Real-time monitoring and intelligent adjustment system for water quality of drinking water production line based on internet of things

By integrating multiple modules of the Internet of Things (IoT) system, the problems of insufficient real-time performance and compliance in traditional water quality control have been solved. Real-time monitoring, rapid response, and traceability compliance of drinking water production lines have been achieved, reducing the risks brought about by chemical shortages and environmental constraints, and improving production capacity and water quality stability.

CN121554019BActive Publication Date: 2026-05-08LIAONING LINGXIUSHAN MINERAL SPRING DRINK CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
LIAONING LINGXIUSHAN MINERAL SPRING DRINK CO LTD
Filing Date
2026-01-21
Publication Date
2026-05-08

AI Technical Summary

Technical Problem

Traditional water quality control methods struggle to achieve real-time monitoring, rapid response, and traceability compliance, leading to actuator dead zones and hysteresis, chemical shortages or concentration ratio errors, resulting in oscillations, production losses, and conflicts with environmental regulations.

Method used

An IoT-based real-time water quality monitoring and intelligent regulation system for drinking water production lines is adopted, including modules such as data access and self-calibration, edge preprocessing, soft sensor and mechanism fusion, anomaly detection and root cause localization, prediction layer, intelligent regulation and CIP scheduling optimization. Through equipment unification, clock synchronization, filtering interpolation, adaptive sampling, soft sensor and mechanism fusion, dead zone hysteresis compensation, risk arbitration and CIP scheduling optimization, the system achieves full-process governance.

Benefits of technology

It significantly improves the stability and foresight of observation and estimation, provides rapid and accurate alerts and eliminates motion interference oscillations, optimizes chemical use and environmental constraints, ensures production capacity stability and governance transparency, and achieves real-time monitoring, rapid response and traceable compliance throughout the entire process of governance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121554019B_ABST
    Figure CN121554019B_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of production line control, and discloses a drinking water production line water quality real-time monitoring and intelligent adjustment system based on the Internet of Things, which registers equipment and units uniformly, eliminates deviation by NTP time correction, calibrates zero point range by shift / CIP, monitors drift by EWMA and reduces weight, constructs a state vector containing ID / lot and audits into a warehouse, removes noise by median / bilateral filtering, unifies raster interpolation, adaptively samples according to curvature and events by sliding window multi-scale aggregation, normalizes and interpolates a near-time training window, estimates difficult-to-measure indexes by a soft sensor, depicts residual chlorine by a mechanism model, and outputs estimation and interval and audits by uncertainty weighted fusion. The present application realizes whole-process management of'real-time monitoring-quick response-traceable compliance', significantly reduces risks caused by chemical shortages or proportioning errors and environmental protection constraints, reduces production capacity loss caused by cleaning and plan conflicts, and improves water quality stability and management transparency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of production line control, and more specifically, to an Internet of Things-based real-time water quality monitoring and intelligent adjustment system for drinking water production lines. Background Technology

[0002] As the drinking water industry continues to evolve towards large-scale, continuous, and high-standard quality supervision, traditional water quality control methods centered on offline testing are no longer sufficient to meet the needs of the entire process of governance, which requires "real-time monitoring, rapid response, and traceability compliance."

[0003] In traditional water quality control methods, when actuator dead zones and hysteresis occur (valve jamming, pump cavitation), continuous and discrete actions interfere with each other, causing oscillations; or chemical shortages or concentration ratio errors cause restrictions on CIP discharge disposal and changes in environmental regulations; and conflicts between cleaning cycle and production plan lead to capacity loss. Summary of the Invention

[0004] This invention provides an IoT-based real-time water quality monitoring and intelligent adjustment system for drinking water production lines, solving technical problems such as actuator dead zone and hysteresis, chemical shortage, or concentration ratio error in related technologies.

[0005] This invention provides an Internet of Things-based real-time water quality monitoring and intelligent adjustment system for drinking water production lines, comprising:

[0006] Data access and self-calibration module: Registers equipment and units for consistency, eliminates deviations through NTP time synchronization; calibrates zero-point range for shifts / CIP, and reduces weights for EWMA drift monitoring; constructs state vectors containing IDs / batches and audits them before storing them in the database;

[0007] Edge preprocessing and adaptive sampling module: median / bilateral filtering for noise reduction, unified raster interpolation; sliding window multi-scale aggregation, adaptive sampling based on curvature and events;

[0008] Soft sensor and mechanism fusion module: near-time training window normalization and interpolation; soft sensor estimation of difficult-to-measure indicators, mechanism model characterization of residual chlorine; uncertainty weighted fusion, output estimate and interval audit;

[0009] Anomaly detection and root cause localization module: Standardized baseline establishment, Mahalanobis distance and CUSUM / PH to identify anomalies and change points; Root causes are ranked based on process topology scoring, and action suggestions are generated, pushed out, and recorded.

[0010] Prediction layer module: Hybrid state space combined with hierarchical attention; extracts multi-scale features, outputs short- and medium-term predictions and uncertainties, supporting MPC and early warning;

[0011] Intelligent adjustment module: compensates for dead zone / hysteresis and applies NPSH constraints; risk arbitration MPC and RL, minimum residence and CBF protection, timeout degradation of line control; supports gray-scale rollback and manual / stop auditing;

[0012] CIP scheduling optimization module: differential pressure / flux criterion triggering; constrains inventory, emissions and windows, selects robust formulations for membrane penalty; calculates flushing volume and timing, generates scheduling and auditing and writes back to the knowledge graph;

[0013] HMI Interaction and Alarm Linkage Module: Presents trends, prediction ranges, arbitration weights, and suggestions; alarm classification merging and delayed confirmation, interlocking and dual-person approval; mode management and full auditing, supporting trajectory playback.

[0014] Furthermore, the following steps are performed through the data access and self-calibration module:

[0015] S110, Equipment Registration and Unit Unification: Inventory of field equipment and sensors, collect model / range / unit and installation location, establish equipment channel unit mapping and perform unit standardization and conversion, generate globally unique equipment ID and configuration item, write to configuration center and audit library, and output equipment list and calibration metadata;

[0016] S120, clock synchronization and timestamp alignment: The gateway periodically synchronizes with the NTP or local time source, calculates the clock deviation of the device or gateway, corrects the timestamp of the newly arrived sample at the data receiving end, records the correction value and source, and if the deviation exceeds the threshold, an alarm is triggered and the device is required to reset or resynchronize, ensuring that cross-device data is comparable on the same time grid.

[0017] S130, Zero / Range Calibration: Collect stable segment data at shift / CIP boundaries, calculate zero drift or proportional coefficient and apply it in batches to the corresponding channels, perform two-point calibration to verify the calibration effect, generate calibration report and difference comparison, update equipment status and version number, and retain audit records;

[0018] Triggered in shift or CIP boundary events, the original value is corrected;

[0019] If proportional correction is required, two-point calibration should be used;

[0020] S140, Drift Monitoring and Self-Diagnosis: Real-time calculation of EWMA drift for each channel and comparison with thresholds. If the drift exceeds the limit, a health tag is added and the channel's contribution to control and estimation is reduced. Maintenance work orders and notifications are automatically created, and redundant sensors are switched when necessary.

[0021] S150, State Vector Construction: Perform consistency verification and missing data filling on each source data, concatenate the latest measurements into a state vector, and attach the device ID, batch / shift and timestamp, and write it to the time series library and message bus for consumption by the anomaly detection, prediction and control modules.

[0022] Furthermore, the following steps are performed through the edge preprocessing and adaptive sampling module:

[0023] S210, Denoising: Select median or bilateral filter parameters according to the channel noise characteristics, suppress abrupt changes and spikes, output a denoised sequence, and mark the filtered points in the data quality label;

[0024] S220, Time Alignment: Establish a unified time grid and perform linear or spline interpolation according to the source data timestamps. Clean up and resample duplicate and abrupt timestamps, output the aligned multi-source sequence and record the interpolation ratio.

[0025] S230, Sliding Aggregation: Maintains a circular buffer to store the most recent window data, and calculates the statistics of mean, variance, extreme values ​​and RMS to form window features;

[0026] S240, Adaptive Sampling: Real-time calculation of the rate of change / gradient and event indication of the time series, updates the sampling frequency according to the formula and sends it to the gateway / PLC acquisition task, monitors CPU and bandwidth usage, and automatically limits the flow and downsamples when the resource protection threshold is triggered.

[0027] Furthermore, the following steps are performed through the soft sensor and mechanism fusion module:

[0028] S310, Training Window Construction: Construct a feature tensor using a sliding window, perform dimensional normalization and missing value imputation, generate data batches for use by soft sensors and prediction models, and cache them at the edges;

[0029] S320, Soft Sensor Estimation: Calls the selected soft sensor model to perform forward inference, outputs the online estimate and uncertainty of the target index, continuously records the estimation error and performs incremental fine-tuning or rolling updates of the model version as planned;

[0030] S330, Mechanism Model: Based on temperature, pH and process conditions, the residual chlorine decay coefficient and dosing gain are adaptively updated, the residual chlorine prediction at the next moment is calculated and verified to meet the regulatory threshold, and the result is used as the input of control constraints.

[0031] S340, Uncertainty Weighted Fusion: The variances of the two estimations, namely the evaluation mechanism and the data-driven estimation, are subjected to inverse variance weighted fusion to generate the final estimate and confidence level, which is then pushed to the anomaly detection, prediction and control modules to form a consistent state input.

[0032] Furthermore, the anomaly detection and root cause localization module performs the following steps:

[0033] S410, Standardization and Baseline: Calculate the historical mean and standard deviation of each parameter, generate standardized series and maintain seasonal or batch baselines, and review and update them regularly to reduce the impact of drift;

[0034] S420, Statistical Distance Alarm: Real-time calculation of Mahalanobis distance and comparison with threshold. If the threshold is exceeded, an alarm event is generated and entered into the queue. At the same time, the influencing parameters and context are recorded to trigger root cause localization.

[0035] S430, Change Point Detection: Apply CUSUM / PH test to the standardized sequence, output the location and type label of the change point, and correlate it with the time proximity of the process event;

[0036] S440, Root Cause Localization: Based on the process topology, perform subgraph search and causal scoring to generate root cause ranking and a list of suggested actions, which are then pushed to the HMI and control layer for "automatic / semi-automatic / manual" execution selection and recorded for auditing.

[0037] Furthermore, the following steps are performed through the prediction layer module:

[0038] S510, State-space modeling: Obtain the system matrix and noise term settings through data-driven identification or mechanism derivation, complete model validation and cross-validation, output a prediction model that can be used for MPC and register the version;

[0039] S520, Multi-scale Feature Extraction and Attention: Construct a four-layer hierarchical structure and calculate attention weights and saliency scores to generate interpretable heatmaps and key feature lists, which are then fed back to optimize operation and control strategies.

[0040] S530, Prediction and Uncertainty: Rolls out predictions for several future steps and calculates variance and confidence intervals, which are then published to the controller and HMI for advance adjustment and alarm suppression. At the same time, prediction errors are recorded for continuous learning.

[0041] Furthermore, the following steps are performed through the intelligent adjustment module:

[0042] S610, Actuator Dead Zone / Hysteresis Compensation: Identify the dead zone and hysteresis characteristics of the actuator through step / slope tests, and apply compensation functions and saturation protection to the real-time control signal;

[0043] S620, Pump Cavitation Safety Constraint: Calculates the available net positive suction head in real time and compares it with the minimum net positive suction head required by the equipment. If it is lower than the safety margin, the pump frequency is reduced or the valve position / bypass is adjusted, a protection alarm is generated and the triggering reason is recorded.

[0044] S630, Constraint Softening and Objective Function: Construct constraint and cost functions with softened variables, call the optimization solver to return the control sequence, verify feasibility and constraint violation, and record penalty guarantees;

[0045] S640, MPC / RL Hybrid Arbitration and Minimum Resident Time: Calculates arbitration weight based on risk score, merges MPC and RL outputs and enforces minimum residence time, and records switching events and reasons;

[0046] S650, dimensionality reduction and timeout degradation: monitors solution time and convergence status, shortens the prediction domain and variable dimension and warm-starts when necessary; immediately reverts to linear control if the threshold is exceeded;

[0047] S660, Security Barrier Hardening: Evaluate the CBF inequality and security set constraints of candidate control variables. If they are not satisfied, modify or reject the action to ensure that all issued commands are located in the set of safe and executable control variables.

[0048] S670, RL security and deployment strategy: pre-trained strategy on offline replay data and embedded with security constraints, gray-scale deployment and rollback in production environment, online fine-tuning and output gated by arbitrator;

[0049] S680, Manual Override Guard: Continuously monitors the HMI mode bit; entering "Manual / Stop" freezes the automatic control and actuator outputs and records audit data.

[0050] Furthermore, the calculation formulas for MPC / RL hybrid arbitration and minimum residency are as follows:

[0051] ;

[0052] ;

[0053] ;

[0054] in, To score the risk, For temperature coefficient, For the minimum stay time, As for the weight of arbitration, For the Sigmoid function; The time interval between two consecutive control source switching; These are the MPC and RL control variables, respectively. For the minimum stay time, To control the quantity;

[0055] The reward function for RL safety and deployment strategies is as follows:

[0056] ;

[0057] in, These correspond to water quality loss, energy consumption, chemical consumption, action switching, and safety constraint rewards, respectively. Losses due to water quality deviations; The indicator function to satisfy the constraints, As a reward value; For energy consumption, This refers to the amount of medicine consumed. To control the number of source / action switching times.

[0058] Furthermore, the following steps are performed through the CIP scheduling optimization module:

[0059] S710, trigger criterion: periodically evaluate transmembrane pressure difference and membrane flux and set hysteresis, generate CIP candidate events and enter the constraint evaluation stage;

[0060] S720, Resource / Environmental / Planning Constraints: Check chemical inventory, emission targets and production windows, calculate feasible sets and priorities, and output executable time windows and bill of materials;

[0061] S730, formulation concentration robust range and membrane penalty: Select formulation concentration within the robust range and estimate membrane damage penalty, weigh cleaning effect against membrane life, and screen candidate solutions;

[0062] S740, Residue Dissipation and Flushing Volume: Calculates the required flushing volume and time based on the residue model, generates the flushing program and valve / pump action sequence, and synchronously sends them to the HMI and PLC for execution;

[0063] S750, Comprehensive Optimization: Construct an optimization model that includes resource / environmental / planning constraints, use MILP or heuristics to solve for timing, formulation and stage duration, issue and execute the model and collect effect data to close the loop optimization parameters.

[0064] Furthermore, the following steps are performed through the HMI interaction and alarm linkage module:

[0065] S810, Trend and Forecast Display: Overlays real-time curves and forecast ranges on the HMI, displays arbitration weights and suggested actions, provides one-click execution or semi-automatic options and displays a safety assessment;

[0066] S820, Alarm Classification and Suppression: Classifies alarms, removes duplicates and merges them, sets delayed confirmation and suppression strategies, supports batch confirmation and comments, and reduces the risk of alarm storms;

[0067] S830, Interlocking and Secondary Confirmation: Critical actions trigger interlocking condition checks, and can only be executed after confirmation by two people. Both execution and failure are recorded with events and reasons for traceability.

[0068] S840, Mode Management and Audit: Provides mode switching guidance and risk warnings, records operator, time and reason, automatically synchronizes controller status and verifies safety boundaries;

[0069] S850, Traceability and Playback: Saves anomalies and control traces to a timeline / audit library, provides retrieval, filtering, and export capabilities, and generates compliance reports and event replays to support audits and improvements.

[0070] The beneficial effects of this invention are as follows:

[0071] This invention establishes a reliable and traceable data baseline by unifying equipment / channels and NTP time synchronization, zero point and range calibration. Combined with filtering interpolation and adaptive sampling, soft sensor and mechanism fusion and hierarchical time series prediction, it significantly improves the stability and foresight of observation and estimation.

[0072] On the anomaly management side, Mahalanobis distance and CUSUM / PH enable rapid and accurate alarms and provide solutions in conjunction with root cause localization; on the control side, dead zone / hysteresis compensation, NPSH safety constraints, MPC+RL risk arbitration and minimum residence, and CBF safety barriers work together to eliminate interference oscillations of continuous and discrete actions and provide smooth degradation for solution timeouts.

[0073] Meanwhile, CIP scheduling optimizes timing and formulation under inventory / emission / production windows and membrane penalties, while HMI manual monitoring and full auditing ensure closed-loop safety and compliance of human intervention.

[0074] The overall technical effect is to achieve full-process governance of "real-time monitoring - rapid response - traceability and compliance", significantly reduce the risks caused by chemical shortages or ratio errors and environmental constraints, reduce production capacity losses caused by cleaning and planning conflicts, and improve the stability of the treated water quality and the transparency of governance. Attached Figure Description

[0075] Figure 1 This is a structural block diagram of the IoT-based real-time water quality monitoring and intelligent regulation system for drinking water production lines of the present invention.

[0076] Figure 2 This is a flowchart of the data access and preprocessing process of the present invention;

[0077] Figure 3 This is a fusion diagram of the soft sensor and mechanism model of the present invention;

[0078] Figure 4 This is a flowchart of the anomaly detection and root cause localization process of the present invention;

[0079] Figure 5 This is the MPC / RL intelligent adjustment logic diagram of the present invention;

[0080] Figure 6This is a flowchart of the HMI interaction and audit log of the present invention. Detailed Implementation

[0081] The subject matter described herein will now be discussed with reference to exemplary embodiments. It should be understood that these embodiments are discussed only to enable those skilled in the art to better understand and implement the subject matter described herein, and changes may be made to the function and arrangement of the elements discussed without departing from the scope of this specification. Various processes or components may be omitted, substituted, or added as needed in the examples. Furthermore, features described in some examples may be combined in other examples.

[0082] like Figures 1-6 As shown, an IoT-based real-time water quality monitoring and intelligent adjustment system for drinking water production lines includes...

[0083] Data access and self-calibration module: Registers equipment and units for consistency, eliminates deviations through NTP time synchronization; calibrates zero-point range for shifts / CIP, and reduces weights for EWMA drift monitoring; constructs state vectors containing IDs / batches and audits them before storing them in the database;

[0084] Specifically, the process involves registering and unifying the units of field equipment and channels, performing NTP or gateway clock synchronization to eliminate time deviations, triggering zero-point and range calibration based on shift / CIP boundaries, and performing two-point calibration when necessary; continuously monitoring channel drift and health status with EWMA, marking abnormal channels as "requiring maintenance" and temporarily downgrading their weight; and finally constructing a multi-parameter status vector for subsequent analysis and control, associating it with equipment ID, batch / shift information, and audit logs to achieve a traceable production data baseline.

[0085] In one embodiment of the present invention, the following steps are specifically included:

[0086] S110, Equipment Registration and Unit Unification: Inventory of field equipment and sensors, collect model / range / unit and installation location, establish equipment channel unit mapping and perform unit standardization and conversion, generate globally unique equipment ID and configuration item, write to configuration center and audit library, and output equipment list and calibration metadata for reference in subsequent steps;

[0087] S120, Clock Synchronization and Timestamp Alignment: The gateway periodically synchronizes with the NTP or local time source and calculates... At the data receiving end, the timestamp of the newly arrived sample is corrected, and the correction value and source are recorded. If the deviation exceeds the threshold, an alarm is triggered and the device is required to be reset or re-synchronized to ensure that cross-device data is comparable on a unified time grid.

[0088] ;

[0089] in, For device or gateway clock offset (seconds); This is the corrected UTC timestamp. UTC timestamp;

[0090] S130, Zero / Range Calibration: Collect stable segment data at shift / CIP boundary, calculate zero drift or proportional coefficient and apply it in batches to the corresponding channel, perform two-point calibration to verify calibration effect, generate calibration report and difference comparison, update equipment status and version number, and retain audit records for traceability.

[0091] Events at the shift or CIP boundary Triggered, the original value is corrected to:

[0092] ;

[0093] in, These are the original measured values; This is the value after zero-point correction; The zero-point drift coefficient is estimated within the boundary event; For a set of shift or CIP boundary events; This is the standard solution or reference zero point value;

[0094] If proportional correction is required, use two-point calibration:

[0095] ;

[0096] in, These are the original readings for low and high standard solutions; This corresponds to the standard value; These are two-point calibration coefficients; For the output after calibration, This is the original value.

[0097] S140, Drift Monitoring and Self-Diagnosis: Real-time calculation of EWMA drift for each channel and comparison with thresholds. If the drift exceeds the limit, a health tag is added and the channel's contribution to control and estimation is reduced. Maintenance work orders and notifications are automatically created. If necessary, redundant sensors are switched to maintain closed-loop input stability.

[0098] When necessary, it refers to the situation where "closed-loop input stability" is no longer met, in order to avoid abnormal measurements from disrupting the stability of estimation and control.

[0099] The above situations include, but are not limited to, EWMA drift exceeding the soft threshold and persisting, data quality degradation, consistency verification failure, health tag "maintenance required" status not being restored, sensor offline / communication interruption persisting, stuck / saturated or exceeding engineering limits or physically impossible values, fault codes, etc.

[0100] Exponentially sliding motion estimation of drift for key channels:

[0101] ;

[0102] If the threshold is exceeded, the health label will be set to "Maintenance Required".

[0103] in, EWMA drift estimate at time t EWMA drift estimate for the previous time step; EWMA smoothing factor (recommended 0.05–0.20). ; The recent moving average (window 300–600 samples); the threshold is usually set to... , These are the original measured values; The historical baseline standard deviation (and) (of the same dimension), used for threshold setting.

[0104] S150, State Vector Construction: Consistency checks and missing data completion are performed on each source data, and the latest measurements are concatenated into a single vector. It also includes the device ID, batch / shift number and timestamp, and is written into the time series library and message bus for consumption by the anomaly detection, prediction and control modules;

[0105] ;

[0106] in, Turbidity; The conductivity is expressed in m / cm. Temperature (°C); Dissolved oxygen (mg / L); Residual chlorine (mg / L); The redox potential is (mV). Total organic carbon (mg / L); Ultraviolet absorption (1 / m); Membrane / pump pressure (kPa); Flow rate (m³ / h); Liquid level (m); Cumulative water production (m³); For membrane flux (Lm⁻²h⁻¹) This is the concatenated state vector.

[0107] Edge preprocessing and adaptive sampling module: median / bilateral filtering for noise reduction, unified raster interpolation; sliding window multi-scale aggregation, adaptive sampling based on curvature and events;

[0108] Specifically, the multi-source time-series data collected on the industrial gateway is denoised by median / bilateral filtering, interpolated and aligned using a unified time grid, and multi-scale aggregation is performed using a sliding window to preserve steady-state and transient features. The sampling frequency is dynamically adjusted according to curvature and events (valve position switching, pump start / stop, alarm triggering) to improve the observation resolution of key stages while meeting bandwidth, storage and power consumption constraints, and to provide a high-quality data stream for subsequent anomaly detection and prediction.

[0109] In one embodiment of the present invention, the following steps are specifically included:

[0110] S210, Denoising: Select median or bilateral filter parameters according to the channel noise characteristics to suppress abrupt changes and spikes, output the denoised sequence and mark the filtered points in the data quality label for reference during subsequent auditing and model training;

[0111] For high-frequency noise, use median or bilateral filtering:

[0112] ;

[0113] Among them, the filter parameters This is the half-window size for median filtering (number of samples). This is the output sequence of the median filter; For median operators;

[0114] S220, Time Alignment: Establish a unified time grid and perform linear or spline interpolation according to the source data timestamps. Clean up and resample duplicate and abrupt timestamps, output the aligned multi-source sequence and record the interpolation ratio to evaluate data reliability.

[0115] Interpolate multi-source data to the same time raster :

[0116] ;

[0117] in, To unify the time grid points (seconds). Original timestamp (seconds); The measurement value at a given time (units consistent with the original channel).

[0118] S230, Sliding Aggregation: Maintains a circular buffer to store the most recent window data, calculates statistics such as mean, variance, extreme values ​​and RMS to form window features, which not only preserves steady-state trends but also captures transient anomalies, providing multi-scale input for detection and prediction;

[0119] ;

[0120] in, The length of the sliding window (number of samples); For the sequence at time The value (unit is the same as the original channel). For the sequence at time The possible values ​​of -i This represents the window mean.

[0121] S240, Adaptive Sampling: Real-time Computation Based on event indications, update the sampling frequency according to the formula and send it to the gateway / PLC acquisition task; monitor CPU and bandwidth usage; and automatically limit the flow and reduce sampling when the resource protection threshold is triggered to ensure system stability.

[0122] The sampling frequency is dynamically adjusted based on curvature and events.

[0123] ;

[0124] in, Represents the rate of change / gradient of a time series (units AND and φ). Same, time unit is seconds); indicator function Used to identify the occurrence of an event (dimensionless, taking 0 or 1), the event includes valve position switching, pump start / stop, and alarm triggering; For the Sigmoid function (dimensionless); The curvature sensitivity coefficient (dimensionless). The event sensitivity coefficient (dimensionless); The upper and lower limits of the sampling frequency (Hz); For a moment The sampling frequency (Hz); norm (usually taken) ).

[0125] Soft sensor and mechanism fusion module: near-time training window normalization and interpolation; soft sensor estimation of difficult-to-measure indicators, mechanism model characterization of residual chlorine; uncertainty weighted fusion, output estimate and interval audit;

[0126] Specifically, a near-time training window is constructed and normalization and missing information are completed. A soft sensor model is run to estimate water quality indicators that are difficult to measure or costly. At the same time, a mechanism model such as residual chlorine is established to characterize the physicochemical process. The two types of estimation results are weighted and fused according to uncertainty to generate robust online estimates and confidence intervals for anomaly detection, prediction and control inputs. The model version and parameters are recorded to support auditing and backtracking.

[0127] In one embodiment of the present invention, the following steps are specifically included:

[0128] S310, Training Window Construction: Based on Length The sliding window constructs a feature tensor, performs dimensional normalization and missing value imputation (nearest neighbor interpolation / model imputation), generates data batches for use by soft sensors and prediction models, and caches them at the edges;

[0129] S320, Soft Sensor Estimation: Calls the selected soft sensor model to perform forward inference, outputs the online estimate and uncertainty of the target index, continuously records the estimation error and performs incremental fine-tuning or rolling updates of the model version as planned;

[0130] ;

[0131] in, The time window length (number of samples). For soft sensor models (regression / LSTM / Transformer). Its parameter set, Online estimation of difficult-to-measure indicators;

[0132] S330, Mechanism Model: Adaptively updated based on temperature, pH, and process conditions. and Based on the mechanism parameters, calculate the prediction of residual chlorine at the next time step and verify whether it meets the regulatory threshold, and use the result as the input of control constraints.

[0133] Taking residual chlorine as an example, consider natural decay and dosing gain:

[0134] ;

[0135] in, This represents the residual chlorine concentration (mg / L) at the next moment. This represents the current residual chlorine concentration (mg / L). The residual chlorine decay coefficient (1 / min) is given. This refers to the drug dosing gain (mg / L per mg / L dosage). This refers to the dosage (mg / L). Process noise (mg / L) This represents the sampling step size (min).

[0136] S340, Uncertainty Weighted Fusion: The variances of the two estimations, namely the evaluation mechanism and the data-driven estimation, are subjected to inverse variance weighted fusion to generate the final estimate and confidence level, which is then pushed to the anomaly detection, prediction and control modules to form a consistent state input;

[0137] Uncertainty-inverse weighted fusion mechanism and data-driven estimation:

[0138] ;

[0139] in, The standard deviations of data-driven (ML) and mechanism-based (MECH) estimates are respectively (and) (of the same dimension) is used to quantify uncertainty; Data-driven and mechanism-based models at time 1, 2, 3, 4, 5, 6, 7, The estimated value.

[0140] Anomaly detection and root cause localization module: Standardized baseline establishment, Mahalanobis distance and CUSUM / PH to identify anomalies and change points; Root causes are ranked based on process topology scoring, and action suggestions are generated, pushed out, and recorded.

[0141] Specifically, the parameters are standardized to establish a baseline, multivariate Mahalanobis distance is calculated to trigger anomalies, and statistical methods such as CUSUM / PH are used to identify change points. Then, the affected subgraphs are located on the process topology, the contribution scores and root cause rankings of equipment and parameters are performed, and treatment suggestions (bypass, backwash, chemical dosing, CIP) and expected impacts are generated and pushed to the HMI and control layer. At the same time, the event chain and evidence are retained for auditing and model retraining.

[0142] In one embodiment of the present invention, the following steps are specifically included:

[0143] S410, Standardization and Baseline: Calculating Historical Means of Each Parameter with standard deviation Generate standardized sequences and maintain seasonal or batch baselines, and review and update them regularly to reduce the impact of drift;

[0144] ;

[0145] in, For the first The standardized values ​​of each parameter These are the mean and standard deviation, respectively. For the first The parameters at time... The multivariate observation vector;

[0146] S420, Statistical Distance Alarm: Real-time calculation of Mahalanobis distance and comparison with threshold. In comparison, alarm events exceeding the threshold are queued, and the influencing parameters and context are recorded to trigger root cause localization.

[0147] ;

[0148] in, For multivariate mean and covariance; Alarm threshold; This is a Mahalanobis distance statistic. For a moment The multivariate observation vector, For alarm indication;

[0149] S430, Change Point Detection: Apply CUSUM / PH test to the standardized sequence, output the location and type label (mutation / asymptotic) of change points, and correlate them with the time proximity of process events;

[0150] S440, Root Cause Analysis: Based on the process topology, perform subgraph search and causal scoring to generate root cause ranking and suggested action list, push them to HMI and control layer for "automatic / semi-automatic / manual" execution selection and record audit;

[0151] In the process diagram, an affected sub-diagram is generated, and the contribution of equipment and parameters is scored. Output treatment recommendations (bypass, backwash, chemical dosing, CIP);

[0152] in, Score the contribution of the device / parameter to the anomaly (which can be obtained by Shapley value or attention weight normalization).

[0153] Prediction layer module: Hybrid state space combined with hierarchical attention; extracts multi-scale features, outputs short- and medium-term predictions and uncertainties, supporting MPC and early warning;

[0154] Specifically, a hybrid state-space model is established and combined with hierarchical temporal attention. Multi-scale features are extracted from four layers of "process section equipment parameter events" to output short- and medium-term predictions and uncertainty ranges of key water quality and process quantities. Attention weights and feature contributions are also given to explain the model's decision-making and guide the focus of operators and controllers. The prediction results are then incorporated into subsequent MPC and alarm suppression strategies.

[0155] In one embodiment of the present invention, the following steps are specifically included:

[0156] S510, State-space modeling: obtained through data-driven identification or mechanism derivation. With noise term settings, complete model validation and cross-validation, output a prediction model that can be used for MPC and register the version;

[0157] ;

[0158] in, For the system matrix; For exogenous disturbances; This refers to the process noise term; This is the system state vector; To control the input vector;

[0159] S520, Multi-scale Feature Extraction and Attention: Construct a four-layer hierarchical structure and calculate attention weights and saliency scores to generate interpretable heatmaps and key feature lists, which are then fed back to optimize operation and control strategies.

[0160] Construct a four-layer representation of "process section equipment parameter events" and assign attention weights. Depicting contribution and dependence.

[0161] S530, Forecasting and Uncertainty: Rolling Forecasts of the Future The variance and confidence interval are calculated and published to the controller and HMI for early adjustment and alarm suppression, while the prediction error is recorded for continuous learning.

[0162] ;

[0163] in, To predict the number of steps; To predict uncertainty (variance or covariance). For the future The output prediction sequence of the step; These are hierarchical temporal attention weights used to characterize feature contributions and dependencies.

[0164] Intelligent adjustment module: compensates for dead zone / hysteresis and applies NPSH constraints; risk arbitration MPC and RL, minimum residence and CBF protection, timeout degradation of line control; supports gray-scale rollback and manual / stop auditing;

[0165] Specifically, dead zone / hysteresis compensation and NPSH safety constraints are implemented for actuators such as valves and pumps, and constraint softening and penalties are used to ensure optimization feasibility; coordination is achieved between MPC and RL through risk-aware arbitration weights, and minimum dwell time is set to prevent oscillations caused by high-frequency switching; MPC is dimensionality reduced and warm-started, and smoothly degraded to linear control in the event of solution timeout, while discrete CBF safety barriers and RL safety rewards, gray-scale launch and rollback mechanisms are enabled; manual / stop protection and auditing of HMI are supported to ensure closed-loop safety and controllability when manual intervention is required;

[0166] In one embodiment of the present invention, the following steps are specifically included:

[0167] S610, Actuator Dead Zone / Hysteresis Compensation: Identify the dead zone and hysteresis characteristics of the actuator through step / slope tests, apply compensation functions and saturation protection to the real-time control signal to ensure that small commands can produce a considerable response and reduce oscillations;

[0168] ;

[0169] in, The dead zone threshold is identified by a step test. The effective control quantity after dead zone compensation. To control the input vector;

[0170] S620, Pump Cavitation Safety Constraints (NPSH): Real-time Calculation and equipment If the value is lower than the safety margin, the pump frequency is reduced or the valve position / bypass is adjusted, a protection alarm is generated, and the triggering reason is recorded.

[0171] ;

[0172] ;

[0173] in, For inlet pressure, Vapor pressure, To manage losses, For density, It is the acceleration due to gravity. For safety margin, The minimum net positive suction head required by the equipment (manufacturer's specification). For usable net positive suction head, This is the t-th available net positive intake head;

[0174] S630, Constraint Softening and Objective Function: Construct the constraint and cost function with softening variables, call the optimization solver to return the control sequence, verify feasibility and constraint violation, and record them. For auditing and reference purposes;

[0175] ;

[0176] ;

[0177] ;

[0178] in, To ensure feasibility through penalties (softening / slackening variables). To control the upper and lower limits of the indicators; For the first Step output prediction, To control the increment, for The amount of control at any given moment for The amount of control at any given moment The length of the MPC prediction domain (steps). For reference trajectory, These are weighting coefficients; To optimize the objective function value; for Norm; For weighted norm (weight matrix) ).

[0179] S640, MPC / RL hybrid arbitration and minimum dwell time: Calculate arbitration weight based on risk score, integrate MPC and RL outputs and enforce minimum dwell time, record switching events and reasons, and prevent closed-loop oscillation caused by high-frequency switching;

[0180] ;

[0181] ;

[0182] ;

[0183] in, Assign a risk score (e.g., probability of violation). For temperature coefficient, For the minimum stay time, As for the weight of arbitration, For the Sigmoid function; The time interval between two consecutive control source switching; These are the MPC and RL control variables, respectively. For the minimum stay time, To control the quantity;

[0184] S650, Dimensionality Reduction and Timeout Degradation in Solving: Monitors solution time and convergence status, shortens the prediction domain and variable dimensions and performs a warm start when necessary; immediately reverts to linear control if a threshold is exceeded. To ensure real-time performance and security;

[0185] Adaptive shortening of prediction domain Variable selection and warm start;

[0186] "When necessary" refers to the implementation of a solution acceleration strategy that reduces the prediction domain and variable dimension and adopts a warm start, respectively, under the condition of meeting the preset soft / hard triggering conditions, as well as a linear control backoff strategy under timeout or abnormal conditions, in order to ensure the real-time performance and safety of the control loop.

[0187] Among them, soft triggering (performing dimensionality reduction and warm start):

[0188] The solution time reaches the soft threshold: close to the control cycle budget or has consumed too much time.

[0189] Convergence quality is not up to standard: optimality / KKT residual and feasibility violation exceed preset thresholds.

[0190] Stagnant progress: Insufficient improvement of the target or too small iteration step size (exhibiting "stagnation / delay" characteristics).

[0191] Multiple near-timeouts but not yet timeouts: The system has approached the soft threshold multiple times in recent cycles, posing a real-time risk.

[0192] Hard trigger (execute timeout and degrade to linear control):

[0193] The solution time exceeds the hard threshold: exceeding the cycle or safety margin.

[0194] The iteration reaches the upper limit but still fails to converge: and the convergence criterion is not met.

[0195] The number of consecutive soft triggers has reached the limit, meaning that even after multiple consecutive soft triggers, recovery is still not possible.

[0196] Timeout rollback to linear control:

[0197] ;

[0198] in, For linear control / LQR gain matrix, It is a linear control quantity, i.e., the control input. For the prediction domain, This is the system state vector;

[0199] S660, Safety Barrier Hardening (Discrete CBF): Evaluates the CBF inequalities and safety set constraints for candidate control variables; if not satisfied, corrects or rejects the action, ensuring all issued commands are within the specified range. ;

[0200] ;

[0201] in, For safety functions (such as residual chlorine safety margin). Let be the CBF relaxation coefficient. ; For a set of safe and executable control variables, This is the state at the next moment.

[0202] S670, RL security and deployment strategy: Pre-train the strategy on offline replay data and embed security constraints, can be deployed to the production environment in a gray-scale and rollback manner, fine-tune it in small steps online and gating the output by the arbitrator to ensure that exploration is restricted and safe and compliant.

[0203] Reward function:

[0204] ;

[0205] in, These correspond to water quality loss, energy consumption, chemical consumption, action switching, and safety constraint rewards, respectively. Losses due to water quality deviations; The indicator function to satisfy the constraints, As a reward value; Energy consumption (such as power integral or electricity consumption). This refers to the amount of medicine consumed (by mass or volume). To control the number of source / action switching times.

[0206] Offline pre-training is combined with online fine-tuning, with gray-scale deployment and rollback; RL outputs only when arbitration is permitted.

[0207] S680, manual overwrite protection: continuously monitors the HMI mode position, enters "manual / stop" to freeze the automatic control and actuator output and record audit, and when restored, executes parameter synchronization and gradually unfreezes the process to avoid sudden changes that may cause process shocks;

[0208] CIP scheduling optimization module: differential pressure / flux criterion triggering; constrains inventory, emissions and windows, selects robust formulations for membrane penalty; calculates flushing volume and timing, generates scheduling and auditing and writes back to the knowledge graph;

[0209] Specifically, based on differential pressure and flux threshold criteria, and combined with chemical inventory, emission limits and production window constraints, the timing of CIP triggering and formulation concentration are optimized, and a robust scheme is selected under membrane damage penalty; the required flushing volume and time are calculated according to the residual dissipation model, detailed CIP scheduling instructions, material requirements and environmental audit records are generated, and the execution effect is written back to the knowledge graph to continuously improve the formulation and cycle time;

[0210] In one embodiment of the present invention, the following steps are specifically included:

[0211] S710, Trigger Criterion: Periodic Evaluation and Hysteresis is set to avoid jitter, CIP candidate events are generated, and the constraint evaluation phase is initiated.

[0212] ;

[0213] in, Transmembrane pressure difference; This represents the transmembrane pressure threshold. Membrane flux (or standardized flux). Its threshold;

[0214] S720, Resource / Environmental / Planning Constraints: Check chemical inventory, emission targets and production windows, calculate feasible sets and priorities, and output executable time windows and bill of materials;

[0215] ;

[0216] in, In the time window The set of CIP steps to be executed within the internal plan. For steps The amount of chemicals used; Candidate time window variables; This refers to the available stock of chemicals. For drainage or environmental protection indicators, For discharge or environmental protection limits; For permitted production windows;

[0217] S730, formulation concentration robust range and membrane penalty: Select formulation concentration within the robust range and estimate membrane damage penalty, weigh cleaning effect against membrane life, and screen candidate solutions;

[0218] ;

[0219] in, This refers to the concentration of the formulation. Punishment for membrane damage; This represents the upper and lower bounds of the robust range for the formulation concentration;

[0220] S740, Residue Dissipation and Flushing Volume: Calculates the required flushing volume and time based on the residue model, generates the flushing program and valve / pump action sequence, and synchronously sends them to the HMI and PLC for execution;

[0221] ;

[0222] in, The residual concentration in the system after CIP; The initial residual concentration at the end of CIP; The residual dissipation coefficient (fitted from experiments); For system volume; For the flushing volume; This represents the residual concentration threshold.

[0223] Rinse time:

[0224] ;

[0225] in, For the flushing volume; For flushing flow rate, This refers to the rinsing time;

[0226] S750, Comprehensive Optimization: Construct an optimization model that includes resource / environmental / planning constraints, use MILP or heuristics to solve for timing, formulation and phase duration, issue and execute, and collect effect data to close the loop optimization parameters;

[0227] ;

[0228] Among them, the target weight These correspond to the trade-off coefficients for recovery rate loss, chemical consumption, downtime, and membrane damage, respectively. This refers to the downtime. In the time window Formula Chemical consumption at that time Punishment for membrane damage; For flux recovery rate;

[0229] HMI Interaction and Alarm Linkage Module: Presents trends, prediction ranges, arbitration weights, and suggestions; alarm classification merging and delayed confirmation, interlocking and dual-person approval; mode management and full auditing, supporting trajectory playback;

[0230] Specifically, the touchscreen interface displays real-time trends, prediction ranges, and arbitration weights, providing suggested actions and their security assessments; it implements alarm classification, merging, and delayed confirmation to suppress alarm storms, and performs interlocking and dual-person confirmation for critical actions; it manages automatic / semi-automatic / manual mode switching and generates complete audit logs, supports the retrieval and playback of anomalies and control trajectories, and ensures that human-machine collaboration is transparent, traceable, and compliant.

[0231] In one embodiment of the present invention, the following steps are specifically included:

[0232] S810, Trend and Forecast Display: Overlays real-time curves and forecast ranges on the HMI, displays arbitration weights and suggested actions, provides one-click execution or semi-automatic options, and displays a safety assessment.

[0233] S820 Alarm Classification and Suppression: Classifies, deduplicates, and merges alarms; sets delayed confirmation and suppression strategies; supports batch confirmation and annotation; and reduces the risk of alarm storms.

[0234] S830, Interlocking and Secondary Confirmation: Critical actions trigger interlocking condition checks, and can only be executed after confirmation by two people. Both execution and failure are recorded with the event and reason for traceability.

[0235] S840, Mode Management and Audit: Provides mode switching guidance and risk warnings, records operator, time and reason, automatically synchronizes controller status and verifies safety boundaries.

[0236] S850, Traceability and Playback: Saves anomalies and control traces to a timeline / audit library, provides retrieval, filtering, and export capabilities, and generates compliance reports and event replays to support audits and improvements.

[0237] In an actual drinking water production line, the hardware conditions and on-site configuration for incorporating the aforementioned real-time water quality monitoring and intelligent adjustment system are as follows:

[0238] Sensors and Instruments: Online instruments for turbidity, pH, ORP, residual chlorine, temperature, flow rate, pressure, etc., supporting digital / analog interfaces and field calibration. Includes calibration kits and standard solutions. Sensor installation locations meet bypass sampling and representativeness requirements, and interfaces are compatible with fieldbus.

[0239] Actuators and equipment: Metering pumps (for disinfectant / coagulant dosing), electric regulating valves, variable frequency pumps, and other actuators support remote setting and feedback signals. They feature valve limit and pump protection logic, and the equipment can be configured for maintenance bypass and safety interlocking.

[0240] Control and Edge Computing: Edge gateways / industrial PCs are used for data access, preprocessing, fusion, and control strategy execution; PLCs / DCS perform real-time control and interlocking. Clock synchronization (NTP / PTP) ensures unified time across the entire network; it has the necessary local caching and fault recovery capabilities.

[0241] Communication and Networking: Industrial Ethernet and fieldbus (such as Modbus, OPC UA, etc.), VLANs and access control policies isolate business and management networks. Encryption and certificate management, whitelisting and jump server policies are employed to ensure network security and audit traceability.

[0242] Software platform and data: HMI / SCADA is used for monitoring and operation, with audit logs, report export, configuration version management and rollback capabilities. Local time series data persistence and backup strategies, and version management and update processes for models and parameters.

[0243] Power supply and environment: UPS and lightning protection grounding ensure stable power supply, and the cabinet and environment have temperature and humidity control and dust and water protection measures.

[0244] Spare parts and redundancy: Spare sensors and calibration kits, and optional redundancy configurations for critical networks and compute nodes.

[0245] Site conditions and maintenance: Bypass sampling points and sampling pipelines are rationally laid out; CIP cleaning and routine maintenance plans are complete; reagents are safely stored and managed. On-site operation authority levels and change approval processes are in place; contingency plans and drill records for abnormal situations are maintained.

[0246] Under fluctuating raw water quality conditions, maintain stable effluent quality, reduce the frequency and risk of human intervention, and ensure that key quality indicators remain within process safety boundaries. This involves a closed-loop system of online monitoring, anomaly detection, intelligent adjustment, and HMI (House Management System) for the entire process from raw water intake to effluent.

[0247] The scenario in the example is as follows: After the raw water enters the plant, sensors such as turbidity, pH, residual chlorine, temperature, and flow rate are continuously collected at the edge side; the system needs to maintain the stability of the water quality leaving the plant in the case of water quality fluctuations and reduce human intervention.

[0248] The objectives are as follows: to achieve end-to-end real-time monitoring, anomaly location, and safe and controllable intelligent adjustment, ensuring that key quality indicators continuously meet process standards.

[0249] like Figure 2 -The data access and preprocessing flowchart is shown below. The data access and preprocessing process is as follows:

[0250] Automatic calibration and noise reduction: Calibrate the sensor for zero / slope drift, and apply filtering and outlier handling.

[0251] EWMA (Ever-Wave Monitoring): Monitors long-term, minute shifts, triggering health status alerts and adjustments to the sampling strategy.

[0252] Adaptive sampling: Dynamically adjusts the sampling frequency and window size based on fluctuations and uncertainties.

[0253] Clock synchronization and interpolation: NTP unified time axis is used to perform linear / spline interpolation on missing or unaligned samples;

[0254] like Figure 3 -As shown in the diagram of soft sensor and mechanism model fusion, the index estimation and fusion are as follows:

[0255] Soft sensor estimation: Regression / LSTM / Transformer and other models are used to estimate "difficult-to-measure indicators" online.

[0256] Mechanism model: Characterizes the mechanism relationship of natural decay of residual chlorine in pipelines and the effect of temperature.

[0257] Fusion and uncertainty: The final estimate and uncertainty are obtained by inverse variance weighting, which are used for subsequent decision credibility assessment.

[0258] like Figure 4 - The flowchart for anomaly detection and root cause localization is shown below. Anomaly detection and root cause localization are as follows:

[0259] Change point detection: CUSUM / PH and other methods identify significant changes in water quality and estimate them.

[0260] Distance metric: Mahalanobis distance is used to assess the significance of bias and form a queue of alarm events.

[0261] Root cause scoring and treatment: Shapley values ​​are used to score root causes, match them with a treatment strategy library, and generate feedback and process adjustment recommendations.

[0262] like Figure 5 The MPC / RL intelligent regulation logic diagram is shown below. The intelligent control logic (MPC+RL+CBF) is as follows:

[0263] MPC prediction optimization: Based on prediction and constraint optimization in the rolling time domain, it provides dosage and valve position suggestions.

[0264] RL Long-Term Strategy: Combine long-term gains with learning to fine-tune strategies to improve overall performance under dynamic conditions.

[0265] Arbitration and Safety Barrier: The arbitrator integrates the recommendations of both; CBF ensures that the control does not exceed the limits (such as residual chlorine not falling below the lower limit, and pump operation not triggering cavitation).

[0266] Actuator protection: Consider valve dead zone compensation and pump NPSH protection to smoothly execute commands.

[0267] like Figure 6 The HMI interaction and audit log flowchart is shown below. The HMI interaction and auditing are as follows:

[0268] Change approval: Changes to process parameters must be approved by the HMI before being issued to avoid misoperation.

[0269] Auditing and Reporting: All operations and alarms are written to the audit log, and report export and version rollback are supported.

[0270] Monitoring and Display: The large screen displays key indicator trends, alarm lists, and handling progress.

[0271] In practical applications, the system ensures stable effluent quality during shifts with fluctuating raw water quality, reducing manual intervention. When anomalies occur, it quickly identifies the root cause and provides treatment suggestions, ensuring that safety boundaries are not breached.

[0272] The embodiments of the present invention have been described above, but the present invention is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of the present invention, all of which are within the protection scope of the present invention.

Claims

1. A real-time water quality monitoring and intelligent adjustment system for drinking water production lines based on the Internet of Things, characterized in that, include: Data access and self-calibration module: Registers equipment and units for consistency, eliminates deviations through NTP time synchronization; calibrates zero-point range for shifts / CIP, and reduces weights for EWMA drift monitoring; constructs state vectors containing IDs / batches and audits them before storing them in the database; Edge preprocessing and adaptive sampling module: median / bilateral filtering for noise reduction, unified raster interpolation; sliding window multi-scale aggregation, adaptive sampling based on curvature and events; Soft sensor and mechanism fusion module: near-time training window normalization and interpolation; Soft sensors estimate difficult-to-measure indicators, and mechanism models characterize residual chlorine; uncertainty weighted fusion is used to output estimates and intervals with auditing. Anomaly detection and root cause localization module: Standardized baseline establishment, Mahalanobis distance and CUSUM / PH to identify anomalies and change points; Root causes are ranked based on process topology scoring, and action suggestions are generated, pushed out, and recorded. Prediction layer module: Hybrid state space combined with hierarchical attention; Extract multi-scale features and output short- to medium-term predictions and uncertainties to support MPC and early warning; Intelligent adjustment module: compensates for dead zone / hysteresis and applies NPSH constraints; risk arbitration MPC and RL, minimum residence and CBF protection, timeout degradation of line control; supports gray-scale rollback and manual / stop auditing; CIP scheduling optimization module: differential pressure / flux criterion triggering; constrains inventory, emissions and windows, selects robust formulations for membrane penalty; calculates flushing volume and timing, generates scheduling and auditing and writes back to the knowledge graph; HMI Interaction and Alarm Linkage Module: Presents trends, prediction ranges, arbitration weights, and suggestions; alarm classification merging and delayed confirmation, interlocking, and dual-person approval; Pattern management and full auditing, supporting trajectory playback.

2. The IoT-based real-time water quality monitoring and intelligent adjustment system for drinking water production lines according to claim 1, characterized in that, Perform the following steps using the data access and self-calibration module: S110, Equipment Registration and Unit Unification: Inventory of field equipment and sensors, collect model / range / unit and installation location, establish equipment channel unit mapping and perform unit standardization and conversion, generate globally unique equipment ID and configuration item, write to configuration center and audit library, and output equipment list and calibration metadata; S120, clock synchronization and timestamp alignment: The gateway periodically synchronizes with the NTP or local time source, calculates the clock deviation of the device or gateway, corrects the timestamp of the newly arrived sample at the data receiving end, records the correction value and source, and if the deviation exceeds the threshold, an alarm is triggered and the device is required to reset or resynchronize, ensuring that cross-device data is comparable on the same time grid. S130, Zero / Range Calibration: Collect stable segment data at shift / CIP boundaries, calculate zero drift or proportional coefficient and apply it in batches to the corresponding channels, perform two-point calibration to verify the calibration effect, generate calibration report and difference comparison, update equipment status and version number, and retain audit records; Triggered in shift or CIP boundary events, the original value is corrected; If proportional correction is required, two-point calibration should be used; S140, Drift Monitoring and Self-Diagnosis: Real-time calculation of EWMA drift for each channel and comparison with thresholds. If the drift exceeds the limit, a health tag is added and the channel's contribution to control and estimation is reduced. Maintenance work orders and notifications are automatically created. When the closed-loop input is unstable, the system switches to redundant sensors. S150, State Vector Construction: Perform consistency verification and missing data filling on each source data, concatenate the latest measurements into a state vector, and attach the device ID, batch / shift and timestamp, and write it to the time series library and message bus for consumption by the anomaly detection, prediction and control modules.

3. The IoT-based real-time water quality monitoring and intelligent adjustment system for drinking water production lines according to claim 1, characterized in that, The following steps are performed through the edge preprocessing and adaptive sampling module: S210, Denoising: Select median or bilateral filter parameters according to the channel noise characteristics, suppress abrupt changes and spikes, output a denoised sequence, and mark the filtered points in the data quality label; S220, Time Alignment: Establish a unified time grid and perform linear or spline interpolation according to the source data timestamps. Clean up and resample duplicate and abrupt timestamps, output the aligned multi-source sequence and record the interpolation ratio. S230, Sliding Aggregation: Maintains a circular buffer to store the most recent window data, and calculates the statistics of mean, variance, extreme values ​​and RMS to form window features; S240, Adaptive Sampling: Real-time calculation of the rate of change / gradient and event indication of the time series, updates the sampling frequency according to the formula and sends it to the gateway / PLC acquisition task, monitors CPU and bandwidth usage, and automatically limits the flow and downsamples when the resource protection threshold is triggered.

4. The IoT-based real-time water quality monitoring and intelligent adjustment system for drinking water production lines according to claim 1, characterized in that, The following steps are performed using the soft sensor and mechanism fusion module: S310, Training Window Construction: Construct a feature tensor using a sliding window, perform dimensional normalization and missing value imputation, generate data batches for use by soft sensors and prediction models, and cache them at the edges; S320, Soft Sensor Estimation: Calls the selected soft sensor model to perform forward inference, outputs the online estimate and uncertainty of the target index, continuously records the estimation error and performs incremental fine-tuning or rolling updates of the model version as planned; S330, Mechanism Model: Based on temperature, pH and process conditions, the residual chlorine decay coefficient and dosing gain are adaptively updated, the residual chlorine prediction at the next moment is calculated and verified to meet the regulatory threshold, and the result is used as the input of control constraints. S340, Uncertainty Weighted Fusion: The variances of the two estimations, namely the evaluation mechanism and the data-driven estimation, are subjected to inverse variance weighted fusion to generate the final estimate and confidence level, which is then pushed to the anomaly detection, prediction and control modules to form a consistent state input.

5. The IoT-based real-time water quality monitoring and intelligent adjustment system for drinking water production lines according to claim 1, characterized in that, The following steps are performed by the anomaly detection and root cause localization module: S410, Standardization and Baseline: Calculate the historical mean and standard deviation of each parameter, generate standardized series and maintain seasonal or batch baselines, and review and update them regularly to reduce the impact of drift; S420, Statistical Distance Alarm: Real-time calculation of Mahalanobis distance and comparison with threshold. If the threshold is exceeded, an alarm event is generated and entered into the queue. At the same time, the influencing parameters and context are recorded to trigger root cause localization. S430, Change Point Detection: Apply CUSUM / PH test to the standardized sequence, output the location and type label of the change point, and correlate it with the time proximity of the process event; S440, Root Cause Analysis: Based on the process topology, perform subgraph search and causal scoring to generate root cause ranking and a list of suggested actions, which are then pushed to the HMI and control layer for "automatic / semi-automatic / manual" execution selection and recorded for auditing.

6. The IoT-based real-time water quality monitoring and intelligent adjustment system for drinking water production lines according to claim 1, characterized in that, The following steps are performed through the prediction layer module: S510, State-space modeling: Obtain the system matrix and noise term settings through data-driven identification or mechanism derivation, complete model validation and cross-validation, output a prediction model that can be used for MPC and register the version; S520, Multi-scale Feature Extraction and Attention: Construct a four-layer hierarchical structure and calculate attention weights and saliency scores to generate interpretable heatmaps and key feature lists, which are then fed back to optimize operation and control strategies. S530, Prediction and Uncertainty: Rolls out predictions for several future steps and calculates variance and confidence intervals, which are then published to the controller and HMI for advance adjustment and alarm suppression. At the same time, prediction errors are recorded for continuous learning.

7. The IoT-based real-time water quality monitoring and intelligent adjustment system for drinking water production lines according to claim 1, characterized in that, The following steps are performed via the intelligent adjustment module: S610, Actuator Dead Zone / Hysteresis Compensation: Identify the dead zone and hysteresis characteristics of the actuator through step / slope tests, and apply compensation functions and saturation protection to the real-time control signal; S620, Pump Cavitation Safety Constraint: Calculates the available net positive suction head in real time and compares it with the minimum net positive suction head required by the equipment. If it is lower than the safety margin, the pump frequency is reduced or the valve position / bypass is adjusted, a protection alarm is generated and the triggering reason is recorded. S630, Constraint Softening and Objective Function: Construct constraint and cost functions with softened variables, call the optimization solver to return the control sequence, verify feasibility and constraint violation, and record penalty guarantees; S640, MPC / RL Hybrid Arbitration and Minimum Resident Time: Calculates arbitration weight based on risk score, merges MPC and RL outputs and enforces minimum residence time, and records switching events and reasons; S650, dimensionality reduction and timeout degradation: monitors solution time and convergence status, and shortens the prediction domain and variable dimension and warm-starts when preset trigger conditions are met; if the threshold is exceeded, it immediately falls back to linear control; Preset triggering conditions include: solution time reaching the soft threshold, convergence quality failing to meet standards, progress stalling, multiple consecutive near-timeouts but not yet timeouts, solution time exceeding the hard threshold, iteration reaching the upper limit but still not converging, and soft triggers occurring consecutively reaching the upper limit. S660, Security Barrier Hardening: Evaluate the CBF inequality and security set constraints of candidate control variables. If they are not satisfied, modify or reject the action to ensure that all issued commands are located in the set of safe and executable control variables. S670, RL security and deployment strategy: pre-trained strategy on offline replay data and embedded with security constraints, gray-scale deployment and rollback in production environment, online fine-tuning and output gated by arbitrator; S680, Manual Override Guard: Continuously monitors the HMI mode bit, and entering "Manual / Stop" freezes the automatic control and actuator outputs and records audits.

8. The IoT-based real-time water quality monitoring and intelligent adjustment system for drinking water production lines according to claim 7, characterized in that, The calculation formulas for MPC / RL hybrid arbitration and minimum residency are as follows: ; ; ; in, To score the risk, For temperature coefficient, For the minimum stay time, As for the weight of arbitration, For the Sigmoid function; The time interval between two consecutive control source switching; These are the MPC and RL control variables, respectively. To control the quantity; The reward function for RL safety and deployment strategies is as follows: ; in, These correspond to water quality loss, energy consumption, chemical consumption, action switching, and safety constraint rewards, respectively. Losses due to water quality deviations; The indicator function to satisfy the constraints, As a reward value; For energy consumption, This refers to the amount of medicine consumed. To control the number of source / action switching times.

9. The IoT-based real-time water quality monitoring and intelligent adjustment system for drinking water production lines according to claim 1, characterized in that, Perform the following steps using the CIP scheduling optimization module: S710, trigger criterion: periodically evaluate transmembrane pressure difference and membrane flux and set hysteresis, generate CIP candidate events and enter the constraint evaluation stage; S720, Resource / Environmental / Planning Constraints: Check chemical inventory, emission targets and production windows, calculate feasible sets and priorities, and output executable time windows and bill of materials; S730, formulation concentration robust range and membrane penalty: Select formulation concentration within the robust range and estimate membrane damage penalty, weigh cleaning effect against membrane life, and screen candidate solutions; S740, Residue Dissipation and Flushing Volume: Calculates the required flushing volume and time based on the residue model, generates the flushing program and valve / pump action sequence, and synchronously sends them to the HMI and PLC for execution; S750, Comprehensive Optimization: Construct an optimization model that includes resource / environmental / planning constraints, use MILP or heuristics to solve for timing, formulation and stage duration, issue and execute the model and collect effect data to close the loop optimization parameters.

10. The IoT-based real-time water quality monitoring and intelligent adjustment system for drinking water production lines according to claim 1, characterized in that, Perform the following steps through the HMI interaction and alarm linkage module: S810, Trend and Forecast Display: Overlays real-time curves and forecast ranges on the HMI, displays arbitration weights and suggested actions, provides one-click execution or semi-automatic options and displays a safety assessment; S820, Alarm Classification and Suppression: Classifies alarms, removes duplicates and merges them, sets delayed confirmation and suppression strategies, supports batch confirmation and comments, and reduces the risk of alarm storms; S830, Interlocking and Secondary Confirmation: Critical actions trigger interlocking condition checks, and can only be executed after confirmation by two people. Both execution and failure are recorded with events and reasons for traceability. S840, Mode Management and Audit: Provides mode switching guidance and risk warnings, records operator, time and reason, automatically synchronizes controller status and verifies safety boundaries; S850, Traceability and Playback: Saves anomalies and control traces to a timeline / audit library, provides retrieval, filtering, and export capabilities, and generates compliance reports and event replays to support audits and improvements.

Citation Information

Patent Citations

  • Big data-based hydrogeological dynamic monitoring and analysis system and method

    CN120217027A

  • Cold storage energy-saving control method based on deep reinforcement learning

    CN121210865A