Multi-source water quality abnormity early warning and automatic sample reserving system based on Internet of Things
By working in concert with a multi-source water quality sensor array and an edge computing gateway, multi-parameter coupled anomaly detection and dynamic baseline adaptive adjustment are achieved. This solves the problems of high false alarm rate and disconnect between early warning and sample retention in existing water quality monitoring systems, and provides an efficient solution for water quality anomaly early warning and automatic sample retention.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-01-04
- Publication Date
- 2026-04-14
AI Technical Summary
Existing water quality monitoring systems suffer from high false alarm rates and high risk of missed alarms due to the reliance on a single parameter threshold. Furthermore, the early warning system is disconnected from the sample retention process, lacks environmental adaptability, and cannot achieve real-time, high-precision identification of polluted water samples.
A multi-source water quality sensor array is constructed to work in collaboration with an edge computing gateway. Through multi-parameter coupled anomaly detection, dynamic baseline adaptive adjustment, and hierarchical early warning logic, low-latency water quality anomaly early warning and automatic sampling are achieved at the edge. Combined with a lightweight model and IoT communication, a closed-loop architecture from perception to execution is formed.
It has achieved high-precision identification and real-time location of water quality anomalies, provided a complete chain of pollution evidence, reduced false alarm rates, and improved the timeliness and reliability of environmental supervision.
Smart Images

Figure CN121856504A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of environmental monitoring and Internet of Things (IoT) technology. Specifically, it relates to a multi-source water quality anomaly early warning and automatic sampling system and method based on IoT. Background Technology
[0002] As water resource security increasingly becomes a core issue in national ecological governance and public health protection, IoT-based online water quality monitoring systems have been widely applied in key water bodies such as rivers, lakes, drinking water sources, and urban drainage networks. These systems continuously collect water quality parameters by deploying sensor nodes and transmit the data to a management platform via communication networks, providing fundamental support for early identification and emergency response to pollution incidents. In this technological evolution, early systems primarily focused on threshold-exceeding alarm mechanisms for single indicators (such as chemical oxygen demand or ammonia nitrogen concentration). Their design logic was simple, and hardware costs were low, effectively meeting basic monitoring needs in specific historical periods, particularly suitable for steady-state water environments with clearly defined pollution sources and slow water quality changes.
[0003] However, with the continuous development of related technologies and the increasingly stringent performance requirements of application scenarios, some inherent characteristics of the aforementioned technical solutions at the principle level have gradually revealed their limitations in addressing new challenges. Specifically, the single-parameter-dependent early warning model essentially ignores the multi-dimensional coupling characteristics of water pollution events—sudden pollution in the real world often manifests as a synergistic anomaly of multiple physicochemical parameters. For example, illegal industrial wastewater discharge is often accompanied by a combination of phenomena such as a sudden increase in turbidity, a decrease in dissolved oxygen, and a sudden change in conductivity. If an alarm is triggered solely based on the static threshold of a single indicator, it is highly susceptible to generating numerous false alarms due to short-term sensor drift, biological attachment, or local disturbances. Conversely, in some weak-signal pollution scenarios, a single parameter may not have reached the preset threshold but still constitute a potential risk, leading to missed alarms. Furthermore, existing systems generally adopt a fixed threshold strategy, failing to consider the natural fluctuations in water background values due to seasons, climate, or hydrological conditions. This results in a severe imbalance in the applicability of the same parameter threshold during the low-temperature winter period and the algal bloom period in summer, significantly weakening the long-term reliability of the early warning system.
[0004] While some studies have attempted to introduce machine learning models to predict or score water quality sequences, their technical approaches are mostly limited to post-processing in cloud data centers, failing to establish a real-time closed-loop linkage with front-end physical execution mechanisms. Crucially, such solutions often overlook the stringent constraints of edge devices in terms of power consumption, computing power, and storage resources. The complex models employed are difficult to deploy efficiently on low-power microcontrollers, resulting in uncontrollable time delays between anomaly identification and sample retention command issuance. Existing automatic sample retention devices largely rely on timed sampling or manual remote triggering mechanisms, lacking deep coupling with early warning logic. This prevents the simultaneous locking of contaminated water samples upon confirmation of an anomaly, leading to a dilemma of "evidence in the early warning, but no sample for tracing the source." The root cause lies in the fact that the current technological system has not yet established a collaborative architecture that integrates multi-source sensor information, dynamically adapts to environmental changes, and completes the entire "perception-judgment-execution" response chain at the edge. This fragmented state not only limits the improvement of early warning accuracy but also directly weakens the integrity and timeliness of the pollution evidence chain in environmental law enforcement.
[0005] Therefore, how to construct a water quality anomaly early warning system that can deeply integrate multi-parameter spatiotemporal correlation features, adaptively adjust the early warning threshold based on dynamic baseline, and realize low-latency hierarchical decision-making and synchronous triggering of physical sampling at the edge has become a key challenge and technical problem that needs to be solved by those skilled in the art. Summary of the Invention
[0006] This invention provides a multi-source water quality anomaly early warning and automatic sampling system and method based on the Internet of Things (IoT), aiming to solve the problems of high false alarm rate, high risk of missed alarm, poor environmental adaptability, and disconnect between early warning and sampling execution in existing technologies due to single-parameter threshold judgment. To achieve the above-mentioned objectives, this invention constructs a collaborative architecture that integrates multi-source sensor information, dynamic baseline adaptive adjustment, low-latency hierarchical decision-making at the edge, and synchronous triggering of physical sampling. This ensures that polluted water samples are locked and identified immediately upon the occurrence of water quality anomalies, thereby guaranteeing the integrity and timeliness of the pollution evidence chain.
[0007] The system comprises a multi-source water quality sensor array, an edge computing gateway, an intelligent sample retention control unit, an IoT communication module, and a cloud platform. The multi-source water quality sensor array, deployed at the target water monitoring point, includes a pH sensor, a turbidity sensor, a conductivity sensor, a dissolved oxygen sensor, and a temperature compensation module. The outputs of each sensor are connected to the edge computing gateway via a signal conditioning circuit. The edge computing gateway has a built-in microcontroller, whose main control chip uses an ARM Cortex-M7 architecture and runs a lightweight anomaly detection model. This model is used for multi-source data time alignment and noise filtering, dynamic baseline calculation based on a sliding window, multi-parameter coupled anomaly score generation, and graded early warning logic judgment. The intelligent sample retention control unit is connected to the edge computing gateway via a GPIO interface. Upon receiving an advanced early warning signal, it drives a peristaltic pump to extract water samples and inject them into the corresponding sample bottle. The sample bottle contains an RFID tag to record the sampling time, geographical location, and anomaly type code. The IoT communication module integrates NB-IoT and 4G dual-mode communication capabilities, uploading early warning events, sample retention status, and raw sensor data to the cloud platform after AES-256 encryption. The cloud platform provides a visual monitoring interface, historical data backtracking and analysis functions, and a remote update interface for model parameters, supporting online iterative optimization of lightweight models at the edge.
[0008] Furthermore, the multi-source data time alignment performed by the edge computing gateway is achieved by synchronizing the sampling clocks of each sensor using a hardware timer, with a fixed sampling period of 10 seconds. Noise filtering employs a combination of a moving average filter and wavelet threshold denoising, with a moving window length of 30 sampling points, a db4 wavelet basis function, and a decomposition level of 3. Dynamic baseline calculation is performed independently for each water quality parameter. Calculate the mean within a sliding window (window length is 7 days) at the current time t. with standard deviation And based on this, an adaptive threshold is generated. , where the coefficient The seasonal factor is dynamically adjusted based on the spring and autumn seasons. The value is 2.0 for spring and autumn, 2.3 for summer, and 1.8 for winter. The seasonal factor is determined by the real-time clock module in combination with preset calendar rules.
[0009] Furthermore, multi-parameter coupled anomaly detection is achieved by constructing a water quality parameter correlation matrix R. This matrix is calculated based on historical normal water quality data during the system initialization phase and refreshed each time a model update command is issued by the cloud platform. When any parameter... The real-time value exceeds its adaptive threshold And there is another parameter satisfy and Synchronization exceeds its adaptive threshold When an anomaly is detected, a primary alert is triggered, with the correlation coefficient threshold being used to determine the validity of the anomaly. The value is fixed at 0.7. The primary warning only sends alarm events to the cloud platform through the IoT communication module and does not initiate sampling operations.
[0010] Furthermore, the edge computing gateway incorporates an anomaly scoring engine to quantitatively evaluate the deviation of multiple parameters under the initial warning state. The anomaly score S(t) is defined as the weighted sum of the reconstruction errors of each parameter exceeding the threshold. The weights are determined by the parameter's contribution to historical pollution events, obtained through statistics from a historical event database trained offline on the cloud platform, and synchronized to the edge as the model is updated. When the duration of the initial warning reaches or exceeds a preset duration... (Fixed to 300 seconds) and the anomaly score S(t) reaches or exceeds the threshold. When the value is fixed at 0.85, the edge computing gateway generates an advanced warning signal and sends it to the intelligent sample retention control unit via the UART interface. Upon receiving the advanced warning signal, the intelligent sample retention control unit immediately starts a DC motor-driven peristaltic pump to extract 500 ml of water sample from the sampling tubing and inject it into the currently numbered sample bottle. The sample bottles are numbered sequentially by time, each with a capacity of 600 ml. The bottle cap contains a passive UHF RFID tag, whose storage area is divided into a timestamp field, a geographic coordinate field, and an anomaly type code field. The writing operation is completed by the RFID reader / writer connected to the sample retention control unit via the SPI interface. When the current sample bottle is full, the mechanical switching mechanism automatically rotates to the next empty bottle position and simultaneously sends a "full" signal to the edge computing gateway. The edge computing gateway then sends a "sample ready" notification to the cloud platform via the IoT communication module.
[0011] Furthermore, after receiving raw sensor data, early warning events, and sample status information from the IoT communication module, the cloud platform stores them in a time-series database and displays the real-time status of each monitoring point on a visualization interface using a map layer overlay. The cloud platform is also equipped with a model training server, which periodically collects anomaly scoring logs and sample results from each edge node, optimizes the correlation matrix R and anomaly scoring weights using supervised learning methods, and packages the updated model parameters into a firmware upgrade package, which is then distributed to the corresponding edge computing gateway via a secure OTA channel.
[0012] In a preferred embodiment of the present invention, the lightweight anomaly detection model deployed in the edge computing gateway is a Long Short-Term Memory Autoencoder (LSTM-AE). Its network structure includes a single-layer LSTM encoder, a bottleneck layer, and a single-layer LSTM decoder, with a total parameter size of less than 50KB. It can perform inference operations on an ARM Cortex-M7 core at a frequency of once every 10 seconds. During the training phase, the model uses a normal water quality dataset for unsupervised learning. During the inference phase, it outputs the reconstruction error of each parameter as the basic input for anomaly scoring.
[0013] In another preferred embodiment of the present invention, the temperature compensation module in the multi-source water quality sensor array is physically integrated with each physicochemical sensor. Its real-time temperature readings are used to compensate and correct the measured values of pH, dissolved oxygen and conductivity. The compensation algorithm is implemented by a lookup table method combined with linear interpolation. The lookup table data is stored in the non-volatile memory of the edge computing gateway.
[0014] In another preferred embodiment of the present invention, the IoT communication module performs integrity verification before data is uploaded, generates a check code using the CRC32 algorithm, and verifies it at the cloud platform receiving end. If the verification fails, a retransmission mechanism is triggered, with a maximum of 3 retransmissions. If the number of retransmissions exceeds 3, the data packet is marked as lost and logged.
[0015] The method of this invention includes the following steps: First, a multi-source water quality sensor array synchronously collects at least three water quality parameters, and sends the raw signals to an edge computing gateway via a signal conditioning circuit; second, the edge computing gateway performs time alignment and noise filtering on each parameter, and dynamically calculates the baseline mean and standard deviation of each parameter based on a sliding window to generate an adaptive threshold; third, it performs coupled anomaly detection based on a pre-constructed water quality parameter correlation matrix, and triggers a primary warning when multiple parameters simultaneously exceed the threshold and the correlation condition is met; if the duration of the primary warning and the anomaly score both reach preset conditions, an advanced warning signal is generated; finally, the intelligent sample retention control unit responds to the advanced warning signal and drives the sampling mechanism to complete the entire process of water sample extraction, injection, and sample bottle labeling.
[0016] Through the above-mentioned system architecture and method, this invention achieves high-precision identification of water quality anomalies and real-time locking of polluted water samples, solving the technical defects of traditional systems such as the disconnect between early warning and sample retention, high false alarm rate, and weak environmental adaptability, and providing a complete chain of evidence with legal validity for water environment supervision. Attached Figure Description
[0017] Figure 1 This is a schematic diagram of the overall structure of a multi-source water quality anomaly early warning and automatic sampling system based on the Internet of Things according to the present invention.
[0018] Figure 2This is a flowchart illustrating the multi-source data processing and hierarchical early warning logic in the edge computing gateway of this invention.
[0019] Figure 3 This is a partial structural diagram of the intelligent sample retention control unit and the RFID tag of the sample bottle working together in this invention. Detailed Implementation
[0020] This invention provides a multi-source water quality anomaly early warning and automatic sampling system and method based on the Internet of Things (IoT), the specific implementation of which is described below. The system consists of five main parts: a multi-source water quality sensor array, an edge computing gateway, an intelligent sampling control unit, an IoT communication module, and a cloud platform. These parts work closely together via wired or wireless means to form an integrated closed-loop architecture from sensing and judgment to execution and uploading.
[0021] like Figure 1 As shown, a multi-source water quality sensor array is deployed at the target water body monitoring point for real-time acquisition of key water quality parameters. This sensor array includes a pH sensor, a turbidity sensor, a conductivity sensor, a dissolved oxygen sensor, and a temperature compensation module. All sensors employ an industrial-grade waterproof encapsulation structure and are installed within the same sampling chamber to ensure a consistent sampling environment. Each sensor output is connected to the edge computing gateway via an independent signal conditioning circuit. The signal conditioning circuit includes a preamplifier, a low-pass filter, and an analog-to-digital converter, used to convert analog sensor signals into digital signals and suppress high-frequency noise interference. The temperature compensation module is physically integrated with the pH, dissolved oxygen, and conductivity sensors. Its real-time temperature reading serves as the compensation correction input, used to correct measurement deviations caused by water temperature changes. The compensation algorithm employs a lookup table method combined with linear interpolation. The lookup table data is pre-stored in the non-volatile memory of the edge computing gateway, covering compensation coefficients within common water temperature ranges.
[0022] As the local decision-making core, the edge computing gateway uses an ARM Cortex-M7 architecture microcontroller with a main frequency of no less than 480MHz, 512KB SRAM and 2MB Flash storage, and supports a floating-point unit to accelerate mathematical calculations. This gateway runs a lightweight anomaly detection model and performs tasks such as multi-source data time alignment, noise filtering, dynamic baseline calculation, multi-parameter coupled anomaly score generation, and hierarchical early warning logic judgment. Figure 2As shown, multi-source data time alignment is achieved by synchronizing the sampling clocks of each sensor using a hardware timer. The sampling period is fixed at 10 seconds, meaning a full-channel synchronous sampling event is triggered every 10 seconds. Noise filtering employs a combination of a moving average filter and wavelet thresholding: first, a moving average filter with a length of 30 sampling points is applied to the original sequence of each parameter for initial smoothing; then, a three-level wavelet decomposition is performed on the smoothed sequence, using the db4 wavelet basis function. Soft thresholding is applied to the wavelet coefficients of each level, with the threshold set to 1.5 times the standard deviation of the noise at that level. Wavelet reconstruction is then performed to obtain the final denoised signal.
[0023] Dynamic baseline calculations are performed independently for each water quality parameter. For any parameter... At the current time t, the system maintains a sliding window of length 7 days, containing historical valid data points for this parameter. The system calculates the mean of the data within the window in real time. with standard deviation And based on this, an adaptive threshold is generated. The coefficient k(t) is dynamically adjusted based on seasonal factors: 2.0 for spring and autumn, 2.3 for summer, and 1.8 for winter. These seasonal factors are automatically determined by the edge computing gateway's built-in real-time clock module in conjunction with preset calendar rules, requiring no external intervention. This mechanism enables the system to adapt to the natural fluctuations in water quality background values across different seasons, avoiding false alarms or missed alarms caused by fixed thresholds.
[0024] Multi-parameter coupled anomaly detection is implemented based on the water quality parameter correlation matrix R. This matrix is calculated offline using historical normal water quality datasets during the system initialization phase. The matrix elements... Indicates parameters and The Pearson correlation coefficient between them. The correlation matrix is stored in the Flash storage area of the edge computing gateway and refreshed each time the cloud platform issues a model update command. When any parameter The real-time value exceeds its adaptive threshold And there is another parameter satisfy and Synchronization exceeds its adaptive threshold When this occurs, the system identifies it as a valid anomaly and triggers a primary warning. Among these, the correlation coefficient threshold... The value is fixed at 0.7. This value has been verified through extensive historical data analysis and can effectively suppress false alarms caused by single-point mutations while ensuring sensitivity. The primary warning only sends alarm events to the cloud platform through the IoT communication module and does not initiate any physical execution actions.
[0025] The edge computing gateway further incorporates an anomaly scoring engine to quantitatively assess the degree of deviation of multiple parameters in the initial warning state. The anomaly score S(t) is defined as the weighted sum of the reconstruction errors of each parameter exceeding the threshold, i.e. in, Let be the set of parameters that exceed the adaptive threshold at time t. For parameters Reconstruction error, For the corresponding weights. The contribution of this parameter to historical pollution events is determined by statistical analysis of a historical event database trained offline on a cloud platform. Specifically, for each confirmed pollution event, the frequency of each parameter exceeding the threshold and its correlation with the event label within 30 minutes prior to the event are statistically analyzed, and the results are normalized and used as weight values. These weights are synchronized to the edge computing environment as the model is updated. When the duration of the initial warning reaches or exceeds a preset duration... =300 seconds, and the anomaly score S(t) reaches or exceeds the threshold. When the value is 0.85, the edge computing gateway generates an advanced warning signal and sends it to the intelligent sample retention control unit via the UART interface at a baud rate of 9600.
[0026] In a preferred embodiment of the present invention, the lightweight anomaly detection model deployed in the edge computing gateway is a Long Short-Term Memory Autoencoder (LSTM-AE). The model's network structure includes a single-layer LSTM encoder (32 hidden units), a bottleneck layer (8 dimensions), and a single-layer LSTM decoder (32 hidden units), with a total parameter size of less than 50KB. During the training phase, the model uses a normal water quality dataset for unsupervised learning, aiming to minimize the mean squared error between the input sequence and the reconstructed sequence. During the inference phase, the model receives multi-parameter time series segments (60 time steps) with a step size of 10 seconds, outputting the reconstructed values of each parameter at the current time, and the reconstruction error. This serves as the basic input for anomaly scoring. The model can complete full inference on an ARM Cortex-M7 core at a frequency of once every 10 seconds, meeting real-time requirements.
[0027] like Figure 3As shown, the intelligent sample retention control unit connects to the edge computing gateway via a GPIO interface to receive advanced warning signals and perform physical sample retention operations. This unit includes a DC motor drive circuit, a peristaltic pump, a mechanical switching mechanism, an RFID reader / writer, and control logic circuitry. Upon receiving an advanced warning signal, the control logic circuitry immediately starts the DC motor, driving the peristaltic pump to extract 500 ml of water sample from the sampling tubing. The sampling tubing is made of food-grade silicone tubing with an inner diameter of 6 mm, connecting the water sampling port and the sample bottle inlet. The sample bottles are numbered sequentially, with a total of 12 positions. Each bottle has a capacity of 600 ml and is made of high-density polyethylene, possessing corrosion resistance and light-shielding properties. The bottle caps have built-in passive UHF RFID tags, operating at a frequency of 860–960 MHz, with a storage capacity of 512 bits. The tag storage area is divided into three fields: a timestamp field (32 bits, recording the number of seconds since the Unix epoch), a geographic coordinate field (64 bits, including longitude and latitude, 32 bits each, with a precision of 1e-6 degrees), and an anomaly type code field (16 bits, generating a unique code based on the parameter combination triggered in the primary warning). The writing operation is completed by the RFID reader / writer connected to the intelligent sample retention control unit via the SPI interface. The writing process starts within 500 milliseconds after the water sample is injected, ensuring that the information strictly corresponds to the sample.
[0028] Once the current sample bottle is full, the liquid level sensor detects that the liquid level has reached the preset height, triggering a "bottle full" signal. This signal is fed back to the intelligent sample retention control unit, which drives a stepper motor to rotate the rotary disk 30 degrees, aligning the next empty bottle with the injection port. Simultaneously, the intelligent sample retention control unit sends a "bottle full" signal to the edge computing gateway via another GPIO pin. Upon receiving this signal, the edge computing gateway sends a "sample ready" notification to the cloud platform via the IoT communication module, including the sample bottle number, sampling time, and anomaly type code.
[0029] The IoT communication module integrates NB-IoT and 4G dual-mode communication capabilities, supporting automatic network switching. Before data upload, the module encrypts raw sensor data, early warning events, and sampled status information using AES-256 and adds a CRC32 checksum. The encryption key is distributed by the cloud platform through a secure channel during device registration and stored in the secure storage area of the edge computing gateway. Data packets are encapsulated using the CoAP protocol and transmitted to the cloud platform via UDP. The cloud platform receiver first verifies the CRC32 checksum; if the verification fails, it returns a NACK signal. Upon receiving the NACK, the IoT communication module initiates a retransmission mechanism with a 5-second retransmission interval and a maximum of 3 retransmissions. If all three retransmissions fail, the data packet is marked as lost, and a timestamp and data type are recorded in the local log. Batch retransmission is attempted after network recovery.
[0030] The cloud platform is deployed on a distributed server cluster and includes a data receiving service, a time-series database, a visualization engine, a model training server, and an OTA management module. The data receiving service parses data packets from each monitoring point, verifies their integrity, and stores them in the time-series database (using the InfluxDB engine), indexing them by monitoring point ID, timestamp, and data type. The visualization engine provides a web interface, displaying the real-time status of each monitoring point in a map layer overlay format, including four status icons: normal, primary warning, advanced warning, and sample ready, with the option to click to view detailed curves. The model training server periodically (at 2 AM daily) pulls anomaly scoring logs, sample retention results, and corresponding raw sensor data from each edge node. Supervised learning methods (such as XGBoost or lightweight neural networks) are used to optimize the threshold strategy and anomaly scoring weights in the correlation matrix R. The optimized model parameters are packaged into a firmware upgrade package and distributed to the corresponding edge computing gateway via the OTA management module through the HTTPS protocol. The upgrade process uses a differential update mechanism, transmitting only the changed parts to reduce bandwidth consumption, and digital signature verification is performed before the upgrade to ensure the legitimate origin of the firmware.
[0031] In one specific embodiment, the system is deployed at a monitoring station along a river section in a city. A multi-source water quality sensor array collects data on pH, turbidity, conductivity, dissolved oxygen, and temperature every 10 seconds. An edge computing gateway runs an LSTM-AE model to denoise and reconstruct the data. At 14:20:00 on July 15, 2023, the system detected a sudden drop in pH to 5.2 (adaptive threshold of 6.8), while conductivity rose to 1850 μS / cm (adaptive threshold of 1200 μS / cm). Querying the correlation matrix R, the correlation coefficient between pH and conductivity is -0.78, with an absolute value greater than 0.7, satisfying the coupling condition and triggering a primary warning. For the next 5 minutes, the anomaly score S(t) remained above 0.85, and the system generated a high-level warning signal at 14:25:00. The intelligent sample retention control unit immediately activated the peristaltic pump, drawing 500 ml of water sample and injecting it into sample bottle number 7. A timestamp (1689431100), geographical coordinates (121.4737°E, 31.2304°N), and anomaly type code (0x1A3F) were then written into the sample bottle. The cloud platform received a "sample ready" notification at 14:25:08 and highlighted the monitoring point as a red alert on the visualization interface. Environmental enforcement personnel arrived at the scene within one hour and collected the sample bottle as evidence.
[0032] To verify the technical effectiveness of this invention, a comparative test was conducted using a conventional single-threshold early warning system. This system only triggers an alarm and samples when pH < 6.0 or turbidity > 100 NTU. The system was operated continuously for 30 days at the same river section, recording the number of alarms, the number of samples collected, and the number of actual pollution events confirmed by manual verification. The test results are shown in the table below: Data shows that this invention significantly reduces the false alarm rate while maintaining zero underreporting. In the comparative example, multiple instances of invalid sample retention were triggered by temporary increases in turbidity due to rainfall, while this invention effectively filters out such interference through multi-parameter coupling and a dynamic baseline mechanism. Furthermore, the sample retention operation of this invention is only triggered under advanced alerts, ensuring that each sample has a high confidence level of pollution correlation, providing a reliable basis for subsequent law enforcement.
[0033] Furthermore, the system supports collaborative analysis across multiple monitoring points. The cloud platform can perform spatiotemporal correlation of abnormal events at multiple monitoring points within the same watershed to identify pollution diffusion paths. For example, if upstream monitoring point A triggers an advanced warning at 14:25, and downstream monitoring point B exhibits a similar parameter anomaly pattern at 14:40, the system can automatically label it as the same pollution event and plot the propagation trajectory on the visualization interface. This function relies on a unified time base (synchronized by GPS or NTP) for each monitoring point and a standardized anomaly type coding system.
[0034] In terms of power management, the system supports dual power supply modes: AC mains and solar power. The edge computing gateway has a built-in power management unit that automatically switches to lithium battery power and enters a low-power mode when an AC mains power interruption is detected: the sampling period is extended to 60 seconds, unnecessary peripherals are shut down, and only core sensing and communication functions are retained. When the battery level drops below 20%, a low battery alarm is sent to the cloud platform, and priority is given to ensuring the execution of the last valid sample.
[0035] In summary, this invention constructs a highly reliable, environmentally adaptable, and legally admissible water quality anomaly early warning and automatic sampling system through a collaborative mechanism involving multi-source sensor fusion, dynamic baseline adaptation, edge-side hierarchical decision-making, and synchronous triggering of physical sampling. Its technical solution is highly reproducible in engineering implementation; all key parameters, algorithm structures, and hardware interfaces have been clearly defined, and those skilled in the art can deploy and operate the system based on the above description.
Claims
1. A multi-source water quality anomaly early warning and automatic sampling system based on the Internet of Things, characterized in that, include: A multi-source water quality sensor array is used to simultaneously collect at least three water quality parameters. The multi-source water quality sensor array includes a pH sensor, a turbidity sensor, a conductivity sensor, a dissolved oxygen sensor, and a temperature compensation module. An edge computing gateway, connected to the multi-source water quality sensor array, is used to perform time alignment and noise filtering on various water quality parameters. It dynamically calculates the baseline mean and standard deviation of each parameter based on a sliding window to generate an adaptive threshold, and performs multi-parameter coupling anomaly detection in conjunction with a pre-constructed water quality parameter correlation matrix. When the multi-parameter synchronous threshold and correlation conditions are met, a primary warning is triggered. If the duration of the primary warning and the anomaly score both reach preset conditions, an advanced warning signal is generated. The intelligent sample retention control unit is connected to the edge computing gateway. After receiving the advanced early warning signal, it drives the peristaltic pump to extract water samples and inject them into the sample retention bottle. The sampling time, geographical coordinates and anomaly type are encoded and written into the RFID tag built into the sample retention bottle through an RFID reader. The IoT communication module, connected to the edge computing gateway, is used to encrypt and upload early warning events, sample retention status, and raw sensor data to the cloud platform. The cloud platform is used to receive and store uploaded data, provide a visual monitoring interface, and support remote updates of edge model parameters.
2. The system according to claim 1, characterized in that, The edge computing gateway synchronizes the sampling clock of each sensor through a hardware timer, with a fixed sampling period of 10 seconds; the noise filtering adopts a combination of a moving average filter and wavelet threshold denoising, wherein the moving window length is 30 sampling points, the wavelet basis function is db4, and the decomposition layer is 3 layers.
3. The system according to claim 1, characterized in that, The adaptive threshold ,in and Parameters The mean and standard deviation within a 7-day sliding window are dynamically adjusted by the coefficient k(t) based on seasonal factors: 2.0 for spring and autumn, 2.3 for summer, and 1.8 for winter.
4. The system according to claim 1, characterized in that, The water quality parameter correlation matrix is calculated based on historical normal water quality data during the system initialization phase and is refreshed each time the cloud platform issues a model update command; when any parameter Exceeding the adaptive threshold And there is another parameter satisfy 0.7 and synchronously exceeding its adaptive threshold At that time, a primary warning was triggered.
5. The system according to claim 1, characterized in that, The anomaly score S(t) is the weighted sum of the reconstruction errors of each threshold parameter, and the weight is determined by the contribution of the parameter in historical pollution events. When the duration of the primary warning reaches or exceeds 300 seconds and the anomaly score S(t) reaches or exceeds 0.85, an advanced warning signal is generated.
6. The system according to claim 5, characterized in that, The edge computing gateway is deployed with a long short-term memory autoencoder model, which includes a single-layer LSTM encoder, a bottleneck layer, and a single-layer LSTM decoder. The total number of parameters is less than 50KB, and it is used to output the reconstruction error of each parameter as the basic input for anomaly scoring.
7. The system according to claim 1, characterized in that, The temperature compensation module is physically integrated with pH, dissolved oxygen, and conductivity sensors. Its real-time temperature readings are used to compensate and correct the measured values by combining a lookup table method with linear interpolation. The lookup table data is stored in the non-volatile memory of the edge computing gateway.
8. The system according to claim 1, characterized in that, The sample bottles are numbered according to time sequence, each with a capacity of 600 ml. The bottle cap has a built-in passive UHF RFID tag, and the tag storage area is divided into a timestamp field, a geographic coordinate field, and an anomaly type code field. The tag is written within 500 milliseconds after the water sample is injected.
9. The system according to claim 1, characterized in that, The IoT communication module uses AES-256 encryption and adds a CRC32 checksum before uploading data. If the cloud platform receiver fails to verify, it will trigger a retransmission mechanism with a maximum of 3 retransmissions.
10. The system according to claim 1, characterized in that, The cloud platform is equipped with a model training server, which periodically collects abnormal scoring logs and sample results from edge nodes, optimizes the correlation matrix and abnormal scoring weights using supervised learning methods, and sends the updated model parameters to the edge computing gateway through a secure OTA channel.