A sewage treatment-oriented intelligent sensor-based domestic sewage water quality monitoring method
Patent Information
- Application Number
- CN202610714987.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-05-22
- Publication Date
- 2026-10-20
AI Technical Summary
基于当前水质综合状态向量对历史水质状态向量开展模式回溯,可完成历史水质数据的自动化检索与特征匹配,精准定位与当前综合状态向量相似度最高的历史污染事件特征片段,依托归一化状态分量完成历史片段与当前状态的差异比对,可直接生成污染因子贡献度列表,实现污染溯源环节的自动化运行,细化各污染因子的表征维度,精准量化不同污染因子对当前水质状态的影响程度,提升污染溯源结果的精准性,弱化人工分析带来的主观偏差,让污染因子的影响程度以量化形式呈现,保障溯源结果的客观性与一致性。
Smart Images

Figure FT_1 
Figure FT_2 
Figure FT_3
Abstract
Description
Technical Field
[0001] This invention belongs to the field of intelligent wastewater quality monitoring technology, specifically a method for monitoring the quality of domestic wastewater based on intelligent sensors for wastewater treatment. Background Technology
[0002] Current domestic sewage water quality monitoring technologies mostly use single sensors to collect water quality data, performing only basic outlier screening and missing value supplementation without aligning the data to a spatiotemporal reference. Feature extraction relies solely on single-scale analysis, and water quality assessment is primarily based on single parameter thresholds, failing to output a comprehensive state vector composed of multiple normalized components. Pollution source tracing depends on manual review of historical monitoring data, lacking automated pattern matching of historical water quality states. Furthermore, sensor array acquisition parameters are fixed and cannot be dynamically adjusted based on monitoring results.
[0003] Existing monitoring technologies suffer from insufficient data processing precision, lack multi-scale feature fusion, and offer only a single form of water quality status representation. They are unable to achieve automated retrospective analysis of historical pollution events and matching of similar fragments, and struggle to quantify the contribution of pollutants. Fixed sensor acquisition parameters cannot adapt to real-time changes in wastewater quality characteristics, resulting in a unidirectional monitoring process that fails to establish a closed-loop control mechanism.
[0004] This invention aims to solve the problems of the inability to automatically trace back historical pollution events and the inability to generate the contribution of pollution factors through difference comparison, while also solving the problems of the inability to dynamically adjust sensor acquisition parameters and the inability to form a closed-loop monitoring process. Summary of the Invention
[0005] This invention aims to solve at least one of the technical problems existing in the prior art; Therefore, this invention proposes a method for monitoring the water quality of domestic sewage based on intelligent sensors, which is aimed at sewage treatment, including: The raw water quality sensing data of the intelligent sensor array is collected, aligned with the spatiotemporal reference, and a water quality parameter time series matrix is generated. Then, outlier removal and missing value filling are completed to obtain the water quality parameter time series matrix after cleaning. The time-series matrix of the cleaned water quality parameters is input into a feature extraction device for multi-scale feature deconstruction to generate a fused feature set. Based on the fused feature set, a water quality status assessment network is constructed to perform state space mapping and output a comprehensive state vector of the current wastewater quality. The comprehensive state vector is composed of multiple normalized state components. Based on the comprehensive state vector, the pollution source tracing analysis module performs pattern backtracking on the historical water quality state vector to identify the feature fragments of historical pollution events that have the highest similarity to the current comprehensive state vector. The feature fragments of the historical pollution events are compared with the current comprehensive state vector to generate a list of pollution factors contributing to the current water quality. Based on the list of pollutant contributions, a sensor excitation parameter set for the next round of data acquisition is generated by the monitoring strategy adjuster. The sensor excitation parameter set is then sent to the intelligent sensor array, which controls the array to perform wastewater quality monitoring in the next cycle according to the new parameter configuration, thus forming a closed-loop monitoring process.
[0006] Furthermore, the process of aligning with a spatiotemporal reference to generate a water quality parameter time series matrix, followed by outlier removal and missing value imputation, yields a cleaned water quality parameter time series matrix, including: The system collects raw water quality sensing data, including turbidity voltage, chemical oxygen demand electrode response current, and ammonia nitrogen ion selective electrode potential, from intelligent sensor arrays deployed at key nodes of the sewage pipe network, forming a multidimensional raw data stream. Spatiotemporal benchmark alignment is performed on the multidimensional raw data stream to generate a time series matrix of water quality parameters that are sampled synchronously. The row vectors of the water quality parameter time series matrix correspond to different water quality indicators, and the column vectors correspond to the joint measurement values of multiple indicators at the same time. Anomaly removal and missing value imputation are performed on the water quality parameter time series matrix to obtain the cleaned water quality parameter time series matrix; The step of performing spatiotemporal benchmark alignment on the multidimensional raw data stream to generate a time-series matrix of synchronously sampled water quality parameters includes: The current reading of the internal clock and geographic location coordinates of each smart sensor in the smart sensor array are obtained to form a raw data packet containing timestamps, latitude and longitude coordinates and water quality index readings; Using the timestamp of the main smart sensor as a reference, the timestamps of the other subordinate smart sensors are resampled using linear interpolation to eliminate time deviations caused by transmission delays. The resampled data from each smart sensor is projected onto a unified geographic grid coordinate system according to its corresponding geographic location coordinates to achieve spatial alignment. The time- and spatially aligned multi-source data are arranged by row into sequences of different water quality indicators and by column into joint measurements at the same time, thus constructing the time series matrix of the water quality parameters.
[0007] Further, outlier removal and missing value imputation are performed on the water quality parameter time series matrix to obtain the cleaned water quality parameter time series matrix, including: For each row of the water quality index sequence in the water quality parameter time series matrix, calculate its moving average absolute deviation, and mark data points that deviate from the moving average absolute deviation by more than three times the standard deviation as outliers. For the marked outliers, the linear weighted value of the two normal sampling points before and after them is used to replace them, thus completing the removal and repair of outliers; For time periods with consecutive missing values, analyze the rate of change of water quality indicators before and after the time period, use an autoregressive model to predict the trend of water quality indicators within the missing value interval, and generate imputed values. The data, after anomaly repair and missing value filling, is reorganized into the time series matrix of water quality parameters after cleaning.
[0008] Furthermore, the time-series matrix of the cleaned water quality parameters is input into a feature extraction device for multi-scale feature deconstruction to generate a fused feature set, including: The fused feature set includes time-domain statistical features, frequency-domain energy features, and trend slope features; For each row of the index sequence in the time series matrix of the cleaned water quality parameters, calculate the mean, variance and peak value within the sliding window, which are used as the time domain statistical features; A Fourier transform is performed on the time-series matrix of the cleaned water quality parameters to convert the time-domain signal to the frequency domain, and the energy proportion of the main frequency components is extracted as the frequency domain energy feature. A polynomial fit is performed on the time series matrix of the water quality parameters after cleaning, the derivative of the fitted curve is calculated, and the value of the derivative at a specific time point is used as the trend slope feature. The time-domain statistical features, frequency-domain energy features, and trend slope features at the same time are concatenated to form a high-dimensional feature vector. The feature vectors at all times together constitute the fused feature set.
[0009] Furthermore, based on the fused feature set, a water quality status assessment network is constructed to perform state-space mapping, outputting a comprehensive state vector of the current wastewater quality, including: The water quality status assessment network is initialized, which includes an input layer, a hidden layer, and an output layer, wherein the number of nodes in the input layer is equal to the dimension of the feature vector in the fused feature set; The feature vectors in the fused feature set are used as inputs and fed into the input layer of the water quality status assessment network. In the water quality status assessment network, the input features are transformed and abstracted step by step through the nonlinear activation function of the hidden layer to extract a deep state representation. The output layer of the water quality state assessment network maps the deep state representation to a preset n-dimensional water quality state space and outputs n component values, which together form the comprehensive state vector.
[0010] Furthermore, based on the comprehensive state vector, the pollution source tracing analysis module performs pattern backtracking on the historical water quality state vector to identify the historical pollution event feature segments with the highest similarity to the current comprehensive state vector, including: Retrieve all tagged pollution events and their corresponding historical water quality state vector sequences from a long-term stored historical database to form a historical state database; Calculate the Euclidean distance between the integrated state vector and each historical water quality state vector in the historical state database, and use it as a similarity measure; Set a similarity threshold and filter out all candidate historical water quality state vectors whose Euclidean distance is less than the similarity threshold; Among the candidate historical water quality state vectors, the one with the smallest Euclidean distance is selected, and the historical state vector sequence segment containing it is taken as the feature segment of the historical pollution event.
[0011] Furthermore, the feature fragments of the historical pollution events are compared with the current comprehensive state vector to generate a list of pollution factor contributions to the current water quality, including: The difference vector is obtained by subtracting the feature fragments of the historical pollution events from the current comprehensive state vector dimension by dimension. For each component in the difference vector, the weighted difference vector is obtained by amplifying or reducing it according to the weight of its corresponding water quality index. Take the absolute value of each component in the weighted difference vector and sort them from largest to smallest to obtain the sorted difference sequence; The sorted difference sequence is associated with the corresponding water quality indicator name to generate a list of the pollution factor contributions sorted in descending order of contribution.
[0012] Furthermore, based on the pollution factor contribution list, a set of sensor excitation parameters for the next round of data acquisition is generated through the monitoring strategy adjuster, including: The sensor excitation parameter set includes the sampling frequency, measurement range, and filter coefficient of each sensor; Analyze the top-ranking pollutants in the list of pollutant contributions to determine the key water quality indicators that need to be monitored. For the aforementioned key water quality indicators, query the maximum measurement range and resolution limit of the corresponding smart sensors; Based on the current values and trends of the key water quality indicators, the sampling frequency of the smart sensors corresponding to the key water quality indicators is dynamically adjusted so that they can capture changes without excessively consuming resources in the current state. The adjusted sampling frequency, the optimal range set for each key water quality indicator, and the corresponding filter coefficients are packaged together to generate the sensor excitation parameter set.
[0013] Furthermore, the sensor excitation parameter set is sent to the intelligent sensor array to control it to perform wastewater quality monitoring in the next cycle according to the new parameter configuration, including: The sensor excitation parameter group is protocol encapsulated, and the address information and check code of the target smart sensor are added to form a control command packet; The control command packet is broadcast to the network where the smart sensor array is located via a wireless communication link; After receiving the control command packet, each smart sensor in the smart sensor array performs address parsing and verification. Once a match is confirmed, the local configuration register is updated with the new parameters carried in the control command packet. After the update is completed, each smart sensor starts the next round of data acquisition tasks according to the new parameter configuration, thus continuing the closed-loop monitoring process.
[0014] Furthermore, it also includes: After generating the comprehensive state vector, it is compared dimension by dimension with a pre-set water quality safety threshold vector. When any component in the comprehensive state vector exceeds the threshold of the corresponding component in the water quality safety threshold vector, an early warning mechanism is triggered to generate early warning information containing the name of the exceeding indicator and the magnitude of the exceeding. The warning information is associated with the current list of pollution factor contributions to form an enhanced warning information that includes cause inference, and then stored in the warning log.
[0015] Compared with the prior art, the beneficial effects of the present invention are: By performing pattern backtracking on historical water quality state vectors based on the current comprehensive water quality state vector, it is possible to automate the retrieval and feature matching of historical water quality data, accurately locate the feature fragments of historical pollution events with the highest similarity to the current comprehensive state vector, and compare the differences between historical fragments and the current state based on normalized state components. This can directly generate a list of pollution factor contribution, realize the automated operation of the pollution source tracing process, refine the representation dimensions of each pollution factor, accurately quantify the impact of different pollution factors on the current water quality state, improve the accuracy of pollution source tracing results, reduce the subjective bias caused by manual analysis, present the impact of pollution factors in a quantitative form, and ensure the objectivity and consistency of source tracing results.
[0016] Based on the list of pollutant contributions, a sensor excitation parameter set adapted to the current water quality state is generated through a monitoring strategy adjuster. This parameter set is then directly sent to the intelligent sensor array, changing the fixed acquisition parameter operation mode of the sensor array. This enables dynamic adjustment and autonomous configuration of the acquisition parameters, ensuring that the sensor's acquisition excitation parameters are adapted to the current water quality characteristics. This optimizes the targeting of data acquisition, making subsequent water quality sensor data more aligned with the analysis needs of water quality status assessment and pollution source tracing. The issuance and execution of the parameter set completes the closed-loop construction of the monitoring process, achieving full-process linkage of data acquisition, feature analysis, status assessment, pollution source tracing, and parameter adjustment. This enhances the autonomous control capability of the monitoring process, ensures the continuity of each monitoring link, and allows the monitoring configuration to iterate and optimize in real time with the water quality state, thereby enhancing the adaptability and operational smoothness of the entire monitoring system. Attached Figure Description
[0017] Figure 1 This is a flowchart illustrating the steps of a smart sensor-based method for monitoring the water quality of domestic sewage for wastewater treatment, as described in this invention. Figure 2 A flowchart for outlier removal and missing value imputation in the time series matrix of water quality parameters; Figure 3 A flowchart for multi-scale feature deconstruction and feature set generation; Figure 4 Configure analysis charts for sensor excitation parameters; Figure 5 This is a time-series monitoring chart of multiple indicators of domestic sewage quality. Detailed Implementation
[0018] The technical solution of the present invention will be clearly and completely described below with reference to the embodiments. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0019] See Figure 1Intelligent sensor arrays deployed at key nodes of the domestic sewage pipe network continuously collect raw sensor data reflecting water quality conditions. This raw data first undergoes a preprocessing stage, including spatiotemporal benchmark alignment to unify the spatiotemporal framework of data from different sensors, followed by outlier removal and missing value imputation, generating a regular and reliable cleaned water quality parameter time-series matrix. This matrix is then fed into a feature extraction device, where multi-scale feature deconstruction is performed through time-domain, frequency-domain, and trend analysis to form a fusion feature set that comprehensively characterizes the dynamic properties of water quality. Based on this, a water quality status assessment network is activated, mapping the high-dimensional fusion features to a low-dimensional, interpretable state space, outputting a comprehensive state vector composed of multiple normalized state components to quantify the overall current water quality status. The pollution source tracing analysis module is then activated, comparing the current comprehensive state vector with records in a historical database, identifying the most matching historical pollution event feature fragments by calculating similarity. By comparing the current state with these historical fragments, a list of pollution factor contributions ranked by impact degree can be generated, revealing the main potential causes leading to the current water quality status. Finally, based on the analysis results of the contribution list, the monitoring strategy adjuster dynamically calculates the optimal operating parameters for each sensor in the next monitoring cycle, i.e., the sensor excitation parameter set, and sends it to the sensor array. The sensor array is reconfigured according to the new parameters and starts the next round of monitoring, thus forming a closed loop of "sensing-analysis-decision-control" to achieve intelligent, refined, and adaptive monitoring of domestic sewage quality.
[0020] In one embodiment of the present invention, see [reference] Figure 2 A smart sensor array was deployed in a monitoring well downstream of the junction of a main pipeline in a domestic sewage network. The array contains three smart sensor nodes that measure turbidity, chemical oxygen demand (COD), and ammonia nitrogen concentration, respectively. Each smart sensor node operates according to a built-in independent clock and a preset sampling interval. At 10:00:00 on March 15, 2026, the turbidity sensor node collected a voltage value of Volt, its built-in clock reading is The coordinates recorded by the GPS module are The chemical oxygen demand sensor node collected the electrode response current as follows: Microamps, its built-in clock reading is The coordinates are The ammonia nitrogen sensor node collected the ion-selective electrode potential as follows: millivolts, its built-in clock reading is The coordinates are These raw readings, together with spatiotemporal information, constitute the initial multidimensional raw data stream.
[0021] In practical implementation, spatiotemporal benchmark alignment is performed on the multidimensional raw data stream to generate a time-series matrix of water quality parameters for synchronous sampling. The system designates the turbidity sensor with the highest clock accuracy as the master intelligent sensor. The timestamp of the turbidity sensor is used as the basis for this process. To standardize reference benchmarks, the timestamps of chemical oxygen demand (COD) sensors are used. and the timestamp of the ammonia nitrogen sensor There is a deviation from the reference standard. The time series data of the chemical oxygen demand (COD) sensor and ammonia nitrogen sensor were resampled using linear interpolation. Current reading at time Micro-amplitude, interpolation alignment to uniformity Reference time, interpolation result is Microampere, placing the ammonia nitrogen sensor in Potential reading at time millivolts, interpolation aligned to Reference time, interpolation result is millivolts. During the spatial alignment process, the coordinates reported by the three sensor nodes were all transformed and mapped to a Cartesian coordinate system grid with the monitoring well center as the origin, and the coordinates were unified as follows: The time-aligned and spatially aligned data is organized such that the row vectors of the matrix correspond to the three water quality indicators: turbidity, chemical oxygen demand, and ammonia nitrogen, while the column vectors correspond to... The combined measurement of the three indicators at this unified moment volt, microampere, millivolt The column vectors of multiple consecutive aligned times constitute the time series matrix of water quality parameters.
[0022] In some embodiments, outlier removal is performed on the time series matrix of water quality parameters. Taking the turbidity index sequence as an example, outlier removal is performed on the sequence including the current point. A sliding window containing a set of data points is used to calculate the mean of the data within the window. and moving average absolute deviation Moving average absolute deviation The calculation formula is: in: Represents a sliding window One data point within, This indicates the median calculation. If the current data point... satisfy Then the current data point Marked as an outlier. For example, in a certain sliding window, the mean turbidity reading is... Volts, moving average absolute deviation Calculated as Volts, and the reading at the center of the window is Volt, due to Therefore The volt reading was marked as an anomaly. For this anomaly, the readings from the adjacent normal sampling points before and after it were used. Volt and Volt is used for linear interpolation, and the interpolation result is used as the basis for further analysis. Volt replacement of original abnormal reading volt.
[0023] In some embodiments, missing value imputation is performed on the time series matrix of water quality parameters, and the chemical oxygen demand index sequence is in to The time period was interrupted by signal transmission, resulting in continuous gaps. A first-order autoregressive model was established by analyzing the rate of change of chemical oxygen demand (COD) readings in the period preceding the gaps. : ,in express Chemical oxygen demand reading at time 10:00 express Chemical oxygen demand reading at time 10:00 It is the autoregressive coefficient. It is a white noise sequence. Model parameters are fitted using historical data prior to the missing time period. Then, using this model, starting from the last valid data point, the missing time periods are predicted step by step. to The chemical oxygen demand (COD) readings at each moment are used to generate a sequence of missing values. Finally, the turbidity, COD, and ammonia nitrogen data, after anomaly repair and missing value filling, are reorganized to form a time-series matrix of water quality parameters after cleaning.
[0024] In one embodiment of the present invention, see [reference] Figure 3 The feature extraction device receives a time-series matrix of water quality parameters from the pretreatment process, which contains readings of three water quality indicators—turbidity, chemical oxygen demand (COD), and ammonia nitrogen—at continuous time points. For a given... Minutes are the intervals, and the length is... Turbidity index sequence of each sampling point The calculation of time-domain statistical features is performed on a preset length of The sliding window is used to move to the nth point in the sequence. To the When there are 1 data points, calculate the arithmetic mean of the turbidity readings within the window. Calculate the variance of turbidity readings within the window. And calculate the peak value of the turbidity reading within the window. mean ,variance and peak Together, they constitute the time-domain statistical characteristics of the central moment of this window.
[0025] In some embodiments, the frequency domain energy characteristics are obtained by performing a fast Fourier transform on a single water quality index sequence. For the same sequence of length... turbidity sequence Perform a Fast Fourier Transform to transform it from the time domain to the frequency domain, obtaining a frequency domain complex sequence. Calculate each frequency component. energy ,in Representing complex numbers The model. Find the one with the highest energy. Let the set of frequency components be denoted by their subscripts. Calculate the proportion of these main frequency energies to the total energy. ,Proportion It is extracted as the frequency domain energy feature of the turbidity sequence within the current analysis window.
[0026] Optionally, the trend slope feature is calculated using polynomial fitting for the above turbidity sequence. Based on sampling point number The independent variable is the turbidity reading. Using the least squares method as the dependent variable, a second-order polynomial is fitted to obtain the fitted curve function. ,in The sampling point number, , , The coefficients are the fit coefficients. This function is calculated at the end of the sequence. The first derivative value at derivative value The trend slope feature of the turbidity sequence at the end of the current analysis window is extracted. For the same analysis time, the time-domain statistical features, frequency-domain energy features, and trend slope features of the three indicators—turbidity, chemical oxygen demand, and ammonia nitrogen—are concatenated into a high-dimensional feature vector, such as a vector containing... Individual indicators ( One time-domain feature + Individual frequency domain features + Trend characteristics The eigenvectors of a dimension, and the set of eigenvectors at all analysis times constitute the fused feature set.
[0027] In practical implementation, a water quality status assessment network is constructed based on a fused feature set. This network comprises one input layer, two hidden layers, and one output layer. The number of neurons in the input layer is set to... The dimension of the first hidden layer is strictly equal to that of the fused feature vector. One neuron, using Activation function ,in This represents the weighted sum of the inputs to the neurons in this hidden layer. The second hidden layer design includes... Each neuron, also using Activation function. The output layer is designed to contain... A linear layer of neurons, with the output layer having a dimension of [missing information]. Corresponding to the preset The spatial state of water quality. When The fused feature vectors of dimension 1 are fed into the input layer of the water quality status assessment network, and the feature vectors are then processed by the nonlinear activation function of the first hidden layer. Transformation, followed by a nonlinear activation function in the second hidden layer. The transformation process involves progressive transformation and abstraction. The abstracted, deeper state representation is then passed to the output layer. Each neuron outputs a real value; these four real values are then processed... Normalization function processing, constrained by Within the interval, they together form a dimensional comprehensive state vector .
[0028] In one embodiment of the present invention, a pollution source tracing and analysis module is invoked. The module receives a comprehensive state vector output from the current monitoring cycle. The comprehensive state vector is a four-dimensional vector, denoted as... The pollution source tracing and analysis module accesses a long-term stored historical database, which records events that occurred within the past year. The identified pollution events each contain a sequence of historical water quality states arranged chronologically over the duration of the event. The historical water quality state vector sequence corresponding to each pollution event constitutes the historical state database. The calculation unit of the pollution source tracing analysis module sequentially reads each historical water quality state vector stored in the historical state database. For example, when reading the first historical water quality state vector recorded in the historical state database... The pollution event was at the Historical water quality state vector at any given time .
[0029] In some embodiments, the Euclidean distance between the integrated state vector and the historical water quality state vector is calculated as a similarity measure. and Euclidean distance between The calculation formula is as follows: in: Represents the integrated state vector The One portion, Represents the historical water quality state vector The Each component. Substitute in specific values, The pollution source tracing and analysis module presets a similarity threshold. When the calculated Euclidean distance Less than the similarity threshold At that time, the corresponding historical water quality state vector The vectors were identified as candidate historical water quality state vectors. The pollution source analysis module traversed all historical water quality state vectors in the historical state database, calculated all Euclidean distances, and filtered out all vectors with Euclidean distances less than 1. The candidate historical water quality state vectors are used to form a candidate set.
[0030] In some embodiments, the historical water quality state vector with the smallest Euclidean distance is selected from the candidate set, assuming that after traversal calculation, it is found to be the closest to the target vector. The historical water quality state vector with the smallest Euclidean distance is Its distance The pollution source tracing and analysis module then located... The historical record to which it belongs, namely the Pollution event number 1, and extracted the number 2 from the historical state database. The pollution event occurred during the following period. The corresponding sequence of all historical water quality state vectors This sequence segment was identified as the feature fragment of a historical pollution event with the highest similarity to the current integrated state vector.
[0031] Optionally, the feature fragments of historical pollution events are compared with the current comprehensive state vector to extract the feature fragments of historical pollution events. vector of time ,Will and By performing dimension-by-dimensional subtraction, we obtain the difference vector. The system has a pre-set weight vector for water quality indicators. Weight vector The four components correspond to the weights of the four dimensions of the comprehensive state vector, respectively, for the difference vector. Each dimension component Multiply by the water quality index weight vector The corresponding components The weighted difference vector is obtained. .
[0032] Optionally, for the weighted difference vector Taking the absolute values of each component in the matrix, we obtain... Sort these four absolute values in descending order. The sorting result is: Each value in the sorted difference sequence is associated with its corresponding water quality index name. Assuming the four dimensions of the comprehensive state vector correspond to "organic pollution index," "suspended solids index," "nutrient index," and "toxicity index," respectively, then the sorted absolute values... Related to "nutrient index", Related to the "organic pollution index", Related to "toxicity index", Associate with "Suspended Solids Index". Based on this association, generate a list of pollutant contributions sorted in descending order of contribution, with the following content: "Nutrient Index: 0.04", "Organic Pollution Index: 0.036", "Toxicity Index: 0.03", and "Suspended Solids Index: 0.02".
[0033] Understandably, after completing pattern retrospection and difference comparison, the pollution source tracing analysis module outputs historical pollution event characteristic fragments and a list of pollution factor contributions. The historical pollution event characteristic fragments can be used to trace potentially similar past pollution causes, while the pollution factor contribution list quantifies the degree to which each water quality indicator contributes to the current state's deviation from historical patterns. The pollution factor contribution list directly indicates the water quality indicators that require priority attention and adjustments to monitoring strategies; this list is then passed to the subsequent monitoring strategy adjustment module for decision-making.
[0034] In one embodiment of the present invention, the monitoring strategy adjuster receives a list of pollution factor contribution values from the pollution source analysis module. The list includes "Nutrient Index: 0.04", "Organic Pollution Index: 0.036", "Toxicity Index: 0.03", and "Suspended Solids Index: 0.02". The monitoring strategy adjuster parses this list to generate a sensor excitation parameter set for the next round of data acquisition. The sensor excitation parameter set includes the sampling frequency, measurement range, and filter coefficient of each sensor. The monitoring strategy adjuster identifies the top two pollutant contribution values, "Nutrient Index" and "Organic Pollution Index", as the key water quality indicators to be monitored in this round. The monitoring strategy adjuster queries the internally stored intelligent sensor hardware performance parameter table to obtain the performance parameters of the ammonia nitrogen ion selective electrode corresponding to the "Nutrient Index" and the chemical oxygen demand electrode corresponding to the "Organic Pollution Index". The maximum measurement range of the ammonia nitrogen ion selective electrode is... mg / L, resolution limit is The maximum measurement range of the chemical oxygen demand electrode is mg / L. mg / L, resolution limit is mg / L.
[0035] In some embodiments, the monitoring strategy adjuster dynamically adjusts the sampling frequency based on the current values and trends of key water quality indicators, such as the current reading of ammonia nitrogen concentration. mg / L, in the past Its slope of change within minutes Current reading of chemical oxygen demand (COD) in mg / L / min mg / L, and the slope of its change mg / L / min. The system's preset base sampling frequency. for The adjustment formula is as follows: (Times / minute) in: This represents the calculated new sampling frequency. It is the adjustment factor (set to) ), Represents the absolute value of the slope of change. This indicates the current reading. For an ammonia nitrogen sensor, the calculation... times / minute, rounded to the nearest integer. times / minute; for chemical oxygen demand (COD) sensors, calculation times / minute, rounded to the nearest integer. Times / minute. Due to its outstanding contribution, the system increased the sampling frequency of these two key indicators to [number missing]. times / minute, which is the sampling frequency for non-critical indicators. Times. At the same time, the optimal range for the ammonia nitrogen sensor is set to [value missing]. mg / L, the optimal range for the chemical oxygen demand sensor is set to mg / L, and configured cutoff frequencies for them respectively. The low-pass filter coefficients in Hertz. The monitoring strategy adjuster packages all the adjusted parameters to generate a sensor excitation parameter set, see Table 1.
[0036] Table: Example Table of Sensor Excitation Parameter Groups In practice, the sensor excitation parameter set is protocol-encapsulated to form a control command packet. This encapsulation process is completed within the monitoring strategy adjuster. The control command packet includes a frame header. Network address of the target sensor array Logical addresses of each sensor (ammonia nitrogen sensor) Chemical oxygen demand sensor Turbidity sensor pH sensor The data payload includes the packaged sensor excitation parameter set. A cyclic redundancy check (CRC) algorithm is used to calculate the checksum of the entire data payload. Bit check code Appended to the end of the control command packet, the frame header, address information, data payload, and checksum together constitute a complete control command packet. This is achieved through deployment in the field... The wireless communication gateway broadcasts control command packets in the form of wireless radio frequency signals to a network address of... The smart sensor array is located in Wireless sensor network.
[0037] Optionally, each smart sensor node in the smart sensor array continuously monitors the wireless channel. Upon receiving a broadcast control command packet, each node first performs address resolution. The ammonia nitrogen sensor node compares the target logical address in the control command packet. Logical address stored within itself After confirming a match, read the checksum at the end of the command packet. The system then recalculates the checksum on the received instruction packet data portion. The recalculated checksum is then compared with the received checksum. The verification codes were compared, and found to be completely identical, thus the verification passed. The ammonia nitrogen sensor node then parsed the data payload portion of the instruction packet and extracted the new operating parameters assigned to itself: sampling frequency. times / minute, measurement range mg / L, Filter Coefficient Hertz. The microcontroller of the sensor node writes the new sampling frequency value to the internal timer configuration register, the new measurement range value to the range control register of the analog front-end chip, and the new filter coefficient value to the filter parameter register of the digital signal processing unit, thus completing the update of the local configuration register.
[0038] Optionally, after the sensor excitation parameter set is issued and updated, each node in the smart sensor array starts working according to the new parameter configuration. The timer for the ammonia nitrogen sensor node is configured to be every Sampling is triggered once per second, and its analog front-end chip is set to... For the dosage range of mg / L, the digital filter unit's load cutoff frequency is [missing value]. The low-pass filter parameters are set in Hertz. The chemical oxygen demand (COD), turbidity, and pH sensors are also reconfigured based on the received parameters. After all sensor nodes have updated their parameters, they begin data acquisition from the next synchronization clock signal, following the new sampling frequency, range, and filter coefficients, thus continuing the closed-loop monitoring process. It is understandable that interference in the wireless communication link may cause some nodes to fail to receive commands. The monitoring strategy adjuster starts a confirmation timer after sending the command packet. If no configuration confirmation is received from all nodes within the timeout period, the monitoring strategy adjuster will resend the control command packet until all nodes have confirmed the update. It is understood that the distribution and updating of sensor excitation parameter sets enable the monitoring system to adaptively optimize resource allocation based on real-time analysis results, concentrating limited sampling and communication resources on monitoring water quality indicators most likely to cause problems.
[0039] See Figure 4 This is a diagram analyzing sensor excitation parameter configurations, visually illustrating the differences in sampling frequency and filter coefficient configurations among various water quality sensors, corresponding to the parameter distribution and configuration stages in the closed-loop wastewater quality monitoring process. The sampling frequency of ammonia nitrogen and chemical oxygen demand sensors is four times that of turbidity and pH sensors, reflecting the monitoring system's resource allocation towards high-contribution pollutants. Key indicator sensors employ low-pass filtering with low cutoff frequencies, effectively smoothing high-frequency noise, improving data stability, and facilitating the capture of slow pollution change trends. Conventional indicator sensors use high cutoff frequencies, ensuring real-time data while reducing computational and communication overhead. The diagram quantifies the technical advantages of the adaptive monitoring strategy, ensuring the monitoring accuracy of key indicators while avoiding the resource waste caused by high-frequency sampling of all indicators.
[0040] In one embodiment of the present invention, the system immediately executes a water quality safety assessment process after generating the comprehensive state vector. The system pre-stores a water quality safety threshold vector for comparison. This water quality safety threshold vector is a four-dimensional vector, defined as follows: Comprehensive state vector Also a four-dimensional vector, the result calculated in this monitoring period is: The system will synthesize the state vector. With water quality safety threshold vector Perform a dimension-by-dimensional comparison; the comparison operation is performed on each component of the vector. Execution, check conditions Whether it is valid, among which The range of values for is arrive , The first state vector represents the composite state vector. One portion, The first element representing the water quality safety threshold vector Each component. Substituting the specific values, for the first dimension component: The condition is met; for the second dimension component: The condition is not met; for the third dimension component: The condition is not met; for the fourth dimension component: , the condition is established.
[0041] In some embodiments, when a dimension-by-dimensional comparison reveals that any component in the integrated state vector exceeds the threshold of the corresponding component in the water quality safety threshold vector, an early warning mechanism is triggered. Based on the comparison results, the integrated state vector... First dimension component Exceeding the water quality safety threshold vector First-dimensional threshold Fourth dimension component Exceeding the water quality safety threshold vector Fourth dimensional threshold Therefore, the early warning mechanism is activated. The early warning mechanism generates an early warning message, which clearly indicates that the names of the exceeding indicators are the "organic pollution index" corresponding to the first dimension and the "toxicity index" corresponding to the fourth dimension, and calculates the exceedance range. For the "organic pollution index," the exceedance range is... Regarding the "toxicity index," the exceedance range was... The generated warning message text reads: "Warning: Water quality indicators exceed standards. Exceeding indicators: Organic pollution index, exceeding standard by 6.25%; Toxicity index, exceeding standard by 20.0%."
[0042] In some embodiments, the generated warning information is associated with a list of pollutant contribution levels generated in the same analysis period. The list of pollutant contribution levels includes "Nutrient Index: 0.04", "Organic Pollution Index: 0.036", "Toxicity Index: 0.03", and "Suspended Solids Index: 0.02". The system matches and associates the "Organic Pollution Index" and "Toxicity Index" exceeding the standards listed in the warning information with the entries with the same names and their contribution values in the list of pollutant contribution levels, forming an enhanced warning information that includes cause inference. The enhanced warning information adds "Analysis of the contribution of major potential pollutants: Organic Pollution Index contribution 0.036, ranked 2nd; Toxicity Index contribution 0.03, ranked 3rd" to the original warning information. The complete enhanced warning information text is: "Warning: Water quality indicators exceed standards. Exceeding indicators: Organic Pollution Index, exceeding standard range: 6.25%; Toxicity Index, exceeding standard range: 20.0%. Analysis of the contribution of major potential pollutants: Organic Pollution Index contribution 0.036, ranked 2nd; Toxicity Index contribution 0.03, ranked 3rd."
[0043] Optionally, enhanced early warning information including cause inference is stored in the early warning log. The early warning log is a database table in the system with timestamp recording functionality. When enhanced early warning information is generated, the system automatically obtains the current time "2026-03-16 14:30:25" as the timestamp, and combines the timestamp "2026-03-16 14:30:25" with the complete text content of the enhanced early warning information as a single record entry, writing it to the early warning log database table. The record written to the early warning log database table includes a "timestamp" field and a "warning content" field. The value of the "timestamp" field is "2026-03-16 14:30:25," and the value of the "warning content" field is the aforementioned complete enhanced early warning information text.
[0044] Optionally, enhanced early warning information, while stored in the early warning log, is also sent to an external system via a predefined system interface. The system calls an application programming interface to encapsulate the enhanced early warning information text according to a predefined "JavaScript object notation" format, forming a structured message. This message is then sent via Hypertext Transfer Protocol to a pre-configured Uniform Resource Locator address, i.e., the receiving endpoint of the monitoring center server. It can be understood that the execution of the early warning mechanism is independent of other steps in the closed-loop monitoring process; it is triggered immediately once the comprehensive state vector is generated and compared. It can also be understood that the early warning log database provides structured data records for the analysis and auditing of historical water quality safety events.
[0045] See Figure 5 This is a time-series monitoring chart of multiple indicators for domestic sewage quality, showing the dynamic trends of four core water quality indicators in sewage from March 16th to March 17th. Chemical oxygen demand (COD) was the most volatile indicator in this monitoring, peaking at 03:03 on March 17th and then surging again at 03:09 on March 17th. This indicates intermittent input of organic pollution load, possibly corresponding to peak domestic sewage discharge or localized pipe network pollution events. Turbidity and COD showed a weakly synchronous fluctuation trend, with significant peaks at 03:00 and 03:08 on March 17th, indicating a certain correlation between suspended solids content and organic pollution, possibly caused by the same type of sewage discharge source. Ammonia nitrogen concentration remained at a low level with only minor fluctuations, indicating a low risk of nutrient pollution. The pH value remained stable between 6 and 8, consistent with the slightly alkaline characteristics of domestic sewage, and no acid-base imbalance was observed.
[0046] The above embodiments are only used to illustrate the technical methods of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical methods of the present invention without departing from the spirit and scope of the technical methods of the present invention.
Claims
1. A method for monitoring the water quality of domestic sewage based on intelligent sensors for wastewater treatment, characterized in that, include: The raw water quality sensing data of the intelligent sensor array is collected, aligned with the spatiotemporal reference, and a water quality parameter time series matrix is generated. Then, outlier removal and missing value filling are completed to obtain the water quality parameter time series matrix after cleaning. The time-series matrix of the cleaned water quality parameters is input into a feature extraction device for multi-scale feature deconstruction to generate a fused feature set. Based on the fused feature set, a water quality status assessment network is constructed to perform state space mapping and output a comprehensive state vector of the current wastewater quality. The comprehensive state vector is composed of multiple normalized state components. Based on the comprehensive state vector, the pollution source tracing analysis module performs pattern backtracking on the historical water quality state vector to identify the feature fragments of historical pollution events that have the highest similarity to the current comprehensive state vector. The feature fragments of the historical pollution events are compared with the current comprehensive state vector to generate a list of pollution factors contributing to the current water quality. Based on the list of pollutant contributions, a sensor excitation parameter set for the next round of data acquisition is generated by the monitoring strategy adjuster. The sensor excitation parameter set is then sent to the intelligent sensor array, which controls the array to perform wastewater quality monitoring in the next cycle according to the new parameter configuration, thus forming a closed-loop monitoring process.
2. The method for monitoring the quality of domestic sewage based on intelligent sensors for sewage treatment according to claim 1, characterized in that, The process involves aligning with a spatiotemporal reference to generate a water quality parameter time series matrix, followed by outlier removal and missing value imputation to obtain the cleaned water quality parameter time series matrix, including: The system collects raw water quality sensing data, including turbidity voltage, chemical oxygen demand electrode response current, and ammonia nitrogen ion selective electrode potential, from intelligent sensor arrays deployed at key nodes of the sewage pipe network, forming a multidimensional raw data stream. Spatiotemporal benchmark alignment is performed on the multidimensional raw data stream to generate a time series matrix of water quality parameters that are sampled synchronously. The row vectors of the water quality parameter time series matrix correspond to different water quality indicators, and the column vectors correspond to the joint measurement values of multiple indicators at the same time. Anomaly removal and missing value imputation are performed on the water quality parameter time series matrix to obtain the cleaned water quality parameter time series matrix; The step of performing spatiotemporal benchmark alignment on the multidimensional raw data stream to generate a time-series matrix of synchronously sampled water quality parameters includes: The current reading of the internal clock and geographic location coordinates of each smart sensor in the smart sensor array are obtained to form a raw data packet containing timestamps, latitude and longitude coordinates and water quality index readings; Using the timestamp of the main smart sensor as a reference, the timestamps of the other subordinate smart sensors are resampled using linear interpolation to eliminate time deviations caused by transmission delays. The resampled data from each smart sensor is projected onto a unified geographic grid coordinate system according to its corresponding geographic location coordinates to achieve spatial alignment. The time- and spatially aligned multi-source data are arranged by row into sequences of different water quality indicators and by column into joint measurements at the same time, thus constructing the time series matrix of the water quality parameters.
3. The method for monitoring the quality of domestic sewage based on intelligent sensors for sewage treatment according to claim 2, characterized in that, Anomaly removal and missing value imputation are performed on the water quality parameter time series matrix to obtain the cleaned water quality parameter time series matrix, including: For each row of the water quality index sequence in the water quality parameter time series matrix, calculate its moving average absolute deviation, and mark data points that deviate from the moving average absolute deviation by more than three times the standard deviation as outliers. For the marked outliers, the linear weighted value of the two normal sampling points before and after them is used to replace them, thus completing the removal and repair of outliers; For time periods with consecutive missing values, analyze the rate of change of water quality indicators before and after the time period, use an autoregressive model to predict the trend of water quality indicators within the missing value interval, and generate imputed values. The data, after anomaly repair and missing value filling, is reorganized into the time series matrix of water quality parameters after cleaning.
4. The method for monitoring the quality of domestic sewage based on intelligent sensors for sewage treatment according to claim 3, characterized in that, The time-series matrix of the cleaned water quality parameters is input into a feature extraction device for multi-scale feature deconstruction to generate a fused feature set, including: The fused feature set includes time-domain statistical features, frequency-domain energy features, and trend slope features; For each row of the index sequence in the time series matrix of the cleaned water quality parameters, calculate the mean, variance and peak value within the sliding window, which are used as the time domain statistical features; A Fourier transform is performed on the time-series matrix of the cleaned water quality parameters to convert the time-domain signal to the frequency domain, and the energy proportion of the main frequency components is extracted as the frequency domain energy feature. A polynomial fit is performed on the time series matrix of the water quality parameters after cleaning, the derivative of the fitted curve is calculated, and the value of the derivative at a specific time point is used as the trend slope feature. The time-domain statistical features, frequency-domain energy features, and trend slope features at the same time are concatenated to form a high-dimensional feature vector. The feature vectors at all times together constitute the fused feature set.
5. A method for monitoring the water quality of domestic sewage based on intelligent sensors for sewage treatment according to claim 4, characterized in that, Based on the fused feature set, a water quality status assessment network is constructed to perform state-space mapping and output a comprehensive state vector of the current wastewater quality, including: The water quality status assessment network is initialized, which includes an input layer, a hidden layer, and an output layer, wherein the number of nodes in the input layer is equal to the dimension of the feature vector in the fused feature set; The feature vectors in the fused feature set are used as inputs and fed into the input layer of the water quality status assessment network. In the water quality status assessment network, the input features are transformed and abstracted step by step through the nonlinear activation function of the hidden layer to extract a deep state representation. The output layer of the water quality state assessment network maps the deep state representation to a preset n-dimensional water quality state space and outputs n component values, which together form the comprehensive state vector.
6. A method for monitoring the water quality of domestic sewage based on intelligent sensors for sewage treatment according to claim 5, characterized in that, Based on the comprehensive state vector, the pollution source tracing analysis module performs pattern backtracking on the historical water quality state vector to identify the feature fragments of historical pollution events with the highest similarity to the current comprehensive state vector, including: Retrieve all tagged pollution events and their corresponding historical water quality state vector sequences from a long-term stored historical database to form a historical state database; Calculate the Euclidean distance between the integrated state vector and each historical water quality state vector in the historical state database, and use it as a similarity measure; Set a similarity threshold and filter out all candidate historical water quality state vectors whose Euclidean distance is less than the similarity threshold; Among the candidate historical water quality state vectors, the one with the smallest Euclidean distance is selected, and the historical state vector sequence segment containing it is taken as the feature segment of the historical pollution event.
7. A method for monitoring the water quality of domestic sewage based on intelligent sensors for sewage treatment according to claim 6, characterized in that, The feature fragments of the historical pollution events are compared with the current comprehensive state vector to generate a list of pollution factor contributions to the current water quality, including: The difference vector is obtained by subtracting the feature fragments of the historical pollution events from the current comprehensive state vector dimension by dimension. For each component in the difference vector, the weighted difference vector is obtained by amplifying or reducing it according to the weight of its corresponding water quality index. Take the absolute value of each component in the weighted difference vector and sort them from largest to smallest to obtain the sorted difference sequence; The sorted difference sequence is associated with the corresponding water quality indicator name to generate a list of the pollution factor contributions sorted in descending order of contribution.
8. A method for monitoring the water quality of domestic sewage based on intelligent sensors for sewage treatment according to claim 7, characterized in that, Based on the pollution factor contribution list, the sensor excitation parameter set for the next round of data acquisition is generated by the monitoring strategy adjuster, including: The sensor excitation parameter set includes the sampling frequency, measurement range, and filter coefficient of each sensor; Analyze the top-ranking pollutants in the list of pollutant contributions to determine the key water quality indicators that need to be monitored. For the aforementioned key water quality indicators, query the maximum measurement range and resolution limit of the corresponding smart sensors; Based on the current values and trends of the key water quality indicators, the sampling frequency of the smart sensors corresponding to the key water quality indicators is dynamically adjusted so that they can capture changes without excessively consuming resources in the current state. The adjusted sampling frequency, the optimal range set for each key water quality indicator, and the corresponding filter coefficients are packaged together to generate the sensor excitation parameter set.
9. A method for monitoring the water quality of domestic sewage based on intelligent sensors for sewage treatment according to claim 8, characterized in that, The sensor excitation parameter set is sent to the intelligent sensor array to control it to perform wastewater quality monitoring in the next cycle according to the new parameter configuration, including: The sensor excitation parameter group is protocol encapsulated, and the address information and check code of the target smart sensor are added to form a control command packet; The control command packet is broadcast to the network where the smart sensor array is located via a wireless communication link; After receiving the control command packet, each smart sensor in the smart sensor array performs address parsing and verification. Once a match is confirmed, the local configuration register is updated with the new parameters carried in the control command packet. After the update is completed, each smart sensor starts the next round of data acquisition tasks according to the new parameter configuration, thus continuing the closed-loop monitoring process.
10. A method for monitoring the water quality of domestic sewage based on intelligent sensors for sewage treatment according to claim 9, characterized in that, Also includes: After generating the comprehensive state vector, it is compared dimension by dimension with a pre-set water quality safety threshold vector. When any component in the comprehensive state vector exceeds the threshold of the corresponding component in the water quality safety threshold vector, an early warning mechanism is triggered to generate early warning information containing the name of the exceeding indicator and the magnitude of the exceeding. The warning information is associated with the current list of pollution factor contributions to form an enhanced warning information that includes cause inference, and then stored in the warning log.
