AI-based intelligent water quality data acquisition and processing method
By identifying timing misalignment and physicochemical coupling anomalies in the responses of multiple optical sensors, dynamic time-shift compensation and Bayesian inversion amplitude correction are employed. Combined with cross-index coupling consistency verification and self-attention dynamic feature acquisition, the problem of insufficient accuracy in water quality data processing is solved, and high-precision water quality data processing and prediction are achieved.
Patent Information
- Application Number
- CN202611184085.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-06
- Publication Date
- 2026-11-06
AI Technical Summary
Existing water quality data acquisition and processing technologies suffer from data inconsistency and distortion of coupling relationships when faced with complex field conditions such as sudden changes in suspended particle size and cross-interference of optical sensors, resulting in insufficient accuracy of water quality data processing.
By identifying timing misalignment and physicochemical coupling anomalies in the responses of multiple optical sensors, dynamic time-shift compensation of water quality optical sensors and Bayesian inversion amplitude correction are adopted. Combined with cross-index coupling consistency verification and self-attention dynamic feature acquisition, a high-quality water quality prediction input sequence is constructed.
It improves the accuracy of water quality data processing, reduces the timing misalignment and amplitude detuning of multi-sensor responses caused by suspended solids particle size sorting, ensures the physical rationality and reliability of feature vectors, and enhances the accuracy of water quality prediction and the robustness of the system.
Smart Images

Figure CN123048931A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of water quality data acquisition and processing technology, and in particular to an AI-based intelligent water quality data acquisition and processing method. Background Technology
[0002] For wastewater treatment plants, reclaimed water plants, or industrial park water treatment systems, with the acceleration of industrialization and urbanization, the fluctuation of influent water quality is intensifying and the types of pollutants are becoming increasingly complex. Traditional water quality data acquisition and processing methods have shortcomings such as long cycles, low frequency, and narrow coverage, making it difficult to meet the needs of real-time early warning and refined management. Therefore, research on intelligent water quality data acquisition and processing methods is urgently needed. The main implementation process of existing water quality data acquisition and processing is as follows: First, based on a multi-parameter sensor array deployed in the target water area, such as electrochemical sensors, ultraviolet spectral sensors, and UAV-borne multispectral cameras, pH (potential of) is obtained. The system collects multi-source water quality data, including hydrogen (pH), dissolved oxygen, ammonia nitrogen, and turbidity. Then, it uploads the raw multi-source water quality data and geolocation tags to an edge computing gateway or cloud server via 4G / 5G cellular networks. Next, it uses preprocessing methods such as sliding window filtering to remove outliers and linear interpolation to fill short-term missing values to denoise and standardize the raw multi-source water quality data. Finally, it uses algorithms such as principal component analysis or canonical correlation analysis to fuse the qualified multi-source water quality data, obtaining a fused low-dimensional feature vector. This low-dimensional feature vector is then input into a pre-defined AI (Artificial Intelligence) analysis model, such as support vector machines for water quality classification or long short-term memory networks for water quality indicator trend prediction, to predict water quality conditions.
[0003] The above-mentioned technology has at least the following technical problems: The existing main implementation process of water quality data acquisition and processing has basically achieved an automated closed loop from data acquisition, transmission, preprocessing to model prediction, which is the mainstream technical route in the field of water quality monitoring. However, in practical applications, the above technical route often encounters problems of data consistency and distortion of coupling relationship expression when facing complex field conditions such as severe hydraulic disturbance, sudden change in suspended particle size, and cross interference of multiple sensors.
[0004] During water quality data collection and processing in wastewater treatment plants, reclaimed water plants, or industrial park water treatment systems, abnormal fluctuations in influent water quality, such as severe disturbances in the return sludge and mixed liquor, can lead to the formation of a large amount of suspended particulate matter in the water. Because there are significant differences in the settling velocity and initial flow velocity between particles of different sizes, suspended matter exhibits a particle size separation phenomenon where large particles lead and fine particles follow. Existing water quality monitoring points generally utilize multi-parameter optical sensors, such as turbidity sensors and COD (Chemical Oxygen Demand) sensors. Integrated installations of sensors such as chemical oxygen demand (COD) UV absorption sensors and chlorophyll fluorescence sensors within the same water medium can lead to optical cross-interference when monitoring optical water quality data such as turbidity, COD, and chlorophyll a. This is because the measurement signals of all optical sensors rely on the transmission, scattering, or fluorescence excitation of light in the water. Large suspended particles cause strong scattering and attenuation of incident and signal light, resulting in optical cross-interference. For example, the scattering and attenuation of UV light by large particles can cause false positive absorption values from the COD sensor, and the dual attenuation of excitation and emission light by particles can raise the baseline of the chlorophyll fluorescence signal. Current technologies typically use turbidity compensation algorithms, sliding window filtering, or statistical outlier removal algorithms to process data independently for each optical sensor. However, since different optical sensors have different response times and amplitudes to the same particle group interference, independent processing can lead to asynchronous identification of abnormal signals such as instantaneous spikes, gradual rises, and baseline drift in different sensor channels. For instance, instantaneous spikes in turbidity may be smoothly removed by a sliding window, while COD may be affected by other particles. Delayed false positives in OD (Optical Discharge) data are often retained as valid data due to relatively gradual changes. This leads to problems such as misalignment of data change nodes and insufficient consistency accuracy among different optical water quality data points on the time axis. Furthermore, these issues result in inaccurate characterization of the physicochemical coupling relationships between different optical water quality data points. For example, turbidity and chlorophyll are usually negatively correlated in eutrophic water bodies, but the presence of large particle scattering interference may cause turbidity to spike while chlorophyll remains unchanged or even decreases. When feature extraction is performed based on optical water quality data with inaccurate characterization of physicochemical coupling relationships, the generated water quality feature vector may have individual index values within the preset normal range, but the overall water quality feature vector will have feature deviations, such as extremely high turbidity and extremely low COD. When performing water quality data processing such as multi-source data fusion and water quality prediction based on water quality feature vectors with feature deviations, the final result is a technical problem of insufficient accuracy in water quality data processing. Summary of the Invention
[0005] This invention provides an AI-based intelligent water quality data acquisition and processing method, which solves the problem of insufficient accuracy in water quality data processing in existing technologies and improves the accuracy of water quality data processing.
[0006] To achieve the aforementioned objectives, the present invention provides the following technical solution: an AI-based intelligent water quality data acquisition and processing method, comprising: monitoring the consistency of water quality data acquisition to identify physical and chemical coupling anomalies caused by misaligned response times of multiple optical sensors; detecting cross-sensor asynchronous response anomalies based on the monitoring results; if cross-sensor asynchronous response anomalies are detected, selectively selecting dynamic time-shift compensation or Bayesian inversion amplitude correction for water quality optical sensors; if no cross-sensor asynchronous response anomalies are detected, performing cross-index coupling consistency verification, including cross-index credibility vector acquisition and determining whether multiple water quality sources conflict; after the cross-index coupling consistency verification is completed, performing self-attention dynamic feature acquisition and prediction input construction based on the verification results, including data credibility score vector acquisition, dynamic feature weight vector acquisition, and water quality prediction input sequence acquisition.
[0007] The above technical solution has at least the following advantages compared with the existing technology: 1. The above scheme monitors the consistency of water quality data collection and detects cross-sensor asynchronous response anomalies based on the monitoring results. If cross-sensor asynchronous response anomalies are detected, dynamic time-shift compensation or Bayesian inversion amplitude correction of the water quality optical sensors is selected accordingly. This helps reduce the timing misalignment and amplitude detuning of multi-sensor responses caused by suspended particle size sorting, ensuring that the data from each optical sensor are aligned on the time axis and that the amplitude relationship conforms to physicochemical laws, thereby improving data consistency from the source. If no cross-sensor asynchronous response anomalies are found, cross-index coupling consistency verification is performed directly, which helps verify whether the water quality data maintains the inherent consistency between the indicators. By identifying and labeling low-reliability indicators in a timely manner, coupling relationships are minimized, and the disruption of overall operational consistency caused by single-indicator cleaning is reduced, ensuring the physical rationality of feature vectors. After cross-indicator coupling consistency verification is completed, self-attention dynamic feature acquisition and prediction input construction are performed based on the verification results, including data reliability score vector acquisition, dynamic feature weight vector acquisition, and water quality prediction input sequence acquisition. This helps generate prediction input sequences with reliability labels. The reliability-adjusted attention mechanism suppresses interference from distorted data and enhances reliable features, enabling subsequent water quality prediction to adaptively rely on high-quality information, ultimately improving the accuracy of water quality data processing.
[0008] 2. The above-mentioned scheme, by specifically acquiring the delay parameters and amplitude ratio parameters of water quality optical sensors, helps to quantify the degree of temporal misalignment and amplitude detuning caused by differences in the response characteristics of various optical sensors with high precision. This overcomes the shortcomings of existing technologies that rely solely on a single sensor or fixed statistical rules for anomaly detection, which cannot distinguish the source of interference and are prone to misjudgment or missed judgment. When the delay parameters of water quality optical sensors meet the anomaly conditions, dynamic time-shift compensation of water quality optical sensors is adopted; when the delay parameters do not meet the anomaly conditions, amplitude anomaly discrimination is initiated. When the amplitude ratio parameters of water quality optical sensors meet the amplitude anomaly conditions, Bayesian inversion amplitude correction is adopted if they do; otherwise, cross-index coupling consistency verification is performed. This helps to reduce the pollution of the entire water quality multi-source index due to the failure to correct local anomalies in time. Compared with the existing technology that processes each sensor independently and ignores asynchronous responses, this scheme can ensure the time axis alignment and reasonable amplitude ratio globally, thereby improving the reliability of subsequent cross-index coupling verification and feature extraction, and ultimately achieving an overall improvement in the accuracy of water quality data processing.
[0009] 3. When the influent water composition of a wastewater treatment plant or industrial park water treatment system undergoes fundamental changes, such as the mixing of upstream industrial wastewater leading to a significant change in the proportion of organic matter in suspended solids, the standard proportion coefficients in the physicochemical coupling constraints established under historically stable operating conditions become inapplicable. In this case, continuing to use the original fixed coupling model for residual calculation and reliability judgment will result in a large amount of normal data being misjudged as coupling anomalies. Therefore, it is necessary to implement an alternative method for obtaining the preset coupling model, specifically acquiring the average coupling residuals and the proportion of low-coupling reliability indicators for all indicators. This helps to quantify the matching degree between the current coupling model and the on-site operating conditions in real time, overcoming the shortcomings of existing technologies where fixed models cannot detect water quality component drift and the misjudgment rate increases after long-term operation, thus providing a reliable basis for model updates. Based on the trigger criteria, if the average coupling residual of a number of consecutive data consistency monitoring time periods exceeds the preset average coupling threshold, and the proportion of low-coupling reliable indicators exceeds the preset proportion threshold, then the current preset coupling model is determined to be invalid, triggering a coupling model update. The water quality multi-source indicators of the most recent number of sampling data consistency monitoring time periods are used as a temporary training set. For each target indicator, the measured values of other indicators are used as input features, and the true value of the target indicator is used as the output label. A lightweight regression model such as random forest or ridge regression is retrained, which helps the coupling model to adaptively track changes in influent composition online, improves the robustness and automation level of the system, and ensures the accuracy of cross-indicator coupling verification during long-term operation. Attached Figure Description
[0010] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0011] Figure 1 A flowchart illustrating the AI-based intelligent water quality data acquisition and processing method provided in this application embodiment; Figure 2 A flowchart providing an overview of the AI-based intelligent water quality data acquisition and processing method is provided for the embodiments of this application. Figure 3 This application provides water quality data coverage, field types, and fluctuation characteristic maps for an AI-based intelligent water quality data acquisition and processing method in its embodiments. Figure 4 This application provides a cross-parameter coupling correlation diagram of multiple water quality indicators in the influent and effluent of a wastewater treatment plant for the embodiments of the AI-based intelligent water quality data acquisition and processing method. Figure 5 This application provides a diagram illustrating the self-attention dynamic feature operation mechanism of an AI-based intelligent water quality data acquisition and processing method. Detailed Implementation
[0012] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. All other embodiments obtained by those skilled in the art based on the described embodiments of the present invention without creative effort are within the scope of protection of the present invention.
[0013] Unless otherwise defined, the technical or scientific terms used in this invention shall have the ordinary meaning understood by one of ordinary skill in the art to which this invention pertains. The terms “first,” “second,” and similar terms used in this invention do not indicate any order, quantity, or importance, but are merely used to distinguish different components. Similarly, the terms “an,” “a,” or “the,” and similar terms do not indicate a quantity limitation, but rather indicate the presence of at least one. The terms “comprising,” “including,” or “including,” and similar terms mean that the element or object preceding the word encompasses the element or object listed following the word and its equivalents, without excluding other elements or objects. The terms “connected,” “linked,” or “connected,” and similar terms are not limited to physical or mechanical connections, but can include electrical connections, whether direct or indirect.
[0014] Example 1, as Figure 1 As shown, the flowchart of the AI-based intelligent water quality data acquisition and processing method provided in this application embodiment is as follows: Figure 1 It can be seen that during the water quality data acquisition and processing, water quality data acquisition consistency monitoring is used to identify physical and chemical coupling anomalies caused by misalignment in the response time sequence of multiple optical sensors. Based on the monitoring results, cross-sensor asynchronous response anomalies are detected. If cross-sensor asynchronous response anomalies are detected, dynamic time-shift compensation or Bayesian inversion amplitude correction for water quality optical sensors is selected accordingly. Dynamic time-shift compensation for water quality optical sensors is used to dynamically adjust the sampling trigger time of the next monitoring period according to the predicted time delay deviation, reducing node misalignment from the source. Bayesian inversion amplitude correction is used to adaptively correct amplitude detuning based on the physical and chemical coupling relationship as a priori probability, so that the response intensity of each indicator is restored to the standard proportional relationship. Through water quality data acquisition consistency monitoring, it is helpful to detect the heterogeneity of multi-sensor response caused by suspended particle size sorting in advance, and actively reduce the chain errors caused by time axis misalignment and amplitude detuning in the subsequent feature extraction stage. Compared with passive outlier removal methods, it improves the foresight and targeting of data cleaning.
[0015] If no cross-sensor asynchronous response anomaly is detected, cross-index coupling consistency verification is directly performed, including cross-index confidence vector acquisition and judgment of whether multi-source water quality indicators conflict. Cross-index coupling consistency verification helps to quantify the degree of coordination between each indicator and the overall water quality status, identify single anomalies that deviate from coupling constraints and are not supported by other strongly coupled indicators, and provide a physically meaningful basis for subsequent dynamic feature weight allocation.
[0016] After the cross-index coupling consistency verification is completed, self-attention dynamic feature acquisition and prediction input construction are carried out based on the verification results, including data credibility score vector acquisition, dynamic feature weight vector acquisition, and water quality prediction input sequence acquisition. Self-attention dynamic feature acquisition and prediction input construction are used to generate prediction input sequences with credibility labels and suppress distorted data interference. Self-attention dynamic feature acquisition and prediction input construction helps subsequent water quality prediction to adaptively focus on credible features, ignore distorted features, and retain real mutation information, thereby embedding quality perception capabilities at the input level.
[0017] As described above, the three processes of water quality data acquisition consistency monitoring, cross-indicator coupling consistency verification, and self-attention dynamic feature acquisition and prediction input construction work together and support each other. This helps to build a progressive data cleaning chain of time-series alignment, coupling verification, and feature purification, reducing distortions from different sources layer by layer, and ultimately achieving high-confidence water quality prediction input. Specifically, water quality data acquisition consistency monitoring corrects time-series and amplitude anomalies at the source, providing reliable starting data for cross-indicator coupling verification. Cross-indicator coupling verification further filters residual inconsistent information and outputs coupling confidence as the quantitative weight basis for the self-attention mechanism. Self-attention dynamic feature acquisition uses this weight to adaptively aggregate features and directly downweights low-confidence features. All three processes work together to improve the accuracy of water quality data processing.
[0018] It should be understood that, in the specific implementation of the AI-based intelligent water quality data acquisition and processing method provided in this application embodiment, a dynamic knowledge database needs to be pre-constructed in one specific embodiment. This dynamic knowledge database includes, on the one hand, multiple core control parameters jointly calibrated by water treatment industry experts and algorithm engineers, including but not limited to: preset number of sampling points, preset number of consecutive samplings, and preset drift initiation threshold; on the other hand, this dynamic knowledge database also integrates a historical case library of water quality data processing that has been cleaned in a unified format. These cases cover different wastewater treatment plants or reclaimed water plants under various operating conditions, such as rainstorm impact and backflow. The database contains raw time-series data from multi-channel sensors under conditions of sludge disturbance and industrial wastewater contamination, intermediate results after time-scale alignment and amplitude recovery, intervariate coupling residual sequences, consistency confidence distribution, data quality scores, dynamic feature weights, cleaning action records, and output errors and manual verification results of subsequent prediction models. In addition, this dynamic knowledge database also preserves iterative traces of the model's continuous evolution, such as adaptive adjustment records of smoothing coefficients in the time-delay prediction model, online correction logs of the prior covariance matrix in the amplitude correction module, incremental learning versions of the mapping matrix in the self-attention cleaning module, and the evolution history of thresholds in conflict variable discrimination rules.
[0019] From a data organization architecture perspective, this dynamic knowledge database adopts a hierarchical hybrid storage strategy: relational tables are used to store structured data, such as sensor measured values, sampling timestamps, missing proportions, coupling residuals, consistency confidence, quality scores, feature weights, and cleaning action labels; non-relational object storage is used to store unstructured data, such as waveform fragments of UV absorbance time-series curves, turbidity peak morphology characteristics, chlorophyll fluorescence drift trajectories, sensor calibration images, and maintenance documents; it is designed that personnel can use the multi-dimensional feedback signals obtained in real time from the water quality data processing pipeline, including the deviation convergence trend of the output of the time-series alignment unit, the estimated residual of the output of the amplitude correction unit, the conflict variable groups marked by the consistency verification unit, the quality of the input sequence generated by the feature cleaning unit, the output error of the prediction model, and the results of manual sampling, to periodically verify and dynamically fine-tune various control parameters in the dynamic knowledge database online, so that the dynamic knowledge database can adaptively match the influent water quality fluctuation characteristics under different treatment scenarios, the response characteristic drift of various sensors due to aging or contamination, and the differences in hydraulic disturbance intensity at different process nodes.
[0020] like Figure 2 As shown, the flowchart illustrates the overall overview of the AI-based intelligent water quality data acquisition and processing method provided in this application embodiment. Figure 2 It can be seen that: water quality data acquisition consistency monitoring is carried out, and based on the acquired water quality optical sensor delay parameters and water quality optical sensor amplitude ratio parameters, it is determined whether there are cross-sensor asynchronous response anomalies. When the water quality optical sensor delay parameters meet the water quality optical sensor delay anomaly conditions, dynamic time shift compensation of the water quality optical sensor is adopted; otherwise, amplitude anomaly discrimination is entered. When the water quality optical sensor amplitude ratio parameters meet the water quality optical sensor amplitude anomaly conditions, Bayesian inversion amplitude correction is adopted; otherwise, cross-index coupling consistency verification is performed. After the cross-index coupling consistency verification is completed, self-attention dynamic feature acquisition and prediction input construction are carried out.
[0021] Preferably, the specific process of water quality data acquisition consistency monitoring is as follows: Step 1.1, during the data consistency monitoring period, collect the original measurement data sequence of the optical sensor, including turbidity sequence, COD ultraviolet absorbance sequence, fluorescence intensity sequence, and chromaticity sequence; the turbidity sequence represents the sequence of turbidity values monitored by the turbidity sensor at continuous sampling time; the COD ultraviolet absorbance sequence represents the sequence of COD ultraviolet absorbance values monitored by the COD ultraviolet absorption sensor at continuous sampling time; the fluorescence intensity sequence represents the sequence of fluorescence intensity values monitored by the chlorophyll fluorescence sensor at continuous sampling time; the chromaticity sequence represents the sequence of chromaticity values monitored by the chromaticity sensor at continuous sampling time; Step 1.2, obtain... The specific acquisition process for the water quality optical sensor delay parameters and amplitude ratio parameters is as follows: The water quality optical sensor delay parameters include the COD UV absorbance delay time, chromaticity delay time, and chlorophyll fluorescence drift delay time; the water quality optical sensor amplitude ratio parameters include the COD UV absorbance amplitude ratio coefficient, chromaticity amplitude ratio coefficient, and chlorophyll fluorescence drift rate; the moment when the instantaneous peak is detected by the turbidity sensor is recorded as the signal arrival reference time; starting from the signal arrival reference time, a sampling period is traced back one sampling period and extended forward by a preset number of sampling periods to form an analysis window; within the analysis window, the COD UV absorbance sequence is calculated using a first-order difference algorithm to obtain the COD UV absorbance... The COD UV absorbance difference sequence; the difference value of each sampling point in the COD UV absorbance difference sequence represents the change in absorbance between adjacent times; when the COD UV absorbance difference sequence meets the COD UV absorbance rise discrimination condition, the time of the first sampling point that meets the condition is recorded as the start time of the COD response rise; when the COD UV absorbance difference sequence does not meet the COD UV absorbance rise discrimination condition, it indicates that the current turbidity peak has not caused an effective COD response, and the COD UV absorbance delay time and COD UV absorbance amplitude ratio coefficient are set to 0; the COD UV absorbance rise discrimination condition indicates that the difference values of all sampling points in the COD UV absorbance difference sequence for a consecutive preset number of sampling points are greater than 0; the COD UV absorbance... The moment when the difference value in the difference sequence changes from positive to negative, and the corresponding absorbance value is the first zero-crossing point of the maximum value within the analysis window, is recorded as the COD response peak point. The time difference between the start of the COD response rise and the signal arrival at the reference time is used as the COD UV absorbance delay time of the COD UV absorbance sequence relative to the turbidity peak, which is used to quantify the response lag of the COD UV absorbance sequence relative to the turbidity sequence. At the same time, the ratio of the COD UV absorbance value at the COD response peak point to the amplitude of the turbidity peak is used as the COD UV absorbance amplitude proportionality coefficient, which is used to describe the normal proportional relationship between the COD response intensity caused by the same particle group and the turbidity response. The amplitude of the turbidity peak is represented by the maximum value of the turbidity sequence within the analysis window.
[0022] Obtain the chromaticity delay time and chromaticity amplitude ratio coefficient. It should be noted that since the chromaticity sensor and the COD ultraviolet absorption sensor both belong to the ultraviolet and visible light absorption type sensors, their response morphology is peak-shaped, and they share the same mechanism of interference from large particle scattering. Therefore, the process for obtaining the chromaticity delay time and chromaticity amplitude ratio coefficient is completely consistent with the process for obtaining the COD ultraviolet absorbance delay time and COD ultraviolet absorbance amplitude ratio coefficient. Based on the sliding window mean filtering algorithm, within the analysis window, the fluorescence intensity sequence is subjected to sliding window mean filtering to eliminate high-frequency noise, and then each sampling point is obtained. The cumulative change is relative to the starting point of the analysis window. The cumulative change is represented by subtracting the filtered fluorescence intensity value of the first sampling point in the analysis window from the filtered fluorescence intensity value of the current sampling point, and then taking the absolute value. When the cumulative change does not meet the fluorescence sensor drift condition, it indicates that the chlorophyll fluorescence sensor has not drifted effectively, and both the chlorophyll fluorescence drift delay time and the chlorophyll fluorescence drift rate are set to 0. The fluorescence sensor drift condition indicates that the cumulative change meets the preset drift initiation threshold for a consecutive preset number of times. When the cumulative change meets the fluorescence sensor drift condition, the first cumulative change... The sampling point when the chlorophyll fluorescence baseline drift exceeds the preset drift initiation threshold is recorded as the chlorophyll fluorescence baseline drift initiation time. It is then determined whether the cumulative change meets the chlorophyll fluorescence baseline drift stabilization condition. If it does, the first sampling point meeting the chlorophyll fluorescence baseline drift stabilization condition is recorded as the chlorophyll fluorescence baseline drift stabilization time; otherwise, the last sampling point in the analysis window is taken as the stabilization point. The chlorophyll fluorescence baseline drift stabilization condition means continuing to monitor the cumulative change until the cumulative change within a preset number of consecutive sampling points is less than the preset drift stabilization threshold. The preset drift stabilization threshold is determined by the cumulative change over a historical time period. The average value is used to represent the chlorophyll fluorescence baseline drift start time; the time difference between the start time of chlorophyll fluorescence baseline drift and the signal arrival time is used as the chlorophyll fluorescence drift delay time to quantify the hysteresis of the chlorophyll fluorescence signal response relative to the turbidity signal; the difference between the fluorescence intensity value at the stable point of chlorophyll fluorescence baseline drift and the preset fluorescence intensity threshold is divided by the drift duration to obtain the chlorophyll fluorescence drift rate, and the preset fluorescence intensity threshold is represented by the average value of fluorescence intensity values over a historical period; the drift duration is represented by the result of the difference calculation between the stable time of chlorophyll fluorescence baseline drift and the start time of chlorophyll fluorescence baseline drift.
[0023] Step 1.3: Based on the water quality optical sensor delay parameters and amplitude ratio parameters, determine whether there is an anomaly in cross-sensor asynchronous response. The specific process is as follows: For the water quality optical sensor delay parameters, determine whether it is necessary to implement dynamic time-shift compensation based on the comparison results with the water quality optical sensor delay anomaly conditions. Specifically: When the water quality optical sensor delay parameters meet the water quality optical sensor delay anomaly conditions, it indicates that there is a timing misalignment anomaly in the optical sensor channel, that is, the response caused by the same particle group is not aligned on the time axis, resulting in node misalignment in the time dimension of subsequent multi-parameter data. The water quality optical sensor delay parameters that meet the water quality optical sensor delay anomaly conditions are then compared with the anomaly conditions. The corresponding optical sensor is marked as an optical anomaly sensor, and dynamic time-shift compensation for the water quality optical sensor is adopted. When the delay parameter of the water quality optical sensor does not meet the delay anomaly condition, it enters the amplitude anomaly judgment stage. Amplitude anomaly judgment means that for the amplitude ratio parameter of the water quality optical sensor, based on the comparison result with the amplitude anomaly condition of the water quality optical sensor, it is decided whether Bayesian inversion amplitude correction is necessary. Specifically, when the amplitude ratio parameter of the water quality optical sensor meets the amplitude anomaly condition, it indicates that the current optical sensor has an amplitude detuning anomaly, that is, the response intensity caused by luminescence cross-interference does not conform to the physicochemical coupling relationship, resulting in inaccurate characterization of the subsequent coupling relationship. Optical sensors exhibiting abnormal amplitude conditions are marked as having abnormal amplitude ratios. In such cases, Bayesian inversion amplitude correction is required; otherwise, cross-index coupling consistency verification is necessary. Abnormal delay conditions in water quality optical sensors are indicated by the absolute value of the COD UV absorbance delay time exceeding a preset COD delay threshold, the absolute value of the chromaticity delay time exceeding a preset chromaticity delay threshold, or the absolute value of the chlorophyll fluorescence drift delay time exceeding a preset chlorophyll delay threshold. The preset COD delay threshold is represented by the average absolute value of the COD UV absorbance delay time over a historical time period, and the preset chromaticity delay threshold is represented by the average absolute value of the chromaticity delay time over a historical time period. The preset chlorophyll delay threshold is represented by the average absolute value of the chlorophyll fluorescence drift delay time over a historical period. Abnormal conditions of water quality optical sensor amplitude are indicated by the COD UV absorbance amplitude ratio coefficient being greater than the preset COD ratio deviation threshold, the chromaticity amplitude ratio coefficient being greater than the preset chromaticity ratio deviation threshold, or the chlorophyll fluorescence drift rate being greater than the preset chlorophyll ratio deviation threshold. The preset COD ratio deviation threshold is represented by the average value of the COD UV absorbance amplitude ratio coefficient over a historical period, the preset chromaticity ratio deviation threshold is represented by the average value of the preset chromaticity ratio deviation threshold over a historical period, and the preset chlorophyll ratio deviation threshold is represented by the average value of the preset chlorophyll ratio deviation threshold over a historical period.
[0024] As described above, monitoring the consistency of water quality data collection helps to proactively identify timing misalignment and amplitude detuning of optical multi-sensor responses caused by suspended particle size sorting during the data collection stage. This reduces the cumulative errors caused by node misalignment and proportional distortion during subsequent feature extraction and prediction modeling, minimizes invalid compensation or misjudgment operations triggered by uncorrected asynchronous responses, improves the data quality of cross-index coupling verification, and achieves the goal of suppressing distortion propagation from the source and enhancing the anti-interference capability of the overall data processing link.
[0025] Preferably, the specific process of dynamic time-shift compensation for water quality optical sensors is as follows: Step 2.1, obtain the instantaneous time delay deviation of the corresponding optical anomaly sensor, including the instantaneous time delay deviation of COD ultraviolet absorbance, chromaticity, and chlorophyll; the instantaneous time delay deviation of COD ultraviolet absorbance is represented by the result of the difference calculation between the COD ultraviolet absorbance delay time and the preset COD delay threshold; the instantaneous time delay deviation of chromaticity is represented by the result of the difference calculation between the chromaticity delay time and the preset chromaticity delay threshold; the instantaneous time delay deviation of chlorophyll is represented by the result of the difference calculation between the chlorophyll fluorescence drift delay time and the preset chlorophyll delay threshold; a positive instantaneous time delay deviation indicates that the current optical anomaly sensor response lags behind the turbidity peak, and a negative instantaneous time delay deviation indicates that the current optical anomaly sensor response leads the turbidity peak; input the instantaneous time delay deviation of the data consistency monitoring time periods closest to the current data consistency monitoring time period into the preset time period in chronological order. In the time delay prediction model, the predicted time delay deviation of the corresponding optical anomaly sensor is obtained. The number of preset time periods is set in advance by preset personnel. The predicted time delay deviation is used to characterize the degree to which the response of the current optical anomaly sensor may lead or lag behind the turbidity peak in the next data consistency monitoring period. Step 2.2: Based on the predicted time delay deviation, the adaptive sampling trigger advance or adaptive sampling trigger delay of each optical anomaly sensor in the next data consistency monitoring period is obtained. For each optical anomaly sensor, when the corresponding predicted time delay deviation is positive, it means that the response of the current optical anomaly sensor in the next data consistency monitoring period is expected to lag behind the turbidity peak. At this time, the adaptive sampling trigger advance is obtained. The adaptive sampling trigger advance is numerically equal to the predicted time delay deviation value. The physical meaning is: in order to offset the expected lag, the sampling time needs to be advanced by the same amount of time relative to the signal arrival reference time, so that the response waveform is aligned with the turbidity peak on the time axis.
[0026] Step 2.3: Dynamically adjust the actual sampling time of the corresponding optical sensor based on the adaptive sampling trigger advance. Specifically, for each optical anomaly sensor with a positive predicted delay deviation, set the sampling trigger time of the optical anomaly sensor to the unified reference clock time minus the adaptive sampling trigger advance. That is, within each sampling period of the optical anomaly sensor, the actual start time of data acquisition is one adaptive sampling trigger advance compared to the unified reference clock time, thereby shifting the response waveform of the optical anomaly sensor forward on the time axis to compensate for its inherent response lag. When the predicted delay deviation is negative, it indicates the next data consistency monitoring period. The response of the current optical anomaly sensor is expected to precede the turbidity peak. At this point, an adaptive sampling trigger delay is acquired, which is numerically equal to the absolute value of the prediction delay deviation. Based on this adaptive sampling trigger delay, the actual sampling time of the corresponding optical sensor is dynamically adjusted. Specifically, for each optical anomaly sensor with a negative prediction delay deviation, the sampling trigger time of that sensor is set to the unified reference clock time plus the adaptive sampling trigger delay. That is, within each sampling period of that optical anomaly sensor, the actual start time of data acquisition is delayed by one adaptive sampling trigger delay compared to the unified reference clock time, thereby... The current response waveform shifts backward on the time axis to offset its inherent response lead. After the dynamic time-shift compensation of the water quality optical sensor is completed, the corresponding instantaneous delay deviation is reacquired. If the absolute value of the corresponding instantaneous delay deviation is less than the absolute value of the previous corresponding instantaneous delay deviation, amplitude anomaly detection is performed. If the corresponding instantaneous delay deviation is not less than the previous corresponding instantaneous delay deviation, the smoothing coefficient is automatically reduced. This process is repeated iteratively to continuously bring the sampling trigger parameters of each optical anomaly sensor closer to the optimal value, ultimately achieving long-term stable alignment of the responses of each sensor. When the number of times the dynamic time-shift compensation of the water quality optical sensor is executed exceeds the preset maximum number of compensations, if... If the corresponding instantaneous delay deviation is still not less than the previous corresponding instantaneous delay deviation, a dynamic compensation failure prompt is sent. The maximum number of preset compensation attempts is set in advance by preset personnel. Automatically reducing the smoothing coefficient means that the smoothing coefficient of the exponentially weighted moving average in the preset delay prediction model is automatically reduced. The current smoothing coefficient is multiplied by a preset attenuation factor less than 1, such as 0.9, to obtain a new smoothing coefficient, making the model more sensitive to recent deviation changes. At the same time, the current instantaneous delay deviation is used as a feedback term and substituted into the preset delay prediction model to recalculate the predicted delay deviation for the next time period, forming a closed-loop iteration. The preset attenuation factor is set in advance by preset personnel.
[0027] It should be noted that the preset time delay prediction model used in this embodiment is specifically an exponentially weighted moving average model. An autoregressive moving average model or a simple moving average model can also be used. The specific training process is as follows: First, extract continuous time period sequences from historical time periods, with each time period corresponding to an instantaneous time delay deviation value. These are arranged in chronological order to form a deviation training sequence. Next, a smoothing coefficient is preset based on the fluctuation amplitude of the historical deviation sequence, for example, 0.8~0.98, for model training. Prediction error is evaluated, and the model parameters with the smallest prediction error are selected as the final configuration. Finally, the trained and validated model is used for real-time prediction. That is, the instantaneous time delay deviation of the number of time periods closest to the current data consistency monitoring time period is used as input, and the predicted time delay deviation for the next time period is output. This process ensures that the preset time delay prediction model can adapt to the time delay variation patterns under different operating conditions.
[0028] As described above, dynamic time-shift compensation of water quality optical sensors helps to actively reduce time-series offsets caused by differences in the response characteristics of optical sensors, reduce the degree of node misalignment of sampled data on the time axis, reduce subsequent amplitude misjudgment and coupling distortion caused by asynchronous response failure to be corrected in time, improve the time alignment accuracy and synchronous acquisition quality of the original measurement data of optical sensors, suppress the propagation of time-series errors from the data source, and thus provide a high-fidelity input data foundation for cross-index coupling consistency verification.
[0029] Preferably, the specific process of Bayesian inversion amplitude correction is as follows: Step 3.1, obtain physicochemical coupling constraints, including turbidity and COD proportional constraints, turbidity and chromaticity proportional constraints, and turbidity and chlorophyll inverse correlation constraints. The specific acquisition process is as follows: Since the proportion of organic matter carried by suspended particulate matter is relatively stable in normal water quality without cross-interference, the turbidity value is positively correlated with the COD UV absorbance value, and the turbidity value is positively correlated with the chromaticity value. Therefore, the COD UV absorbance value should be consistent with the turbidity value at the same sampling time. The relationship is linear, meaning there is a direct proportionality constraint between turbidity and COD. The chromaticity value and the turbidity value at the sampling time satisfy a linear relationship, i.e., there is a direct proportionality constraint between turbidity and chromaticity. This constraint is defined as follows: the actual COD UV absorbance value equals the turbidity value at the same sampling time multiplied by a preset standard proportionality coefficient, plus a preset random error. The preset standard proportionality coefficient is obtained by linear regression of turbidity values and COD UV absorbance values over a historical time period. The preset random error follows a Gaussian distribution with a mean of zero and is preset by the designated personnel. The turbidity and chromaticity proportionality constraint is used to characterize the deviation of actual data from the linear relationship. The actual chromaticity value is equal to the turbidity value at the same sampling time multiplied by the preset chromaticity standard proportional coefficient, plus a preset chromaticity random error. The preset chromaticity random error follows a Gaussian distribution with a mean of zero. It is obtained by calculating the variance of the regression residual after linear regression of turbidity and chromaticity values under historical stable operating conditions. It is used to characterize the degree of random fluctuation between the actual chromaticity value and the turbidity proportionality relationship. Since the scattering attenuation of fluorescence by suspended matter will lead to a decrease in fluorescence intensity, the fluorescence intensity value and turbidity value should satisfy an inverse correlation. Therefore, the fluorescence intensity value and turbidity amplitude should satisfy an inverse correlation, i.e., there is a chlorophyll inverse correlation constraint. The chlorophyll inverse correlation constraint is that the actual fluorescence intensity value is equal to the negative value of the turbidity value multiplied by the preset fluorescence proportional coefficient, plus a preset fluorescence random error. The preset fluorescence random error also follows a zero-mean Gaussian distribution and is set in advance by the preset personnel. The preset fluorescence proportional coefficient is obtained by linear regression of turbidity values and fluorescence intensity values over a historical time period.
[0030] Step 3.2: Obtain the prior mean vector and prior covariance matrix based on the physicochemical coupling constraint. The specific acquisition process is as follows: First, define the state vector. ,in This represents the actual turbidity value at the k-th sampling time. This represents the actual COD UV absorbance value at the k-th sampling time. This represents the actual chromaticity value at the k-th sampling time. This represents the actual fluorescence intensity value at the k-th sampling time. For preset standard ratio coefficients, For preset colorimetric standard ratio coefficients, Let a be a preset fluorescence ratio coefficient, a be a preset random error, b be a preset chromaticity random error, and c be a preset fluorescence random error, and construct a prior mean vector. , can be represented as Dividing the sum of squared residuals of each regression model under historical stable operating conditions by the degrees of freedom yields the regression residual variances of each index. Based on these regression residual variances, the prior covariance matrix can be obtained, which can be expressed as: ; Where W represents the prior covariance matrix, This represents a diagonal matrix, where the diagonal elements are the variances of the regression residuals for each indicator. This represents the variance of the turbidity regression residuals. This represents the variance of the COD regression residuals. This represents the variance of the chromaticity regression residuals. This represents the variance of the fluorescence intensity regression residuals. Specifically, the process for obtaining the variance of the COD regression residuals is as follows: Turbidity values and COD UV absorbance values from multiple sampling times during a historical stable period are selected. A linear regression equation is fitted using the least squares method. For each sampling point, the difference between the actual COD UV absorbance value and the regression prediction value, i.e., the residual, is calculated. The residuals of all sampling points are squared and summed to obtain the sum of squared residuals. The sum of squared residuals is then divided by the degrees of freedom, which is equal to the number of sampling points minus the number of regression parameters. Here, the parameters are... The variance of the COD regression residual is obtained by counting the number of values as 1. Similarly, the process of obtaining the variance of the chromaticity regression residual and the variance of the fluorescence intensity regression residual is the same as that of obtaining the variance of the COD regression residual. The variance of the turbidity regression residual is obtained by a very small positive number preset by the pre-defined personnel. The prior covariance matrix represents the degree of uncertainty of the physical-chemical coupling constraint. The larger the diagonal element, the weaker the coupling relationship of the corresponding index. The prior mean vector and the prior covariance matrix are substituted into the existing Gaussian joint prior distribution form to obtain the joint prior distribution.
[0031] Step 3.3: Using the raw measurement data sequences from the optical sensors of the amplitude anomaly sensor, such as COD UV absorbance sequences, fluorescence intensity sequences, and chromaticity sequences, as the observation data for the existing Gaussian likelihood function, the water quality observation likelihood function is obtained; the water quality observation likelihood function can be characterized as... , indicating that in a given actual state x k Under the given conditions, the observed current measurement value z k The probability, x k Let z be the actual state vector at the k-th sampling time, containing the actual values of various water quality multi-source indicators at that time, such as actual turbidity, actual COD UV absorbance, actual color, and actual fluorescence intensity. It is an unknown quantity to be estimated and needs to be solved by Bayesian inversion recursion; kThe observation vector at the k-th sampling time is composed of the raw measurement values directly collected by each optical sensor and is the known input data.
[0032] Based on Bayes' theorem, a Bayesian inversion recursion is performed on the joint prior distribution and the water quality observation likelihood function. The specific process is as follows: The joint prior distribution is used as the initial probability of the actual values at the current sampling time, including the actual COD UV absorbance, actual chromaticity, and actual fluorescence intensity values. The water quality observation likelihood function is used as the probability mapping between the observed data and the actual values. Based on Bayes' theorem, the joint prior distribution is multiplied by the observation likelihood function and normalized to obtain the posterior distribution. The posterior distribution is a probabilistic description of the actual values monitored by the amplitude anomaly sensor, incorporating physicochemical coupling constraints and current observation data. It gives the probability density of all possible values of the actual value, and the posterior distribution remains a Gaussian distribution. Based on the recursive Bayesian estimation, a recursive prediction is performed sequentially for each sampling time to obtain the posterior mean and posterior covariance at the current time. The recursive prediction is performed with each sampling time... The observation vector at each time point is taken as input, and the corresponding posterior mean and posterior covariance are taken as output, until all sampling points within the current data consistency monitoring period are processed. The posterior mean represents the optimal estimate of the true value of each amplitude anomaly sensor after incorporating the physicochemical coupling constraint and the current observation data. It includes the posterior estimates of the turbidity value, COD UV absorbance value, fluorescence intensity value, and chromaticity value at the current sampling time. The posterior covariance matrix represents the uncertainty of this optimal estimate. The smaller the diagonal element, the more reliable the estimate. The original measurement value of the amplitude anomaly sensor at each sampling time within the current data consistency monitoring period is corrected to the corresponding component in the posterior mean of the corresponding time. For example, if the COD UV absorbance sensor is marked as an amplitude anomaly sensor, then its original COD UV absorbance is replaced with the posterior estimate of the UV absorbance value.After calibration, the amplitude ratio parameter of the corresponding amplitude anomaly sensor is recalculated, and compared with the previously acquired amplitude ratio parameter to verify the effectiveness of the calibration. The specific verification process is as follows: If the re-acquired proportional coefficient deviation index is less than the previously acquired proportional coefficient deviation index, a cross-index coupling consistency check is performed; otherwise, the corresponding amplitude ratio parameter of the water quality optical sensor is uploaded to the water quality data acquisition and processing center. The water quality data acquisition and processing center uses this amplitude ratio parameter as feedback information to dynamically adjust the constraints of the prior covariance matrix, enhancing the constraint effect of the physicochemical coupling relationship. The proportional coefficient deviation index is determined by recalculating the amplitude ratio parameter of the water quality optical sensor. The results of calculating the absolute value of the difference between the amplitude proportional coefficient of the corresponding amplitude anomaly sensor and the corresponding proportional deviation threshold are represented as follows: COD amplitude proportional coefficient deviation index, chromaticity amplitude proportional coefficient deviation index, and chlorophyll fluorescence drift deviation index. The COD amplitude proportional coefficient deviation index is obtained by calculating the absolute value of the difference between the newly acquired COD UV absorbance amplitude proportional coefficient and the corresponding preset COD proportional deviation threshold; the chromaticity amplitude proportional coefficient deviation index is obtained by calculating the absolute value of the difference between the newly acquired chromaticity amplitude proportional coefficient and the corresponding preset chromaticity proportional deviation threshold; and the chlorophyll fluorescence drift rate deviation index is obtained by calculating the absolute value of the difference between the newly acquired chlorophyll fluorescence drift rate and the corresponding preset chlorophyll proportional deviation threshold.
[0033] As described above, Bayesian inversion amplitude correction helps to fully utilize prior knowledge of physical-chemical coupling to probabilistically estimate and correct sensor amplitude detuning, reduce response intensity ratio deviation caused by cross-interference, reduce the contamination of amplitude anomalies on cross-index coupling consistency verification and self-attention feature extraction, improve the physical consistency, numerical accuracy and overall reliability of multi-parameter data, achieve statistical optimal approximation of sensor observations to the real water quality state, and thus enhance robustness and adaptability under complex influent fluctuations and sensor performance degradation conditions.
[0034] Preferably, the specific process of cross-index coupling consistency verification is as follows: Step 4.1: Obtain multi-source water quality indicators, including turbidity, COD UV absorbance, color, fluorescence intensity, pH (monitored by a pH sensor), dissolved oxygen (monitored by a fluorescence dissolved oxygen sensor), and ammonia nitrogen (monitored by an ammonia nitrogen sensor); Step 4.2: Obtain the normalized coupling residual for each current multi-source water quality indicator; the specific calculation formula for the normalized coupling residual is as follows: ; Where R_i(t) is the normalized coupling residual of target index i at time t, i represents the index number of the current target index among the multi-source water quality indicators, t represents the sampling time, x'_i(t) represents the value of the multi-source water quality indicator at sampling time t, and x_hat_i(t) represents the expected value of the target index. The standard deviation of the residuals during the historical stable period is used to make the residuals dimensionless. The larger the coupling residual, the further the measured value of the current indicator deviates from the expected value predicted by other indicators, that is, the worse the coupling consistency between the current indicator and the overall water quality status.
[0035] Step 4.3: Obtain the coupling confidence level for each index based on the normalized coupling residual; the specific formula for calculating the coupling confidence level is as follows: ; Where C_i(t) is the coupling credibility of target index i at time t, and Theta_i R The preset quantile threshold for the historical stable period residuals, such as the 95th quantile, is used. The coupling confidence value ranges from 0 to 1. A higher coupling confidence value indicates a higher cross-index confidence of the current indicator. Specifically, when R_i(t) ≤ Theta_i R When C_i(t) ≥ 0 and approaches 1 as the residual decreases; when R_i(t) > Theta_i R When C_i(t) = 0, it indicates that the indicator is seriously inconsistent with the overall water quality status. The specific process for obtaining the expected value of the target indicator, the preset residual standard deviation, and the preset quantile threshold of the preset stable residual is as follows: Input the multi-source water quality indicators of the historical time period into the preset coupling model, output the expected value of the target indicator, and simultaneously obtain the standard deviation of the historical stable period residual and the preset quantile threshold of the historical stable period residual. The preset coupling model can use methods such as correlation matrix, partial correlation analysis, random forest feature contribution estimation, or lightweight neural network prediction residual. Its function is to estimate the expected value of the current target indicator based on the measured values of other indicators besides the target indicator. The specific training process of the preset coupling model is as follows: First, select the preset quantile threshold from the multi-source water quality indicators of the historical stable period. The training set is set with a sample size of 100 samples, and the remaining samples are used as the validation set. Then, for each target indicator, a pre-defined coupled model is trained using the measured values of other indicators as input features and the true value of the target indicator as the output label. Next, the pre-defined coupled model is evaluated using the validation set. The measured values of all indicators except the target indicator for each sample in the validation set are input into the model to obtain the expected value of the target indicator output by the model. Then, the expected value of the target indicator is subtracted from the corresponding true value in the validation set, and the absolute value is taken to obtain the prediction residual for each sample. Finally, the standard deviation of all prediction residuals in the training and validation sets is calculated to obtain the standard deviation of the historical stable period residuals. Simultaneously, the pre-defined quantiles of the prediction residuals are obtained to obtain the pre-defined quantile threshold of the historical stable period residuals.
[0036] Based on coupling credibility, a hierarchical label is generated for each indicator. The specific process is as follows: If the coupling credibility is lower than a preset first threshold, the corresponding indicator is marked as a low-coupling credibility indicator; if the coupling credibility is between the preset first threshold and the preset second threshold, including the endpoints of the thresholds, the corresponding indicator is marked as a medium-coupling credibility indicator. The preset first threshold is represented by the average coupling credibility over a historical time period, and the preset second threshold is set in advance by preset personnel; if the coupling credibility is higher than the second preset threshold, the corresponding indicator is marked as a high-coupling credibility indicator, where the preset first threshold is less than the preset second threshold.
[0037] Step 4.4: Arrange the coupling credibility of all water quality multi-source indicators in a preset order to form the current cross-indicator credibility vector. The preset order is set in advance by preset personnel. Step 4.5: Determine whether the water quality multi-source indicators are conflicting indicators. The specific determination process is as follows: If the coupling credibility of the current indicator is lower than a preset first threshold, and at least a preset number of other indicators with strong coupling relationships to the current indicator have coupling credibility higher than a preset second threshold, then the current indicator is determined to be a conflicting indicator, indicating that the measured or corrected value of this indicator may still have unresolved amplitude misalignment or timing misalignment. In other cases, the current indicator is determined to be a conflicting indicator. The target is not a conflicting indicator; the number of preset indicators is set in advance by preset personnel. Other indicators that have a strong coupling relationship with the current indicator are defined as the set of indicators that have a strong coupling relationship with the current indicator. Under historical stable operating conditions, based on multi-parameter correlation analysis, the Pearson correlation coefficient or Spearman rank correlation coefficient between various water quality multi-source indicators is obtained. Other indicators whose absolute value of the correlation coefficient is greater than the preset strong coupling threshold are defined as the set of indicators that have a strong coupling relationship with the current indicator. Each indicator in this set of indicators has a significant synergistic change relationship with the current indicator in terms of physicochemical mechanism, such as the positive correlation between turbidity and COD ultraviolet absorption intensity, and the inverse correlation between turbidity and fluorescence intensity. These conflicting indicators are grouped into a conflicting water quality multi-source indicator group.
[0038] As described above, cross-indicator coupling consistency verification helps to quantify the degree of coordinated deviation between each water quality indicator and the overall water quality status, reduce the false alarm rate of misjudging real anomalies due to noise or residual interference of a single indicator, reduce the pollution spread caused by distortion of coupling relationship in subsequent feature extraction, improve the ability to identify conflicting indicator groups and ensure physical rationality during data cleaning, realize secondary verification of data quality from the perspective of cross-variable collaboration, and thus provide a reliable stratification basis for the acquisition of self-attention dynamic features.
[0039] Preferably, self-attention dynamic feature acquisition and prediction input construction are performed based on coupling residuals, cross-index credibility vectors, and a list of conflicting water quality multi-source index groups. The specific process is as follows: Step 5.1, based on the coupling residuals, cross-index credibility vectors, list of conflicting water quality multi-source index groups, and historical prediction errors of each index in the multi-source water quality indexes, obtain the data credibility score for each index; the specific formula for obtaining the data credibility score is as follows: ; Where Qi(t) is the data reliability score of indicator i, mi(t) represents the proportion of missing data of indicator i during the data consistency monitoring period, with a value range of 0 to 1. The smaller the value, the more complete the data. It is represented by the difference between the total number of preset indicator sampling points and the actual number of sampling points of indicator i, and then the result of the difference operation is divided by the total number of preset indicator sampling points. C_i(t) represents the coupling reliability of indicator i, Ei(t-1) represents the normalized value of historical prediction error in the previous data consistency period, with a value range of 0 to 1. The smaller the value, the more accurate the historical prediction. α1, α2, α3 are preset weight coefficients. This score comprehensively reflects the completeness of indicator data, coupling consistency, and historical prediction reliability. The data reliability scores of all indicators form a data reliability score vector, which can be represented as Q(t)=[Q1(t),Q2(t),…,Qn(t)], where n is the total number of water quality multi-source indicators.
[0040] For indicators belonging to the list of conflicting water quality multi-source indicators, after calculating the corresponding data credibility score, a preset penalty coefficient is multiplied by the data credibility score to further reduce its weight in the subsequent attention mechanism. The preset penalty coefficient is pre-set by a pre-defined team. Step 5.2: Based on the data credibility score vector, obtain the credibility-adjusted self-attention weight. The specific process for obtaining the credibility-adjusted attention weight is as follows: Arrange the water quality multi-source indicators according to a preset indicator sorting order to obtain a water quality feature vector. The preset indicator sorting order is pre-set by a pre-defined team. Input the water quality feature vector into a preset self-attention model for linear transformation to obtain a water quality query vector and a water quality key vector. The water quality query vector represents the query feature of the current indicator in the attention mechanism, i.e., describing the information that the indicator is interested in. The water quality key vector represents the key feature of the current indicator when it is the object of attention, i.e., describing the feature information of the indicator itself. Obtain the credibility-adjusted attention weight based on the water quality query vector and the water quality key vector. The specific formula is as follows: ; Where A_i(t) represents the confidence-adjusted attention weight for the i-th indicator, and q_i represents the water quality query vector. This represents the transpose of the water quality bond vector. The dot product of the query vector and the key vector is used to measure the similarity between features. `d` is a scaling factor to prevent the dot product from becoming too large; its specific value is equal to the dimension of `q_i`. `λ` is the confidence adjustment coefficient, and `Qi(t)` is the data confidence score of the i-th indicator. This formula suppresses the attention weight of low-confidence indicators and enhances the attention weight of high-confidence indicators, thereby automatically reducing the impact of distorted data during feature aggregation. The confidence adjustment of all indicators forms a dynamic feature weight vector A(t) = [A1(t), A2(t), ..., An(t)]. This formula is designed based on the standard self-attention mechanism, specifically: to actively suppress the negative impact of low-confidence features and enhance the contribution of high-confidence features, the data confidence score is used as a bias term. The similarity score is superimposed on the credibility score and then normalized so that the credibility adjustment attention weights not only reflect the similarity between features, but also the data quality of each indicator itself, thereby achieving adaptive feature selection that enhances credible features and suppresses distorted features.
[0041] Step 5.4: Arrange the water quality feature vector, data confidence score vector, and dynamic feature weight vector in chronological order to obtain the water quality prediction input sequence. The water quality prediction input sequence can be represented as follows: Where r represents the preset historical window length, which is set in advance by preset personnel, such as 24 data consistency monitoring time periods, and F(t) is the predicted input sequence of the final output; This represents a three-dimensional tensor composed of all water quality multi-source indicators from time t-r+1 to t; , The time series consists of the corresponding data credibility score and dynamic feature weights, which can enable subsequent water quality predictions to adaptively adjust their reliance on historical information based on credibility.
[0042] It should be noted that when calculating the data credibility score in this application embodiment, three preset weight coefficients α1, α2, and α3 need to be obtained in advance. The process of obtaining the preset weight coefficients is as follows: First, extract multiple data segments under different operating conditions from historical water quality monitoring data, including the stable influent load period, the shock load period, the sensor performance decay period, and the period with high data missing incidence. Each segment contains the missing rate, coupling credibility, historical prediction error, and true data credibility value of each indicator. The true data credibility value refers to the benchmark reference value obtained by labeling the actual credibility of each target indicator in the corresponding time period through manual review or laboratory test results. Then, a multi-objective optimization algorithm, such as a non-dominated sorting genetic algorithm or a particle swarm optimization algorithm, is used to calculate the data credibility score of the three coefficients. The search is performed in the selection space, with the optimization objective being to maximize the consistency between the confidence score and the human ground truth, such as the area under the curve, while minimizing the root mean square error of the subsequent water quality prediction model. Next, the generalization performance of the candidate weight combination is evaluated through ten-fold cross-validation, removing solutions that perform worse than the baseline on the validation set and retaining the effective combinations on the Pareto front. Finally, for each typical operating condition feature, the feature vector consisting of the mean missing rate, the skewness of the coupling confidence distribution, and the variance of the prediction error, is combined with its corresponding optimal weight into an entry and stored in the dynamic knowledge database. During runtime, the system calculates the operating condition feature vector in real time within the current monitoring period, and uses nearest neighbor retrieval or weighted interpolation methods to match the closest operating condition entry from the dynamic knowledge database, outputting the corresponding α1, α2, and α3 values.
[0043] It should be noted that the preset self-attention model used in this embodiment is specifically a single-head self-attention layer. Multi-head self-attention layers or multi-layer self-attention stacked structures can also be used. Specifically, the training process of the preset self-attention model is as follows: First, a large number of samples are extracted from the historical water quality data consistency monitoring period. Each sample contains the water quality feature vector at the same sampling time and the corresponding target output, such as the true value of the water quality prediction at the next time moment or a manually labeled confidence label. These samples are divided into training set, validation set, and test set according to time order. Next, an initial self-attention layer containing a linear transformation matrix is constructed. The query weight matrix Wq and key weight matrix Wk are randomly initialized, and the initial values of the scaling factor d and the confidence adjustment coefficient λ are set. Then, a batch gradient descent method, such as the Adam optimizer, is used for iterative training on the training set. Each batch of water quality features is... The feature vector is input into the model, and attention weights and weighted aggregated feature representations are calculated through forward propagation. Then, a fully connected mapping layer outputs the water quality prediction value. The mean squared error between the predicted value and the true value is used as the loss function. The parameters of Wq, Wk, and subsequent mapping layers are updated layer by layer through backpropagation. After each training cycle, the loss is evaluated on the validation set and the learning rate is adjusted. If the validation loss no longer decreases after several consecutive cycles, training is terminated early. After training, the generalization ability of the model is verified using the test set. The Wq and Wk that minimize the validation loss are saved as the linear transformation matrix for final deployment. During online inference, the water quality feature vector at the current moment is directly multiplied by the trained Wq and Wk to obtain the water quality query vector and water quality key vector. This training process ensures that the self-attention model can extract the feature mapping relationship that is most effective for subsequent credibility adjustment.
[0044] As described above, the self-attention dynamic feature acquisition and prediction input construction helps to adaptively adjust the attention weights of each indicator based on the data credibility score during the feature aggregation stage. This reduces the contamination of the final feature representation by low-credibility features, reduces the accumulation of prediction bias caused by fixed-weight aggregation, improves the model's sensitivity to real water quality change signals and its anti-interference ability, and achieves the dominant representation of high-credibility features. In turn, it provides a more reliable and discriminative input sequence for downstream water quality prediction models.
[0045] Example 2, as an alternative to the preset coupling model in the cross-index coupling consistency verification of Example 1, addresses situations where the influent water quality composition of a wastewater treatment plant or industrial park water treatment system undergoes fundamental changes, such as upstream industrial wastewater mixing leading to a significant change in the proportion of organic matter in suspended solids. This renders the standard proportion coefficients in the physicochemical coupling constraints established under historical stable operating conditions inapplicable. In such cases, continuing to use the original fixed coupling model for residual calculation and reliability judgment would result in a large number of normal data being misjudged as coupling anomalies. To address this issue, this example proposes another dynamic update scheme for the preset coupling model. The specific process is as follows: After each data consistency monitoring period ends, the average coupling residual and the proportion of low-coupling reliability indicators for all indicators are obtained. The average coupling residual is represented by summing the normalized coupling residuals of all water quality multi-source indicators within the current data consistency monitoring period and dividing by the total number of water quality multi-source indicators. The proportion of low-coupling reliability indicators is represented by calculating the proportion of the number of indicators with coupling reliability below a preset first threshold within the current data consistency monitoring period to the total number of water quality multi-source indicators. If the number of consecutive preset time periods is... If the average coupling residual of the consistency monitoring period exceeds the preset average coupling threshold, and the proportion of low-coupling reliable indicators exceeds the preset proportion threshold, the current preset coupling model is deemed invalid, triggering a coupling model update. The preset average coupling threshold is represented by the average of the average coupling residuals over historical time periods, and the preset proportion threshold is represented by the average of the proportions of low-coupling reliable indicators over historical time periods. In other cases, the conventional preset coupling model is used. The specific process for updating the coupling model is as follows: Water quality multi-source indicators from the most recent preset sampling time period are used as a temporary training set. For each target indicator, the measured values of other indicators are used as input features, and the true value of the target indicator is used as the output label. A lightweight regression model, such as a random forest or ridge regression, is retrained. The preset sampling time period is pre-set by a predetermined group of personnel. The expected value of the indicator, the preset residual standard deviation, and the preset quantile threshold of the preset stable residual are re-obtained from the retrained coupling model. The updated coupling model is then used to re-obtain the normalized coupling residual and coupling reliability of the most recent data consistency monitoring time period.
[0046] As described above, the dynamic online update mechanism of the preset coupling model helps the coupling model continuously track the slow drift and sudden changes in the composition of the influent water quality, reduces the error rate of a large amount of normal data being misjudged as coupling anomalies due to outdated standard proportional coefficients, reduces the negative impact of accumulated deviations after long-term operation of the fixed model on cross-index consistency verification, improves the robustness and adaptability of the system under complex and variable working conditions, and enables the coupling model to automatically maintain the matching degree with the actual water quality without manual intervention, thereby ensuring the long-term accuracy of cross-index coupling verification.
[0047] like Figure 3 As shown in the embodiments of this application, the water quality data coverage, field types, and fluctuation characteristic maps of the AI-based intelligent water quality data acquisition and processing method are provided by... Figure 3 As can be seen: Sub-figure A is a chart showing the time coverage and site scale of the water quality data provided by this scheme. The horizontal axis is the sampling time axis, spanning from January 2022 to January 2025; the vertical axis represents the number of sites. The blue line represents the number of sites that should be sampled, which remained stable at 38 throughout the process; the orange line represents the actual number of effective sampling sites, with the value fluctuating slightly between 36 and 38. Overall, the number of monitoring sites is stable, and the sampling coverage scale is stable and controllable. Sub-figure B is a bar chart showing the missing rate of each input water quality field. The vertical axis represents input water quality fields such as conductivity, pH, and dissolved oxygen; the horizontal axis represents the percentage of missing data. The missing rates of all water quality indicators are only distributed within a very small range of 0.001% to 0.003%, indicating a low percentage of missing data in the overall dataset and high integrity of the original data. Sub-figure C shows the daily trend and spatial fluctuation of normalized pH. The horizontal axis is the sampling time axis from January 2022 to January 2025; the vertical axis represents the normalized pH. The pH output values after processing are shown; the dark blue curve represents the daily average change trend of the pH index, and the light blue filled area represents the standard deviation of pH values between monitoring stations, intuitively reflecting the temporal fluctuations of pH and the spatial variation between different stations. The overall normalized pH value oscillates stably within the range of 0.62 to 0.72; Subplot D is a heat map of the correlation between multiple water quality fields: the horizontal and vertical axes correspond one-to-one with completely consistent water quality fields; the color bars on the right represent Pearson correlation coefficients, with red indicating positive correlation (the darkest red coefficient approaching 1.00), blue indicating negative correlation (the darkest blue coefficient approaching -0.75), and light white indicating no significant correlation; the heat map clearly shows the strength of positive and negative correlations between various water quality indicators, such as the significant negative correlation between the average temperature and the average dissolved oxygen, which fully verifies that the basic dataset used in this AI water quality modeling is stable, has few missing samples, and has clear correlation patterns between indicators.
[0048] like Figure 4 As shown in the embodiment of this application, the cross-parameter coupling correlation diagram of multiple water quality indicators in the influent and effluent of a wastewater treatment plant, based on the AI-based intelligent water quality data acquisition and processing method, is derived from... Figure 4As can be seen, Subplot A represents a cross-index coupling correlation heatmap within a historical stable window, with the horizontal and vertical axes showing a completely consistent correlation structure between different water quality and treatment stage fields; the vertical bar color scale on the right represents the Pearson correlation coefficient, with darker red indicating a stronger positive correlation, lighter white indicating no significant correlation, and light blue-gray indicating a weak negative correlation; the color blocks visually represent the coupling strength between various influent and effluent indicators under stable operating conditions, such as a significant positive correlation between pollutants of the same type influent and effluent, and positive coupling relationships between conductivity and pH indicators; Subplot B represents single-index time-series coupling. The residual heatmap, with the vertical axis consistent with subplot A and the horizontal axis representing the time series, covers nearly 140 consecutive sampling days. The color axis on the right represents the normalized coupling residual values. Light green approaching 0 indicates a high degree of fitting coupling and minimal deviation. As the color gradually changes towards dark blue and black, the residual values increase, indicating that the index coupling deviates from the normal pattern at that time point. Overall, the residuals of each index are light green for most of the time periods, indicating good coupling consistency. This set of verification charts quantifies the inherent coupling and linkage patterns of influent and effluent water quality parameters during the stable operation of the wastewater treatment plant, ensuring the coupling consistency and reliability of the dataset during intelligent water quality data processing.
[0049] like Figure 5 As shown in the diagram, the self-attention dynamic feature operation mechanism of the AI-based intelligent water quality data acquisition and processing method provided in this application embodiment is... Figure 5 As can be seen, Sub-figure A represents the input of missing rate, coupling credibility, and historical error into the autonomous attention layer. After calculation, dynamic feature weights are output, ultimately resulting in differentiated attention weights that adapt to the credibility of the data, thus achieving the constraint and control of attention allocation by credibility. Sub-figure B is a bar chart comparing the weights of low-credibility fields being suppressed and credible fields being retained. The horizontal axis corresponds to the three credibility evaluation dimensions of missing rate, coupling credibility, and historical error. The vertical axis represents the feature attention weight values, with a value range of 0 to 0.6. The legend is divided into two types of bars: light blue bars represent the conventional attention weights without credibility intervention, and orange bars represent the corrected attention weights after credibility adjustment. As can be seen from the figure, the attention weights of high-credibility features are increased to retain them, while the weights of low-credibility features are reduced to suppress and filter them, thereby reducing the interference of low-quality water quality data on the accuracy of subsequent water quality prediction.
[0050] The above are merely specific embodiments of the present invention, but the scope of protection of the present invention is not limited thereto. The scope of protection of the present invention should be determined by the scope of the claims.
Claims
1. An AI-based intelligent water quality data acquisition and processing method, characterized in that, The method includes: To identify the physical and chemical coupling anomalies caused by misalignment in the response timing of multiple optical sensors, water quality data acquisition consistency monitoring is performed. Based on the monitoring results, cross-sensor asynchronous response anomalies are detected. If cross-sensor asynchronous response anomalies are detected, dynamic time-shift compensation or Bayesian inversion amplitude correction of water quality optical sensors is selected accordingly. If no cross-sensor asynchronous response anomaly is detected, then cross-index coupling consistency verification is performed, including cross-index confidence vector acquisition and judgment of whether multi-source water quality indicators conflict. After the cross-index coupling consistency verification is completed, self-attention dynamic feature acquisition and prediction input construction are carried out based on the verification results, including data credibility score vector acquisition, dynamic feature weight vector acquisition, and water quality prediction input sequence acquisition.
2. The AI-based intelligent water quality data acquisition and processing method according to claim 1, characterized in that, The specific process for monitoring the consistency of water quality data collection is as follows: During the data consistency monitoring period, the original measurement data sequences of the optical sensors were collected, including turbidity sequence, COD UV absorbance sequence, fluorescence intensity sequence and colorimetric sequence; The delay parameters and amplitude ratio parameters of the water quality optical sensor are obtained through the following process: The delay parameters of the water quality optical sensor include COD UV absorbance delay time, chromaticity delay time, and chlorophyll fluorescence drift delay time. The amplitude ratio parameters of the water quality optical sensor include the COD ultraviolet absorbance amplitude ratio coefficient, the chromaticity amplitude ratio coefficient, and the chlorophyll fluorescence drift rate; The moment when the instantaneous spike is detected by the turbidity sensor is recorded as the signal arrival time. Starting from the time the signal arrives at the reference point, an analysis window is formed by backtracking one sampling period and extending forward by a preset number of sampling periods. Within the analysis window, the COD UV absorbance sequence is calculated using a first-order difference algorithm to obtain the COD UV absorbance difference sequence. When the COD UV absorbance difference sequence meets the COD UV absorbance increase discrimination condition, the time of the first sampling point that meets the condition is recorded as the COD response increase start time. When the COD UV absorbance difference sequence does not meet the COD UV absorbance increase discrimination condition, the COD UV absorbance delay time and COD UV absorbance amplitude ratio coefficient are set to 0. The moment when the difference value in the COD UV absorbance difference sequence changes from positive to negative and the corresponding absorbance value is the first zero-crossing point of the maximum value within the analysis window is recorded as the COD response peak point. The time difference between the start time of the COD response rise and the time when the signal reaches the reference is used as the COD UV absorbance delay time relative to the turbidity peak of the COD UV absorbance sequence. The ratio of the COD UV absorbance value at the COD response peak point to the amplitude of the turbidity peak is used as the COD UV absorbance amplitude proportionality coefficient. Obtain the chromaticity delay time and chromaticity amplitude scaling factor; Based on the sliding window mean filtering algorithm, the fluorescence intensity sequence is filtered by the sliding window mean within the analysis window to obtain the cumulative change of each sampling point relative to the starting point of the analysis window; The cumulative change is represented by subtracting the filtered fluorescence intensity value of the first sampling point in the analysis window from the filtered fluorescence intensity value of the current sampling point and then taking the absolute value. When the cumulative change does not meet the fluorescence sensor drift condition, both the chlorophyll fluorescence drift delay time and the chlorophyll fluorescence drift rate are set to 0. When the cumulative change meets the fluorescence sensor drift condition, the time of the first sampling point where the cumulative change exceeds the preset drift start threshold is recorded as the chlorophyll fluorescence baseline drift start time. Determine whether the cumulative change satisfies the chlorophyll fluorescence baseline drift stabilization condition. If it does, record the first sampling point that satisfies the chlorophyll fluorescence baseline drift stabilization condition as the chlorophyll fluorescence baseline drift stabilization time. Otherwise, take the last sampling point in the analysis window as the stabilization point. The time difference between the start time of the chlorophyll fluorescence baseline drift and the arrival time of the signal at the reference time is taken as the chlorophyll fluorescence drift delay time. The chlorophyll fluorescence drift rate is obtained by dividing the difference between the fluorescence intensity value at the stable point of chlorophyll fluorescence baseline drift and the preset fluorescence intensity threshold by the drift duration. Based on the delay parameter and amplitude ratio parameter of the water quality optical sensor, it is determined whether there is an abnormality in cross-sensor asynchronous response.
3. The AI-based intelligent water quality data acquisition and processing method according to claim 2, characterized in that, The specific process for determining whether there is an anomaly in cross-sensor asynchronous response is as follows: For the delay parameters of water quality optical sensors, the decision on whether to implement dynamic time-shift compensation for water quality optical sensors is based on the comparison results with the delay anomaly conditions of water quality optical sensors. Specifically, when the delay parameters of water quality optical sensors meet the delay anomaly conditions, the optical sensors corresponding to the delay parameters that meet the delay anomaly conditions are marked as optically abnormal sensors, and dynamic time-shift compensation for water quality optical sensors is implemented. When the delay parameters of water quality optical sensors do not meet the delay anomaly conditions, the amplitude anomaly judgment is initiated. The amplitude anomaly discrimination refers to determining whether Bayesian inversion amplitude correction is necessary based on the comparison result between the amplitude ratio parameter of the water quality optical sensor and the amplitude anomaly condition of the water quality optical sensor. Specifically, when the amplitude ratio parameter of the water quality optical sensor meets the amplitude anomaly condition, the optical sensor corresponding to the amplitude ratio parameter of the water quality optical sensor that meets the amplitude anomaly condition is marked as an amplitude anomaly sensor, and Bayesian inversion amplitude correction is performed. Otherwise, cross-index coupling consistency verification is performed.
4. The AI-based intelligent water quality data acquisition and processing method according to claim 3, characterized in that, The specific process of dynamic time-shift compensation for the water quality optical sensor is as follows: Acquire the instantaneous time delay deviation of the corresponding optical anomaly sensor, including the instantaneous time delay deviation of COD ultraviolet absorbance, the instantaneous time delay deviation of chromaticity, and the instantaneous time delay deviation of chlorophyll; The instantaneous delay deviation of the data consistency monitoring time periods closest to the current data consistency monitoring time period is input into the preset delay prediction model in chronological order to obtain the predicted delay deviation of the corresponding optical anomaly sensor. Based on the predicted time delay deviation, the adaptive sampling trigger advance or adaptive sampling trigger delay of each optical anomaly sensor in the next data consistency monitoring period is obtained; For each optical anomaly sensor, when the corresponding prediction delay deviation is positive, the adaptive sampling trigger advance is obtained; The actual sampling time of the corresponding optical sensor is dynamically adjusted based on the adaptive sampling trigger advance. When the prediction delay deviation is negative, obtain the adaptive sampling trigger delay amount; The actual sampling time of the corresponding optical sensor is dynamically adjusted based on the adaptive sampling trigger delay.
5. The AI-based intelligent water quality data acquisition and processing method according to claim 4, characterized in that, The dynamic adjustment of the actual sampling time of the corresponding optical sensor based on the adaptive sampling trigger advance means that for each optical anomaly sensor with a positive prediction delay deviation, the sampling trigger time of the optical anomaly sensor is set to the unified reference clock time minus the adaptive sampling trigger advance. The dynamic adjustment of the actual sampling time of the corresponding optical sensor based on the adaptive sampling trigger delay means that for each optical anomalous sensor with a negative predicted delay deviation, the sampling trigger time of the optical anomalous sensor is set to the unified reference clock time plus the adaptive sampling trigger delay. After the dynamic time-shift compensation of the water quality optical sensor is completed, the corresponding instantaneous time delay deviation is reacquired. If the absolute value of the corresponding instantaneous time delay deviation is less than the absolute value of the previous corresponding instantaneous time delay deviation, then amplitude anomaly judgment is performed. If the corresponding instantaneous delay deviation is not less than the previous instantaneous delay deviation, the smoothing coefficient will be automatically reduced.
6. The AI-based intelligent water quality data acquisition and processing method according to claim 3, characterized in that, The specific process of Bayesian inversion amplitude correction is as follows: The physical-chemical coupling constraints were obtained, including the direct correlation between turbidity and COD, the direct correlation between turbidity and chromaticity, and the inverse correlation between turbidity and chlorophyll. The specific acquisition process is as follows: The turbidity-COD proportional constraint is that the actual COD UV absorbance value is equal to the turbidity value at the same sampling time multiplied by a preset standard proportional coefficient, plus a preset random error. The turbidity and chromaticity proportional constraint is that the actual chromaticity value is equal to the turbidity value at the same sampling time multiplied by a preset chromaticity standard proportional coefficient, plus a preset chromaticity random error. The chlorophyll inverse correlation constraint is that the actual fluorescence intensity value is equal to the negative value of the turbidity value multiplied by a preset fluorescence ratio coefficient, plus a preset fluorescence random error. The prior mean vector and prior covariance matrix are obtained based on the physical-chemical coupling constraint. Substituting the prior mean vector and prior covariance matrix into the Gaussian joint prior distribution form, we obtain the joint prior distribution; The original measurement sequence of the amplitude anomaly sensor is used as the observation data of the Gaussian likelihood function to obtain the water quality observation likelihood function; Bayesian inversion recursion is performed on the joint prior distribution and the likelihood function of water quality observations based on Bayes' theorem.
7. The AI-based intelligent water quality data acquisition and processing method according to claim 6, characterized in that, The specific process of the Bayesian inversion recursion is as follows: The joint prior distribution is used as the initial probability of the actual values at the current sampling time, including the actual COD UV absorbance value, actual chromaticity value and actual fluorescence intensity value. The water quality observation likelihood function is used as the probability mapping between the observed data and the actual values. Based on Bayes' theorem, the joint prior distribution is multiplied by the observation likelihood function and normalized to obtain the posterior distribution; Based on recursive Bayesian estimation, recursive prediction is performed sequentially for each sampling time to obtain the posterior mean and posterior covariance at the current time. The original measurement values of the amplitude anomaly sensor at each sampling time within the current data consistency monitoring period are corrected to the corresponding components in the posterior mean of the corresponding time. After calibration, the amplitude ratio parameter of the water quality optical sensor corresponding to the sensor with the abnormal amplitude is recalculated, and then compared with the previously obtained amplitude ratio parameter to verify the effectiveness of the calibration. The specific verification process is as follows: If the newly acquired proportional coefficient deviation index is less than the previously acquired proportional coefficient deviation index, a cross-index coupling consistency check is performed; otherwise, the corresponding water quality optical sensor amplitude ratio parameter is uploaded to the water quality data acquisition and processing center.
8. The AI-based intelligent water quality data acquisition and processing method according to claim 7, characterized in that, The specific process of the cross-index coupling consistency verification is as follows: Obtain multi-source water quality indicators; Obtain the normalized coupling residual for each current water quality multi-source indicator; The coupling reliability of each index is obtained based on the normalized coupling residual and the preset coupling model; Based on coupling credibility, hierarchical labels are generated for each indicator. The specific process is as follows: If the coupling credibility is lower than the preset first threshold, the corresponding index will be marked as a low coupling credibility index. If the coupling credibility is between the preset first threshold and the preset second threshold, the corresponding index will be marked as a medium coupling credibility index. If the coupling credibility is higher than the second preset threshold, the corresponding index will be marked as a high coupling credibility index. The coupling credibility of all water quality multi-source indicators is arranged in a preset order to form the current cross-indicator credibility vector; The specific process for determining whether multiple water quality indicators are conflicting indicators is as follows: If the coupling credibility of the current indicator is lower than the preset first threshold, and at least a preset number of other indicators that have a strong coupling relationship with the current indicator have a coupling credibility higher than the preset second threshold, then the current indicator is determined to be a conflicting indicator. These conflict indicators are grouped into a multi-source conflict water quality indicator group. Self-attention dynamic feature acquisition and prediction input construction are based on coupling residuals, cross-index credibility vectors, and lists of conflicting water quality multi-source index groups.
9. The AI-based intelligent water quality data acquisition and processing method according to claim 8, characterized in that, The specific process of acquiring self-attention dynamic features and constructing predictive inputs is as follows: Based on the coupling residuals of each indicator in the multi-source water quality indicators, the cross-indicator credibility vector, the list of conflicting multi-source water quality indicator groups, and the historical prediction error, the data credibility score of each indicator is obtained. Based on the data credibility score vector, obtain the credibility-adjusted self-attention weights; The specific process for obtaining the attention weights for credibility adjustment is as follows: The water quality feature vector is obtained by arranging the multi-source water quality indicators in a preset order. The water quality feature vector is input into a preset self-attention model for linear transformation to obtain the water quality query vector and the water quality key vector. Attention weights are adjusted based on the credibility obtained from the water quality query vector and water quality key vector.
10. The AI-based intelligent water quality data acquisition and processing method according to claim 8, characterized in that, The acquisition of the preset coupling model also includes: After each data consistency monitoring period ends, obtain the average coupling residual and the proportion of low-coupling reliable indicators for all indicators; If the average coupling residual of the data consistency monitoring period exceeds the preset average coupling threshold and the proportion of low coupling reliability indicators exceeds the preset proportion threshold, then the current preset coupling model is determined to be invalid and the coupling model is triggered to be updated. The specific process of updating the coupled model is as follows: The water quality multi-source indicators of the most recent preset sampling time period are used as a temporary training set. For each target indicator, the measured values of other indicators are used as input features and the true value of the target indicator is used as the output label. The lightweight regression model is then retrained. The expected value of the index, the preset residual standard deviation, and the preset quantile threshold of the preset stable residual are obtained again from the coupled model obtained from the retraining. The normalized coupling residuals and coupling confidence were re-acquired using the updated coupling model for the most recent data consistency monitoring period.
