Optimized water treatment method and system based on machine learning
By using the CNN-LSTM algorithm model to stream the water treatment equipment data in smart water system, the problem of insufficient data analysis and prediction accuracy of the system is solved, the automatic scheduling and efficient operation of the water treatment system are realized, and the response speed is improved and the level of wisdom.
Patent Information
- Application Number
- CN202411152694.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-21
- Publication Date
- 2024-12-06
AI Technical Summary
The existing smart water systems have shortcomings in data analysis and prediction accuracy, resulting in low accuracy in water resource demand forecasting and leak detection, and lack of advanced AI algorithms and intelligent decision-making systems, and have limited response capabilities.
Using machine learning-based optimized water treatment method, the process variable data of water treatment equipment is collected by arranging sensors, the CNN-LSTM algorithm model is constructed for data flow processing, and the control strategy is confirmed based on the model prediction results and preset rules to realize the water treatment Automatic scheduling of the system.
It significantly improves the prediction accuracy and response speed of the water treatment system, realizes the automated operation and unattended system, improves the level of intelligence and processing efficiency, and reduces waste of energy and resources.
Smart Images

Figure CN119089141A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of machine learning, and in particular to an optimized water treatment method and system based on machine learning. Background Art
[0002] Smart water systems currently widely use sensors and remote monitoring technologies to achieve real-time monitoring and data collection of parameters such as water quality, water pressure, and water level. These data are transmitted to the data center through the Internet of Things technology to provide real-time support for system operation. However, the degree of intelligence in existing systems is relatively low, and most systems still rely on traditional monitoring and control methods. Although data collection technology is becoming increasingly advanced, the system's ability to analyze and predict big data needs to be improved. The lack of efficient data mining and machine learning algorithm applications has resulted in low accuracy in the system's prediction of water resource demand and leak detection. In addition, the lack of advanced AI algorithms and intelligent decision-making systems limits the system's ability to respond in complex situations. Summary of the invention
[0003] Based on this, the embodiments of the present application provide a method and system for optimizing water treatment based on machine learning, which can solve the problems in the prior art.
[0004] In a first aspect, a method for optimizing water treatment based on machine learning is provided, the method comprising:
[0005] The process variable data are collected by sensors arranged at different parts of the water treatment equipment; wherein the process variable data at least include pH, turbidity, dissolved oxygen, ORP, hardness, conductivity, organic matter, nitrogen, phosphorus, heavy metals, liquid level, flow rate, and pressure data;
[0006] The collected process variable data is stored according to type and structure to achieve data partitioning and indexing;
[0007] Perform data cleaning and standardization on the stored data; data cleaning includes processing missing values, outliers, duplicate data, smoothing data and removing noise, and standardization includes data standardization and normalization;
[0008] Build a CNN-LSTM algorithm model and use it to process data streams;
[0009] Compare the model prediction results with the preset rules, and confirm the control strategy based on the comparison results; the preset rules include default rules and customized rules;
[0010] Control the water treatment equipment in each process link according to the confirmed control strategy to achieve the treatment of the overall water treatment system.
[0011] Optionally, the stored data is cleansed, including:
[0012] Fill missing values through linear relationship, the formula is:
[0013]
[0014] Where (x0, y0) and (x1, y1) are known data points, and x is the point to be interpolated.
[0015] Optionally, the stored data is smoothed and denoised, and normalized, including:
[0016] Analyze the stored data, determine the main characteristics and noise level of the data through data evaluation, and perform preliminary data processing to reduce short-term fluctuations; apply denoising technology to remove high-frequency random noise in the data, and ensure that the processed data can improve the accuracy and generalization ability of the prediction model through result analysis and model evaluation;
[0017] Standardize the stored data, including:
[0018] Use StandardScaler to standardize and convert each feature to a form with a mean of 0 and a standard deviation of 1;
[0019] After the data is normalized, the Min-Max Scaler is used to scale the data to the range of [0, 1] or [-1, 1] to ensure that all features are at the same scale.
[0020] Optionally, the data is stream processed through the CNN-LSTM algorithm model, including:
[0021] Correlation analysis is performed in the CNN-LSTM model. According to the time correlation in the time series data, the periodicity and trend of the time series are identified through the autocorrelation function; the autocorrelation function specifically includes:
[0022]
[0023] x t is the value of the time series at time point t;
[0024] is the mean of the time series;
[0025] k is the number of lag periods;
[0026] ACF(k) is the autocorrelation coefficient for lag number k.
[0027] Optionally, the predicted results of the model are compared with the preset rules, and the control strategy is confirmed according to the comparison results, including:
[0028] Load preset default rules and customized rules; the rules contain thresholds for various water quality parameters and corresponding operation instructions;
[0029] Compare the prediction results of the model with the numerical settings in the default rules, and when the prediction results are within the range of the default rules, determine the operation steps according to the rules; wherein the operation steps include adjusting the operating parameters of the water treatment equipment;
[0030] When the prediction result exceeds the range of the default rule or meets the special rule, check whether there is a customized rule applicable. If there is an applicable customized rule, compare the prediction result with the conditions of the customized rule to determine whether the prediction result falls within the range defined by the customized rule, and check whether the priority of the customized rule is higher than the default rule;
[0031] Based on the comparison results, choose to apply the default rule or customized rule; when the customized rule has a higher priority and is applicable, select the customized rule as the control strategy; otherwise, use the default rule.
[0032] Optionally, the water treatment equipment in each process link is controlled according to the confirmed control strategy, including:
[0033] Generate specific equipment operation instructions according to the confirmed control strategy; wherein the equipment operation instructions at least include valve control, pump start and stop, and local instrument control;
[0034] According to the set optimization strategy, arrange the operation sequence of water treatment equipment to achieve the optimization of the overall water treatment system.
[0035] In a second aspect, there is provided an optimized water treatment system based on machine learning, the system comprising:
[0036] A data collection module is used to collect process variable data through sensors arranged at different parts of the water treatment equipment; wherein the process variable data at least includes pH, turbidity, dissolved oxygen, ORP, hardness, conductivity, organic matter, nitrogen, phosphorus, heavy metals, liquid level, flow rate, and pressure data;
[0037] A data storage module is used to store the collected process variable data according to type and structure, and realize data partitioning and indexing;
[0038] The data cleaning module is used to clean and standardize the stored data; data cleaning includes processing missing values, outliers, duplicate data, smoothing data and removing noise, and standardization includes data standardization and normalization;
[0039] The algorithm model module is used to build a CNN-LSTM algorithm model and process data streams through the CNN-LSTM algorithm model.
[0040] A rule module is used to compare the results predicted by the model with the preset rules and confirm the control strategy according to the comparison results; wherein the preset rules include default rules and customized rules;
[0041] The scheduling module is used to control the water treatment equipment in each process link according to the confirmed control strategy to achieve the treatment of the overall water treatment system.
[0042] In a third aspect, an electronic device is provided, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the machine learning-based optimized water treatment method described in any one of the first aspects is implemented.
[0043] In a fourth aspect, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the machine learning-based optimized water treatment method described in any one of the first aspects is implemented.
[0044] In a fifth aspect, a computer program product is provided, comprising a computer program / instruction, which, when executed by a processor, implements any of the machine learning-based optimized water treatment methods described in the first aspect.
[0045] The beneficial effects brought by the technical solution provided by the embodiment of the present application include at least:
[0046] (1) By integrating advanced machine learning algorithms (CNN-LSTM model), the system can achieve accurate prediction, real-time monitoring and scheduling of water treatment process variables, achieve the optimization goals, energy efficiency, and automated and unattended operation of the water treatment system, and significantly improve the level of intelligence, processing efficiency and response speed.
[0047] (2) The automated dispatching system reduces manual intervention and reduces labor costs. At the same time, the intelligently optimized equipment operation strategy reduces the waste of energy and resources, and helps achieve energy conservation and emission reduction. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] In order to more clearly illustrate the implementation methods of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for the implementation methods or the description of the prior art. Obviously, the drawings in the following description are only exemplary, and for ordinary technicians in this field, other implementation drawings can be derived from the provided drawings without creative work.
[0049] Figure 1 A flow chart of an optimized water treatment method based on machine learning provided in an embodiment of the present application;
[0050] Figure 2A flowchart of the steps of a method for optimizing water treatment based on machine learning is provided in an embodiment of the present application. DETAILED DESCRIPTION
[0051] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0052] In the description of the present invention, the terms "comprises", "has" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or apparatus comprising a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may also include other steps or units that are not explicitly listed but are inherent to these processes, methods, products or apparatuses, or steps or units added based on further optimization schemes conceived by the present invention.
[0053] Smart water systems currently use sensors and remote monitoring technologies to achieve real-time monitoring and data collection of water quality, water pressure, water level and other parameters. These data are transmitted to the data center through the Internet of Things technology to provide real-time support for system operation. However, the current level of intelligence in smart water systems is relatively low, and most systems still rely on traditional monitoring and control methods.
[0054] Although data collection technology is becoming increasingly advanced, the system's ability to analyze big data and its prediction accuracy need to be improved. The lack of efficient data mining and machine learning algorithm applications has resulted in low accuracy in predicting water demand and leak detection. The lack of advanced AI algorithms and intelligent decision-making systems has limited the system's ability to respond in complex situations.
[0055] What are the links in the water treatment system: Water treatment mainly uses various water treatment processes to meet different water use standards required by the country
[0056] Innovation: Conventionally, neural networks are only required to be applied to smart water services in the prediction aspect. This algorithm combines specific process links and rules to achieve not only prediction, but also data storage, collection, cleaning, scheduling, and finally the optimization and control of the process. Relevant rules have been formulated based on relevant industry experience, so that this application can be operated like a human based on the reasoning results and the rules, thereby reducing labor costs and realizing intelligent and unmanned production operations. By using the CNN-LSTM hybrid model to process time series data, the algorithm uses convolutional neural networks (CNNs) to extract local features in time series and captures long-term dependencies through long short-term memory networks (LSTMs). This structure enables the CNN-LSTM model to not only effectively identify short-term patterns, but also consider the impact of past inputs on current and future predictions. The CNN layer is responsible for extracting local patterns from the data, while the LSTM layer handles the temporal dependencies of these patterns and retains historical information through a recursive structure.
[0057] In order to solve the above problems existing in the prior art, the present invention provides a method and system for optimizing water treatment process based on machine learning.
[0058] The method and system of the present invention include a data storage system, a data collection system, a data cleaning system, a CNN-LSTM algorithm model system, a rule system, and a scheduling system.
[0059] Data storage: The collected data is stored in a suitable storage medium according to type and structure. The system selects a suitable database or file system for storage according to the data type, and implements data partitioning and indexing to improve storage efficiency and query performance.
[0060] Data processing: After evaluating the data, missing values, outliers, duplicate data, etc. are processed, and the data is unified in format and standard and verified.
[0061] Build a dynamic CNN-LSTM algorithm model: CNN-LSTM Hybrid Models is a hybrid model that combines convolutional neural networks (CNN) and LSTM. CNN effectively extracts local features from time series data, while LSTM can capture long-term dependencies. The combination of the two can improve the model's ability to understand complex dynamic patterns.
[0062] Model prediction: Perform stream processing on real-time data, perform feature extraction, feature conversion, and data standardization. Process the real-time prediction results of the model and return them to the requester through the API.
[0063] Practical application: Based on the results predicted by the model and combined with the rules formulated by the software system, water treatment equipment in different links is controlled to optimize the overall water treatment system.
[0064] The process optimization of a single water treatment unit can achieve the overall optimization of the entire water treatment system. The process of this water treatment system combined with the model algorithm system is usually divided into several key steps, starting from data collection to the final instruction issuance to achieve intelligence and optimization of the entire water treatment system. Figure 1 As shown, a flow chart of the optimized water treatment method based on machine learning is given.
[0065] Please refer to Figure 2 , which shows a flow chart of the steps of a method for optimizing water treatment based on machine learning provided in an embodiment of the present application, which may include the following steps:
[0066] S1, collecting process variable data through sensors arranged in different parts of the water treatment equipment.
[0067] The process variable data include at least pH, turbidity, dissolved oxygen, ORP, hardness, conductivity, organic matter, nitrogen, phosphorus, heavy metals, liquid level, flow rate, and pressure data.
[0068] This step mainly realizes data collection and transmission: the system first collects process variable data in real time through various sensors (such as pH, turbidity, dissolved oxygen, etc.). These sensors are usually distributed in different parts of the water treatment equipment to ensure comprehensive monitoring of water quality. After the collected data is processed, it is transmitted to the central control system through the network.
[0069] S2, stores the collected process variable data according to type and structure to achieve data partitioning and indexing.
[0070] This step mainly implements the data storage system, which is designed to support large-scale data acquisition, storage, management and analysis, and is particularly suitable for data processing in real-time monitoring and control systems. The system is used to store large amounts of data from sensors, controllers and other data sources, and ensure the integrity, availability and security of the data. Collect data from various data sources (such as sensors, PLCs, SCADA systems, etc.) in real time. Support multiple data interfaces and protocols, such as OPC, Modbus, RESTful API, etc. Process structured data (such as database records), semi-structured data (such as log files), and unstructured data (such as image data). Storage media include relational databases, time series databases, NoSQL databases, file storage, etc.
[0071] S3, performs data cleaning and standardization on the stored data.
[0072] Among them, data cleaning includes processing missing values, outliers, duplicate data, smoothing data and removing noise, and standardization processing includes data standardization and normalization. In this step, data cleaning is achieved, including preprocessing of data, and linear interpolation is used for missing values in data processing. Due to the relatively stable data changes, missing values are filled by linear relationship, and the formula is:
[0073]
[0074] Where (x0, y0) and (x1, y1) are known data points, and x is the point to be interpolated.
[0075] In this step, the stored data is analyzed, the main characteristics and noise level of the data are determined through data evaluation, and the data is preliminarily processed to reduce short-term fluctuations; denoising technology is applied to remove high-frequency random noise in the data, and through result analysis and model evaluation, it is ensured that the processed data can improve the accuracy and generalization ability of the prediction model.
[0076] The purpose of data smoothing and denoising is to improve data quality and make data easier to analyze and model. Smoothing data can reduce short-term fluctuations and noise in the data, making long-term trends and patterns more obvious; it can more clearly observe the trends and periodic characteristics of the data, which is particularly important for predictive models; it can help the model better capture trends and patterns and improve prediction accuracy. Denoising technology can remove random fluctuations and irrelevant noise in the data, making the actual signal more prominent; it helps the model learn the real relationship in the data more accurately, thereby improving the performance of the model; it helps reduce the overfitting of the model to random fluctuations in the data, thereby improving the generalization ability of the model.
[0077] Data standardization and normalization, standardization is preferred, and normalization is used as a supplementary method. The data distribution of most water treatment parameters is usually non-normal, and may show a right-skewed distribution or other asymmetric distribution. The data distribution of parameters in the field of water treatment, such as water inflow, turbidity, pH value, pressure, conductivity, and adsorption rate, is often non-normal. The data distribution varies greatly and there is obvious non-normality.
[0078] S4, build a CNN-LSTM algorithm model, and perform stream processing on the data through the CNN-LSTM algorithm model.
[0079] In the embodiment of the present application, for the CNN-LSTM model, it is generally recommended to perform standardization first, because it can handle data with different means and standard deviations and can help the model better learn long-term dependencies. StandardScaler is used for standardization to convert each feature to a form with a mean of 0 and a standard deviation of 1. After the data is standardized, the Min-Max Scaler is used to scale the data to the range of [0, 1] or [-1, 1] to ensure that all features are at the same scale.
[0080] Feature engineering is performed in the CNN-LSTM model. Feature engineering is the process of extracting, transforming, or creating features from raw data that help improve model performance. Feature selection uses correlation matrices and feature selection techniques to identify important features. Model design uses CNN to extract local features and LSTM to capture long-term dependencies in time series. Model evaluation evaluates model performance and analyzes the impact of features on prediction results.
[0081] First, use the autocorrelation function (ACF): to identify periodicity in the time series. This helps to understand the periodic pattern of the data, thus providing preliminary information for subsequent modeling.
[0082] The autocorrelation function is used to measure the correlation of a time series at different time lags. It can help identify the periodicity and trend of the time series. Its formula is:
[0083]
[0084] x t is the value of the time series at time point t.
[0085] is the mean of the time series.
[0086] k is the number of lags.
[0087] ACF(k) is the autocorrelation coefficient for lag number k.
[0088] Next, use the partial correlation function (PACF) to identify direct correlations in the time series and determine the number of lags in the data. PACF helps understand the direct impact of lags on current values, which is particularly important for model selection and parameter tuning.
[0089] PACF (Partial Autocorrelation Function) is used to measure the correlation of time series at different lags after removing the effects of other lags. PACF determines the number of lags in the ARIMA model, selects the time step in the LSTM model, and calculates the partial autocorrelation coefficient. When , the impact of the first p-1 lags on the current lag is removed by regression. The specific formula is:
[0090]
[0091] Based on the understanding of ACF and PACF, create lag features. Lag features are past values of a time series that are added to the data as new features to capture time dependencies. Create lag features in the CNN-LSTM model to capture the impact of historical information of the time series on the current value.
[0092] Finally, the CNN-LSTM model is used to process and predict time series data. The CNN layer is used to extract local features, and the LSTM layer is used to capture long-term dependencies, ultimately achieving prediction of time series.
[0093] The algorithm model specifically includes the following steps:
[0094] (1) Data splitting:
[0095] The data is split in chronological order into training set, validation set and test set for model parameter adjustment and selection.
[0096] (2) Build a CNN-LSTM model: Define the model structure, including the CNN layer and the LSTM layer.
[0097] In the CNN part, convolutional layers are used to extract local features, and 1D convolutional layers are used to perform convolution operations on time series. In the LSTM part, LSTM layers are used to capture long-term dependencies in time series. The output layer is a fully connected layer used to predict target variables (including but not limited to, optimal backwash time, resin regeneration cycle).
[0098] (3) Model training: Use the training data to train the model and verify it on the validation set.
[0099] (4) Model evaluation: Evaluate model performance on the test set and make predictions.
[0100] (5) Model optimization: adjust hyperparameters and improve model structure.
[0101] S5, comparing the model prediction results with the preset rules, and confirming the control strategy based on the comparison results.
[0102] Among them, the preset rules include default rules and customized rules. Specifically, the default rules are numerical settings based on rich experience accumulation, covering the best practices of each process link. When the algorithm outputs the prediction results, it will be compared with the set values in the rule system to determine the specific operation steps. These operations may involve one or more chemical water treatment equipment, and different chemical water treatment equipment are scheduled through the scheduling system to achieve intelligent treatment effects.
[0103] Customized rules can make water treatment processes different in some special cases. You can use customized rules in the rule system. After getting the predicted value of the algorithm model system, if the predicted value is within the customized rule range and the priority setting is greater than the default rule, the scheduling system will schedule the relevant water treatment equipment according to the customized rules to achieve intelligent treatment effects.
[0104] In an optional embodiment of the present application, preset default rules and customized rules are loaded; wherein the rules include thresholds of various water quality parameters and corresponding operation instructions;
[0105] Compare the prediction results of the model with the numerical settings in the default rules, and when the prediction results are within the range of the default rules, determine the operation steps according to the rules; wherein the operation steps include adjusting the operating parameters of the water treatment equipment;
[0106] When the prediction result exceeds the range of the default rule or meets the special rule, check whether there is a customized rule applicable. If there is an applicable customized rule, compare the prediction result with the conditions of the customized rule to determine whether the prediction result falls within the range defined by the customized rule, and check whether the priority of the customized rule is higher than the default rule;
[0107] Based on the comparison results, choose to apply the default rule or the customized rule. If the customized rule has a higher priority and is applicable, select the customized rule as the control strategy; otherwise, use the default rule.
[0108] S6, controls the water treatment equipment in each process link according to the confirmed control strategy to achieve the treatment of the overall water treatment system.
[0109] The output and rule-based control of the model algorithm system sends instructions to the equipment for operation, such as adjusting the valve opening, starting or stopping the pump, etc., and optimizes the strategy according to the set rules, intelligently arranges the operation sequence of the equipment, and arranges the start and stop of pumps or reactors at different stages.
[0110] Practical application and deployment
[0111] The system and method of the present invention are applicable to various water treatment processes, including but not limited to urban sewage treatment, industrial wastewater treatment, drinking water treatment and seawater desalination. The system optimizes the scheduling and operation of equipment in the water treatment process through advanced software control technology, aiming to improve treatment efficiency, reduce energy consumption and ensure that water quality meets standards. The user interface provides an intuitive dashboard for real-time monitoring of equipment status and processing parameters. The operator can use the interface to set operating parameters, view alarm information and manually intervene in system operations. In addition, the user interface also supports the generation of system operation reports and analysis results to help operators make data-driven decisions.
[0112] System deployment includes two main steps: hardware installation and software configuration:
[0113] Hardware installation involves the arrangement of sensors and actuators, as well as the setting of the central processing unit and communication equipment. Software configuration includes the initialization of system parameters, configuration of the database, debugging of control algorithms, and setting of user permissions. After the system is installed, a comprehensive system debugging is carried out to ensure the normal operation of all devices and software modules. The debugging process includes verifying the accuracy of data acquisition, testing the effectiveness of control algorithms, and checking the responsiveness of the user interface. After debugging is completed, the system will be verified on site to confirm its stability and reliability in actual operation. After the system is running, regular maintenance and technical support services are provided. Maintenance includes regular inspection and calibration of sensors, updating control algorithms, optimizing system performance, and handling possible faults. Technical support services ensure that the system can respond to problems in a timely manner during operation and make necessary adjustments and improvements.
[0114] The intelligent water treatment system ensures that the system can effectively cope with different water treatment challenges in long-term operation and improve the overall water treatment efficiency and stability through continuous optimization process. This process enables the system to achieve highly intelligent and unmanned operation, thereby significantly improving the efficiency and quality of water treatment, reducing the need for human intervention, reducing operating costs and effectively ensuring water quality safety.
[0115] This embodiment also provides a method for optimizing an ion exchange system (IEX). In actual application, the specific procedure is as follows:
[0116] System instrument detection and parameter definition: Comprehensively consider various key parameters and instrument detection data key parameters. In this case, there are four instruments, which play different roles in the system and collect data required by the model. Flow meter is used to monitor the inlet and outlet flow in real time, and its data is used to dynamically adjust the operating parameters. Ion concentration sensor: Monitors the ion concentration in the inlet and outlet water to evaluate the ion exchange effect. Resin saturation sensor: Measures the saturation of the resin to help determine the regeneration cycle. Pressure sensor: Monitors system pressure changes and indirectly reflects the system operation status.
[0117] The key parameters and state variables in this embodiment are given below:
[0118] Inlet flow Q in : Water flow through the ion exchange system (m 3 / h).
[0119] Influent ion concentration C in : Concentration of target ions in the influent water (mg / L).
[0120] Influent conductivity σ in : Conductivity of influent water (μS / cm).
[0121] Conductivity of produced water σ out : Electrical conductivity of outlet water (μS / cm).
[0122] Conductivity difference: The difference between the conductivity of the inlet water and the conductivity of the product water (μS / cm).
[0123] Resin capacity The amount of ions that can be exchanged in the resin (meq / L).
[0124] Resin saturation S: The degree of saturation of ions in the resin (%).
[0125] Resin exchange rate R: the rate at which the resin exchanges ions per unit time (meq / h).
[0126] Exchange efficiency η: The exchange efficiency of the resin, reflecting the performance of the resin (%).
[0127] Backwash cycle: The backwash cycle of the resin (h).
[0128] Regeneration cycle: Resin backwash cycle (h).
[0129] Backwash and regeneration cycles are periodic maintenance operations that affect the service life and performance of the resin.
[0130] Ion exchange kinetic modeling: The kinetics of the ion exchange process can be described by a set of nonlinear differential equations, taking into account the influence of factors such as influent flow rate, ion concentration, and resin saturation. Specifically:
[0131] 1. Changes in ion concentration in resin:
[0132]
[0133] Among them, C resin is the ion concentration in the resin, k is the ion exchange rate constant, and f1 is an additional function that takes into account other operational effects (such as backwashing and regeneration).
[0134] 2. Changes in resin saturation:
[0135]
[0136] 3. Changes in ion concentration of outlet water:
[0137]
[0138] Among them, C out is the ion concentration in the effluent, Q out is the water flow rate, V resin is the volume of the resin, and f2 is an additional function that takes into account the influence of other operating conditions.
[0139] 4. Resin exchange rate adjustment:
[0140]
[0141] Among them, R(t) is the exchange rate of the resin, η is the exchange efficiency, and f3 is an additional function used to consider other influencing factors.
[0142] Data-driven modeling: During the model training phase, the CNN-LSTM model is trained using historical data. The goal of the training is to learn the complex nonlinear relationships in the system and the ability to predict the future state of the system. During the training process, the back propagation algorithm and optimizer can be used to adjust the model parameters so that the model can more accurately predict the future ion exchange process.
[0143] The algorithm model uses a hybrid model (CNN-LSTM) of convolutional neural network (CNN) and long short-term memory network (LSTM) to process time series data and make predictions. The specific structure is as follows:
[0144] CNN layer: It is used to extract local features from time series data. Through convolution operations, CNN layers identify short-term patterns in the data, such as changing trends and sudden events. These features help capture local structural information in the input data.
[0145]
[0146] where x i+j,d is the data in the time series, w j+1,d is the weight of the convolution kernel, and b is the bias term.
[0147] LSTM layer: used to capture long-term dependencies in the data. The LSTM network retains and updates historical information through its memory cells, enabling the model to handle long-term trends and patterns in time series data.
[0148] LSTM t =LSTM(Imput t ,Hidden t-1 ,Cell t-1 )
[0149] Among them, Input t is the input of the current time step, Hidden t-1 is the hidden state of the previous time step, Cell t-1 is the cell state at the previous time step.
[0150] Prediction output: After processing by CNN and LSTM, the model outputs the prediction results, which represent the water quality parameters or treatment requirements in the future time step.
[0151] The CNN-LSTM model combines the convolutional neural network (CNN) and the long short-term memory network (LSTM), which is suitable for processing time series data and can effectively capture the spatial features and temporal dependencies in the data.
[0152] CNN part: used to extract spatial features in time series data. Through convolutional layers and pooling layers, CNN can effectively identify and extract features at different time points, such as the distribution of influent ion concentration and the spatial information of conductivity changes.
[0153] LSTM part: used to capture the long-term dependencies of time series data. The LSTM network can memorize and process long-sequence information through gating units, and is suitable for processing dynamic changes in ion exchange systems, such as changes in ion concentration in resins and dynamic adjustments to ion concentration in effluent water.
[0154] Model application and practical effects: Using the trained CNN-LSTM model combined with the rule base design can achieve the following practical effects:
[0155] Rule base design:
[0156] Create a rule base containing multiple rules, each rule consists of two parts: conditions and actions.
[0157] Condition part: based on the predicted value output by the algorithm model and the actual observed data, such as the predicted resin saturation exceeding the set threshold, abnormal water conductivity, etc.
[0158] Operation section: defines response measures for different conditions, such as adjusting the resin regeneration cycle, adjusting the resin exchange rate, starting backwash operations, etc.
[0159] Rule system implementation:
[0160] Design a rule engine that can monitor and analyze data in real time and execute corresponding rule operations based on the predicted results. The rule system dynamically adjusts the operation strategy through real-time updated predicted values and historical data to achieve optimal water treatment effects and stable system operation.
[0161] Dynamic prediction: Based on real-time monitoring data, the model can accurately predict the future state of the ion exchange system, such as the changing trend of ion concentration in the resin, the fluctuation of effluent water quality, etc. It is crucial to adjust operating parameters in real time, prevent system failures and improve treatment efficiency. Combining algorithm models and rule systems, unmanned operation of the water treatment process can be achieved. The system can automatically adjust operating parameters according to the predicted values without human intervention and manual adjustment.
[0162] Optimization control: The model can recommend the optimal operating strategy based on the prediction results, such as adjusting the water inlet flow, optimizing the resin regeneration cycle, dynamically adjusting the resin exchange rate, etc. The algorithm model can predict the future state of the water treatment system in real time, and the rule system can respond and adjust quickly according to the predicted value to achieve the optimal operation state and water quality output of the system.
[0163] Fault warning and maintenance: Through the rule system's recognition and response to abnormal patterns, it can provide early warning of possible system failures and take preventive maintenance measures to reduce system downtime and maintenance costs.
[0164] The combination of CNN-LSTM model and rule system can not only realize the intelligent and unmanned management of water treatment process, but also improve the stability, efficiency and intelligent level of operation of the system. It is an important innovation and application in the field of water treatment technology.
[0165] In an optional embodiment of the present application, the above method can also be implemented by manually controlling the water treatment system. The specific implementation process and effect are the same as the above-mentioned intelligent automated water treatment system process and will not be repeated here.
[0166] The embodiment of the present application also provides a block diagram of an optimized water treatment system based on machine learning, including:
[0167] A data collection module is used to collect process variable data through sensors arranged at different parts of the water treatment equipment; wherein the process variable data at least includes pH, turbidity, dissolved oxygen, ORP, hardness, conductivity, organic matter, nitrogen, phosphorus, heavy metals, liquid level, flow rate, and pressure data;
[0168] A data storage module is used to store the collected process variable data according to type and structure, and realize data partitioning and indexing;
[0169] The data cleaning module is used to clean and standardize the stored data; data cleaning includes processing missing values, outliers, duplicate data, smoothing data and removing noise, and standardization includes data standardization and normalization;
[0170] The algorithm model module is used to build a CNN-LSTM algorithm model and process data streams through the CNN-LSTM algorithm model.
[0171] A rule module is used to compare the results predicted by the model with the preset rules and confirm the control strategy according to the comparison results; wherein the preset rules include default rules and customized rules;
[0172] The scheduling module is used to control the water treatment equipment in each process link according to the confirmed control strategy to achieve the treatment of the overall water treatment system.
[0173] For the specific definition of the optimized water treatment system, please refer to the definition of optimized water treatment based on machine learning above, which will not be repeated here. Each module in the above-mentioned optimized water treatment system can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.
[0174] In one embodiment, an electronic device is provided, which may be a computer. The electronic device includes a processor, a memory and a network interface connected via a system bus. The processor of the device is used to provide computing and control capabilities. The memory of the device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to optimize water treatment data. The network interface of the computer device is used to communicate with an external terminal via a network connection. When the computer program is executed by the processor, a method for optimizing water treatment based on machine learning is implemented.
[0175] In one embodiment of the present application, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps of the above-mentioned machine learning-based optimized water treatment method are implemented.
[0176] In one embodiment of the present application, a computer program product is provided, including a computer program / instruction, which implements the steps of the above-mentioned machine learning-based optimized water treatment method when executed by a processor.
[0177] The computer-readable storage medium and computer program product provided in this embodiment have similar implementation principles and technical effects to those of the above method embodiments, and are not described in detail here.
[0178] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing related hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in M forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (SyMchliMk) DRAM (SLDRAM), memory bus (RaMbus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0179] The technical features of the above-described embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above-described embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0180] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be construed as limiting the scope of the patent application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent application shall be subject to the attached claims.
Claims
1. A method for optimizing water treatment based on machine learning, characterized in that: The method comprises: The process variable data are collected by sensors arranged at different parts of the water treatment equipment; wherein the process variable data at least include pH, turbidity, dissolved oxygen, ORP, hardness, conductivity, organic matter, nitrogen, phosphorus, heavy metals, liquid level, flow rate, and pressure data; The collected process variable data is stored according to type and structure to achieve data partitioning and indexing; Perform data cleaning and standardization on the stored data; data cleaning includes processing missing values, outliers, duplicate data, smoothing data and removing noise, and standardization includes data standardization and normalization; Build a CNN-LSTM algorithm model and use it to process data streams; Compare the model prediction results with the preset rules, and confirm the control strategy based on the comparison results; wherein the preset rules include default rules and customized rules; Control the water treatment equipment in each process link according to the confirmed control strategy to achieve the treatment of the overall water treatment system.
2. The optimized water treatment method according to claim 1, characterized in that: Clean the stored data, including: Fill missing values through linear relationship, the formula is: Where (x0, y0) and (x1, y1) are known data points, and x is the point to be interpolated.
3. The optimized water treatment method according to claim 1, characterized in that: Smoothing, denoising and standardizing the stored data include: Analyze the stored data, determine the main characteristics and noise level of the data through data evaluation, and perform preliminary data processing to reduce short-term fluctuations; apply denoising technology to remove high-frequency random noise in the data, and ensure that the processed data can improve the accuracy and generalization ability of the prediction model through result analysis and model evaluation; Standardize the stored data, including: Use StandardScaler to standardize and convert each feature to a form with a mean of 0 and a standard deviation of 1; After the data is normalized, the Min-Max Scaler is used to scale the data to the range of [0, 1] or [-1, 1] to ensure that all features are at the same scale.
4. The optimized water treatment method according to claim 1, characterized in that: The CNN-LSTM algorithm model is used to process data streams, including: Correlation analysis is performed in the CNN-LSTM model. According to the time correlation in the time series data, the periodicity and trend of the time series are identified through the autocorrelation function; the autocorrelation function specifically includes: x t is the value of the time series at time point t; is the mean of the time series; k is the number of lag periods; ACF(k) is the autocorrelation coefficient for lag number k.
5. The optimized water treatment method according to claim 1, characterized in that: Compare the model prediction results with the preset rules and confirm the control strategy based on the comparison results, including: Load preset default rules and customized rules; the rules contain thresholds for various water quality parameters and corresponding operation instructions; Compare the prediction results of the model with the numerical settings in the default rules, and when the prediction results are within the range of the default rules, determine the operation steps according to the rules; wherein the operation steps include adjusting the operating parameters of the water treatment equipment; When the prediction result exceeds the range of the default rule or meets the special rule, check whether there is a customized rule applicable. If there is an applicable customized rule, compare the prediction result with the conditions of the customized rule to determine whether the prediction result falls within the range defined by the customized rule, and check whether the priority of the customized rule is higher than the default rule; Based on the comparison results, choose to apply the default rule or customized rule; when the customized rule has a higher priority and is applicable, select the customized rule as the control strategy; otherwise, use the default rule.
6. The optimized water treatment method according to claim 1, characterized in that: Control the water treatment equipment in each process according to the confirmed control strategy, including: Generate specific equipment operation instructions according to the confirmed control strategy; wherein the equipment operation instructions at least include valve control, pump start and stop, and local instrument control; According to the set optimization strategy, arrange the operation sequence of water treatment equipment to achieve the optimization of the overall water treatment system.
7. An optimized water treatment system based on machine learning, characterized in that: The system comprises: A data collection module is used to collect process variable data through sensors arranged at different parts of the water treatment equipment; wherein the process variable data at least includes pH, turbidity, dissolved oxygen, ORP, hardness, conductivity, organic matter, nitrogen, phosphorus, heavy metals, liquid level, flow rate, and pressure data; A data storage module is used to store the collected process variable data according to type and structure, and realize data partitioning and indexing; The data cleaning module is used to clean and standardize the stored data; data cleaning includes processing missing values, outliers, duplicate data, smoothing data and removing noise, and standardization includes data standardization and normalization; The algorithm model module is used to build a CNN-LSTM algorithm model and process data streams through the CNN-LSTM algorithm model. A rule module is used to compare the results predicted by the model with the preset rules and confirm the control strategy according to the comparison results; wherein the preset rules include default rules and customized rules; The scheduling module is used to control the water treatment equipment in each process link according to the confirmed control strategy to achieve the treatment of the overall water treatment system.
8. An electronic device, characterized in that: The method comprises a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the optimized water treatment method according to any one of claims 1 to 6 is implemented.
9. A computer-readable storage medium, characterized in that: A computer program is stored thereon, and when the computer program is executed by a processor, the optimized water treatment method as claimed in any one of claims 1 to 6 is implemented.
10. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instructions are executed by a processor, the optimized water treatment method as claimed in any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
Intelligent dosing control method based on deep learning prediction model
CN115857355A
CNN-LSTM-based multi-element water quality prediction method
CN116843076A
Water monitoring and control system incorporating real-time rainfall and water quality data in parallel
US20240255485A1
Cited By
Manufacturing process-oriented large-scale data mining method and system and storage medium
CN119806095A
A Large-Scale Data Mining Method, System and Storage Medium for Manufacturing Processes
CN119806095B
