Water quality residual chlorine on-line monitoring and optical alarm system based on DPD detection method

By using a water quality residual chlorine online monitoring and optical alarm system based on the DPD detection method, combined with multi-source data acquisition and machine learning prediction models, the system has achieved residual chlorine concentration trend prediction and graded optical alarms. This solves the problems of existing systems being unable to predict and false alarms, and improves the intelligence level and response efficiency of water quality monitoring.

CN122109470APending Publication Date: 2026-05-29BEIJING POLYTECHNIC

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
BEIJING POLYTECHNIC
Filing Date
2026-03-17
Publication Date
2026-05-29

AI Technical Summary

Technical Problem

Existing online residual chlorine monitoring systems cannot predict concentration change trends, making it difficult to provide early warnings. Furthermore, traditional alarm methods offer limited information and cannot effectively combine multi-dimensional information for comprehensive judgment, resulting in a high false alarm rate and low efficiency in analyzing detection data.

Method used

The water quality residual chlorine online monitoring and optical alarm system based on DPD detection method integrates a water quality multi-source data acquisition module, an edge computing module, an optical alarm module, and a power supply module. It uses a machine learning prediction model to fuse multi-source data to achieve trend prediction and uses a multi-color programmable light source for graded alarm.

Benefits of technology

It enables the prediction of future trends and abnormal risks in residual chlorine concentration, provides early warnings, improves human-machine interaction efficiency and on-site safety monitoring, reduces false alarm rate and system maintenance requirements, and ensures the long-term stability and reliability of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122109470A_ABST
    Figure CN122109470A_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of water quality monitoring, in particular to a water quality residual chlorine online monitoring and optical alarm system based on DPD detection method, comprising a water quality multi-source data acquisition module for acquiring residual chlorine concentration and other multi-source water quality and process parameters; an edge computing module for fusion processing of multi-source data through its built-in data fusion and prediction analysis software system, outputting residual chlorine future change trend and risk probability by using a time series prediction model, and then dynamically mapping different risk levels and generating adaptive optical alarm control instructions; and an optical alarm module for driving a multi-color programmable light source unit according to the instructions to generate optical alarm signals with specific color, brightness, flashing frequency and mode combination strictly corresponding to the risk level. The present application realizes intelligent prediction and forward-looking hierarchical optical alarm of residual chlorine concentration, significantly improving the intelligent level and risk warning capability of water quality monitoring.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of water quality monitoring technology, specifically to an online monitoring and optical alarm system for residual chlorine in water based on the DPD detection method. Background Technology

[0002] Residual chlorine is a key indicator for evaluating the disinfection effect of drinking water and ensuring the safety of water quality in pipe networks. Currently, the DPD spectrophotometric method has become the mainstream method for residual chlorine detection due to its accuracy and reliability, and it has begun to be applied in the field of online monitoring.

[0003] However, existing online residual chlorine monitoring solutions have significant shortcomings. Most systems can only provide passive alarms after thresholds are exceeded, failing to predict concentration trends and thus hindering early warning. Furthermore, these systems typically analyze residual chlorine data in isolation, failing to effectively integrate multi-dimensional information such as pH, water temperature, and flow rate for comprehensive judgment, leading to a high false alarm rate under complex operating conditions. In addition, traditional audible and visual alarms offer limited information and cannot intuitively differentiate the severity and development of risks. While the DPD spectrophotometric method is accurate, existing online monitoring solutions mostly perform single, static detections, lacking integration with multi-source data, and post-detection data analysis is inefficient, failing to achieve trend prediction.

[0004] Therefore, there is an urgent need for an online monitoring system that can integrate multi-source data, achieve trend prediction, and perform hierarchical and proactive alarms through intelligent optical signals, in order to improve the intelligence level and response efficiency of water quality monitoring. Summary of the Invention

[0005] In view of the above-mentioned shortcomings of the existing technology, the present invention provides an online monitoring and optical alarm system for residual chlorine in water based on the DPD detection method, which can effectively solve the problems mentioned in the existing technology.

[0006] To achieve the above objectives, the present invention provides the following technical solution:

[0007] This invention provides an online monitoring and optical alarm system for residual chlorine in water based on the DPD detection method, including a multi-source water quality data acquisition module, an edge computing module, an optical alarm module, and a power supply module;

[0008] The water quality multi-source data acquisition module is used to acquire multiple water quality parameters of the target water body in real time. It is configured with a residual chlorine sensor to measure the residual chlorine concentration in the water and an auxiliary water quality sensor to measure other water quality parameters besides the residual chlorine concentration. The water quality multi-source data acquisition module is communicatively connected to the edge computing module.

[0009] The edge computing module is configured with a data fusion and predictive analysis software system, including:

[0010] The data preprocessing and fusion submodule is used to receive and synchronize real-time multi-source water quality data from the multi-source water quality data acquisition module, including real-time residual chlorine concentration, pH value, and water temperature value; and to perform normalization processing and feature extraction on the multi-source water quality data to generate a fused feature vector.

[0011] The machine learning prediction model submodule is used to store and run a pre-trained time series prediction model. The time series prediction model takes the fused feature vector within the current and historical time windows as input and outputs the prediction result of the residual chlorine concentration change trend and the corresponding water quality anomaly risk probability value within a specific future time period.

[0012] The risk level mapping and alarm decision submodule is used to dynamically map the current and predicted water quality status into discrete risk levels based on the water quality anomaly risk probability value output by the machine learning prediction model submodule and multiple preset risk probability thresholds; the risk levels include normal status, first-level warning status, and second-level alarm status; and generate corresponding adaptive optical alarm control commands based on the real-time risk levels obtained by mapping.

[0013] The online model update submodule is used to periodically or according to triggering conditions to use new water quality data and corresponding actual residual chlorine changes as incremental training samples to perform incremental learning or parameter adjustment on the time series prediction model in order to adapt to changes in the water environment or chlorination process.

[0014] The optical alarm module is communicatively connected to the edge computing module and is used to receive and execute the adaptive optical alarm control command from the edge computing module.

[0015] The optical alarm module includes a multi-color programmable light source unit. By driving the multi-color programmable light source unit, an optical alarm signal with a specific combination of visual features corresponding to the risk level is generated. The combination of visual features includes light source color, light source brightness, flashing frequency, and flashing mode.

[0016] The power supply module is used to provide stable power to the water quality multi-source data acquisition module, the edge computing module, and the optical alarm module.

[0017] Furthermore, the auxiliary water quality sensor in the water quality multi-source data acquisition module also includes at least one of a turbidity sensor, a conductivity sensor, and a redox potential sensor;

[0018] The water quality multi-source data acquisition module also includes a data interface unit for communicating with external devices, used to acquire process parameters related to the target water body in real time via wired or wireless communication; the process parameters include the real-time chlorination rate of the chlorination unit, the real-time flow value of the water supply network, and the start-up and shutdown status of the pumping station;

[0019] The data preprocessing and fusion submodule is further configured to perform time alignment and fusion of the acquired process parameters and the multi-source water quality data stream to jointly form the fusion feature vector.

[0020] Furthermore, the temporal prediction model is a combination or ensemble of any one or more of the following models: Long Short-Term Memory Network model, Gated Recurrent Unit model, Temporal Convolutional Network model, or Transformer encoder model based on attention mechanism;

[0021] The training data for the time-series prediction model comes from historical long-term continuous monitoring datasets of target monitoring points or similar water bodies. The datasets include time-series sequences of residual chlorine concentration, pH value, water temperature value, and other optional parameters. The training objective of the model is to minimize the error between the predicted residual chlorine concentration for one or more fixed time steps in the future and the actual observed value.

[0022] Furthermore, in the risk level mapping and alarm decision submodule, the preset multiple risk probability thresholds include a first threshold and a second threshold, wherein the first threshold is less than the second threshold;

[0023] When the probability value of water quality abnormality risk is continuously lower than the first threshold, it is mapped to a normal state;

[0024] When the probability value of water quality anomaly risk reaches or exceeds the first threshold but is lower than the second threshold, it is mapped to a level one warning state.

[0025] When the probability value of water quality abnormality risk reaches or exceeds the second threshold, it is mapped to a level two alarm state;

[0026] The adaptive optics alarm control command includes a specific set of parameters bound to each risk level for controlling the multicolor programmable light source unit.

[0027] Furthermore, the optical alarm module executes optical alarm signal modes corresponding to each risk level as follows:

[0028] When the risk level is normal, the adaptive optics alarm control command drives the multi-color programmable light source unit to emit a continuously bright green light, or to enter a low-power sleep state.

[0029] When the risk level is at the first level of warning, the adaptive optics alarm control command drives the multi-color programmable light source unit to emit slowly alternating flashing yellow and blue light, wherein the brightness ratio and alternation frequency of the yellow and blue light are positively correlated with the magnitude of the water quality abnormality risk probability value.

[0030] When the risk level is at level two alarm status, the adaptive optics alarm control command drives the multi-color programmable light source unit to emit high-brightness, high-frequency flashing red light, and the flashing mode is a rapid pulse pattern, to distinguish it from the warning status.

[0031] Furthermore, the edge computing module also includes a local interactive display unit;

[0032] The local interactive display unit is used to display the raw parameter readings uploaded by the water quality multi-source data acquisition module in real time, and to visualize the historical trend, current value and prediction trajectory of residual chlorine concentration in the form of dynamic curves.

[0033] The local interactive display unit provides a parameter configuration interface, allowing authorized operators to adjust risk thresholds, optical coding protocol parameters, or some hyperparameters of machine learning models on-site.

[0034] Furthermore, the edge computing module also integrates a remote communication subunit, which supports at least one wireless wide area network protocol;

[0035] The edge computing module is configured to periodically upload the multi-source water quality data stream, the risk level, the water quality anomaly risk probability value, and equipment status information to a cloud server or remote monitoring center through the remote communication subunit; and to receive remote configuration instructions or model update files from the cloud server or remote monitoring center.

[0036] When the risk level mapping and alarm decision submodule determines that the risk level is a level 1 early warning state or a level 2 alarm state, the edge computing module automatically pushes an alarm notification message containing time, location, risk level, and key parameter values ​​to a preset remote terminal or management platform through the remote communication subunit.

[0037] Furthermore, the triggering conditions for the online model update submodule include:

[0038] Periodic triggering, incremental learning is initiated at preset fixed time intervals;

[0039] Performance degradation trigger is activated when the prediction error of the time series prediction model continuously exceeds a preset error threshold in a recent evaluation period.

[0040] Process change trigger: This is initiated when process adjustment confirmation information is received from an external source via the data interface.

[0041] The incremental learning or parameter adjustment performed by the online model update submodule is carried out locally in the edge computing module using newly collected data on the basis of the pre-trained model, and a lightweight training algorithm that limits the use of computing resources is adopted to ensure that the online update does not affect the normal operation of the main monitoring function of the system.

[0042] Furthermore, the system also includes an ambient light feedback module;

[0043] The ambient light feedback module is connected to the edge computing module and is used to collect the ambient light illuminance at the installation location of the optical alarm module in real time.

[0044] Based on the real-time reading of the ambient light intensity, the brightness parameter value of the light source is dynamically adjusted to achieve adaptive adjustment of the alarm light signal brightness.

[0045] The technical solution provided by this invention has the following advantages compared with the known prior art:

[0046] This invention integrates multi-source water quality and process data and analyzes it using a time-series prediction model. It not only monitors the current residual chlorine value but also predicts its future trend and probability of abnormal risks. This allows the system to issue an "early warning" alarm before the residual chlorine concentration actually exceeds or falls below the standard, giving maintenance personnel valuable response time and transforming passive handling into proactive intervention, effectively preventing water quality safety accidents.

[0047] This invention drives a multi-color programmable light source to output light signals with specific combinations of color, brightness, flashing frequency, and pattern according to different levels of "normal, warning, and alarm". In particular, in the warning state, the proportion of light colors and the flashing frequency can dynamically change with the risk probability value, forming a "visual gradient" of risk level. This allows operators to instantly judge the risk level and its changing trend through the pattern of the light signal, even from a certain distance, which greatly improves the efficiency of human-computer interaction and the level of on-site safety monitoring.

[0048] This invention incorporates a built-in online model update submodule, which can automatically trigger incremental learning based on conditions such as performance degradation and process changes. This allows the prediction model to continuously optimize in response to changes in water characteristics, overcoming the prediction failure problem caused by concept drift in traditional fixed models. At the same time, the ambient light feedback function can automatically adjust the alarm light brightness according to the ambient light, ensuring clear visibility of the alarm signal under various lighting conditions. This significantly reduces system maintenance requirements and improves its long-term stability and reliability in complex industrial environments. Attached Figure Description

[0049] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the accompanying drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are merely some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without any creative effort.

[0050] Figure 1 This is a schematic diagram of the system structure of the present invention. Detailed Implementation

[0051] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative effort are within the scope of protection of the present invention.

[0052] The present invention will be further described below with reference to embodiments.

[0053] Example:

[0054] Reference Figure 1 This invention provides an online monitoring and optical alarm system for residual chlorine in water based on the DPD detection method. This system is an integrated hardware and software platform that integrates high-precision online detection, intelligent data analysis and prediction, and intuitive optical warning functions, aiming to achieve forward-looking monitoring and efficient alarm of residual chlorine concentration in water.

[0055] The system mainly includes a multi-source water quality data acquisition module, an edge computing module, an optical alarm module, and a system power supply module. The modules communicate and collaborate with each other through electrical connections and a data bus.

[0056] The water quality multi-source data acquisition module is the system's perception layer, responsible for acquiring various key parameters of the target water body in real time and accurately. Its core lies in the collaboration between the core sensing unit and the external data interface unit.

[0057] The core sensing unit directly contacts the water body for measurement and must include a residual chlorine sensing unit based on DPD spectrophotometry. The specific workflow is precisely controlled by the edge computing module, forming an automated measurement cycle.

[0058] (1) Quantitative sampling and injection: A micro peristaltic pump extracts 5 mL of the water sample to be tested from the flow cell and injects it into the optical cuvette. Subsequently, a reagent pump driven by a precision stepper motor extracts 0.1% DPD colorimetric reagent solution from the refrigerated reagent compartment and injects it precisely into the cuvette.

[0059] (2) Isothermal colorimetric reaction: The cuvette is placed in an isothermal block controlled by a semiconductor cooling chip, and the temperature is stabilized at 25±0.5℃. Under these conditions, the free residual chlorine in the water sample reacts rapidly with the DPD reagent to generate a stable rose-red compound. The reaction time is controlled at 60 seconds.

[0060] (3) Photometric Measurement: After the reaction is completed, an LED monochromatic light source with an emission wavelength of 510 nm is controlled by the edge computing module to be lit, and the light passes through the colorimetric solution in the cuvette. The photodiode (PD) detector located on the other side measures the intensity of the transmitted light and converts it into a voltage signal. The system calculates the concentration by measuring the absorbance (A) according to the Lambert-Beer law. Specifically, the system first measures the transmittance I0 of the blank reagent (chlorine-free water + DPD reagent) and the transmittance I of the sample solution, calculates the absorbance A=log(I0 / I), and finally retrieves the residual chlorine concentration value through the pre-stored standard curve (absorbance A-residual chlorine concentration C curve). The measurement range is usually 0-5 mg / L, and the resolution can reach 0.01 mg / L.

[0061] (4) Automatic cleaning: After each measurement, the cleaning pump will inject deionized water and air into the cuvette and the entire flow path in sequence to rinse and dry them in order to avoid cross-contamination and prepare for the next measurement.

[0062] In addition, the core sensing unit must also include an auxiliary water quality sensing unit, which integrates at least a pH sensing subunit and a water temperature sensing subunit. In practice, a turbidity sensing subunit and a conductivity sensing subunit can be added as needed to obtain a more comprehensive water quality profile.

[0063] Furthermore, the multi-source water quality data acquisition module also includes a data interface unit for communication with external control systems (such as water plant PLCs and SCADA systems). This data interface unit can acquire process parameters closely related to the target water body in real time via industrial protocols such as Modbus RTU / TCP and Profinet, or through 4-20mA analog input. These parameters typically include the real-time chlorination rate of the upstream chlorination unit, the real-time flow rate of the water supply network, and the start / stop status signals of the pumping stations. These external parameters are key driving factors affecting the dynamic changes in residual chlorine in the network.

[0064] The implementation of edge computing modules is typically achieved by industrial-grade embedded computers or high-performance microcontrollers, which have built-in data fusion and predictive analysis software systems responsible for processing the raw data from the acquisition modules, performing intelligent analysis, and making decisions.

[0065] The data preprocessing and fusion submodule is first responsible for data reception and synchronization. Since the sampling periods and communication delays of various sensors may differ, this submodule uses a high-precision system clock as a reference to timestamp-align all input real-time multi-source water quality data, including residual chlorine concentration, pH, water temperature, and process parameters obtained through the data interface unit. Linear interpolation is typically used to synchronize these data to a unified time series. Next, the data preprocessing and fusion submodule normalizes the synchronized data, scaling data with varying dimensions and numerical ranges to the [0,1] interval to eliminate dimensional influences and facilitate subsequent model processing. Finally, feature extraction is performed, such as calculating the rate of change, mean, and standard deviation of residual chlorine over a past time window (e.g., 30 minutes), or constructing the interaction term between pH and water temperature. The raw data and derived features are combined into a comprehensive fused feature vector, which serves as the input to the machine learning model.

[0066] The machine learning prediction model submodule stores and runs a pre-trained temporal prediction model. In one specific embodiment, the temporal prediction model employs an integrated architecture of a Long Short-Term Memory (LSTM) network model and a temporal convolutional network model. The LSTM layer excels at capturing long-term temporal dependencies, while the TCN layer efficiently extracts local features. The model takes the aforementioned fused feature vector as input, along with historical sequences from the current time and a past period (e.g., the past 12 sampling points, sampled once per hour).

[0067] The model's output consists of two parts: first, a prediction of the residual chlorine concentration trend over a specific future period (e.g., the next 1-3 hours), i.e., a series of predicted concentration values; and second, a scalar value that comprehensively assesses future risk—the probability value of water quality anomaly risk, which ranges from 0 to 1, with higher values ​​indicating a greater likelihood of residual chlorine exceeding or falling below the standard. The training data for the time-series prediction model comes from historical long-term continuous monitoring datasets of the target monitoring points or water bodies with similar operating conditions. Supervised learning is employed to minimize the mean squared error (MSE) between the predicted and observed values.

[0068] The risk level mapping and alarm decision submodule receives the risk probability values ​​output by the model and performs logical judgments based on multiple preset risk probability thresholds. Typically, two thresholds are set: a first threshold (early warning threshold) and a higher second threshold (alarm threshold). For example, the first threshold is set to 0.65, and the second threshold to 0.85. This submodule executes the following mapping logic: when the water quality anomaly risk probability value is consistently below the first threshold, it is determined to be in a "normal state"; when the probability value reaches or exceeds the first threshold but is below the second threshold, it is determined to be in a "Level 1 early warning state"; when the probability value reaches or exceeds the second threshold, it is determined to be in a "Level 2 alarm state". Based on the real-time risk level obtained from the mapping, this submodule generates a corresponding adaptive optical alarm control command. This command is a structured parameter set that explicitly specifies the control parameters such as the color, brightness, flicker frequency, and flicker mode of the light source, directly driving the optical alarm module.

[0069] The online model update submodule ensures that the system's predictive capabilities can adaptively optimize over time, preventing model performance degradation due to water quality characteristic drift. The triggering conditions for the online model update submodule are diverse: including periodic triggering (e.g., automatically starting every two weeks); performance degradation triggering (when the model's prediction error continuously exceeds a preset error threshold within a recent evaluation period); and process change triggering (when a significant adjustment to the external chlorination process is confirmed through the data interface). After triggering, the online model update submodule uses newly collected water quality data and corresponding actual residual chlorine changes as incremental training samples. Locally on the edge computing module, a lightweight online learning algorithm is used to incrementally learn or fine-tune the pre-trained time-series prediction model.

[0070] Specifically, the lightweight training algorithm is selected from any one or more combinations of the following:

[0071] (1) Elastic weight consolidation algorithm: By adding an importance weight penalty term to the loss function, the change of key parameters of historical tasks is constrained when updating model parameters, and only the parameters that are sensitive to the current new data are fine-tuned, thereby significantly reducing the amount of computation while preventing catastrophic forgetting.

[0072] (2) Progressive Neural Network Extension Algorithm: Based on the pre-trained model, only a small number of new neurons or network branches are added to adapt to new data features, most of the original network layer parameters are frozen, and only the newly added part is trained to achieve incremental learning with extremely low resource consumption.

[0073] (3) Model pruning and quantization fine-tuning algorithm: First, the pre-trained model is structurally pruned (removing redundant channels or layers), then the remaining parameters are quantized with low bit (such as INT8), and finally only the quantized lightweight model is updated in small batches, which greatly reduces the number of floating-point operations and memory usage.

[0074] (4) Online randomized learning algorithm: abandoning the backpropagation mechanism, adopting a randomized incremental learning strategy, only generating a small number of candidate nodes when new samples are input, filtering and adjusting the output weights according to the supervision mechanism, realizing the update in a single forward calculation, and avoiding the computational overhead caused by gradient iteration;

[0075] (5) Federated learning edge adaptation algorithm: After receiving the global model from the cloud, it performs single-round or few-round fine-tuning (usually 1-3 epochs) using only a small batch of data locally. It prevents overfitting through an early stopping mechanism and ensures rapid convergence by combining a learning rate decay strategy.

[0076] The algorithm described above runs in a low-priority thread of the edge computing module. A lightweight task scheduler controls the CPU utilization to not exceed a preset threshold (e.g., 20%) and uses an incremental data caching mechanism to load only the current batch of data for each update, avoiding memory overflow and ensuring that the performance of the main thread for real-time monitoring and alarms is not affected.

[0077] This process strictly limits the consumption of computing resources and is usually run in a low-priority background thread to ensure that it does not affect the performance of the main thread for real-time monitoring and alarms.

[0078] In addition, the edge computing module also integrates a remote communication subunit. This subunit supports at least one wireless wide area network protocol, such as 4G, NB-IoT, or LoRa. On the one hand, it periodically packages and uploads multi-source water quality data streams, real-time risk levels, water quality anomaly risk probability values, and device status information (such as battery level and signal strength) to a cloud server or remote monitoring center; on the other hand, it can receive remote configuration commands or model update files from the cloud. When the risk level mapping and alarm decision submodule determines the status as a Level 1 warning or Level 2 alarm, this remote communication subunit will automatically trigger to push a structured alarm notification message to the preset maintenance personnel's mobile APP or monitoring platform. The message content includes the event time, monitoring point location, specific risk level, and key parameter values, realizing remote real-time alarm.

[0079] The optical alarm module is implemented as a field human-machine interface and warning terminal of the system, which directly receives and executes adaptive optical alarm control commands from the edge computing module.

[0080] The core of the optical alarm module is a multi-color programmable light source unit, typically composed of a high-brightness RGB LED array and its driving circuit. The driving circuit can precisely control the current (brightness) and on / off timing (flickering) of each LED according to instructions. The optical alarm signal generated by this module corresponds strictly one-to-one with the risk level, and its visual feature combination is multi-dimensional.

[0081] When the risk level is normal: the command drives the light source to emit a continuously bright green light, indicating that the system is running smoothly; to save energy, it can also be set to enter a low-power sleep state.

[0082] When the risk level is at Level 1 warning: the command drives the light source to emit slowly alternating flashes of yellow and blue light. The brightness ratio of yellow and blue, as well as the flashing frequency, are not fixed but are positively correlated with the current probability of water quality anomalies. Specifically, the flashing frequency is linearly adjusted between 0.5Hz and 1Hz, with a faster frequency for higher risk probabilities. The proportion of yellow light brightness increases with the probability, ranging from 30% to 70%, while the blue light brightness complements it. The duration of a single light illumination is 500ms to 1000ms, automatically adjusting with the frequency. This allows for a direct and visual reflection of subtle changes in the risk level through light signals.

[0083] When the risk level is at the level 2 alarm state: the command drives the light source to immediately switch to a high-brightness, high-frequency flashing red light, and the flashing mode is a rapid pulse type. The specific parameters are: pulse frequency 3Hz to 5Hz, duty cycle 20% to 40%, single pulse width 100ms to 200ms, forming a visual impact of rapid alternation of light and dark, which is significantly different from the warning state, ensuring that operators can immediately detect serious abnormalities even from a distance.

[0084] The power supply module provides energy to the entire system. It typically uses a wide-voltage input AC-DC switching power supply and is equipped with a backup battery to ensure that the system can continue to operate for several hours when the mains power is interrupted.

[0085] The system may also include an ambient light feedback module, typically containing an ambient light sensor installed near the optical alarm module to collect real-time ambient light levels at the module's location. This illuminance reading is sent to the edge computing module. The relevant logic within the edge computing module dynamically adjusts the light source brightness parameter in the output command based on the ambient light intensity. For example, it automatically increases the LED brightness to 100% in bright daylight and reduces it to 30% in dim nighttime conditions, thus achieving adaptive adjustment of the alarm light signal brightness. This ensures good visibility under any ambient light conditions while avoiding light pollution at night.

[0086] The system's specific workflow is as follows: After system startup, the multi-source water quality data acquisition module automatically completes residual chlorine DPD method detection and other parameter acquisition at a set cycle (e.g., every 5 minutes) and sends the data to the edge computing module. The edge computing module's data preprocessing and fusion submodule synchronizes, normalizes, and fuses the data. The machine learning prediction model submodule calculates future residual chlorine trends and risk probabilities based on the fused feature historical sequence. The risk level mapping and alarm decision submodule maps risk levels based on probability values ​​and generates corresponding optical control commands. These commands are sent to the optical alarm module, causing it to display light signals of the corresponding color and pattern. Simultaneously, if the status is a warning or alarm, the remote communication subunit sends alarm information to the cloud and remote terminals. The online model update submodule continuously monitors in the background and automatically initiates the model optimization process when conditions are met. The entire process operates automatically, realizing a complete closed loop from accurate detection and intelligent prediction to graded visual alarms.

[0087] The above embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions will not cause the essence of the corresponding technical solutions to deviate from the protection scope of the technical solutions of the embodiments of the present invention.

Claims

1. A water quality residual chlorine online monitoring and optical alarm system based on DPD detection method, characterized in that, It includes a multi-source water quality data acquisition module, an edge computing module, an optical alarm module, and a power supply module; The water quality multi-source data acquisition module is used to acquire multiple water quality parameters of the target water body in real time. It is configured as a residual chlorine sensor to measure the residual chlorine concentration in the water and an auxiliary water quality sensor to measure other water quality parameters besides the residual chlorine concentration. The auxiliary water quality sensor includes at least a pH sensor and a water temperature sensor. The water quality multi-source data acquisition module is communicatively connected to the edge computing module. The edge computing module is configured with a data fusion and predictive analysis software system, including: The data preprocessing and fusion submodule is used to receive and synchronize real-time multi-source water quality data from the multi-source water quality data acquisition module, including real-time residual chlorine concentration, pH value, and water temperature value; and to perform normalization processing and feature extraction on the multi-source water quality data to generate a fused feature vector. The machine learning prediction model submodule is used to store and run a pre-trained time series prediction model. The time series prediction model takes the fused feature vector within the current and historical time windows as input and outputs the prediction result of the residual chlorine concentration change trend and the corresponding water quality anomaly risk probability value within a specific future time period. The risk level mapping and alarm decision submodule is used to dynamically map the current and predicted water quality status into discrete risk levels based on the water quality anomaly risk probability value output by the machine learning prediction model submodule and multiple preset risk probability thresholds; the risk levels include normal status, first-level warning status, and second-level alarm status; and generate corresponding adaptive optical alarm control commands based on the real-time risk levels obtained by mapping. The online model update submodule is used to periodically or according to triggering conditions to use new water quality data and corresponding actual residual chlorine changes as incremental training samples to perform incremental learning or parameter adjustment on the time series prediction model in order to adapt to changes in the water environment or chlorination process. The optical alarm module is communicatively connected to the edge computing module and is used to receive and execute the adaptive optical alarm control command from the edge computing module. The optical alarm module includes a multi-color programmable light source unit. By driving the multi-color programmable light source unit, an optical alarm signal with a specific combination of visual features corresponding to the risk level is generated. The combination of visual features includes light source color, light source brightness, flashing frequency, and flashing mode. The power supply module is used to provide stable power to the water quality multi-source data acquisition module, the edge computing module, and the optical alarm module.

2. The online monitoring and optical alarm system for residual chlorine in water based on the DPD detection method according to claim 1, characterized in that, The auxiliary water quality sensor in the water quality multi-source data acquisition module further includes at least one of a turbidity sensor, a conductivity sensor, and a redox potential sensor. The water quality multi-source data acquisition module also includes a data interface unit for communicating with external devices, used to acquire process parameters related to the target water body in real time via wired or wireless communication; the process parameters include the real-time chlorination rate of the chlorination unit, the real-time flow value of the water supply network, and the start-up and shutdown status of the pumping station; The data preprocessing and fusion submodule is further configured to perform time alignment and fusion of the acquired process parameters and the multi-source water quality data stream to jointly form the fusion feature vector.

3. The online monitoring and optical alarm system for residual chlorine in water based on the DPD detection method according to claim 1, characterized in that, The temporal prediction model is a combination or ensemble of any one or more of the following models: Long Short-Term Memory Network model, Gated Recurrent Unit model, Temporal Convolutional Network model, or Transformer encoder model based on attention mechanism; The training data for the time-series prediction model comes from historical long-term continuous monitoring datasets of target monitoring points or similar water bodies. The datasets include time-series sequences of residual chlorine concentration, pH value, water temperature value, and other optional parameters. The training objective of the model is to minimize the error between the predicted residual chlorine concentration for one or more fixed time steps in the future and the actual observed value.

4. The online monitoring and optical alarm system for residual chlorine in water based on the DPD detection method according to claim 1, characterized in that, In the risk level mapping and alarm decision submodule, the preset multiple risk probability thresholds include a first threshold and a second threshold, wherein the first threshold is less than the second threshold; When the probability value of water quality abnormality risk is continuously lower than the first threshold, it is mapped to a normal state; When the probability value of water quality anomaly risk reaches or exceeds the first threshold but is lower than the second threshold, it is mapped to a level one warning state. When the probability value of water quality abnormality risk reaches or exceeds the second threshold, it is mapped to a level two alarm state; The adaptive optics alarm control command includes a specific set of parameters bound to each risk level for controlling the multicolor programmable light source unit.

5. The online monitoring and optical alarm system for residual chlorine in water based on the DPD detection method according to claim 1, characterized in that, The optical alarm module executes the optical alarm signal modes corresponding to each risk level as follows: When the risk level is normal, the adaptive optics alarm control command drives the multi-color programmable light source unit to emit a continuously bright green light, or to enter a low-power sleep state. When the risk level is at the first level of warning, the adaptive optics alarm control command drives the multi-color programmable light source unit to emit slowly alternating flashing yellow and blue light, wherein the brightness ratio and alternation frequency of the yellow and blue light are positively correlated with the magnitude of the water quality abnormality risk probability value. When the risk level is at level two alarm status, the adaptive optics alarm control command drives the multi-color programmable light source unit to emit high-brightness, high-frequency flashing red light, and the flashing mode is a rapid pulse pattern, to distinguish it from the warning status.

6. The online monitoring and optical alarm system for residual chlorine in water based on the DPD detection method according to claim 1, characterized in that, The edge computing module also includes a local interactive display unit; The local interactive display unit is used to display the raw parameter readings uploaded by the water quality multi-source data acquisition module in real time, and to visualize the historical trend, current value and prediction trajectory of residual chlorine concentration in the form of dynamic curves. The local interactive display unit provides a parameter configuration interface, allowing authorized operators to adjust risk thresholds, optical coding protocol parameters, or some hyperparameters of machine learning models on-site.

7. The online monitoring and optical alarm system for residual chlorine in water based on the DPD detection method according to claim 1, characterized in that, The edge computing module also integrates a remote communication subunit, which supports at least one wireless wide area network protocol. The edge computing module is configured to periodically upload the multi-source water quality data stream, the risk level, the water quality anomaly risk probability value, and equipment status information to a cloud server or remote monitoring center through the remote communication subunit; and to receive remote configuration instructions or model update files from the cloud server or remote monitoring center. When the risk level mapping and alarm decision submodule determines that the risk level is a level 1 early warning state or a level 2 alarm state, the edge computing module automatically pushes an alarm notification message containing time, location, risk level, and key parameter values ​​to a preset remote terminal or management platform through the remote communication subunit.

8. The online monitoring and optical alarm system for residual chlorine in water based on the DPD detection method according to claim 1, characterized in that, The triggering conditions for the online model update submodule include: Periodic triggering, incremental learning is initiated at preset fixed time intervals; Performance degradation trigger is activated when the prediction error of the time series prediction model continuously exceeds a preset error threshold in a recent evaluation period. Process change trigger: This is initiated when process adjustment confirmation information is received from an external source via the data interface. The incremental learning or parameter adjustment performed by the online model update submodule is carried out locally in the edge computing module using newly collected data on the basis of the pre-trained model, and a lightweight training algorithm that limits the use of computing resources is adopted to ensure that the online update does not affect the normal operation of the main monitoring function of the system.

9. The online monitoring and optical alarm system for residual chlorine in water based on the DPD detection method according to claim 1, characterized in that, The system also includes an ambient light feedback module; The ambient light feedback module is connected to the edge computing module and is used to collect the ambient light illuminance at the installation location of the optical alarm module in real time. Based on the real-time reading of the ambient light intensity, the brightness parameter value of the light source is dynamically adjusted to achieve adaptive adjustment of the alarm light signal brightness.