Wastewater treatment plant modeling method and system based on physical information neural network

By using a modeling method based on physical information neural networks, combined with data and physical constraints, the changes in the biochemical characteristics of the wastewater treatment system are dynamically captured, solving the problem of inaccurate predictions in traditional static models under unsteady conditions and achieving lower operating energy consumption.

CN121480276APending Publication Date: 2026-02-06SHANGHAI HUAYI ENVIRONMENTAL PROTECTION TECH CO LTD +1
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202511603117.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-04
Publication Date
2026-02-06

Smart Images

  • Figure CN121480276A_ABST
    Figure CN121480276A_ABST
Patent Text Reader

Abstract

The invention discloses a wastewater treatment plant modeling method and system based on a physical information neural network. The method comprises the following steps: acquiring and inputting working condition parameters and inlet water quality data to a neural network model, and performing forward calculation to obtain predicted outlet water state variables and key kinetic parameters; determining a first deviation based on a difference value between the predicted effluent and an actual measurement value, and substituting the predicted variable and the parameter into an activated sludge mechanism differential equation set to calculate a residual error so as to obtain a second deviation; performing weighted summation on the two deviations to form a total optimization target, and performing iterative training according to the total optimization target to obtain a final model; different working condition parameters are substituted into the model for multiple times of forward deduction, and finally in combination with energy consumption data, the working condition with the lowest energy consumption meeting the effluent standard is determined as the optimal process control parameter. By implementing the technical scheme provided by the invention, the actual operation energy consumption meeting the effluent quality standard is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of neural networks, and in particular to a wastewater treatment plant modeling method and system based on physical information neural networks. BACKGROUND

[0002] At present, wastewater treatment is a key link to ensure water environment safety and promote sustainable use of water resources. How to ensure long-term stable and standard wastewater quality and maximize the reduction of operation cost has become a core issue.

[0003] In related technologies, the internationally recognized activated sludge model (ASM) is usually selected as the basic framework, and the operation monitoring data accumulated for a long time in the wastewater treatment plant is used to calibrate and verify the biological kinetics and stoichiometry parameters involved in the model, so that the simulation output of the model can as accurately as possible reproduce the actual biochemical reaction process. Then, this fully calibrated mechanism model is used to carry out a large number of offline simulation deductions by using advanced optimization tools such as genetic algorithm, so as to explore the minimum energy consumption control strategy that meets the effluent standard under different influent conditions.

[0004] However, in related technologies, since the calibration process relies on historical data sets, the determined internal kinetic parameters of the model are a set of static constant values representing the average state of history. When the wastewater treatment system encounters a sudden impact of high-load industrial wastewater or seasonal changes, resulting in a drift of the microbial population structure that is not fully reflected in the historical data, it is difficult for this set of fixed parameters to accurately reflect the dynamic changes of biochemical reaction characteristics in real time. Therefore, the optimization deduction based on the static model will reduce the reliability of the energy-saving control strategy in guiding real production when facing such non-steady-state conditions, resulting in unnecessary energy consumption due to safety redundancy. SUMMARY

[0005] The present application provides a wastewater treatment plant modeling method and system based on physical information neural networks, for reducing the actual operation energy consumption under the condition of meeting the effluent water quality standard.

[0006] In a first aspect of the present application, a wastewater treatment plant modeling method based on physical information neural networks is provided, which comprises: The operation data of the sewage treatment process are acquired, and the operation data include working condition parameters, influent water quality data, actual effluent water quality measurement values, and energy consumption data corresponding to the working condition parameters; the working condition parameters and the influent water quality data are input into a neural network model with preset initial network parameters, forward calculation is performed, predicted effluent water quality state variables and predicted key kinetic parameters are obtained; a first deviation is determined based on a difference between the predicted effluent water quality state variables and the actual effluent water quality measurement values; the predicted effluent water quality state variables and the predicted key kinetic parameters are substituted into a preset differential equation set of an activated sludge reaction mechanism, a calculation residual obtained by calculation is determined as a second deviation; the first deviation and the second deviation are weighted and summed to obtain a total optimization target; based on the total optimization target, internal network parameters of the neural network model are iteratively adjusted until a value of the total optimization target is less than a preset convergence threshold, and a final neural network model is obtained; different working condition parameters in the operation data are taken as inputs and substituted into the final neural network model, multiple forward inferences are performed, and multiple groups of predicted effluent water quality results respectively corresponding to different working condition parameters are obtained; based on the multiple groups of predicted effluent water quality results, in combination with the energy consumption data, working condition parameters corresponding to the lowest energy consumption when a preset effluent water quality standard is met are determined as optimal process control parameters.

[0007] In the above embodiment, the neural network model is used to simultaneously predict the effluent water quality and the key kinetic parameters as the core technical features, and the data and physical double deviations are constructed to perform joint constraint: the first deviation (data deviation) ensures that the model output fits the actual measurement value, and the second deviation (physical residual) forces the model-predicted dynamic parameters to comply with the physical law of biochemical reaction through the preset mechanism differential equation set. The training method driven by the data and mechanism in combination enables the final model to dynamically capture the real-time biochemical characteristic changes of the system caused by influent shock or seasonal changes, thereby solving the defects of the traditional static model, such as the decrease in reliability when facing non-steady-state working conditions due to parameter solidification, and further making the energy-saving control strategy obtained by optimization inference more accurate and reliable, and finally achieving lower actual operation energy consumption while ensuring that the effluent meets the standard.

[0008] In combination with some embodiments of the first aspect, in some embodiments, the predicted effluent water quality state variables and the predicted key kinetic parameters are substituted into the preset differential equation set of the activated sludge reaction mechanism, and a calculation residual obtained by calculation is determined as the second deviation, and specifically includes: The change rate of the influent flow in the working condition parameters and the change rate of the characteristic pollutant concentration in the influent water quality data are monitored in real time, and the product of the change rate of the characteristic pollutant concentration and the change rate of the influent flow is calculated to obtain a dynamic hydraulic shock index; the physical process inhibition factor is multiplied by the biochemical reaction term in the differential equation set to obtain a physical constraint equation; the predicted effluent water quality state variables and the predicted key kinetic parameters are substituted into the physical constraint equation, an equation residual is calculated, and the equation residual is determined as the second deviation.

[0009] In the above embodiment, by calculating the product of the inflow rate and the concentration change rate of the pollutants in real time, a dynamic hydraulic impact index quantifying the hydraulic impact intensity is constructed, and a physical process inhibition factor inversely proportional to the impact index is derived. Multiplying the factor into the mechanism differential equation set makes the second deviation as a physical constraint to dynamically simulate the real process that the biochemical reaction rate is inhibited by physical flushing under high load impact. This improves the prediction accuracy of the model under extreme working conditions, and the optimal control strategy given can balance the treatment effect and energy consumption, thereby reducing the overall energy consumption level while ensuring water quality standards.

[0010] In combination with some embodiments of the first aspect, in some embodiments, before multiplying the physical process inhibition factor with the biochemical reaction term in the differential equation set to obtain the physical constraint equation, further comprising: Calculating the covariance sign of the inflow rate change rate and the characteristic pollutant concentration change rate to determine the impact phase discriminant; when the impact phase discriminant is positive, setting the physical process inhibition factor to 1.

[0011] In the above embodiment, by calculating the covariance sign of the inflow rate and the concentration change rate of the pollutants, an impact phase discriminant capable of identifying the impact type is constructed. When the synchronous growth impact of flow and concentration occurs (the discriminant is positive), the physical process inhibition factor is set to 1, distinguishing between biochemical impact dominated by high concentration load and pure hydraulic flushing, avoiding incorrect inhibition of model prediction in the key biochemical reaction stage, making the model response to different impacts more consistent with the real physical process, and further optimizing the derived control strategy to be more targeted and economical, effectively dealing with the impact while achieving better energy saving and consumption reduction effect.

[0012] In combination with some embodiments of the first aspect, in some embodiments, the predicted effluent water quality state variable and the predicted key kinetic parameter are substituted into the preset differential equation set of activated sludge reaction mechanism, and the calculated residual is determined as the second deviation, specifically comprising: Based on the dissolved oxygen concentration change and the aeration quantity data in the working condition parameters, the actual oxygen consumption rate is determined; based on the total organic matter concentration in the influent water quality data, the theoretical oxygen consumption rate is calculated by using the preset reference kinetic parameter; when the biodegradability abnormality index exceeds the preset abnormality index threshold value, the predicted effluent water quality state variable, the predicted key kinetic parameter, and the influent component correction factor are substituted into the differential equation set to calculate the residual, which is determined as the second deviation.

[0013] In the above embodiment, the biodegradability abnormality index is constructed by calculating the ratio of the actual oxygen consumption rate to the theoretical oxygen consumption rate to detect the composition mutation of the influent caused by industrial wastewater impact, etc. When the abnormality occurs, the index generates the influent composition correction factor and substitutes it into the differential equation set as the physical constraint of the model, forcing the model to dynamically correct the internal judgment of the current biochemical reaction process. The adaptive physical correction capability enables the final optimization control strategy to more accurately match the real-time working condition and avoid excessive aeration and other redundant operations caused by misjudgment.

[0014] In combination with some embodiments of the first aspect, in some embodiments, when the biodegradability abnormality index exceeds the preset abnormality index threshold, the predicted effluent quality state variable, the predicted key kinetic parameter, and the influent composition correction factor are substituted into the differential equation set to calculate the residual error, and before determining the second deviation, the method comprises: Based on the total organic matter concentration, the total nitrogen concentration, and the total phosphorus concentration in the influent water quality data, the carbon-nitrogen ratio and the carbon-phosphorus ratio are calculated; when the carbon-nitrogen ratio or the carbon-phosphorus ratio exceeds the preset biological metabolic limit threshold, the active potential correction coefficient is calculated according to the difference between the exceeding value and the biological metabolic limit threshold; the actual oxygen consumption rate is multiplied by the active potential correction coefficient to obtain the corrected actual oxygen consumption rate; the corrected actual oxygen consumption rate is used to replace the actual oxygen consumption rate, and the corrected biodegradability abnormality index is obtained by dividing the theoretical oxygen consumption rate instead of the biodegradability abnormality index.

[0015] In the above embodiment, the carbon-nitrogen ratio and the carbon-phosphorus ratio are calculated to monitor the nutritional balance in real time, and the active potential correction coefficient is constructed to quantify the inhibition degree of nutritional imbalance on microbial activity, which is then used to correct the actual oxygen consumption rate, thereby obtaining the corrected biodegradability abnormality index that excludes the nutritional limitation artifact and more truly reflects the biodegradability of the influent. Based on the accurate system state judgment, the subsequent control strategy can effectively avoid the waste of resources such as invalid aeration caused by misjudgment of the microbial activity state, thereby reducing the operating cost while ensuring the treatment effect.

[0016] In combination with some embodiments of the first aspect, in some embodiments, the first deviation and the second deviation are weighted and summed to obtain a total optimization target, specifically comprising: Based on the microbial yield coefficient and the maximum specific growth rate in the predicted key kinetic parameter, the predicted metabolic efficiency index is calculated according to the biochemical stoichiometry principle; when the predicted metabolic efficiency index exceeds the preset metabolic efficiency physical upper limit threshold, the difference between the predicted metabolic efficiency index and the metabolic efficiency physical upper limit threshold is calculated to determine the third deviation; the first deviation, the second deviation, and the third deviation are weighted and summed to obtain a corrected total optimization target.

[0017] In the above embodiment, by constructing a predicted metabolic efficiency index based on biochemical principle, and introducing a physical upper limit threshold of metabolic efficiency as a physical check, when the predicted result deviates from reality, the third deviation will be included in the correction of the total optimization target as a penalty term, forcing the model to respect the basic biological metabolic law in the optimization process, so as to ensure that the deduced control strategy is always in a physically reachable and effective interval, avoiding excessive aeration and other invalid energy consumption caused by pursuing theoretically high efficiency, and finally achieving the optimization of operation energy efficiency while ensuring the treatment effect.

[0018] In combination with some embodiments of the first aspect, in some embodiments, the first deviation and the second deviation are weighted and summed to obtain the total optimization target, specifically including: Before the model training process starts, the first deviation weight and the second deviation weight are set, and as the training proceeds, the first deviation weight is gradually reduced and the second deviation weight is gradually increased according to a preset scheduling function, until the first deviation weight and the second deviation weight are stable; the first deviation, the first deviation weight, the second deviation and the second deviation weight are weighted and summed to obtain the total optimization target.

[0019] In the above embodiment, the first deviation driven by data is given a higher weight at the beginning of training, so that the model can quickly capture the basic correlation and pattern in the data. As the training proceeds, the optimization focus is gradually and smoothly transferred to the second deviation representing the process mechanism constraint through a preset scheduling function, which is equivalent to applying a dynamic, loose-to-tight physical bridle to the model learning process, guiding the final convergence in a solution space that satisfies both data authenticity and physical consistency on the basis of sufficient learning of data, ensuring that the generated optimization result is physically reachable and efficient in the real world.

[0020] In a second aspect, the embodiments of the present application provide a wastewater treatment plant modeling system, which comprises one or more processors and a memory; the memory is coupled to the one or more processors, and the memory is used to store computer program code, the computer program code comprising computer instructions, and the one or more processors invoke the computer instructions to enable the wastewater treatment plant modeling system to perform the method described in the first aspect and any possible implementation manner of the first aspect.

[0021] In a third aspect, the embodiments of the present application provide a computer program product comprising instructions, which, when the computer program product is executed on a wastewater treatment plant modeling system, enable the wastewater treatment plant modeling system to perform the method described in the first aspect and any possible implementation manner of the first aspect.

[0022] In a fourth aspect, the embodiments of the present application provide a computer readable storage medium, including instructions, when the instructions are executed on a wastewater treatment plant modeling system, causing the wastewater treatment plant modeling system to perform the method described in the first aspect and any possible implementation manner of the first aspect.

[0023] It can be understood that the wastewater treatment plant modeling system provided in the second aspect, the computer program product provided in the third aspect, and the computer storage medium provided in the fourth aspect are all used to execute the wastewater treatment plant modeling method based on a physical information neural network provided by the embodiments of the present application. Therefore, the beneficial effects that can be achieved are referred to the beneficial effects in the corresponding method, which will not be repeated here.

[0024] The one or more technical solutions provided in the embodiments of the present application have at least the following technical effects or advantages: 1. The present application synchronously predicts the effluent water quality and the key kinetic parameters as the core technical features through the neural network model, and constructs a joint constraint of data and physics: the first bias (data bias) ensures that the model output fits the actual measured value, and the second bias (physical residual) forces the model predicted dynamic parameters to follow the physical law of biochemical reaction through the preset mechanism differential equation set. This training method driven by data and mechanism makes the final model dynamically capture the real-time biochemical characteristics change of the system caused by the impact of influent or seasonal change, thereby solving the defect that the reliability of the traditional static model decreases when facing non-steady state working conditions due to parameter solidification, and further making the energy-saving control strategy optimized and deduced more accurate and reliable, so as to obtain lower actual operation energy consumption while ensuring that the effluent meets the standard.

[0025] 2. The present application constructs a biodegradability abnormality index by calculating the ratio of the actual and theoretical oxygen consumption rate, detects the mutation of the influent component caused by the impact of industrial wastewater, etc. When the abnormality occurs, the index generates an influent component correction factor and substitutes it into the differential equation set as the physical constraint of the model, forcing the model to dynamically correct the internal judgment of the current biochemical reaction process. This adaptive physical correction capability makes the final optimized control strategy more accurately match the real-time working condition, avoiding excessive aeration and other redundant operations caused by misjudgment.

[0026] 3. The present application calculates the carbon-nitrogen ratio and the carbon-phosphorus ratio to monitor the nutritional balance in real time, and constructs an active potential correction coefficient to quantify the inhibition degree of nutritional imbalance on microbial activity, which is then used to correct the actual oxygen consumption rate, so as to obtain a corrected biodegradability abnormality index that eliminates the nutritional limitation artifact and more truly reflects the biodegradability of the influent. Based on the accurate system state judgment, the subsequent control strategy can effectively avoid the waste of resources such as invalid aeration caused by misjudgment of the state of microbial activity, thereby reducing the operation cost under the premise of ensuring the treatment effect. BRIEF DESCRIPTION OF DRAWINGS

[0027] Figure 1 is a flowchart of a wastewater treatment plant modeling method based on a physical information neural network in an embodiment of the present application; Figure 2 is another flowchart of a wastewater treatment plant modeling method based on a physical information neural network in an embodiment of the present application; Figure 3 is an exemplary hardware structure diagram of a wastewater treatment plant modeling system in an embodiment of the present application. DETAILED DESCRIPTION

[0028] The terms used in the following embodiments of the present application are only for the purpose of describing specific embodiments and are not intended to be limiting of the present application. As used in the specification and the appended claims of the present application, the singular forms “a,” “an” and “the” are intended to include the plural forms as well, unless the context clearly indicates otherwise. It will be further understood that the terms “and / or” as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items.

[0029] Hereinafter, the terms “first” and “second” are only for the purpose of description and cannot be understood as implying or suggesting relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined with “first” and “second” can explicitly or implicitly include one or more of the features, and in the description of the embodiments of the present application, the meaning of “a plurality of” is two or more, unless otherwise specified.

[0030] In the related art, the internationally recognized activated sludge model (ASM) is usually selected as the basic framework, and the biological kinetics and other parameters involved in the model are calibrated by using the long-term accumulated operation monitoring data of the wastewater treatment plant. The essence of this method is to seek a set of static parameter constants that can optimally fit the historical data. However, as a dynamic biochemical system, the internal microbial activity, population structure, etc. of the wastewater treatment plant will change in real time with environmental factors such as influent load and temperature, and a fixed set of static parameters cannot capture this time-varying characteristic. Therefore, when encountering a working condition fluctuation that is not fully reflected in the historical data, the energy-saving control strategy derived based on the static model will be inaccurate and the reliability will be reduced, resulting in too high safety redundancy reserved in the operation to ensure that the effluent meets the standard, causing unnecessary energy waste.

[0031] In the embodiments of the present application, a neural network model is constructed, which not only predicts the water quality, but also synchronously outputs key dynamic parameters reflecting the current state of the system. The core is that the model training no longer depends only on data fitting (first bias), but introduces a physical residual (second bias) calculated based on the differential equations of activated sludge reaction mechanism as another optimization objective. This training paradigm driven by data and mechanism together is constrained by the total optimization objective, forcing the neural network to learn the data law while the predicted dynamic parameters and water quality state variables must always follow the basic biochemical reaction law. This makes the model free from the dependence on static parameters, and can dynamically capture the real-time biochemical characteristics of the system, solving the misalignment problem of traditional models in non-steady state conditions, thus ensuring that the deduced energy-saving control strategy is more accurate and reliable in actual application, and can reduce the operating energy cost under the premise of ensuring the effluent water quality.

[0032] Figure 1 is a flowchart of using the wastewater treatment plant modeling method based on physical information neural network in the embodiments of the present application, including the following steps: S101, acquiring operation data of the sewage treatment process, the operation data including working condition parameters, influent water quality data, actual effluent water quality measurement value and energy consumption data corresponding to the working condition parameters.

[0033] Wherein, the sewage treatment process refers to the sum of a series of process units performed to remove pollutants in water, such as A2 / O process or SBR process; the operation data represents a set of quantitative indicators recording the running state of the sewage treatment process in a specific time period; the working condition parameters are variables that can be adjusted by the operator to affect the treatment effect, used to represent the running settings of the system, such as aeration amount, dissolved oxygen concentration set value, sludge return ratio, etc.; the influent water quality data refers to the pollution load indicators of the raw water flowing into the treatment system, such as chemical oxygen demand (COD), ammonia nitrogen (NH4-N), etc.; the actual effluent water quality measurement value is the real water quality data obtained by online instrument or manual test after treatment; the energy consumption data is the amount of energy consumed to maintain a specific working condition, mainly referring to the power consumption of devices such as air blower and water pump.

[0034] Specifically, data is extracted and integrated from the supervisory control and data acquisition system and the laboratory information management system of the wastewater treatment plant. First, the data collection time range, sampling frequency, and data point are determined. Then, the original data stream is obtained through database query, API interface call, or file export. A key is data alignment. Considering the hydraulic retention time (HRT) of several hours of wastewater in the system, the influent data at time t must be matched with the effluent data at time (t+HRT) and the average operating parameter during this period to establish the correct causal relationship. In addition, the original data inevitably contains noise, missing values, and outliers, so data preprocessing is necessary, including using interpolation algorithms (such as linear interpolation, spline interpolation) to fill in missing data, and using statistical methods (such as box plot method, Z-score) or machine learning algorithms (such as Isolation Forest) to identify and eliminate outliers.

[0035] In some embodiments, the acquisition and preprocessing of this operation data can be achieved in various ways: Optionally, a data acquisition system based on the OPC (OLE for Process Control) protocol is built: (1) An OPC server is configured on the central control server of the wastewater treatment plant, and the tags (Tag) of the corresponding operating conditions, water quality, energy consumption, and other data points in the SCADA system are published externally; (2) A data acquisition client is developed, which connects to the server through the OPC client interface and subscribes to the required data tags; (3) The client program receives data updates at a set time interval (e.g., 5 minutes) and stores the original data with timestamps in a local or cloud-based time series database, which is then processed for unified cleaning and alignment.

[0036] It can be understood that other ways can also be used to implement data preparation, such as using industrial Internet of Things gateways for edge-side data acquisition and preliminary processing, etc., which are not limited here.

[0037] S102, input the operating parameter and influent water quality data into the neural network model with preset initial network parameters, perform forward calculation, and obtain the predicted effluent water quality state variable and predicted key kinetic parameter.

[0038] The neural network model refers to a calculation model composed of a large number of interconnected nodes (neurons), which can be used to learn the complex nonlinear relationship between data. The preset initial network parameter refers to the initialization and assignment of all weights and biases in the network before the model training starts, which is usually preset according to a certain standard random distribution (such as Xavier or He initialization). The forward calculation refers to the one-way process of data starting from the input layer, passing through the network layer by layer through weighted calculation and nonlinear activation function processing, and finally generating results in the output layer. The predicted effluent water quality state variable is the estimated value of the future effluent pollutant concentration. The predicted key kinetic parameter is the estimated value of the internal parameter (such as the maximum specific growth rate of microorganisms) describing the biochemical reaction rate.

[0039] Specifically, a set of operating parameters and influent water quality data are organized into an input vector x and input into the first layer (input layer) of the network. Then, in each hidden layer of the network, the output vector of the previous layer is multiplied by the weight matrix of the current layer, and the bias vector is added, and then the result is passed to a nonlinear activation function (such as ReLU, sigmoid or tanh) to obtain the output of the current layer. This process is performed layer by layer until the data is passed to the output layer. The output layer usually uses a linear activation function to allow the output to have any range of values, and the final output vector contains the predicted effluent water quality state variable and key kinetic parameter.

[0040] In some embodiments, the forward calculation of this neural network model can be implemented in various ways: Optionally, a feedforward neural network (FNN) is used: the operating parameters and influent water quality data at time t are spliced into a single flattened feature vector; an FNN composed of an input layer, multiple fully connected hidden layers and an output layer is constructed, where the hidden layers are connected through weight matrices and activation functions (such as ReLU); the feature vector is input into the network, and a series of matrix-vector multiplication and activation function transformations are performed to calculate layer by layer, and finally an output vector containing all predicted values is obtained in the output layer.

[0041] It can be understood that other more complex network structures, such as attention mechanism and graph neural network, can also be used to implement this prediction function, which is not limited here.

[0042] S103, determining a first deviation based on the difference between the predicted effluent water quality state variable and the actual effluent water quality measurement value.

[0043] The predicted effluent water quality state variable refers to an estimated value of the concentration of each pollutant in the effluent obtained by forward calculation of the neural network model in step S102; the actual effluent water quality measurement value refers to the measured effluent pollutant concentration at the corresponding time point of the input data in the operation data obtained in S101; and the first deviation is commonly referred to as loss or cost in the field of machine learning and is used to guide the optimization of model parameters.

[0044] Specifically, in each iteration of model training, the forward calculation (S102) is performed first. A batch of training samples is taken out from the data set, each sample containing the input of the model (working conditions and influent water quality) and the corresponding true output (actual effluent water quality). After the model completes the forward calculation on this batch of samples, the corresponding predicted effluent water quality is obtained. Then, for each water quality index (such as COD, ammonia nitrogen) in each sample, the difference between the predicted value and the true value is calculated. Finally, all these differences are aggregated into a single numerical value by a predefined loss function (such as mean squared error or mean absolute error), which is the first deviation.

[0045] In some embodiments, the calculation of the first deviation can be achieved in various ways: Optionally, a mean squared error (MSE) loss function is used: for each sample in a batch, the square of the difference between all predicted effluent water quality index values and the corresponding true values is calculated; the average of the squared differences of all indexes within a single sample is calculated; and finally the average squared difference of all samples in the entire batch is calculated again to obtain the final first deviation value. This method gives higher punishment to larger errors.

[0046] It can be understood that other loss functions, such as Huber loss (combining the advantages of MSE and MAE), can also be selected to calculate the first deviation according to the requirements of specific tasks, which are not limited here.

[0047] S104, the predicted effluent water quality state variable and the predicted key kinetic parameter are substituted into the preset differential equation set of activated sludge reaction mechanism, and the calculated residual error is determined as the second deviation.

[0048] The preset differential equation set of activated sludge reaction mechanism refers to a set of mathematical equations established based on recognized principles of microbial dynamics and stoichiometry, which is public knowledge in the field of water treatment; substitution means that the variables (such as the concentrations of various microorganisms and substrates) and parameters (such as reaction rate constants) output by the neural network are used as terms in the differential equations; and the calculation residual error refers to the degree of inequality on both sides of the equation after the output of the neural network is substituted into the equation. In theory, perfect prediction should make the equation equal to zero, and any non-zero result is a residual error; and the second deviation is a quantitative measure of the residual error.

[0049] Specifically, the core technology of Automatic Differentiation is used. For the differential equation f(dS / dt, S, p) = 0, the output of the neural network directly gives the state variable S and the kinetic parameter p as a function of time t. Using the automatic differentiation tool, the derivative of the neural network output S with respect to the input t dS / dt can be calculated, and then S, p and the calculated dS / dt are substituted into the expression of the equation f, and the result r is calculated. This r is the physical residual. Finally, by calculating the norm (such as the square of the L2 norm) of the residual vector r, a scalar value is obtained, which is the second deviation.

[0050] In some embodiments, the calculation of this second deviation can be realized in various ways: Optionally, based on the complete ASM1 model for calculation: construct a calculation graph containing all 8 differential equations in the ASM1 model; obtain the predicted values of all 13 state variables (7 dissolved substances, 6 particulate substances) and related kinetic parameters at a specific time point t from the neural network model; use the automatic differentiation function of deep learning frameworks such as PyTorch or TensorFlow to calculate the derivative of each state variable with respect to time t; Substitute these predicted values and derivative values into the 8 differential equations to obtain a residual vector containing 8 residual values; calculate the mean square value (average of all element squares) of the residual vector as the second deviation.

[0051] It can be understood that other mechanism models (such as ASM2d, ASM3, etc.) can also be selected or constructed according to the specific process being studied to calculate the second deviation, which is not limited here.

[0052] In some embodiments, to deal with the situation of severe fluctuations in hydraulic and water quality loads of the sewage treatment system when it encounters rainwater impact or abnormal upstream sewage, dynamic hydraulic impact index and physical process inhibition factor can also be introduced to adjust the strength of the physical mechanism constraint, so as to improve the training stability and prediction accuracy of the model during the impact load.

[0053] Specifically, the influent flow rate (Q) and the concentration of a characteristic pollutant (C, e.g. COD or ammonia nitrogen) are continuously monitored as the operating condition and water quality data, respectively, and their rates of change dQ / dt and dC / dt are obtained using numerical methods such as the difference method. Then, the two rates are multiplied to obtain a dynamic hydraulic shock index (Index_shock = dQ / dt * dC / dt). This index can comprehensively quantify the combined shock intensity of hydraulic and water quality: when the flow rate and concentration both increase sharply (typical shock load scenario), the index is a large positive value, indicating that a severe combined increasing shock is being experienced. The advantage of this is that it can convert the abstract concept of shock into a quantifiable, continuously changing numerical indicator.

[0054] To further distinguish the type of shock, the covariance of the rates of change of the influent flow rate and the concentration of the characteristic pollutant within a short time window is calculated and determined as a shock phase discriminator. When the discriminator is positive, it indicates that the flow rate and concentration tend to change in the same direction (both increasing or decreasing), which usually corresponds to the main rising phase of the shock of pollutant load accumulation. In this phase, the biochemical reaction rules described by the activated sludge mechanism model are still the core logic that dominates the system state change. Therefore, the physical process suppression factor (a) is set to 1 at this time, which means that the physical constraints are fully effective and are not weakened at all. The advantage of this is that it can ensure that the model still strictly follows the biochemical reaction kinetics during the regular load growth phase, preventing the model from producing predictions that violate physical common sense simply by data fitting.

[0055] In all other cases where the shock phase discriminator is not positive (such as the subsiding phase of the shock, dilution-type shock, etc.), the physical process suppression factor (a) is inversely proportional to the dynamic hydraulic shock index, for example a = 1 / (1+k*|Index_shock|), where k is a tuning coefficient. This means that when the shock index is larger, the suppression factor a tends to 0; when the shock index tends to 0, the suppression factor a tends to 1. Then, multiply this dynamic suppression factor a with the biochemical reaction terms (e.g. terms describing microbial growth, substrate consumption) in the original activated sludge differential equations to obtain new physical constraint equations. Finally, substitute the neural network predicted effluent water quality state variables and key kinetic parameters into this dynamically adjusted physical constraint equation, calculate the equation residual, and determine this residual as the final second bias. During severe and irregular shocks, the original mechanism model may be distorted due to the breaking of its inherent assumptions (such as the slowly varying condition), and at this time, through a suppression factor a that tends to 0, the contribution of the distorted physical model to the overall optimization objective can be reduced, making the neural network training more dependent on the true measured data (first bias), avoiding being misled by false physical prior knowledge, so that the model can more flexibly capture the true system behavior under these extreme operating conditions.

[0056] The above technical solution improves the generalization ability and prediction accuracy of the model under non-steady state impact working conditions. Traditional physical information neural network (PINN) gives data constraints and physical constraints with fixed weights, but under impact load, the accuracy of the mechanism model (physical constraint) will decrease. If the model is still forced to strictly comply with this physical constraint at this time, it will cause the physical residual (second deviation) to produce false or contradictory gradient signals, interfere with or even destroy the model's learning of the true data law, causing unstable training. By introducing a dynamic suppression factor, the weight of the physical constraint is automatically reduced when the impact occurs, so that the optimization direction of the model is mainly dominated by the true data (first deviation), so that the model can fit the true dynamics during the impact, avoiding the negative effects brought by the physical constraint.

[0057] S105, the first deviation and the second deviation are weighted and summed to obtain a total optimization target.

[0058] The total optimization target is the final scalar function that guides the parameter update of the entire neural network model, also known as the total loss function, and the only purpose of model training is to minimize the total optimization target.

[0059] Specifically, the mathematical expression is usually L_total = λ_data * L_data + λ_phy * L_phy, where L_data and L_phy are the first and second deviations, and λ_data and λ_phy are preset weight coefficients. These two weight coefficients are parameters that need to be debugged, and their setting has a significant impact on the final performance of the model. For example, if λ_phy is much larger than λ_data, the model will prioritize meeting the physical constraint, even if it sacrifices some fitting accuracy for noisy data; conversely, the model will be more inclined to reproduce the training data.

[0060] In some embodiments, the construction of this total optimization target can be achieved in various ways: Optionally, fixed weight coefficients are used for weighted summation: based on prior knowledge or preliminary experiments, fixed weight values are set for the two deviations, for example, the weight of the data deviation λ_data is set to 1.0, and the weight of the physical deviation λ_phy is set to 0.1; in each iteration, the calculated L_data and L_phy are multiplied by their corresponding weights; add the two weighted deviation values to obtain the total optimization target L_total.

[0061] It can be understood that more complex adaptive weighting algorithms can also be used, which can automatically adjust the weight according to the gradient size or change of each deviation to achieve a better balance, which is not limited here.

[0062] In some embodiments of this application, in order to enhance the biological interpretability and physical authenticity of the neural network model prediction results, metabolic efficiency constraints based on biochemometrics principles can be introduced, so that the key kinetic parameters predicted by the model are within a scientifically reasonable range.

[0063] Specifically, this technical solution adds a hard constraint on basic biological principles to the original dual constraints of data and physical mechanisms.

[0064] After the neural network model completes one forward computation (S102), two core variables are extracted from the output of the key predictive kinetic parameters: the microbial yield coefficient (Y) and the maximum specific growth rate (μ_max). The microbial yield coefficient (Y) characterizes the ability of microorganisms to convert a unit mass of substrate (contaminant) into their own biomass, while the maximum specific growth rate (μ_max) represents the fastest proliferation rate under ideal conditions. According to the principles of biostoichiometry, there is an inherent trade-off between these two parameters, constrained by the laws of thermodynamics, and they cannot increase simultaneously indefinitely. Therefore, a predictive metabolic efficiency index can be constructed, for example, Indicator_eff=f(Y, μ_max), which comprehensively reflects the overall efficiency of microbial energy conversion and material synthesis.

[0065] A physical upper limit threshold (Threshold_eff) for metabolic efficiency is preset. This threshold is based on the general principles of microbial physiology and bioenergetics, and is a theoretically insurmountable limit derived from extensive literature research; it is common knowledge in the field. The predicted metabolic efficiency index calculated in the previous step is compared with the physical upper limit threshold. If and only if the predicted value exceeds the physical upper limit, the difference between the two is calculated, and this positive difference is defined as the third bias (L_bio). If the predicted value does not exceed the upper limit, the third bias is zero. A highly targeted penalty mechanism is constructed, which is only activated when the model makes a prediction that clearly violates basic biological principles.

[0066] Finally, the first deviation (L_data) describing the degree of data fitting, the second deviation (L_phy) describing the degree of process mechanism fitting, and the third deviation (L_bio) are weighted and summed to obtain a corrected total optimization target, i.e. L_total_corrected=w1*L_data+w2*L_phy+w3*L_bio. Among them, the weight w3 of the third deviation is usually set to be larger because it represents a hard physical constraint that cannot be violated. By using this corrected total optimization target for subsequent model training (S106), the optimizer not only makes the model fit the data and comply with the reaction kinetics when performing gradient descent, but also must try to avoid making the predicted metabolic efficiency index exceed the physical upper limit, thereby strictly limiting the solution space of the model within a biologically reasonable range.

[0067] The above technical solution solves the problem that the neural network model may generate physically impossible kinetic parameters in order to minimize data errors by introducing a third deviation representing a biological hard constraint. When the metabolic efficiency predicted by the model exceeds the theoretical upper limit, a non-zero penalty term is activated, and a strong gradient signal is generated in the back propagation, which directly guides and forces the internal network parameters of the model to be corrected towards the interval that can output biologically reasonable parameters. Not only can overfitting of the model be avoided, but more importantly, the scientific effectiveness of the internal state and parameters is ensured, making the output results more reliable and interpretable.

[0068] S106, based on the total optimization target, iteratively adjust the internal network parameters of the neural network model until the value of the total optimization target is less than a preset convergence threshold, to obtain a final neural network model.

[0069] Among them, iterative adjustment refers to the process of updating all weights and biases in the neural network in small increments through optimization algorithms in one round after another, i.e. the learning or training process of the model; internal network parameters refer to the weights and biases that constitute the neural network; the preset convergence threshold is a very small positive number (such as 1e-5) set in advance to determine whether the model training has reached a satisfactory stable state. This threshold is usually set according to engineering experience and the requirements for model accuracy, and when the loss value is lower than it or no longer decreases, it is considered that the model has converged; the final neural network model refers to the model whose internal network parameters are finally determined and fixed after the training process is completed, at which time it has already possessed stable prediction ability from input to output.

[0070] Specifically, each iteration comprises a closed loop of forward computation, calculation of the overall optimization objective, backpropagation, and parameter update. First, the model performs forward computation to obtain the overall optimization objective L_total. Next, the backpropagation algorithm is executed, which uses the chain rule from calculus to calculate the gradient (partial derivative) of L_total with respect to each parameter (weight and bias) in the network. This gradient indicates the direction of parameter adjustment; adjusting the parameters along this direction will result in the fastest decrease in loss. Then, the optimizer algorithm (such as Adam or SGD) performs a small update to all network parameters based on the calculated gradient and the learning rate hyperparameter. This process repeats continuously, with each iteration decreasing the value of L_total slightly, thereby gradually improving the model's predictive ability until the convergence criterion is met.

[0071] In some embodiments, this model training process can be implemented in a variety of ways: Optionally, the Adam (Adaptive Moment Estimation) optimizer can be used for training: The Adam optimizer is initialized, and key hyperparameters such as the learning rate (e.g., 0.001), β1 (e.g., 0.9), and β2 (e.g., 0.999) are set. After backpropagation in each iteration, the Adam optimizer calculates an adaptive learning rate for each parameter based on the first moment estimate (momentum) and second moment estimate (similar to velocity) of the gradient. This adaptive learning rate is then used to update the network parameters. This method offers fast convergence and stable performance.

[0072] It is understandable that other optimization algorithms such as RMSprop and Adagrad can also be used, combined with various training strategies such as learning rate decay and early stopping, to complete this step, which is not limited here.

[0073] S107. Take the different operating parameters in the operating data as input, substitute them into the final neural network model, perform multiple forward inferences, and obtain multiple sets of predicted effluent water quality results corresponding to different operating parameters.

[0074] Wherein, different operating parameters refer to a series of artificial set of operating parameter combinations for exploring the optimal operating point, which can be within the range of historical data or exploratory settings beyond the range of historical data; the forward deduction is essentially the same as the forward calculation in S102, but the purpose is different: the former is to calculate the loss in training, while here it is purely for prediction and simulation using the model after the end of model training; the multiple sets of predicted effluent water quality results refer to each virtual operating parameter input, which will get a corresponding predicted effluent water quality output through the model, thereby forming a simulation data set containing input-output corresponding relationship.

[0075] Specifically, without actually changing the operating parameters of the wastewater treatment plant, the effects of different operation strategies can be evaluated through computer simulation. First, one or more key operating parameters (such as aeration quantity, internal reflux ratio) that need to be optimized are determined, and reasonable value ranges and steps to be explored are set for them, thereby forming a multi-dimensional parameter grid. Then, each point in the grid (i.e. each operating parameter combination) is traversed, combined with a typical or average influent water quality data to form the input of the model. This input is fed into the final neural network model to perform a forward deduction, and the predicted effluent water quality output by the model is recorded. This process is repeated until all the set operating parameter combinations are traversed, and finally a working condition-effect relationship map is generated.

[0076] In some embodiments, this process of multiple forward deductions can be implemented in various ways: Optionally, the grid search (Grid Search) method is used for deduction: 1 to 3 key operating parameters (such as DO set value, external carbon source dosage) and their respective exploration ranges and discrete steps (such as DO from 1.5 to 2.5 mg / L, step 0.1) are determined; nested loops are used to generate all possible parameter combinations to form a parameter grid; for each combination in the grid, the trained model is called to perform a forward deduction, and the input operating parameters and the output predicted water quality results are stored in the form of key-value pairs.

[0077] It can be understood that more advanced experimental design methods such as Latin hypercube sampling can also be used to generate more representative operating parameter combinations for deduction, which is not limited here.

[0078] S108, based on the multiple sets of predicted effluent water quality results, combined with energy consumption data, determine the operating parameters corresponding to the lowest energy consumption when meeting the preset effluent water quality standards as the optimal process control parameters.

[0079] Among them, the multiple sets of predicted effluent water quality results are simulation effect data sets generated by S107 under different working condition parameters; the energy consumption data can be obtained from the working condition-energy consumption relationship model established from the data obtained from S101, or the energy consumption value calculated based on the device performance curve; the preset effluent water quality standard is the upper limit of pollutant concentration that the treated effluent must meet according to the national or local environmental regulations, for example, the first level A standard in the Discharge Standard of Pollutants for Municipal Wastewater Treatment Plant; the optimal process control parameter is a set of operable working condition parameter setting values that can ensure that the effluent meets the standard stably and minimize the treatment cost (mainly represented by energy consumption).

[0080] Specifically, first, each set of working condition-predicted water quality data pairs obtained in S107 is traversed. For each set of data, it is checked whether the predicted water quality meets all the preset effluent water quality standards. All working condition parameters that meet this condition are screened out to form a feasible solution set. Then, for each working condition parameter in the feasible solution set, the corresponding operating energy consumption is calculated according to the relationship with energy consumption (for example, the greater the aeration amount, the higher the energy consumption of the blower). Finally, among all the feasible solutions, the working condition parameter corresponding to the lowest energy consumption value is selected as the optimal process control parameter.

[0081] In some embodiments, the determination of this optimal parameter can be achieved in various ways: Optionally, it can be achieved by constructing and solving an explicit optimization problem: taking the trained neural network model itself as the constraint function NN(working condition) <= water quality standard in the optimization problem; taking the relationship between working condition and energy consumption (which can be fitted from historical data, such as energy consumption = f(working condition)) as the objective function min(f(working condition)) in the optimization problem; using a mature numerical optimization solver (such as the minimize function in the SciPy library) to directly solve the optimal working condition parameter with the objective function and constraint function as input. This method is more efficient than grid search, especially in the case of continuous and high-dimensional parameter space.

[0082] It can be understood that a multi-objective optimization algorithm can also be combined to consider multiple objectives such as energy consumption, chemical consumption, and effluent stability to find a set of Pareto optimal solutions for decision makers to choose from, which is not limited here.

[0083] In the above embodiments, a neural network model synchronously predicts the effluent quality and key dynamic parameters, which are core technical features, and constructs a dual constraint of data and physical biases: the first bias (data bias) ensures that the model output closely matches the actual measured values, while the second bias (physical residual) forces the model to predict dynamic parameters that must follow the physical laws of biochemical reactions through a preset set of mechanistic differential equations. This training method, driven by both data and mechanism, enables the final model to dynamically capture real-time changes in biochemical characteristics caused by influent impacts or seasonal variations. This solves the shortcomings of traditional static models, which suffer from parameter fixation and decreased reliability under non-steady-state conditions. Consequently, the optimized energy-saving control strategy is more accurate and reliable, ultimately achieving lower actual operating energy consumption while ensuring effluent meets standards.

[0084] In other embodiments of this application, when a large amount of industrial wastewater with high ammonia nitrogen and high total phosphorus but lacking carbon sources is introduced into the influent, it may result in low apparent oxygen consumption activity, which can easily be misjudged as a toxic shock. Using the wastewater treatment plant modeling method based on physical information neural networks provided in this application, the impact of nutrient limitations can be identified and quantified through activity potential correction, thereby tracing the root cause of the actual biochemical anomaly.

[0085] like Figure 2 The diagram shown is another flowchart illustrating the wastewater treatment plant modeling method based on a physical information neural network provided in this application, including the following steps: S201. Obtain operational data of the wastewater treatment process, including operating parameters, influent water quality data, actual effluent water quality measurements, and energy consumption data corresponding to the operating parameters.

[0086] S202. Input the operating parameters and influent water quality data into a neural network model with preset initial network parameters, perform forward calculations, and obtain the predicted effluent water quality state variables and predicted key dynamic parameters.

[0087] S203. Determine the first deviation based on the difference between the predicted effluent water quality state variables and the actual effluent water quality measurement values.

[0088] Steps S201-S203 and Figure 1 Steps S101-S103 in the illustrated embodiment are similar and can be found in the descriptions of steps S101-S103, which will not be repeated here.

[0089] S204. Based on the changes in dissolved oxygen concentration and aeration data in the operating parameters, determine the actual oxygen consumption rate.

[0090] The dissolved oxygen concentration change refers to the increment or decrement of the dissolved oxygen (DO) concentration in the biochemical reaction tank per unit time; the aeration amount data refers to the flow of air or pure oxygen delivered by the aeration system to the reaction tank, which is the main source of oxygen supply; and the actual oxygen uptake rate (OUR) represents the real rate at which the active sludge microbial community in the reaction tank consumes dissolved oxygen due to metabolic activities (mainly degradation of organic matter and ammonia nitrogen) at a specific moment, and is an index reflecting microbial activity.

[0091] Specifically, the microbial oxygen uptake rate that cannot be directly measured is deduced based on the oxygen mass balance principle in the aeration tank. The theoretical basis is that, in a small time period, the net change amount of the dissolved oxygen concentration in water (d(DO) / dt) is equal to the total supply rate of oxygen (i.e., oxygen transfer rate OTR) minus the total consumption rate of microorganisms (i.e., actual oxygen uptake rate OUR). Therefore, the core formula OUR=OTR-d(DO) / dt can be obtained. The oxygen transfer rate OTR is positively correlated with the aeration amount, but it is also affected by many factors such as water temperature, air pressure, sludge concentration, and aeration equipment efficiency, and is usually expressed as OTR=KLa*(DO_sat-DO), wherein KLa is the total oxygen transfer coefficient, and DO_sat is the saturated dissolved oxygen concentration. Therefore, to calculate OUR, KLa must be determined first. KLa can be calibrated by offline water test or estimated in real time by online dynamic model. After KLa is determined, the actual oxygen uptake rate OUR can be accurately calculated by combining the real-time monitored aeration amount, DO concentration, and its change rate.

[0092] In some embodiments, the determination of the actual oxygen uptake rate can be achieved in various ways: Optionally, an in-situ respirometry method is used: in a relatively isolated area of the aeration tank, the aeration to the area is temporarily stopped (for example, for 2-3 minutes) by controlling the valve; during this period, the DO concentration decrease process in the area is continuously monitored by using a high-frequency sampling DO sensor; since there is no oxygen supply (OTR≈0), the absolute value of the DO concentration decrease slope (d(DO) / dt) is the actual oxygen uptake rate OUR at this moment. This method is direct and relatively accurate.

[0093] It can be understood that other more complex online estimation algorithms, such as a KLa and OUR synchronous estimation method based on Kalman filtering, can also be used to achieve this function, which is not limited here.

[0094] S205, based on the total organic matter concentration in the influent water quality data, a theoretical oxygen uptake rate is calculated by using preset reference kinetic parameters.

[0095] The water quality data of the influent refers to the pollution load index of raw water flowing into the treatment system; the total organic matter concentration generally refers to chemical oxygen demand (COD) or biochemical oxygen demand (BOD); the preset reference kinetic parameter refers to a parameter representing the metabolic characteristics of microorganisms under standard or ideal conditions, such as the heterotrophic bacteria yield coefficient (Y H), which is a well-known common sense in the field of water treatment, and the value is generally derived from the recommended value of the authoritative activated sludge model or a large number of experimental studies on typical municipal sewage; and the theoretical oxygen consumption rate refers to the oxygen consumption rate that should be generated when the organic matter in the influent is completely biodegradable and the microorganisms metabolize according to the reference kinetic parameters.

[0096] Specifically, this step answers the question “If today's influent is exactly the same as the typical municipal sewage described in a textbook, what is the oxygen consumption rate it should generate according to the biochemical reaction stoichiometry?” The calculation is completely based on the principle of biochemical stoichiometry. For example, under aerobic conditions, the simplified reaction formula of heterotrophic microorganisms degrading organic matter shows that part of the organic matter is used to synthesize new cell material (determined by the yield coefficient Y H), and the other part is oxidized and decomposed to provide energy, and the latter is the main reason for oxygen consumption. Therefore, the proportion of organic matter used for oxidation and decomposition is (1-Y H). The theoretical oxygen consumption rate (OUR theoretical) can be calculated by the following formula: OUR theoretical=(influent flow rate*influent degradable COD concentration)*(1-Y H) / aeration tank volume. This calculation process directly converts the organic matter load of the influent into a theoretical oxygen consumption flux.

[0097] In some embodiments, the calculation of this theoretical oxygen consumption rate can be achieved in various ways: Optionally, based on the simplified COD load method: select an acknowledged heterotrophic bacteria yield coefficient Y H for municipal sewage from ASM1 and other classic models; obtain the influent flow rate (Q in) and total COD concentration (COD in) in real time, and set a typical proportion of rapidly biodegradable COD (rbCOD) in total COD according to experience; and substitute these values into the formula OUR theoretical=(Q in*(COD in*40%))*(1-0.67) / V aeration to calculate the theoretical oxygen consumption rate.

[0098] It can be understood that more complex theoretical oxygen consumption rate calculation models can also be constructed according to whether factors such as nitrification oxygen consumption are considered, which are not limited here.

[0099] S206, when the biodegradability abnormality index exceeds the preset abnormality index threshold value, the predicted effluent water quality state variable, the predicted key kinetic parameter, and the influent component correction factor are substituted into the system of differential equations to calculate the residual error, and the second deviation is determined.

[0100] wherein the biodegradability abnormality index is the ratio of the actual oxygen uptake rate (obtained in S204) to the theoretical oxygen uptake rate (obtained in S205), which quantifies the extent of deviation of the influent characteristics from the regular; the preset abnormality index threshold is the boundary value for triggering the correction mechanism, which is usually determined based on the statistical analysis of long-term historical data of a specific wastewater treatment plant, to determine the fluctuation range of the index under normal operation, and beyond this range is considered abnormal; the influent component correction factor is dynamically calculated to adjust the coefficients of the differential equations; the preset correction factor calculation function is a predefined mathematical function for mapping the abnormality index to the correction factor, the form (such as linear, segmented or nonlinear function) is obtained according to expert experience or offline experimental data, which aims to reasonably quantify the influence of abnormality on biochemical reaction.

[0101] Specifically, first, the biodegradability abnormality index Index = OUR actual / OUR theoretical is calculated. If Index is less than the preset threshold, it is considered that the influent is normal, and the calculation method of the second deviation is exactly the same as S104. However, when Index exceeds the threshold, it may mean that industrial wastewater with high biological activity enters, resulting in actual oxygen consumption far exceeding the theoretical expectation, and it is determined that the influent is abnormal. At this time, the preset correction function is called, for example, Factor = 1 + a * (Index-Threshold), to calculate the influent component correction factor Factor. Then, this Factor will be used to modify some key items in the differential equations. For example, the term describing the growth of heterotrophic bacteria can be multiplied by the factor to reflect that the yield or reaction rate of the influent substrate has changed. Finally, the prediction result of the neural network is substituted into this dynamically corrected differential equation set to calculate the residual error, and the second deviation is obtained. The advantage of this is that the physical constraints themselves are no longer static, but can be adaptively adjusted according to real-time data feedback, so that the physical model is closer to the real situation under abnormal working conditions, thereby providing more accurate gradient guidance for the neural network.

[0102] In some embodiments, this conditional second deviation calculation can be implemented in various ways: Optionally, it is realized by adjusting the division of influent components: set the abnormality index threshold. When Index exceeds this value, it is considered that the proportion of rapidly biodegradable components (rbCOD) in the influent is higher than the regular assumption; call the correction function Factor = g(Index) to calculate the dynamic proportion factor of rbCOD; before the influent water quality data is substituted into the model, preprocess the influent COD, multiply the concentration of rbCOD component by Factor, thereby increasing the effective concentration entering the differential equations, while the equations themselves remain unchanged, and then the residual error is calculated.

[0103] It can be appreciated that more complex correction strategies can also be designed, such as simultaneously correcting multiple kinetic parameters or stoichiometric coefficients, to achieve dynamic adjustment of the physical model, which is not limited here.

[0104] In some embodiments, to cope with the situation where the ratio of basic nutrients such as carbon, nitrogen, phosphorus, etc. in the influent water quality is severely imbalanced, a correction of the activity potential based on the principle of biochemical stoichiometry can also be introduced before calculating the biodegradability anomaly index, to more accurately identify the biochemical abnormalities caused by the characteristics of the influent organic matter itself rather than nutrient salt limitation.

[0105] Specifically, based on the influent water quality data obtained from online sensors or laboratory analysis, the total organic matter concentration (usually represented by COD or TOC), total nitrogen concentration (TN), and total phosphorus concentration (TP) are extracted. Then, the carbon-nitrogen ratio (C / N) and carbon-phosphorus ratio (C / P) are calculated. In this embodiment, to focus on the relative relationship between nitrogen and phosphorus excess and carbon source, the carbon-nitrogen ratio is defined as the ratio of total nitrogen concentration to total organic matter concentration (TN / TOC), and the carbon-phosphorus ratio is defined as the ratio of total phosphorus concentration to total organic matter concentration (TP / TOC).

[0106] The calculated carbon-nitrogen ratio and carbon-phosphorus ratio are compared with the preset biological metabolic limitation threshold. This preset threshold is determined based on the commonly known principle of biochemical stoichiometry of microbial growth and metabolism. For example, microbial synthesis of cell material usually needs to follow the element ratio of approximately C:N:P=100:5:1. Therefore, when the TN / TOC ratio in the influent is significantly higher than 5 / 100=0.05 or the TP / TOC ratio is significantly higher than 1 / 100=0.01, it can be considered that the carbon source relative to nitrogen or phosphorus has become a limiting substrate, and the overall activity of the microorganisms will be limited by the amount of carbon supply rather than the maximum metabolic potential itself.

[0107] When the carbon-nitrogen ratio or the carbon-phosphorus ratio is monitored to exceed the above-mentioned preset threshold, the correction mechanism is started. A correction coefficient of activity potential (a) is calculated according to the difference between the exceeding value and the threshold. For example, the correction coefficient can be designed as a function inversely proportional to the exceeding degree, a=1+k*(Ratio_actual-Ratio_threshold), where k is a gain coefficient. The physical meaning of this correction coefficient is to quantify a theoretical magnification factor: that is, if sufficient carbon source is supplemented, how much can the actual oxygen consumption activity of the current microbial community theoretically be improved. Then, the actual oxygen consumption rate (OUR_actual) obtained in S204 is multiplied by the correction coefficient of activity potential to obtain a corrected actual oxygen consumption rate (OUR_corrected=OUR_actual* a). This corrected value represents the potential oxygen consumption rate that the microorganisms can achieve under the current water temperature and organic matter characteristics, excluding the influence of nutrient salt limitation.

[0108] Finally, the corrected actual oxygen consumption rate is used to replace the original actual oxygen consumption rate, and then divided by the theoretical oxygen consumption rate calculated in S205 to obtain the corrected biodegradability abnormality index (Index_corrected=OUR_corrected / OUR_theoretical). This corrected index will replace the original biodegradability abnormality index in the subsequent step S206 to determine whether the adjustment of the physical mechanism model needs to be started.

[0109] The above technical steps quantitatively compensate for the activity inhibition caused by insufficient carbon source by introducing an activity potential correction coefficient based on the principle of biochemical stoichiometry, so that the final corrected biodegradability abnormality index can more truly reflect the inherent characteristics of the influent organic matter, and the accuracy of subsequent model correction is improved.

[0110] S207, the first deviation and the second deviation are weighted and summed to obtain a total optimization target.

[0111] Step S207 is similar to step S105 in the embodiment shown in FIG. 6, and can refer to the description in step S105, which will not be repeated here. Figure 1 The step S105 in the embodiment shown in FIG. 6 is similar to step S105 in the embodiment shown in FIG. 6, and can refer to the description in step S105, which will not be repeated here.

[0112] In some embodiments, a weight dynamic scheduling strategy can also be used to combine the total optimization target, so as to guide the model to learn in different stages of training.

[0113] Specifically, before the model training process formally starts, an initial first deviation weight (w1) and a second deviation weight (w2) are set. In the initial state, the first deviation weight is set to be very high (for example, w1=0.99), and the second deviation weight is very low (for example, w2=0.01). Such a setting ensures that in the early stage of training, the gradient of the total optimization target (L_total=w1L_data+w2L_phy) is mainly contributed by the first deviation (L_data), at this time the neural network will concentrate all the efforts to learn how to make the prediction result as close to the real monitoring data as possible, and quickly master the basic patterns and correlations in the data.

[0114] With the training, the two weights are automatically and smoothly adjusted according to a preset scheduling function at each training cycle or every few cycles. The preset scheduling function is a mathematical expression for controlling the rate of weight change and trajectory, such as a linear function, an exponential decay function or a cosine annealing function, which is set empirically or experimentally before model training. The core logic of the function is to gradually reduce the first bias weight while increasing the second bias weight. For example, using linear scheduling, w1(t) = max(w1_final, w1_initial-t*decay_rate), w2(t) = 1-w1(t), where t is the number of training cycles.

[0115] This weight adjustment process does not go on indefinitely, but will stop changing after reaching a certain preset training cycle, or when the weight value reaches a preset final target value (e.g. w1=0.6, w2=0.4), and remains stable in subsequent training. This ensures that in the later stage of training, the model can reach a clear and lasting balance between data fitting and physical consistency, and make fine adjustments. In addition, the entire scheduling process always follows an important constraint: the value of the first bias weight is always greater than that of the second bias weight (w1>w2). This reflects a core engineering idea that the physical mechanism model is a simplification and abstraction of the real world, and the real data is always the final test standard. Ensuring that the weight of data fitting is always dominant can prevent the model from deviating from the real world operation in order to excessively satisfy the theoretical equation.

[0116] The above technical solution realizes an intelligent training strategy of "fitting first, then correcting" through dynamic weight scheduling. In the early stage of training, the neural network parameters are random, and the output deviates greatly from the physical mechanism. If strong physical constraints (high w2) are applied at this time, it will produce huge and chaotic gradients, interfering with the model's learning of basic data patterns. Instead, let the model focus on data fitting first and quickly converge to a roughly correct solution space. On this basis, gradually introduce physical constraints, which is equivalent to fine-tuning near an already very good solution, guiding the model to a better solution that conforms to both data and physical principles, thereby improving the stability and efficiency of training and enhancing the model's generalization ability.

[0117] S208, based on the total optimization target, iteratively adjusting the internal network parameters of the neural network model until the value of the total optimization target is less than a preset convergence threshold, obtaining a final neural network model.

[0118] S209, taking different working condition parameters in the running data as input, substituting them into the final neural network model, and performing multiple forward inferences to obtain multiple groups of predicted effluent water quality results corresponding to different working condition parameters.

[0119] S210, based on multiple sets of predicted effluent water quality results, combined with energy consumption data, determine the corresponding energy consumption of the lowest working condition parameters when meeting the preset effluent water quality standard as the optimal process control parameter.

[0120] Steps S208-S210 are similar to steps S106-S108 in the embodiment shown in Figure 1 The steps S106-S108 in the embodiment shown in the embodiment are similar to the description in steps S106-S108. Here, no longer described.

[0121] In the above embodiment, by calculating the actual oxygen consumption rate and the theoretical oxygen consumption rate, a comparison benchmark between the real state and the theoretical expectation is established; and the activated sludge potential correction is introduced to identify and compensate the activated sludge inhibition caused by the imbalance of nutrients, so as to obtain the corrected biodegradability anomaly index which can more purely reflect the inherent biodegradability of the influent organic matter, identify the true biochemical anomaly, and dynamically generate the influent component correction factor, and then adaptively adjust the constraint equation of the physical mechanism model. When facing complex and variable influent shock, the model has higher recognition accuracy and robustness, significantly improves the prediction performance of the model in the real industrial scene, and finally reduces the actual operation energy consumption under the condition of meeting the effluent water quality standard.

[0122] Next, an exemplary wastewater treatment plant modeling system 300 provided by an embodiment of the present application is introduced. Figure 3 is an exemplary hardware structure schematic diagram of the wastewater treatment plant modeling system 300 provided by an embodiment of the present application.

[0123] In some embodiments, the wastewater treatment plant modeling system 300 is a computer device or includes a computer device in the wastewater treatment plant modeling system 300. The computer device includes a processor, a memory and a network interface connected by a system bus. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store data. The network interface of the computer device is used to communicate with other terminals or servers outside through network connection. In some embodiments, the network interface can be a wired network interface, and in some embodiments, the network interface can also be a wireless network interface. The computer program is executed by the processor to implement the method in the embodiments of the present application.

[0124] Those skilled in the art can understand that, Figure 3The structure shown in the figure is only a block diagram of part of the structure related to the scheme of the present application, and does not constitute a limitation on the computer device to which the scheme of the present application is applied. A specific computer device can include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0125] The above-described embodiments are only used to illustrate the technical scheme of the present application, but not limit it; although the technical scheme recorded in the foregoing embodiments has been described in detail, those skilled in the art should understand that the technical scheme recorded in the foregoing embodiments can be modified, or some technical features can be replaced by equivalents; and these modifications or replacements do not make the essence of the corresponding technical scheme deviate from the scope of the technical scheme of the embodiments of the present application.

[0126] In the above embodiments, according to the context, the term "when" can be interpreted as "if" or "after" or "in response to determining" or "in response to detecting". Similarly, according to the context, the phrase "upon determining" or "if detecting (the stated condition or event)" can be interpreted as "if determining" or "in response to determining" or "upon detecting (the stated condition or event)" or "in response to detecting (the stated condition or event)".

[0127] In the above embodiments, all or part of the technical scheme can be implemented by software, hardware, firmware or any combination thereof. When implemented by software, all or part of the technical scheme can be implemented in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of the present application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another computer readable storage medium, for example, the computer instructions can be transmitted from one website, computer, server or data center to another website, computer, server or data center through wired (such as coaxial cable, optical fiber, digital subscriber line) or wireless (such as infrared, wireless, microwave, etc.) mode. The computer readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. integrated with one or more available media. The available media can be magnetic media (for example, floppy disk, hard disk, magnetic tape), optical media (for example, DVD), or semiconductor media (for example, solid state disk) and the like.

[0128] Those skilled in the art can understand that all or part of the processes in the above-mentioned method embodiments can be implemented by a computer program instructing relevant hardware to complete, the program can be stored in a computer readable storage medium, and the program can include the processes of the above-mentioned method embodiments when executed. The aforementioned storage medium includes ROM or random storage memory RAM, magnetic disc or optical disc and various storage code medium.

Claims

1. A wastewater treatment plant modeling method based on physical information neural networks, characterized in that, include: The operation data of the wastewater treatment process is obtained, including operating parameters, influent water quality data, actual effluent water quality measurements, and energy consumption data corresponding to the operating parameters. The operating parameters and the influent water quality data are input into a neural network model with preset initial network parameters for forward calculation to obtain the predicted effluent water quality state variables and predicted key dynamic parameters. The first deviation is determined based on the difference between the predicted effluent water quality state variables and the actual effluent water quality measurement values; The predicted effluent water quality state variables and the predicted key kinetic parameters are substituted into the preset set of differential equations for the activated sludge reaction mechanism, and the calculated residual is determined as the second deviation. The first deviation and the second deviation are weighted and summed to obtain the overall optimization objective. Based on the overall optimization objective, the internal network parameters of the neural network model are iteratively adjusted until the value of the overall optimization objective is less than a preset convergence threshold, thereby obtaining the final neural network model. The different operating parameters in the operating data are used as inputs and substituted into the final neural network model to perform multiple forward inferences, thereby obtaining multiple sets of predicted effluent water quality results corresponding to different operating parameters. Based on multiple sets of predicted effluent water quality results and combined with the energy consumption data, the operating parameters with the lowest energy consumption when meeting the preset effluent water quality standards are determined as the optimal process control parameters.

2. The method according to claim 1, characterized in that, The step of substituting the predicted effluent water quality state variables and the predicted key kinetic parameters into a pre-defined set of differential equations for the activated sludge reaction mechanism, and calculating the resulting residual as the second deviation, specifically includes: The dynamic hydraulic shock index is obtained by real-time monitoring of the influent flow rate change rate in the operating parameters and the characteristic pollutant concentration change rate in the influent water quality data, and calculating the product of the characteristic pollutant concentration change rate and the influent flow rate change rate. The physical process inhibition factor is multiplied by the biochemical reaction term in the differential equation system to obtain the physical constraint equation; the physical process inhibition factor is obtained based on the dynamic hydraulic impact index and is inversely proportional to the dynamic hydraulic impact index. Substitute the predicted effluent water quality state variables and the predicted key kinetic parameters into the physical constraint equation, calculate the equation residual, and determine it as the second deviation.

3. The method according to claim 2, characterized in that, Before multiplying the physical process inhibition factor by the biochemical reaction terms in the system of differential equations to obtain the physical constraint equations, the method further includes: The covariance sign of the rate of change of the influent flow rate and the rate of change of the concentration of the characteristic pollutant is calculated and determined as the discriminant for the shock stage; When the impact stage discriminant is positive, the physical process inhibition factor is set to 1.

4. The method according to claim 1, characterized in that, The step of substituting the predicted effluent water quality state variables and the predicted key kinetic parameters into a pre-defined set of differential equations for the activated sludge reaction mechanism, and calculating the resulting residual as the second deviation, specifically includes: Based on the changes in dissolved oxygen concentration and aeration data in the operating parameters, the actual oxygen consumption rate is determined. Based on the total organic matter concentration in the influent water quality data, the theoretical oxygen consumption rate is calculated using preset benchmark kinetic parameters. When the biodegradability anomaly index exceeds the preset anomaly index threshold, the predicted effluent water quality state variables, the predicted key kinetic parameters, and the influent component correction factor are substituted into the differential equation system to calculate the residual, which is determined as the second deviation; the biodegradability anomaly index is the ratio of the actual oxygen consumption rate to the theoretical oxygen consumption rate; the influent component correction factor is calculated by substituting the biodegradability anomaly index into the preset correction factor calculation function.

5. The method according to claim 4, characterized in that, Before determining the second deviation by substituting the predicted effluent water quality state variables, the predicted key kinetic parameters, and the influent component correction factors into the differential equation system when the biodegradability anomaly index exceeds the preset anomaly index threshold, the process includes: Based on the total organic matter concentration, total nitrogen concentration, and total phosphorus concentration in the influent water quality data, the carbon-nitrogen ratio and carbon-phosphorus ratio are calculated; the carbon-nitrogen ratio is the ratio of the total nitrogen concentration to the total organic matter concentration; the carbon-phosphorus ratio is the ratio of the total phosphorus concentration to the total organic matter concentration. When the carbon-nitrogen ratio or the carbon-phosphorus ratio exceeds a preset biological metabolic limitation threshold, an activity potential correction coefficient is calculated based on the difference between the excess value and the biological metabolic limitation threshold. Multiply the actual oxygen consumption rate by the activity potential correction factor to obtain the corrected actual oxygen consumption rate; The modified actual oxygen consumption rate is used to replace the actual oxygen consumption rate, and then divided by the theoretical oxygen consumption rate to obtain the modified biochemical anomaly index, which is used in place of the biochemical anomaly index.

6. The method according to claim 1, characterized in that, The step of weighted summing of the first deviation and the second deviation to obtain the overall optimization objective specifically includes: Based on the microbial yield coefficient and maximum specific growth rate in the predicted key kinetic parameters, the predicted metabolic efficiency index is calculated according to the principles of biochemometrics. When the predicted metabolic efficiency index exceeds the preset physical upper limit threshold of metabolic efficiency, the difference between the predicted metabolic efficiency index and the physical upper limit threshold of metabolic efficiency is calculated and determined as the third deviation. The first deviation, the second deviation, and the third deviation are weighted and summed to obtain the corrected overall optimization objective.

7. The method according to claim 1, characterized in that, The step of weighted summing of the first deviation and the second deviation to obtain the overall optimization objective specifically includes: Before the model training process begins, a first bias weight and a second bias weight are set. As training progresses, the first bias weight is gradually reduced and the second bias weight is increased according to a preset scheduling function, until the first bias weight and the second bias weight remain stable; the value of the first bias weight is greater than the value of the second bias weight. The total optimization objective is obtained by weighting and summing the first deviation, the first deviation weight, the second deviation, and the second deviation weight.

8. A wastewater treatment plant modeling system, characterized in that, The wastewater treatment plant modeling system includes: one or more processors and a memory; the memory is coupled to the one or more processors, the memory is used to store computer program code, the computer program code including computer instructions, and the one or more processors call the computer instructions to cause the wastewater treatment plant modeling system to perform the method as described in any one of claims 1-7.

9. A computer program product containing instructions, characterized in that, When the computer program product is run on the wastewater treatment plant modeling system, the wastewater treatment plant modeling system performs the method as described in any one of claims 1-7.

10. A computer-readable storage medium comprising instructions, characterized in that, When the instructions are executed on the wastewater treatment plant modeling system, the wastewater treatment plant modeling system performs the method as described in any one of claims 1-7.

Citation Information

Cited By

  • Artificial intelligence application management and control method and system for sewage treatment plant based on multi-modal model

    CN121722086A