A method and device for predicting water quality of industrial wastewater based on deep learning

Through the RF-CNN-LSTM model based on deep learning, the problems of low prediction accuracy and low processing efficiency in industrial sewage water quality prediction are solved, and more accurate and stable water quality prediction is achieved, which is suitable for complex industrial sewage treatment scenarios.

CN118260574BActive Publication Date: 2024-09-13UNIV OF SCI & TECH BEIJING
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410368648.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-03-28
Publication Date
2024-09-13
Estimated Expiration
2044-03-28

AI Technical Summary

Technical Problem

The existing technology has low prediction accuracy in industrial wastewater quality prediction, is difficult to handle nonlinear and unsteady conditions, and is difficult to process time series data in real time, resulting in low processing efficiency.

Method used

Using a method based on deep learning, by obtaining the historical data of inlet and outlet water quality monitoring of industrial sewage treatment plants for preprocessing and interpolation processing, the RF-CNN-LSTM model is constructed, correlation analysis and feature screening are performed, and the model is trained and evaluated to achieve Water quality prediction.

Benefits of technology

It improves the accuracy and stability of water quality prediction, can adapt to complex actual working conditions and water quality characteristics, provides a more comprehensive and reliable spatio-temporal sequence data processing solution, and enhances the generalization ability and interpretability of the model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118260574B
    Figure CN118260574B
Patent Text Reader

Abstract

The present invention relates to the field of artificial intelligence technology, and in particular to a method and device for predicting water quality of industrial sewage based on deep learning, the method comprising: obtaining historical data of inlet and outlet water quality monitoring; preprocessing and interpolating the historical data of inlet and outlet water quality monitoring to obtain a water quality monitoring sample data set; performing correlation analysis on the water quality monitoring sample data set to obtain a feature data set; constructing an initial water quality prediction model based on RF‑CNN‑LSTM; using the feature data set to train the initial water quality prediction model based on RF‑CNN‑LSTM to obtain a trained water quality prediction model based on RF‑CNN‑LSTM; using a model evaluation index to evaluate the trained water quality prediction model based on RF‑CNN‑LSTM to obtain an evaluated water quality prediction model based on RF‑CNN‑LSTM; obtaining water quality data to be predicted; inputting the water quality data to be predicted into the evaluated water quality prediction model based on RF‑CNN‑LSTM to obtain an effluent water quality prediction result. The present invention can improve the accuracy of effluent water quality prediction.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of artificial intelligence technology, and in particular to a method and device for predicting water quality of industrial sewage based on deep learning. Background Art

[0002] Industrial wastewater treatment is an indispensable part of modern industrial production. It involves treating wastewater generated during the production process to ensure that the discharged water quality meets environmental protection standards. At present, the water quality of industrial wastewater is affected by a variety of indicators, and water quality monitoring data is usually presented as time series data. There are complex correlations between various indicators. Timely and accurate prediction of water quality has become an urgent need in the environmental protection industry.

[0003] Traditional industrial wastewater treatment methods often rely on wastewater treatment processes and experience to develop on-site industrial operation procedures. Their disadvantages are low treatment efficiency and sensitivity to changes in influent water quality. In recent years, statistical methods and traditional deep learning methods have been used to predict the water quality of industrial wastewater. However, statistical methods and traditional deep learning rely on linear assumptions about water quality data and require manual selection of feature parameters, resulting in low prediction accuracy for industrial wastewater under nonlinear and non-steady-state conditions, and difficulty in real-time processing of time series data; in addition, statistical methods and traditional deep learning usually cannot fully utilize the potential relationship between large-scale data and complex water quality characteristics, resulting in low prediction accuracy. Summary of the invention

[0004] In order to solve the technical problems of low prediction accuracy, difficulty in real-time processing of time series data and low processing efficiency in the prior art, the embodiment of the present invention provides a method and device for predicting water quality of industrial wastewater based on deep learning. The technical solution is as follows:

[0005] On the one hand, a method for predicting water quality of industrial sewage based on deep learning is provided, the method is implemented by a device for predicting water quality of industrial sewage based on deep learning, and the method comprises:

[0006] S1. Obtain historical data on inlet and outlet water quality monitoring of industrial wastewater treatment plants;

[0007] S2. Preprocess the historical data of the inlet and outlet water quality monitoring to obtain preprocessed data; interpolate the preprocessed data to obtain a water quality monitoring sample data set;

[0008] S3, performing correlation analysis on the water quality monitoring sample data set to obtain a feature data set; dividing the feature data set into a training data set and a test data set;

[0009] S4. Construct an initial water quality prediction model based on RF (Random Forest)-CNN (Convolutional Neural Network)-LSTM (Long Short-Term Memory);

[0010] S5. According to the training data set, the initial RF-CNN-LSTM-based water quality prediction model is trained to obtain a trained RF-CNN-LSTM-based water quality prediction model;

[0011] S6. Input the test data set into the trained water quality prediction model based on RF-CNN-LSTM to obtain a prediction result; according to the prediction result, evaluate the trained water quality prediction model based on RF-CNN-LSTM to obtain an evaluated water quality prediction model based on RF-CNN-LSTM;

[0012] S7. Obtain the water quality data to be predicted; input the water quality data to be predicted into the evaluated RF-CNN-LSTM-based water quality prediction model to obtain the effluent water quality prediction result.

[0013] Optionally, the historical data collection indicators of the inlet and outlet water quality monitoring of the industrial wastewater treatment plant of S1 include: inlet data indicators and outlet data indicators;

[0014] The influent data indicators include: influent COD concentration, influent ammonia nitrogen concentration, influent total phosphorus concentration, influent total nitrogen concentration, influent pH value, hourly flow rate, hourly flow rate, cumulative flow rate and sludge concentration;

[0015] The sludge concentration includes: mixed liquor suspended solids, mixed liquor volatile suspended solids, sludge settling ratio and sludge index;

[0016] The effluent data indicators include: effluent COD concentration, effluent ammonia nitrogen concentration, effluent total phosphorus concentration, effluent total nitrogen concentration and effluent pH value.

[0017] Optionally, the step S2 preprocesses the historical data of the inlet and outlet water quality monitoring to obtain preprocessed data; and interpolates the preprocessed data to obtain a water quality monitoring sample data set, including:

[0018] S21, intercepting the smooth data segment in the historical data of the inlet and outlet water quality monitoring; compiling the use index range of the predicted water quality data according to the inlet and outlet water index designed by the sewage treatment plant and the laboratory chemical test result interval;

[0019] S22, performing anomaly detection on the intercepted historical data according to the usage index range, removing abnormal data in the water quality monitoring historical data, and obtaining processed water quality monitoring historical data;

[0020] S23, using the KNN algorithm to interpolate the processed water quality monitoring historical data to obtain the interpolated water quality monitoring historical data;

[0021] S24. Normalize the interpolated historical water quality monitoring data to obtain a water quality monitoring sample data set.

[0022] Optionally, the step S3 performs correlation analysis on the water quality monitoring sample data set to obtain a feature data set, including:

[0023] S31. Calculate the correlation coefficient between the inlet data index and the outlet data index in the water quality monitoring sample data set according to the inlet data index and the outlet data index;

[0024] S32, sorting the correlation coefficients from large to small, and selecting the index with a correlation coefficient greater than 0.2 as the characteristic parameter of the water inlet data;

[0025] S33. Screen the water quality monitoring sample data set according to the characteristic parameters of the inlet water data to obtain a characteristic data set.

[0026] Optionally, the initial RF-CNN-LSTM water quality prediction model of S4 includes: an RF module, a CNN module and an LSTM module;

[0027] The RF module is used to fit the mapping relationship between the inlet water data and the outlet water data;

[0028] The CNN module includes: two convolutional layers, a pooling layer, an activation function and a fully connected layer; the CNN module is used to extract features from water quality data;

[0029] The LSTM module includes: an input gate, a forget gate and an output gate; the LSTM module is used to learn the time series information in the input water quality data.

[0030] Optionally, the step S5 trains the initial RF-CNN-LSTM-based water quality prediction model according to the training data set to obtain a trained RF-CNN-LSTM-based water quality prediction model, including:

[0031] S51, inputting the training set into the initial water quality prediction model based on RF-CNN-LSTM, extracting features of the training set through the CNN module to obtain local features and spatial information; inputting the local features and spatial information into the LSTM module, and the LSTM module processes the local features and spatial information to obtain a first predicted water quality feature result;

[0032] S52, inputting the training set into the initial water quality prediction model based on RF-CNN-LSTM, processing the training set through the RF module, and obtaining the second predicted water quality characteristic result;

[0033] S53. Set different weights for the first predicted water quality characteristic results and the second predicted water quality characteristic results to obtain effluent water quality indicators; train the water quality prediction model based on RF-CNN-LSTM according to the effluent water quality indicators and the loss function MSE to obtain a trained water quality prediction model based on RF-CNN-LSTM.

[0034] On the other hand, a device for predicting water quality of industrial sewage based on deep learning is provided, and the device is applied to a method for predicting water quality of industrial sewage based on deep learning, and the device comprises:

[0035] An acquisition unit is used to acquire historical data of inlet and outlet water quality monitoring of industrial wastewater treatment plants;

[0036] A preprocessing unit, used to preprocess the historical data of the inlet and outlet water quality monitoring to obtain preprocessed data; and to interpolate the preprocessed data to obtain a water quality monitoring sample data set;

[0037] A calculation and division unit, used for performing correlation analysis on the water quality monitoring sample data set to obtain a feature data set; and dividing the feature data set into a training data set and a test data set;

[0038] Construction unit, used to build the initial water quality prediction model based on RF-CNN-LSTM;

[0039] A training unit is used to train the initial RF-CNN-LSTM-based water prediction model according to the training data set to obtain a trained RF-CNN-LSTM-based water quality prediction model; input the test data set into the trained RF-CNN-LSTM-based water quality prediction model to obtain a prediction result; and evaluate the trained RF-CNN-LSTM-based water quality prediction model according to the prediction result to obtain an evaluated RF-CNN-LSTM-based water quality prediction model;

[0040] The prediction unit is used to obtain the water quality data to be predicted; the water quality data to be predicted is input into the evaluated RF-CNN-LSTM-based water quality prediction model to obtain the effluent water quality prediction result.

[0041] Optionally, the collection indicators of historical data of the inlet and outlet water quality monitoring of the industrial sewage treatment plant include: inlet data indicators and outlet data indicators;

[0042] The influent data indicators include: influent COD concentration, influent ammonia nitrogen concentration, influent total phosphorus concentration, influent total nitrogen concentration, influent pH value, hourly flow rate, hourly flow rate, cumulative flow rate and sludge concentration;

[0043] The sludge concentration includes: mixed liquor suspended solids, mixed liquor volatile suspended solids, sludge settling ratio and sludge index;

[0044] The effluent data indicators include: effluent COD concentration, effluent ammonia nitrogen concentration, effluent total phosphorus concentration, effluent total nitrogen concentration and effluent pH value.

[0045] Optionally, the preprocessing unit is used to:

[0046] Intercept the smooth data segment from the historical data of the inlet and outlet water quality monitoring; compile the use index range of the predicted water quality data according to the inlet and outlet water index of the sewage treatment plant design and the laboratory chemical test result interval;

[0047] According to the usage index range, anomaly detection is performed on the intercepted historical data, abnormal data in the water quality monitoring historical data is eliminated, and processed water quality monitoring historical data is obtained;

[0048] The KNN algorithm is used to interpolate the processed historical water quality monitoring data to obtain the interpolated historical water quality monitoring data;

[0049] The historical water quality monitoring data after interpolation are normalized to obtain a water quality monitoring sample data set.

[0050] Optionally, the calculation and division unit is used to:

[0051] Calculate the correlation coefficient between the inlet data index and the outlet data index in the water quality monitoring sample data set according to the inlet data index and the outlet data index;

[0052] Sort the correlation coefficients from large to small, and select the indicators with correlation coefficients greater than 0.2 as the characteristic parameters of the water inflow data;

[0053] According to the characteristic parameters of the influent data, the water quality monitoring sample data set is screened to obtain a characteristic data set.

[0054] Optionally, the construction unit is used to include: an RF module, a CNN module and an LSTM module;

[0055] The RF module is used to fit the mapping relationship between the inlet water data and the outlet water data;

[0056] The CNN module includes: two convolutional layers, a pooling layer, an activation function and a fully connected layer; the CNN module is used to extract features from water quality data;

[0057] The LSTM module includes: an input gate, a forget gate and an output gate; the LSTM module is used to learn the time series information in the input water quality data.

[0058] Optionally, the training unit is used to:

[0059] Input the training set into the initial water quality prediction model based on RF-CNN-LSTM, extract features of the training set through the CNN module to obtain local features and spatial information; input the local features and spatial information into the LSTM module, and the LSTM module processes the local features and spatial information to obtain the first predicted water quality feature result;

[0060] The training set is input into the initial water quality prediction model based on RF-CNN-LSTM, and the training set is processed by the RF module to obtain the second predicted water quality characteristic results;

[0061] Different weights are set for the first predicted water quality characteristic results and the second predicted water quality characteristic results to obtain the effluent water quality index; according to the effluent water quality index and the loss function MSE, the water quality prediction model based on RF-CNN-LSTM is trained to obtain the trained water quality prediction model based on RF-CNN-LSTM.

[0062] On the other hand, a water quality prediction device for industrial wastewater based on deep learning is provided, and the water quality prediction device for industrial wastewater based on deep learning comprises: a processor; a memory, on which computer-readable instructions are stored, and when the computer-readable instructions are executed by the processor, any one of the above-mentioned methods for predicting water quality of industrial wastewater based on deep learning is implemented.

[0063] On the other hand, a computer-readable storage medium is provided, in which at least one instruction is stored. The at least one instruction is loaded and executed by a processor to implement any one of the above-mentioned methods for predicting water quality of industrial wastewater based on deep learning.

[0064] The beneficial effects brought about by the technical solution provided by the embodiment of the present invention include at least:

[0065] The embodiment of the present invention firstly obtains historical data of inlet and outlet water quality monitoring of an industrial sewage treatment plant; pre-processes the historical data of inlet and outlet water quality monitoring to obtain pre-processed data; interpolates the pre-processed data to obtain a water quality monitoring sample data set; performs correlation analysis on the water quality monitoring sample data set to obtain a feature data set; divides the feature data set into a training data set and a test data set; secondly, constructs an initial RF-CNN-LSTM-based water quality prediction model; trains the initial RF-CNN-LSTM-based water quality prediction model according to the training data set to obtain a trained RF-CNN-LSTM-based water quality prediction model; inputs the test data set into the trained RF-CNN-LSTM-based water quality prediction model to obtain a prediction result; evaluates the trained RF-CNN-LSTM-based water quality prediction model according to the prediction result to obtain an evaluated RF-CNN-LSTM-based water quality prediction model; finally, obtains water quality data to be predicted; inputs the water quality data to be predicted into the evaluated RF-CNN-LSTM-based water quality prediction model to obtain an effluent water quality prediction result.

[0066] In the embodiment of the present invention, the historical data of inlet and outlet water quality monitoring is firstly processed in a dislocation manner, which can capture the correlation between the data and effectively avoid the error accumulation problem caused by inconsistent data intervals during the prediction process of the model; the correlation coefficient method is used to screen the inlet characteristic parameters, which can improve the prediction accuracy of the model, reduce the complexity of the model, enhance the interpretability of the model, and improve the generalization ability of the model, so that it can adapt to a wider range of actual working conditions and water quality characteristics. Secondly, a water quality prediction model based on RF-CNN-LSTM is constructed, and the model is trained to obtain a trained water quality prediction model based on RF-CNN-LSTM; through multi-model integration, the complementary effect of different models improves the stability of the overall model, and can be applied to complex actual scenarios of industrial wastewater treatment water quality prediction; the water quality prediction model based on RF-CNN-LSTM provides a more comprehensive, robust and reliable solution for processing spatiotemporal series data; finally, RMSE, MAE, MAPE and R are used. 2 Model evaluation indicators are used to evaluate the trained RF-CNN-LSTM-based water quality prediction model, which helps to quantify the performance of the model, making the sewage water quality prediction method more scientific and reliable, and improving its applicability in practical applications. The embodiment of the present invention can be used to predict and monitor the effluent water quality indicators of the AAO process in an industrial sewage treatment plant in real time. BRIEF DESCRIPTION OF THE DRAWINGS

[0067] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0068] Figure 1 It is a schematic diagram of the process structure of water quality prediction of industrial wastewater based on deep learning provided by an embodiment of the present invention;

[0069] Figure 2 This is a flow chart of a method for predicting water quality of industrial wastewater based on deep learning provided by an embodiment of the present invention;

[0070] Figure 3 It is a block diagram of a water quality prediction device for industrial wastewater based on deep learning provided by an embodiment of the present invention;

[0071] Figure 4 It is a structural schematic diagram of a water quality prediction device for industrial wastewater based on deep learning provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0072] The technical solution of the present invention is described below in conjunction with the accompanying drawings.

[0073] In the embodiments of the present invention, words such as "exemplarily" and "for example" are used to indicate examples, illustrations or explanations. Any embodiment or design described as "example" in the present invention should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of the word "example" is intended to present the concept in a specific way. In addition, in the embodiments of the present invention, the meaning expressed by "and / or" can be both, or it can be either of the two.

[0074] In the embodiments of the present invention, "image" and "picture" can sometimes be used interchangeably. It should be noted that when the difference between them is not emphasized, the meanings they intend to express are the same. "of", "corresponding, relevant" and "corresponding" can sometimes be used interchangeably. It should be noted that when the difference between them is not emphasized, the meanings they intend to express are the same.

[0075] In the embodiments of the present invention, sometimes a subscript such as W1 may be mistakenly written as a non-subscript such as W1. When the difference is not emphasized, the meanings to be expressed are consistent.

[0076] In order to make the technical problems, technical solutions and advantages to be solved by the present invention more clear, a detailed description will be given below with reference to the accompanying drawings and specific embodiments.

[0077] The embodiment of the present invention provides a method for predicting the water quality of industrial wastewater based on deep learning. The method can be implemented by a device for predicting the water quality of industrial wastewater based on deep learning. The device for predicting the water quality of industrial wastewater based on deep learning can be a terminal or a server. Figure 1 What is shown is a schematic diagram of the process structure of a water quality prediction of industrial wastewater based on deep learning provided by an embodiment of the present invention; a feasible implementation method, obtaining environmental monitoring data and sewage treatment plant system data, wherein the data collection indicators include inlet data indicators and outlet data indicators; wherein the inlet data indicators include: inlet pH value, hourly flow rate, hourly flow rate, cumulative flow rate, inlet COD concentration, inlet ammonia nitrogen concentration, inlet total phosphorus concentration and inlet total nitrogen concentration; wherein the outlet data indicators include: outlet COD concentration, outlet ammonia nitrogen concentration, outlet total phosphorus concentration, outlet pH value and outlet total nitrogen concentration; a feasible implementation method, performing data segmentation interception on the inlet and outlet data to obtain intercepted data; calibrating and removing outliers in the intercepted data, and using the KNN algorithm to interpolate and fill the data to obtain Get complete water quality data; dislocation the complete water quality data; use the correlation coefficient method to perform correlation analysis on the dislocation data to obtain the characteristic parameters of the inlet data indicators; divide the water quality data into a training set and a test set according to the parameter characteristics of the inlet data indicators; input the training set into the initial water quality prediction model based on RF-CNN-LSTM, and extract the features of the training data through the CNN model to obtain local features; wherein, the input training set data is 8-dimensional data; wherein, the CNN model includes two convolutional layers and a pooling layer; input the obtained local features into the LSTM to obtain the first predicted water quality feature; input the training set into the RF machine learning module to obtain the second predicted water quality feature, set weights for the first predicted water quality feature and the second water quality feature respectively, and obtain the final effluent water quality prediction result. wherein, the final effluent water quality prediction result is 5-dimensional data; wherein, the training set is used to train the water quality prediction model based on RF-CNN-LSTM; the test set is used to verify the prediction performance of the water quality prediction model based on RF-CNN-LSTM; wherein, RMSE, MAE, MAPE and R are used 2 Model evaluation index, evaluate the model and obtain the optimal model parameters; a feasible implementation method is to compare and analyze the processing results of the intercepted data, the processing results of the uninterrupted data and the processing results of the added sludge data, and select the optimal input data; according to the optimal model parameters and the optimal input data, optimize the water quality prediction model based on RF-CNN-LSTM to obtain the predicted value of the effluent index; a feasible implementation method is to compare and analyze the actual value of the effluent index with the predicted value of the effluent index to obtain the analysis result. Figure 2The flowchart of the method for predicting water quality of industrial wastewater based on deep learning is shown. The processing flow of the method may include the following steps:

[0078] S1. Obtain historical data on inlet and outlet water quality monitoring of industrial wastewater treatment plants.

[0079] Among them, the historical data of inlet and outlet water quality monitoring are relatively continuous time series data.

[0080] Optionally, the historical data collection indicators of the inlet and outlet water quality monitoring of the industrial wastewater treatment plant of S1 include: inlet data indicators and outlet data indicators;

[0081] Influent data indicators, including: influent COD concentration, influent ammonia nitrogen concentration, influent total phosphorus concentration, influent total nitrogen concentration, influent pH value, hourly flow rate, hourly flow rate, cumulative flow rate and sludge concentration;

[0082] Among them, sludge concentration includes: mixed liquor suspended solids, mixed liquor volatile suspended solids, sludge settling ratio and sludge index;

[0083] Effluent data indicators include: effluent COD concentration, effluent ammonia nitrogen concentration, effluent total phosphorus concentration, effluent total nitrogen concentration and effluent pH value.

[0084] Among them, the data of the embodiment of the present invention is the historical water quality monitoring data of the inlet and outlet water of a certain industrial wastewater treatment plant from 0:00 on May 21, 2021 to 8:00 on January 12, 2024, among which the total number of inlet data is 23,023 and the total number of outlet data is 22,984.

[0085] A feasible implementation method is to set the offset processing of effluent data and influent data to 30 hours according to the hydraulic retention time of each stage of the sewage treatment plant, that is, to use the influent data to predict the effluent water quality indicators 30 hours later.

[0086] Among them, due to the hydraulic retention time problem of the sewage treatment process, in order to improve the accuracy of the prediction model and ensure that the timing relationship of the input and output data is consistent with the actual water quality change trend, the inlet and outlet water quality data are time-shifted according to the sewage plant process flow. This can capture the correlation between the data and avoid the error accumulation problem caused by inconsistent data intervals during the prediction process of the model.

[0087] S2. Preprocess the historical data of inlet and outlet water quality monitoring to obtain preprocessed data; interpolate the preprocessed data to obtain a water quality monitoring sample data set.

[0088] Optionally, the specific implementation process of S2 may include S21-S24:

[0089] S21. Intercept the smooth data segments in the historical data of inlet and outlet water quality monitoring; compile the use index range of the predicted water quality data according to the inlet and outlet water index of the sewage plant design and the range of laboratory chemical test results;

[0090] Among them, the following Table 1 stipulates the range of usage indicators for predicting water quality data in an embodiment of the present invention.

[0091] Table 1

[0092]

[0093] Among them, establishing the scope of use of predicted water quality data can ensure the accuracy and reliability of the prediction results.

[0094] S22. According to the usage index range, perform anomaly detection on the intercepted historical data, remove abnormal data in the water quality monitoring historical data, and obtain processed water quality monitoring historical data;

[0095] Among them, according to the designed inlet and outlet water indicators of the sewage treatment plant and the range of laboratory chemical test results, the use indicator range regulations for predicting water quality data are compiled, and water quality data that does not meet the regulations and missing values ​​are marked as abnormal data and deleted.

[0096] S23, using KNN (K-Nearest Neighbors) algorithm to interpolate the processed water quality monitoring historical data to obtain the interpolated water quality monitoring historical data;

[0097] S24. Normalize the interpolated historical water quality monitoring data to obtain a water quality monitoring sample data set.

[0098] S3. Perform correlation analysis on the water quality monitoring sample data set to obtain a feature data set; divide the feature data set into a training data set and a test data set.

[0099] Before the correlation analysis, the water quality monitoring sample data set was staggered, and the staggered time was 30 hours; among them, the training set and test set accounted for 80% and 20% respectively, and the training set data was further divided into training set and validation set according to the ratio of 9:1.

[0100] Optionally, the specific implementation process of S3 may include S31-S33:

[0101] S31. Calculate the correlation coefficient between the inlet data index and the outlet data index in the water quality monitoring sample data set according to the inlet data index and the outlet data index;

[0102] The calculation methods of the correlation coefficient include: Spearman correlation coefficient method, Kendall correlation coefficient method and Pearson correlation coefficient method; the embodiment of the present invention selects the Spearman correlation coefficient method to calculate the correlation coefficient of the inlet data index and the outlet data index.

[0103] S32, sorting the correlation coefficients from large to small, and selecting the index with a correlation coefficient greater than 0.2 as the characteristic parameter of the water inlet data;

[0104] The following Table 2 shows the calculation results of the Spearman correlation coefficient in the embodiment of the present invention.

[0105] Table 2

[0106]

[0107] Among them, when the correlation between the inlet data index and the outlet data index is greater than 0.2, there is a certain degree of correlation between the two. The indicators with a correlation coefficient greater than 0.2 are selected as the inlet data characteristic parameters, including: cumulative flow, inlet pH, inlet ammonia nitrogen concentration, inlet total phosphorus concentration, inlet total nitrogen concentration, hourly flow, hourly flow rate and inlet COD concentration.

[0108] S33. Screen the water quality monitoring sample data set according to the characteristic parameters of the influent data to obtain a characteristic data set.

[0109] Among them, the correlation coefficient method is used to screen the characteristic parameters of the input water inlet data, which can improve the prediction accuracy of the model, reduce the complexity of the model and enhance the interpretability of the model; it can also improve the generalization ability of the model and make the model adapt to a wider range of actual working conditions and water quality characteristics.

[0110] S4. Construct an initial water quality prediction model based on RF (Random Forest)-CNN (Convolutional Neural Network)-LSTM (Long Short-Term Memory).

[0111] Optionally, the initial RF-CNN-LSTM water quality prediction model of S4 includes: an RF module, a CNN module and an LSTM module;

[0112] RF module, used to fit the mapping relationship between inlet and outlet data;

[0113] Among them, for a given training data set, the RF module will perform random sampling to generate multiple different sub-data sets for the training of each decision tree, which can optimize the feature extraction process of the CNN module and the LSTM module.

[0114] CNN module, including: two convolutional layers, pooling layer, activation function and fully connected layer; CNN module is used to extract features of water quality data;

[0115] Among them, the CNN module is used to extract local features and spatial information of the data.

[0116] The LSTM module includes an input gate, a forget gate, and an output gate; the LSTM module is used to learn the time series information in the input water quality data.

[0117] Among them, the LSTM module is used to process time-related data and capture long-term dependencies in time series data.

[0118] S5. According to the training data set, the initial RF-CNN-LSTM-based water quality prediction model is trained to obtain a trained RF-CNN-LSTM-based water quality prediction model.

[0119] Optionally, the specific implementation process of S5 may include S51-S53:

[0120] S51, inputting the training set into the initial water quality prediction model based on RF-CNN-LSTM, extracting features of the training set through the CNN module to obtain local features and spatial information; inputting the local features and spatial information into the LSTM module, and the LSTM module processes the local features and spatial information to obtain a first predicted water quality feature result;

[0121] A feasible implementation method is to input the training set into the initial water quality prediction model based on RF-CNN-LSTM, extract features of the input data through the CNN model to obtain local features and spatial information; downsample the extracted local features and spatial information through the maximum pooling layer to obtain processed features; wherein the CNN model includes a first convolution layer with 128 filters and 3 kernel sizes, and a second convolution layer with 64 filters and 2 kernel sizes; wherein the CNN model can be expressed by the following formulas (1) to (3):

[0122]

[0123] relu(x)=max(0,x) (2)

[0124] p r (t) = max pooling (p i-1 (t)) (3)

[0125] Where t represents time (t≥0), h r(t) represents the feature vector of the convolution kernel of the rth layer at the tth moment; h r-1 (t) represents the feature vector of the r-1th layer convolution kernel at time t; relu(·) represents the ReLU activation function; Represents the convolution operation of the convolution kernel; ω r (t) represents the weight vector of the convolution kernel of the rth layer; b1(t) represents the bias parameter; p r (t) represents the feature vector of the rth pooling layer at the tth time; p i-1 (t) represents the feature vector of the i-1th pooling layer at the tth time, that is, the output of the previous layer; max pooling (·) represents the pooling rule.

[0126] A feasible implementation method is to process the processed features through an LSTM model and a fully connected layer to obtain a predicted water quality feature 1; wherein the LSTM module includes 1024 LSTM units; wherein the LSTM model can be expressed by the following formula (4)-formula (8):

[0127] f t =σ[W f (h t-1 ,x t )+b f ] (4)

[0128] l t =σ[W1(h t-1 ,x t )+b l ] (5)

[0129] c' t =tanh[W c (h t-1 ,x t )+b c ] (6)

[0130] c t =f t c t-1 -l t c' t (7)

[0131] o t =σ[W o (h t-1 ,x t )+b o ] (8)

[0132] Among them, f t represents the forget gate coefficient at time t; l t represents the input gate coefficient at time t; c' tRepresents the input data obtained by the tanh function; c t represents the update unit state at time t; o t represents the output gate coefficient; h t-1 represents the output data at time t-1; x t represents the input data at time t; c t-1 represents the cell state at time t-1; W f (·) represents the weight function of the forget gate corresponding to the neuron from time t-1 to time t; b f W represents the deviation of the forget gate corresponding to the neuron from time t-1 to time t; l (·) represents the weight function of the input gate corresponding to the neuron from time t-1 to time t; b l represents the deviation of the input gate corresponding to the neuron from time t-1 to time t; W c (·) represents the weight function of the input data corresponding to the neuron from time t-1 to time t; b c represents the deviation of the input data corresponding to the neuron from time t-1 to time t; Wx(·) represents the weight function of the output gate of the neuron from time t-1 to time t; b o Represents the bias of the output gate of the neuron from time t-1 to time t; t represents the time.

[0133] S52, inputting the training set into the initial water quality prediction model based on RF-CNN-LSTM, processing the training set through the RF module, and obtaining the second predicted water quality characteristic result;

[0134] A feasible implementation method is to input the training set into the initial water quality prediction model based on RF-CNN-LSTM, and process the training set through the RF model to obtain the second predicted water quality characteristic result; wherein, the RF model is configured with 100 decision trees and 40 random seeds, wherein the RF model can be expressed by the following formula (9) and formula (10): Based on a set of decision tree classifiers {h(x,θ k )}:

[0135] H(x)=arg max∑ k I(h k (x) = y) (9)

[0136] mg(X,Y)=av k I[h k (X) = Y]-maxav k I[h k (X) = Y] / (j≠Y) (10)

[0137] Among them, x is the input of decision tree h, H(x) is the combined classification model; h i is any decision tree; y is the target variable; I is the indicative function; mg(X,Y) represents the decision tree at node X according to feature h k The Gini index of the data set is divided by the value Y of (X); X is the input vector; Y is the correct classification; Y is the wrong classification; av k is the average value; θ k is a random vector that follows an independent and identical distribution.

[0138] S53. Set different weights for the first predicted water quality characteristic results and the second predicted water quality characteristic results to obtain effluent water quality indicators; train the water quality prediction model based on RF-CNN-LSTM according to the effluent water quality indicators and the loss function MSE to obtain a trained water quality prediction model based on RF-CNN-LSTM.

[0139] A feasible implementation method is to set different weights for the first predicted water quality characteristic results and the second predicted water quality characteristic results, and generate the final effluent water quality prediction result through the output layer, wherein the output layer adopts the tanh activation function and the output layer has a single node; according to the obtained effluent water quality prediction result, the loss function MSE is adopted, and the training is performed through the Adam optimizer, and the learning rate is 0.0001.

[0140] In this embodiment of the present invention, the weight ratio of LSTM / RF is set to 0.5 / 0.5. During the training process, 500 epochs are used and the batch size is 512.

[0141] S6. Input the test data set into the trained water quality prediction model based on RF-CNN-LSTM to obtain the prediction result. According to the prediction result, evaluate the trained water quality prediction model based on RF-CNN-LSTM to obtain the evaluated water quality prediction model based on RF-CNN-LSTM.

[0142] A feasible implementation method is to evaluate the trained RF-CNN-LSTM-based water quality prediction model based on the effluent water quality prediction results obtained from the test data set using model evaluation indicators; wherein the model evaluation indicators include: RMSE (Root Mean Square Error), MAE (Mean Square Error), MAPE (Mean Absolute Percentage Error) and determination coefficient R 2 .

[0143] The RMSE value calculates the square difference between the predicted value and the actual value, which can quantify the overall prediction accuracy of the model; the RMSE value can be calculated by the following formula (11):

[0144]

[0145] Where m represents the length of the test data; the value range of i is 1, ..., m; y i represents the predicted value, Represents the true value.

[0146] In a feasible implementation, the MAE value calculates the absolute difference between the predicted value and the actual value, is insensitive to outliers, and can accurately reflect the average error of the prediction result; the MAE value can be calculated by the following formula (12):

[0147]

[0148] Where m represents the length of the test data; the value range of i is 0, ..., m; y i represents the predicted value, Represents the true value.

[0149] In a feasible implementation, the MAPE value represents the error in percentage form, which is universal for data of different magnitudes and can comprehensively evaluate the prediction performance of the model. The MAPE value can be calculated by the following formula (13):

[0150]

[0151] Where m represents the length of the test data; the value range of i is 0, ..., m; y i represents the predicted value, Represents the true value.

[0152] A feasible implementation method, R 2 It is used to measure the degree to which the model explains the total variance. Its value is between 0 and 1. The closer it is to 1, the stronger the model's ability to explain the actual data. 2 The value of can be calculated by the following formula (14):

[0153]

[0154] Where m represents the length of the test data; the value range of i is 0, ..., m; y i represents the predicted value, Represents the true value.

[0155] Among them, the smaller the values ​​of RMSE, MAE, and MAPE, the higher the prediction accuracy; 2The closer the value is to 1, the better the fit of the model.

[0156] A feasible implementation method is to evaluate the water quality prediction model according to the model indicators and obtain the calculation results of the model evaluation indicators. Among them, the prediction percentage error of each effluent indicator except the effluent pH value is less than 8%, and the calculation accuracy of the water quality prediction model reaches the standard that can be used; in the prediction of all effluent indicators, the R output of the model is 2 The coefficients are all greater than 0.6; the prediction results of effluent pH value under different correlation gradients are not significantly different, R 2 The coefficient has reached 0.98, and the water quality prediction model fits the data well.

[0157] Among them, the following Table 3 shows the optimal calculation results of the model evaluation index of the embodiment of the present invention.

[0158] Table 3

[0159]

[0160] S7. Obtain the water quality data to be predicted; input the water quality data to be predicted into the evaluated RF-CNN-LSTM-based water quality prediction model to obtain the effluent water quality prediction result.

[0161] A feasible implementation method is to input the water quality data to be predicted into the evaluated water quality prediction model based on RF-CNN-LSTM, process the water quality data to be predicted through the CNN module and the LSTM module to obtain the first predicted water quality characteristic result; process the predicted water quality data through the RF module to obtain the second predicted water quality characteristic result; according to the set weight ratio, the first predicted water quality characteristic result and the second predicted water quality characteristic result are fused to obtain the outlet water quality prediction result.

[0162] Among them, the embodiment of the present invention combines the RF model, the CNN model and the LSTM model to reduce the overfitting of the water quality prediction model to the training data and improve the robustness of the water quality prediction model.

[0163] The embodiment of the present invention firstly obtains historical data of inlet and outlet water quality monitoring of an industrial sewage treatment plant; pre-processes the historical data of inlet and outlet water quality monitoring to obtain pre-processed data; interpolates the pre-processed data to obtain a water quality monitoring sample data set; performs correlation analysis on the water quality monitoring sample data set to obtain a feature data set; divides the feature data set into a training data set and a test data set; secondly, constructs an initial RF-CNN-LSTM-based water quality prediction model; trains the initial RF-CNN-LSTM-based water quality prediction model according to the training data set to obtain a trained RF-CNN-LSTM-based water quality prediction model; inputs the test data set into the trained RF-CNN-LSTM-based water quality prediction model to obtain a prediction result; evaluates the trained RF-CNN-LSTM-based water quality prediction model according to the prediction result to obtain an evaluated RF-CNN-LSTM-based water quality prediction model; finally, obtains water quality data to be predicted; inputs the water quality data to be predicted into the evaluated RF-CNN-LSTM-based water quality prediction model to obtain an effluent water quality prediction result.

[0164] In the embodiment of the present invention, the historical data of inlet and outlet water quality monitoring is firstly processed in a dislocation manner, which can capture the correlation between the data and effectively avoid the error accumulation problem caused by inconsistent data intervals during the prediction process of the model; the correlation coefficient method is used to screen the inlet characteristic parameters, which can improve the prediction accuracy of the model, reduce the complexity of the model, enhance the interpretability of the model, and improve the generalization ability of the model, so that it can adapt to a wider range of actual working conditions and water quality characteristics. Secondly, a water quality prediction model based on RF-CNN-LSTM is constructed, and the model is trained to obtain a trained water quality prediction model based on RF-CNN-LSTM; through multi-model integration, the complementary effect of different models improves the stability of the overall model, and can be applied to complex actual scenarios of industrial wastewater treatment water quality prediction; the water quality prediction model based on RF-CNN-LSTM provides a more comprehensive, robust and reliable solution for processing spatiotemporal series data; finally, RMSE, MAE, MAPE and R are used. 2 Model evaluation indicators are used to evaluate the trained RF-CNN-LSTM-based water quality prediction model, which helps to quantify the performance of the model, making the sewage water quality prediction method more scientific and reliable, and improving its applicability in practical applications. The embodiment of the present invention can be used to predict and monitor the effluent water quality indicators of the AAO process in an industrial sewage treatment plant in real time.

[0165] Figure 3 The present invention is a block diagram of a device for predicting water quality of industrial wastewater based on deep learning according to an exemplary embodiment. The device is used in a method for predicting water quality of industrial wastewater based on deep learning. Figure 3The device includes an acquisition unit 310, a preprocessing unit 320, a calculation and division unit 330, a construction unit 340, a training unit 350 and a prediction unit 360. Among them:

[0166] An acquisition unit 310 is used to acquire historical data of water quality monitoring of inlet and outlet water of an industrial wastewater treatment plant;

[0167] The preprocessing unit 320 is used to preprocess the historical data of the inlet and outlet water quality monitoring to obtain preprocessed data; interpolate the preprocessed data to obtain a water quality monitoring sample data set;

[0168] The calculation and division unit 330 is used to perform correlation analysis on the water quality monitoring sample data set to obtain a feature data set; and divide the feature data set into a training data set and a test data set;

[0169] A construction unit 340 is used to construct an initial water quality prediction model based on RF-CNN-LSTM;

[0170] The training unit 350 is used to train the initial RF-CNN-LSTM-based water quality prediction model according to the training data set to obtain a trained RF-CNN-LSTM-based water quality prediction model; input the test data set into the trained RF-CNN-LSTM-based water quality prediction model to obtain a prediction result; and evaluate the trained RF-CNN-LSTM-based water quality prediction model according to the prediction result to obtain an evaluated RF-CNN-LSTM-based water quality prediction model;

[0171] The prediction unit 360 is used to obtain water quality data to be predicted; input the water quality data to be predicted into the evaluated RF-CNN-LSTM-based water quality prediction model to obtain the effluent water quality prediction result.

[0172] Optionally, the collection indicators of historical data of the inlet and outlet water quality monitoring of the industrial sewage treatment plant include: inlet data indicators and outlet data indicators;

[0173] The influent data indicators include: influent COD concentration, influent ammonia nitrogen concentration, influent total phosphorus concentration, influent total nitrogen concentration, influent pH value, hourly flow rate, hourly flow rate, cumulative flow rate and sludge concentration;

[0174] The sludge concentration includes: mixed liquor suspended solids, mixed liquor volatile suspended solids, sludge settling ratio and sludge index;

[0175] The effluent data indicators include: effluent COD concentration, effluent ammonia nitrogen concentration, effluent total phosphorus concentration, effluent total nitrogen concentration and effluent pH value.

[0176] Optionally, the preprocessing unit 320 is used to:

[0177] Intercept the smooth data segment from the historical data of the inlet and outlet water quality monitoring; compile the use index range of the predicted water quality data according to the inlet and outlet water index of the sewage treatment plant design and the laboratory chemical test result interval;

[0178] According to the usage index range, anomaly detection is performed on the intercepted historical data, abnormal data in the water quality monitoring historical data is eliminated, and processed water quality monitoring historical data is obtained;

[0179] The KNN algorithm is used to interpolate the processed historical water quality monitoring data to obtain the interpolated historical water quality monitoring data;

[0180] The historical water quality monitoring data after interpolation are normalized to obtain a water quality monitoring sample data set.

[0181] Optionally, the calculation and division unit 330 is used to:

[0182] Calculate the correlation coefficient between the inlet data index and the outlet data index in the water quality monitoring sample data set according to the inlet data index and the outlet data index;

[0183] Sort the correlation coefficients from large to small, and select the indicators with correlation coefficients greater than 0.2 as the characteristic parameters of the water inflow data;

[0184] According to the characteristic parameters of the influent data, the water quality monitoring sample data set is screened to obtain a characteristic data set.

[0185] Optionally, the construction unit 340 is used to include: an RF module, a CNN module and an LSTM module;

[0186] The RF module is used to fit the mapping relationship between the inlet water data and the outlet water data;

[0187] The CNN module includes: two convolutional layers, a pooling layer, an activation function and a fully connected layer; the CNN module is used to extract features from water quality data;

[0188] The LSTM module includes: an input gate, a forget gate and an output gate; the LSTM module is used to learn the time series information in the input water quality data.

[0189] Optionally, the training unit 350 is used to:

[0190] Input the training set into the initial water quality prediction model based on RF-CNN-LSTM, extract features of the training set through the CNN module to obtain local features and spatial information; input the local features and spatial information into the LSTM module, and the LSTM module processes the local features and spatial information to obtain the first predicted water quality feature result;

[0191] The training set is input into the initial water quality prediction model based on RF-CNN-LSTM, and the training set is processed by the RF module to obtain the second predicted water quality characteristic results;

[0192] Different weights are set for the first predicted water quality characteristic results and the second predicted water quality characteristic results to obtain the effluent water quality index; according to the effluent water quality index and the loss function MSE, the water quality prediction model based on RF-CNN-LSTM is trained to obtain the trained water quality prediction model based on RF-CNN-LSTM.

[0193] The embodiment of the present invention firstly obtains historical data of inlet and outlet water quality monitoring of an industrial sewage treatment plant; pre-processes the historical data of inlet and outlet water quality monitoring to obtain pre-processed data; interpolates the pre-processed data to obtain a water quality monitoring sample data set; performs correlation analysis on the water quality monitoring sample data set to obtain a feature data set; divides the feature data set into a training data set and a test data set; secondly, constructs an initial RF-CNN-LSTM-based water quality prediction model; trains the initial RF-CNN-LSTM-based water quality prediction model according to the training data set to obtain a trained RF-CNN-LSTM-based water quality prediction model; inputs the test data set into the trained RF-CNN-LSTM-based water quality prediction model to obtain a prediction result; evaluates the trained RF-CNN-LSTM-based water quality prediction model according to the prediction result to obtain an evaluated RF-CNN-LSTM-based water quality prediction model; finally, obtains water quality data to be predicted; inputs the water quality data to be predicted into the evaluated RF-CNN-LSTM-based water quality prediction model to obtain an effluent water quality prediction result.

[0194] In the embodiment of the present invention, the historical data of inlet and outlet water quality monitoring is firstly processed in a dislocation manner, which can capture the correlation between the data and effectively avoid the error accumulation problem caused by inconsistent data intervals during the prediction process of the model; the correlation coefficient method is used to screen the inlet characteristic parameters, which can improve the prediction accuracy of the model, reduce the complexity of the model, enhance the interpretability of the model, and improve the generalization ability of the model, so that it can adapt to a wider range of actual working conditions and water quality characteristics. Secondly, a water quality prediction model based on RF-CNN-LSTM is constructed, and the model is trained to obtain a trained water quality prediction model based on RF-CNN-LSTM; through multi-model integration, the complementary effect of different models improves the stability of the overall model, and can be applied to complex actual scenarios of industrial wastewater treatment water quality prediction; the water quality prediction model based on RF-CNN-LSTM provides a more comprehensive, robust and reliable solution for processing spatiotemporal series data; finally, RMSE, MAE, MAPE and R are used. 2 Model evaluation indicators are used to evaluate the trained RF-CNN-LSTM-based water quality prediction model, which helps to quantify the performance of the model, making the sewage water quality prediction method more scientific and reliable, and improving its applicability in practical applications. The embodiment of the present invention can be used to predict and monitor the effluent water quality indicators of the AAO process in an industrial sewage treatment plant in real time.

[0195] Figure 4 is a schematic diagram of the structure of a water quality prediction device for industrial wastewater based on deep learning provided by an embodiment of the present invention, such as Figure 4 As shown, the water quality prediction device for industrial wastewater based on deep learning may include the above Figure 3 The water quality prediction device for industrial wastewater based on deep learning is shown. Optionally, the water quality prediction device 410 for industrial wastewater based on deep learning may include a first processor 2001.

[0196] Optionally, the industrial wastewater water quality prediction device 410 based on deep learning may also include a memory 2002 and a transceiver 2003 .

[0197] The first processor 2001, the memory 2002 and the transceiver 2003 may be connected via a communication bus.

[0198] Combine the following Figure 4 The components of the deep learning-based industrial wastewater water quality prediction device 410 are specifically introduced:

[0199] The first processor 2001 is the control center of the water quality prediction device 410 for industrial wastewater based on deep learning, which can be a processor or a general term for multiple processing elements. For example, the first processor 2001 is one or more central processing units (CPUs), or an application specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiment of the present invention, such as one or more microprocessors (digital signal processors, DSPs), or one or more field programmable gate arrays (field programmable gate arrays, FPGAs).

[0200] Optionally, the first processor 2001 can perform various functions of the industrial wastewater water quality prediction device 410 based on deep learning by running or executing a software program stored in the memory 2002 and calling data stored in the memory 2002.

[0201] In a specific implementation, as an embodiment, the first processor 2001 may include one or more CPUs, such as Figure 4 CPU0 and CPU1 are shown in FIG.

[0202] In a specific implementation, as an embodiment, the water quality prediction device 410 for industrial wastewater based on deep learning may also include multiple processors, such as Figure 4 The first processor 2001 and the second processor 2004 are shown in FIG. Each of these processors can be a single-core processor (single-CPU) or a multi-core processor (multi-CPU). The processor here can refer to one or more devices, circuits, and / or processing cores for processing data (e.g., computer program instructions).

[0203] The memory 2002 is used to store the software program for executing the solution of the present invention, and is controlled to be executed by the first processor 2001. The specific implementation method can refer to the above method embodiment, which will not be repeated here.

[0204] Optionally, the memory 2002 may be a read-only memory (ROM) or other types of static storage devices that can store static information and instructions, a random access memory (RAM) or other types of dynamic storage devices that can store information and instructions, or an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compressed optical disc, laser disc, optical disc, digital versatile disc, Blu-ray disc, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store the desired program code in the form of an instruction or data structure and can be accessed by a computer, but is not limited thereto. The memory 2002 may be integrated with the first processor 2001, or may exist independently, and may be accessed through the interface circuit ( Figure 4 (not shown) is coupled to the first processor 2001, which is not specifically limited in this embodiment of the present invention.

[0205] The transceiver 2003 is used to communicate with a network device or a terminal device.

[0206] Optionally, the transceiver 2003 may include a receiver and a transmitter ( Figure 4 The receiver is used to implement a receiving function, and the transmitter is used to implement a sending function.

[0207] Optionally, the transceiver 2003 can be integrated with the first processor 2001, or can exist independently, and can be connected to the first processor 2001 through the interface circuit ( Figure 4 (not shown) is coupled to the first processor 2001, which is not specifically limited in this embodiment of the present invention.

[0208] It should be noted that Figure 4 The structure of the deep learning-based industrial wastewater water quality prediction device 410 shown in the figure does not constitute a limitation on the router. The actual knowledge structure recognition device may include more or fewer components than shown in the figure, or a combination of certain components, or a different arrangement of components.

[0209] In addition, the technical effects of the industrial wastewater water quality prediction device 410 based on deep learning can refer to the technical effects of the industrial wastewater water quality prediction method based on deep learning described in the above method embodiment, and will not be repeated here.

[0210] It should be understood that the first processor 2001 in the embodiment of the present invention may be a central processing unit (CPU), and the processor may also be other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), field programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.

[0211] It should also be understood that the memory in the embodiments of the present invention may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of random access memory (RAM) are available, such as static RAM (SRAM), dynamic random access memory (DRAM), synchronous DRAM (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link DRAM (SLDRAM), and direct rambus RAM (DR RAM).

[0212] The above embodiments can be implemented in whole or in part by software, hardware (such as circuits), firmware or any other combination. When implemented by software, the above embodiments can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions or computer programs. When the computer instructions or computer programs are loaded or executed on a computer, the process or function described in the embodiment of the present invention is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from one website, computer, server or data center to another website, computer, server or data center by wired (such as infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or data center that contains one or more available media sets. The available medium can be a magnetic medium (for example, a floppy disk, a hard disk, a tape), an optical medium (for example, a DVD), or a semiconductor medium. The semiconductor medium can be a solid-state hard disk.

[0213] It should be understood that the term "and / or" in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. A and B can be singular or plural. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship, but it may also indicate an "and / or" relationship. Please refer to the context for specific understanding.

[0214] In the present invention, "at least one" means one or more, and "more than one" means two or more. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b, or c can be represented by: a, b, c, ab, ac, bc, or abc, where a, b, c can be single or multiple.

[0215] It should be understood that in various embodiments of the present invention, the size of the serial numbers of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.

[0216] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.

[0217] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described equipment, devices and units can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0218] In the several embodiments provided by the present invention, it should be understood that the disclosed devices, apparatuses and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0219] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0220] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0221] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in various embodiments of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0222] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.

Claims

1. A method for predicting water quality of industrial wastewater based on deep learning, characterized in that: The method comprises: S1. Obtain historical data on inlet and outlet water quality monitoring of industrial wastewater treatment plants; S2. Preprocess the historical data of the inlet and outlet water quality monitoring to obtain preprocessed data; interpolate the preprocessed data to obtain a water quality monitoring sample data set; S3, performing correlation analysis on the water quality monitoring sample data set to obtain a feature data set; dividing the feature data set into a training data set and a test data set; S4, construct the initial water quality prediction model based on RF-CNN-LSTM; The initial RF-CNN-LSTM water quality prediction model includes: an RF module, a CNN module and an LSTM module; The RF module is used to fit the mapping relationship between the inlet water data and the outlet water data; The CNN module includes: two convolutional layers, a pooling layer, an activation function and a fully connected layer; the CNN module is used to extract features from water quality data; The LSTM module includes: an input gate, a forget gate and an output gate; the LSTM module is used to learn the time series information in the input water quality data; S5. According to the training data set, the initial RF-CNN-LSTM-based water quality prediction model is trained to obtain a trained RF-CNN-LSTM-based water quality prediction model; The step S5 trains the initial RF-CNN-LSTM-based water quality prediction model according to the training data set to obtain a trained RF-CNN-LSTM-based water quality prediction model, including: S51, inputting the training set into the initial water quality prediction model based on RF-CNN-LSTM, extracting features of the training set through the CNN module to obtain local features and spatial information; inputting the local features and spatial information into the LSTM module, and the LSTM module processes the local features and spatial information to obtain a first predicted water quality feature result; S52, inputting the training set into the initial water quality prediction model based on RF-CNN-LSTM, processing the training set through the RF module, and obtaining the second predicted water quality characteristic result; S53, by setting different weights for the first predicted water quality characteristic result and the second predicted water quality characteristic result, respectively, to obtain an outlet water quality index; according to the outlet water quality index and the loss function MSE, the water quality prediction model based on RF-CNN-LSTM is trained to obtain a trained water quality prediction model based on RF-CNN-LSTM; S6. Input the test data set into the trained water quality prediction model based on RF-CNN-LSTM to obtain a prediction result; according to the prediction result, evaluate the trained water quality prediction model based on RF-CNN-LSTM to obtain an evaluated water quality prediction model based on RF-CNN-LSTM; S7. Obtain the water quality data to be predicted; input the water quality data to be predicted into the evaluated RF-CNN-LSTM-based water quality prediction model to obtain the effluent water quality prediction result.

2. The method for predicting water quality of industrial wastewater based on deep learning according to claim 1, characterized in that: The historical data collection indicators of the inlet and outlet water quality monitoring of the industrial wastewater treatment plant of S1 include: inlet data indicators and outlet data indicators; The influent data indicators include: influent COD concentration, influent ammonia nitrogen concentration, influent total phosphorus concentration, influent total nitrogen concentration, influent pH value, hourly flow rate, hourly flow rate, cumulative flow rate and sludge concentration; The sludge concentration includes: mixed liquor suspended solids, mixed liquor volatile suspended solids, sludge settling ratio and sludge index; The effluent data indicators include: effluent COD concentration, effluent ammonia nitrogen concentration, effluent total phosphorus concentration, effluent total nitrogen concentration and effluent pH value.

3. The method for predicting water quality of industrial wastewater based on deep learning according to claim 1, characterized in that: The step S2 pre-processes the historical data of the inlet and outlet water quality monitoring to obtain pre-processed data; The pre-processed data is interpolated to obtain a water quality monitoring sample data set, including: S21, intercepting a smooth data segment from the historical data of the inlet and outlet water quality monitoring; According to the sewage plant design inlet and outlet water indicators and laboratory chemical test results, compile the use indicator range of the predicted water quality data; S22, performing anomaly detection on the intercepted historical data according to the usage index range, removing abnormal data in the water quality monitoring historical data, and obtaining processed water quality monitoring historical data; S23, using the KNN algorithm to interpolate the processed water quality monitoring historical data to obtain the interpolated water quality monitoring historical data; S24. Normalize the interpolated historical water quality monitoring data to obtain a water quality monitoring sample data set.

4. The method for predicting water quality of industrial wastewater based on deep learning according to claim 2, characterized in that: The step S3 performs correlation analysis on the water quality monitoring sample data set to obtain a feature data set, including: S31. Calculate the correlation coefficient between the inlet data index and the outlet data index in the water quality monitoring sample data set according to the inlet data index and the outlet data index; S32, sorting the correlation coefficients from large to small, and selecting the index with a correlation coefficient greater than 0.2 as the characteristic parameter of the water inlet data; S33. Screen the water quality monitoring sample data set according to the characteristic parameters of the inlet water data to obtain a characteristic data set.

5. A water quality prediction device for industrial wastewater based on deep learning, wherein the water quality prediction device for industrial wastewater based on deep learning is used to implement the water quality prediction method for industrial wastewater based on deep learning as claimed in any one of claims 1 to 4, characterized in that: The device comprises: An acquisition unit is used to acquire historical data of inlet and outlet water quality monitoring of industrial wastewater treatment plants; A preprocessing unit, used to preprocess the historical data of the inlet and outlet water quality monitoring to obtain preprocessed data; and to interpolate the preprocessed data to obtain a water quality monitoring sample data set; A calculation and division unit, used for performing correlation analysis on the water quality monitoring sample data set to obtain a feature data set; and dividing the feature data set into a training data set and a test data set; Construction unit, used to build the initial water quality prediction model based on RF-CNN-LSTM; The initial RF-CNN-LSTM water quality prediction model includes: an RF module, a CNN module and an LSTM module; The RF module is used to fit the mapping relationship between the inlet water data and the outlet water data; The CNN module includes: two convolutional layers, a pooling layer, an activation function and a fully connected layer; the CNN module is used to extract features from water quality data; The LSTM module includes: an input gate, a forget gate and an output gate; the LSTM module is used to learn the time series information in the input water quality data; A training unit is used to train the initial RF-CNN-LSTM-based water quality prediction model according to the training data set to obtain a trained RF-CNN-LSTM-based water quality prediction model; input the test data set into the trained RF-CNN-LSTM-based water quality prediction model to obtain a prediction result; and evaluate the trained RF-CNN-LSTM-based water quality prediction model according to the prediction result to obtain an evaluated RF-CNN-LSTM-based water quality prediction model; The initial RF-CNN-LSTM-based water quality prediction model is trained according to the training data set to obtain a trained RF-CNN-LSTM-based water quality prediction model, including: Input the training set into the initial water quality prediction model based on RF-CNN-LSTM, extract features of the training set through the CNN module to obtain local features and spatial information; input the local features and spatial information into the LSTM module, and the LSTM module processes the local features and spatial information to obtain the first predicted water quality feature result; The training set is input into the initial water quality prediction model based on RF-CNN-LSTM, and the training set is processed by the RF module to obtain the second predicted water quality characteristic results; By setting different weights for the first predicted water quality characteristic results and the second predicted water quality characteristic results, the effluent water quality index is obtained; according to the effluent water quality index and the loss function MSE, the RF-CNN-LSTM-based water quality prediction model is trained to obtain the trained RF-CNN-LSTM-based water quality prediction model; The prediction unit is used to obtain the water quality data to be predicted; the water quality data to be predicted is input into the evaluated RF-CNN-LSTM-based water quality prediction model to obtain the effluent water quality prediction result.

6. The water quality prediction device for industrial wastewater based on deep learning according to claim 5, characterized in that: The historical data collection indicators of the inlet and outlet water quality monitoring of the industrial sewage treatment plant include: inlet data indicators and outlet data indicators; The influent data indicators include: influent COD concentration, influent ammonia nitrogen concentration, influent total phosphorus concentration, influent total nitrogen concentration, influent pH value, hourly flow rate, hourly flow rate, cumulative flow rate and sludge concentration; The sludge concentration includes: mixed liquor suspended solids, mixed liquor volatile suspended solids, sludge settling ratio and sludge index; The effluent data indicators include: effluent COD concentration, effluent ammonia nitrogen concentration, effluent total phosphorus concentration, effluent total nitrogen concentration and effluent pH value.

7. A water quality prediction device for industrial wastewater based on deep learning, characterized in that: The water quality prediction device for industrial sewage based on deep learning includes: processor; A memory having computer-readable instructions stored thereon, wherein when the computer-readable instructions are executed by the processor, the method according to any one of claims 1 to 4 is implemented.

8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores program codes, which can be called by a processor to execute the method according to any one of claims 1 to 4.