CN117389142A - Prediction deduction and safe real-time control method for biochemical reaction tank of sewage treatment plant - Google Patents

Prediction deduction and safe real-time control method for biochemical reaction tank of sewage treatment plant Download PDF

Info

Publication number
CN117389142A
CN117389142A CN202311334398.8A CN202311334398A CN117389142A CN 117389142 A CN117389142 A CN 117389142A CN 202311334398 A CN202311334398 A CN 202311334398A CN 117389142 A CN117389142 A CN 117389142A
Authority
CN
China
Prior art keywords
data
model
control
biochemical reaction
reaction tank
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202311334398.8A
Other languages
Chinese (zh)
Inventor
黄慰忠
谢军
刘新秀
田文翀
信昆仑
刘雨婷
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tongji University
Shanghai Urban Construction Design Research Institute Group Co Ltd
Original Assignee
Tongji University
Shanghai Urban Construction Design Research Institute Group Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tongji University, Shanghai Urban Construction Design Research Institute Group Co Ltd filed Critical Tongji University
Priority to CN202311334398.8A priority Critical patent/CN117389142A/en
Publication of CN117389142A publication Critical patent/CN117389142A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B13/00Adaptive control systems, i.e. systems automatically adjusting themselves to have a performance which is optimum according to some preassigned criterion
    • G05B13/02Adaptive control systems, i.e. systems automatically adjusting themselves to have a performance which is optimum according to some preassigned criterion electric
    • G05B13/04Adaptive control systems, i.e. systems automatically adjusting themselves to have a performance which is optimum according to some preassigned criterion electric involving the use of models or simulators
    • G05B13/048Adaptive control systems, i.e. systems automatically adjusting themselves to have a performance which is optimum according to some preassigned criterion electric involving the use of models or simulators using a predictor
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/10Pre-processing; Data cleansing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/21Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
    • G06F18/217Validation; Performance evaluation; Active pattern learning techniques
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/27Regression, e.g. linear or logistic regression
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/044Recurrent networks, e.g. Hopfield networks
    • G06N3/0442Recurrent networks, e.g. Hopfield networks characterised by memory or gating, e.g. long short-term memory [LSTM] or gated recurrent units [GRU]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Artificial Intelligence (AREA)
  • Evolutionary Computation (AREA)
  • General Physics & Mathematics (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • General Engineering & Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Software Systems (AREA)
  • Health & Medical Sciences (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Evolutionary Biology (AREA)
  • Biomedical Technology (AREA)
  • Biophysics (AREA)
  • Computational Linguistics (AREA)
  • General Health & Medical Sciences (AREA)
  • Molecular Biology (AREA)
  • Computing Systems (AREA)
  • Mathematical Physics (AREA)
  • Medical Informatics (AREA)
  • Automation & Control Theory (AREA)
  • Activated Sludge Processes (AREA)

Abstract

The invention discloses a prediction deduction and safe real-time control method for a biochemical reaction tank of a sewage treatment plant, which is characterized in that the characteristics of a system are judged through data statistics and dynamic characteristic analysis, and the deduction and prediction of the state parameters of a biological reaction process of sewage treatment is carried out through a method of combining a Koopman matrix and a deep learning model in the study of a power system. And optimizing the reaction aeration quantity, the internal circulation flow and the sludge reflux process control by means of a model predictive control system with the aim of stably operating the biochemical reaction tank and reaching the standard of the effluent quality. And further checking the safety and rationality of the control based on the data information. The intelligent predictive control method is based on a data driving technology, deep learning and safety inspection, has the characteristics of high reliability and strong adaptability to different changes, reduces the aeration amount of a treatment plant of a sewage plant on the premise of ensuring the quality of effluent, and realizes optimal control.

Description

Prediction deduction and safe real-time control method for biochemical reaction tank of sewage treatment plant
Technical Field
The invention relates to the technical field of computer simulation, in particular to a method for predicting, deducting and safely controlling a biochemical reaction tank of a sewage treatment plant in real time.
Background
The model predictive control method is an effective method for realizing optimal real-time control. The existing research shows that the treatment efficiency of the biochemical reaction tank of the sewage treatment plant can be improved through model predictive control, the fine control is realized by means of predictive information and an optimization model method, and the electric energy and material consumption are saved under the same water inlet condition.
The existing method learns by means of strong fitting and learning capacity of a deep learning model and by collecting a large amount of accumulated process operation data of a biochemical reaction tank of a sewage treatment plant, and accurate prediction of an actual process is achieved. And taking the deep learning model as a prediction deduction model in model prediction control, further combining with real-time optimization model solution to obtain a time-step-by-time optimal control strategy, and optimally scheduling the operation of the biochemical reaction tank. Because the method is driven by data, compared with the traditional prediction control method based on the biochemical reaction tank mechanism model, the method avoids the influence caused by calculation errors of model adjustment. Meanwhile, the method trains a prediction model through measured data, and has better adaptability to complex influence factors existing in an actual system.
However, the method still has the defects in the background of biochemical reaction tanks of sewage treatment plants at present, and the method is specifically characterized in the following aspects:
1. At present, model prediction research of real-time control of a biochemical reaction tank of a sewage treatment plant based on deep learning only pays attention to whether the water quality of effluent reaches the standard or not, and takes the model prediction research as an optimal control target. The existing methods therefore lack in depth consideration of the operational stability of the biochemical reaction tanks. The status data of the biochemical reaction tank is often one of the direct factors influencing the water outlet.
2. The model predictive control based on machine learning is a black box model, and the model cannot embody the dynamic characteristics and rules of the operation of the biochemical reaction tank, so that the model structure and the predictive result are difficult to explain.
3. In the existing research, the input, output, structural parameters and the like of the deep learning model are mainly selected and evaluated in a cross-validation and trial-and-error mode. However, there is still no effective analysis and evaluation method in the context of deduction and prediction in biochemical reaction tanks.
4. Since this method is a data-driven method, its application effect is very dependent on the reliability of the training data and the deep learning model. However, studies have shown that existing deep learning models may still suffer from output anomalies under part of the input conditions, which may lead to a lack of safety guarantee for the resulting control commands of the method.
Therefore, how to improve the reliability and the adaptability to different changes, and reduce the aeration amount of a treatment plant of a sewage plant on the premise of ensuring the quality of effluent water, and realize optimal control are technical problems which are needed to be solved by technicians in the field.
Disclosure of Invention
In view of the above-mentioned shortcomings of the prior art, the invention provides a method for predicting, deducting and safely controlling a biochemical reaction tank of a sewage treatment plant in real time, which aims to improve reliability, improve adaptability to different changes, reduce aeration amount of a sewage treatment plant on the premise of ensuring water quality of effluent, and realize optimal control.
In order to achieve the purpose, the invention discloses a method for predicting, deducing and safely controlling a biochemical reaction tank of a sewage treatment plant in real time, which is based on a Koopman matrix and deep learning and comprises the following steps:
step 1, preprocessing original data of a biochemical reaction tank;
step 2, carrying out statistics and dynamic characteristic analysis on the biochemical reaction tank in a data driving mode;
step 3, constructing a prediction deduction model Koopman Deep Learning of a biochemical reaction tank based on a Koopman matrix and a deep learning method, namely Koopman-DL;
step 4, a biochemical reaction tank model prediction control method Koopman Deep Learning Model Predictive Control based on a Koopman-DL prediction deduction model is established, namely the Koopman-DL-MPC;
And 5, constructing a data-driven rationality and safety inspection method of the biochemical reaction tank Koopman-DL-MPC.
Preferably, in step 1, the raw data of the biochemical reaction tank means state data obtained by monitoring the biochemical reaction tank in real time;
the preprocessing refers to cleaning and statistical analysis of the original data;
the cleaning refers to removing noise and abnormal fluctuation caused by equipment or environmental disturbance in the original data, and supplementing the removed data by a time-averaged method.
More preferably, in step 1, according to the removing of the original data, the standard deviation of 3 times of the data is calculated within one hydraulic retention time before and after the data removing time node, and the extremely abnormal data is removed by taking the standard deviation as an upper limit standard and a lower limit standard. And then supplementing the removed data by interpolation method through the data in the time period, wherein the specific process is as follows:
step 1.1, sorting the original data, namely the data obtained by monitoring the biochemical reaction tank in real time according to the running time;
step 1.2, determining a time interval for cleaning the original data according to the hydraulic retention time of the biochemical reaction tank;
Step 1.3, calculating the mean value and standard deviation of each data of the biochemical reaction tank in each time interval;
step 1.4, deleting extreme abnormal data exceeding 3 times of standard deviation in a time interval, and supplementing the extreme abnormal data through interpolation;
step 1.5, carrying out normalization processing on the interpolated data so as to facilitate subsequent data analysis and modeling;
the calculation formula of the interpolation is as follows:
wherein i is a time node needing interpolation; datain i The i-th interpolation data obtained by calculation is used for replacing deleted data, the data is obtained by calculating the data of all TN time steps before and after the i-time node, and the time step of the time is represented by a variable j; DATA j The jth original data in each time interval is used for interpolation calculation; the set of all the interpolated Data is Data;
the normalization formula in step 1.5 is as follows:
wherein inorm represents a Data time node needing normalization, and Data inorm For the interpolated Data of inorm time step, max (Data) and min (Data) are the maximum and minimum values of the interpolated Data, dataNorm inorm Normalized data for the inorm time step; the set of all normalized data compositions is DataNorm.
Preferably, in step 1, the raw data includes COD, ammonia nitrogen, total phosphorus, water temperature and flow rate of the water inlet part of the biochemical reaction tank under different quarter and rainfall load conditions of the sewage treatment plant, the activated sludge mixed suspended solid concentration MLSS of the biochemical reaction tank, the dissolved oxygen concentration DO of anaerobic, anoxic and aerobic sections in the tank, the oxidation-reduction potential ORP and the nitrate nitrogen NO of the aerobic section 3 - The aeration quantity, the medicine adding quantity, the inside and the outside of the biochemical reaction tankReflux flow and sludge discharge, wherein COD, total nitrogen and total phosphorus in the water outlet part of the biochemical reaction tank;
the original data are obtained through real-time online data monitoring, and the frequency is one piece of 10 minutes.
Preferably, in step 2, the raw data after cleaning, that is, the monitoring data obtained from the biochemical reaction tank after cleaning, is used to analyze statistical information of the data and dynamic process of the biochemical reaction, select characteristics affecting the biochemical reaction tank, and then use the characteristics and corresponding data as input data of a prediction deduction model;
the statistical and dynamic characteristic analysis forms of the data comprise linear correlation analysis, nonlinear regression analysis, data probability distribution and conditional probability distribution estimation and Koopman matrix analysis of a power system of the data.
More preferably, in step 2, the process of performing statistical and kinetic analysis on the kinetic process of the biochemical reaction is as follows:
step 2.1, analyzing and evaluating the linear correlation between each data item in the normalized data and the data item with time difference through linear correlation analysis, wherein the specific formula of the correlation coefficient calculation is as follows:
wherein r (DataNorm ) z+lt ) For two sets of data DataNorm and DataNorm z+lt The linear correlation coefficient obtained by calculation between the corresponding data items; z is a natural number of 1 or more, and represents a data number used for correlation verification; a natural number of 1 or more, representing a time difference for the correlation-check data; cov is the covariance of the data; var is the variance of the data;
step 2.2, using input and output of a prediction model as input and output of regression problems through nonlinear regression analysis, fitting by using collected data by means of a deep learning model, selecting according to different model inputs, a deep learning model structure and super parameters, and comparing to obtain a model input data item with the best fitting performance and a model structure;
the fitting process is shown in the following formula:
wherein Reg is a deep learning model that is regressed for fitting;
Num represents the amount of data used for the nonlinear fitting;
k is a counting variable of data in regression calculation, from 1 to Num;
DataNorm k+1 and DataNorm k Is the input and output of the fitting;
θ is a parameter of the deep learning used by the regression model;
step 2.3, estimating data probability distribution and conditional probability distribution, analyzing and obtaining probability distribution of the data and conditional probability distribution of the data, thereby analyzing the historically operating characteristics of the biochemical reaction tank from the data perspective;
step 2.3.1, determining the maximum and minimum values of all data items according to the data, and dividing intervals between the minimum and maximum values;
and 2.3.2, counting the data quantity contained in each partition, and counting all the data to obtain the number of the data contained in each partition, thereby obtaining the probability distribution of the data. The value range of each data item can be directly known through probability distribution, and the history condition of the biochemical reaction tank can be directly known;
step 2.3.3, screening data meeting a certain condition from the data, and counting the data quantity contained in each partition of the screened data to obtain the number of the data contained in each partition, thereby obtaining the conditional probability distribution of the data;
Step 2.4, combining Extended Dynamic Mode Decomposition, namely, an EDMD method, to obtain an approximate Koopman matrix and a characteristic value thereof from the original data, and obtaining the approximate matrix of the Koopman matrix in the observation function sense, wherein the approximate matrix can be obtained by solving the following optimization problem:
wherein G is an observation function;
k is a Koopman matrix to be solved, a reference is provided for the size of the Koopman matrix in a subsequent prediction model according to the dimension of the Koopman matrix, and meanwhile, the dynamic property of the sewage treatment A2O process can be analyzed and judged through the property of K, for example, the stability of the system is judged through the characteristic value condition of K;
DataNorm km+1 and DataNorm km For the data used for solving the Koopman matrix, data are obtained from the cleaned data;
numk is the total amount of data used to solve the Koopman matrix; km is a count variable from 1 to Numk for solving Koopman matrix usage data.
More preferably, in step 3, a deep learning-based biochemical reaction tank prediction deduction model is constructed. The deep learning prediction deduction model comprises biochemical reaction tank data feature selection, model training and model testing, super-parameter selection and cross verification of a Koopman matrix and a deep learning model, and model robustness analysis. The method comprises the following steps:
Step 3.1, combining the result of nonlinear regression analysis and the cleaned data, and selecting the input information of the prediction deduction model as the input and output of the Koopman-DL prediction deduction model;
the input of the prediction deduction model is water inflow data, biochemical reaction tank state data and control data in a period of time in the current moment; each specific data is consistent with the data items screened by the regression model;
the output of the prediction deduction model is the water quality of the effluent and the state of the biochemical reaction tank in a future period. The model super-parameter reference nonlinear regression analysis selects parameters, and is debugged through cross verification; the specific formula is as follows:
wherein t represents the current time; lag is the predicted time span; x is X t ,...,X t+lag State variables from t to t+lag time; r is (r) t ,...r t+lag The water inflow variable is from t to t+lag time; a, a t ,...,a t+lag Controlling variables from t to t+lag time; preY t+lag+1 PreX for predicting effluent variables t+lay+1 For predicting state variables, both sets of data are from normalized data;the depth neural network is used for approaching an observation function corresponding to the Koopman matrix; w is deep neural network->Is obtained through training; k is a Koopman matrix;
and 3.2, training the constructed prediction model by using the cleaning data, wherein the training is realized by minimizing a loss function, and the model training and the model testing are specifically shown as follows:
Wherein t is a time node counter of training data, and from 1 to the number NumT of the training data; x is X t ,...,X t+lag State variables from t to t+lag time; r is (r) t ,...r t+lag The water inflow variable is from t to t+lag time; a, a t ,...,a t+lag Controlling variables from t to t+lag time; y is Y t+lag+1 To predict the true value of the effluent variable; x is X t+lag+1 Is the true value of the predicted state variable;
the optimization model is solved through a training algorithm Adam of a deep learning model, and the trained model can be used for prediction simulation of the dynamics of the biochemical reaction tank;
step 3.3, designing a super-parameter of the deep learning model part and a Koopman matrix training initial value and a matrix dimension of the Koopman matrix part based on the comparison result of the super-parameter of the regression model and the Koopman matrix, and further adjusting the super-parameter on the basis;
the model hyper-parameter adjustment refers to testing initial values of different deep learning model structures and Koopman operators on the basis of the training process, and retraining by using the training algorithm every time of resetting to obtain a trained model calculation effect. By comparing the effects of the models under different superparameters and the initial value of the Koopman matrix, selecting a group with the best performance as a final model superparameter and the initial value of the Koopman matrix, using the corresponding model as a final Koopman-DL prediction deduction model, and using the model for prediction;
Step 3.4, carrying out robustness analysis on the prediction deduction model after training; the robustness analysis observes the variation range of the output of the disturbance input model with different degrees;
if the output of the predictive deduction model can be kept in a certain range under different random disturbance inputs, the trained predictive deduction model can be considered to have better robustness;
the specific calculation formula of the disturbance of different degrees is as follows:
where tc is the time node counter that increments the disturbance data,to add perturbed state data, X tc For status data +.>To add disturbed control data, a tc For controlling data +.>R for adding the disturbed water inflow data tc For the water inflow data, δ -N (μ, σ) is a normal distributed random disturbance that obeys a standard deviation of μ as the mean value σ.
More preferably, in step 4, a model predictive control method Koopman-DL-MPC of the biochemical reaction tank is constructed according to the predictive deduction model in combination with a model predictive control method model predictive control, i.e., MPC;
the biochemical reaction tank model prediction control method based on the deep learning prediction deduction model comprises the following steps:
step 4.1, constructing a standard model predictive control framework MPC; the model predictive control framework MPC is a biochemical reaction tank state and water outlet predictive model Koopman-DL based on a Koopman matrix and deep learning;
Step 4.2, inputting the monitoring data of the biochemical reaction tank into a prediction model to predict the state of the biochemical reaction tank and the quality of the effluent;
step 4.3, scoring according to the prediction result and combining the control target, and taking the score as an optimized objective function; wherein the optimization objective includes three aspects: the index of the biochemical reaction tank needs to be stabilized near the design working condition as much as possible; the water quality of the effluent meets the specified effluent index; the aeration quantity is required to be as small as possible;
step 4.4, optimizing and adjusting control measures including aeration quantity, medicine adding quantity and internal and external reflux quantity in a future time step according to an optimization target by using an optimization algorithm so as to maximize a target function value;
step 4.5, obtaining an optimal control strategy in a time step in the future through repeated prediction and optimization, and controlling the optimal control strategy;
step 4.6, entering the next time step, and repeating the steps 4.1 to 4.5, thereby realizing real-time optimal control of the system;
the above process is described by the following time-step optimization model:
minJ+U+P
t∈{t 0 ,t 1 ,...,t M }
wherein t is time, lag is the time span of the predicted output variable; J. u, P the objective function corresponding to the above three objectives; xlow_bound, xup _bound, price_bound, yup _bound are upper and lower limits for biochemical reaction tank state variables and effluent indicators; abound is a target line for the control variable; x is X t 、Y t 、a t The method is used for inputting state variables, water outlet indexes and optimizing control variables; preX (PreX) t+lay+1 、PreY t+lay+1 The state variables and the water outlet indexes are predicted and output; lagk is a counter for optimizing control variables;
the model predictive control method reduces the total aeration amount and the medicine adding amount of the system as much as possible on the premise of ensuring that the effluent quality reaches the standard and the state of the biochemical reaction tank is stable, and realizes the optimal control and the energy-saving operation of the biochemical reaction tank;
in the above process, any optimization algorithm may be used to solve the above optimization model, including but not limited to genetic algorithms, particle swarm algorithms, etc.; the iterative step number of the optimization algorithm is calculated by a control time interval and a single optimization time, and the formula is as follows:
step_opt is the iterative STEP number calculated by the optimization algorithm, Δt is the TIME interval controlled, and time_opt is the TIME required for single iteration of the optimization algorithm;
the effect evaluation of the process control system is calculated by J+U+P, and the lower the J+U+P obtained in the control process is, the better the control effect is.
More preferably, in step 5, on the basis of the virtual real-time optimization control system of the biochemical reaction tank, the rationality and safety check of the output control variable of the Koopman-DL-MPC are added;
The rationality and safety inspection comprises the following specific steps of judging whether the current optimization control variable is in a manually specified range, judging whether the current optimization control variable is consistent with the similar situation in history, and judging whether the control effect of the current optimization control variable is feasible or not:
step 5.1, judging whether the current optimized control variable is in a manually specified range; the optimization control strategy obtained by the model predictive control Koopman-DL-MPC needs to be compared with relevant indexes in the operation standard of the A2O process of the sewage treatment plant manually specified, and whether the optimization control strategy is in the range specified by the standard is judged according to the comparison result; the method comprises the following specific steps:
step 5.1.1, directly counting historical control variable data and calculating the mean value and standard deviation of the historical control variable data;
and 5.1.2, directly adding and subtracting the number of the standard deviation of 3 times from the mean value as a reasonable range according to the principle of the standard deviation of 3 times of statistics, and directly checking whether the optimized control variable is kept within the range, wherein the calculation process of the upper limit and the lower limit can be calculated by the following formula:
wherein upper and lower are upper and lower limits calculated by the data; a, a h Historical data representing the control variable, and a total of NumA data; h is a counting variable used by the control variable data in calculating upper and lower limits; a represents the average value of the control variable data;
step 5.1.3, further calibrating the upper limit and the lower limit by combining recommended process parameters; finally, taking the intersection of the recommended process parameter range and the down and upper intervals as a final judgment range, namely considering that the current optimized control variable is in a manually specified range when the optimized control variable meets the following inequality condition:
aOPT∈[down,upper]∩[s down ,s upper ]
wherein aOPT represents the optimized control variable; [ Down, upper ]]Representing a range of values determined by down and upper; s is(s) down Sum s upper Is the recommended upper and lower limits of the process parameters; [ s ] down ,s upper ]Represented by s down Sum s upper A determined numerical range; n represents the portion where the two sets of ranges intersect; aOPT e denotes that the optimized control variable belongs to the set.
Step 5.2, judging whether the current optimized control variable is consistent with the similar situation in history; counting the conditional probability distribution of the control variable under the similar condition through the normalized historical data, and determining the reasonable upper and lower limit ranges of the control variable according to the principle of 3 times of standard deviation of statistics to judge;
The conditional probability distribution under the similar condition refers to the probability distribution condition of calculating the obtained optimized control variable at a certain moment, selecting the control data close to the water inlet variable and the state variable from the historical data by means of the water inlet variable and the state variable at the moment, and counting the control data; the judging data is judged by the vector distance, and the specific formula is as follows:
wherein X is s1 And X is s2 Two sets of state data representing the comparison required; r is (r) s1 And r s2 Two sets of water inflow data which need to be compared are represented; s1 and s2 are subscripts of two sets of data to be compared; when the distance is sufficiently small, then the two sets of data are considered to be close;
the reasonable upper and lower limit ranges of the control variables are similar to those in the step 5.1, and the only difference is that the data of the control variables are the data passing through screening;
the method comprises the following specific steps:
step 5.2.1, comparing the current time state data and the water inlet data with the historical state data and the historical data at all times, and calculating the distance between each group of data through the distance formula;
step 5.2.2, setting the distance threshold value to be 0.2, and recording a control variable corresponding to historical data with similarity smaller than the threshold value to obtain 'control variable data in a condition similar to the current state in history';
Step 5.2.3, calculating the screened data according to the step 5.1 to obtain a control variable judgment range of the conditional probability distribution under the similar condition; if the optimized control variable is within the range, the current optimized control variable is considered to be consistent with the similar situation in history, and the test of consistent with the similar situation in history is passed;
step 5.3, judging whether the control effect of the current optimized control variable is feasible or not; and inputting the optimized control variable, the current water inflow variable and the state variable into a Koopman-DL prediction model, and directly predicting to obtain the state variable and the water outflow variable at the future moment so as to judge whether the control effect is feasible.
The method comprises the following specific steps:
step 5.3.1, taking the optimized control variable and the current time state as input of a deduction prediction model to perform one-step prediction;
step 5.3.2, comparing the prediction result with the biochemical reaction tank operation standard; if the state variables including dissolved oxygen and MLSS are still kept in the specified range of the biochemical reaction tank and the effluent quality reaches the standard, the optimized control variables given at the current moment are considered to be reasonable and feasible and can be used as the control output of the system; otherwise, it is considered that the control variables currently given can achieve the optimal effect by saving control factors such as aeration.
Step 5.4, judging the final safety rationality of the optimized control variable; if the optimized control variable passes the inspection in the steps 5.1-5.3, the control variable is considered to be safe and reasonable and can be used for actual control; otherwise, the risk of the optimized control variable is considered to exist, and the step 4 is returned to perform calculation again.
The invention has the beneficial effects that:
(1) The analysis method provided by the invention has a wide application range, and can be used for constructing a model prediction real-time control system based on a deep learning model of sewage treatment plants with different AAO processes.
(2) The invention brings the stable operation of the biochemical reaction tank into the target of optimal control for the first time, further controls energy conservation and optimizes the operation of the system on the premise of considering the water quality of the effluent and the stable state of the biochemical reaction tank.
(3) According to the invention, the Koopman matrix and the deep learning are combined for the first time to be used for predicting and deducting the dynamic process of the biochemical reaction tank of the sewage treatment plant, and the linear structure behind the Koopman matrix is found through the Koopman matrix on the basis of considering the nonlinear simulation capability of the Koopman matrix, so that the interpretability of the Koopman matrix is improved.
(4) The invention provides a data driving inspection method for controlling safety and rationality for a black box model real-time control model of an AAO process of a sewage treatment plant for the first time, and improves reliability and practicability of the method.
The conception, specific structure, and technical effects of the present invention will be further described with reference to the accompanying drawings to fully understand the objects, features, and effects of the present invention.
Drawings
FIG. 1 is a schematic diagram of a method according to an embodiment of the invention.
FIG. 2 is a schematic diagram of a Koopman-DL prediction deduction model according to an embodiment of the present invention.
FIG. 3 is a flow chart of model predictive control based on deep learning in an embodiment of the invention.
FIG. 4 is a flowchart of a method for verifying rationality and security according to an embodiment of the invention.
FIG. 5 is a graph showing the results of data correlation analysis according to an embodiment of the present invention.
FIG. 6 is a graph illustrating comparison of process control variables for optimizing control in accordance with one embodiment of the present invention
FIG. 7 is a graph illustrating comparison of state variables of an optimization control process in accordance with one embodiment of the present invention
FIG. 8 is a graph of comparison of optimal control process control variables in combination with plausibility checking in one embodiment of the invention
FIG. 9 is a graph of optimization control process state variable versus plausibility checking in accordance with one embodiment of the present invention
Detailed Description
Example 1
As shown in fig. 1 to 4, the method for predicting, deducting and controlling safety of the biochemical reaction tank of the sewage treatment plant in real time is based on Koopman matrix and deep learning, and comprises the following steps:
step 1, preprocessing original data of a biochemical reaction tank;
Step 2, carrying out statistics and dynamic characteristic analysis on the biochemical reaction tank by adopting a data driving mode;
step 3, constructing a prediction deduction model Koopman Deep Learning (Koopman-DL) of a biochemical reaction tank based on a Koopman matrix and a deep learning method;
step 4, a biochemical reaction tank model predictive control method Koopman Deep Learning Model Predictive Control (Koopman-DL-MPC) is established based on a Koopman-DL predictive deduction model;
and 5, constructing a data-driven rationality and safety inspection method of the biochemical reaction tank Koopman-DL-MPC.
The invention combines the Koopman matrix, the mathematical statistics method and the model predictive control technology in the deep learning and the power system research to construct the method for predicting the state of the biochemical reaction tank of the sewage treatment plant and optimizing and controlling the water outlet in real time. Firstly, the Koopman matrix and the deep learning are fused, the characteristics of the linear structure constructed by the Koopman matrix and the strong learning fitting capacity of the deep learning method are combined, the linear structure behind the black box model is found, the defect of insufficient analysis of the characteristics of the black box model on the power system is overcome on the premise of ensuring the prediction precision, and the interpretability of the data driving model is improved. Secondly, taking the state variable of the biochemical reaction tank as one of the targets of the optimal control, and realizing the energy-saving optimal control on the basis of considering the stable operation of the biochemical reaction tank. And then, analyzing and testing the dynamics rule of the biochemical reaction tank by a mathematical statistics method, thereby providing references for selecting the input, output and structural parameters of the deep learning model. Finally, three rationality tests are provided for the output control strategy to restrict the control instruction, so that the output of the optimization model accords with the actual condition, and the safety of the model control output in the actual application of the sewage plant is ensured.
In certain embodiments, in step 1, the raw data for the biochemical reaction tank refers to status data obtained by monitoring the biochemical reaction tank in real time;
the analysis and pretreatment comprises the steps of cleaning the original data;
the cleaning refers to removing abnormal data caused by equipment maintenance events from the original data, and removing noise and abnormal fluctuation from the original data by a time-averaged method.
Summarizing in practical application, cleaning the original data can enable the processed data to be more stable and better reflect the dynamic characteristics of the biochemical reaction tank.
In some embodiments, in step 1, according to the 3 times standard deviation principle in the original data, the time interval characteristics of the biochemical reaction tank are combined to remove the extreme abnormal data, and the data is supplemented by an interpolation method, and the specific process is as follows:
step 1.1, sorting original data, namely data obtained from a biochemical reaction tank by real-time monitoring according to the running time;
step 1.2, determining a time interval for cleaning original data according to the hydraulic retention time of the biochemical reaction tank;
step 1.3, calculating the mean value and standard deviation of each data of the biochemical reaction tank in each time interval;
Step 1.4, deleting extreme abnormal data exceeding 3 times of standard deviation in a time interval, and supplementing the extreme abnormal data through interpolation;
step 1.5, carrying out normalization processing on the interpolated data so as to facilitate subsequent data analysis and modeling;
the calculation formula of interpolation is as follows:
wherein i is a time node needing interpolation; datain i The i-th interpolation data obtained by calculation is used for replacing deleted data, the data is obtained by calculating the data of all TN time steps before and after the i-time node, and the time step of the time is represented by a variable j; DATA j The jth original data in each time interval is used for interpolation calculation; the set of all the interpolated Data is Data;
the normalization formula in step 1.5 is as follows:
wherein inorm represents a Data time node needing normalization, and Data inorm For the interpolated Data of inorm time step, max (Data) and min (Data) are the maximum and minimum values of the interpolated Data, dataNorm inorm Normalized data for the inorm time step; the set of all normalized data compositions is DataNorm.
In practical application, the original data processed by the steps eliminates the influence of abnormal values and disturbance values to a certain extent, and is convenient for subsequent modeling by normalization and adjustment, thereby providing a data base for subsequent analysis and modeling.
In certain embodiments, in step 1, the raw data comprises COD, ammonia nitrogen, total nitrogen and total nitrogen of the water inlet part of the biochemical reaction tank under different quarter and rainfall load conditions of the sewage treatment plantPhosphorus, water temperature and flow, activated sludge mixed suspended solid concentration MLSS of a biochemical reaction tank, dissolved oxygen concentration DO of anaerobic, anoxic and aerobic sections in the tank, oxidation-reduction potential ORP and nitrate nitrogen NO of aerobic sections 3 - Aeration quantity, medicine adding quantity, internal and external reflux flow and sludge discharging quantity of the biochemical reaction tank, and COD, total nitrogen and total phosphorus of the water outlet part of the biochemical reaction tank;
raw data were obtained by real-time online data monitoring, with a frequency of 10 minutes.
In practical application, as the data needs to support the construction of dynamic feature analysis and prediction deduction models, the data quantity needs to be as comprehensive as possible, and at least comprises running conditions of sewage treatment plants under different quarters and rainfall load conditions, so that the reliability of the subsequent analysis results can be ensured.
In some embodiments, in step 2, the kinetic process of the biochemical reaction is analyzed by adopting data subjected to cleaning and normalization, the characteristics of the biochemical reaction affecting the biochemical reaction tank are selected, then the influence of each characteristic on the kinetics of the biochemical reaction tank is analyzed, and the characteristics and corresponding data are used as input data of a prediction deduction model;
The forms of the input data include linear correlation analysis, nonlinear regression analysis, data probability distribution and conditional probability distribution estimation and Koopman matrix analysis of the power system.
In certain embodiments, in step 2, the kinetics of the biochemical reaction is analyzed as follows:
step 2.1, analyzing and evaluating the linear correlation between each data item in the normalized data and the data item with time difference through linear correlation analysis, wherein the specific formula of the correlation coefficient calculation is as follows:
wherein r (DataNorm ) z+lt ) For two sets of data DataNorm and DataNorm z+lt Between corresponding data itemsCalculating the obtained linear correlation coefficient; z is a natural number of 1 or more, and represents a data number used for correlation verification; a natural number of 1 or more, representing a time difference for the correlation-check data; cov is the covariance of the data; var is the variance of the data;
step 2.2, using input and output of a prediction model as input and output of regression problems through nonlinear regression analysis, fitting by using collected data by means of a deep learning model, selecting according to different model inputs, a deep learning model structure and super parameters, and comparing to obtain a model input data item with the best fitting performance and a model structure;
The fitting process is shown in the following formula:
wherein Reg is a deep learning model that is regressed for fitting;
num represents the amount of data used for the nonlinear fitting;
k is a counting variable of data in regression calculation, from 1 to Num;
DataNorm k+1 and DataNorm k Is the input and output of the fitting;
θ is a parameter of the deep learning used by the regression model;
step 2.3, estimating data probability distribution and conditional probability distribution, analyzing the data and obtaining probability distribution thereof and conditional probability distribution among each other, thereby analyzing the historical operation characteristics of the biochemical reaction tank from the data angle, and specifically comprising the following steps:
step 2.3.1, determining the maximum and minimum values of all data items according to the data, and dividing intervals between the minimum and maximum values;
and 2.3.2, counting the data quantity contained in each partition, and counting all the data to obtain the number of the data contained in each partition, thereby obtaining the probability distribution of the data. The value range of each data item can be directly known through probability distribution, and the history condition of the biochemical reaction tank can be directly known;
step 2.3.3, screening data meeting certain conditions from the data, and counting the data quantity contained in each partition of the screened data to obtain the number of the data contained in each partition, thereby obtaining the conditional probability distribution of the data;
Step 2.4, combining Extended Dynamic Mode Decomposition, namely, taking an approximate Koopman matrix and characteristic values thereof from original data by an EDMD method, and obtaining the approximate matrix of the Koopman matrix in the observation function sense, wherein the approximate matrix can be obtained by solving the following optimization problem:
wherein G is an observation function;
k is a Koopman matrix to be solved, a reference is provided for the size of the Koopman matrix in a subsequent prediction model according to the dimension of the Koopman matrix, and meanwhile, the dynamic property of the sewage treatment A2O process can be analyzed and judged through the property of K, for example, the stability of the system is judged through the characteristic value condition of K;
DataNorm km+1 and DataNorm km For the data used for solving the Koopman matrix, the data is obtained from the cleaned data;
numk is the total amount of data used to solve the Koopman matrix; km is a count variable from 1 to Numk for solving Koopman matrix usage data.
In practical application, the mutual influence condition of each data under different time difference conditions is obtained through data correlation analysis, for example, if the inflow water COD data and the MLSS data after half an hour (lt is equal to half an hour) are selected to calculate the correlation coefficient, namely, the influence of the change of inflow water COD on the MLSS of the biochemical reaction tank after half an hour is analyzed. Therefore, the main data factors influencing the dynamic process of the biochemical reaction tank and the corresponding time span can be analyzed and known, and the input characteristics are screened for the subsequent modeling.
In practical application, nonlinear regression analysis is performed, input and output are used as input and output of regression problems by a prediction model, collected data are used for fitting by means of a deep learning model, and the model with the best fitting performance is obtained by comparison according to different deep learning model structures and super parameter selection, so that how parameters needed to be used by the prediction model are selected can be primarily judged, and references are provided for subsequent modeling.
In practical application, the conditional probability needs to perform condition screening when counting the data amount contained in each partition, for example, when "inflow COD is greater than 600mg/L", the MLSS of the biochemical reaction tank needs to perform condition judgment on the data at the same moment to determine whether the selected data item meets the condition that "inflow COD is greater than 600mg/L", and only the data meeting the condition can be counted in each partition. And after all the data are counted, obtaining the probability distribution of the data meeting certain conditions, namely the conditional probability distribution. Through the data distribution, the operation condition and the regulation and control characteristics of the biochemical reaction tank in history can be visually displayed, and a reference is provided for subsequent rationality inspection.
In practice, an approximate Koopman matrix is taken from the normalized data in combination with the Extended Dynamic Mode Decomposition method. And providing a reference for the size of the Koopman matrix in a subsequent prediction model according to the dimension of the Koopman matrix, and simultaneously analyzing and judging the dynamic property of the sewage treatment A2O technical process according to the property of the Koopman matrix, for example, judging the stability of the system according to the characteristic value condition.
In some embodiments, in step 3, using the normalized data, designing and selecting features as input data of a prediction deduction model by using nonlinear fitting results and Koopman dynamics feature analysis results, and constructing and training a deep learning model to obtain the prediction deduction model;
the prediction deduction model construction comprises the steps of biochemical reaction tank data feature selection, model training and model testing, and super-parameter selection and cross verification of a Koopman matrix and a deep learning model, and model robustness analysis;
the method comprises the following steps:
step 3.1, combining the result of nonlinear regression analysis and the cleaned data, and selecting the input information of the prediction deduction model as the input and output of the Koopman-DL prediction deduction model;
the input of the prediction deduction model is water inflow data, biochemical reaction tank state data and control data in a period of time in the current moment; each specific data is consistent with the data items screened by the regression model;
the output of the prediction deduction model is the water quality of the effluent and the state of the biochemical reaction tank in a future period of time. The model super-parameter reference nonlinear regression analysis selects parameters, and is debugged through cross verification; the specific formula is as follows:
Wherein t represents the current time; lag is the predicted time span; x is X t ,...,X t+lag State variables from t to t+lag time; r is (r) t ,...r t+lag The water inflow variable is from t to t+lag time; a, a t ,...,a t+lag Controlling variables from t to t+lag time; preY t+lag+1 PreX for predicting effluent variables t+lay+1 For predicting state variables, both sets of data are from normalized data;the depth neural network is used for approaching an observation function corresponding to the Koopman matrix; w is deep neural network->Is obtained through training; k is a Koopman matrix;
and 3.2, training the constructed prediction deduction model by using cleaning data, wherein the training is realized by minimizing a loss function, and the specific formula is as follows:
wherein t is a time node counter of training data, and from 1 to the number NumT of the training data; x is X t ,...,X t+lag State variables from t to t+lag time; r is (r) t ,...r t+lag The water inflow variable is from t to t+lag time; a, a t ,...,a t+lag Controlling variables from t to t+lag time; y is Y t+lag+1 To predict the true value of the effluent variable; x is X t+lag+1 Is the true value of the predicted state variable;
the optimization model is solved through a training algorithm Adam of a deep learning model, and the model after training can be used for prediction simulation of the dynamics of the biochemical reaction tank;
step 3.3, designing a super-parameter of the deep learning model part and a Koopman matrix training initial value and a matrix dimension of the Koopman matrix part based on the comparison result of the super-parameter of the regression model and the Koopman matrix, and further adjusting the super-parameter on the basis;
The model hyper-parameter adjustment of (2) refers to testing the initial values of different deep learning model structures and Koopman operators on the basis of the training process, and retraining by using the training algorithm every time of resetting to obtain the trained model calculation effect. By comparing the effects of the models under different superparameters and the initial value of the Koopman matrix, selecting a group with the best performance as a final model superparameter and the initial value of the Koopman matrix, using the corresponding model as a final Koopman-DL prediction deduction model, and using the model for prediction;
step 3.4, carrying out robustness analysis on the prediction deduction model after training; the robustness analysis observes the variation range of the output of the disturbance input model with different degrees;
if the output of the predictive deduction model can be kept in a certain range under different random disturbance inputs, the trained predictive deduction model can be considered to have better robustness;
the specific calculation formula of the disturbance of different degrees is as follows:
where tc is the time node counter that increments the disturbance data,to add perturbed state data, X tc For status data +.>To add disturbed control data, a tc For controlling data +.>R for adding the disturbed water inflow data tc For the water inflow data, δ -N (μ, σ) is a normal distributed random disturbance that obeys a standard deviation of μ as the mean value σ.
In practical application, the time length at least reaches one hydraulic retention time, and the upper limit of the time length is obtained through linear correlation analysis of the time lag, and when the correlation between the data corresponding to a certain time lag and the data at the current moment is extremely low, the data in the lag time period is used as the input characteristic of the prediction model.
In some embodiments, in step 4, a virtual real-time optimization control system of the biochemical reaction tank is constructed according to the prediction deduction model and the model prediction control method model predictive control and the MPC;
the prediction control of the biochemical reaction tank model based on the deep learning prediction deduction model is as follows:
step 4.1, constructing a standard model predictive control framework MPC; the model prediction control framework MPC is a biochemical reaction tank state and water outlet prediction model Koopman-DL based on a Koopman matrix and deep learning;
step 4.2, inputting monitoring data of the biochemical reaction tank into a prediction model to predict the state of the biochemical reaction tank and the quality of effluent water;
step 4.3, scoring according to the prediction result and combining the control target, and taking the score as an optimized objective function; wherein the optimization objective includes three aspects: the index of the biochemical reaction tank needs to be stabilized near the design working condition as much as possible; the water quality of the effluent meets the specified effluent index; the aeration quantity is required to be as small as possible;
Step 4.4, optimizing and adjusting control measures including aeration quantity, medicine adding quantity and internal and external reflux quantity in a future time step according to an optimization target by using an optimization algorithm so as to maximize a target function value;
step 4.5, obtaining an optimal control strategy in a time step in the future through repeated prediction and optimization, and controlling the optimal control strategy;
step 4.6, entering the next time step, and repeating the steps 4.1 to 4.5, thereby realizing real-time optimal control of the system;
the above process is described by the following time-step optimization model:
min J+U+P
t∈{t 0 ,t 1 ,...,t M }
wherein t is time, lag is the time span of the predicted output variable; J. u, P the objective function corresponding to the above three objectives; xlow_bound, xup _bound, ylow_bound, yup _bound are upper and lower limits for biochemical reaction tank state variables and effluent indicatorsThe method comprises the steps of carrying out a first treatment on the surface of the abound is a target line for the control variable; x is X t 、Y t 、a t The method is used for inputting state variables, water outlet indexes and optimizing control variables; preX (PreX) t+lay+1 、PreY t+lay+1 The state variables and the water outlet indexes are predicted and output; lagk is a counter for optimizing control variables;
on the premise of ensuring that the effluent quality reaches the standard and the state of the biochemical reaction tank is stable in the model predictive control method, the total aeration amount and the medicine adding amount of the system are reduced as much as possible, and the optimal control and the energy-saving operation of the biochemical reaction tank are realized;
The effect evaluation of the process control system is calculated by J+U+P, and the lower the J+U+P obtained in the control process is, the better the control effect is.
In practical applications, maximizing the objective function means optimizing the control variable a in the control of one time step in the future t+lag The state of the biochemical reaction tank is as stable as possible, the effluent quality reaches the standard, the control index is as high as possible in accordance with the requirement of artificial design, and the biochemical reaction tank is used for all time t 0 ,t 1 ,...,t M Optimization is performed, thereby achieving the objective of optimal control.
Any optimization algorithm may be used to solve the above-described optimization model including, but not limited to, genetic algorithms, particle swarm algorithms, and the like. However, considering the characteristic of real-time control of the biochemical reaction tank, the optimization algorithm needs to increase the limit of calculation time when solving the optimization problem in each time step, and the optimization solving time should not exceed the time interval of control, namely the iterative steps of the optimization algorithm are calculated by the control time interval and the single optimization time, and the formula is as follows:
wherein STEP_OPT is the iterative STEP number calculated by the optimization algorithm, deltat is the TIME interval of control, and TIME_OPT is the TIME required by single iteration of the optimization algorithm;
when the optimization algorithm is still not converged within a certain time in operation, the algorithm is terminated, and the existing optimization result is output as a reference for subsequent control.
In certain embodiments, in step 5, the rationality and safety check of the control instruction is increased based on the Koopman-DL-MPC real-time optimal control system of the biochemical reaction tank;
the rationality and safety test comprises the following specific steps of judging whether the current optimization control variable is in a manually specified range, judging whether the current optimization control variable is consistent with the similar situation in history, and judging whether the control effect of the current optimization control variable is feasible or not:
step 5.1, judging whether the current optimized control variable is in a manually specified range; the optimization control strategy obtained by model predictive control Koopman-DL-MPC needs to be compared with relevant indexes in the operation standard of the A2O process of the sewage treatment plant manually specified, and whether the optimization control strategy is in the range specified by the standard is judged according to the comparison result; the method comprises the following specific steps:
step 5.1.1, directly counting historical control variable data and calculating the mean value and standard deviation of the historical control variable data;
and 5.1.2, directly adding and subtracting the number of the standard deviation of 3 times from the mean value as a reasonable range according to the principle of the standard deviation of 3 times of statistics, and directly checking whether the optimized control variable is kept within the range, wherein the calculation process of the upper limit and the lower limit can be calculated by the following formula:
Wherein upper and lower are upper and lower limits calculated by the data; a, a h Historical data representing the control variable, and a total of NumA data; h is a counting variable used by the control variable data in calculating upper and lower limits;expression controlAverage value of variable data;
step 5.1.3, further calibrating the upper limit and the lower limit by combining recommended process parameters; finally, taking the intersection of the recommended process parameter range and the down and upper intervals as a final judgment range, namely considering that the current optimized control variable is in a manually specified range when the optimized control variable meets the following inequality condition:
aOPT∈[down,upper]∩[s down ,s upper ]
wherein aOPT represents the optimized control variable; [ Down, upper ]]Representing a range of values determined by down and upper; s is(s) down Sum s upper Is the recommended upper and lower limits of the process parameters; [ s ] down ,s upper ]Represented by s down Sum s upper A determined numerical range; n represents the portion where the two sets of ranges intersect; aOPT e denotes that the optimized control variable belongs to the set.
Step 5.2, judging whether the current optimized control variable is consistent with the similar situation in history; counting the conditional probability distribution of the control variable under the similar condition through the normalized historical data, and determining the reasonable upper and lower limit ranges of the control variable according to the principle of 3 times of standard deviation of statistics to judge;
The conditional probability distribution under the similar condition refers to the probability distribution condition of calculating the obtained optimized control variable at a certain moment, selecting the control data close to the water inlet variable and the state variable from the historical data by means of the water inlet variable and the state variable at the moment, and counting the control data; the judging data is judged by the vector distance, and the specific formula is as follows:
wherein X is s1 And X is s2 Two sets of state data representing the comparison required; r is (r) s1 And r s2 Two sets of water inflow data which need to be compared are represented; s1 and s2 are subscripts of two sets of data to be compared; when the distance is sufficiently small, then the two sets of data are considered to be closeIs a kind of device for the treatment of a cancer;
the calculation process of the reasonable upper and lower limit ranges of the control variable is similar to that of the step 5.1, and the only difference is that the data of the control variable is the data passing through screening;
the method comprises the following specific steps:
step 5.2.1, comparing the current time state data and the water inlet data with the historical state data and the historical data at all times, and calculating the distance between each group of data through the distance formula;
step 5.2.2, setting the distance threshold value to be 0.2, and recording a control variable corresponding to historical data with similarity smaller than the threshold value to obtain 'control variable data in a condition similar to the current state in history';
Step 5.2.3, calculating the screened data according to the step 5.1 to obtain a control variable judgment range of the conditional probability distribution under the similar condition; if the optimized control variable is within the range, the current optimized control variable is considered to be consistent with the similar situation in history, and the test of consistent with the similar situation in history is passed;
step 5.3, judging whether the control effect of the current optimized control variable is feasible or not; and inputting the optimized control variable, the current water inflow variable and the state variable into a Koopman-DL prediction model, and directly predicting to obtain the state variable and the water outflow variable at the future moment so as to judge whether the control effect is feasible.
The method comprises the following specific steps:
step 5.3.1, taking the optimized control variable and the current time state as input of a deduction prediction model to perform one-step prediction;
step 5.3.2, comparing the prediction result with the biochemical reaction tank operation standard; if the state variables including dissolved oxygen and MLSS are still kept in the specified range of the biochemical reaction tank and the effluent quality reaches the standard, the optimized control variables given at the current moment are considered to be reasonable and feasible and can be used as the control output of the system; otherwise, it is considered that the control variables currently given can achieve the optimal effect by saving control factors such as aeration.
Step 5.4, judging the final safety rationality of the optimized control variable; if the optimized control variable passes the inspection in the steps 5.1-5.3, the control variable is considered to be safe and reasonable and can be used for actual control; otherwise, the risk of the optimized control variable is considered to exist, and the step 4 is returned to perform calculation again.
In practical application, on the basis of a virtual real-time optimized control system of the biochemical reaction tank, the rationality and safety inspection performance of control instructions are increased to ensure the reliability and safety of the system in actual operation, control effect fluctuation caused by the output disturbance of a deep learning model or the optimization result disturbance of the control system is avoided, and the stable operation of the biochemical reaction tank is ensured.
And in conclusion, the rationality and the safety of the optimized control variable can be evaluated, and the reliability and the practicability of the optimizing method are further improved.
Example 2
The aeration amount and the internal and external reflux amount control process of the biochemical reaction tank are optimized for illustration. The sewage treatment plant of the case adopts an AAO process, and the design flow is 800,000m 3 And/d comprising 8 parallel and independently operated biochemical reaction tanks, each having a capacity of 100,000m 3 And/d. In the case, one biochemical reaction tank is selected for analysis.
Step one: and collecting historical data of the biochemical reaction tank, and preprocessing the original data.
Corresponding data are directly obtained through real-time monitoring equipment of the biochemical reaction tank. On the basis of the original data, calculating standard deviation and mean value, deleting data exceeding 3 times of standard deviation according to the principle of 3 times of standard deviation, deleting abnormal data, replacing the deleted data in an interpolation mode, and removing the abnormal data caused by events such as equipment maintenance and the like. And then, carrying out normalization processing on the data, so that subsequent analysis and modeling are facilitated.
Step two: and carrying out statistical analysis and dynamic system characteristic analysis on the processed data.
Based on the data, the mathematical statistics and the dynamic system characteristic analysis are directly carried out on the data, and the method comprises the following steps: linear correlation analysis of data, nonlinear regression analysis, estimation of probability distribution and conditional probability distribution of data, and Koopman matrix analysis of a power system.
The linear correlation results are shown in Table 1, from which it is known that the aeration rate data has a significant positive correlation with the dissolved oxygen DO data after a while, and therefore, a significant consideration is required in the subsequent modeling process. Meanwhile, the dissolved oxygen data of different monitoring sites are also different under the influence of the aeration quantity, the correlation coefficient of the monitoring points close to the aeration position is higher, and the correlation coefficient is lower, so that more relevant dissolved oxygen data can be considered to be selected as input, and the model training effect is improved.
Table 1. Correlation coefficients of aeration quantity data and dissolved oxygen data of each monitoring point location under different time spans lt.
Nonlinear regression uses long short memory neural networks (LSTM) as a model for regression and analyzes its performance by testing different model hyper-parameters. The different superparameter combinations were named Structure1-4, the parameters of which are exemplified by the number of LSTM layers, and the specific settings are shown in Table 2 below. The fitting result of the model constructed by each structure is shown in fig. 6, and as can be seen from the graph, the more complex model structure has better adaptability to the real-time monitoring data of the biochemical reaction tank. Thereby providing a reference for subsequent modeling.
Table 2.4 hyper-parameters tested were selected in combination.
The probability distribution and the conditional probability distribution of the data can be directly obtained through statistics by the method, and the obtained conditional probability 'the carbon nitrogen ratio (C/N) of the biochemical reaction tank MLSS at different water inflow' is shown in the table 3. The results in the table can directly show that the internal operation condition of the biochemical reaction tank has a certain fixed mode under the specific water inlet condition. For example, when the influent carbon nitrogen ratio is low, the MLSS value of the biochemical reaction tank is kept between 3600 and 3300 mg/L. With the increase of C/N, although the concentration value of MLSS is still between 3600 and 3300mg/L under most conditions, higher values up to 3800 to 4100mg/L are gradually appeared. Therefore, the reasonable operation range of the biochemical reaction tank can be judged, and a foundation is provided for follow-up optimal control and rationality inspection.
TABLE 3 data distribution of biochemical reaction tank MLSS under different carbon-nitrogen ratio (C/N) of water
By directly solving the Koopman matrix of the power system on the data, the corresponding Koopman matrix and the corresponding matrix eigenvalue can be obtained, and the dynamic characteristics of the power system can be reflected. The characteristic values are shown in fig. 5. From the graph, the characteristic values of the Koopman matrix of the power system corresponding to the biochemical reaction tank are all within a unit circle, and the distribution is concentrated at a position close to a real part of 1, so that the power system corresponding to the biochemical reaction tank has stability, and various state indexes gradually tend to be stable on the premise of no external interference for a long time.
Step three: and constructing a prediction deduction model of the Koopman-DL biochemical reaction tank.
And directly constructing a biochemical reaction tank state and water outlet prediction deduction model combining the Koopman matrix and the deep learning by integrating the analyzed related information and the modeling method. The model inputs water inflow data, biochemical reaction tank state data and control data (aeration and reflux quantity) of the biochemical reaction tank in the past Hydraulic Retention Time (HRT), and outputs the biochemical reaction tank state data and water quality data of water outflow in the future half an hour, and the model structure is shown in figure 2. The model is trained by means of Adam's algorithm, which is commonly used for deep learning. Model validation data is a certain period of time (total 50000 pieces of data from 5 months in 2020 to 21 months in 2020, 10 months in 2020), wherein training data is 1000 pieces of data selected randomly, test data is total 50000 pieces of data, and mean square error (mean square error, MSE) and Nash equilibrium coefficients (Nash-Sutcliffeefficiency coefficient, NSE) of results of testing and predicting water quality data are shown in Table 4. From the results, the Koopman-DL model can realize more accurate prediction by learning, and MSE and NSE of the prediction result reach 2.6358 and 0.995, thereby embodying the effectiveness of the method. And then, by adding random disturbance to the input in the test process, the prediction effect of the test model under the disturbance condition is used for verifying the reliability of the test model.
Table 4 Mean Square Error (MSE) and nash equalization coefficients (NSE) for each model prediction result.
Step four: model predictive control was constructed on the basis of Koopman-DL.
The Koopman-DL-MPC is directly used as a prediction model to be embedded into a model prediction control MPC structure, so that a model prediction control system of the biochemical reaction tank is established. The particle optimizing algorithm is adopted as an optimizing algorithm, the calculation time limit under the actual real-time control condition is considered, the calculation time of the optimizing algorithm is set to be not more than half an hour of the control time step, once the optimizing algorithm still has no convergence in 20min calculation, the algorithm is stopped, and the control instruction output of the current optimizing process is controlled. The optimization objective includes three aspects as above: the index of the biochemical reaction tank needs to be stabilized near the design working condition as much as possible; the water quality of the effluent meets the specified effluent index; the aeration rate and the drug addition amount need to be as small as possible.
And selecting a certain day time period corresponding to the historical data as a case to perform simulation control, and comparing the process result of the simulation optimization control with the actual control process to obtain a result shown in fig. 6 and 7. The result shows that the control process of the Koopman-DL-MPC has obvious fluctuation, but the aeration index is obviously reduced compared with the actual situation, and the state variables are all in a certain range, so that the optimization through an optimization algorithm can ensure the conditions, and the effectiveness of the method is proved.
Step five: the Koopman-DL-MPC is combined with a rationality checking method, so that the control safety is improved.
On the basis of the Koopman-DL-MPC, the output control instruction of each control time step is combined with a rationality check index to provide rationality check for the control of the Koopman-DL-MPC, so that the safety of the control of the Koopman-DL-MPC is improved. Data for the same time period were also selected for testing, with the relevant settings of the Koopman-DL-MPC unchanged. The control results obtained are shown in fig. 8 and 9. From the results in the figure, it can be seen that with the help of the rationality check, the control process is significantly more stable than before and the state variables remain within a certain range, thereby further improving the safety on the basis of ensuring optimal control.
The foregoing describes in detail preferred embodiments of the present invention. It should be understood that numerous modifications and variations can be made in accordance with the concepts of the invention by one of ordinary skill in the art without undue burden. Therefore, all technical solutions which can be obtained by logic analysis, reasoning or limited experiments based on the prior art by the person skilled in the art according to the inventive concept shall be within the scope of protection defined by the claims.

Claims (10)

1. A method for predicting deduction and controlling safety in real time of a biochemical reaction tank of a sewage treatment plant; the method is characterized by comprising the following steps based on a Koopman matrix and deep learning:
step 1, preprocessing original data of a biochemical reaction tank;
step 2, carrying out statistics and dynamic characteristic analysis on the biochemical reaction tank in a data driving mode;
step 3, constructing a prediction deduction model Koopman Deep Learning of a biochemical reaction tank based on a Koopman matrix and a deep learning method, namely Koopman-DL;
step 4, a biochemical reaction tank model prediction control method Koopman Deep Learning Model Predictive Control based on a Koopman-DL prediction deduction model is established, namely the Koopman-DL-MPC;
and 5, constructing a data-driven rationality and safety inspection method of the biochemical reaction tank Koopman-DL-MPC.
2. The method for predicting deduction and safe real-time control of a biochemical reaction tank of a sewage treatment plant according to claim 1, wherein in step 1, the raw data of the biochemical reaction tank is state data obtained by monitoring the biochemical reaction tank in real time;
the analysis and preprocessing comprises cleaning and normalizing the original data;
The cleaning refers to removing abnormal data caused by equipment maintenance events from the original data, removing noise and abnormal fluctuation from the original data by a time-averaged method, and the normalization is to map the data between-1 and-1 by calculation so as to facilitate subsequent analysis and modeling.
3. The method for predicting, deducing and controlling safety of a biochemical reaction tank of a sewage treatment plant according to claim 2, wherein in step 1, according to the original data combined with the time interval characteristics of the biochemical reaction tank, extreme abnormal data are removed, data supplementation is performed by an interpolation method, and data information is perfected by a normalization method, and the specific process is as follows:
step 1.1, sorting the original data, namely the data obtained by monitoring the biochemical reaction tank in real time according to the running time;
step 1.2, determining a time interval for cleaning the original data according to the hydraulic retention time of the biochemical reaction tank;
step 1.3, calculating the mean value and standard deviation of each data of the biochemical reaction tank in each time interval;
step 1.4, deleting extreme abnormal data exceeding 3 times of standard deviation in a time interval, and supplementing the extreme abnormal data through interpolation;
Step 1.5, carrying out normalization processing on the interpolated data so as to facilitate subsequent data analysis and modeling;
the calculation formula of the interpolation is as follows:
wherein i is a time node needing interpolation; datain i The i-th interpolation data obtained by calculation is used for replacing deleted data, the data is obtained by calculating the data of all TN time steps before and after the i-time node, and the time step of the time is represented by a variable j; DATA j The jth original data in each time interval is used for interpolation calculation; the set of all the interpolated Data is Data;
the normalization formula in step 1.5 is as follows:
wherein inorm represents a Data time node needing normalization, and Data inorm For the interpolated Data of inorm time step, max (Data) and min (Data) are the maximum and minimum values of the interpolated Data, dataNorm inorm Normalized data for the inorm time step; the set of all normalized data compositions is DataNorm.
4. The method for predicting deduction and safe real-time control of a biochemical reaction tank of a sewage treatment plant according to claim 1, wherein in the step 1, the raw data comprise COD, ammonia nitrogen, total phosphorus, water temperature and flow rate of a water inlet part of the biochemical reaction tank under different quarter and rainfall load conditions of the sewage treatment plant, and activated sludge of the biochemical reaction tank is mixed and suspended The concentration of floating solids MLSS, the dissolved oxygen concentration DO of anaerobic, anoxic and aerobic sections in the pool, the oxidation-reduction potential ORP and the nitrate nitrogen NO of the aerobic section 3 - Aeration quantity, medicine adding quantity, internal and external reflux flow and sludge discharging quantity of the biochemical reaction tank, and COD, total nitrogen and total phosphorus of the water outlet part of the biochemical reaction tank;
the original data are obtained through real-time online data monitoring, and the frequency is one piece of 10 minutes.
5. The method for predicting deduction and safe real-time control of biochemical reaction tank of sewage treatment plant according to claim 1, wherein in step 2, the data of biochemical reaction is subjected to statistics and dynamic characteristic analysis by adopting normalization data after cleaning;
the form of the input data comprises linear correlation analysis, nonlinear regression analysis, data probability distribution and conditional probability distribution estimation of the data and Koopman matrix analysis of a power system;
selecting characteristics affecting the biochemical reaction of the biochemical reaction tank according to linear correlation analysis and nonlinear regression analysis, analyzing the historical operation characteristics of the biochemical reaction tank from the data angle according to probability distribution and conditional probability distribution analysis conditions, and taking the characteristics and corresponding data as input data of a prediction deduction model; and providing a reference for the size of the Koopman matrix in a subsequent prediction model according to the dimension of the Koopman matrix, and simultaneously analyzing and judging the dynamic property of the sewage treatment A2O technical process according to the property of the Koopman matrix, for example, judging the stability of the system according to the characteristic value condition.
6. The method for predicting deduction and safe real-time control of biochemical reaction tank in a sewage treatment plant according to claim 5, wherein in step 2, the process of analyzing the dynamic process of the biochemical reaction is as follows:
step 2.1, analyzing and evaluating the linear correlation between each data item in the normalized data and the data item with time difference through linear correlation analysis, wherein the specific formula of the correlation coefficient calculation is as follows:
wherein r (DataNorm ) z+lt ) For two sets of data DataNorm and DataNorm z+lt The linear correlation coefficient obtained by calculation between the corresponding data items; z is a natural number of 1 or more, and represents a data number used for correlation verification; a natural number of 1 or more, representing a time difference for the correlation-check data; cov is the covariance of the data; var is the variance of the data;
step 2.2, using input and output of a prediction model as input and output of regression problems through nonlinear regression analysis, fitting by using collected data by means of a deep learning model, selecting according to different model inputs, a deep learning model structure and super parameters, and comparing to obtain a model input data item with the best fitting performance and a model structure;
The fitting process is shown in the following formula:
wherein Reg is a deep learning model that is regressed for fitting;
num represents the amount of data used for the nonlinear fitting;
k is a counting variable of data in regression calculation, from 1 to Num;
DataNorm k+1 and DataNorm k Is the input and output of the fitting;
θ is a parameter of the deep learning used by the regression model;
step 2.3, data probability distribution and conditional probability distribution estimation, analyzing and obtaining probability distribution of the data and conditional probability distribution of the data, thereby analyzing the historically operating characteristics of the biochemical reaction tank from the data perspective, and specifically comprising the following steps:
step 2.3.1, determining the maximum and minimum values of all data items according to the data, and dividing intervals between the minimum and maximum values;
step 2.3.2, counting the data quantity contained in each partition, and counting all the data to obtain the data quantity contained in each partition, thereby obtaining the probability distribution of the data, and directly obtaining the value range of each data item and the history condition of the biochemical reaction tank through the probability distribution;
step 2.3.3, screening data meeting a certain condition from the data, and counting the data quantity contained in each partition of the screened data to obtain the number of the data contained in each partition, thereby obtaining the conditional probability distribution of the data;
Step 2.4, combining Extended Dynamic Mode Decomposition, namely, an EDMD method, to obtain an approximate Koopman matrix and a characteristic value thereof from the original data, and obtaining the approximate matrix of the Koopman matrix in the observation function sense, wherein the approximate matrix can be obtained by solving the following optimization problem:
wherein G is an observation function;
k is a Koopman matrix to be solved, a reference is provided for the size of the Koopman matrix in a subsequent prediction model according to the dimension of the Koopman matrix, and meanwhile, the dynamic property of the sewage treatment A2O process can be analyzed and judged through the property of K, for example, the stability of the system is judged through the characteristic value condition of K;
DataNorm km+1 and DataNorm km For the data used for solving the Koopman matrix, data are obtained from the cleaned data;
numk is the total amount of data used to solve the Koopman matrix; km is a count variable from 1 to Numk for solving Koopman matrix usage data.
7. The method for predicting deduction and safety real-time control of a biochemical reaction tank of a sewage treatment plant according to claim 1, wherein in step 3, the characteristics are designed and selected as input data of a predicting deduction model by using the normalized data after cleaning and by means of the result of Koopman matrix dynamics characteristic analysis, and a deep learning model is constructed and trained to obtain the predicting deduction model;
The prediction deduction model comprises biochemical reaction tank data feature selection, super-parameter selection of a Koopman matrix and a deep learning model, model training and structure cross verification, model testing and model stability and reliability analysis;
the method comprises the following steps:
step 3.1, combining the result of nonlinear regression analysis and the cleaned data, and selecting the input information of the prediction deduction model as the input and output of the Koopman-DL prediction deduction model;
the input of the prediction deduction model is water inflow data, biochemical reaction tank state data and control data in a period of time in the current moment; each specific data is consistent with the data items screened by the regression model;
the output of the prediction deduction model is the water quality of the effluent and the state of a biochemical reaction tank in a future period; the model super-parameter reference nonlinear regression analysis selects parameters, and is debugged through cross verification; the specific formula is as follows:
wherein t represents the current time; lag is the predicted time span; x is X t ,...,X t+lag State variables from t to t+lag time; r is (r) t ,...r t+lag The water inflow variable is from t to t+lag time; a, a t ,...,a t+lag Controlling variables from t to t+lag time; preY t+lag+1 PreX for predicting effluent variables t+lay+1 For predicting state variables, both sets of data are from normalized data; Is depth spiritThrough a network, the method is used for approaching an observation function corresponding to a Koopman matrix; w is deep neural network->Is obtained through training; k is a Koopman matrix;
and 3.2, training the constructed prediction model by using the cleaning data, wherein the training is realized by minimizing a loss function, and the model training and the model testing are specifically shown as follows:
wherein t is a time node counter of training data, and from 1 to the number NumT of the training data; x is X t ,...,X t+lag State variables from t to t+lag time; r is (r) t ,...r t+lag The water inflow variable is from t to t+lag time; a, a t ,...,a t+lag Controlling variables from t to t+lag time; y is Y t+lag+1 To predict the true value of the effluent variable; x is X t+lag+1 Is the true value of the predicted state variable;
the optimization model is solved through a training algorithm Adam of a deep learning model, and the trained model can be used for prediction simulation of the dynamics of the biochemical reaction tank;
step 3.3, designing a super-parameter of the deep learning model part and a Koopman matrix training initial value and a matrix dimension of the Koopman matrix part based on the comparison result of the super-parameter of the regression model and the Koopman matrix, and further adjusting the super-parameter on the basis;
the model hyper-parameter adjustment is to test the initial values of different deep learning model structures and Koopman operators on the basis of the training process, and retraining is carried out by using the training algorithm every time of resetting to obtain a trained model calculation effect; by comparing the effects of the models under different superparameters and the initial value of the Koopman matrix, selecting a group with the best performance as a final model superparameter and the initial value of the Koopman matrix, using the corresponding model as a final Koopman-DL prediction deduction model, and using the model for prediction;
Step 3.4, carrying out robustness analysis on the prediction deduction model after training; the robustness analysis observes the variation range of the output of the disturbance input model with different degrees;
if the output of the predictive deduction model can be kept in a certain range under different random disturbance inputs, the trained predictive deduction model can be considered to have better robustness;
the specific calculation formula of the disturbance of different degrees is as follows:
where tc is the time node counter that increments the disturbance data,to add perturbed state data, X tc For status data +.>To add disturbed control data, a tc For controlling data +.>R for adding the disturbed water inflow data tc For the water inflow data, δ -N (μ, σ) is a normal distributed random disturbance that obeys a standard deviation of μ as the mean value σ.
8. The method for predicting deduction and safe real-time control of a biochemical reaction tank of a sewage treatment plant according to claim 1, wherein in step 4, a virtual real-time optimization control system of the biochemical reaction tank is constructed according to the predicting deduction model in combination with a model predicting control method model predictive control and an MPC;
the prediction control of the biochemical reaction tank model based on the deep learning prediction deduction model is as follows:
Step 4.1, constructing a standard model predictive control framework MPC; the model predictive control framework MPC is a biochemical reaction tank state and water outlet predictive model Koopman-DL based on a Koopman matrix and deep learning;
step 4.2, inputting the monitoring data of the biochemical reaction tank into a prediction model to predict the state of the biochemical reaction tank and the quality of the effluent;
step 4.3, scoring according to the prediction result and combining the control target, and taking the score as an optimized objective function; wherein the optimization objective includes three aspects: the index of the biochemical reaction tank needs to be stabilized near the design working condition as much as possible; the water quality of the effluent meets the specified effluent index; the aeration quantity is required to be as small as possible;
step 4.4, optimizing and adjusting control measures including aeration quantity, medicine adding quantity and internal and external reflux quantity in a future time step according to an optimization target by using an optimization algorithm so as to maximize a target function value;
step 4.5, obtaining an optimal control strategy in a time step in the future through repeated prediction and optimization, and controlling the optimal control strategy;
step 4.6, entering the next time step, and repeating the steps 4.1 to 4.5, thereby realizing real-time optimal control of the system;
The above process is described by the following time-step optimization model:
minJ+U+P
t∈{t 0 ,t 1 ,...,t M }
wherein t is time, lag is the time span of the predicted output variable; J. u, P the objective function corresponding to the above three objectives; xlow_bound, xup _bound, price_bound, yup _bound are upper and lower limits for biochemical reaction tank state variables and effluent indicators; abound is a target line for the control variable; x is X t 、Y t 、a t The method is used for inputting state variables, water outlet indexes and optimizing control variables; preX (PreX) t+lay+1 、PreY t+lay+1 The state variables and the water outlet indexes are predicted and output; lagk is a counter for optimizing control variables;
the model predictive control method reduces the total aeration amount and the medicine adding amount of the system as much as possible on the premise of ensuring that the effluent quality reaches the standard and the state of the biochemical reaction tank is stable, and realizes the optimal control and the energy-saving operation of the biochemical reaction tank.
9. The predictive modeling combined model predictive control method according to claim 8, wherein the control effect is evaluated by j+u+p, and the lower the j+u+p obtained in the control process is, the better the control effect is; any optimization algorithm may be used to solve the above-described optimization model, including but not limited to genetic algorithms, particle swarm algorithms, and the like; however, considering the characteristic of real-time control of the biochemical reaction tank, the optimization algorithm needs to increase the limit of calculation time when solving the optimization problem in each time step, and the optimization solving time should not exceed the time interval of control, namely the iterative steps of the optimization algorithm are calculated by the control time interval and the single optimization time, and the formula is as follows:
The step_opt is the iterative STEP number calculated by the optimization algorithm, Δt is the TIME interval of control, and time_opt is the TIME required for single iteration of the optimization algorithm.
10. The method for predicting deduction and safe real-time control of a biochemical reaction tank of a sewage treatment plant according to claim 8, wherein in step 5, on the basis of a virtual real-time optimal control system of the biochemical reaction tank, rationality and safety inspection of control instructions are added;
the rationality and safety inspection comprises range detection of control instructions, rationality inspection of control instructions based on historical data and control instruction control effect estimation based on a prediction deduction model;
the method comprises the following specific steps:
step 5.1, judging whether the current optimized control variable is in a manually specified range; the optimization control strategy obtained by the model predictive control Koopman-DL-MPC needs to be compared with relevant indexes in the operation standard of the A2O process of the sewage treatment plant manually specified, and whether the optimization control strategy is in the range specified by the standard is judged according to the comparison result; the method comprises the following specific steps:
step 5.1.1, directly counting historical control variable data and calculating the mean value and standard deviation of the historical control variable data;
And 5.1.2, directly adding and subtracting the number of the standard deviation of 3 times from the mean value as a reasonable range according to the principle of the standard deviation of 3 times of statistics, and directly checking whether the optimized control variable is kept within the range, wherein the calculation process of the upper limit and the lower limit can be calculated by the following formula:
wherein upper and lower are upper and lower limits calculated by the data; a, a h Historical data representing the control variable, and a total of NumA data; h is a counting variable used by the control variable data in calculating upper and lower limits;expressing the average value of the control variable data;
step 5.1.3, further calibrating the upper limit and the lower limit by combining recommended process parameters; finally, taking the intersection of the recommended process parameter range and the down and upper intervals as a final judgment range, namely considering that the current optimized control variable is in a manually specified range when the optimized control variable meets the following inequality condition:
aOPT∈[down,upper]∩[s down ,s upper ]
wherein aOPT represents the optimized control variable; [ Down, upper ]]Representing a range of values determined by down and upper; s is(s) down Sum s upper Is the recommended upper and lower limits of the process parameters; [ s ] down ,s upper ]Represented by s down Sum s upper A determined numerical range; n represents the portion where the two sets of ranges intersect; aOPT epsilon represents that the optimized control variable belongs to the set;
Step 5.2, judging whether the current optimized control variable is consistent with the similar situation in history; counting the conditional probability distribution of the control variable under the similar condition through the normalized historical data, and determining the reasonable upper and lower limit ranges of the control variable according to the principle of 3 times of standard deviation of statistics to judge;
the conditional probability distribution under the similar condition refers to the probability distribution condition of calculating the obtained optimized control variable at a certain moment, selecting the control data close to the water inlet variable and the state variable from the historical data by means of the water inlet variable and the state variable at the moment, and counting the control data; the judging data is judged by the vector distance, and the specific formula is as follows:
wherein X is s1 And X is s2 Two sets of state data representing the comparison required; r is (r) s1 And r s2 Two sets of water inflow data which need to be compared are represented; s1 and s2 are subscripts of two sets of data to be compared; when the distance is sufficiently small, then the two sets of data are considered to be close;
the reasonable upper and lower limit ranges of the control variables are similar to those in the step 5.1, and the only difference is that the data of the control variables are the data passing through screening;
the method comprises the following specific steps:
Step 5.2.1, comparing the current time state data and the water inlet data with the historical state data and the historical data at all times, and calculating the distance between each group of data through the distance formula;
step 5.2.2, setting the distance threshold value to be 0.2, and recording a control variable corresponding to historical data with similarity smaller than the threshold value to obtain 'control variable data in a condition similar to the current state in history';
step 5.2.3, calculating the screened data according to the step 5.1 to obtain a control variable judgment range of the conditional probability distribution under the similar condition; if the optimized control variable is within the range, the current optimized control variable is considered to be consistent with the similar situation in history, and the test of consistent with the similar situation in history is passed;
step 5.3, judging whether the control effect of the current optimized control variable is feasible or not; inputting the optimized control variable, the current time water inflow variable and the state variable into a Koopman-DL prediction model, and directly predicting to obtain the state variable and the water outflow variable at the future time so as to judge whether the control effect is feasible or not;
the method comprises the following specific steps:
step 5.3.1, taking the optimized control variable and the current time state as input of a deduction prediction model to perform one-step prediction;
Step 5.3.2, comparing the prediction result with the biochemical reaction tank operation standard; if the state variables including dissolved oxygen and MLSS are still kept in the specified range of the biochemical reaction tank and the effluent quality reaches the standard, the optimized control variables given at the current moment are considered to be reasonable and feasible and can be used as the control output of the system; otherwise, the control variables given at present can achieve the optimization effect by saving control factors such as aeration and the like;
step 5.4, judging the final safety rationality of the optimized control variable; if the optimized control variable passes the inspection in the steps 5.1-5.3, the control variable is considered to be safe and reasonable and can be used for actual control; otherwise, the risk of the optimized control variable is considered to exist, and the step 4 is returned to perform calculation again.
CN202311334398.8A 2023-10-16 2023-10-16 Prediction deduction and safe real-time control method for biochemical reaction tank of sewage treatment plant Pending CN117389142A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311334398.8A CN117389142A (en) 2023-10-16 2023-10-16 Prediction deduction and safe real-time control method for biochemical reaction tank of sewage treatment plant

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311334398.8A CN117389142A (en) 2023-10-16 2023-10-16 Prediction deduction and safe real-time control method for biochemical reaction tank of sewage treatment plant

Publications (1)

Publication Number Publication Date
CN117389142A true CN117389142A (en) 2024-01-12

Family

ID=89467830

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311334398.8A Pending CN117389142A (en) 2023-10-16 2023-10-16 Prediction deduction and safe real-time control method for biochemical reaction tank of sewage treatment plant

Country Status (1)

Country Link
CN (1) CN117389142A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117964023A (en) * 2024-04-01 2024-05-03 山东中研环保设备有限公司 Sewage treatment control system based on artificial intelligence algorithm control

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117964023A (en) * 2024-04-01 2024-05-03 山东中研环保设备有限公司 Sewage treatment control system based on artificial intelligence algorithm control

Similar Documents

Publication Publication Date Title
CN111291937A (en) Method for predicting quality of treated sewage based on combination of support vector classification and GRU neural network
Heddam et al. ANFIS-based modelling for coagulant dosage in drinking water treatment plant: a case study
CN109879410A (en) Sewage treatment aeration control system
Pisa et al. LSTM-based wastewater treatment plants operation strategies for effluent quality improvement
CN103903452A (en) Traffic flow short time predicting method
CN117389142A (en) Prediction deduction and safe real-time control method for biochemical reaction tank of sewage treatment plant
CN114275912B (en) Aeration system dissolved oxygen control method based on adaptive neural network model
CN108562709A (en) A kind of sewage disposal system water quality monitoring method for early warning based on convolution self-encoding encoder extreme learning machine
CN114757104B (en) Method for constructing hydraulic real-time regulation and control model of series gate group water transfer project
Wang et al. Reliable model of reservoir water quality prediction based on improved ARIMA method
CN112799310A (en) Method for urban drainage system simulation control mixed model based on mechanism model, concept model and data model of C language
CN113094988A (en) Data-driven slurry circulating pump operation optimization method and system
Zhang et al. Study on water quality prediction of urban reservoir by coupled CEEMDAN decomposition and LSTM neural network model
Grochowski et al. Supervised model predictive control of wastewater treatment plant
CN104914227A (en) Multi-gaussian kernel self-optimization relevance vector machine based wastewater quality soft-measurement method
CN111125907A (en) Sewage treatment ammonia nitrogen soft measurement method based on hybrid intelligent model
CN113627506A (en) Intelligent detection method for total phosphorus in effluent based on information fusion-interval two-type fuzzy neural network
CN116969616A (en) Soft measurement-based integrated sewage treatment facility control method, device and equipment
CN105160422A (en) Sewage treatment effluent total phosphorus prediction method based on self-organization cascade neural network
CN115356930B (en) Multi-objective optimization control system and method in sewage treatment process
CN116956156A (en) Sewage treatment intelligent aeration method and system based on artificial intelligence
CN111709585A (en) Air conditioner load prediction method and device and storage medium
CN116263850A (en) Online sewage water quality early warning method combining offline simulation data
CN115206444A (en) Optimal drug dosage prediction method based on FCM-ANFIS model
Huang et al. Modeling of a paper-making wastewater treatment process using a fuzzy neural network

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination