A data- and knowledge-driven intelligent detection method for total nitrogen removal amount
Through the intelligent detection method of total nitrogen removal driven by data and knowledge, the coordinated optimization algorithm is used to adjust the detection model parameters, which solves the problem of long detection time of total nitrogen concentration, real-time and accurate detection of total nitrogen removal is achieved, and the detection level of the sewage treatment process is improved.
Patent Information
- Application Number
- CN202211676768.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-26
- Publication Date
- 2025-08-01
- Estimated Expiration
- 2042-12-26
AI Technical Summary
In the prior art, the total nitrogen concentration detection time is long, which is difficult to meet the requirements of sewage treatment plants for real-time detection of total nitrogen concentration. It is difficult to fully express the operation characteristics of sewage treatment in a single information, resulting in the difficulty of obtaining the total nitrogen removal amount in real time.
Using data and knowledge-driven intelligent detection of total nitrogen removal, we can establish an intelligent detection model for total nitrogen removal by collecting data, constraint knowledge and semantic knowledge of the sewage treatment process, and dynamically adjust the detection model parameters using collaborative optimization algorithm to achieve rapid and accurate detection of total nitrogen removal.
Real-time detection of total nitrogen removal is achieved, detection accuracy is improved, real-time detection needs of sewage treatment plants for total nitrogen concentration, and detection level of sewage treatment process is improved.
Smart Images

Figure CN115905929B_ABST
Abstract
Description
Technical Field
[0001] The present invention designs an intelligent detection model for total nitrogen removal amount driven by data and knowledge. By collecting data, constraint knowledge, and semantic knowledge to describe the operating state from the sewage treatment process, an intelligent detection model for total nitrogen removal amount is established using data and knowledge, realizing the accurate detection of total nitrogen removal amount. This intelligent detection method for total nitrogen removal amount based on data and knowledge can online evaluate the sewage treatment performance by real-time detecting the total nitrogen removal amount, and belongs to the field of water treatment. Background Art
[0002] China is a country with severe water resource shortage. The per capita fresh water possession is about 2,200 cubic meters, only one-fourth of the world average level. At the same time, the water pollution problem has become a prominent problem restricting the sustainable development of China's economy and society. Therefore, implementing sewage treatment and realizing the reclamation and utilization of sewage are effective ways to meet the sustainable utilization of water resources.
[0003] Modeling the sewage treatment process is an important tool for measuring sewage treatment capacity. The sewage treatment process can treat the excessive organic matter in sewage through physical, chemical, and biological reaction processes, degrade and separate it from the sewage. The current main factors affecting the effluent water quality are pollutants such as nitrogen, phosphorus, and biochemical oxygen demand. For urban sewage treatment, it is very crucial to meet the standard of total nitrogen in the effluent. Quickly detecting the total nitrogen concentration, improving the sewage treatment capacity, and ensuring the effluent water quality meets the standard play a significant role in preventing water pollution and resource recycling. To evaluate the nitrogen removal capacity of the sewage treatment process, the total nitrogen removal amount is an important indicator for measuring the pros and cons of urban sewage treatment capacity. The total nitrogen removal amount is usually calculated based on the flow rate, influent total nitrogen concentration, and effluent total nitrogen concentration. For the detection of total nitrogen concentration, it is usually based on ultraviolet spectrophotometry, using reagents such as potassium hydrogen sulfate and sodium hydroxide for detection. Although this method has high detection accuracy and is the basis for the detection accuracy scale of other instruments, this method requires operations such as preparing relevant reagents, setting the detection environment, and comparative calculations. Its detection time is about 4 hours, which is difficult to meet the requirements of real-time detection of total nitrogen concentration in sewage treatment plants. Therefore, it is of great significance to study an intelligent total nitrogen concentration detection method, real-time evaluate the total nitrogen removal amount in the sewage treatment process, and improve the detection level of the sewage treatment process.
[0004] The present invention designs an intelligent detection method for total nitrogen removal amount driven by data and knowledge. This method collects data and knowledge of the sewage treatment process, establishes a detection model for total nitrogen removal amount based on process data, constraint knowledge, and semantic knowledge, and uses a cooperative optimization algorithm to update the parameters of the detection model, realizing the rapid and accurate detection of total nitrogen removal amount. Summary of the Invention
[0005] The present invention obtains an intelligent detection method for the total nitrogen removal amount driven by data and knowledge. This method describes the operating state of the sewage treatment process by collecting data, constraint knowledge, and semantic knowledge in the sewage treatment process, and uses a collaborative optimization algorithm based on data and semantic knowledge to adjust the parameters of the detection model, ensuring the accuracy of the extraction of the operating characteristics of the sewage treatment process and improving the detection accuracy of the total nitrogen removal amount.
[0006] The present invention adopts the following technical solutions and implementation steps:
[0007] An intelligent detection method for the total nitrogen removal amount driven by data and knowledge, characterized in that an intelligent detection model for the total nitrogen removal amount is established based on data, constraint knowledge, and semantic knowledge, and a collaborative optimization algorithm is used to dynamically adjust the parameters of the detection model to achieve accurate detection of the total nitrogen removal amount in the sewage treatment process. The specific steps are as follows:
[0008] (1) Data collection and knowledge expression of the sewage treatment process
[0009] The data of the sewage treatment process includes continuous data and switch data; the continuous data includes influent flow rate, chemical oxygen demand, oxidation-reduction potential of the anaerobic tank, oxidation-reduction potential of the anoxic tank, dissolved oxygen in the first aerobic tank, dissolved oxygen in the second aerobic tank, and temperature; the continuous data is normalized:
[0010]
[0011] where m = 1,..., 8; t = 1, 2,..., Z, Z is the total number of samples, B1(t) is the influent flow rate at time t, in cubic meters per hour, B2(t) is the chemical oxygen demand at time t, in milligrams per liter, B3(t) is the oxidation-reduction potential of the anaerobic tank at time t, in millivolts, B4(t) is the oxidation-reduction potential of the anoxic tank at time t, in millivolts, B5(t) is the dissolved oxygen concentration in the first aerobic tank at time t, in milligrams per liter, B6(t) is the dissolved oxygen concentration in the second aerobic tank at time t, in milligrams per liter, B7(t) is the temperature at time t, in degrees Celsius, B8(t) is the total nitrogen removal amount at time t, in kilograms per hour, B m,min is the minimum value of all samples of the mth variable, B m,maxis the maximum value of all samples of the m-th variable; x1(t) = b1(t) is the normalized influent flow rate at time t, x2(t) = b2(t) is the normalized chemical oxygen demand at time t, x3(t) = b3(t) is the normalized oxidation-reduction potential of the anaerobic tank at time t, x4(t) = b4(t) is the normalized oxidation-reduction potential of the anoxic tank at time t, x5(t) = b5(t) is the normalized dissolved oxygen concentration of the first aerobic tank at time t, x6(t) = b6(t) is the normalized dissolved oxygen concentration of the second aerobic tank at time t, x7(t) = b7(t) is the normalized temperature at time t; is the normalized actual total nitrogen removal amount at time t;
[0012] The switch-type data is the internal reflux pump frequency, and its states include on and off; 1 represents on, and 0 represents off; u(t) is the internal reflux pump frequency at time t;
[0013] The constraint knowledge of the sewage treatment process includes:
[0014] Constraint knowledge 1: If 14 ≤ l(t) ≤ 29, then 30 ≤ y(t) ≤ 250; Constraint knowledge 2: If 30 ≤ l(t) ≤ 45, then 0 ≤ y(t) ≤ 200; Constraint knowledge 3: If 0 ≤ l(t) ≤ 13 or 46 ≤ l(t) ≤ 95, then 30 ≤ y(t) ≤ 300; where, l(t) = mod(t, 96), mod() is the modulo operation, and y(t) is the predicted total nitrogen removal amount;
[0015] The semantic knowledge of the sewage treatment process includes:
[0016] Semantic knowledge 1: If the i-th continuous input variable x i (t) is the influent flow rate or chemical oxygen demand, then Δx i (t) > 0; Semantic knowledge 2: If the i-th continuous input variable x i (t) is the oxidation-reduction potential or dissolved oxygen, then Δx i (t) < 0; Semantic knowledge 3: If the switch-type input variable u(t) is the internal reflux pump frequency, then Δu(t) > 0; where, i = 1,..., 7, Δx i (t) is the derivative of the predicted total nitrogen removal amount y(t) with respect to the i-th continuous input variable x i (t), and Δu(t) is the derivative of the predicted total nitrogen removal amount y(t) with respect to the switch-type input variable u(t);
[0017] (2) Establishment of the intelligent detection model for total nitrogen removal amount
[0018] The output y(t) of the intelligent detection model for total nitrogen removal amount is calculated as follows:
[0019]
[0020] Among them, f k (t) is the continuous membership function of the k-th fuzzy rule, and c ik (t) is the center of the i-th continuous input of the k-th fuzzy rule at time t, and σ ik (t) is the width of the i-th continuous input of the k-th fuzzy rule at time t, and Y k (t) is the switching membership function of the k-th rule, and a k (t) is the coefficient of the switching input of the k-th fuzzy rule at time t, and w k (t) is the weight of the k-th fuzzy rule at time t, and d k (f k (t), Y k (t)) is the output of the k-th fuzzy rule;
[0021] (3) Updating the parameters of the intelligent detection model based on the cooperative optimization algorithm
[0022] ① Initialize the intelligent detection model: Set the sliding window length to 16, and the starting element at the leftmost side of the sliding window is the first group of samples, i.e., t = 1; The initial iteration number g = 1, and the maximum iteration number is 50; The center of the first iteration at the initial time is randomly selected in [0, 1], and the width coefficient weight
[0023] ② Set the input matrix Q of the sliding window at time t t = [q(t), q(t + 1), …, q(t + 15)], q(t) = [x1(t), x2(t), …, x7(t), u(t)] T , where T is the transpose operation; Set the output matrix of the sliding window at time t
[0024] ③ Initially select the first column of the input matrix Q at time t t , i.e., s = 1;
[0025] ④ Take the s-th column of Q at time t t as the input of the detection model, and use formulas (2)-(5) to obtain the output y s (t) of the corresponding model;
[0026] ⑤ Update the parameters of the detection model based on data and semantic knowledge
[0027] Calculate the derivative Δx of the predicted total nitrogen removal value y s (t) with respect to the i-th continuous input variable x i (t) i(t); According to semantic knowledge 1, judge whether Δx1(t)>0 and Δx2(t)>0 hold; according to semantic knowledge 2, judge whether Δx3(t)<0, Δx4(t)<0, Δx5(t)<0 and Δx6(t)<0 hold; if none of Δx1(t), …, Δx6(t) hold, then set β = 1, otherwise, β = 0; the parameter update formula is as follows:
[0028]
[0029] Among them, is the center of the s-th update at time t, is the width of the s-th update at time t, η1 is the learning rate based on data information, η2 is the learning rate based on semantic knowledge, λ1 = -1, λ2 = -1, λ3 = 1, λ4 = 1, λ5 = 1, λ6 = 1, λ7 = 0; the error of the s-th group of samples at time t is the derivative of the total nitrogen removal amount prediction value with respect to the center, is the derivative of the total nitrogen removal amount prediction value with respect to the width, is Δx i (t) with respect to the derivative of the center, is Δx i (t) with respect to the derivative of the width;
[0030] Calculate the derivative Δu(t) of the total nitrogen removal amount prediction output y s (t) with respect to the switched input variable u(t); according to semantic knowledge 3, judge whether Δu(t)>0 holds; if it does not hold, then set β = 1, otherwise, β = 0; the parameter update formula is as follows:
[0031]
[0032] Among them, is the coefficient of the s-th update at time t, is the weight of the s-th update at time t, is the derivative of the total nitrogen removal amount prediction value with respect to the coefficient, is the derivative of the total nitrogen removal amount prediction value with respect to the weight, (t) is the derivative of Δu(t) with respect to the coefficient;
[0033] ⑥ If s < 16, increase s by 1 and go to step ④; if the number of iterations s ≥ 16, go to step ⑦;
[0034] ⑦ If the number of iterations g < 50, increase g by 1 and go to step ③; if the number of iterations g ≥ 50, go to step (4);
[0035] (4) Intelligent Detection of Total Nitrogen Removal Amount Based on Detection Model
[0036] First, using the total nitrogen removal amount detection model, take the influent flow rate, chemical oxygen demand, oxidation-reduction potential of the anaerobic tank, oxidation-reduction potential of the anoxic tank, dissolved oxygen of the first aerobic tank, dissolved oxygen of the second aerobic tank, and temperature at the next moment of the rightmost element of the sliding window as the input of the total nitrogen removal amount intelligent detection model, and calculate the output of the model according to formulas (2)-(5), which is the detected value y(t + 16) of the total nitrogen removal amount; secondly, calculate the value of l(t + 16); if 14 ≤ l(t + 16) ≤ 29, then according to constraint knowledge 1, if y(t + 16) < 30, then let y(t + 16) be 30, if y(t + 16) > 250, then let y(t + 16) be 250; if 30 ≤ l(t + 16) ≤ 45, then according to constraint knowledge 2, if y(t + 16) < 0, then let y(t + 16) be 0, if y(t + 16) > 200, then let y(t + 16) be 200; if 0 ≤ l(t) ≤ 13 or 46 ≤ l(t) ≤ 95, then according to constraint knowledge 3, if y(t + 16) < 30, then let y(t + 16) be 30, if y(t + 16) > 300, then let y(t + 16) be 300;
[0037] If t ≤ Z - 16, set the number of iterations g = 1, the parameter vector Increase the time t by 1, and turn to step ② in (3); otherwise, the detection of the total nitrogen removal amount ends.
[0038] The creativity of the present invention is mainly reflected in:
[0039] (1) Aiming at the problem that the traditional total nitrogen concentration detection period is long and it is difficult to obtain the total nitrogen removal amount in real time, the present invention proposes an intelligent detection method for the total nitrogen removal amount, which solves the problem of difficult real-time detection of the total nitrogen removal amount;
[0040] (2) Aiming at the problem that single information is difficult to comprehensively express the operation characteristics of sewage treatment, the present invention proposes a data and knowledge-driven detection model, which guides the parameter learning process of the model based on data and semantic knowledge, and improves the detection accuracy of the model. Description of the Drawings
[0041] Figure 1 is the training root mean square error graph of the intelligent detection method for the total nitrogen removal amount of the present invention;
[0042] Figure 2 is the total nitrogen removal amount prediction result graph of the intelligent detection method of the present invention, where the solid line is the actual output value of the total nitrogen removal amount, and the dotted line is the predicted value of the total nitrogen removal amount based on the intelligent detection model;
[0043] Figure 3It is the prediction error graph of the total nitrogen removal amount of the intelligent detection method of the present invention; Specific embodiments
[0044] The experimental data come from the actual data of a sewage treatment plant in November 2021; the influent flow rate, chemical oxygen demand, oxidation-reduction potential of the anaerobic tank, oxidation-reduction potential of the anoxic tank, dissolved oxygen in the first aerobic tank, dissolved oxygen in the second aerobic tank, temperature, internal reflux pump frequency, and total nitrogen removal amount are respectively taken as experimental samples, and 960 groups of available data are left after excluding abnormal samples.
[0045] The present invention adopts the following technical solutions and implementation steps:
[0046] An intelligent detection method for total nitrogen removal amount driven by data and knowledge, characterized in that an intelligent detection model for total nitrogen removal amount is established based on data, constraint knowledge, and semantic knowledge, and a collaborative optimization algorithm is used to dynamically adjust the parameters of the detection model to achieve accurate detection of the total nitrogen removal amount in the sewage treatment process, specifically including the following steps:
[0047] (1) Data collection and knowledge expression in the sewage treatment process
[0048] The data in the sewage treatment process include continuous data and switch data; the continuous data include influent flow rate, chemical oxygen demand, oxidation-reduction potential of the anaerobic tank, oxidation-reduction potential of the anoxic tank, dissolved oxygen in the first aerobic tank, dissolved oxygen in the second aerobic tank, and temperature; the continuous data are normalized:
[0049]
[0050] where m = 1,…,8; t = 1,2,...,960, 960 is the total number of samples, B1(t) is the influent flow rate at time t, in cubic meters per hour, B2(t) is the chemical oxygen demand at time t, in milligrams per liter, B3(t) is the oxidation-reduction potential of the anaerobic tank at time t, in millivolts, B4(t) is the oxidation-reduction potential of the anoxic tank at time t, in millivolts, B5(t) is the dissolved oxygen concentration in the first aerobic tank at time t, in milligrams per liter, B6(t) is the dissolved oxygen concentration in the second aerobic tank at time t, in milligrams per liter, B7(t) is the temperature at time t, in degrees Celsius, B8(t) is the total nitrogen removal amount at time t, in kilograms per hour, B m,min is the minimum value of all samples of the mth variable, B m,maxis the maximum value of all samples of the m-th variable; x1(t) = b1(t) is the normalized influent flow rate at time t, x2(t) = b2(t) is the normalized chemical oxygen demand at time t, x3(t) = b3(t) is the normalized oxidation-reduction potential of the anaerobic tank at time t, x4(t) = b4(t) is the normalized oxidation-reduction potential of the anoxic tank at time t, x5(t) = b5(t) is the normalized dissolved oxygen concentration of the first aerobic tank at time t, x6(t) = b6(t) is the normalized dissolved oxygen concentration of the second aerobic tank at time t, x7(t) = b7(t) is the normalized temperature at time t; is the normalized actual total nitrogen removal amount at time t;
[0051] The switch-type data is the internal reflux pump frequency, and its states include on and off; 1 represents on, and 0 represents off; u(t) is the internal reflux pump frequency at time t;
[0052] The constraint knowledge of the sewage treatment process includes:
[0053] Constraint knowledge 1: If 14 ≤ l(t) ≤ 29, then 30 ≤ y(t) ≤ 250; Constraint knowledge 2: If 30 ≤ l(t) ≤ 45, then 0 ≤ y(t) ≤ 200; Constraint knowledge 3: If 0 ≤ l(t) ≤ 13 or 46 ≤ l(t) ≤ 95, then 30 ≤ y(t) ≤ 300; where, l(t) = mod(t, 96), mod() is the modulo operation, and y(t) is the predicted value of the total nitrogen removal amount;
[0054] The semantic knowledge of the sewage treatment process includes:
[0055] Semantic knowledge 1: If the i-th continuous input variable x i (t) is the influent flow rate or the chemical oxygen demand, then Δx i (t) > 0; Semantic knowledge 2: If the i-th continuous input variable x i (t) is the oxidation-reduction potential or the dissolved oxygen, then Δx i (t) < 0; Semantic knowledge 3: If the switch-type input variable u(t) is the internal reflux pump frequency, then Δu(t) > 0; where, i = 1,..., 7, Δx i (t) is the derivative of the predicted value y(t) of the total nitrogen removal amount with respect to the i-th continuous input variable x i (t), and Δu(t) is the derivative of the predicted value y(t) of the total nitrogen removal amount with respect to the switch-type input variable u(t);
[0056] (2) Establishment of the intelligent detection model for total nitrogen removal amount
[0057] The output y(t) of the intelligent detection model for total nitrogen removal amount is calculated as follows:
[0058]
[0059]
[0060] where f k (t) is the continuous membership function of the k-th fuzzy rule, and c ik (t) is the center of the i-th continuous input of the k-th fuzzy rule at time t, and σ ik (t) is the width of the i-th continuous input of the k-th fuzzy rule at time t, and Y k (t) is the switching membership function of the k-th rule, and a k (t) is the coefficient of the switching input of the k-th fuzzy rule at time t, and w k (t) is the weight of the k-th fuzzy rule at time t, and d k (f k (t), Y k (t)) is the output of the k-th fuzzy rule;
[0061] (3) Updating the parameters of the intelligent detection model based on the collaborative optimization algorithm
[0062] ① Initialize the intelligent detection model: Set the sliding window length to 16, and the starting element on the leftmost side of the sliding window is the first group of samples, i.e., t = 1; The initial iteration number g = 1, and the maximum iteration number is 50; The center of the first iteration at the initial time is randomly selected in [0, 1], the width the weight and the coefficient k = 1, …, 6; k = 1, …, 6;
[0063] ② Set the input matrix Q of the sliding window at time t t = [q(t), q(t + 1), …, q(t + 15)], q(t) = [x1(t), x2(t), …, x7(t), u(t)] T , where T represents the transpose operation; Set the output matrix of the sliding window at time t
[0064] ③ Initially select the first column of the input matrix Q at time t t , i.e., s = 1;
[0065] ④ Use the s-th column of Q at time t t as the input of the detection model, and obtain the output y s (t) of the corresponding model using formulas (9)-(12);
[0066] ⑤ Update the parameters of the detection model based on data and semantic knowledge
[0067] Calculate the predicted value y of the total nitrogen removal s(t) The derivative Δx i (t) of the i-th continuous input variable x i (t); According to semantic knowledge 1, judge whether Δx1(t)>0 and Δx2(t)>0 hold; According to semantic knowledge 2, judge whether Δx3(t)<0, Δx4(t)<0, Δx5(t)<0 and Δx6(t)<0 hold; If none of Δx1(t), …, Δx6(t) hold, then β = 1, otherwise, β = 0; The parameter update formula is:
[0068]
[0069] where, is the center of the s-th update at time t, is the width of the s-th update at time t, η1 is the learning rate based on data information, η2 is the learning rate based on semantic knowledge, λ1 = -1, λ2 = -1, λ3 = 1, λ4 = 1, λ5 = 1, λ6 = 1, λ7 = 0; The error of the s-th group of samples at time t is the derivative of the total nitrogen removal amount prediction value with respect to the center, is the derivative of the total nitrogen removal amount prediction value with respect to the width, is the derivative of Δx i (t) with respect to the center, is the derivative of Δx i (t) with respect to the width;
[0070] Calculate the derivative Δu(t) of the total nitrogen removal amount prediction output y s (t) with respect to the switch input variable u(t); According to semantic knowledge 3, judge whether Δu(t)>0 holds; If it does not hold, then set β = 1, otherwise, β = 0; The parameter update formula is as follows:
[0071]
[0072] where, is the coefficient of the s-th update at time t, is the weight of the s-th update at time t, is the derivative of the total nitrogen removal amount prediction value with respect to the coefficient, is the derivative of the total nitrogen removal amount prediction value with respect to the weight, (t) is the derivative of Δu(t) with respect to the coefficient;
[0073] ⑥ If s < 16, increase s by 1 and go to step ④; If the number of iterations s ≥ 16, go to step ⑦;
[0074] ⑦ If the number of iterations g < 50, increase g by 1 and go to step ③; if the number of iterations g ≥ 50, go to step (4);
[0075] (4) Intelligent detection of the total nitrogen removal amount based on the detection model
[0076] Using the total nitrogen removal amount detection model, taking the influent flow rate, chemical oxygen demand, oxidation-reduction potential of the anaerobic tank, oxidation-reduction potential of the anoxic tank, dissolved oxygen of the first aerobic tank, dissolved oxygen of the second aerobic tank, and temperature at the next moment of the rightmost element of the sliding window as the input of the total nitrogen removal amount intelligent detection model, and calculating the output of the model according to formulas (9)-(12) as the detection value y(t + 16) of the total nitrogen removal amount;
[0077] Calculate the value of l(t + 16); if 14 ≤ l(t + 16) ≤ 29, then according to constraint knowledge 1, if y(t + 16) < 30, then set y(t + 16) to 30, if y(t + 16) > 250, then set y(t + 16) to 250; if 30 ≤ l(t + 16) ≤ 45, then according to constraint knowledge 2, if y(t + 16) < 0, then set y(t + 16) to 0, if y(t + 16) > 200, then set y(t + 16) to 200; if 0 ≤ l(t) ≤ 13 or 46 ≤ l(t) ≤ 95, then according to constraint knowledge 3, if y(t + 16) < 30, then set y(t + 16) to 30, if y(t + 16) > 300, then set y(t + 16) to 300;
[0078] If t ≤ 944, set the number of iterations g = 1, the parameter vector Increase the time t by 1 and go to step ② in (3); otherwise, the detection of the total nitrogen removal amount ends;
[0079] Using the total nitrogen removal amount intelligent detection method, the root mean square error for training is as Figure 1 , X-axis: number of samples, unit is piece, Y-axis: training root mean square error. The prediction result of the total nitrogen removal amount is as Figure 2 shown, X-axis: number of samples, unit is piece, Y-axis: predicted output of the total nitrogen removal amount, unit is kg / hour, the solid line is the actual output value of the total nitrogen removal amount, and the dashed line is the predicted value of the total nitrogen removal amount based on the intelligent detection model; the error between the actual output and the test output of the total nitrogen removal amount is as Figure 3 , X-axis: number of samples, unit is piece, Y-axis: prediction error of the total nitrogen removal amount, unit is kg / hour.
Claims
1. An intelligent detection method for total nitrogen removal amount driven by data and knowledge, characterized in that, It includes the following steps: (1) Data collection and knowledge expression of the sewage treatment process The data of the sewage treatment process includes continuous data and switch data; the continuous data includes influent flow, chemical oxygen demand, oxidation-reduction potential of the anaerobic tank, oxidation-reduction potential of the anoxic tank, dissolved oxygen of the first aerobic tank, dissolved oxygen of the second aerobic tank, and temperature; normalize the continuous data: where m = 1, …, 8; t = 1, 2, …, Z, Z is the total number of samples, B1(t) is the influent flow rate at time t, with the unit of cubic meters per hour, B2(t) is the chemical oxygen demand at time t, with the unit of milligrams per liter, B3(t) is the oxidation-reduction potential of the anaerobic tank at time t, with the unit of millivolts, B4(t) is the oxidation-reduction potential of the anoxic tank at time t, with the unit of millivolts, B5(t) is the dissolved oxygen concentration of the first aerobic tank at time t, with the unit of milligrams per liter, B6(t) is the dissolved oxygen concentration of the second aerobic tank at time t, with the unit of milligrams per liter, B7(t) is the temperature at time t, with the unit of degrees Celsius, B8(t) is the total nitrogen removal amount at time t, with the unit of kilograms per hour, B m,min is the minimum value of all samples of the m-th variable, B m,max is the maximum value of all samples of the m-th variable; x1(t) = b1(t) is the normalized influent flow rate at time t, x2(t) = b2(t) is the normalized chemical oxygen demand at time t, x3(t) = b3(t) is the normalized oxidation-reduction potential of the anaerobic tank at time t, x4(t) = b4(t) is the normalized oxidation-reduction potential of the anoxic tank at time t, x5(t) = b5(t) is the normalized dissolved oxygen concentration of the first aerobic tank at time t, x6(t) = b6(t) is the normalized dissolved oxygen concentration of the second aerobic tank at time t, x7(t) = b7(t) is the normalized temperature at time t; is the normalized actual total nitrogen removal amount at time t; The switch data is the frequency of the internal reflux pump, and its states include on and off; 1 represents on, and 0 represents off; u(t) is the frequency of the internal reflux pump at time t; The constraint knowledge of the sewage treatment process includes: Constraint knowledge 1: If 14 ≤ l(t) ≤ 29, then 30 ≤ y(t) ≤ 250; Constraint knowledge 2: If 30 ≤ l(t) ≤ 45, then 0 ≤ y(t) ≤ 200; Constraint knowledge 3: If 0 ≤ l(t) ≤ 13 or 46 ≤ l(t) ≤ 95, then 30 ≤ y(t) ≤ 300; where l(t) = mod(t, 96), mod() is the modulo operation, and y(t) is the predicted value of the total nitrogen removal amount; The semantic knowledge of the sewage treatment process includes: Semantic knowledge 1: If the i-th continuous input variable x i (t) is the influent flow rate or chemical oxygen demand, then Δx i (t)>0; Semantic knowledge 2: If the i-th continuous input variable x i (t) is the redox potential or dissolved oxygen, then Δx i (t)<0; Semantic knowledge 3: If the switching input variable u(t) is the internal reflux pump frequency, then Δu(t)>0; where i = 1, …, 7, Δx i (t) is the derivative of the total nitrogen removal prediction value y(t) with respect to the i-th continuous input variable x i (t), and Δu(t) is the derivative of the total nitrogen removal prediction value y(t) with respect to the switching input variable u(t). (2) Establishment of the intelligent detection model for the total nitrogen removal amount The output y(t) of the intelligent detection model for the total nitrogen removal amount is calculated as follows: where, f k (t) is the continuous membership function of the k-th fuzzy rule, c ik (t) is the center of the i-th continuous input of the k-th fuzzy rule at time t, σ ik (t) is the width of the i-th continuous input of the k-th fuzzy rule at time t, Y k (t) is the switching membership function of the k-th rule, a k (t) is the coefficient of the switching input of the k-th fuzzy rule at time t, w k (t) is the weight of the k-th fuzzy rule at time t, d k (f k (t), Y k (t)) is the output of the k-th fuzzy rule; (3) Parameter update of the intelligent detection model based on the collaborative optimization algorithm ① Initialize the intelligent detection model: Set the sliding window length to 16, and the starting element on the leftmost side of the sliding window is the first group of samples, i.e., t = 1; The initial iteration number g = 1, and the maximum iteration number is 50; The center of the first iteration at the initial moment Randomly take values in [0,1], and the width Coefficient Weight ② Set the input matrix Q of the sliding window at time t t = [q(t), q(t + 1), …, q(t + 15)], where q(t) = [x1(t), x2(t), …, x7(t), u(t)] T , T represents the transpose operation; set the output matrix of the sliding window at time t ③ Initially select the first column of the input matrix Q at time t, i.e., s = 1; t ④Take the Q at time t t in the s-th column as the input of the detection model, and obtain the output y s (t) of the corresponding model using formulas (2)-(5); ⑤ Update the parameters of the detection model based on the data and semantic knowledge Calculate the predicted value y of the total nitrogen removal amount s (t) for the derivative Δx i (t) of the i-th continuous input variable x i (t); according to semantic knowledge 1, judge whether Δx1(t)>0 and Δx2(t)>0 hold; according to semantic knowledge 2, judge whether Δx3(t)<0, Δx4(t)<0, Δx5(t)<0 and Δx6(t)<0 hold; if none of Δx1(t), …, Δx6(t) hold, then set β = 1, otherwise, β = 0; the parameter update formula is as follows: Among them, is the center updated for the s-th time at time t, is the width updated for the s-th time at time t, η1 is the learning rate based on data information, η2 is the learning rate based on semantic knowledge, λ1 = -1, λ2 = -1, λ3 = 1, λ4 = 1, λ5 = 1, λ6 = 1, λ7 = 0; the error of the s-th group of samples at time t is the actual total nitrogen removal amount of the s-th group of samples at time t; is the derivative of the predicted total nitrogen removal amount with respect to the center, is the derivative of the predicted total nitrogen removal amount with respect to the width, is Δx i (t) derivative with respect to the center, is Δx i (t) derivative with respect to the width; Calculate the predicted output y of the total nitrogen removal amount s (t), the derivative Δu(t) of the switching input variable u(t); according to semantic knowledge 3, determine whether Δu(t)>0 holds; if it does not hold, set β = 1, otherwise, β = 0; the parameter update formula is as follows: Among them, is the coefficient updated for the s-th time at time t, is the weight updated for the s-th time at time t, is the derivative of the predicted total nitrogen removal amount with respect to the coefficient, is the derivative of the predicted total nitrogen removal amount with respect to the weight, is the derivative of Δu(t) with respect to the coefficient; ⑥ If s < 16, increase s by 1 and go to step ④; if the number of iterations s ≥ 16, go to step ⑦; ⑦ If the number of iterations g < 50, increase g by 1 and go to step ③; if the number of iterations g ≥ 50, go to step (4); (4) Intelligent detection of the total nitrogen removal amount based on the detection model First, use the total nitrogen removal amount detection model, take the influent flow, chemical oxygen demand, oxidation-reduction potential of the anaerobic tank, oxidation-reduction potential of the anoxic tank, dissolved oxygen of the first aerobic tank, dissolved oxygen of the second aerobic tank, and temperature at the next moment of the rightmost element of the sliding window as the input of the intelligent detection model for the total nitrogen removal amount, and calculate the output of the model according to formulas (2)-(5) as the detection value y(t + 16) of the total nitrogen removal amount; secondly, calculate the value of l(t + 16); if 14 ≤ l(t + 16) ≤ 29, then according to constraint knowledge 1, if y(t + 16) < 30, then let y(t + 16) be 30, if y(t + 16) > 250, then let y(t + 16) be 250; if 30 ≤ l(t + 16) ≤ 45, then according to constraint knowledge 2, if y(t + 16) < 0, then let y(t + 16) be 0, if y(t + 16) > 200, then let y(t + 16) be 200; if 0 ≤ l(t) ≤ 13 or 46 ≤ l(t) ≤ 95, then according to constraint knowledge 3, if y(t + 16) < 30, then let y(t + 16) be 30, if y(t + 16) > 300, then let y(t + 16) be 300; If t ≤ Z - 16, set the number of iterations g = 1, and the parameter vector Increment the time t by 1 and go to step ② in (3); otherwise, the total nitrogen removal amount detection ends.