Method and system for predicting dosage of magnetic coagulant
Through the processing of sewage plant operation data and the application of group intelligent optimization algorithms, a prediction model for the amount of magnetic powder, PAC and PAM was established, which solved the problem that the amount of magnetic coagulation agents was difficult to accurately predict, and improved the magnetic coagulation rate and reduced operating costs.
Patent Information
- Application Number
- CN202411897154.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-20
- Publication Date
- 2025-04-18
AI Technical Summary
In magnetic coagulation technology, the amount of magnetic coagulation agent is difficult to accurately predict, resulting in water quality not meeting standards or waste of drugs, increasing the operating costs of the water plant.
By collecting operation data of the sewage plant, performing data cleaning and normalization processing, using the group intelligent optimization algorithm to optimize the limit learning machine, combining PSO and FOA algorithms, a dosage prediction model is established to predict the dosage amount of magnetic powder, PAC, and PAM.
Accurate prediction of the dosage of magnetic coagulation agents is achieved, the magnetic coagulation rate is improved, the waste of drugs is reduced, and the operating costs of water plants are reduced.
Smart Images

Figure CN119850053A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of water treatment, and in particular to a method and system for predicting the dosage of a magnetic coagulant. Background Art
[0002] Magnetic coagulation technology has the advantages of fast processing speed, high processing efficiency, large processing capacity, wide adaptability, small footprint, low energy consumption, convenient operation and management, and high degree of automation. Through the application of magnetic coagulation technology, the concentration of key indicators such as COD, TP, ammonia nitrogen and SS in water bodies can be effectively and quickly reduced. The dosage of the reagent in the magnetic coagulation tank directly determines the effect of the magnetic coagulation sedimentation process. Too little dosage will lead to substandard water quality. Too much dosage will also affect the effect of magnetic coagulation sedimentation, and will cause waste of reagents and increase the operating costs of the water plant. Therefore, the appropriate dosage is the key to optimizing production. Summary of the invention
[0003] In view of this, the present invention provides a method and system for predicting the dosage of a magnetic coagulant to solve the problem of how to predict the dosage of a magnetic coagulant.
[0004] In a first aspect, the present invention provides a method for predicting the dosage of a magnetic coagulant, the method comprising:
[0005] Collect the operation data of the target sewage treatment plant, including the turbidity of inlet and outlet water, TP, magnetic powder, PAC, and PAM dosage;
[0006] Clean and normalize the operation data;
[0007] The swarm intelligence optimization algorithm is used to optimize the ELM extreme learning machine, and the PSO algorithm is combined with the FOA algorithm to optimize the parameters of the ELM extreme learning machine to obtain the dosage prediction model;
[0008] The current influent turbidity and influent TP are input into the dosage prediction model, and the prediction results of magnetic powder, PAC and PAM dosage are output.
[0009] The present invention processes the operation data of the target sewage treatment plant, optimizes the ELM extreme learning machine using a swarm intelligence optimization algorithm, combines the PSO algorithm with the FOA algorithm to make up for the shortcomings of the extreme learning machine, and establishes a dosage prediction model. The dosage of magnetic powder, PAC, and PAM is predicted according to the input current influent turbidity and influent TP, so as to predict the appropriate dosage of magnetic coagulant for the target sewage treatment plant and improve the magnetic coagulation rate.
[0010] In an optional implementation, performing data cleaning on the operation data includes:
[0011] Calculate the ratio of missing samples to total samples in the running data;
[0012] If the ratio of missing samples to total samples is less than the minimum value of the preset ratio threshold range, all missing sample data are removed;
[0013] If the ratio of missing samples to total samples is within the preset ratio threshold, the continuous data is filled according to the average value, and the discrete data is filled according to the mode;
[0014] If the ratio of missing samples to total samples is greater than the maximum value of the preset ratio threshold range, regression analysis is used to fill in the continuous data, and the k-means algorithm is used to fill in the discrete data.
[0015] The present invention improves data integrity by performing filling processing on data with different missing sample proportions, thereby avoiding data loss due to equipment failure, human operational errors, etc., and avoiding incomplete data due to uneven data quality.
[0016] In an optional implementation, the ELM extreme learning machine is optimized using a swarm intelligence optimization algorithm, and the parameters of the ELM extreme learning machine are optimized using a PSO algorithm fused with a FOA algorithm, including:
[0017] The turbidity and TP were used as input layer neurons, and the dosage of magnetic powder, PAC, and PAM were used as output layer neurons to construct the ELM extreme learning machine.
[0018] Use PSO algorithm to globally search ELM extreme learning machine parameters;
[0019] The FOA algorithm is used to perform local search in the global search parameters to obtain the optimal parameters of the ELM extreme learning machine and perform parameter optimization.
[0020] The present invention adopts the PSO algorithm to fuse the FOA algorithm to optimize the parameters of the extreme learning machine. Taking into account the computational complexity of the algorithm and the accuracy of solving the optimal solution, the parameters of the input layer neurons and the output layer neurons are set. The advantage of the PSO algorithm that can quickly search for the optimal solution is combined with the advantage of the FOA algorithm that can locally search for the optimal solution. The extreme learning machine is optimized to improve the prediction accuracy of the dosage prediction model.
[0021] In an optional implementation, performing parameter optimization includes:
[0022] Divide the running data into training data set and test data set;
[0023] The ELM extreme learning machine is trained using the training data set, and the ELM extreme learning machine is tested using the test data set to determine the optimal input weights and hidden layer bias parameters of the ELM extreme learning machine.
[0024] The present invention trains the ELM extreme learning machine using a training data set and tests the ELM extreme learning machine using a test data set to find the optimal input weights and hidden layer bias parameters of the extreme learning machine model, thereby maximizing the prediction accuracy of the model, and evaluating the accuracy and prediction efficiency of the model by comparing the predicted values with the measured values.
[0025] In an optional implementation, after optimizing the ELM extreme learning machine using a swarm intelligence optimization algorithm, optimizing the parameters of the ELM extreme learning machine using a PSO algorithm and a FOA algorithm to obtain a dosage prediction model, the method further includes:
[0026] The performance of the dosage prediction model was evaluated using R-square, root mean square error and average relative error indicators.
[0027] The present invention evaluates the prediction result of the dosage of the agent by using three error indicators, namely, R square, root mean square error indicator and average relative error indicator, so as to optimize the dosage prediction model and improve the prediction result of the dosage prediction model.
[0028] In an optional embodiment, after inputting the current influent turbidity and influent TP into the dosage prediction model and outputting the prediction results of the dosage of magnetic powder, PAC, and PAM, the method further includes:
[0029] The output prediction results of the dosage of magnetic powder, PAC and PAM are sent to the controller to drive the dispensing system to add the corresponding reagents in the mixing tank of the target sewage treatment plant.
[0030] The present invention receives the predicted results of the dosage of magnetic powder, PAC and PAM through a controller to realize intelligent control of the magnetic coagulation dosing equipment, thereby giving full play to the effectiveness of the coagulant and the magnetic seed and improving the magnetic coagulation rate under the premise of ensuring rapid water quality treatment.
[0031] In a second aspect, the present invention provides a magnetic coagulant dosage prediction system, the system comprising:
[0032] The data acquisition module is used to collect the operating data of the target sewage treatment plant, including the turbidity of inlet and outlet water, TP, magnetic powder, PAC, and PAM dosage;
[0033] Data processing module, used for data cleaning and normalization of operation data;
[0034] The model building module is used to optimize the ELM extreme learning machine using the swarm intelligence optimization algorithm, and to optimize the parameters of the ELM extreme learning machine using the PSO algorithm and the FOA algorithm to obtain the dosage prediction model;
[0035] The prediction module is used to input the current influent turbidity and influent TP into the dosage prediction model and output the prediction results of magnetic powder, PAC and PAM dosage.
[0036] In a third aspect, the present invention provides a computer device, comprising: a memory and a processor, the memory and the processor are communicatively connected to each other, computer instructions are stored in the memory, and the processor executes the magnetic coagulant dosage prediction method of the above-mentioned first aspect or any corresponding embodiment thereof by executing the computer instructions.
[0037] In a fourth aspect, the present invention provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable a computer to execute the method for predicting the dosage of a magnetic coagulant according to the first aspect or any corresponding embodiment thereof.
[0038] In a fifth aspect, the present invention provides a computer program product, comprising computer instructions for causing a computer to execute the method for predicting the dosage of a magnetic coagulant according to the first aspect or any corresponding embodiment thereof. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0040] Figure 1 is a schematic flow chart of a method for predicting the dosage of a magnetic coagulant according to an embodiment of the present invention;
[0041] Figure 2 is a schematic diagram of a flow chart according to an embodiment of the present invention;
[0042] Figure 3 is a structural block diagram of a magnetic coagulant dosage prediction system according to an embodiment of the present invention;
[0043] Figure 4 It is a schematic diagram of the hardware structure of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0044] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution 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. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0045] BP neural network (Back Propagation, BP) originated in the 1980s and is one of the classic models of artificial neural networks. The algorithm has a strong nonlinear fitting ability and performs well in solving nonlinear problems. Structurally, the BP neural network consists of several layers and neurons within the layers, and can perform a variety of tasks such as pattern recognition, classification and regression. The training of the network relies on the back propagation algorithm, which can adjust the network weights based on error feedback to minimize the error. The application range of BP neural network is wide: it is used for digital and face recognition in image recognition, and for stock market and weather forecasting in prediction. In the sewage treatment industry, BP neural network is widely used to construct input-output relationship models for water quality simulation prediction. Although the BP network tends to the target through iterative adjustment of weights, when dealing with large networks, considering factors such as initial weights and thresholds, the error function may form multiple local minima. Since the classic BP algorithm lacks the ability to jump out of the local minimum, increasing the number of training times may not significantly reduce the error.
[0046] The development of extreme learning machines (ELMs) and their derived diversified neural network training technologies not only breaks through the shortcomings of traditional feedforward neural networks, but also further enhances the practicality of neural networks in predictive control applications, laying a solid foundation for the further development of predictive control technology. Compared with the BP neural network model, its accuracy has been significantly improved. Compared with the traditional BP network, the ELM model has a faster training speed and better generalization, and is not easily affected by local optimal solutions. However, the extreme learning machine also has some shortcomings: the number of hidden layer nodes can only be determined by trial and error. In practice, it is found that the number of nodes has a significant impact on network performance, and an inappropriate number of nodes will weaken the generalization of the network. In addition, the randomly generated hidden layer nodes may contain nodes with little or no utility. Too many nodes can easily cause overfitting, resulting in inconsistency between training accuracy and test accuracy. Even if an incremental learning algorithm is used, nodes with low utility may be introduced, reducing the robustness and generalization of the network.
[0047] In recent years, swarm intelligence optimization algorithms have been widely used to solve complex problems due to their simple structure and easy implementation. Swarm intelligence optimization algorithms have the characteristics of simple structure, few parameters, easy implementation, and contain adaptive convergence factors and information feedback mechanisms. They can balance local optimization and global search, and have excellent performance in problem solving accuracy and convergence speed. They are suitable for complex system modeling, neural network parameter optimization and other fields.
[0048] In order to address the deficiencies of the prior art, the embodiment of the present invention uses a swarm intelligence optimization algorithm to optimize the structure of the ELM model. By combining the powerful convergence ability of the swarm intelligence optimization algorithm and the deep learning characteristics of the ELM model, and using the error feedback mechanism in the ELM model to continuously update information, the global optimal solution is obtained, and a set of accurately predicted magnetic coagulation dosing systems is obtained. The embodiment of the present invention has a faster learning ability and less need for human intervention. It can predict and provide accurate dosage of reagents in real time. Even if the concentration of the sewage plant influent fluctuates greatly, the prediction system can operate stably and effectively. A dosing controller can be built at the same time to realize intelligent control of the magnetic coagulation dosing equipment, so as to give full play to the effectiveness of coagulants and magnetic seeds and improve the magnetic coagulation rate while ensuring rapid water quality treatment.
[0049] According to an embodiment of the present invention, an embodiment of a method for predicting the dosage of a magnetic coagulant is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0050] In this embodiment, a method for predicting the dosage of a magnetic coagulant is provided. Figure 1 FIG. 4 is a flow chart of a method for predicting the dosage of a magnetic coagulation agent according to an embodiment of the present invention. Figure 1 As shown, the process includes the following steps:
[0051] Step S101, collecting operation data of the target sewage treatment plant.
[0052] In the embodiment of the present invention, the operation data of the target sewage plant for the past 12 months are collected, and the operation data include the turbidity of the inlet and outlet water, TP (Total Phosphorus), magnetic powder, PAC (Polyaluminium Chloride), and PAM (Polyscrylamide). There are many pollutant indicators involved in the sewage treatment process. Taking all the pollutant indicators as the input variables of the model will undoubtedly increase the complexity of the model and increase the processing time of the model, thereby reducing the accuracy of the predicted agent. The embodiment of the present invention selects and analyzes the relationship between six main influent water quality variables (turbidity, ammonia nitrogen, COD, TP, temperature and pH) and the dosage of magnetic coagulant agents (magnetic powder, PAC, PAM). According to the analysis of the characteristics of the magnetic coagulation process, it can be seen that in the magnetic coagulation process, there is a strong positive correlation between the dosage of the three agents and the turbidity and TP, that is, the higher the turbidity and TP content, the greater the corresponding required dosage, and the correlation of other indicators is relatively weak. The embodiment of the present invention selects turbidity and TP among the influent water quality variables as input variables, and selects the dosage of magnetic powder, PAC, and PAM as output variables.
[0053] Step S102, performing data cleaning and normalization processing on the operation data.
[0054] In the embodiment of the present invention, during the data collection process, there may be problems such as partial data loss, distortion or singular values. In order to reduce the impact of these problems on the prediction performance, the operating data needs to be cleaned and normalized. Among them, the normalization process converts the data into a decimal in the interval [0, 1], which can play a role in smoothing the gradient, and the loss of the model will also tend to be stable. Among them, the normalization formula is expressed as:
[0055]
[0056] Among them, X is the original data, X max and X min are the maximum and minimum values of the data, respectively, mon is the normalized data.
[0057] Step S103, using a swarm intelligence optimization algorithm to optimize the ELM extreme learning machine, using a PSO algorithm combined with a FOA algorithm to optimize the parameters of the ELM extreme learning machine, and obtaining a dosage prediction model.
[0058] In an embodiment of the present invention, in order to make up for the shortcomings of the extreme learning machine, a swarm intelligence optimization algorithm is used to optimize the ELM extreme learning machine, and the PSO algorithm and the FOA algorithm are combined. The PSO algorithm can quickly search for the individual optimal value, but when searching for the global optimal value, the PSO algorithm effect is generally prone to premature convergence. The FOA algorithm can effectively find the optimal value through rapid iteration, make up for the defects of the PSO algorithm, and construct a dosage prediction model. The dosage prediction model predicts the dosage of magnetic powder, PAC, and PAM.
[0059] Step S104, input the current influent turbidity and influent TP into the dosage prediction model, and output the prediction results of the dosage of magnetic powder, PAC and PAM.
[0060] In an embodiment of the present invention, the current influent turbidity and influent TP after pretreatment are input into a dosage prediction model, and the dosage prediction model effectively predicts the dosage of magnetic powder, PAC, and PAM according to the input data to perform water quality treatment.
[0061] The magnetic coagulant dosage prediction method provided in this embodiment processes the operating data of the target sewage treatment plant, optimizes the ELM extreme learning machine using a swarm intelligence optimization algorithm, combines the PSO algorithm with the FOA algorithm to make up for the shortcomings of the extreme learning machine, and establishes a dosage prediction model. The dosage of magnetic powder, PAC, and PAM is predicted according to the input current influent turbidity and influent TP, so as to predict the appropriate magnetic coagulant dosage for the target sewage treatment plant and improve the magnetic coagulation rate.
[0062] In this embodiment, a method for predicting the dosage of a magnetic coagulant is provided, and the process includes the following steps:
[0063] Step S201, collecting the operation data of the target sewage treatment plant.
[0064] For details, please see Figure 1 Step S101 of the illustrated embodiment will not be described in detail here.
[0065] Step S202, performing data cleaning and normalization processing on the operation data.
[0066] Specifically, the data cleaning of the operation data in the above step S202 includes:
[0067] Step S2021, calculate the ratio of missing samples in the running data to the total samples.
[0068] Step S2022: If the ratio of missing samples to total samples is less than the minimum value of the preset ratio threshold range, all missing sample data are removed.
[0069] Step S2023, if the ratio of missing samples to total samples is within a preset ratio threshold range, the continuous data is filled according to the average value, and the discrete data is filled according to the mode.
[0070] Step S2024, if the ratio of missing samples to total samples is greater than the maximum value of the preset ratio threshold range, regression analysis is used to fill the continuous data, and k-means algorithm is used to fill the discrete data.
[0071] In the embodiment of the present invention, the amount of process data involved in the sewage treatment process is extremely large, and there may be equipment failures, human operation errors and other reasons. Therefore, it is inevitable that the data quality will be uneven. A large amount of noise, missing values and inconsistent data will reduce the quality of subsequent data processing, thereby losing the efficiency and rationality of data mining. Suppose the proportion of missing samples to total samples is P r , which can be divided into the following three cases:
[0072] 1. P r When ≦1%, all missing sample data are removed;
[0073] 2. When 1% <P r When the missing data is less than 3%, fill it in according to the data category of the missing samples. If it is continuous data, fill it in with the average value of the dimension. If it is discrete data, fill it in with the data with the highest frequency of occurrence in the dimension.
[0074] 3. When P r When it is >3%, you can consider using regression analysis to fill the continuous data. If it is discrete data, you can consider using the k-means method to fill the data.
[0075] By filling in data with different missing sample proportions, the integrity of the data can be improved to avoid data loss due to equipment failure, human error, etc., and incomplete data due to uneven data quality.
[0076] Step S203, using a swarm intelligence optimization algorithm to optimize the ELM extreme learning machine, using a PSO algorithm combined with a FOA algorithm to optimize the parameters of the ELM extreme learning machine, and obtaining a dosage prediction model.
[0077] Specifically, the above step S203 includes:
[0078] Step S2031, taking turbidity and TP as input layer neurons, and taking the dosage of magnetic powder, PAC, and PAM as output layer neurons, to construct an ELM extreme learning machine.
[0079] Step S2032: Use the PSO algorithm to perform a global search for ELM extreme learning machine parameters.
[0080] Step S2033, using the FOA algorithm to perform local search in the global search parameters, obtain the optimal parameters of the ELM extreme learning machine, and perform parameter optimization.
[0081] In the embodiment of the present invention, for N training samples (x i ,y i ), (i=1, 2,...,N), xi∈R n ,y i ∈R m , where n represents the number of neurons in the model input layer, and m represents the number of neurons in the output layer. The network has M hidden layer nodes, and the input weights from the input layer to the hidden layer are wi = [w1, w2, ..., w n ] T , the output weight from the hidden layer to the output layer is β i =[β1,β2,…,β m ] T , b i represents the bias of the i-th hidden layer node, and g(x) is the activation function. The ELM model can be expressed as formula (2):
[0082]
[0083] The above equation is converted into matrix form as formula (3):
[0084] Hβ=Y(3)
[0085] Among them, H is the output matrix of the hidden layer nodes of the ELM model, β is the output weight, and Y is the output weight, see formula (4) and formula (5):
[0086]
[0087] In order to achieve the training effect, we need to get w i , b i , β i , we get formula (6):
[0088]
[0089] During the ELM learning process, the input weights w are randomly generated. i and hidden layer threshold b i In addition, when the number of hidden layer nodes and the activation function are determined, only the output weight β i is unknown, so the essence of model training is to find the least squares solution of Hβ=Y process.
[0090] like Figure 2As shown, in order to make up for the shortcomings of the extreme learning machine, the embodiment of the present invention adopts a swarm intelligence optimization algorithm to optimize the ELM extreme learning machine, and combines the PSO with the FOA algorithm. The combined algorithm can make up for the shortcomings of the PSO algorithm. The PSO algorithm can quickly search for individual optimal values. When the amount of data is relatively large, the FOA algorithm needs to set a large number of fruit flies for search, resulting in a slow convergence speed, and PSO can make up for the shortcomings of the first half of the FOA. However, when searching for the global optimal value, the PSO algorithm is generally prone to premature convergence. The FOA algorithm can efficiently find the optimal value through rapid iteration, which makes up for the defects of the second half of the PSO.
[0091] The particle swarm optimization algorithm (PSO) is proposed based on the study of bird foraging behavior. By imitating the behavior mechanism of birds when foraging, the movement of particles in the solution space is guided to obtain the optimal solution to the optimization problem. In the particle swarm optimization algorithm, particles have speed and position like organisms, and the movement of particles is guided by individual optimality (Pbest) and global optimality (Gbest). Let the dimension of the solution space be n, then the position and speed of the particle at the tth iteration are expressed as:
[0092]
[0093] Wherein, i=1, 2...M, M is the number of particles in the population.
[0094] After introducing individual optimal and global optimal (Gbest), the speed and position of the particle after one iteration can be obtained. The formula is as follows:
[0095] v i (t+1)=ω(t)v i (t)+c1·r1(Pbest i (t)-x i (t))+c2·r2(Gbest(t)-x i (t)) (9)
[0096] x i (t+1)=x i (t)+v i (t+1) (10)
[0097] Among them, ω is a non-negative inertia factor, and its value affects the optimization ability. When ω is large, it means that the particle inertia is large and it is not easy to change the previous path, and the global optimization ability is strong. When ω is small, the particle has a strong local optimization ability. c1 and c2 are acceleration constants, the former is the individual learning factor of the particle, and the latter is the social learning factor of the particle.
[0098] Pbesti(t) is the component of the optimal value of the n-dimensional individual in the t-th generation, and Gbest(t) is the n-dimensional component of the global optimal solution in the t-th generation, which is expressed as follows:
[0099] Pbest i (t) = argmin{f(x i (1)),f(x i (2))…,f(x i (t))} (11)
[0100] Gbest(t)=argmin{f(Pbest1(1)),f(Pbest1(2))…,f(Pbest M (1))} (12)
[0101] The Fruit Fly Optimization Algorithm (FOA) is an emerging swarm intelligence optimization algorithm based on the foraging behavior of fruit flies. It has the advantages of being simple to implement and having strong search capabilities. Combined with the foraging process of fruit flies, the initial position of the fruit fly swarm is initialized to (intXaxis, intYaxis), and the foraging direction and distance R are random. Then:
[0102]
[0103] Considering that the fruit fly individual cannot know the location of the food at the beginning, the distance D between the fruit fly individual and the origin is i The reciprocal of is defined as the taste concentration judgment value S i ,Right now:
[0104]
[0105] Assume the fitness function is f, and the flavor concentration judgment value S i Substitute f to get the food concentration value Smelli at the position of the fruit fly individual, that is:
[0106] Smell i =f(S i ) (15)
[0107] Find the individual with the largest food concentration among the fruit flies, and record the concentration value and location information, that is:
[0108] [bestSmell, bestindex]=max(Smell i ) (16)
[0109] The other individuals in the fruit fly group fly to the location of the individual with the largest food concentration value, that is:
[0110]
[0111] Iterate in the above manner and determine the change in the food concentration value before and after the iteration. If the food concentration value becomes larger after the iteration, then execute formula (17), otherwise continue to iterate until the set maximum number of iterations is reached.
[0112] The following are the optimization steps:
[0113] a) Initialize the position and velocity of the particle;
[0114] b) Calculate particle fitness;
[0115] c) Update the individual optimal solution of particles and the global optimal solution;
[0116] d) Update the particle's position and velocity and enter the FOA algorithm;
[0117] e) taking the solutions produced by the above process as the initial solution set of FOA and calculating the optimal position update of the fruit fly;
[0118] f) Determine whether the fruit flies transfer and update pheromones;
[0119] g) Determine whether the optimal solution can be output. If the conditions are not met, re-enter FOA for iteration.
[0120] The parameter setting process is as follows: the PSO algorithm is fused with the FOA algorithm to optimize the parameters of the extreme learning machine. Considering the computational complexity of the algorithm and the accuracy of solving the optimal solution, the PSO fusion FOA algorithm sets the following parameters: the number of particles M = 20, the learning factor c1 = c2 = 2, the inertia weight ω = 0.7, the number of FOA populations is 30, and the maximum number of iterations is 50. The parameter configuration of the ELM model is as follows: the turbidity and total magnetism are used as input layer neurons, so the number of input layer neurons is 2. Based on the dual considerations of model complexity and computational efficiency, the number of hidden layer neuron nodes of the optimized model is set to 20, and the dosage of the three agents is used as output layer neurons, so the number of output layer neurons is 3, and the activation function is Sigmoid.
[0121] On the MATLAB software platform, the input layer data is named "Input" and the output layer data is named "Output". After the data is input into the system, a learning rate of 0.2 is adopted to predict the dosage of magnetic powder, PAC and PAM in the magnetic coagulation process.
[0122] The PSO algorithm is combined with the FOA algorithm to optimize the parameters of the extreme learning machine. Considering the computational complexity of the algorithm and the accuracy of solving the optimal solution, the parameters of the input layer neurons and the output layer neurons are set. The advantage of the PSO algorithm that can quickly search for the optimal solution is combined with the advantage of the FOA algorithm that can locally search for the optimal solution. The extreme learning machine is optimized to improve the prediction accuracy of the dosage prediction model.
[0123] Specifically, the parameter optimization in the above step S203 includes:
[0124] Step S2034, dividing the running data into a training data set and a test data set.
[0125] Step S2035, training the ELM extreme learning machine using the training data set, testing the ELM extreme learning machine using the test data set, and determining the optimal input weights and hidden layer bias parameters of the ELM extreme learning machine.
[0126] In an embodiment of the present invention, 300 groups of data in the operating data are used as training data sets, and 65 groups of data are used as test data sets to find the optimal input weights and hidden layer bias parameters of the extreme learning machine model, thereby maximizing the prediction accuracy of the model. By comparing the predicted values with the measured values, the accuracy and prediction efficiency of the model are evaluated.
[0127] The ELM extreme learning machine is trained by using the training data set and tested by using the test data set to find the optimal input weights and hidden layer bias parameters of the extreme learning machine model, thereby maximizing the prediction accuracy of the model. The accuracy and prediction effectiveness of the model are evaluated by comparing the predicted values with the measured values.
[0128] Step S204, using R square, root mean square error index and average relative error index to evaluate the prediction effect of the dosage prediction model.
[0129] In the embodiment of the present invention, R 2 The prediction effect of the dosage of three kinds of agents was evaluated by three error indicators: root mean square error (RMSE) and mean relative error (MAPE). 2 The closer it is to 1, the closer RMSE is to 0, and the closer MAPE is to 0, the better the prediction effect. The calculation of the three indicators is shown in formulas (18) to (20).
[0130]
[0131] Among them, yi is the predicted value, f i is the actual value, is the mean of the actual values.
[0132] In the embodiment of the present invention, R is predicted 2 More than 0.9, MAPE less than 2%.
[0133] By using three error indicators, namely R square, root mean square error and average relative error, to evaluate the prediction results of the dosage of the agent, it is convenient to optimize the dosage prediction model to improve the prediction results of the dosage prediction model.
[0134] Step S205, input the current influent turbidity and influent TP into the dosage prediction model, and output the prediction results of the dosage of magnetic powder, PAC and PAM.
[0135] For details, please see Figure 1 Step S104 of the illustrated embodiment will not be described in detail here.
[0136] Step S206, sending the output prediction results of the dosage of magnetic powder, PAC, and PAM to the controller to drive the dispensing system to add corresponding reagents in the mixing tank of the target sewage treatment plant.
[0137] In an embodiment of the present invention, a dosing controller is built to realize intelligent control of the magnetic coagulation dosing equipment, and the dosage results of magnetic powder, PAC, and PAM output by the dosage prediction model are transmitted to the controller. After receiving the information, the controller drives the dosing system to add corresponding agents in different mixing tanks of the target sewage treatment plant.
[0138] In some optional implementations, after adding the reagent, the values of various indicators of the effluent are monitored and fed back to the intelligent controller for optimization and correction, thereby achieving closed-loop treatment of the water quality.
[0139] The magnetic coagulant dosage prediction method provided in this embodiment receives the prediction results of the dosage of magnetic powder, PAC, and PAM through a controller to realize intelligent control of the magnetic coagulation dosing equipment, thereby fully exerting the effectiveness of the coagulant and magnetic seed and improving the magnetic coagulation rate while ensuring rapid water quality treatment.
[0140] In the present embodiment, a magnetic coagulant dosage prediction system is also provided, which is used to realize the above-mentioned embodiment and preferred implementation mode, and the description thereof will not be repeated. As used below, the term "module" can realize the combination of software and / or hardware of the predetermined function. Although the system described in the following embodiments is preferably realized with software, the realization of hardware, or the combination of software and hardware is also possible and conceived.
[0141] This embodiment provides a magnetic coagulant dosage prediction system. Figure 3 As shown, including:
[0142] The data collection module 301 is used to collect the operation data of the target sewage treatment plant, and the operation data includes the turbidity of the inlet and outlet water, TP, magnetic powder, PAC, and the dosage of PAM.
[0143] The data processing module 302 is used to perform data cleaning and normalization processing on the operation data.
[0144] The model building module 303 is used to optimize the ELM extreme learning machine using a swarm intelligence optimization algorithm, and to optimize the parameters of the ELM extreme learning machine using a PSO algorithm combined with a FOA algorithm to obtain a dosage prediction model.
[0145] The prediction module 304 is used to input the current influent turbidity and influent TP into the dosage prediction model, and output the prediction results of the dosage of magnetic powder, PAC and PAM.
[0146] In some optional implementations, the data processing module 302 includes:
[0147] The calculation unit is used to calculate the ratio of missing samples to total samples in the running data.
[0148] The data processing unit is used to remove all missing sample data if the ratio of missing samples to total samples is less than the minimum value of a preset ratio threshold range.
[0149] The first filling unit is used to fill the continuous data according to the average value and fill the discrete data according to the mode if the ratio of missing samples to total samples is within a preset ratio threshold range.
[0150] The second filling unit is used to fill the continuous data with regression analysis and fill the discrete data with k-means algorithm if the ratio of missing samples to total samples is greater than the maximum value of a preset ratio threshold range.
[0151] In some optional implementations, the model building module 303 includes:
[0152] A construction unit is used to construct an ELM extreme learning machine by taking turbidity and TP as input layer neurons and the dosage of magnetic powder, PAC and PAM as output layer neurons.
[0153] The first search unit is used to perform a global search for ELM extreme learning machine parameters using a PSO algorithm.
[0154] The second search unit is used to perform local search in the global search parameters using the FOA algorithm to obtain the optimal parameters of the ELM extreme learning machine and perform parameter optimization.
[0155] In some optional implementations, the model building module 303 further includes:
[0156] The data partitioning unit is used to divide the running data into a training data set and a test data set.
[0157] The parameter optimization unit is used to train the ELM extreme learning machine using the training data set, test the ELM extreme learning machine using the test data set, and determine the optimal input weight and hidden layer bias parameters of the ELM extreme learning machine.
[0158] In some optional embodiments, the system further comprises:
[0159] The performance evaluation module is used to evaluate the prediction effect of the dosage prediction model using R square, root mean square error index and average relative error index.
[0160] In some optional embodiments, the system further comprises:
[0161] The control module is used to send the output prediction results of the dosage of magnetic powder, PAC and PAM to the controller to drive the dispensing system to add the corresponding reagents in the mixing tank of the target sewage treatment plant.
[0162] The further functional description of each of the above modules and units is the same as that of the above corresponding embodiments and will not be repeated here.
[0163] The magnetic coagulant dosage prediction system in this embodiment is presented in the form of a functional unit, where the unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and memory that executes one or more software or fixed programs, and / or other devices that can provide the above functions.
[0164] The embodiment of the present invention also provides a computer device having the above Figure 3 The magnetic coagulant dosage prediction system shown.
[0165] See also Figure 4 , Figure 4 is a schematic diagram of the structure of a computer device provided by an optional embodiment of the present invention, such as Figure 4As shown, the computer device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. Various components are connected to each other using different buses for communication, and can be installed on a common mainboard or installed in other ways as needed. The processor can process the instructions executed in the computer device, including instructions stored in or on the memory to display the graphical information of the GUI on an external input / output device (such as, a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple computer devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Figure 4 A processor 10 is taken as an example.
[0166] The processor 10 may be a central processing unit, a network processor or a combination thereof. The processor 10 may further include a hardware chip. The hardware chip may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic or any combination thereof.
[0167] The memory 20 stores instructions executable by at least one processor 10, so that at least one processor 10 executes the method shown in the above embodiment.
[0168] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely arranged relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0169] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 20 may also include a combination of the above types of memory.
[0170] The computer device also includes an input device 30 and an output device 40. The processor 10, the memory 20, the input device 30 and the output device 40 may be connected via a bus or other means. Figure 4 The example of connecting through bus is taken in the following.
[0171] The input device 30 can receive input digital or character information and generate key signal input related to user settings and function control of the computer device, such as a touch screen, etc. The output device 40 can include a display device, etc.
[0172] The embodiment of the present invention also provides a computer-readable storage medium. The method according to the embodiment of the present invention can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium through a network download, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state hard disk, etc.; further, the storage medium can also include a combination of the above types of memories. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor, or hardware, the method shown in the above embodiment is implemented.
[0173] A part of the present invention may be applied as a computer program product, such as a computer program instruction, which, when executed by a computer, can call or provide the method and / or technical solution according to the present invention through the operation of the computer. Those skilled in the art should understand that the existence of computer program instructions in computer-readable media includes, but is not limited to, source files, executable files, installation package files, etc., and accordingly, the way in which computer program instructions are executed by a computer includes, but is not limited to: the computer directly executes the instruction, or the computer compiles the instruction and then executes the corresponding compiled program, or the computer reads and executes the instruction, or the computer reads and installs the instruction and then executes the corresponding installed program. Here, the computer-readable medium may be any available computer-readable storage medium or communication medium accessible to the computer.
[0174] Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations all fall within the scope of the present application.
Claims
1. A method for predicting the dosage of a magnetic coagulant, characterized in that: The method comprises: Collecting the operation data of the target sewage treatment plant, including the turbidity of inlet and outlet water, TP, magnetic powder, PAC, and PAM dosage; Performing data cleaning and normalization processing on the operation data; The swarm intelligence optimization algorithm is used to optimize the ELM extreme learning machine, and the PSO algorithm is combined with the FOA algorithm to optimize the parameters of the ELM extreme learning machine to obtain the dosage prediction model; The current influent turbidity and influent TP are input into the dosage prediction model, and the prediction results of the dosage of magnetic powder, PAC and PAM are output.
2. The method according to claim 1, characterized in that The step of cleaning the operation data includes: Calculate the ratio of missing samples to total samples in the running data; If the ratio of missing samples to total samples is less than the minimum value of the preset ratio threshold range, all missing sample data are removed; If the ratio of missing samples to total samples is within the preset ratio threshold, the continuous data is filled according to the average value, and the discrete data is filled according to the mode; If the ratio of missing samples to total samples is greater than the maximum value of the preset ratio threshold range, regression analysis is used to fill in the continuous data, and the k-means algorithm is used to fill in the discrete data.
3. The method according to claim 1, characterized in that The method of optimizing the ELM extreme learning machine by using a swarm intelligence optimization algorithm and optimizing the parameters of the ELM extreme learning machine by using a PSO algorithm combined with a FOA algorithm includes: The turbidity and TP were used as input layer neurons, and the dosage of magnetic powder, PAC, and PAM were used as output layer neurons to construct the ELM extreme learning machine. Use PSO algorithm to globally search ELM extreme learning machine parameters; The FOA algorithm is used to perform local search in the global search parameters to obtain the optimal parameters of the ELM extreme learning machine and perform parameter optimization.
4. The method according to claim 3, characterized in that The parameter optimization comprises: Dividing the operating data into a training data set and a test data set; The training data set is used to train the ELM extreme learning machine, and the test data set is used to test the ELM extreme learning machine to determine the optimal input weights and hidden layer bias parameters of the ELM extreme learning machine.
5. The method according to claim 1, characterized in that: After optimizing the ELM extreme learning machine by using a swarm intelligence optimization algorithm, optimizing the parameters of the ELM extreme learning machine by using a PSO algorithm fused with a FOA algorithm, and obtaining a dosage prediction model, the method further includes: The performance of the dosage prediction model was evaluated using R-square, root mean square error and average relative error indicators.
6. The method according to claim 1, characterized in that After inputting the current influent turbidity and influent TP into the dosage prediction model and outputting the prediction results of the dosage of magnetic powder, PAC and PAM, the method further includes: The output prediction results of the dosage of magnetic powder, PAC and PAM are sent to the controller to drive the dispensing system to add the corresponding reagents in the mixing tank of the target sewage treatment plant.
7. A magnetic coagulant dosage prediction system, characterized in that: The system comprises: A data acquisition module is used to collect the operation data of the target sewage treatment plant, wherein the operation data includes the turbidity of the inlet and outlet water, TP, the dosage of magnetic powder, PAC and PAM; A data processing module, used for performing data cleaning and normalization processing on the operation data; The model building module is used to optimize the ELM extreme learning machine using the swarm intelligence optimization algorithm, and to optimize the parameters of the ELM extreme learning machine using the PSO algorithm and the FOA algorithm to obtain the dosage prediction model; The prediction module is used to input the current influent turbidity and influent TP into the dosage prediction model and output the prediction results of the dosage of magnetic powder, PAC and PAM.
8. A computer device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the method for predicting the dosage of a magnetic coagulant according to any one of claims 1 to 6 by executing the computer instructions.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the method for predicting the dosage of a magnetic coagulant according to any one of claims 1 to 6.
10. A computer program product, characterized in that It comprises computer instructions, and the computer instructions are used to make a computer execute the magnetic coagulant dosage prediction method according to any one of claims 1 to 6.