Intelligent correction method for measurement data of water quality instrument in response to sudden water quality change

By monitoring and dynamically analyzing water quality data in real time, identifying and reconstructing sudden abnormal data segments, the problem of lag and misjudgment in traditional water quality instruments when responding to sudden changes in water quality is solved, and efficient and accurate water quality monitoring and correction are achieved.

CN121210936BActive Publication Date: 2026-03-31HANGZHOU JIASHU ENVIRONMENTAL MONITORING CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-12-01
Publication Date
2026-03-31

AI Technical Summary

Technical Problem

Traditional water quality instruments suffer from response lag and misjudgment/missed judgment when responding to sudden changes in water quality. Furthermore, they lack correlation analysis with environmental factors, resulting in calibration data that does not match the actual water quality conditions, thus affecting the real-time performance and accuracy of water quality monitoring.

Method used

By monitoring water quality data in real time, identifying abrupt changes, and combining sliding window and dynamic fluctuation index calculations, suddenness verification is performed, abnormal data segments are reconstructed, and formatted to generate correction results.

Benefits of technology

It significantly improves the automation efficiency and response speed of water quality anomaly monitoring, ensures the accuracy and practicality of correction data, meets real-time processing needs, and provides accurate data support for water quality assessment and decision-making.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121210936B_ABST
    Figure CN121210936B_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of computer, disclose a water quality instrument measurement data intelligent correction method in response to sudden water quality change, the method comprises: real-time monitoring the water quality data of target water area, obtain the original data sequence of the target water area;The original data sequence is carried out mutation feature identification, obtain the candidate abnormal section of the original data sequence;The candidate abnormal section is carried out suddenness verification, obtain the sudden abnormal data section in the candidate abnormal section;The data reconstruction is carried out to the sudden abnormal data section, obtain the corrected data sequence;The formatted processing is carried out to the corrected data sequence, obtain the final correction result of the target water area in response to water quality change, the present application can improve the automation efficiency and response speed of water quality abnormal monitoring and data processing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer technology, and in particular to an intelligent correction method for water quality instrument measurement data in response to sudden changes in water quality. Background Technology

[0002] In the field of water quality monitoring, traditional water quality instrument measurement data processing methods exhibit a significant lag in response to sudden changes in water quality. Existing technologies mostly rely on fixed thresholds or simple statistical models to identify data anomalies, making it difficult to dynamically adapt to the water quality fluctuation patterns of different water areas. This results in the inability to quickly and accurately distinguish between instrument measurement errors and actual water quality anomalies when water quality parameters change suddenly, often leading to missed or incorrect anomaly detections, which in turn affects the timeliness of subsequent water quality assessments and decisions.

[0003] Meanwhile, existing technologies lack correlation analysis with environmental factors in the data correction process, only correcting isolated water quality measurements and ignoring the impact of environmental factors such as water temperature, flow rate, and pollutant discharge on water quality changes. This singular data processing model results in discrepancies between the corrected data and the actual water quality, failing to provide accurate data support for water quality supervision. Furthermore, the numerous manual interventions and low level of automation further reduce the efficiency of emergency response to water quality anomalies, making it difficult to meet the demands for both real-time and accurate water quality monitoring. Therefore, improving the automation efficiency and response speed of water quality anomaly monitoring and data processing has become an urgent problem to be solved. Summary of the Invention

[0004] This invention provides an intelligent correction method for water quality instrument measurement data in response to sudden changes in water quality, in order to solve the problems mentioned in the background art.

[0005] To achieve the above objectives, the present invention provides an intelligent correction method for water quality instrument measurement data in response to sudden changes in water quality, comprising:

[0006] S1. Real-time monitoring of water quality data in the target water area to obtain the original data sequence of the target water area;

[0007] S2. Perform mutation feature identification on the original data sequence to obtain candidate abnormal segments of the original data sequence;

[0008] S3. Perform burst verification on the candidate abnormal segments to obtain burst abnormal data segments in the candidate abnormal segments;

[0009] S4. Reconstruct the data from the sudden abnormal data segment to obtain the corrected data sequence;

[0010] S5. The corrected data sequence is formatted to obtain the final correction result of the target water area in response to water quality changes.

[0011] In a preferred embodiment, the real-time monitoring of water quality data of the target water area to obtain the original data sequence of the target water area includes:

[0012] Based on a preset data interface, a data connection is established with the water quality instruments deployed in the target water area to obtain the monitoring data stream of the water quality instruments deployed in the target water area;

[0013] The monitoring data stream is processed in chronological order to obtain standardized data blocks for the water quality instrument.

[0014] The standardized data blocks are spliced ​​and combined in chronological order of collection to obtain the original data sequence of the water quality instrument.

[0015] In a preferred embodiment, the step of identifying mutation features in the original data sequence to obtain candidate anomalous segments of the original data sequence includes:

[0016] The original data sequence is segmented based on a sliding window to obtain continuous data segments of the original data sequence;

[0017] The statistical characteristics of the data within the continuous data segments are calculated to obtain the statistical sequence of the original data sequence;

[0018] Based on historical data of the target water area, the statistical sequence is compared with a preset dynamic threshold to obtain the preliminary outlier segments of the original data sequence;

[0019] The initial abnormal segment is subjected to a neighborhood continuity check to obtain candidate abnormal segments of the original data sequence.

[0020] In a preferred embodiment, calculating the statistical characteristics of the data within the continuous data segments to obtain the statistical sequence of the original data sequence includes:

[0021] Extract the monitoring data values ​​of the data points in the continuous data segment;

[0022] Based on the dynamic fluctuation index calculation formula, the degree of abrupt change tendency of the monitored data values ​​is assessed to obtain the statistical characteristics of the continuous data segment. The dynamic fluctuation index calculation formula is as follows:

[0023] ;

[0024] in, This represents the dynamic fluctuation index of the continuous data segment. This represents the total number of data points within the continuous data segment. Indicates the first [number]th ... Monitoring data values ​​of each data point This represents the arithmetic mean of all monitored data values ​​within the continuous data segment. This represents the maximum value of the monitored data within the continuous data segment. This represents the minimum value of the monitored data within the continuous data segment;

[0025] The dynamic fluctuation indexes of the continuous data segments are arranged in chronological order to obtain the statistical sequence of the original data sequence.

[0026] In a preferred embodiment, the candidate anomaly segments are subjected to burst verification to obtain bursty anomaly data segments among the candidate anomaly segments, including:

[0027] Obtain environmental factor monitoring data for the time period corresponding to the candidate anomaly segment;

[0028] The candidate anomaly segments are analyzed for change trends to obtain the water quality temporal change characteristics of the candidate anomaly segments;

[0029] Based on the change patterns of key environmental parameters, feature extraction is performed on the environmental factor monitoring data to obtain the environmental factor change characteristics of the candidate anomaly segment;

[0030] The temporal variation characteristics of water quality are coupled with the variation characteristics of environmental factors for correlation analysis.

[0031] Based on the results of the coupling correlation analysis, the suddenness verification of the data changes and environmental factor changes of the candidate anomaly segment is performed. When the results of the suddenness verification of the water quality time series changes and environmental factor changes are inconsistent, the sudden anomaly data segment of the candidate anomaly segment is obtained.

[0032] In a preferred embodiment, the step of performing a coupling correlation analysis between the water quality temporal variation characteristics and the environmental factor variation characteristics includes:

[0033] Key feature parameters are extracted from the water quality temporal change characteristics and the environmental factor change characteristics to obtain the water quality temporal change feature vector and the environmental factor change feature vector of the candidate anomaly segment;

[0034] Calculate the dynamic weighted coupling coefficient between the water quality time-series change feature vector and the environmental factor change feature vector;

[0035] The dynamic weighted coupling coefficient is compared with a preset coupling threshold. When the dynamic weighted coupling coefficient is less than the preset coupling threshold, the sudden abnormal data segment of the candidate abnormal segment is obtained.

[0036] In a preferred embodiment, the formula for calculating the dynamic weighted coupling coefficient is:

[0037] ;

[0038] in, This represents the dynamic weighted coupling coefficient between the water quality time-series change feature vector and the environmental factor change feature vector. This represents the total number of feature points within the candidate anomaly segment. Indicates the candidate anomaly segment number 1 Water quality temporal variation characteristic values ​​at each characteristic point Indicates the first Characteristic values ​​of environmental factor changes at each characteristic point Indicates the candidate anomaly segment number 1 Temporal weighting coefficients for each feature point This represents the mean of the water quality time-series variation characteristic values. This represents the mean value of the characteristic values ​​of the changes in the environmental factors.

[0039] In a preferred embodiment, the step of reconstructing the abruptly abnormal data segment to obtain a corrected data sequence includes:

[0040] Based on the normal monitoring data of adjacent time periods of the sudden abnormal data segment, reconstructed reference data for the sudden abnormal data segment is generated;

[0041] Based on the statistical characteristics of the reconstructed reference data, the reconstructed reference data is reconstructed to obtain the parameter range of the reconstructed reference data;

[0042] Based on the parameter range, the abnormal data values ​​in the sudden abnormal data segment are replaced point by point to obtain the reconstructed data points of the sudden abnormal data segment.

[0043] The reconstructed data points are arranged and combined according to the original timestamp order to obtain the reconstructed data segment of the sudden anomaly data segment;

[0044] The reconstructed data segment and the original normal data segment are integrated in a time sequence to obtain the corrected data sequence of the sudden abnormal data segment.

[0045] In a preferred embodiment, generating reconstruction reference data for the sudden anomaly data segment based on normal monitoring data from adjacent time periods includes:

[0046] Extract normal monitoring data for a first predetermined time length prior to the sudden abnormal data segment to obtain the forward reference data of the sudden abnormal data segment;

[0047] Extract normal monitoring data for a second predetermined time length following the sudden abnormal data segment to obtain the backward reference data of the sudden abnormal data segment;

[0048] The forward reference data and the backward reference data are merged to obtain the reconstruction reference data for the sudden anomaly data segment.

[0049] In a preferred embodiment, the step of formatting the corrected data sequence to obtain the final correction result for the target water area in response to water quality changes includes:

[0050] The corrected data sequence of the sudden anomaly data segment is used as the formatted data of the sudden anomaly data segment;

[0051] The data to be formatted is encapsulated in chronological order to obtain a standardized data packet of the sudden abnormal data segment;

[0052] Add the verification identifier and data source identifier to the standardized data packet data to obtain the transmission ready data for the sudden abnormal data segment;

[0053] Based on the communication protocol format supported by the water quality instrument, the transmission-ready data is format-converted to obtain the final correction result of the target water area in response to water quality changes.

[0054] Compared with the prior art, the present invention has the following beneficial effects:

[0055] 1. Significantly improve the automation efficiency and response speed of water quality anomaly monitoring and data processing: Obtain raw data sequences through real-time monitoring, combine sliding window segmentation and dynamic fluctuation index calculation to achieve accurate identification of abrupt change characteristics, and then complete the suddenness verification through time series correlation and environmental factor coupling analysis. Reduce manual intervention, quickly locate sudden abnormal data segments, solve the problems of response lag and anomaly misjudgment and omission in traditional methods, and meet the real-time processing needs of sudden water quality changes.

[0056] 2. Ensuring the accuracy and usability of corrected data: The data reconstruction process generates reference data based on adjacent normal data of the abnormal segment, replaces outliers point by point according to statistical characteristics and integrates them in time sequence to ensure that the corrected data conforms to the actual water quality patterns; the formatting process adds verification and source identification and adapts to the system communication protocol, so that the final result can be directly used for water quality supervision, solving the problems of traditional correction ignoring environmental factors, large data deviations and low usability, and providing accurate data support for water quality assessment and decision-making. Attached Figure Description

[0057] Figure 1This is a flowchart illustrating an intelligent correction method for water quality instrument measurement data in response to sudden changes in water quality, provided in an embodiment of the present invention.

[0058] The realization of the objective, functional features and advantages of the present invention will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation

[0059] It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.

[0060] This application provides an intelligent correction method for water quality instrument measurement data in response to sudden changes in water quality. The executing entity of this intelligent correction method for water quality instrument measurement data in response to sudden changes in water quality includes, but is not limited to, at least one of the following electronic devices that can be configured to execute the method provided in this application: a server, a terminal, etc. In other words, the intelligent correction method for water quality instrument measurement data in response to sudden changes in water quality can be executed by software or hardware installed on a terminal device or a server device. The server includes, but is not limited to, a single server, a server cluster, a cloud server, or a cloud server cluster. The server can be an independent server or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms.

[0061] Reference Figure 1 The diagram shown is a flowchart illustrating an intelligent correction method for water quality instrument measurement data in response to sudden water quality changes, according to an embodiment of the present invention. In this embodiment, the intelligent correction method for water quality instrument measurement data in response to sudden water quality changes includes:

[0062] S1. Real-time monitoring of water quality data in the target water area to obtain the original data sequence of the target water area;

[0063] In this embodiment of the invention, the real-time monitoring of water quality data of the target water area to obtain the original data sequence of the target water area includes:

[0064] Based on a preset data interface, a data connection is established with the water quality instruments deployed in the target water area to obtain the monitoring data stream of the water quality instruments deployed in the target water area;

[0065] The monitoring data stream is processed in chronological order to obtain standardized data blocks for the water quality instrument.

[0066] The standardized data blocks are spliced ​​and combined in chronological order of collection to obtain the original data sequence of the water quality instrument.

[0067] Specifically, the entire implementation process revolves around the acquisition and processing of water quality instrument data in the target water area. First, a connection is established with the water quality instrument based on a preset data interface to obtain the monitoring data stream. Then, the monitoring data stream format is unified according to the time sequence to form standardized data blocks. Finally, the standardized data blocks are spliced ​​together according to the collection time to obtain the original data sequence.

[0068] Furthermore, when obtaining preset data interface parameters, operators open the configuration document of the water quality monitoring system, find parameters such as interface type and communication baud rate in the "Interface Configuration" section, and record them one by one to ensure that the parameter information is accurate.

[0069] Furthermore, when connecting the water quality meter to the data acquisition terminal, select a dedicated data cable that matches the interface type. Align one end of the cable with the pins of the water quality meter's communication interface, slowly insert it, and ensure the clip is securely fastened. Similarly, firmly insert the other end into the corresponding interface of the data acquisition terminal to avoid affecting data transmission due to poor contact.

[0070] Furthermore, when configuring parameters in the data acquisition terminal software, open the software's "Device Connection" interface, and fill in the recorded interface type, baud rate, and other parameters in the corresponding input boxes in sequence. Check each item after filling it in, and click the "Connect" button after confirming that it is correct. If the software prompts "Connection failed", recheck whether the parameter input is consistent with the configuration document, and at the same time unplug and plug the connection cable to ensure good contact until the software displays "Connection successful".

[0071] Furthermore, after a successful connection, the water quality instrument will automatically send data according to its set monitoring interval, such as once every 3 minutes. The data acquisition terminal receives these continuous data in real time, which include timestamps such as 2025-09-17 10:00:00 and indicators such as pH value and dissolved oxygen content. These real-time received continuous data are the monitoring data stream of the water quality instrument deployed in the target water area.

[0072] Furthermore, when parsing the original format of the monitoring data stream, open the data stream file with a text viewer, observe the data structure line by line, and record the characteristics of different formats. For example, some data uses commas to separate fields, some uses spaces, and some indicator names are abbreviated, such as "DO" to represent dissolved oxygen content.

[0073] Furthermore, when determining a unified data format standard, the general specifications of the water quality monitoring industry are referenced, and the timestamp format is specified as “YYYY-MM-DDHH:MM:SS”, the full name of the indicator is used, such as “dissolved oxygen content” instead of “DO”, and the field separator is uniformly “|”, forming a standard format specification document for subsequent conversion.

[0074] Furthermore, when converting the data format, the monitoring data stream is read line by line. For each data point, the timestamp is extracted first, and then corrected according to the standard format, such as changing "202509171000" to "2025-09-1710:00:00". Next, the indicator name is replaced with the standard full name, and finally the separator is uniformly changed to "|" to ensure that each data point conforms to the format "timestamp | indicator 1: value 1 | indicator 2: value 2".

[0075] Furthermore, after the data format conversion is completed, the data is sorted in ascending order by the "timestamp" column in the data processing table. All sorted data is then divided into groups of 50, and each group of data is saved as an independent TXT file. Each TXT file is a standardized data block of the water quality instrument.

[0076] Furthermore, when extracting the standardized data block collection time, each data block file is opened, the timestamp of the first data is read, and the timestamp is associated with the data block file name and recorded in a table for easy sorting later.

[0077] Furthermore, when preparing a blank text file, create a new TXT file named "Original Data Sequence" in the data storage directory, ensuring that the file path contains no special characters to avoid reading errors during subsequent concatenation.

[0078] Furthermore, when splicing standardized data blocks, according to the recorded time order, first open the first data block file, select all the content and copy it to the "Original Data Sequence" file, and then view the timestamp of the last data in the data block, such as 2025-09-17 10:24:00.

[0079] Next, open the next data block file and confirm that the timestamp of its first data entry, such as 2025-09-17 10:27:00, is later than the last timestamp of the previous data block. Then copy the contents of this data block to the end of the "Original Data Sequence" file and complete the splicing of all data blocks in sequence.

[0080] Furthermore, after the splicing is completed, the "raw data sequence" file is checked line by line. If two data points are found to have the same timestamp and all indicator values, one of them is deleted directly. The final saved file is the raw data sequence of the water quality instrument.

[0081] In summary, the process involves establishing a connection with water quality meters based on a preset data interface to obtain monitoring data streams. This includes first acquiring interface parameters, connecting the device and configuring the parameters, and then receiving data sent in real time by the meter after a successful connection. The final result is the monitoring data stream of the water quality meters deployed in the target water area.

[0082] In general, the process of obtaining standardized data blocks by unifying the monitoring data stream format according to time sequence involves first parsing the original format and determining the unified standard, then converting the format line by line and sorting it, and finally grouping it into standardized data blocks by a fixed number of entries.

[0083] In general, the process of splicing standardized data blocks according to the collection time to obtain the original data sequence is to first determine the order of the data blocks, prepare blank files, then splice the data blocks in sequence and delete duplicate data, and finally form the original data sequence of water quality instruments.

[0084] S2. Perform mutation feature identification on the original data sequence to obtain candidate abnormal segments of the original data sequence;

[0085] In this embodiment of the invention, the step of identifying mutation features in the original data sequence to obtain candidate anomalous segments of the original data sequence includes:

[0086] The original data sequence is segmented based on a sliding window to obtain continuous data segments of the original data sequence;

[0087] The statistical characteristics of the data within the continuous data segments are calculated to obtain the statistical sequence of the original data sequence;

[0088] Based on historical data of the target water area, the statistical sequence is compared with a preset dynamic threshold to obtain the preliminary outlier segments of the original data sequence;

[0089] The initial abnormal segment is subjected to a neighborhood continuity check to obtain candidate abnormal segments of the original data sequence.

[0090] The calculation of statistical features of the data within the continuous data segments to obtain the statistical sequence of the original data sequence includes:

[0091] Extract the monitoring data values ​​of the data points in the continuous data segment;

[0092] Based on the dynamic fluctuation index calculation formula, the degree of abrupt change tendency of the monitored data values ​​is assessed to obtain the statistical characteristics of the continuous data segment. The dynamic fluctuation index calculation formula is as follows:

[0093] ;

[0094] in, This represents the dynamic fluctuation index of the continuous data segment. This represents the total number of data points within the continuous data segment. Indicates the first [number]th ... Monitoring data values ​​of each data point This represents the arithmetic mean of all monitored data values ​​within the continuous data segment. This represents the maximum value of the monitored data within the continuous data segment. This represents the minimum value of the monitored data within the continuous data segment;

[0095] The dynamic fluctuation indexes of the continuous data segments are arranged in chronological order to obtain the statistical sequence of the original data sequence.

[0096] Specifically, the entire implementation process revolves around obtaining candidate anomaly segments from the original data sequence. First, the original data is segmented based on a sliding window to obtain continuous data segments. Then, the statistical features of the segments are calculated to obtain a statistical sequence. Next, the statistical sequence is compared with a preset dynamic threshold to obtain preliminary anomaly segments. Finally, a neighborhood continuity check is performed on the preliminary anomaly segments to obtain candidate anomaly segments.

[0097] Furthermore, when segmenting the original data using a sliding window, the length of the sliding window is first determined, for example, based on the temporal resolution of the original data and actual needs, the window is set to contain 10 data points; then the sliding step size is determined and set to 1 data point. Then, starting from the beginning of the original data sequence, the portion containing 10 data points is taken as the first continuous data segment. After that, the window moves forward by 1 data point each time, and new portions containing 10 data points are taken as subsequent continuous data segments, until all the original data is processed and continuous data segments of the original data sequence are obtained.

[0098] Furthermore, when calculating the statistical characteristics of continuous data segments, for each continuous data segment, the mean is calculated by adding all the data within the segment and then dividing by the number of data points; the variance is calculated by first finding the square of the difference between each data point and the mean, then adding them together and dividing by the number of data points minus 1; the maximum value is found by iterating through all the data within the segment; and the minimum value is found by iterating through all the data within the segment. The mean, variance, maximum value, and minimum value calculated for each segment are arranged in order to form the statistical sequence of the original data sequence.

[0099] Furthermore, when comparing the statistical sequence with the preset dynamic threshold, historical data of the target water area over the past year is first collected. Using the same sliding window segmentation and statistical characteristic calculation method, the statistical sequence of the historical data is obtained. Next, the distribution of the historical data statistical sequence is analyzed to determine the normal fluctuation range of each statistical characteristic (mean, variance, maximum, minimum), and the upper and lower limits of this range are set as preset dynamic thresholds. Then, each statistical characteristic value in the original data sequence is compared with the corresponding preset dynamic threshold. If a statistical characteristic value exceeds the corresponding dynamic threshold range, the original data position corresponding to the continuous data segment containing that statistical characteristic is marked as an outlier. Finally, the original data portion corresponding to the continuous outliers is determined as the preliminary outlier segment of the original data sequence.

[0100] Furthermore, when performing a neighborhood continuity check on the initial anomaly segment, the neighborhood range is first determined by extending the range of two data points in front and behind each data point in the initial anomaly segment as the center. Then, each data point in the initial anomaly segment is checked to see if other data points in its neighborhood also belong to the initial anomaly segment. If more than half of the other data points in the neighborhood of a data point belong to the initial anomaly segment, the data point is considered to be continuously anomaly. Finally, the continuous anomaly data segments that pass the neighborhood continuity check are identified as candidate anomaly segments of the original data sequence.

[0101] Specifically, the entire process revolves around generating a statistical sequence from continuous data segments to the original data sequence. First, the monitoring data values ​​of the data points in the continuous data segments are extracted. Then, the degree of mutation tendency is evaluated based on the dynamic fluctuation index calculation formula to obtain statistical characteristic quantities. Finally, the dynamic fluctuation index is arranged in time order to obtain the statistical sequence.

[0102] Furthermore, when extracting the monitoring data values ​​of data points in continuous data segments, the file storing the continuous data segments is opened. Each segment contains multiple data points with timestamps and monitoring data values ​​in chronological order. The segment content is read line by line, and only the monitoring data values ​​are extracted. All monitoring data values ​​of the same segment are then organized into a set.

[0103] Furthermore, when assessing the degree of abrupt change tendency based on the dynamic volatility index calculation formula, the source of each parameter should first be clarified: It involves counting the total number of data points within a continuous data segment, one by one. It retrieves the first data segment within a continuous data sub-segment. Monitoring data from each data point; It is to include all data within a continuous data segment. Add and then divide The obtained arithmetic mean; It compares all within the sub-segment Find the maximum value; It compares all within the sub-segment Find the minimum value. Then, combine these parameters to calculate the dynamic fluctuation index. This index serves as a statistical characteristic of continuous data segments, reflecting the degree of abrupt changes in the data segment and measuring data fluctuation. The higher the dispersion of data within a segment and the greater the difference between the maximum and minimum values, the larger the dynamic fluctuation index, and vice versa.

[0104] Furthermore, when arranging the dynamic volatility index in chronological order, based on the timestamp of the first data point in each continuous data segment, all segments are sorted from earliest to latest time, and then the dynamic volatility indices corresponding to each segment are listed in sequence to form a dynamic volatility index sequence arranged in chronological order, which is the statistical sequence of the original data sequence.

[0105] In summary, the process of segmenting the original data sequence into continuous data segments based on a sliding window involves first determining the window length and step size, and then extracting data segments by sliding the window.

[0106] In general, calculating the statistical characteristics of data within a continuous data segment to obtain a statistical sequence involves calculating the mean, variance, maximum, minimum, and other characteristic quantities for each segment, and then arranging them in order to obtain the statistical sequence.

[0107] In general, the process of comparing the statistical sequence with a preset dynamic threshold based on historical data of the target water area to obtain preliminary outlier segments involves first processing historical data to obtain a statistical sequence and determining the dynamic threshold, then comparing the original data statistics with the threshold, marking outlier points, and determining preliminary outlier segments.

[0108] In general, the process of checking the continuity of the neighborhood of the preliminary outlier segment to obtain candidate outlier segments involves first determining the neighborhood range, then checking for anomalies within the neighborhood of the data point, and finally identifying continuous and compliant outlier data segments as candidate outlier segments.

[0109] In general, extracting monitoring data values ​​from data points in a continuous data segment involves opening the storage file, reading the segment content line by line, extracting the monitoring data values, and organizing them into a set.

[0110] In summary, assessing the degree of mutation tendency based on the dynamic volatility index calculation formula to obtain statistical characteristics involves first clarifying the source of each parameter, and then combining the parameters to calculate the dynamic volatility index, thereby reflecting the mutation tendency and volatility of the sub-segment data.

[0111] In general, the process of arranging dynamic volatility indices in chronological order to obtain the statistical sequence of the original data sequence is to sort the sub-segments according to the timestamp of the first data point of each sub-segment, and then list the dynamic volatility indices in sequence to form the sequence.

[0112] S3. Perform burst verification on the candidate abnormal segments to obtain burst abnormal data segments in the candidate abnormal segments;

[0113] In this embodiment of the invention, burst verification is performed on the candidate anomalous segments to obtain bursty anomalous data segments among the candidate anomalous segments, including:

[0114] Obtain environmental factor monitoring data for the time period corresponding to the candidate anomaly segment;

[0115] The candidate anomaly segments are analyzed for change trends to obtain the water quality temporal change characteristics of the candidate anomaly segments;

[0116] Based on the change patterns of key environmental parameters, feature extraction is performed on the environmental factor monitoring data to obtain the environmental factor change characteristics of the candidate anomaly segment;

[0117] The temporal variation characteristics of water quality are coupled with the variation characteristics of environmental factors for correlation analysis.

[0118] Based on the results of the coupling correlation analysis, the suddenness verification of the data changes and environmental factor changes of the candidate anomaly segment is performed. When the results of the suddenness verification of the water quality time series changes and environmental factor changes are inconsistent, the sudden anomaly data segment of the candidate anomaly segment is obtained.

[0119] The coupling and correlation analysis of the water quality temporal variation characteristics and the environmental factor variation characteristics includes:

[0120] Key feature parameters are extracted from the water quality temporal change characteristics and the environmental factor change characteristics to obtain the water quality temporal change feature vector and the environmental factor change feature vector of the candidate anomaly segment;

[0121] Calculate the dynamic weighted coupling coefficient between the water quality time-series change feature vector and the environmental factor change feature vector;

[0122] The dynamic weighted coupling coefficient is compared with a preset coupling threshold. When the dynamic weighted coupling coefficient is less than the preset coupling threshold, the sudden abnormal data segment of the candidate abnormal segment is obtained.

[0123] The formula for calculating the dynamic weighted coupling coefficient is as follows:

[0124] ;

[0125] in, This represents the dynamic weighted coupling coefficient between the water quality time-series change feature vector and the environmental factor change feature vector. This represents the total number of feature points within the candidate anomaly segment. Indicates the candidate anomaly segment number 1 Water quality temporal variation characteristic values ​​at each characteristic point Indicates the first Characteristic values ​​of environmental factor changes at each characteristic point Indicates the candidate anomaly segment number 1 Temporal weighting coefficients for each feature point This represents the mean of the water quality time-series variation characteristic values. This represents the mean value of the characteristic values ​​of the changes in the environmental factors.

[0126] Specifically, the entire implementation process revolves around the sudden verification of candidate anomaly segments. First, environmental factor monitoring data for the corresponding time period is obtained. Then, the water quality time-series change characteristics are analyzed from the candidate anomaly segments. Next, the environmental factor change characteristics are extracted. Then, coupling correlation analysis is performed. Finally, the sudden verification is completed based on the analysis results to determine the sudden anomaly data segment.

[0127] Furthermore, when acquiring environmental factor monitoring data, determining the time range of candidate anomaly periods requires checking the timestamp records of the water quality data. For example, find the candidate anomaly period in the water quality data file with a start time of 9:00 and an end time of 9:30 on the same day to accurately determine the time interval.

[0128] Furthermore, when locating the data storage location of environmental factor monitoring equipment, log in to the target water area environmental monitoring management platform, and in the "Equipment Data Archive" module, find the corresponding data storage path according to the equipment name, such as "East Zone Anemometer" or "North Zone Precipitation Sensor," to ensure that the required data can be quickly located.

[0129] Furthermore, when operating the query interface of the environmental factor monitoring system, first select the "Query by time period" option, enter 9:00 in the start time box and 9:30 in the end time box, then check "wind speed", "precipitation" and "water temperature" in the factor type list in turn, click "Query" and wait for the system to load the data.

[0130] Furthermore, after the data is loaded, check the timestamp of each data point line by line to confirm that they are all between 9:00 and 9:30, and that the values ​​of wind speed, precipitation, and water temperature are not missing. After confirming that everything is correct, click the "Export Excel" button to save the data to the specified folder. This Excel file is the required environmental factor monitoring data.

[0131] Furthermore, when analyzing the changing trends of candidate anomaly segments, open the water quality data file of the candidate anomaly segments, copy the data into an Excel spreadsheet, fill in the timestamp in the first column, and fill in the values ​​of water quality indicators such as pH value and dissolved oxygen content in the subsequent columns to ensure that the data corresponds one-to-one with the timestamp.

[0132] Furthermore, when drawing a line chart in Excel, select the timestamp column and a water quality indicator column such as the pH value column, click the "Line Chart" option in the "Insert" menu to generate a line chart of the time change of that indicator, and generate line charts for all water quality indicators in the same way.

[0133] Furthermore, when observing the line graph, record the changes in the indicator values ​​within each time period. For example, the pH value drops from 7.5 to 6.0 from 9:00 to 9:10, remains stable from 9:10 to 9:30, and the dissolved oxygen content continues to decrease. These detailed patterns of change are summarized to form the water quality time-series change characteristics.

[0134] Furthermore, when extracting the characteristics of environmental factor changes, the specific content of the change pattern of key environmental parameters should be clarified first. For example, the fluctuation range should be calculated as the difference between the maximum and minimum values ​​within 10 minutes, the rate of change should be calculated as the change in value within 10 minutes, and the sudden change situation should be checked to see if there is a sudden increase or decrease in value.

[0135] Furthermore, open the environmental factor monitoring data file and divide the data into 10-minute intervals, such as 9:00-9:10, 9:10-9:20, and 9:20-9:30. Calculate the difference between the maximum and minimum wind speed in each interval. For example, the maximum wind speed in the 9:00-9:10 interval is 3 m / s, the minimum is 2 m / s, and the fluctuation range is 1 m / s.

[0136] Furthermore, when calculating the rate of change, the starting value is subtracted from the ending value of each interval, and then divided by 10 minutes. For example, if the water temperature is 25℃ at 9:00 and 26℃ at 9:30, the total change is 1℃, and the rate of change is 0.33℃ every 10 minutes. At the same time, the precipitation data is checked to be 0mm, with no sudden changes. This information is then processed to form the characteristics of environmental factor changes.

[0137] Furthermore, when conducting coupling correlation analysis, the time-series changes in water quality and the changes in environmental factors are first compiled into text lists to clearly present the details of their changes, facilitating subsequent comparisons.

[0138] Furthermore, when comparing the changes of the two, focusing on the same time period such as 9:00-9:10, the water quality indicators dropped rapidly while the environmental factors remained stable, indicating that the two were not related. Logically, the absence of precipitation would not cause a sudden drop in pH, and a gradual increase in water temperature would not cause a significant drop in dissolved oxygen, further confirming the lack of correlation and completing the coupling correlation analysis.

[0139] Furthermore, when conducting sudden verification, the specific details of the verification standard should be clarified first. Sudden change is defined as an index value change exceeding the normal range within a short period of time, such as a pH value change exceeding 1.0, while the environmental factor does not change accordingly, meaning that the change in environmental factor is within the normal range.

[0140] Furthermore, based on the results of the coupling correlation analysis, the water quality index changed by more than 1.5 pH values ​​within 10 minutes, which is considered a sudden change. However, the changes in environmental factors were all within the normal range and there were no sudden changes. The verification results were inconsistent with the standard.

[0141] Furthermore, since the verification results were inconsistent, it indicates that the water quality data anomaly was not caused by environmental factors, which meets the criteria for sudden anomaly. Therefore, this candidate anomaly segment was identified as a sudden anomaly data segment.

[0142] Specifically, the entire implementation process revolves around the suddenness determination of candidate anomaly segments. First, key parameters are extracted from the time-series change characteristics of water quality and the change characteristics of environmental factors to obtain the corresponding feature vectors. Then, the dynamic weighted coupling coefficient of the two is calculated. Finally, the coefficient is compared with the preset threshold to determine whether the candidate anomaly segment is a sudden anomaly data segment.

[0143] Furthermore, when extracting key characteristic parameters, we first sort out the core information of the water quality time-series change characteristics and identify the key parameters as the change range and rate of change of each water quality index. For example, if the pH value drops from 7.5 to 6.0 within 10 minutes, the change range is 1.5 and the change rate is 0.15 per minute.

[0144] Furthermore, by sorting out the core information of the environmental factors’ change characteristics, the key parameters were determined to be the fluctuation range and stability duration of each environmental factor. For example, the wind speed had a maximum value of 3 m / s and a minimum value of 2.5 m / s within 10 minutes, with a fluctuation range of 0.5. The precipitation was 0 mm within 30 minutes, with a stability duration of 30 minutes.

[0145] Furthermore, fixed position numbers are assigned to key parameters. Water quality time-series change characteristic parameters are sorted in the order of "pH value change amplitude, pH value change rate, dissolved oxygen change amplitude, dissolved oxygen change rate", and environmental factor change characteristic parameters are sorted in the order of "wind speed fluctuation amplitude, precipitation stability duration, and water temperature change rate" to ensure that the extraction time sequence number corresponds consistently each time.

[0146] Furthermore, the specific values ​​of each key parameter are arranged sequentially by number to form an ordered numerical sequence. For example, the numerical sequence of water quality time-series change characteristics is "1.5, 0.15 / min, 4.0, 0.4 mg / (L・min)", and the numerical sequence of environmental factor change characteristics is "0.5, 30 min, 0.03℃ / min". These two ordered sequences are the water quality time-series change characteristic vector and the environmental factor change characteristic vector, respectively.

[0147] Furthermore, when calculating the dynamic weighted coupling coefficient, the weights of each key parameter are first determined and allocated according to the degree of influence of the parameter on water quality anomalies. For example, the changes in pH value and dissolved oxygen have a greater impact on water quality anomalies, and each is allocated a weight of 0.3. The fluctuations in wind speed and the duration of stable precipitation have a lesser impact, and each is allocated a weight of 0.2.

[0148] Furthermore, the weighted values ​​of the water quality time-series change feature vector are calculated by multiplying each parameter value by its corresponding weight. For example, the pH value change range is 1.5 × 0.3 = 0.45, and the dissolved oxygen change range is 4.0 × 0.3 = 1.2. The weighted values ​​of all parameters are added together to obtain the weighted sum of water quality features. Assuming that the sum of the weighted values ​​of other parameters is 0.85, the total weighted sum is 0.45 + 1.2 + 0.85 = 2.5.

[0149] Furthermore, the weighted values ​​of the characteristic vector of environmental factor changes are calculated using the same method. The wind speed fluctuation amplitude is 0.5×0.2=0.1, the precipitation stability duration is 30×0.2=6, and the sum of the weighted values ​​of other parameters is 0.9. The total weighted sum is 0.1+6+0.9=7.0.

[0150] Furthermore, the ratio of the weighted sum of the two is calculated by dividing the weighted sum of water quality characteristics by the weighted sum of environmental characteristics, i.e., 2.5 ÷ 7.0 ≈ 0.36. This ratio is the dynamic weighted coupling coefficient between the water quality time-series change feature vector and the environmental factor change feature vector.

[0151] Furthermore, when determining the preset coupling threshold, water quality and environmental factor data of the target water area during periods without abnormalities in the past year are collected, the coupling coefficient of each normal period is calculated, the distribution of these coefficients is statistically analyzed, and the minimum value of 0.6 among the coupling coefficients of 95% of normal periods is determined as the preset coupling threshold to ensure that the threshold can effectively distinguish between normal and abnormal coupling situations.

[0152] Furthermore, the calculated dynamic weighted coupling coefficient of 0.36 was obtained and compared with the preset coupling threshold of 0.6 to determine whether 0.36 is less than 0.6. The comparison confirmed that 0.36 is less than 0.6, indicating that the coupling degree between water quality and environmental factor changes is lower than the normal level and the correlation is weak.

[0153] Furthermore, since the coupling coefficient is less than the threshold, it indicates that the water quality anomaly is not caused by changes in environmental factors, which meets the criteria for sudden anomaly. Therefore, the candidate anomaly segment is determined as a sudden anomaly data segment, and thus the sudden anomaly data segment of the candidate anomaly segment is obtained.

[0154] Specifically, the entire content revolves around the calculation formula for the dynamic weighted coupling coefficient, covering three aspects: the source of parameters, the meaning of the formula, and the trend of the formula, with each part clearly explained.

[0155] Furthermore, parameters The source is the total number of feature points within the candidate anomaly segments. This requires counting each feature point contained in a candidate anomaly segment; the final determined total is... .

[0156] Furthermore, The source is the acquisition of candidate anomaly segments. The water quality time-series change characteristic value corresponding to each characteristic point is obtained by real-time collection of water quality data of that characteristic point by monitoring equipment or by retrieving water quality data from historical monitoring databases and then processing the data.

[0157] Furthermore, The source is the acquisition of candidate anomaly segments. The characteristic values ​​of environmental factor changes corresponding to each characteristic point are obtained by collecting data through environmental factor monitoring equipment or by extracting environmental factor data for that characteristic point from relevant databases.

[0158] Furthermore, The source is based on the candidate anomaly segment. The importance of each feature point in time is determined, and the influence of the time of the feature point on changes in water quality and environmental factors is analyzed, and then corresponding weight values ​​are assigned.

[0159] Furthermore, The source is the mean value of the characteristic values ​​of water quality changes over time, which is used to calculate all... Add the values ​​together, then divide by . The result is .

[0160] Furthermore, The source is the mean value of the characteristic values ​​of environmental factor changes, which is used to calculate all... Add the values ​​together, then divide by . The result obtained is .

[0161] Furthermore, the formula signifies the dynamic weighted coupling coefficient between the water quality temporal change feature vector and the environmental factor change feature vector obtained through calculation. This method measures the degree of coupling between the two, and can clarify the close relationship between water quality changes and environmental factor changes within candidate anomaly segments.

[0162] Furthermore, the formula trend reflects that the higher the degree of synergistic change between the time-series characteristic values ​​of water quality and the characteristic values ​​of environmental factors, that is, the more synchronous and correlated their changes, the higher the calculated dynamic weighted coupling coefficient. The larger the change, the greater the change; conversely, the lower the degree of coordinated change between the two, the greater the change. The smaller it is.

[0163] In general, obtaining environmental factor monitoring data corresponding to the candidate anomaly period involves first determining the time range, then finding the data storage location, filtering and querying the data, and exporting it to finally obtain the environmental factor monitoring data.

[0164] In general, the process of analyzing the changing trends of candidate anomaly segments to obtain the time-series characteristics of water quality changes involves first organizing water quality data and drawing line graphs, then observing the line graphs to record the changing patterns, and finally forming the time-series characteristics of water quality changes.

[0165] In general, extracting the characteristics of environmental factor changes based on the change patterns of key environmental parameters involves first identifying the content of the change pattern, then calculating the fluctuation amplitude and rate of change, checking for abrupt changes, and finally compiling the information to obtain the characteristics of environmental factor changes.

[0166] In general, the process of coupling and correlation analysis between the temporal variation characteristics of water quality and the variation characteristics of environmental factors involves first organizing the details of the changes in both, then comparing the changes and analyzing the logical relationship to complete the coupling and correlation analysis.

[0167] In summary, obtaining sudden abnormal data segments through sudden verification based on the results of coupling correlation analysis involves first clarifying the verification criteria, then judging the verification results, and finally determining the sudden abnormal data segments based on the inconsistent results.

[0168] In general, extracting key feature parameters to obtain feature vectors from the temporal variation characteristics of water quality and the variation characteristics of environmental factors involves first identifying the types of key parameters, then assigning serial numbers and arranging the parameter values ​​in sequence to form the feature vectors of temporal variation of water quality and the feature vectors of variation of environmental factors.

[0169] In general, calculating the dynamic weighted coupling coefficient between two feature vectors involves first determining the parameter weights, then calculating the weighted sum of the two features separately, and finally finding the ratio to obtain the dynamic weighted coupling coefficient.

[0170] In general, the process of determining sudden abnormal data segments by comparing the dynamic weighted coupling coefficient with the preset coupling threshold involves first determining the preset threshold, then comparing the coefficient with the threshold, and finally determining the candidate abnormal segment as a sudden abnormal data segment based on the result that the coefficient is less than the threshold.

[0171] In general, the parameters in the formula are determined through statistical methods, data collection, and calculation. , , , , , The values ​​of these parameters.

[0172] In summary, the significance of the formula lies in calculating the dynamic weighted coupling coefficient. This is used to measure the degree of coupling between the feature vector of water quality changes over time and the feature vector of environmental factor changes.

[0173] In general, the formula trend is that the higher the degree of coordinated change between the time-series water quality characteristic values ​​and the environmental factor characteristic values, the higher the dynamic weighted coupling coefficient. The larger it is, the smaller it is.

[0174] S4. Reconstruct the data from the sudden abnormal data segment to obtain the corrected data sequence;

[0175] In this embodiment of the invention, the step of reconstructing the sudden abnormal data segment to obtain the corrected data sequence includes:

[0176] Based on the normal monitoring data of adjacent time periods of the sudden abnormal data segment, reconstructed reference data for the sudden abnormal data segment is generated;

[0177] Based on the statistical characteristics of the reconstructed reference data, the reconstructed reference data is reconstructed to obtain the parameter range of the reconstructed reference data;

[0178] Based on the parameter range, the abnormal data values ​​in the sudden abnormal data segment are replaced point by point to obtain the reconstructed data points of the sudden abnormal data segment.

[0179] The reconstructed data points are arranged and combined according to the original timestamp order to obtain the reconstructed data segment of the sudden anomaly data segment;

[0180] The reconstructed data segment and the original normal data segment are integrated in a time sequence to obtain the corrected data sequence of the sudden abnormal data segment.

[0181] The step of generating reconstruction reference data for the sudden abnormal data segment based on normal monitoring data in adjacent time periods includes:

[0182] Extract normal monitoring data for a first predetermined time length prior to the sudden abnormal data segment to obtain the forward reference data of the sudden abnormal data segment;

[0183] Extract normal monitoring data for a second predetermined time length following the sudden abnormal data segment to obtain the backward reference data of the sudden abnormal data segment;

[0184] The forward reference data and the backward reference data are merged to obtain the reconstruction reference data for the sudden anomaly data segment.

[0185] Specifically, the entire implementation process revolves around the correction of sudden abnormal data segments. First, reconstructed reference data is generated based on normal monitoring data in adjacent time periods. Then, the parameter range is determined based on its statistical characteristics. Next, abnormal data is replaced according to the parameter range to obtain reconstructed data points. Subsequently, the reconstructed data points are arranged according to the original timestamps to form reconstructed data segments. Finally, the reconstructed data segments are integrated with the original normal data segments in time sequence to obtain the corrected data sequence.

[0186] Furthermore, the first step in generating reconstructed reference data is to accurately determine the time range of sudden abnormal data segments. For example, by checking the abnormal alarm records of water quality instruments, it can be determined that the abnormal data segment begins at 8:00 on the same day and ends at 8:30 on the same day. Based on this, adjacent time periods are defined as 7:30-8:00 and 8:30-9:00 on the same day.

[0187] Further, after determining the adjacent time periods, the data retrieval process begins. Operators need to log in to the historical monitoring database of water quality instruments, enter the two time periods 7:30-8:00 and 8:30-9:00 in the search bar of the "Normal Data Archive" module, and check the "Include complete timestamp" and "Include all water quality index values" options. Click the "Search" button, and the system will automatically filter out the monitoring data marked as "normal" within these two time periods. Export these data to Excel files respectively.

[0188] Furthermore, after the data is exported, duplicate data needs to be removed. Open the exported Excel file and check the timestamp of each data line. If two data lines are found to have the same timestamp, such as 20250917074500, and the corresponding pH value, dissolved oxygen content, and other indicators are exactly the same, delete one of the data lines. Continue until there is no duplicate data in the file. Finally, merge the processed valid data from the two time periods into a new Excel file. The data in this file is the reconstruction reference data.

[0189] Furthermore, when determining the parameter range, first classify the reconstructed reference data according to water quality indicators. Open the Excel file containing the reconstructed reference data, copy all pH data to the "pH value" column of the new table, copy the dissolved oxygen content data to the "dissolved oxygen content" column, and complete the data classification of all indicators in sequence.

[0190] Furthermore, after classification, sort the data in each column. Taking the "pH value" column as an example, select all the data in the column, click "Sort" in the "Data" menu of Excel, select "Ascending" sorting method, after sorting, the value of the first cell in the column is the minimum pH value, and the value of the last cell is the maximum pH value. Find the minimum and maximum values ​​of all indicators in the same way.

[0191] Furthermore, calculate the numerical range of each indicator, connecting the minimum and maximum values ​​of each indicator with "-". For example, the minimum value of pH is 6.8 and the maximum value is 7.5, so the range is 6.8-7.5. The minimum value of dissolved oxygen content is 2.1 mg / L and the maximum value is 7.8 mg / L, so the range is 2.1-7.8 mg / L. Compile all the numerical ranges of the indicators into a Word document, and mark the specific time when the parameter range was determined at the end of the document, such as 202509171530. This document is the parameter range for reconstructing the reference data.

[0192] Furthermore, when replacing abnormal data values, first open the text file storing the sudden abnormal data segments, and use Notepad's "view line by line" function to record the indicator type and abnormal value of each data line. For example, if a line of data has the timestamp: 20250917081000; indicator: pH value; value: 5.2, it is necessary to explicitly record the indicator: pH value and the abnormal value: 5.2.

[0193] Further, look up the numerical range of the corresponding index in the parameter range document, find the pH range of 6.8-7.5, calculate the median value of this range, add the minimum value of 6.8 and the maximum value of 7.5 to get 14.3, then divide 14.3 by 2 to get 7.15. Record the calculation process and results on scratch paper to ensure that the calculation is correct.

[0194] Furthermore, returning to the abnormal data text file, change the pH value from 5.2 to 7.15, and add a "[Replaced]" marker to the end of the modified line to avoid repeated modifications later. Replace all abnormal data values ​​one by one using the same process. All the modified abnormal data together constitute the reconstructed data point set.

[0195] Furthermore, when reconstructing data points by permutation and combination, the timestamp of each reconstructed data point is first extracted, and all timestamps are formatted in the same way as "year-month-day hour:minute:second". For example, 20250917081000 is changed to 2025-09-1708:10:00 to ensure that all timestamps are in the same format.

[0196] Next, open Excel and create a new spreadsheet. Enter the timestamps in a uniform format in column A, and enter the corresponding reconstructed data points in column B, such as "pH value: 7.15". After entering all the data, select the data in column A, click "Sort" in the "Data" menu, select "Ascending" to sort, and then delete the blank rows and redundant formatting elements such as merged cells and border lines in the spreadsheet.

[0197] Furthermore, create a new text document. Starting from the first row of the Excel spreadsheet, copy the reconstructed data points from column B into the text document one by one, with each data point occupying a separate row. After copying, save the text document. This document is the reconstructed data segment of the sudden anomaly data segment.

[0198] Furthermore, the first step in time series integration is to determine the time range of the original normal data segment. By examining the naming of data files, such as "Normal data before anomaly - 7:30-8:00.txt" and "Normal data after anomaly - 8:30-9:00.txt", it is clear that the original normal data segment is divided into two parts: before and after the anomaly. The connection order is "Normal data segment before anomaly → Reconstructed data segment → Normal data segment after anomaly".

[0199] Furthermore, open the files for the normal data segment before the anomaly, the reconstructed data segment, and the normal data segment after the anomaly using Notepad. Check the timestamp of the last data entry in the normal data segment before the anomaly (e.g., 2025-09-17 08:00:00) and the timestamp of the first data entry in the reconstructed data segment (e.g., 2025-09-17 08:00:00) to confirm that the timestamps are consistent and without gaps or overlaps. Then check the timestamp of the last data entry in the reconstructed data segment (e.g., 2025-09-17 08:30:00) and the timestamp of the first data entry in the normal data segment after the anomaly (e.g., 2025-09-17 08:30:00) to ensure accurate time synchronization.

[0200] Furthermore, copy all the contents of the reconstructed data segment to the end of the normal data segment file before the anomaly, delete any blank lines that may exist between the two data segments, then copy all the contents of the normal data segment after the anomaly to the end of the reconstructed data segment, delete blank lines again, and save the merged file. This file is the data sequence after the sudden anomaly data segment has been corrected.

[0201] Specifically, the entire implementation process revolves around obtaining the reconstruction reference data for sudden abnormal data segments. First, normal data of a first predetermined time length before the abnormal data segment is extracted to obtain forward reference data. Then, normal data of a second predetermined time length after the abnormal data segment is extracted to obtain backward reference data. Finally, the forward and backward reference data are merged to obtain the reconstruction reference data.

[0202] Furthermore, when extracting forward reference data, to determine the start time of the abnormal data segment, it is necessary to consult the real-time monitoring log of the water quality instrument, find the record marked "abnormal start" in the log interface, and confirm the corresponding time, such as 10:00 on the same day, to ensure that the start time is accurate.

[0203] Furthermore, after clarifying that the first predetermined time length is 30 minutes, the extraction range is determined by time estimation. Subtracting 30 minutes from the abnormal start time of 10:00, the starting extraction time is obtained as 9:30. Therefore, the normal data time range to be extracted is 9:30-10:00 on the same day. The estimation process needs to be recorded and checked on draft paper to avoid errors in the time range.

[0204] Furthermore, after opening the historical data storage system for water quality instruments, enter the administrator's account and password on the login interface. After entering the main interface of the system, click the "Data Query" module, find the "Data Status" option in the filter criteria bar, select "Normal", and then enter 9:30 and 10:00 in the "Time Range" input box respectively.

[0205] Furthermore, when selecting water quality indicators, you need to select fixed indicators according to monitoring needs, such as selecting the three options "pH value", "dissolved oxygen content" and "turbidity" in sequence, to ensure that the selected indicators are consistent with the subsequent data processing needs. After clicking "Query", wait for the system to load the data. After loading, check the "data status" column row by row to confirm that all data are marked "normal" and no abnormal data is mixed in.

[0206] Furthermore, when exporting data, click the "Export" button on the system interface, select "Excel" format in the pop-up export format selection box, set the storage path of the exported file such as "D drive - water quality data - forward reference data", enter the file name "forward reference data - 9:30-10:00", and click "OK" to complete the export. The data in this Excel file is the forward reference data.

[0207] Furthermore, when extracting backward reference data, the end time of the abnormal data segment is determined by checking the monitoring log, finding the record marked "abnormal end", confirming the time as 10:30 on the same day, clarifying that the second predetermined time length is 30 minutes, adding 30 minutes to 10:30 to get the end extraction time of 11:00, and determining the extraction time range as 10:30-11:00.

[0208] Furthermore, open the "Data Query" module of the historical data storage system, select "Data Status - Normal", enter the time range 10:30-11:00, check the same "pH value", "dissolved oxygen content" and "turbidity" indicators as the previous reference data, click "Query" and then check the data status to ensure that all data are normal.

[0209] Furthermore, when exporting the backward reference data, select the "Excel" format, set the storage path to "D drive - Water quality data - Backward reference data", and name the file "Backward reference data - 10:30-11:00". Click "OK" to complete the export. The data in this Excel file is the backward reference data.

[0210] Furthermore, when merging forward and backward reference data, first open the forward reference data Excel file and check that the header field order is "timestamp", "pH value", "dissolved oxygen content" and "turbidity". Then open the backward reference data file and confirm that its header field order is completely consistent with that of the forward reference data to avoid data misalignment due to different field orders.

[0211] Next, create a new blank Excel file, select all the data in the forward reference data file including the header, press "Ctrl+C" to copy, and paste it into cell A1 of the blank file by pressing "Ctrl+V". After pasting, check the row number of the last row of the forward reference data, such as row 50, which means that the backward reference data needs to be pasted starting from row 51.

[0212] Next, open the backward reference data file, select all data except the header, copy and paste it into cell A51 of the blank file, check the data column by column to ensure that the fields such as "time stamp" and "pH value" correspond one by one, and then check for duplicate timestamps. If two data sets have the same timestamp, delete one of them directly. Finally, save the blank file with the file name "Reconstructed Reference Data". The data in this file is the reconstructed reference data.

[0213] In general, generating reconstructed reference data based on normal monitoring data in adjacent time periods of sudden abnormal data segments involves first determining the adjacent time periods, then retrieving normal data for those time periods, removing duplicate data, and finally summarizing the valid data to form reconstructed reference data.

[0214] In general, determining the parameter range based on the statistical characteristics of the reconstructed reference data involves first classifying and sorting the data by indicator to find the maximum and minimum values, then determining the numerical range of each indicator, and finally summarizing them to form a parameter range document that includes the allowable range of each indicator.

[0215] In general, the process of obtaining reconstructed data points by replacing abnormal data based on parameter ranges involves first reading the abnormal data, then calculating the median value of the indicator range to replace the abnormal values, and finally labeling and modifying them to form a set of reconstructed data points.

[0216] In general, reconstructing data segments by arranging and combining data points according to the original timestamps involves first unifying and sorting the timestamp format, then removing redundant formats and extracting data to form a continuous data string.

[0217] In general, the process of integrating the reconstructed data segments with the original normal data segments to obtain the corrected data sequence involves first determining the connection order, checking the temporal continuity, then splicing the data in sequence, and finally saving the merged file.

[0218] In general, the process of extracting forward reference data from normal monitoring data for a first predetermined time period before the sudden abnormal data segment involves first determining the start time of the abnormality and the first predetermined time period to clarify the extraction range, and then filtering and verifying normal data through the historical data system and exporting it to an Excel file.

[0219] In general, the process of extracting normal monitoring data for a second predetermined time period after a sudden abnormal data segment to obtain backward reference data involves first determining the end time of the abnormality and the second predetermined time period to clarify the extraction range, and then filtering and verifying normal data through the historical data system and exporting it to an Excel file.

[0220] In summary, merging forward reference data and backward reference data to obtain reconstructed reference data involves first confirming that the data structures of the two are consistent, then pasting the data sequentially into a blank file, deleting duplicate data, and finally saving the file.

[0221] S5. The corrected data sequence is formatted to obtain the final correction result of the target water area in response to water quality changes.

[0222] In this embodiment of the invention, the step of formatting the corrected data sequence to obtain the final correction result for the target water area in response to water quality changes includes:

[0223] The corrected data sequence of the sudden anomaly data segment is used as the formatted data of the sudden anomaly data segment;

[0224] The data to be formatted is encapsulated in chronological order to obtain a standardized data packet of the sudden abnormal data segment;

[0225] Add the verification identifier and data source identifier to the standardized data packet data to obtain the transmission ready data for the sudden abnormal data segment;

[0226] Based on the communication protocol format supported by the water quality instrument, the transmission-ready data is format-converted to obtain the final correction result of the target water area in response to water quality changes.

[0227] Specifically, the entire implementation process revolves around the processing of sudden abnormal data segments. First, the corrected data sequence is identified as the data to be formatted. Then, it is encapsulated in chronological order to obtain standardized data packets. Next, verification and data source identification are added to form transmission-ready data. Finally, the format is converted according to the water quality instrument communication protocol to obtain the final correction result for the target water area in response to water quality changes.

[0228] Furthermore, when determining the data to be formatted, the operator first opens the data sequence file after the sudden abnormal data segment has been corrected. This file is usually stored in tabular form and contains columns such as "timestamp", "water quality index", and "index value".

[0229] Furthermore, the operators checked the data sequence line by line, comparing it with the preset list of water quality monitoring indicators such as pH value, dissolved oxygen content, turbidity, and water temperature, to confirm that each indicator had a corresponding data record and that no indicator was missing.

[0230] Furthermore, for each data point's timestamp, check whether its format is "year-month-day hour:minute:second" and whether the time order is consistent with the actual monitoring time, ensuring that there are no issues such as missing timestamps, incorrect formats, or disordered time order.

[0231] Furthermore, only after confirming that all water quality index data are complete and the timestamps are accurate will the corrected data sequence be formally designated as data to be formatted, in preparation for subsequent encapsulation processing.

[0232] Furthermore, when performing data encapsulation processing, the first step is to sort the determined data to be formatted by timestamp. Open the data file to be formatted, select the "timestamp" column, and use the data sorting function to rearrange all the data in chronological order from earliest to latest.

[0233] Furthermore, a standard data package template is designed in advance. The template starts with a fixed data start identifier "DATA_START" and ends with a fixed data end identifier "DATA_END". The data area in the middle is reserved with blank spaces for the corresponding fields in the order of "time stamp, pH value, dissolved oxygen content, turbidity, and water temperature".

[0234] Furthermore, the sorted data to be formatted is filled into the data area of ​​the template one by one, ensuring that the fields of each data point correspond one-to-one with the reserved positions in the template. For example, the timestamp of a data point is filled into the "timestamp" reserved position, and the pH value is filled into the "pH value" reserved position.

[0235] Furthermore, after the “DATA_START” identifier in the template, the generation time of the current data packet is added. The generation time format is “YYYYMMDDHHMMSS”, such as “20250917103000”, to accurately record the creation time of the data packet.

[0236] Furthermore, before the "DATA_END" marker in the template, count and label the total number of data entries in the data package, with the labeling format being "TOTAL:XX". For example, if the total number of data entries is 50, then label it "TOTAL:50". Finally, save the completed template as a "dat" format file, which is the standardized data package.

[0237] Furthermore, when adding calibration labels, operators first obtain a table of normal ranges for water quality indicators. This table clearly defines the normal value ranges for each indicator, such as the normal range for dissolved oxygen content being 0.1–14.5 mg / L and the normal range for pH value being 6.5–8.5.

[0238] Furthermore, open the standardized data package file, read the indicator value of each data line by line, and check whether the value is within the normal range of the corresponding indicator by comparing it with the normal range table. If the indicator value of a certain data exceeds the range, the data source needs to be re-verified, and the verification can continue only after confirming that there are no errors.

[0239] Furthermore, it checks whether the format of each data entry conforms to the preset standard of "timestamp-value", such as "2025-09-1710:30:00-pH:7.2", to ensure that the format is without deviation.

[0240] Furthermore, after all the data has been verified to be correct, a verification identifier is added to the beginning of the data packet file. The identifier format is "verification passed-YYYYMMDDHHMMSS", such as "verification passed-20250917112000", where the time is the specific time when the verification was completed.

[0241] Furthermore, when adding a data source identifier, the operator logs into the water quality instrument management system, enters the name or model of the water quality instrument in the "Equipment Management" module, and queries its unique equipment number, such as "SY-2025001".

[0242] Furthermore, simultaneously query the specific deployment location information of the instrument, such as "XX Lake East District Monitoring Point", and organize the equipment number and deployment location in the format of "Equipment Number: XXX; Deployment Location: XXX", such as "Equipment Number: SY-2025001; Deployment Location: XX Lake East District Monitoring Point".

[0243] Furthermore, the prepared data source identifier is added to the end of the checksum identifier in the data packet, and the updated data packet file is saved. This file is now the transmission-ready data.

[0244] Furthermore, before converting the data to a transmission-ready format, the operator should find the technical documentation accompanying the water quality instrument, locate the communication protocol type supported by the instrument in the "Communication Protocol" section of the document, such as the Modbus protocol, and obtain the detailed requirements of the protocol.

[0245] Furthermore, the specific requirements for data format in the protocol were clarified from the technical documentation, including key requirements such as the field separator being "|", the maximum length of a single data entry being 180 characters, and the file encoding format being GBK, and these were recorded one by one.

[0246] Furthermore, open a text editor such as Notepad, import the transfer-ready data file, and use the tool's "replace" function to replace all English comma separators in the file with the "|" separator required by the protocol.

[0247] Furthermore, check the length of each line of data. If a data line exceeds 180 characters, such as long data containing detailed descriptions of multiple indicators, add a "SPLIT" split marker at an appropriate non-field separator position in the middle of the data without splitting the data fields. For example, split "20250917103000|pH:7.2|Dissolved Oxygen:8.3mg / L|Turbidity:5NTU|Water Temperature:25℃" into "20250917103000|pH:7.2|Dissolved Oxygen:8.3mg / L|SPLIT|Turbidity:5NTU|Water Temperature:25℃".

[0248] Furthermore, open an encoding conversion tool such as Notepad++, import the processed file, and select "Convert to GBK encoding" in the tool's "Encoding" menu to complete the file encoding conversion.

[0249] Furthermore, after the conversion is completed, check the file delimiters, data length, encoding format, etc. against the protocol requirements in the technical document to see if they comply with the regulations. After confirming that all requirements are met, save the file. This file is the final correction result for the target water area in response to water quality changes.

[0250] In general, using the corrected data sequence of sudden abnormal data segments as the data to be formatted is a process of directly defining the data sequence as the data to be formatted, provided that the corrected data sequence contains all water quality index data and accurate timestamps and there are no missing or erroneous data.

[0251] In general, the process of encapsulating the determined data to be formatted in chronological order involves first sorting the data by timestamp, then filling in the data using a standard template containing fixed start / end identifiers and reserved fields, supplementing the generation time and the total number of data entries, and finally saving the data to obtain a standardized data package.

[0252] In general, adding verification and data source identifiers to standardized data packets involves first manually checking the data values ​​and formats, then adding a verification identifier containing the verification time, then querying and adding a data source identifier containing the device number and deployment location, and finally saving the updated file to obtain data ready for transmission.

[0253] In general, the process of transmitting ready data based on the communication protocol format conversion supported by water quality instruments involves first clarifying the protocol's requirements for delimiters, data length, and encoding, then adjusting the data format, splitting excessively long data, converting the encoding, saving the file after verification, and finally obtaining the final correction result for the target water area in response to water quality changes.

[0254] In the several embodiments provided by this invention, it should be understood that the disclosed methods can be implemented in other ways.

[0255] It will be apparent to those skilled in the art that the present invention is not limited to the details of the exemplary embodiments described above, and that the present invention can be implemented in other specific forms without departing from the spirit or essential characteristics of the present invention.

[0256] The embodiments of this application can acquire and process relevant data based on artificial intelligence technology. Artificial intelligence is the theory, method, and technology that uses digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use that knowledge to obtain optimal results.

[0257] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention.

Claims

1. A method for intelligent correction of water quality meter measurement data in response to sudden water quality changes, characterized in that, The method comprises: S1, real-time monitoring of water quality data of a target water area to obtain an original data sequence of the target water area; S2, mutation feature identification of the original data sequence to obtain a candidate abnormal segment of the original data sequence; S3, burst verification of the candidate abnormal segment to obtain a burst abnormal data segment in the candidate abnormal segment, comprising: obtaining environmental factor monitoring data corresponding to a time period of the candidate abnormal segment; analyzing the change trend of the candidate abnormal segment to obtain a water quality time sequence change feature of the candidate abnormal segment; based on the change mode of the key environmental parameters, extracting features from the environmental factor monitoring data to obtain the environmental factor change feature of the candidate abnormal segment; coupling correlation analysis of the water quality time sequence change feature and the environmental factor change feature, comprising: extracting key feature parameters from the water quality time sequence change feature and the environmental factor change feature to obtain a water quality time sequence change feature vector and an environmental factor change feature vector of the candidate abnormal segment; calculating a dynamic weighted coupling coefficient between the water quality time sequence change feature vector and the environmental factor change feature vector, wherein the calculation formula of the dynamic weighted coupling coefficient is: ; in, This represents the dynamic weighted coupling coefficient between the water quality time-series change feature vector and the environmental factor change feature vector. This represents the total number of feature points within the candidate anomaly segment. Indicates the candidate anomaly segment number 1 Water quality temporal variation characteristic values ​​at each characteristic point Indicates the first Characteristic values ​​of environmental factor changes at each characteristic point Indicates the candidate anomaly segment number 1 Temporal weighting coefficients for each feature point This represents the mean of the water quality time-series variation characteristic values. This represents the mean value of the characteristic values ​​of the changes in the environmental factors; comparing the dynamic weighted coupling coefficient with a preset coupling threshold value, and when the dynamic weighted coupling coefficient is less than the preset coupling threshold value, obtaining the burst abnormal data segment of the candidate abnormal segment; S4, data reconstruction of the burst abnormal data segment to obtain a corrected data sequence; S5, formatting processing of the corrected data sequence to obtain a final correction result of the target water area in response to water quality changes.

2. The method of claim 1, wherein the method further comprises: The real-time monitoring of the water quality data of the target water area to obtain the original data sequence of the target water area comprises: based on a preset data interface, connecting the water quality instrument deployed in the target water area to obtain the monitoring data stream of the water quality instrument deployed in the target water area; performing data format uniform processing on the monitoring data stream in chronological order to obtain a standardized data block of the water quality instrument; splicing and combining the standardized data block in chronological order to obtain the original data sequence of the water quality instrument.

3. The method of claim 2, wherein the method further comprises: The mutation feature identification of the original data sequence to obtain the candidate abnormal segment of the original data sequence comprises: based on a sliding window, segmenting the original data sequence to obtain a continuous data sub-segment of the original data sequence; calculating the statistical feature quantity of the data in the continuous data sub-segment to obtain a statistical quantity sequence of the original data sequence; based on the historical data of the target water area, comparing the statistical quantity sequence with a preset dynamic threshold value to obtain a preliminary abnormal segment of the original data sequence; performing neighborhood continuity check on the preliminary abnormal segment to obtain the candidate abnormal segment of the original data sequence.

4. The method of claim 3, wherein the method further comprises: The calculation of the statistical feature quantity of the data in the continuous data sub-segment to obtain the statistical quantity sequence of the original data sequence comprises: extracting the monitoring data value of the data points in the continuous data sub-segment; The mutation tendency degree of the monitoring data value is evaluated based on a dynamic fluctuation index calculation formula, to obtain a statistical characteristic quantity of the continuous data sub-section, wherein the dynamic fluctuation index calculation formula is: ; in, This represents the dynamic fluctuation index of the continuous data segment. This represents the total number of data points within the continuous data segment. Indicates the first [number]th ... Monitoring data values ​​of each data point This represents the arithmetic mean of all monitored data values ​​within the continuous data segment. This represents the maximum value of the monitored data within the continuous data segment. This represents the minimum value of the monitored data within the continuous data segment; The dynamic fluctuation indexes of the continuous data sub-sections are arranged in chronological order to obtain a statistical quantity sequence of the original data sequence.

5. The method of claim 1, wherein the method further comprises: determining a rate of change of the water quality parameter; and determining whether the rate of change is greater than a predetermined threshold. 5 The data reconstruction of the sudden abnormal data section to obtain the corrected data sequence includes: According to the normal monitoring data of the adjacent time period of the sudden abnormal data section, the reconstruction reference data of the sudden abnormal data section is generated; Based on the statistical characteristics of the reconstruction reference data, the reconstruction reference data is reconstructed to obtain the parameter range of the reconstruction reference data; Based on the parameter range, the abnormal data value in the sudden abnormal data section is replaced point by point to obtain the reconstructed data point of the sudden abnormal data section; The reconstructed data points are arranged and combined in the original time stamp order to obtain the reconstructed data section of the sudden abnormal data section; The reconstructed data section and the original normal data section are integrated in time sequence to obtain the corrected data sequence of the sudden abnormal data section.

6. The method of claim 5, wherein the method further comprises: The reconstruction reference data of the sudden abnormal data section is generated according to the normal monitoring data of the adjacent time period of the sudden abnormal data section, including: The normal monitoring data of a first predetermined time length before the sudden abnormal data section is extracted to obtain the forward reference data of the sudden abnormal data section; The normal monitoring data of a second predetermined time length after the sudden abnormal data section is extracted to obtain the backward reference data of the sudden abnormal data section; The forward reference data and the backward reference data are combined to obtain the reconstruction reference data of the sudden abnormal data section.

7. The intelligent correction method for water quality instrument measurement data in response to sudden water quality changes as described in claim 1, characterized in that, The formatted processing of the corrected data sequence to obtain the final correction result of the target water area in response to water quality changes includes: The corrected data sequence of the sudden abnormal data section is taken as the formatted data of the sudden abnormal data section; The formatted data is encapsulated in chronological order to obtain the standardized data packet of the sudden abnormal data section; The check identifier and data source identifier of the standardized data packet data are added to obtain the transmission ready data of the sudden abnormal data section; Based on the communication protocol format supported by the water quality instrument, the transmission ready data is format-converted to obtain the final correction result of the target water area in response to water quality changes.

Citation Information

Patent Citations

  • Remote monitoring method and system for intelligent water purification equipment

    CN120499236A

  • Intelligent water affair dynamic monitoring system and monitoring method based on digital twinning

    CN120685153A