Intelligent feces treatment system and method

By optimizing the adaptive neuro-fuzzy inference system and the Stacking integrated model, combined with the Mamdani reasoning method, precise control of the aeration volume in the manure treatment system is achieved, solving the problems of high energy consumption and redundant operating costs, and improving treatment efficiency and economic benefits.

CN120736670AActive Publication Date: 2025-10-03FUZHOU SHUNWEI TECHNOLOGY CO LTD

Patent Information

Application Number
CN202510853349.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-24
Publication Date
2025-10-03
Estimated Expiration
2045-06-24

AI Technical Summary

Technical Problem

In the existing technology, precise control of aeration volume during manure treatment is difficult to achieve, resulting in high energy consumption and redundant operating costs. Intelligent algorithm models have weak generalization capabilities and delayed rule base updates in applications, affecting the reliability and accuracy of aeration predictions.

Method used

The particle swarm algorithm is used to optimize the membership function parameters and fuzzy rules of the adaptive neuro-fuzzy inference system. Combined with the Stacking integrated model and Mamdani reasoning method, the COD concentration in the biochemical pool is predicted in real time and the blower frequency is dynamically adjusted to optimize the sludge return ratio and stirring intensity, and the lowest cost operation plan is formulated.

Benefits of technology

It achieves accurate prediction of COD concentration in the biochemical pool, dynamically adjusts aeration volume, reduces energy consumption, improves treatment efficiency and reduces operating costs, ensuring efficient and stable sewage treatment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120736670A_ABST
    Figure CN120736670A_ABST
Patent Text Reader

Abstract

The invention discloses an intelligent feces treatment system and method, and belongs to the field of sewage treatment.The intelligent feces treatment system comprises a data acquisition module used for collecting COD, ammonia nitrogen, DO, pH, water temperature, SS and microbial activity parameters of sewage in real time and conducting normalization processing on the collected water quality parameters to form a unified standard data basis; the first model module is used for optimizing membership function parameters and fuzzy rules of an adaptive neural fuzzy inference system by applying a particle swarm algorithm based on the data processed by the data acquisition module, outputting a predicted value of COD concentration in a biochemical pool in real time by training an ANFIS model, and forming a COD prediction model; and the second model module is used for constructing a Stacking integrated model by taking the COD predicted value in the first model module and the data processed in the data acquisition module as input, the integrated model comprises a base learner and a meta learner, and then a prediction result of the base learner is generated by adopting a five-fold cross validation mode.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of sewage treatment, and more specifically, to an intelligent sewage treatment system and method. Background Art

[0002] The current technology for treating manure and sewage generally involves filtering the manure to obtain sewage, and then using a biochemical reaction tank to aerate the sewage. The biochemical reaction tank is mainly used for the degradation of organic pollutants and denitrification and phosphorus removal. It is also the part with the highest energy consumption in the entire treatment process. The operation during the aeration process directly affects the efficiency of the biochemical reaction, and thus affects the degradation effect of organic pollutants and the effectiveness of denitrification and phosphorus removal. It also greatly affects whether the effluent water quality can meet the standards.

[0003] While striving to meet effluent water quality standards, how to effectively save energy and reduce redundant operating costs has become a major problem facing the current sewage treatment industry. Precision aeration can not only dynamically adjust the aeration volume according to real-time water quality conditions and improve the efficiency of biochemical reactions, but also significantly reduce energy consumption and improve the energy efficiency of the entire treatment system.

[0004] In practical applications, how to achieve precise aeration is a technical difficulty. In recent years, intelligent algorithms such as fuzzy reasoning and neural networks have been gradually introduced into the field of sewage treatment, providing new ideas for solving this problem. However, it is worth noting that single intelligent algorithm models often have problems such as weak generalization ability and delayed rule base update in practical applications, which to a certain extent limits their application effect. Taking the adaptive neural fuzzy inference system (ANFIS) as an example, the system has shown certain potential in the prediction of sewage treatment aeration volume. However, if its membership function parameters are not optimized, the prediction error of the ANFIS model will increase significantly, thereby affecting the realization of precise aeration. In addition, although conventional ensemble learning models can fuse multi-source data, their fusion ability is still limited when processing multi-source heterogeneous data, which directly affects the reliability and accuracy of aeration demand prediction. Summary of the Invention

[0005] In view of the problems existing in the prior art, the purpose of the present invention is to provide an intelligent manure and sewage treatment system and method, which can achieve...

[0006] To solve the above problems, the present invention adopts the following technical solutions.

[0007] In a first aspect, an intelligent manure and sewage treatment method comprises:

[0008] Step S1, real-time collection of COD, ammonia nitrogen, DO, pH, water temperature, SS, and microbial activity parameters of sewage, and normalization of the collected water quality parameters to form a unified standard data basis;

[0009] Step S2, based on the data processed in step S1, the membership function parameters and fuzzy rules of the adaptive neural fuzzy inference system are optimized using the particle swarm algorithm, and the predicted value of the COD concentration in the biochemical pool is output in real time by training the ANFIS model, thereby forming a COD prediction model;

[0010] Step S3: Based on the COD prediction value in step S2 and the data processed in step S1 as input, a stacking ensemble model is constructed. The ensemble model includes a base learner and a meta learner. The prediction results of the base learner are generated using a five-fold cross-validation method. These results are input into the meta learner for training, and the aeration volume demand M for the future period is output.

[0011] Step S4: Based on the aeration volume demand M for the future period in step S3 and the DO data in step S1, a fuzzy rule base is established to clarify the relationship between M and DO deviation. A PID parameter adjustment strategy is generated using the Mamdani reasoning method, and then the center of gravity method is used to defuzzify and output the blower frequency adjustment parameter to achieve real-time dynamic adjustment of the blower power.

[0012] Step S5: Analyze the effect of the blower frequency parameter on dissolved oxygen distribution and hydraulic shear force based on the blower frequency parameter and the real-time water quality data from step S1. Optimize the sludge return ratio and agitation intensity based on feedback from microbial activity to generate a hydraulic parameter combination that helps stabilize the microbial community.

[0013] S6: Based on the hydraulic parameters optimized in step S5, the aeration value predicted in step S3, and the time-of-use electricity price of the power grid and the daily sewage treatment volume demand, a minimum cost operation plan is formulated while meeting the daily treatment volume.

[0014] Furthermore, COD, ammonia nitrogen, DO, pH, water temperature, SS, and microbial activity parameters of sewage are collected in real time, and the collected water quality parameters are normalized to form a unified standard data foundation, including:

[0015] Step S11, using a COD online monitor, an ammonia nitrogen detector, a dissolved oxygen sensor, a pH meter, a water temperature probe, a suspended solids meter, and a microbial activity analyzer, real-time data collection is performed on the COD, ammonia nitrogen, DO, pH, water temperature, SS, and microbial activity parameters in the wastewater. During the data collection process, a preset sampling frequency is set.

[0016] In step S12, various water quality parameters collected in step S11 are normalized using a normalization algorithm to eliminate differences in the dimensions of different parameters, and the data are mapped to a unified numerical range to form a data basis with a unified standard.

[0017] Furthermore, based on the data processed in step S1, the particle swarm algorithm is used to optimize the membership function parameters and fuzzy rules of the adaptive neural fuzzy inference system. By training the ANFIS model, the predicted value of the COD concentration in the biochemical pool is output in real time, and a COD prediction model is formed, including:

[0018] Step S21, analyze the characteristics of the normalized sewage COD, ammonia nitrogen, and DO data, determine the initial parameters of the particle swarm algorithm and the adaptive neural fuzzy inference system, set the particle swarm scale, number of iterations, inertia weight, and learning factor parameters, and initialize the membership function type and initial parameters of the ANFIS and the fuzzy rule framework;

[0019] Step S22, applying the initial parameters determined in step S21 to the particle swarm algorithm, using the prediction error of the ANFIS model as the fitness function, optimizing the membership function parameters and fuzzy rules of the ANFIS by continuously iteratively searching in the solution space and updating their own positions and velocities. In each iteration, the performance of the ANFIS model corresponding to each particle is evaluated, and the parameter combination that optimizes the fitness function value is retained;

[0020] Step S23, substituting the membership function parameters and fuzzy rules optimized by the particle swarm algorithm in step S21 into the ANFIS model, and training the ANFIS model using the processed data. During the training process, the model parameters are continuously adjusted, and the training is repeated until the model reaches the set convergence condition;

[0021] In step S24, the trained ANFIS model is put into actual operation, with the data processed in step S1 as real-time input. The model outputs the predicted value of the COD concentration in the biochemical pool in real time. At the same time, the trained model structure, parameters and optimized fuzzy rules are saved to form a COD prediction model.

[0022] Furthermore, based on the COD prediction value in step S2 and the data processed in step S1 as input, a stacking ensemble model is constructed. The ensemble model includes a base learner and a meta learner. Then, a five-fold cross-validation method is used to generate the prediction results of the base learner. These results are input into the meta learner for training, and the aeration volume demand M for the future period is output, including:

[0023] Step S31, determining a base learner and a meta learner of the Stacking ensemble model based on the COD prediction value in step S2 and the data processed in step S1;

[0024] Step S32: merging the COD prediction value in step S2 with the data processed in step S1, and cleaning the processed data to remove duplicate data, check and process any missing values, and form an input data set;

[0025] Step S33: Use a five-fold cross-validation method to train and predict the base learner in step S31. Divide the data set processed in step S32 into five parts, select one part as the test set each time, and use the remaining four parts as the training set. Train each base learner in turn, and use the trained base learner to predict the test set, and record the prediction results of each time.

[0026] In step S34, all prediction results generated by the three base learners in step S33 under five-fold cross validation are collected and organized into a new feature matrix. This feature matrix is ​​used as input data to train the meta-learner in step S31, and the parameters of the meta-learner are continuously adjusted during the training process.

[0027] Further, including:

[0028] In step S351, the input data set processed in step S32 is re-input into the base learners initialized in step S31, and the prediction results of each base learner for the data set are obtained. These prediction results are integrated and input into the meta-learner trained in step S34. After processing by the meta-learner, the aeration volume demand M for the future time period is finally output.

[0029] Furthermore, based on the aeration volume demand M in the future period in step S3 and the DO data in step S1, a fuzzy rule base is established to clarify the relationship between M and DO deviation. The PID parameter adjustment strategy is generated by the Mamdani reasoning method, and then the center of gravity method is used to defuzzify and output the blower frequency adjustment parameter to achieve real-time dynamic adjustment of the blower power, including:

[0030] Step S41, obtaining the aeration volume demand M for the future period from step S351, and extracting the DO data processed in step S1, performing statistical analysis on the M and DO data, determining the variation range of the M and DO deviations, and dividing the data into multiple data intervals;

[0031] Step S42: Based on the data interval determined in step S41, at least two fuzzy linguistic variable sets are defined to describe the aeration volume demand M for the future period, and at least three fuzzy linguistic variable sets are defined to describe the DO deviation. Based on the sewage treatment process principles and actual operating experience, fuzzy rules are formulated between M and DO deviation, and a fuzzy rule base is constructed to clarify the adjustment strategies to be adopted under different combinations of M and DO deviation.

[0032] Step S43, fuzzifying the future time period aeration volume demand M and DO data in step S41 according to the fuzzy linguistic variables defined in step S42, and converting them into corresponding fuzzy set membership values ​​as inputs of the Mamdani reasoning method;

[0033] Step S44, using the input data fuzzified in step S43, combined with the fuzzy rule base constructed in step S42, logically reasoning through the Mamdani reasoning method to calculate the fuzzy output result of the PID parameter adjustment strategy;

[0034] In step S45 , the fuzzy output result of the PID parameter adjustment strategy obtained in step S44 is defuzzified using the center of gravity method, and the fuzzy quantity is converted into an accurate numerical value to obtain a specific PID parameter adjustment value.

[0035] Step S46: Based on the PID parameter adjustment value obtained in step S45, a mapping relationship is established with the blower frequency adjustment parameter, and the blower frequency adjustment parameter is output and sent to the blower control system as a control signal to realize real-time dynamic adjustment of the blower power.

[0036] Furthermore, based on the blower frequency parameters and the real-time water quality data in step S1, the effect of the blower frequency parameters on the dissolved oxygen distribution and hydraulic shear force is analyzed. Based on the feedback of microbial activity, the sludge return ratio and stirring intensity are optimized to generate a hydraulic parameter combination that helps stabilize the microbial community, including:

[0037] Step S51, based on the blower frequency adjustment parameters obtained in step S46, the real-time water quality data processed in step S1, including DO, SS, and microbial activity data, are extracted, the blower frequency parameters are correlated with the DO data in the real-time water quality data, and the distribution curves of dissolved oxygen over time and space at different blower frequencies are plotted to explore the effect of the blower frequency on the dissolved oxygen distribution;

[0038] Step S52: measuring the hydraulic shear force corresponding to the blower at different frequencies by experiments in advance, and recording the results to form a corresponding relationship between the different blower frequencies and the hydraulic shear force;

[0039] Step S53, comprehensively analyzing the relationship between the blower frequency and the hydraulic shear force determined in step S52 in combination with the microbial activity data in step S1, studying the changing trend of microbial activity under different hydraulic shear forces, and finding the hydraulic shear force threshold that has a positive effect on microbial activity;

[0040] Step S54: Based on the relationship between microbial activity and hydraulic shear force and the dissolved oxygen distribution obtained in step S53, a correlation model between sludge return ratio, agitation intensity, and microbial activity is established. By setting different combinations of sludge return ratio and agitation intensity parameters, the response of microbial activity is simulated, and a parameter combination that is conducive to improving microbial activity is screened out;

[0041] In step S55, the sludge return ratio and stirring intensity parameter combination selected in step S54 is evaluated in combination with the constraints of the actual sewage treatment process, and the parameter combination is further optimized using a genetic algorithm to generate a hydraulic parameter combination that helps stabilize the microbial community, including the optimal sludge return ratio and stirring intensity.

[0042] Furthermore, based on the hydraulic parameters optimized in step S5 and the aeration value predicted in step S3, as well as the time-of-use electricity price of the power grid and the daily sewage treatment capacity required, a minimum cost operation plan is formulated while meeting the daily treatment capacity, including:

[0043] Step S61: Obtain the optimized hydraulic parameters from step S55, extract the aeration volume demand M for the future time period predicted in step S35, collect time-of-use electricity price data from the power grid, clarify the electricity price standards for different time periods, and integrate these data based on the daily sewage treatment capacity demand of the sewage treatment plant to establish a basic data set;

[0044] Step S62: Based on the basic data set integrated in step S61, a sewage treatment cost model is constructed. The hydraulic parameters are correlated with the equipment energy consumption, and the aeration volume requirement M is correlated with the blower energy consumption. In combination with the time-of-use electricity price, the treatment cost for each period under different operating parameter combinations is calculated to clarify the quantitative relationship between the cost and each parameter.

[0045] In step S63, the objective function is set to minimize the total cost of sewage treatment for the day, based on the constraint of meeting the daily sewage treatment volume demand and the cost model constructed in step S62. A mathematical optimization algorithm is used to optimize the values ​​of hydraulic parameters and aeration volume at different time periods.

[0046] In step S64, the feasibility of the operating parameter combination scheme obtained by optimization in step S63 is verified to check whether each parameter is within the equipment operating capacity and whether it meets the technical requirements of the sewage treatment process. If there are infeasible parameters, the parameter value range is adjusted and the optimization solution is re-performed until a feasible operating parameter combination scheme is obtained.

[0047] Further, including:

[0048] Step S641: The feasible operating parameter combination scheme verified in step S64 is refined into specific operating instructions, and the specific values ​​of the sludge return ratio, stirring intensity, and aeration volume parameters for each time period are clarified to form the lowest cost operating scheme while meeting the daily processing volume, and output the scheme for actual production use.

[0049] In a second aspect, an intelligent manure and sewage treatment system is applied to the intelligent manure and sewage treatment method, comprising:

[0050] The data acquisition module is used to collect COD, ammonia nitrogen, DO, pH, water temperature, SS, and microbial activity parameters of sewage in real time, and normalize the collected water quality parameters to form a unified standard data basis;

[0051] The first model module uses the particle swarm algorithm to optimize the membership function parameters and fuzzy rules of the adaptive neural fuzzy inference system based on the data processed by the data acquisition module. By training the ANFIS model, it outputs the predicted value of the COD concentration in the biochemical pool in real time and forms a COD prediction model;

[0052] The second model module uses the COD prediction value in the first model module and the data processed in the data acquisition module as input to build a stacking ensemble model. The ensemble model includes a base learner and a meta learner. The prediction results of the base learner are generated using a five-fold cross-validation method. These results are input into the meta learner for training and output the aeration volume demand M for the future period.

[0053] The adjustment module establishes a fuzzy rule base based on the future aeration volume demand M in the second model module and the DO data in the data acquisition module, clarifies the relationship between M and DO deviation, generates a PID parameter adjustment strategy through the Mamdani reasoning method, and then uses the center of gravity method to defuzzify and output the blower frequency adjustment parameter to achieve real-time dynamic adjustment of the blower power;

[0054] The processing module analyzes the impact of blower frequency parameters on dissolved oxygen distribution and hydraulic shear force based on the blower frequency parameters and real-time water quality data from the data acquisition module. Based on the feedback of microbial activity, it optimizes the sludge return ratio and agitation intensity to generate a hydraulic parameter combination that helps stabilize the microbial community.

[0055] Scheme generation module: Based on the hydraulic parameters optimized in the treatment module, the aeration value predicted by the second model module, and the time-of-use electricity price of the power grid and the daily sewage treatment volume demand, the lowest cost operation plan is formulated while meeting the daily treatment volume.

[0056] Compared with the prior art, the present invention has the following beneficial effects:

[0057] (1) This solution collects and analyzes multiple key parameters in sewage in real time, and uses the particle swarm algorithm to optimize the membership function parameters and fuzzy rules of the adaptive neural fuzzy inference system to achieve accurate prediction of the COD concentration in the biochemical pool. This prediction model provides a reliable basis for subsequent aeration demand prediction, and then accurately predicts the aeration demand in future time periods through the Stacking integrated model. Based on these accurate predictions, the system can dynamically adjust the blower power to ensure that the aeration process not only meets the needs of biochemical reactions but also avoids unnecessary energy consumption. This intelligent control method significantly improves the efficiency of manure treatment, while effectively reducing energy consumption and achieving the goal of energy saving and consumption reduction.

[0058] (2) Based on the blower frequency parameters and real-time water quality data, this scheme deeply analyzes the impact of blower frequency on dissolved oxygen distribution and hydraulic shear force, and combines the feedback of microbial activity to optimize the sludge return ratio and stirring intensity, generating a hydraulic parameter combination that helps stabilize the microbial community. In addition, the system also comprehensively considers the time-of-use electricity price of the power grid and the daily sewage treatment volume demand, and formulates the lowest cost operation plan under the premise of meeting the daily treatment volume. This plan not only ensures the efficient and stable progress of sewage treatment, but also effectively reduces the operating cost and improves the overall economic benefits by rationally scheduling equipment operation. BRIEF DESCRIPTION OF THE DRAWINGS

[0059] To more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present invention. Those skilled in the art can also derive other drawings based on these drawings without inventive effort.

[0060] Figure 1 This is a flow chart of an intelligent manure and sewage treatment method of the present invention;

[0061] Figure 2 This is a module diagram of an intelligent manure and sewage treatment system of the present invention. DETAILED DESCRIPTION

[0062] The technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention; it is obvious that the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.

[0063] See also Figures 1 to 2 , an intelligent manure and sewage treatment method, comprising:

[0064] Step S1, real-time collection of COD, ammonia nitrogen, DO, pH, water temperature, SS, and microbial activity parameters of sewage, and normalization of the collected water quality parameters to form a unified standard data basis;

[0065] Step S2, based on the data processed in step S1, the membership function parameters and fuzzy rules of the adaptive neural fuzzy inference system are optimized using the particle swarm algorithm, and the predicted value of the COD concentration in the biochemical pool is output in real time by training the ANFIS model, thereby forming a COD prediction model;

[0066] Step S3: Based on the COD prediction value in step S2 and the data processed in step S1 as input, a stacking ensemble model is constructed. The ensemble model includes a base learner and a meta learner. The prediction results of the base learner are generated using a five-fold cross-validation method. These results are input into the meta learner for training, and the aeration volume demand M for the future period is output.

[0067] Step S4: Based on the aeration volume demand M for the future period in step S3 and the DO data in step S1, a fuzzy rule base is established to clarify the relationship between M and DO deviation. A PID parameter adjustment strategy is generated using the Mamdani reasoning method, and then the center of gravity method is used to defuzzify and output the blower frequency adjustment parameter to achieve real-time dynamic adjustment of the blower power.

[0068] Step S5: Analyze the effect of the blower frequency parameter on dissolved oxygen distribution and hydraulic shear force based on the blower frequency parameter and the real-time water quality data from step S1. Optimize the sludge return ratio and agitation intensity based on feedback from microbial activity to generate a hydraulic parameter combination that helps stabilize the microbial community.

[0069] S6: Based on the hydraulic parameters optimized in step S5, the aeration value predicted in step S3, and the time-of-use electricity price of the power grid and the daily sewage treatment volume demand, a minimum cost operation plan is formulated while meeting the daily treatment volume.

[0070] Step S1 includes the following:

[0071] Step S11, using a COD online monitor, an ammonia nitrogen detector, a dissolved oxygen sensor, a pH meter, a water temperature probe, a suspended solids meter, and a microbial activity analyzer, real-time data collection is performed on the COD, ammonia nitrogen, DO, pH, water temperature, SS, and microbial activity parameters in the wastewater. During the data collection process, a preset sampling frequency is set.

[0072] In step S12, various water quality parameters collected in step S11 are normalized using a normalization algorithm to eliminate differences in the dimensions of different parameters, and the data are mapped to a unified numerical range to form a data basis with a unified standard.

[0073] In this embodiment, water quality parameters include COD, ammonia nitrogen, DO, pH, water temperature, SS, microbial activity and other parameters in sewage. These parameters are normalized to eliminate the differences in the dimensions and numerical ranges of different parameters and map the data to a unified interval, commonly [0, 1] or [-1, 1]. The most commonly used normalization method is minimum-maximum normalization, and its calculation formula is: Among them, x is the original data; x min and x max are the minimum and maximum values ​​of the parameter in the data set; x norm is the normalized data. Through this formula, all the data of each parameter are mapped to the interval [0,1]. For example, if the minimum value of a set of COD data is 10mg / L and the maximum value is 100mg / L, when a certain measured COD value is 30mg / L, the normalized value is After normalization, different water quality parameters, such as COD, ammonia nitrogen and other data have the same dimensions and numerical ranges, providing a unified standard data basis for subsequent data analysis, model construction, etc., avoiding the dominant position of certain parameters in the analysis process due to dimensional differences, affecting the accuracy and reliability of the analysis results.

[0074] In a preferred embodiment of the present invention, step S2 includes the following:

[0075] Step S21, analyze the characteristics of the normalized sewage COD, ammonia nitrogen, and DO data, determine the initial parameters of the particle swarm algorithm and the adaptive neural fuzzy inference system, set the particle swarm scale, number of iterations, inertia weight, and learning factor parameters, and initialize the membership function type and initial parameters of the ANFIS and the fuzzy rule framework;

[0076] Step S22, applying the initial parameters determined in step S21 to the particle swarm algorithm, using the prediction error of the ANFIS model as the fitness function, optimizing the membership function parameters and fuzzy rules of the ANFIS by continuously iteratively searching in the solution space and updating their own positions and velocities. In each iteration, the performance of the ANFIS model corresponding to each particle is evaluated, and the parameter combination that optimizes the fitness function value is retained;

[0077] Step S23, substituting the membership function parameters and fuzzy rules optimized by the particle swarm algorithm in step S21 into the ANFIS model, and training the ANFIS model using the processed data. During the training process, the model parameters are continuously adjusted, and the training is repeated until the model reaches the set convergence condition;

[0078] In step S24, the trained ANFIS model is put into actual operation, with the data processed in step S1 as real-time input. The model outputs the predicted value of the COD concentration in the biochemical pool in real time. At the same time, the trained model structure, parameters and optimized fuzzy rules are saved to form a COD prediction model.

[0079] In this embodiment, statistical analysis is performed on the normalized sewage COD, ammonia nitrogen, and DO data, such as calculating the mean, variance, and correlation, to understand the distribution characteristics of the data and the relationship between variables. These characteristics will affect the setting of the initial parameters of the particle swarm optimization algorithm and the adaptive neural fuzzy inference system (ANFIS).

[0080] For setting the size of the particle swarm, number of iterations, inertia weight, and learning factor parameters, the particle swarm size is generally set to 20-50 particles. If the size is too small, it is easy to fall into the local optimum, and if it is too large, the computational burden will be increased. The number of iterations is set according to the convergence speed and accuracy requirements, usually 100-500 times. The inertia weight ω can be initially set to 0.9 and then adjusted according to the search situation. If the algorithm needs to search for the global optimum in a large range in the early stage, it can be kept at a large value, such as 0.9. In the later stage of iteration, the local optimum is searched finely, and the value of ω is gradually reduced. The learning factors are c1 and c2, and the initial setting is 0.9. The setting can be c1=c2=2, allowing particles to learn evenly towards the individual optimal and global optimal positions. In the scenario of optimizing ANFIS model parameters, try this value first to observe the algorithm convergence speed and accuracy. If it falls into the local optimal position too early, adjust it again. It can be adjusted according to the distance between the particle and the global optimal position. If the particle is far away from the global optimal position, increase c1 to encourage self-exploration; if it is close, increase c2 to promote it to move closer to the group optimal position. By calculating the Euclidean distance between the particle position and the global optimal position, dynamically change the values ​​of c1 and c2, and make the algorithm more flexible to adapt to complex sewage treatment parameter optimization tasks.

[0081] For the setting of ANFIS initial parameters, according to the characteristics of the data, Gaussian type can be selected as the initial membership function type. For the selected membership function type, its initial parameters are set. Taking Gaussian membership function as an example, its parameters include mean and standard deviation. These initial parameters can be roughly estimated according to the distribution range of the data. For example, the mean can be set to the data mean, and the standard deviation can be set to a certain proportion of the data standard deviation. Fuzzy rules are the basis for ANFIS reasoning, and its framework is constructed based on the relationship between input and output variables. For example, for a model with COD, ammonia nitrogen, and DO as input and COD concentration prediction value as output, fuzzy rules can be preliminarily set based on experience, such as "If COD is high, ammonia nitrogen is low, and DO is moderate, then the COD concentration prediction value is high". This rule form constitutes the initial fuzzy rule framework.

[0082] In the particle swarm algorithm, each particle represents a set of ANFIS model parameters in the solution space, such as membership function parameters and fuzzy rule related parameters. The particle has two attributes: position and velocity. Its position corresponds to the parameter value of the ANFIS model, and the velocity determines the update direction and step size of the position. The prediction error of the ANFIS model is used as the fitness function. Commonly used prediction error indicators such as mean square error (MSE) are calculated as follows: Where n is the number of samples, y i is the actual COD concentration value, y ui is the COD concentration value predicted by the ANFIS model. The smaller the fitness function value, the better the prediction effect of the ANFIS model.

[0083] In each iteration, the particle updates its position and velocity according to the following formula:

[0084] Velocity update formula:

[0085] in, is the velocity of particle i in the dth dimension at the k+1th iteration; is the velocity of particle i in the dth dimension at the kth iteration; and are two random numbers between [0,1]; is the individual optimal position of particle i at the kth iteration; is the global optimal position of the entire particle swarm at the kth iteration; The position of particle i in the dth dimension at the kth iteration.

[0086] Position update formula: Through continuous iteration, particles search in the solution space, update their own positions and velocities, and look for the parameter combination that minimizes the fitness function value. That is, the membership function parameters and fuzzy rules of ANFIS are optimized. After each iteration, the performance of the ANFIS model corresponding to each particle is evaluated, and the parameter combination that optimizes the fitness function value is retained.

[0087] ANFIS combines the learning ability of neural networks and the language expression ability of fuzzy reasoning systems. After the membership function parameters and fuzzy rules optimized by the particle swarm algorithm are substituted into the ANFIS model, the model is trained using normalized sewage data. During the training process, ANFIS adopts a hybrid learning algorithm, that is, the least squares method is used for forward propagation and the gradient descent method is used for back propagation. During forward propagation, the input data is used to calculate the membership of each fuzzy set through the membership function, and then the output value is obtained through fuzzy rule reasoning and defuzzification; then the error between the output value and the actual value is calculated, and the error is passed back to the network through back propagation. The membership function parameters are adjusted using the gradient descent method to gradually reduce the error. This process is repeated until the model reaches the set convergence conditions, such as the mean square error is less than a certain threshold, or the number of iterations reaches the preset value. At this time, the ANFIS model completes training and can perform well. The relationship between the input data and the COD concentration is accurately fitted, and the trained ANFIS model is put into actual operation. The data after normalization in step S1 is used as real-time input. The model uses the trained parameters and fuzzy rules based on the input sewage COD, ammonia nitrogen, DO and other data, and through fuzzy reasoning and calculation, outputs the predicted value of the COD concentration in the biochemical pool in real time, providing a decision-making basis for process adjustment and management in the sewage treatment process. The trained model structure, including input and output variables, membership function type and quantity, fuzzy rule framework, membership function parameters and optimized fuzzy rules, is saved to form a complete COD prediction model. The saved model can be directly called in subsequent use for COD concentration prediction of new data, which is also convenient for model maintenance and updating.

[0088] In a preferred embodiment of the present invention, step S3 includes the following:

[0089] Step S31, determining a base learner and a meta learner of the Stacking ensemble model based on the COD prediction value in step S2 and the data processed in step S1;

[0090] Step S32: merging the COD prediction value in step S2 with the data processed in step S1, and cleaning the processed data to remove duplicate data, check and process any missing values, and form an input data set;

[0091] Step S33: Use a five-fold cross-validation method to train and predict the base learner in step S31. Divide the data set processed in step S32 into five parts, select one part as the test set each time, and use the remaining four parts as the training set. Train each base learner in turn, and use the trained base learner to predict the test set, and record the prediction results of each time.

[0092] Step S34: Collect all prediction results generated by the three base learners in step S33 under five-fold cross validation, organize them into a new feature matrix, and use this feature matrix as input data to train the meta-learner in step S31. The parameters of the meta-learner are continuously adjusted during the training process.

[0093] Step S34 includes step S341, which re-inputs the input data set processed in step S32 into the base learner initialized in step S31, obtains the prediction results of each base learner for the data set, integrates these prediction results, and inputs them into the meta-learner trained in step S34. After processing by the meta-learner, the aeration volume demand M for the future time period is finally output.

[0094] In this embodiment, the Stacking ensemble model combines the prediction results of multiple base learners and then uses a meta-learner for secondary learning to improve the model's prediction performance. Based on the COD prediction value in step S2 and the characteristics of the data processed in step S1, the appropriate base learner and meta-learner are determined. The base learner is the underlying learning unit of the Stacking model. Its function is to perform preliminary processing and prediction on the original data. Linear regression models, decision tree models, and support vector machine models can be selected as base learners. By selecting models based on different principles, data can be analyzed and predicted from multiple perspectives, providing richer information for subsequent meta-learners. The role of the meta-learner is to learn the relationship between the prediction results of the base learners and the true values, and to integrate and optimize the outputs of the base learners. Common meta-learners include logistic regression and neural networks. The appropriate meta-learner is selected based on the complexity of the data and the prediction target. If the data relationship is relatively simple, logistic regression can be used as a meta-learner; if the data relationship is complex, a neural network may be more suitable. After determining the meta-learner, it needs to be initialized and initial parameters such as the number of layers and neurons of the neural network need to be set.

[0095] The COD prediction value in step S2 is merged with the data processed in step S1. These data contain multi-dimensional information such as COD, ammonia nitrogen, DO, pH, water temperature, SS, microbial activity, and the COD concentration value predicted by the ANFIS model. The merged data set contains more comprehensive information and can more accurately reflect the relationship between sewage water quality and COD concentration, providing richer data support for subsequent model training. During the data collection and processing process, duplicate records may appear. Duplicate data not only takes up computing resources, but also may affect the accuracy of model training. By comparing all fields of each record in the data set, we can find exactly the same records and delete duplicates to ensure that each record in the data set is unique, thereby improving the quality and validity of the data. During the data collection and processing process, for the actual data, first, check whether there are missing values ​​in the data set. This can be determined by counting the number of non-null values ​​in each field. There are many ways to deal with missing values, such as deleting the records where the missing values ​​are located, but this method may result in a reduction in data volume and information loss. You can also use statistics such as mean, median, and mode to fill in missing values. For example, for the numerical variable COD concentration, the mean of the variable can be used to fill in missing values. You can also use more complex interpolation methods or model-based prediction methods to estimate missing values, such as using the K nearest neighbor algorithm to fill in missing values ​​based on the values ​​of other records similar to the missing value records.

[0096] Each time, one piece of data is selected as the test set, and the remaining four pieces of data are used as training sets. For example, during the first training, the first piece of data is used as the test set, and the second, third, fourth, and fifth pieces of data are used as training sets. The training set data is used to train the base learner to learn the regularities and patterns in the data. After training, the trained base learner is used to predict the test set to obtain the prediction results of the base learner on this fold of the test set. In the same way, the other four pieces of data are used as test sets, and training and prediction are performed five times in total. In this way, each base learner has undergone five training and prediction cycles, which allows it to more fully learn the data characteristics and more accurately evaluate the performance of the model on different data subsets. Through five-fold cross-validation, the model evaluation bias caused by unreasonable data division can be reduced and the generalization ability of the model can be improved. All prediction results generated by the three base learners under five-fold cross-validation in step S33 are collected. Since each base learner makes five predictions, each prediction will generate a prediction value. For each sample, five prediction values ​​of the three base learners will be obtained, a total of 15 prediction values, specifically 3 base learners × 5 predictions. These prediction values ​​are organized into a new feature matrix. Each row of the feature matrix corresponds to a sample, and each column corresponds to the prediction result of a base learner on a certain fold test set. This new feature matrix contains the prediction information of the base learner on the original data from different angles. As the input data of the meta-learner, it can provide the meta-learner with richer features to help it learn the relationship between the prediction results of the base learner and the true value. The sorted feature matrix is ​​used as input data to train the meta-learner in step S31. During the training process, the meta-learner learns how to map the prediction results of the base learner to the true value by adjusting its own parameters, such as the weight coefficient of the logistic regression model, the connection weight of the neural network, etc., based on the input feature matrix and the corresponding true value, that is, the actual aeration volume demand. A suitable loss function, such as the mean square error for regression problems, is used to measure the difference between the predicted value and the true value. The parameters of the meta-learner are continuously adjusted through an optimization algorithm, such as the gradient descent method, to minimize the loss function value, thereby improving the prediction accuracy of the meta-learner. The processed input data set is re-input into In step S31, the initialized base learners are completed. Each base learner predicts the data set based on the rules it has learned, and obtains its own prediction results. After integrating these prediction results, new input data is formed and input into the trained meta-learner. The meta-learner uses the knowledge and parameters learned during the training process to process and analyze the prediction results of the base learners. Through the internal calculation and reasoning process, it finally outputs the aeration volume demand M for the future time period. This process is the core of the practical application of the Stacking integrated model. Through the collaborative work of the base learner and the meta-learner, accurate prediction of the aeration volume demand for the future time period is achieved, providing a scientific basis for aeration control in the sewage treatment process.

[0097] In a preferred embodiment of the present invention, step S4 includes the following:

[0098] Step S41, obtaining the aeration volume demand M for the future period from step S341, and extracting the DO data processed in step S1, performing statistical analysis on the M and DO data, determining the variation range of the M and DO deviations, and dividing the data into multiple data intervals;

[0099] Step S42: Based on the data interval determined in step S41, at least two fuzzy linguistic variable sets are defined to describe the aeration volume demand M for the future period, and at least three fuzzy linguistic variable sets are defined to describe the DO deviation. Based on the sewage treatment process principles and actual operating experience, fuzzy rules are formulated between M and DO deviation, and a fuzzy rule base is constructed to clarify the adjustment strategies to be adopted under different combinations of M and DO deviation.

[0100] Step S43, fuzzifying the future time period aeration volume demand M and DO data in step S41 according to the fuzzy linguistic variables defined in step S42, and converting them into corresponding fuzzy set membership values ​​as inputs of the Mamdani reasoning method;

[0101] Step S44, using the input data fuzzified in step S43, combined with the fuzzy rule base constructed in step S42, logically reasoning through the Mamdani reasoning method to calculate the fuzzy output result of the PID parameter adjustment strategy;

[0102] In step S45 , the fuzzy output result of the PID parameter adjustment strategy obtained in step S44 is defuzzified using the center of gravity method, and the fuzzy quantity is converted into an accurate numerical value to obtain a specific PID parameter adjustment value.

[0103] Step S46: Based on the PID parameter adjustment value obtained in step S45, a mapping relationship is established with the blower frequency adjustment parameter, and the blower frequency adjustment parameter is output and sent to the blower control system as a control signal to realize real-time dynamic adjustment of the blower power.

[0104] In this embodiment, the aeration volume demand M for the future period is first obtained, and the dissolved oxygen (DO) data after treatment in step S1 is extracted at the same time. The aeration volume demand M for the future period is predicted by the Stacking integrated model, and the DO data is one of the sewage water quality parameters collected in real time and processed by normalization. Both reflect the key information in the sewage treatment process. Statistical analysis is performed on the M and DO data. Common statistical indicators include mean, standard deviation, maximum value, minimum value, etc. By calculating these statistics, the central tendency and dispersion degree of the data can be understood. For example, the mean of the DO data is calculated. and standard deviation s, with is the reference partition interval boundary, where k p is a constant, such as 1, 2; observe the variation range of M and DO deviation, and divide them into multiple data intervals according to the data distribution characteristics and sewage treatment process requirements. For example, the DO deviation is divided into intervals such as "negative medium", "negative small", "zero", "positive small", "positive medium", and "positive large", and the aeration volume demand M is divided into intervals such as "low", "medium-low", "medium", "medium-high", and "high", in preparation for subsequent fuzzy processing and rule formulation.

[0105] Based on the determined data interval, at least two fuzzy linguistic variable sets are defined to describe the aeration volume demand M in the future period. For example, three fuzzy linguistic variables, "low aeration volume", "medium aeration volume" and "high aeration volume" are defined. Each fuzzy linguistic variable corresponds to a fuzzy set. The degree to which the data belongs to the fuzzy set is described by the membership function. The membership function can be selected from triangular, trapezoidal, Gaussian and the like. For example, a trapezoidal membership function is used for "low aeration volume". The function parameters are set according to the divided data interval to determine the membership degree of different aeration volume demand values ​​to the fuzzy set of "low aeration volume"; at least three fuzzy linguistic variable sets are defined to describe the DO deviation, such as "DO deviation is large negative", "DO deviation is medium negative", "DO deviation is small negative", "DO deviation is zero", "DO deviation is small positive", "DO deviation is medium positive" and "DO deviation is large positive". Similarly, for each fuzzy linguistic variable, a The corresponding membership function is defined to determine the membership relationship between the DO deviation value and each fuzzy set; fuzzy rules are formulated according to the sewage treatment process principle and actual operation experience. In the sewage treatment process, the aeration volume is closely related to the DO concentration. For example, when the aeration volume demand M is "high" and the DO deviation is "negative and large", it means that the current aeration volume is insufficient and the aeration volume needs to be increased, that is, the blower power should be increased; when the aeration volume demand M is "low" and the DO deviation is "positive and large", it means that the aeration volume is too large and the blower power should be reduced. These experiences are summarized into fuzzy rules in the form of "if...then...", such as "If the aeration volume demand M is high and the DO deviation is negative and large, then the PID parameter adjustment strategy is to significantly increase the proportional coefficient, appropriately increase the integral coefficient, and slightly increase the differential coefficient". A fuzzy rule base is constructed to clarify the adjustment strategy to be adopted under different combinations of M and DO deviation.

[0106] For the aeration volume demand M for the future period, according to the membership function defined in step S42, and the membership degree is the result of substituting the input value into the membership function, the fuzzy linguistic variables belonging to M are calculated and input into the corresponding membership function to obtain the corresponding membership degree. Then, based on the fuzzy set membership values ​​corresponding to the aeration volume demand M for the future period and the DO data, the constructed fuzzy rule base performs logical reasoning. For each fuzzy rule, the antecedent of the rule, that is, the satisfaction degree of the "if" part, is first calculated, that is, the membership degrees of multiple input fuzzy sets are "AND" operated, usually using the minimum value method. Then, according to the consequent of the rule, that is, the "then" part, the satisfaction degree of the antecedent is applied to the output fuzzy set, and the output fuzzy set corresponding to the rule is obtained by "truncation" or "scaling". After performing the above operations on all rules, the output fuzzy sets of each rule are "OR" operated, usually using the maximum value method, to obtain the final fuzzy output result of the PID parameter adjustment strategy.

[0107] For the aeration volume demand M in the future period, according to the membership function, calculate the membership of M to the fuzzy sets corresponding to each fuzzy linguistic variable, such as "low aeration volume", "medium aeration volume", and "high aeration volume", and then calculate its membership to the fuzzy sets corresponding to each DO deviation fuzzy linguistic variable, such as "large negative DO deviation", "medium negative DO deviation", etc. These calculated membership values ​​are used as the input of the Mamdani reasoning method to realize the conversion from precise data to fuzzy data.

[0108] Based on the constructed fuzzy rule base, logical reasoning is performed through the Mamdani reasoning method to calculate the fuzzy output results of the PID parameter adjustment strategy. The specific operation is to regard the fuzzy output results as an overall graph. The horizontal axis of the graph represents the adjustment amount of the PID parameter, and the vertical axis represents the membership corresponding to each adjustment amount. By calculating the "center of gravity" position of this graph, the accurate PID parameter adjustment value can be obtained. The horizontal axis value corresponding to this "center of gravity" position is the specific PID parameter adjustment value required in the end. With this precise value, the sewage treatment equipment can be accurately controlled to operate according to appropriate parameters to ensure the effect and efficiency of sewage treatment.

[0109] Based on the obtained PID parameter adjustment value, a mapping relationship with the blower frequency adjustment parameter is established. This mapping relationship is based on the working characteristics between the PID controller and the blower in the sewage treatment system, and is determined through experiments or actual operation data fitting. For example, the relationship between the PID parameter adjustment value and the blower frequency adjustment parameter is established through experimental testing, and recorded and stored. The recorded blower frequency adjustment parameter is sent as a control signal to the blower control system. After receiving the signal, the blower control system adjusts the power of the blower according to the parameter to achieve real-time dynamic adjustment of the blower power. For example, if the calculated blower frequency adjustment parameter is an increase of 10%, the blower control system will increase the operating frequency of the blower by 10%, thereby adjusting the aeration volume, so that the DO concentration in the sewage treatment process is maintained at an appropriate level, and stable operation of the sewage treatment process is ensured.

[0110] In a preferred embodiment of the present invention, step S5 includes the following:

[0111] Step S51, based on the blower frequency adjustment parameters obtained in step S46, the real-time water quality data processed in step S1, including DO, SS, and microbial activity data, are extracted, the blower frequency parameters are correlated with the DO data in the real-time water quality data, and the distribution curves of dissolved oxygen over time and space at different blower frequencies are plotted to explore the effect of the blower frequency on the dissolved oxygen distribution;

[0112] Step S52: measuring the hydraulic shear force corresponding to the blower at different frequencies by experiments in advance, and recording the results to form a corresponding relationship between the different blower frequencies and the hydraulic shear force;

[0113] Step S53, comprehensively analyzing the relationship between the blower frequency and the hydraulic shear force determined in step S52 in combination with the microbial activity data in step S1, studying the changing trend of microbial activity under different hydraulic shear forces, and finding the hydraulic shear force threshold that has a positive effect on microbial activity;

[0114] Step S54: Based on the relationship between microbial activity and hydraulic shear force and the dissolved oxygen distribution obtained in step S53, a correlation model between sludge return ratio, agitation intensity, and microbial activity is established. By setting different combinations of sludge return ratio and agitation intensity parameters, the response of microbial activity is simulated, and a parameter combination that is conducive to improving microbial activity is screened out;

[0115] In step S55, the sludge return ratio and stirring intensity parameter combination selected in step S54 is evaluated in combination with the constraints of the actual sewage treatment process, and the parameter combination is further optimized using a genetic algorithm to generate a hydraulic parameter combination that helps stabilize the microbial community, including the optimal sludge return ratio and stirring intensity.

[0116] In this embodiment, based on the obtained blower frequency adjustment parameters, the real-time water quality data after treatment in step S1 are extracted at the same time, including dissolved oxygen DO, suspended solids SS and microbial activity data. These data are key parameters in the sewage treatment process. The blower frequency adjustment parameters reflect the operating status of the aeration equipment, and DO, SS and microbial activity data reflect the sewage quality and biochemical treatment effect. The blower frequency parameters are correlated with the DO data in the real-time water quality data. The corresponding relationship between the blower frequency and DO concentration at different times is recorded through the time series analysis method. In the spatial dimension, DO sensors can be arranged at different positions in the biochemical pool to obtain the DO values ​​at each position when the blower is running. According to the data, statistical methods such as calculating the correlation coefficient are used to quantify the degree of linear relationship between the blower frequency and the DO concentration. Then, based on these data, drawing software such as Python's Matplotlib library and Origin are used to draw the distribution curve of dissolved oxygen over time and space under different blower frequencies. In the curve, the horizontal axis can represent time or spatial position, and the vertical axis represents DO concentration. Different blower frequencies are distinguished by different colors or line types. By observing these curves, the effect of blower frequency on dissolved oxygen distribution can be intuitively explored, such as whether the DO concentration can be increased faster under high blower frequency, and how uniform the DO concentration is at different positions in the biochemical pool.

[0117] Through experiments, the blower is set to different operating frequencies, and for each frequency point, the corresponding hydraulic shear force value is accurately measured, such as using a micro piezoresistive sensor for testing. At each frequency, wait for the flow field of the biochemical pool to stabilize for about 10-30 minutes, and use a shear force sensor for multi-point measurement, such as arranging 3-5 sensors in different areas of the biochemical pool, and take the average value as the hydraulic shear force at that frequency. To ensure the accuracy and reliability of the data, the hydraulic shear force measurement at each frequency point should be repeated multiple times, and the average value should be taken as the final measurement result at that frequency. After completing the measurement of all frequency points, the different frequencies measured in the experiment and their corresponding hydraulic shear force data are recorded in detail, and a clear corresponding data set of different blower frequencies and hydraulic shear forces is compiled for subsequent query and use in applications.

[0118] The relationship between the determined blower frequency and hydraulic shear force was combined with microbial activity data for a comprehensive analysis. Microbial activity data can be characterized by measuring indicators such as microbial respiration rate, ATP content, and enzyme activity. The hydraulic shear force values ​​corresponding to different blower frequencies were integrated with the microbial activity data from the same period to form a data set containing blower frequency, hydraulic shear force, and microbial activity. Data analysis methods such as regression analysis and curve fitting were used to study the changing trends of microbial activity under different hydraulic shear forces. For example, by plotting a curve showing the change in microbial activity as a function of hydraulic shear force, it was observed whether microbial activity increased, decreased, or first increased and then decreased with increasing hydraulic shear force. By analyzing the curve, the hydraulic shear force range corresponding to the optimal microbial activity was identified, that is, the hydraulic shear force threshold that has a positive impact on microbial activity. This threshold is crucial for optimizing wastewater treatment processes, as appropriate hydraulic shear force helps maintain microbial activity and promotes biochemical reactions during wastewater treatment.

[0119] Based on the obtained relationship between microbial activity and hydraulic shear force, as well as the obtained dissolved oxygen distribution, a correlation model between sludge return ratio, stirring intensity and microbial activity was established. Sludge return ratio and stirring intensity are important operating parameters in the sewage treatment process. They will affect the mixing degree of sewage in the biochemical tank, the contact efficiency between substrate and microorganisms, etc., and thus affect microbial activity. Using a neural network model, etc., the sludge return ratio and stirring intensity are used as input variables, and microbial activity is used as the output variable. The model is trained in combination with existing data. During the training process, the model parameters are adjusted so that the model can accurately describe the relationship between the input variables and the output variables. By setting different sludge return ratio and stirring intensity parameter combinations, these combinations are input into the established correlation model to simulate the response of microbial activity. A series of parameter combinations can be generated by grid search, random search, etc., and then the model is used to calculate the predicted value of microbial activity under each parameter combination. The microbial activity prediction results under different parameter combinations are compared to screen out parameter combinations that can significantly improve microbial activity. These parameter combinations provide candidate solutions for subsequent process optimization.

[0120] The selected combinations of sludge return ratio and agitation intensity parameters were evaluated in conjunction with the constraints of the actual wastewater treatment process. These constraints included equipment operating capacity, such as the maximum power limit of the agitation equipment, the flow range of the sludge return pump, treatment costs, such as energy and reagent costs, and effluent quality requirements, such as limits on COD and ammonia nitrogen. For each parameter combination, its feasibility and economic benefits were calculated while meeting the actual constraints. Combinations that did not meet the constraints or had poor economic benefits were excluded. A genetic algorithm is used to further optimize the remaining parameter combinations. During the operation of the algorithm, selection operations are performed based on the fitness function value of the individual, which can be defined as an evaluation index that comprehensively considers factors such as microbial activity, treatment cost, and effluent water quality, so as to retain individuals with higher fitness. Through crossover operations, some genes of two individuals are exchanged to generate new individuals. Through mutation operations, certain genes of individuals are randomly changed to increase the diversity of the population. After multiple generations of evolution, the genetic algorithm can search for the optimal or better parameter combination in the parameter space, that is, generate a hydraulic parameter combination that helps to stabilize the microbial community, including the optimal sludge return ratio and stirring intensity, thereby realizing the optimization of the sewage treatment process.

[0121] In a preferred embodiment of the present invention, step S6 includes the following:

[0122] Step S61: Obtain the optimized hydraulic parameters from step S55, extract the aeration volume demand M for the future time period predicted in step S35, collect time-of-use electricity price data from the power grid, clarify the electricity price standards for different time periods, and integrate these data based on the daily sewage treatment capacity demand of the sewage treatment plant to establish a basic data set;

[0123] Step S62: Based on the basic data set integrated in step S61, a sewage treatment cost model is constructed. The hydraulic parameters are correlated with the equipment energy consumption, and the aeration volume requirement M is correlated with the blower energy consumption. In combination with the time-of-use electricity price, the treatment cost for each period under different operating parameter combinations is calculated to clarify the quantitative relationship between the cost and each parameter.

[0124] In step S63, the objective function is set to minimize the total cost of sewage treatment for the day, based on the constraint of meeting the daily sewage treatment volume demand and the cost model constructed in step S62. A mathematical optimization algorithm is used to optimize the values ​​of hydraulic parameters and aeration volume at different time periods.

[0125] Step S64: Feasibility verification is performed on the operating parameter combination scheme obtained by optimization in step S63 to check whether each parameter is within the equipment operating capacity range and whether it meets the technical requirements of the sewage treatment process. If there are infeasible parameters, the parameter value range is adjusted and the optimization solution is re-performed until a feasible operating parameter combination scheme is obtained;

[0126] Step S64 includes step S641, which verifies the feasible operating parameter combination plan in step S64 and refines it into specific operating instructions, clarifies the specific values ​​of the sludge return ratio, stirring intensity, and aeration volume parameters in each time period, forms the lowest cost operating plan while meeting the daily processing volume, and outputs the plan for actual production use.

[0127] In this embodiment, the hydraulic parameters obtained by genetic algorithm optimization are obtained, including the optimal sludge return ratio and stirring intensity; the predicted aeration demand M in the future period is extracted, and the demand value is obtained by analyzing and predicting the sewage water quality parameters based on the Stacking integrated model; the time-of-use electricity price data of the power grid are collected to clarify the electricity price standards for different time periods, such as peak time, valley time, and normal time. The electricity price data can be obtained through information released by the power department or real-time power trading platform; combined with the daily sewage treatment capacity demand of the sewage treatment plant, which is usually determined based on factors such as the population of the service area and industrial discharge volume, these data respectively reflect the sewage treatment capacity demand, the demand for sewage treatment capacity, and the demand for sewage treatment capacity. Water treatment process parameters, energy costs and treatment task requirements, integrate the above-obtained data to establish a basic data set, and use time as the dimension to associate the hydraulic parameters, aeration volume requirements, electricity price standards and daily sewage treatment volume requirements corresponding to each time period. For example, divide a day into 24 hours, record the sludge return ratio, stirring intensity, aeration volume requirement M, electricity price and the amount of sewage that needs to be treated in this period for each hour, and form a structured data table or database table. Through data integration, different types of data can be unified to provide a comprehensive data foundation for the subsequent construction of cost models and optimization analysis.

[0128] The hydraulic parameters such as sludge return ratio and stirring intensity are associated with the energy consumption of related equipment such as sludge return pump and stirring equipment. For example, the mapping relationship between the sludge return ratio Z at different sizes and the sludge return pump power P1 is measured in advance through experiments; the mapping relationship between the stirring intensity H at different sizes and the stirring equipment power P2 is measured through experiments, and then the energy consumption of the corresponding equipment in each time period is calculated based on the power and running time; the mapping relationship between the required aeration volume M and the blower power P3 is determined through experiments, and the blower power P3 is calculated based on the power and running time. The energy consumption of each time period is combined with the time-of-use electricity price. The energy consumption of each device in different time periods is multiplied by the electricity price of the corresponding time period to calculate the treatment cost of each time period under each combination of operating parameters. For example, in a certain period, the energy consumption of the sludge return pump is E1, the energy consumption of the mixing equipment is E2, and the energy consumption of the blower is E3. The electricity price of this period is p, then the treatment cost of this period is C = (E1 + E2 + E3) × p. By calculating the cost of each time period under different operating parameter combinations, the quantitative relationship between the cost and various parameters such as hydraulic parameters and aeration volume requirements is analyzed to clarify the degree of influence of each parameter on the cost. With the daily sewage treatment volume demand as the constraint condition, ensure that in the process of optimizing the operating parameters, the sewage treatment plant can process the specified amount of sewage every day, and there will be no insufficient or excessive treatment capacity. Set the objective function to minimize the total cost of sewage treatment throughout the day, that is, Where T is the total number of time periods in a day, C t is the processing cost of the tth period. The objective function clearly states that the optimization direction is to reduce the processing cost for the whole day by adjusting the operating parameters.

[0129] Mathematical optimization algorithms are used to optimize and solve the values ​​of hydraulic parameters and aeration volume at different time periods. Common mathematical optimization algorithms include linear programming, nonlinear programming, and integer programming. The appropriate algorithm is selected based on the characteristics of the cost model, such as whether the relationship between cost and parameters is linear. For example, if the cost model is a linear relationship, a linear programming algorithm can be used; if it is a nonlinear relationship, a nonlinear programming algorithm is used. During the algorithm solution process, the constraints and objective function are used as inputs. Through iterative calculations, the operating parameter combination that satisfies the constraints and minimizes the objective function value is searched for, that is, the optimal sludge return ratio, stirring intensity, and aeration volume values ​​for each time period. The parameters are checked to see if they are within the equipment's operating capacity. For example, whether the flow rate of the sludge return pump is within its rated flow rate range, whether the stirring intensity of the mixing equipment exceeds its maximum operating intensity, and whether the aeration volume of the blower is within its adjustable range. If any parameter exceeds the operating capacity of the equipment, the plan is not feasible; verify whether the parameters meet the technical requirements of the sewage treatment process, such as whether the sludge return ratio can ensure the normal circulation of sludge and microbial activity in the biochemical tank, whether the aeration volume can maintain a suitable dissolved oxygen concentration to meet the needs of biochemical reactions, etc. If the process requirements are not met, the plan is also judged to be infeasible; if infeasible parameters are found in the feasibility verification, adjust the parameter value range, and narrow the parameter value interval that exceeds the range according to the equipment manual and process experience, and then re-substitute the adjusted parameter range into the mathematical optimization algorithm for a new round of optimization solution, and repeat the feasibility verification steps until a feasible operating parameter combination plan is obtained.

[0130] The feasible operation parameter combination scheme will be verified and refined into specific operation instructions. In units of time, the specific values ​​of the sludge return ratio, stirring intensity, and aeration volume parameters of each time period will be clearly defined. For example, the 24 hours of a day will be divided into one time period per hour, and the sludge return ratio of the first hour will be Z1, the stirring intensity will be H1, and the aeration volume will be M1. The sludge return ratio of the second hour will be Z2, the stirring intensity will be H2, and the aeration volume will be M2. And so on. The lowest cost operation plan will be formed under the premise of meeting the daily processing volume, and the plan will be output for actual production use. The refined operation instructions will be organized into documents or spreadsheets and provided to the operation management personnel of the sewage treatment plant. At the same time, the plan can be imported into the sewage treatment plant's automation control system to realize the automatic operation of the equipment according to the optimized parameters, thereby reducing the treatment cost while ensuring the sewage treatment effect.

[0131] An intelligent manure and sewage treatment system, applied to the intelligent manure and sewage treatment method, comprises:

[0132] The data acquisition module is used to collect COD, ammonia nitrogen, DO, pH, water temperature, SS, and microbial activity parameters of sewage in real time, and normalize the collected water quality parameters to form a unified standard data basis;

[0133] The first model module uses the particle swarm algorithm to optimize the membership function parameters and fuzzy rules of the adaptive neural fuzzy inference system based on the data processed by the data acquisition module. By training the ANFIS model, it outputs the predicted value of the COD concentration in the biochemical pool in real time and forms a COD prediction model;

[0134] The second model module uses the COD prediction value in the first model module and the data processed in the data acquisition module as input to build a stacking ensemble model. The ensemble model includes a base learner and a meta learner. The prediction results of the base learner are generated using a five-fold cross-validation method. These results are input into the meta learner for training and output the aeration volume demand M for the future period.

[0135] The adjustment module establishes a fuzzy rule base based on the future aeration volume demand M in the second model module and the DO data in the data acquisition module, clarifies the relationship between M and DO deviation, generates a PID parameter adjustment strategy through the Mamdani reasoning method, and then uses the center of gravity method to defuzzify and output the blower frequency adjustment parameter to achieve real-time dynamic adjustment of the blower power;

[0136] The processing module analyzes the impact of blower frequency parameters on dissolved oxygen distribution and hydraulic shear force based on the blower frequency parameters and real-time water quality data from the data acquisition module. Based on the feedback of microbial activity, it optimizes the sludge return ratio and agitation intensity to generate a hydraulic parameter combination that helps stabilize the microbial community.

[0137] Scheme generation module: Based on the hydraulic parameters optimized in the treatment module, the aeration value predicted by the second model module, and the time-of-use electricity price of the power grid and the daily sewage treatment volume demand, the lowest cost operation plan is formulated while meeting the daily treatment volume.

[0138] The above description is merely a preferred embodiment of the present invention; however, the scope of protection of the present invention is not limited thereto. Any person skilled in the art who, within the technical scope disclosed by the present invention, makes equivalent substitutions or modifications based on the technical solutions and improved concepts of the present invention shall be covered by the scope of protection of the present invention.

Claims

1. An intelligent manure and sewage treatment method, characterized in that: include: Step S1, real-time collection of COD, ammonia nitrogen, DO, pH, water temperature, SS, and microbial activity parameters of sewage, and normalization of the collected water quality parameters to form a unified standard data basis; Step S2, based on the data processed in step S1, the membership function parameters and fuzzy rules of the adaptive neural fuzzy inference system are optimized using the particle swarm algorithm, and the predicted value of the COD concentration in the biochemical pool is output in real time by training the ANFIS model, thereby forming a COD prediction model; Step S3: Based on the COD prediction value in step S2 and the data processed in step S1 as input, a stacking ensemble model is constructed. The ensemble model includes a base learner and a meta learner. The prediction results of the base learner are generated using a five-fold cross-validation method. These results are input into the meta learner for training, and the aeration volume demand M for the future period is output. Step S4: Based on the aeration volume demand M for the future period in step S3 and the DO data in step S1, a fuzzy rule base is established to clarify the relationship between M and DO deviation. A PID parameter adjustment strategy is generated using the Mamdani reasoning method, and then the center of gravity method is used to defuzzify and output the blower frequency adjustment parameter to achieve real-time dynamic adjustment of the blower power. Step S5: Analyze the effect of the blower frequency parameter on dissolved oxygen distribution and hydraulic shear force based on the blower frequency parameter and the real-time water quality data from step S1. Optimize the sludge return ratio and agitation intensity based on feedback from microbial activity to generate a hydraulic parameter combination that helps stabilize the microbial community. S6: Based on the hydraulic parameters optimized in step S5, the aeration value predicted in step S3, and the time-of-use electricity price of the power grid and the daily sewage treatment volume demand, a minimum cost operation plan is formulated while meeting the daily treatment volume.

2. The intelligent manure and sewage treatment method according to claim 1, characterized in that: Collect COD, ammonia nitrogen, DO, pH, water temperature, SS, and microbial activity parameters of sewage in real time, and normalize the collected water quality parameters to form a unified standard data foundation, including: Step S11, using a COD online monitor, an ammonia nitrogen detector, a dissolved oxygen sensor, a pH meter, a water temperature probe, a suspended solids meter, and a microbial activity analyzer, real-time data collection is performed on the COD, ammonia nitrogen, DO, pH, water temperature, SS, and microbial activity parameters in the wastewater. During the data collection process, a preset sampling frequency is set. In step S12, various water quality parameters collected in step S11 are normalized using a normalization algorithm to eliminate differences in the dimensions of different parameters, and the data are mapped to a unified numerical range to form a data basis with a unified standard.

3. The intelligent manure and sewage treatment method according to claim 2, characterized in that: Based on the data processed in step S1, the particle swarm algorithm is used to optimize the membership function parameters and fuzzy rules of the adaptive neural fuzzy inference system. By training the ANFIS model, the predicted value of the COD concentration in the biochemical pool is output in real time, and a COD prediction model is formed, including: Step S21, analyze the characteristics of the normalized sewage COD, ammonia nitrogen, and DO data, determine the initial parameters of the particle swarm algorithm and the adaptive neural fuzzy inference system, set the particle swarm scale, number of iterations, inertia weight, and learning factor parameters, and initialize the membership function type and initial parameters of the ANFIS and the fuzzy rule framework; Step S22, applying the initial parameters determined in step S21 to the particle swarm algorithm, using the prediction error of the ANFIS model as the fitness function, optimizing the membership function parameters and fuzzy rules of the ANFIS by continuously iteratively searching in the solution space and updating their own positions and velocities. In each iteration, the performance of the ANFIS model corresponding to each particle is evaluated, and the parameter combination that optimizes the fitness function value is retained; Step S23, substituting the membership function parameters and fuzzy rules optimized by the particle swarm algorithm in step S21 into the ANFIS model, and training the ANFIS model using the processed data. During the training process, the model parameters are continuously adjusted, and the training is repeated until the model reaches the set convergence condition; In step S24, the trained ANFIS model is put into actual operation, with the data processed in step S1 as real-time input. The model outputs the predicted value of the COD concentration in the biochemical pool in real time. At the same time, the trained model structure, parameters and optimized fuzzy rules are saved to form a COD prediction model.

4. The intelligent manure and sewage treatment method according to claim 3, characterized in that: Based on the COD prediction value in step S2 and the processed data in step S1 as input, a stacking ensemble model is constructed. The ensemble model includes a base learner and a meta learner. The prediction results of the base learner are generated using a five-fold cross-validation method. These results are input into the meta learner for training, and the aeration volume demand M for the future period is output, including: Step S31, determining a base learner and a meta learner of the Stacking ensemble model based on the COD prediction value in step S2 and the data processed in step S1; Step S32: merging the COD prediction value in step S2 with the data processed in step S1, and cleaning the processed data to remove duplicate data, check and process any missing values, and form an input data set; Step S33: Use a five-fold cross-validation method to train and predict the base learner in step S31. Divide the data set processed in step S32 into five parts, select one part as the test set each time, and use the remaining four parts as the training set. Train each base learner in turn, and use the trained base learner to predict the test set, and record the prediction results of each time. In step S34, all prediction results generated by the three base learners in step S33 under five-fold cross validation are collected and organized into a new feature matrix. This feature matrix is ​​used as input data to train the meta-learner in step S31, and the parameters of the meta-learner are continuously adjusted during the training process.

5. The intelligent manure and sewage treatment method according to claim 4, characterized in that: include: In step S341, the input data set processed in step S32 is re-input into the base learners initialized in step S31, and the prediction results of each base learner for the data set are obtained. These prediction results are integrated and input into the meta-learner trained in step S34. After processing by the meta-learner, the aeration volume demand M for the future time period is finally output.

6. The intelligent manure and sewage treatment method according to claim 5, characterized in that: Based on the aeration volume demand M in the future period in step S3 and the DO data in step S1, a fuzzy rule base is established to clarify the relationship between M and DO deviation. The PID parameter adjustment strategy is generated through the Mamdani reasoning method. The center of gravity method is then used to defuzzify and output the blower frequency adjustment parameters to achieve real-time dynamic adjustment of the blower power, including: Step S41, obtaining the aeration volume demand M for the future period from step S341, and extracting the DO data processed in step S1, performing statistical analysis on the M and DO data, determining the variation range of the M and DO deviations, and dividing the data into multiple data intervals; Step S42: Based on the data interval determined in step S41, at least two fuzzy linguistic variable sets are defined to describe the aeration volume demand M for the future period, and at least three fuzzy linguistic variable sets are defined to describe the DO deviation. Based on the sewage treatment process principles and actual operating experience, fuzzy rules are formulated between M and DO deviation, and a fuzzy rule base is constructed to clarify the adjustment strategies to be adopted under different combinations of M and DO deviation. Step S43, fuzzifying the future time period aeration volume demand M and DO data in step S41 according to the fuzzy linguistic variables defined in step S42, and converting them into corresponding fuzzy set membership values ​​as inputs of the Mamdani reasoning method; Step S44, using the input data fuzzified in step S43, combined with the fuzzy rule base constructed in step S42, logically reasoning through the Mamdani reasoning method to calculate the fuzzy output result of the PID parameter adjustment strategy; In step S45 , the fuzzy output result of the PID parameter adjustment strategy obtained in step S44 is defuzzified using the center of gravity method, and the fuzzy quantity is converted into an accurate numerical value to obtain a specific PID parameter adjustment value. Step S46: Based on the PID parameter adjustment value obtained in step S45, a mapping relationship is established with the blower frequency adjustment parameter, and the blower frequency adjustment parameter is output and sent to the blower control system as a control signal to realize real-time dynamic adjustment of the blower power.

7. The intelligent manure and sewage treatment method according to claim 6, characterized in that: Based on the blower frequency parameters and the real-time water quality data from step S1, the effect of the blower frequency parameters on the dissolved oxygen distribution and hydraulic shear force is analyzed. Based on the feedback of microbial activity, the sludge return ratio and agitation intensity are optimized to generate a hydraulic parameter combination that helps stabilize the microbial community, including: Step S51, based on the blower frequency adjustment parameters obtained in step S46, the real-time water quality data processed in step S1, including DO, SS, and microbial activity data, are extracted, the blower frequency parameters are correlated with the DO data in the real-time water quality data, and the distribution curves of dissolved oxygen over time and space at different blower frequencies are plotted to explore the effect of the blower frequency on the dissolved oxygen distribution; Step S52: measuring the hydraulic shear force corresponding to the blower at different frequencies by experiments in advance, and recording the results to form a corresponding relationship between the different blower frequencies and the hydraulic shear force; Step S53, comprehensively analyzing the relationship between the blower frequency and the hydraulic shear force determined in step S52 in combination with the microbial activity data in step S1, studying the changing trend of microbial activity under different hydraulic shear forces, and finding the hydraulic shear force threshold that has a positive effect on microbial activity; Step S54: Based on the relationship between microbial activity and hydraulic shear force and the dissolved oxygen distribution obtained in step S53, a correlation model between sludge return ratio, agitation intensity, and microbial activity is established. By setting different combinations of sludge return ratio and agitation intensity parameters, the response of microbial activity is simulated, and a parameter combination that is conducive to improving microbial activity is screened out; In step S55, the sludge return ratio and stirring intensity parameter combination selected in step S54 is evaluated in combination with the constraints of the actual sewage treatment process, and the parameter combination is further optimized using a genetic algorithm to generate a hydraulic parameter combination that helps stabilize the microbial community, including the optimal sludge return ratio and stirring intensity.

8. The intelligent manure and sewage treatment method according to claim 7, characterized in that: Based on the hydraulic parameters optimized in step S5 and the aeration volume value predicted in step S3, as well as the time-of-use electricity price of the power grid and the daily sewage treatment volume demand, a minimum cost operation plan is formulated while meeting the daily treatment volume, including: Step S61: Obtain the optimized hydraulic parameters from step S55, extract the aeration volume demand M for the future time period predicted in step S35, collect time-of-use electricity price data from the power grid, clarify the electricity price standards for different time periods, and integrate these data based on the daily sewage treatment capacity demand of the sewage treatment plant to establish a basic data set; Step S62: Based on the basic data set integrated in step S61, a sewage treatment cost model is constructed. The hydraulic parameters are correlated with the equipment energy consumption, and the aeration volume requirement M is correlated with the blower energy consumption. In combination with the time-of-use electricity price, the treatment cost for each period under different operating parameter combinations is calculated to clarify the quantitative relationship between the cost and each parameter. In step S63, the objective function is set to minimize the total cost of sewage treatment for the day, based on the constraint of meeting the daily sewage treatment volume demand and the cost model constructed in step S62. A mathematical optimization algorithm is used to optimize the values ​​of hydraulic parameters and aeration volume at different time periods. In step S64, the feasibility of the operating parameter combination scheme obtained by optimization in step S63 is verified to check whether each parameter is within the equipment operating capacity and whether it meets the technical requirements of the sewage treatment process. If there are infeasible parameters, the parameter value range is adjusted and the optimization solution is re-performed until a feasible operating parameter combination scheme is obtained.

9. The intelligent manure and sewage treatment method according to claim 8, characterized in that: include: Step S641: The feasible operating parameter combination scheme verified in step S64 is refined into specific operating instructions, and the specific values ​​of the sludge return ratio, stirring intensity, and aeration volume parameters for each time period are clarified to form the lowest cost operating scheme while meeting the daily processing volume, and output the scheme for actual production use.

10. An intelligent manure and sewage treatment system, applied to an intelligent manure and sewage treatment method according to any one of claims 1 to 9, characterized in that: include: The data acquisition module is used to collect COD, ammonia nitrogen, DO, pH, water temperature, SS, and microbial activity parameters of sewage in real time, and normalize the collected water quality parameters to form a unified standard data basis; The first model module uses the particle swarm algorithm to optimize the membership function parameters and fuzzy rules of the adaptive neural fuzzy inference system based on the data processed by the data acquisition module. By training the ANFIS model, it outputs the predicted value of the COD concentration in the biochemical pool in real time and forms a COD prediction model; The second model module uses the COD prediction value in the first model module and the data processed in the data acquisition module as input to build a stacking ensemble model. The ensemble model includes a base learner and a meta learner. The prediction results of the base learner are generated using a five-fold cross-validation method. These results are input into the meta learner for training and output the aeration volume demand M for the future period. The adjustment module establishes a fuzzy rule base based on the future aeration volume demand M in the second model module and the DO data in the data acquisition module, clarifies the relationship between M and DO deviation, generates a PID parameter adjustment strategy through the Mamdani reasoning method, and then uses the center of gravity method to defuzzify and output the blower frequency adjustment parameter to achieve real-time dynamic adjustment of the blower power; The processing module analyzes the impact of blower frequency parameters on dissolved oxygen distribution and hydraulic shear force based on the blower frequency parameters and real-time water quality data from the data acquisition module. Based on the feedback of microbial activity, it optimizes the sludge return ratio and agitation intensity to generate a hydraulic parameter combination that helps stabilize the microbial community. Scheme generation module: Based on the hydraulic parameters optimized in the treatment module, the aeration value predicted by the second model module, and the time-of-use electricity price of the power grid and the daily sewage treatment volume demand, the lowest cost operation plan is formulated while meeting the daily treatment volume.

Citation Information

Patent Citations

  • Multi-time step wind power prediction method based on dynamic feature selection

    CN110674965A

  • Method, system, equipment and medium for predicting aeration rate of sewage treatment biochemical pool

    CN116681174A

  • Method and system for predicting and optimizing energy consumption of sewage treatment plant

    CN118709833A

  • Prediction method and device for adding amount of coagulation agent

    CN119850054A

Cited By

  • Integrated sewage separation device and intelligent control method thereof

    CN121377338A

  • Sewage zero discharge control method and system for service facilities of high-cold and high-altitude expressway

    CN121523129A