A raw water turbidity control method based on convolution-long short-term memory-attention

By combining the CNN-LSTM-Attention model and the random forest algorithm, the problem of lag in the prediction of raw water turbidity in thermal power plants was solved, enabling accurate prediction of turbidity values ​​and optimization of chemical dosing, thereby improving the efficiency and economy of raw water treatment.

CN118521189BActive Publication Date: 2024-11-05ZHEJIANG UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411003363.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-25
Publication Date
2024-11-05
Estimated Expiration
2044-07-25

AI Technical Summary

Technical Problem

In existing technologies, the acquisition of turbidity values ​​of raw water in thermal power plants is delayed, which leads to reliance on manual experience for the dosage of chemicals, potentially resulting in waste, and makes it difficult to accurately predict future changes in turbidity.

Method used

A method for predicting raw water turbidity and controlling polymer dosing was established by combining a convolutional long short-term memory-attention model (CNN-LSTM-Attention) with a random forest algorithm. By monitoring water quality parameters and flow rate in real time, the turbidity value for the next hour can be accurately predicted and the dosage of the polymer can be adjusted accordingly.

Benefits of technology

It enables accurate prediction of turbidity values ​​and timely adjustment of drug dosage, reduces drug waste, ensures that turbidity is within a controllable range, and improves the effectiveness of raw water treatment processes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118521189B_ABST
    Figure CN118521189B_ABST
Patent Text Reader

Abstract

The present invention discloses a raw water turbidity control method based on convolution-long short-term memory-attention, including raw water turbidity prediction and polymer dosing control. The raw water turbidity prediction part includes: first, according to the historical data of raw water quality changes, a sedimentation tank turbidity prediction model based on CNN-LSTM-Attention is established; then, according to the real-time acquired water quality change data, the raw water turbidity value for the next hour is predicted in real time. The polymer dosing control part includes: using historical data and a random forest algorithm to construct a polymer dosing prediction model; according to the turbidity value predicted by the turbidity prediction model, if the result exceeds the set threshold, the polymer dosing prediction model is used to predict the drug dosage. The present invention solves the hysteresis problem from the input of polymer to the drug reaction to the turbidity value, while ensuring that the turbidity value can always be within a controllable range, and has a wide range of applicability.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to a turbidity prediction and application method in a raw water treatment process of a thermal power plant, and in particular to a raw water turbidity control method based on convolution-long short-term memory-attention. Background Art

[0002] Raw water turbidity is an important indicator in industrial production activities, and its changes are affected by many factors, such as climate change and human activities. At present, in industrial production, raw water turbidity is controlled by regularly adding drugs. The raw water turbidity value is mainly obtained from the turbidity meter in the pool or the laboratory after collecting samples. In this way, there is a long delay between adding drugs and obtaining turbidity values. At the same time, the amount of drugs added depends on manual experience. In the face of dynamic environmental changes, excessive drug input may result in waste. Therefore, accurately predicting the change of raw water turbidity is of great value to the method of adjusting the amount of production raw materials in industrial production to control raw water turbidity.

[0003] In recent years, there has been a lot of research on using machine learning algorithms to predict raw water turbidity, but ordinary machine learning algorithms are not particularly effective in the field of time series data prediction. In addition to models based on traditional statistical learning methods and related models based on machine learning methods, research in the field of time series prediction in recent years has mainly focused on deep learning methods, and the models used in deep learning methods for time series prediction include the following types:

[0004] (1) RNN-based model:

[0005] Recurrent Neural Networks (RNNs) have been used for sequence modeling and have achieved good results in various natural language processing tasks. Given the natural interpretation of time series data as input and target sequences, many RNN-based architectures have been developed for time prediction applications. At its core, the RNN unit contains an internal memory state as an overview of past information. The memory state is recursively updated with new observations at each time step. Later researchers improved the RNN based on the long-distance gradient vanishing problem and proposed LSTM and GRU. LSTM uses a gating mechanism to enable the recurrent neural network to not only remember past information, but also selectively forget some unimportant information to model long-term contextual relationships, while GRU is based on this idea to reduce the gradient vanishing problem while retaining long-term sequence information. In 2017, Amazon proposed a model DeepAR specifically for processing time series probability prediction. This method uses the classic RNN model for time series prediction. In the training phase, the real value and external features of the previous moment are passed in at each moment, and after passing through the RNN unit, the value of the next moment is predicted. In the prediction stage, the predicted value of the model at the previous moment is used as input, replacing the input of the true value at the previous moment during the training process.

[0006] (2) CNN-based model:

[0007] CNN is widely used in the fields of CV and NLP. Traditional convolution has the characteristics of local connection and weight sharing, so it can effectively capture the association between pixels in the image. However, in sequential data such as time series, the sequence information of the input data is crucial. Traditional convolution operations cannot explicitly model the temporal relationship between elements in time series data. The emergence of TCN solves this problem. TCN adopts a network structure that combines void convolution with causal convolution, which is also called the basic structure of the CNN-based time series prediction model. The salient features of TCN are: the convolution in the architecture is causal, which means that there is no information "leakage" from the future to the past; the architecture can take a sequence of any length and map it to an output sequence of the same length.

[0008] (3) Transformer-based model:

[0009] The Transformer model first achieved remarkable results in the field of NLP. Since both NLP and time series are sequential data, Transformer has also been gradually applied to time series prediction tasks. Neo Wu et al. used a Transformer structure similar to GPT to try time series prediction tasks and achieved good results. However, in time series prediction tasks, the sequence position relationship of sample points is very important. Although Transformer achieves ultra-long-period feature alignment through the attention mechanism, the position information can only rely on position emingding, which affects the application of Transformer in time series prediction.

[0010] (4) Other types of models:

[0011] The N-BEATS model was proposed by Oreshkin BN et al. There is no RNN, CNN or Attention in the internal structure of the model. The network is fully connected and has achieved good results on some open source data sets. The core idea of ​​N-BEATS is that multiple blocks are connected in series, each block learns part of the sequence information, and the input of the next block will remove the information learned by the previous block and only fit the information that has not been learned by the previous block, which is similar to the idea of ​​GBDT. Finally, the estimated results of each block are added to get the final estimated result. In recent years, large language models have gained widespread attention due to their outstanding performance in various fields. Gruver et al. explored whether pre-trained large language models can directly input time series data in integer form and predict future data in a zero-sample manner. Describes the use of GPT-3 and GPT-4 and open source LLMs to interact directly with time series values ​​without further modifying the structure. Long-term time series prediction remains challenging due to the difficulty of capturing long-term dependencies, achieving linear scalability, and maintaining computational efficiency. Md Atik Ahamed et al. introduced TimeMachine, an innovative model that leverages Mamba (a state-space model) to capture long-term dependencies in multivariate time series data while maintaining linear scalability and a small memory footprint.

[0012] Therefore, there is great research value in combining the attention mechanism with the traditional LSTM model for raw water turbidity prediction. The method of combining LSTM with Attention makes the sequence modeling ability of the sequence model and the ultra-long period information extraction ability of the Attention model complement each other. Summary of the invention

[0013] In view of the shortcomings of the prior art, the purpose of the present invention is to provide a raw water turbidity control method based on convolution-long short-term memory-attention. According to the process conditions of the thermal power plant, the research object, the present invention solves the hysteresis of turbidity value acquisition and dosage waste problems in the raw water treatment process adopted by the thermal power plant, proposes a method that can accurately predict the turbidity value in the next hour based on the raw water quality data, and provides a dosage control strategy for coping with changes in turbidity values, thereby effectively improving the raw water treatment process effect of the thermal power plant.

[0014] The object of the present invention is achieved through the following technical scheme: a raw water turbidity control method based on convolution-long short-term memory-attention, including raw water turbidity prediction and polymer dosing control:

[0015] The raw water turbidity prediction part includes the following steps:

[0016] 1.1. According to the dynamic time-varying nature of raw water quality, a raw water turbidity prediction model is established based on the CNN-LSTM-Attention (convolution-long short-term memory-attention) algorithm, so that the raw water turbidity prediction model can accurately predict the turbidity value of the sedimentation tank in the next hour based on the raw water turbidity, raw water quality camera parameters, inlet flow rate and polymer dosage historical data;

[0017] 1.2. Use water quality monitoring cameras, turbidity meters and flow meters to input the corresponding camera parameters, raw water turbidity and inlet flow into the raw water turbidity prediction model in real time to achieve real-time prediction of turbidity values;

[0018] The polymer dosing control part includes the following steps:

[0019] 2.1. Based on the historical data of raw water turbidity value, influent flow rate and polymer dosage, a polymer dosage prediction model was established using the random forest algorithm;

[0020] 2.2. According to the turbidity value given by the raw water turbidity prediction model, if the predicted future turbidity value exceeds the set threshold, the polymer dosage prediction model is used to predict the dosage, otherwise the dosage is maintained.

[0021] Furthermore, the step 1.1 includes the following sub-steps:

[0022] 1.1.1. In the raw water treatment database of the thermal power plant, the raw water turbidity, water inlet flow, polymer dosage, and parameters of the water quality monitoring camera in the daily production process are selected as historical data samples, and data preprocessing is performed. The parameters of the water quality monitoring camera include mass fraction, diameter, sphericity, brightness, and maximum flocculants;

[0023] 1.1.2. Divide the historical data samples obtained in step 1.1.1 into three parts: training set, validation set and test set;

[0024] 1.1.3. Take the water quality monitoring camera parameters, raw water turbidity, inlet flow rate, and polymer dosage data from the previous 2 hours as input variables, and the raw water turbidity value in the next hour as the output variable. According to the training set, validation set, and test set obtained in step 1.1.2, the CNN-LSTM-Attention algorithm is used to train the raw water turbidity prediction model.

[0025] Furthermore, the step 1.1.1 also includes:

[0026] (A) Missing values ​​were filled using linear interpolation;

[0027] (B) Calculate the time delay between the polymer dosing time and the time delay between the turbidity reading by the sedimentation tank turbidity meter, and the time delay between the water quality monitoring camera and the turbidity reading by the sedimentation tank turbidity meter, and align the data;

[0028] (C) Use MinMaxScaler to normalize the data.

[0029] Furthermore, in step 1.1.3, the data for the first 2 hours are divided into 30 time steps; and the data for the next hour are divided into 15 time steps.

[0030] Furthermore, the step 2.1 includes the following sub-steps:

[0031] 2.1.1. In the raw water treatment database of the thermal power plant, the raw water turbidity data in the daily production process that meets the industrial production standards, the water inlet flow rate, the polymer dosage, and the parameters of the water quality monitoring camera are selected as historical data samples, and data preprocessing and feature engineering are performed to clean abnormal data and select useful features. The parameters of the water quality monitoring camera include mass fraction, diameter, sphericity, brightness, and maximum flocculants;

[0032] 2.1.2. Divide the historical data samples obtained in step 2.1.1 into three parts: training set, validation set and test set;

[0033] 2.1.3. Using the water quality monitoring camera parameters, raw water turbidity, and inlet flow rate as input variables and the polymer dosage as output variables, the random forest algorithm is used to train the polymer dosage prediction model based on the training set, validation set, and test set obtained in step 2.1.2.

[0034] Furthermore, the step 2.1.1 also includes:

[0035] (a) Remove data whose turbidity does not meet industrial production standards;

[0036] (b) Use MinMaxScaler to normalize the data;

[0037] (c) Principal Component Analysis (PCA): The original features are projected onto a new coordinate system through linear transformation, and the retained principal components are selected as new features.

[0038] The present invention also provides a raw water turbidity control device based on convolution-long short-term memory-attention, comprising one or more processors for implementing the above-mentioned raw water turbidity control method based on convolution-long short-term memory-attention.

[0039] The present invention also provides a computer-readable storage medium on which a program is stored. When the program is executed by a processor, it is used to implement the above-mentioned raw water turbidity control method based on convolution-long short-term memory-attention.

[0040] The beneficial effects of the present invention are as follows: based on the CNN-LSTM-Attention model, the present invention can accurately predict the turbidity value in the next hour, solving the hysteresis problem from the input of polymer to the reaction of the drug to the turbidity value; at the same time, it provides a solution for drug addition after the turbidity deteriorates, ensuring that the turbidity value can always be within a controllable range. The main technical features of the present invention are: the method is practical and reliable, does not require any additional cost, and has wide applicability. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] Figure 1 This is a flow chart of the raw water turbidity control method based on CNN-LSTM-Attention;

[0042] Figure 2 It is the specific structural principle diagram of the raw water turbidity prediction model;

[0043] Figure 3 It is a structural diagram of LSTM cell. DETAILED DESCRIPTION

[0044] The technical solution of the present invention is described in detail below with reference to the accompanying drawings and embodiments:

[0045] like Figure 1 As shown, a method for controlling raw water turbidity based on convolution-long short-term memory-attention includes the following steps:

[0046] 1. Establish a raw water turbidity prediction model based on CNN-LSTM-Attention (convolution-long short-term memory-attention) to predict the turbidity in the next hour in real time. The specific steps are as follows:

[0047] 1.1. In the raw water treatment database of the thermal power plant, the historical data of raw water turbidity, water inlet flow, polymer dosage, and parameters of the water quality monitoring camera (mass fraction, diameter, sphericity, brightness, and maximum flocculants) in the daily production process are screened out, and data preprocessing and feature engineering are performed to clean abnormal data and screen out useful features. The historical data samples obtained are divided into three parts: training set, validation set, and test set in a ratio of 7:1:2. Specifically, the data preprocessing part can also be divided into the following sub-steps:

[0048] 1.1.1. For the missing data caused by equipment failure or other unexpected situations provided in the database, considering that the time series prediction task requires the time series to have equal intervals and no gaps, linear interpolation is used to fill the missing values.

[0049] 1.1.2. According to the data given by actual industrial production, the turbidity read by the sedimentation tank turbidity meter has different time delays for the polymer dosing time and the water quality monitoring camera. According to the time delay, the polymer dosing amount and the water quality monitoring camera data are shifted in the time dimension to achieve data alignment.

[0050] 1.1.3. Call the MinMaxScaler function in the Scikit-learn library to normalize the data.

[0051] 1.2. The water quality monitoring camera parameters, raw water turbidity, inlet flow rate, and polymer dosage are used as input variables, and the raw water turbidity value in the next hour is used as the output variable. The CNN-LSTM-Attention algorithm is used to train the raw water turbidity prediction model.

[0052] Among them, training the raw water turbidity prediction model also includes the following sub-steps:

[0053] 1.2.1. According to the principle of raw water turbidity prediction model, the definition of the model is constructed based on the pytorch library.

[0054] 1.2.2. Set the relevant parameters of the CNN-LSTM-Attention model and initialize it, then start model training; during this process, use the cross-validation function provided by the Scikit-learn library to validate the set.

[0055] 1.2.3. Verification: Use the method in the Hyperopt library that implements Bayesian optimization to perform hyperparameter optimization to find the best hyperparameter configuration and thus obtain the optimal model.

[0056] like Figure 2 As shown, this is a schematic diagram of the specific structure of the raw water turbidity prediction model.

[0057] The first layer is the input layer of the model, which specifies the format of the input data (batch size, number of time steps, feature dimension).

[0058] The second layer is the convolutional neural network layer (CNN layer). The CNN layer can extract the spatial connection between different feature values ​​in the data, thereby making up for the shortcoming that LSTM cannot capture the spatial components of the data. At the same time, the features it extracts are still temporal. When the sample data enters the CNN layer, it will be sequentially subjected to convolution, pooling, and node expansion (dimensionality reduction) operations. For sequence data, this model adopts one-dimensional convolution, and the convolution kernel is only convolved in a single time domain direction.

[0059] The third layer is a multi-layer LSTM. LSTM has a memory function and can extract the time series change information of the nonlinear data of the building's cooling and heating loads. It introduces an input gate, a forget gate, and an output gate.

[0060] The fourth layer is the attention layer. Attention can enhance the role of important time steps in LSTM, thereby further reducing the model prediction error. Attention is essentially to find the weighted average sum of the output vectors of the last layer of LSTM. The output vector of the LSTM hidden layer is used as the input of the attention layer. It is trained through a fully connected layer, and then the output of the fully connected layer is normalized using the softmax function to obtain the distribution weight of each hidden layer vector. The weight size indicates the importance of the hidden state of each time step to the prediction result.

[0061] The last layer is the output layer, which is used to output the prediction results.

[0062] Among them, LSTM stands for Long Short Term Memory networks, which is a variant of ordinary RNN. It can effectively solve the problem that when traditional RNN processes long sequences, the model often has difficulty capturing long-term dependencies in the sequence. The core of LSTM is the cell state. Figure 3 As shown in the figure, the input information passes through the cell from the horizontal line above, and only interacts with other solid lines in a small amount during the period, indicating some linear transformations, which enables the input information to be preserved relatively completely, that is, it can retain long-term memory. The selective retention of information by LSTM is achieved through a gating mechanism. The gate structure can control the amount of cell information. The gate structure actually performs a linear transformation on the input information, and then implements it through a sigmoid layer, and finally converts the input into a coefficient vector with a value range of 0-1, which can be understood as the proportion of retained information. If the value is 0, it means that the corresponding information will be discarded, and if it is 1, it means that the corresponding information will be retained. There are three gate structures in LSTM cells, namely forget gate, input gate, and output gate. The specific principles of the three gate structures are as follows:

[0063] Forget Gate:

[0064] Used to control which information in the cell state needs to be forgotten so that the cell state Appropriate updates are made during the flow. The forget gate receives and As input parameters, the corresponding forget gate parameters are obtained through the sigmoid layer The specific formula is as follows:

[0065]

[0066] in, is the sigmoid function, is the weight matrix of the forget gate, represents the output of the previous sequence model, represents the input of the current model, is the bias term of the forget gate, is the output of the forget gate.

[0067] Input Gate:

[0068] Update cell status First, LSTM generates a candidate value for update through the tanh layer, denoted as ; Then, an input gate parameter is required To determine the updated information, it is implemented through the sigmoid layer; finally and Multiply to get the updated information, and at the same time, forget the gate obtained above and old cell state Multiply them together to forget some of the information, and combine the two to get the updated state The specific formula is as follows:

[0069]

[0070]

[0071]

[0072] in, is the sigmoid function, is the weight matrix of the input gate, represents the output of the previous sequence model, represents the input of the current model, is the bias term of the input gate, is the output of the input gate; is a candidate value for calculating the cell state, is the weight matrix used to calculate the candidate values, is the bias term used to calculate the candidate value, that is function; is the cell state that needs to be updated, is the forgotten gate obtained, It is the old cell state.

[0073] Output Gate:

[0074] Finally, LSTM needs to calculate the final output information, which is mainly composed of the cell state However, it needs to be filtered through the output gate. First, the cell state The value of is normalized to [-1, 1], which is achieved by a tanh layer. Then a sigmoid layer is used to obtain the output gate parameter , and finally Perform dot multiplication with the normalized cell state to obtain the final filtered result. The specific formula is as follows:

[0075]

[0076] in, is the sigmoid function, is the weight matrix of the output gate, represents the output of the previous sequence model, represents the input of the current model, is the bias term of the output gate, is the output of the output gate; express function; is the cell state, is the output value of the current model.

[0077] 1.3. The water quality monitoring camera, flow meter and raw water turbidity meter provide real-time water quality monitoring camera parameters, raw water turbidity and water inlet flow. Combined with the real-time polymer delivery of the system, the data is input into the trained raw water turbidity prediction model to achieve real-time and accurate prediction of the turbidity value of the sedimentation tank in the next hour.

[0078] 2. According to the turbidity value of the next hour given by the raw water turbidity prediction model, the future dosage is controlled. The specific steps are as follows:

[0079] 2.1. In the raw water treatment database of the thermal power plant, the turbidity data of raw water in the daily production process that meets the industrial production standards, the water inlet flow rate, the polymer dosage, and the historical data of the parameters of the water quality monitoring camera (mass fraction, diameter, sphericity, brightness, and maximum flocculants) are screened out, and data preprocessing and feature engineering are performed to clean abnormal data and screen out useful features. The obtained historical data samples are divided into three parts: training set, validation set, and test set in a ratio of 7:1:2.

[0080] Wherein, step 2.1 also includes the following sub-steps:

[0081] 2.1.1. The polymer dosage prediction model based on random forest is a supervised learning task, which does not need to consider the temporal relationship of data. In order to train a polymer dosage prediction model that can control turbidity, it is necessary to screen out data whose turbidity values ​​meet the standards in actual industrial production.

[0082] 2.1.2. Use the MinMaxScaler function of the Scikit-learn library to normalize the data.

[0083] 2.1.3. Although there are many input features of the data, not all of them are important. High-dimensional data has the curse of dimensionality, and there may be correlations and noise between many variables. Extracting the main information to achieve dimensionality reduction is an effective solution. Principal component analysis (PCA) can extract the main information of the data, achieve noise reduction, and eliminate redundant information. Specifically, by calling the PCA function of the Scikit-learn library, useful features are screened out and the input feature dimension is reduced.

[0084] 2.2. Taking the water quality monitoring camera parameters, raw water turbidity, and inlet flow rate as input variables and the polymer dosage as output variables, the random forest algorithm was used to train and obtain the polymer dosage prediction model.

[0085] Among them, training the random forest model also includes the following sub-steps:

[0086] 2.2.1. Call the RandomForestRegressor method of the Scikit-learn library to build a random forest regression model, initialize relevant parameters, and then start model training. During this process, use the cross-validation function provided by the Scikit-learn library for the validation set.

[0087] 2.2.2. Verification: Use the method in the Hyperopt library that implements Bayesian optimization to perform hyperparameter optimization to find the best hyperparameter configuration and thus obtain the optimal model.

[0088] 2.3. According to the turbidity prediction model, determine whether the turbidity value in the next hour exceeds the set threshold. If not, keep the polymer dosage unchanged; if exceeded, predict the dosage based on the polymer dosing control model and modify the dosage.

[0089] Among them, the random forest model is an ensemble learning method based on decision trees. It improves prediction performance by building multiple decision trees and integrating their prediction results. In the training phase of the model, the random forest extracts multiple subsample sets from the original data set through the bootstrap method; for each subsample set, a decision tree is built; when building each tree, a part of the features is randomly selected for node splitting. And the prediction error is minimized by adjusting the structure and parameters of the tree (such as the number of trees, the minimum number of samples per node, etc.). In the prediction phase, when new water quality data (including water quality monitoring camera parameters, raw water turbidity, and inlet flow) are input, each tree in the random forest model will make a prediction based on these features; the prediction results of all trees will be integrated, and the final dosage prediction value will be determined by taking the average or voting.

[0090] An embodiment of the present invention also provides a raw water turbidity control device based on convolution-long short-term memory-attention, including one or more processors for implementing the raw water turbidity control method based on convolution-long short-term memory-attention of the above embodiment.

[0091] It should be noted that the device embodiment shown in this embodiment matches the content of the above method embodiment, and the content of the above method embodiment can be referred to, which will not be repeated here.

[0092] The embodiment of the present invention also provides a computer-readable storage medium, on which a program is stored, and when the program is executed by a processor, it is used to implement the above-mentioned raw water turbidity control method based on convolution-long short-term memory-attention. The computer-readable storage medium can be an internal storage unit of any device with data processing capabilities described in the above embodiments, such as a hard disk or a memory. The computer-readable storage medium can also be any device with data processing capabilities, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), an SD card, a flash card (Flash Card), etc. equipped on the device. Furthermore, the computer-readable storage medium can also include both an internal storage unit of any device with data processing capabilities and an external storage device. The computer-readable storage medium is used to store the computer program and other programs and data required by any device with data processing capabilities, and can also be used to temporarily store data that has been output or is to be output.

[0093] The above embodiments are only used to illustrate the design ideas and features of the present invention, and their purpose is to enable those skilled in the art to understand the content of the present invention and implement it accordingly. The protection scope of the present invention is not limited to the above embodiments. Therefore, any equivalent changes or modifications made based on the principles and design ideas disclosed by the present invention are within the protection scope of the present invention.

Claims

1. A raw water turbidity control method based on convolution-long short-term memory-attention, It is characterized in that It includes two parts: raw water turbidity prediction and polymer dosing control: The raw water turbidity prediction part includes the following steps: (1.1) According to the dynamic time-varying nature of raw water quality changes, a raw water turbidity prediction model was established based on the CNN-LSTM-Attention algorithm; The step (1.1) includes the following sub-steps: (1.1.1) In the raw water treatment database of the thermal power plant, the raw water turbidity, water inlet flow, polymer dosage, and parameters of the water quality monitoring camera in the daily production process are selected as historical data samples, and data preprocessing is performed. The parameters of the water quality monitoring camera include mass fraction, diameter, sphericity, brightness, and maximum flocculants; (1.1.2) Divide the historical data samples obtained in step (1.1.1) into three parts: training set, validation set and test set; (1.1.3) The water quality monitoring camera parameters, raw water turbidity, inlet flow rate, and polymer dosage data for the last 2 hours are used as input variables, and the raw water turbidity value for the next hour is used as the output variable. Based on the training set, validation set, and test set obtained in step (1.1.2), the CNN-LSTM-Attention algorithm is used to train a raw water turbidity prediction model; (1.2) Using a water quality monitoring camera, a turbidity meter and a flow meter, input the corresponding water quality monitoring camera parameters, raw water turbidity and inlet flow into the raw water turbidity prediction model in real time to predict the turbidity value in real time; The polymer dosing control part includes the following steps: (2.1) Based on the historical data of raw water turbidity value, influent flow rate and polymer dosage, a polymer dosage prediction model was established using the random forest algorithm; The step (2.1) includes the following sub-steps: (2.1.1) In the raw water treatment database of the thermal power plant, the turbidity data of the raw water in the daily production process that meets the industrial production standards, the water inlet flow rate, the polymer dosage, and the parameters of the water quality monitoring camera are selected as historical data samples, and data preprocessing and feature engineering are performed to clean abnormal data and select useful features. The parameters of the water quality monitoring camera include mass fraction, diameter, sphericity, brightness, and maximum flocculants; (2.1.2) Divide the historical data samples obtained in step (2.1.1) into three parts: training set, validation set and test set; (2.1.3) Using the water quality monitoring camera parameters, raw water turbidity, and inlet flow rate as input variables and the polymer dosage as output variables, the random forest algorithm is used to train the polymer dosage prediction model based on the training set, validation set, and test set obtained in step (2.1.2); (2.2) According to the turbidity value given by the raw water turbidity prediction model, if the predicted future turbidity value exceeds the set threshold, the polymer dosing prediction model is used to predict the dosing amount, otherwise the dosing amount is maintained.

2. The raw water turbidity control method based on convolution-long short-term memory-attention according to claim 1, It is characterized in that The step (1.1.1) further includes: (A) Missing values ​​were filled using linear interpolation; (B) Calculate the time delay between the polymer dosing time and the time delay between the turbidity reading by the sedimentation tank turbidity meter, and the time delay between the water quality monitoring camera and the turbidity reading by the sedimentation tank turbidity meter, and align the data; (C) Use MinMaxScaler to normalize the data.

3. The raw water turbidity control method based on convolution-long short-term memory-attention according to claim 1, It is characterized in that In the step (1.1.2), the historical data samples are divided into three parts: training set, validation set and test set according to the ratio of 7:1:

2.

4. The raw water turbidity control method based on convolution-long short-term memory-attention according to claim 1, It is characterized in that In the above step (1.1.3), the data of the last 2 hours are divided into 30 time steps; the data of the next hour are divided into 15 time steps.

5. The raw water turbidity control method based on convolution-long short-term memory-attention according to claim 1, It is characterized in that The step (2.1.1) further includes: (a) Remove data whose turbidity does not meet industrial production standards; (b) Use MinMaxScaler to normalize the data; (c) Principal component analysis: The original features are projected onto a new coordinate system through linear transformation, and the retained principal components are selected as new features.

6. The raw water turbidity control method based on convolution-long short-term memory-attention according to claim 1, It is characterized in that In the step (2.1.2), the historical data samples are divided into three parts: training set, validation set and test set according to the ratio of 7:1:

2.

7. A raw water turbidity control device based on convolution-long short-term memory-attention, It is characterized in that It comprises one or more processors for implementing the raw water turbidity control method based on convolution-long short-term memory-attention as described in any one of claims 1-6.

8. A computer-readable storage medium having a program stored thereon, It is characterized in that When the program is executed by a processor, it is used to implement the raw water turbidity control method based on convolution-long short-term memory-attention as described in any one of claims 1-6.