Prediction method and device for adding amount of coagulation agent

By constructing a multi-layer learning model, using the training set, verification set and test set to predict the water plant operation data, the problem of coagulant addition depends on personal experience, and the efficient use of coagulant and accurate prediction of the optimal dosage is achieved.

CN119850054APending Publication Date: 2025-04-18HUADIAN WATER TECH CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411897431.2
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

Technical Problem

In the prior art, the method of adding coagulants mainly depends on the personal experience of the operator, making it difficult to achieve efficient use, and it is difficult to accurately determine the optimal dosage.

Method used

By obtaining the optimal stirring intensity gradient of the coagulation tank, determining the actual operating data of the water plant, processing the data, building a multi-layer learning model for training, and obtaining a prediction model for coagulation agent dosage.

Benefits of technology

Accurate prediction of the dosage of the optimal coagulant agent is achieved, the efficiency of coagulant is improved, and consumption and production costs are reduced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119850054A_ABST
    Figure CN119850054A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of water treatment, and discloses a method and device for predicting the adding amount of a coagulation reagent. Determining actual operation data of a water plant based on the optimal stirring intensity gradient of the coagulating basin, and processing the actual operation data of the water plant to obtain a training set, a verification set and a test set; constructing a multi-layer learning model, wherein the multi-layer learning model comprises a base learner layer composed of a plurality of base learners and a meta learner layer composed of a meta learner; training the multi-layer learning model by using the training set, the verification set and the test set to obtain a coagulation agent dosage prediction model; and predicting the adding amount of the coagulation agent by using the coagulation agent adding amount prediction model to obtain the optimal adding amount of the coagulation agent. According to the invention, accurate prediction of the optimal adding amount of the coagulation agent and efficient use of the coagulation agent are realized, and the consumption and production cost of the coagulation agent are reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the technical field of water treatment, and in particular to a method and a device for predicting the dosage of a coagulant. Background Art

[0002] Coagulation technology is widely used in water supply and sewage treatment projects. The degree of perfection of the coagulation process directly affects the effect of subsequent treatments such as sedimentation and filtration; how to use coagulants efficiently so that they can play an efficient role while seeking the minimum usage under the allowable conditions to achieve the purpose of cost saving and economic operation has become an important topic.

[0003] The method of adding relevant coagulants mainly relies on the personal experience of the operator and is limited by the accuracy of monitoring data, so it is difficult to achieve efficient use of coagulants. Summary of the invention

[0004] In view of this, the present invention provides a method and device for predicting the dosage of a coagulant to solve the problem that the coagulant is difficult to use efficiently.

[0005] In a first aspect, the present invention provides a method for predicting the dosage of a coagulant, comprising:

[0006] Obtain the optimal stirring intensity gradient of the coagulation tank;

[0007] The actual operation data of the water plant is determined based on the optimal stirring intensity gradient of the coagulation tank, and the actual operation data of the water plant is processed to obtain the training set, the validation set and the test set;

[0008] Constructing a multi-layer learning model, the multi-layer learning model includes a base learner layer composed of multiple base learners and a meta learner layer composed of a meta learner;

[0009] The multi-layer learning model is trained using the training set, validation set and test set to obtain a coagulant dosage prediction model;

[0010] The coagulant dosage prediction model is used to predict the coagulant dosage and obtain the optimal coagulant dosage.

[0011] The method for predicting the dosage of coagulant provided in this embodiment determines the actual operation data of the water plant through the optimal stirring intensity gradient of the coagulation tank, and processes the actual operation data of the water plant to obtain a training set, a validation set and a test set; constructs a multi-layer learning model, the multi-layer learning model includes a base learner layer composed of multiple base learners and a meta learner layer composed of a meta learner; trains the multi-layer learning model with the training set, the validation set and the test set to obtain a coagulant dosage prediction model; predicts the coagulant dosage with the coagulant dosage prediction model to obtain the optimal coagulant dosage, wherein, by constructing a multi-layer learning model and training the multi-layer learning model with the training set, the validation set and the test set, a coagulant dosage prediction model is obtained, which realizes accurate prediction of the optimal coagulant dosage and efficient use of coagulants, and reduces the consumption and production cost of coagulants.

[0012] In an optional embodiment, obtaining the optimal stirring intensity gradient of the coagulation tank includes:

[0013] The unimodal function corresponding to the effluent turbidity and the stirring intensity gradient value is obtained. Based on the unimodal function, the coagulation stirring experiment is carried out using the golden section method. The optimal stirring intensity gradient of the coagulation tank is determined based on the experimental results.

[0014] The method for predicting the dosage of coagulant provided in this embodiment obtains the unimodal function corresponding to the effluent turbidity and the stirring intensity gradient value, conducts coagulation and stirring experiments based on the unimodal function and utilizes the golden section method, and determines the optimal stirring intensity gradient of the coagulation tank based on the experimental results; since the optimal stirring intensity gradient of the coagulation tank is a key control indicator in the coagulation process, it is very important to ensure the coagulation effect and cost-effectiveness. Therefore, by optimizing the optimal stirring intensity gradient of the coagulation tank, the water treatment efficiency is improved while the effective utilization of resources is achieved, the energy consumption is reduced, and the foundation is laid for the subsequent establishment of a coagulant dosage prediction model.

[0015] In an optional embodiment, a multi-layer learning model is trained using a training set, a validation set, and a test set to obtain a coagulant dosage prediction model, including:

[0016] Using the training set, the validation set and the test set to train multiple base learners respectively, and obtaining the verification results of the base learners and the test results of the base learners;

[0017] The verification results of the base learners and the test results of the base learners are concatenated to obtain the meta-learning layer training set and the meta-learning layer test set;

[0018] The meta-learner is tested using the meta-learning layer training set and the meta-learning layer test set to obtain the prediction results of the coagulant dosage.

[0019] The prediction results of coagulant dosage are evaluated, and a coagulant dosage prediction model is constructed based on the evaluation results.

[0020] The method for predicting the dosage of coagulant provided in this embodiment trains multiple base learners by using a training set, a validation set and a test set to obtain the verification results of the base learners and the test results of the base learners; concatenates the verification results of the base learners and the test results of the base learners to obtain a meta-learning layer training set and a meta-learning layer test set; tests the meta-learner by using the meta-learning layer training set and the meta-learning layer test set to obtain the prediction results of the dosage of coagulant; evaluates the prediction results of the dosage of coagulant, and constructs a coagulant dosage prediction model based on the evaluation results; trains the multi-layer learning model by using the training set, the validation set and the test set, thereby realizing the training, verification and testing of the coagulant dosage prediction model, so that the coagulant dosage prediction model integrates multiple algorithms, makes up for the shortcomings of a single model, and makes the prediction of the optimal coagulant dosage more reliable by giving full play to the advantages of each algorithm.

[0021] In an optional implementation, a plurality of base learners are trained using a training set, a validation set, and a test set, respectively, to obtain validation results of the base learners and test results of the base learners, including:

[0022] Using the training set, multiple base learners are cross-trained in parallel to obtain multiple trained base learners;

[0023] Use the validation set to validate multiple base learners after training to obtain the validation results of the base learners;

[0024] The test set is used to test multiple base learners respectively to obtain the test results of the base learners.

[0025] The method for predicting the dosage of coagulant provided in this embodiment performs parallel cross-training on multiple base learners using a training set to obtain multiple trained base learners; verifies the trained multiple base learners using a verification set to obtain verification results of the base learners; and tests the multiple base learners using a test set to obtain test results of the base learners. By training and testing multiple base learners, the prediction accuracy of the multi-layer learning model is improved to a certain extent.

[0026] In an optional implementation, the meta-learner is tested using a meta-learning layer training set and a meta-learning layer test set to obtain a prediction result of the coagulant dosage, including:

[0027] Use the meta-learning layer training set to train the meta-learner to obtain the trained meta-learner;

[0028] The trained meta-learner is tested using the meta-learning layer test set to obtain the prediction results of the coagulant dosage.

[0029] The method for predicting the dosage of coagulant provided in this embodiment trains the meta-learner by using the meta-learning layer training set to obtain the trained meta-learner; and tests the trained meta-learner by using the meta-learning layer test set to obtain the prediction result of the dosage of coagulant. By training and testing the meta-learner, the prediction accuracy of the multi-layer learning model is improved.

[0030] In an optional embodiment, the prediction result of the coagulant dosage is evaluated, and a coagulant dosage prediction model is constructed based on the evaluation result, including:

[0031] Obtaining the measured value of the coagulant dosage, and calculating the error index based on the measured value of the coagulant dosage and the predicted result of the coagulant dosage;

[0032] Obtaining evaluation conditions, and comparing the evaluation conditions with error indicators;

[0033] If the error index meets the evaluation conditions, the multi-layer learning model will be used as the coagulant dosage prediction model.

[0034] The method for predicting the dosage of coagulant provided in this embodiment calculates the error index through the measured value of the dosage of coagulant and the predicted result of the dosage of coagulant, compares the evaluation conditions and the error index, and then constructs a coagulant dosage prediction model based on the comparison result. The error index is used to evaluate the fitting effect of the multi-layer learning model, thereby improving the prediction accuracy and reliability of the coagulant dosage prediction model.

[0035] In a second aspect, the present invention provides a device for predicting the dosage of a coagulant, the device comprising:

[0036] An acquisition module is used to obtain the optimal stirring intensity gradient of the coagulation tank;

[0037] A processing module is used to determine the actual operation data of the water plant based on the optimal stirring intensity gradient of the coagulation tank, and process the actual operation data of the water plant to obtain a training set, a validation set and a test set;

[0038] A construction module, used to construct a multi-layer learning model, the multi-layer learning model includes a base learner layer composed of multiple base learners and a meta learner layer composed of a meta learner;

[0039] A training module is used to train the multi-layer learning model using a training set, a validation set, and a test set to obtain a coagulant dosage prediction model;

[0040] The prediction module is used to predict the dosage of the coagulant using the coagulant dosage prediction model to obtain the optimal coagulant dosage.

[0041] In a third aspect, the present invention provides a computer device, comprising: a memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, and the processor executing the method for predicting the dosage of a coagulant according to the first aspect or any corresponding embodiment thereof by executing the computer instructions.

[0042] 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 coagulant agent according to the first aspect or any corresponding embodiment thereof.

[0043] 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 coagulant according to the first aspect or any corresponding embodiment thereof. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] 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.

[0045] Figure 1 It is a schematic flow chart of a method for predicting the dosage of a coagulant according to an embodiment of the present invention;

[0046] Figure 2 is a schematic diagram of a single-peak function determined based on the effluent turbidity and the optimal stirring intensity gradient of the coagulation tank according to an embodiment of the present invention;

[0047] Figure 3 is a schematic flow chart of another method for predicting the dosage of a coagulant according to an embodiment of the present invention;

[0048] Figure 4 It is a flowchart of specific steps of a method for predicting the dosage of a coagulant according to an embodiment of the present invention;

[0049] Figure 5 This is a structural block diagram of a device for predicting the dosage of a coagulant according to an embodiment of the present invention;

[0050] Figure 6 It is a schematic diagram of the hardware structure of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0051] 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.

[0052] The optimal dosage of coagulant refers to the minimum dosage of coagulant that can meet the established water quality target requirements. Since the factors affecting the coagulation effect are relatively complex, and the water quality and water volume will continue to change during the operation of the water plant, it is quite difficult to achieve the optimal dosage of coagulant and adjust the dosage in a timely and accurate manner.

[0053] Related coagulant dosage prediction methods include:

[0054] The first type of method includes empirical visual inspection, beaker test and empirical model method: the empirical visual inspection method is a method in which the operator determines the dosage of coagulant based on personal experience by visually observing and evaluating the characteristics of alum flocs on site. This method can quickly determine the dosage, but it is highly dependent on the personal experience of the operator and has a large subjective factor, so it is easy to cause large errors; the beaker test method is a method in which the dosage of coagulant is determined by beaker test under the premise of simulating hydraulic conditions. It can obtain a more accurate dosage, but usually requires frequent tests to cope with changes in water quality, resulting in high consumption of manpower and material resources; the empirical model method is a method in which the operator determines the dosage of coagulant based on the production Based on the experience and a large number of beaker test results, the corresponding relationship or empirical formula between turbidity and coagulant dosage is obtained. Among them, the most suitable fluid dynamic conditions for mixing and the stirring of coagulant and water for a certain period of time are the most important conditions for successful flocculation. In the water with coagulant added, the colloidal particles are destabilized and aggregated with each other, gradually becoming large floccules. At this time, the magnitude of the water flow velocity gradient G value plays a major role. In the coagulation stirring experiment, the stirring power of the agitator is calculated, and then the stirring intensity and speed of the stirring equipment are adjusted to determine the optimal stirring intensity gradient of the coagulation tank. The calculation formula of the stirring power of the agitator is as follows:

[0055] W=14.35d 4.38 n 2.69 ρ0 0.69 μ0 0.31 (1)

[0056] Where W is the stirring power of the stirrer, d is the width of the stirring blade (m), n is the stirring speed (r / min), ρ0 is the density of water (1000 / 9.81kg·s 2 / m4 ), μ0 is the absolute viscosity of water (kg·s / m 2 ).

[0057] The calculation formula for the optimal stirring intensity gradient of the coagulation tank is as follows:

[0058]

[0059] Among them, G is the optimal stirring intensity gradient of the coagulation tank, V is the volume of the water sample (m 3 ).

[0060] In actual operation, by adjusting the stirring intensity and speed of the stirring equipment, the optimal G value can be found to achieve the best coagulation effect.

[0061] However, the corresponding relationship and empirical formula in the above-mentioned empirical model method usually have an applicable turbidity range. When the raw water turbidity exceeds this range, the amount of coagulant added is difficult to determine. In addition, the empirical model method mainly uses raw water turbidity as a consideration indicator, and it is difficult to fully reflect the impact of other water quality indicators on the coagulation effect. Therefore, it has limitations in achieving the optimal addition of coagulants and has a limited scope of application.

[0062] The second method is the automatic online monitoring and addition method, which mainly includes three strategies: feedforward control, feedback control and composite control, and realizes the coagulant addition through the online monitoring system; feedforward control refers to the use of online monitoring of raw water quality data to automatically calculate and determine the coagulant dosage based on the existing coagulant dosage mathematical model, and implement the online addition control process; feedback control refers to comparing the control index after coagulation with the preset standard value, and adjusting the dosage based on the difference between the two. The most commonly used coagulant dosage feedback control is based on the streaming current detection technology, that is, when the coagulant is added, the zeta potential of the colloidal particles changes. Monitor the changes in the flowing current, correlate the current signal with the effluent turbidity value and feed it back to the front end to achieve online regulation of the coagulant dosage; composite control is a control strategy that combines feedforward control and feedback control. The parameters that affect the coagulation effect, such as raw water turbidity, pH value, water temperature, and water consumption, are used as feedforward variables. The coagulant dosage is preliminarily determined based on the mathematical model, and the effluent turbidity is used as a feedback signal to adjust the coagulant dosage until the optimal dosage is obtained. However, when the water quality undergoes complex fluctuations, due to the limited measurement range of the detection equipment, composite control is also difficult to achieve precise control of the coagulant dosage.

[0063] To solve the above technical problems, an embodiment of the present invention provides a method for predicting the dosage of coagulant, by establishing a reliable coagulant dosage prediction model and scientifically determining the optimal dosage, thereby reducing the consumption and production cost of the coagulant.

[0064] The embodiment of the present invention provides a method for predicting the dosage of a coagulant. It should be noted that the method for predicting the dosage of a coagulant provided by the embodiment of the present invention may be executed by a device for predicting the dosage of a coagulant. The device for predicting the dosage of a coagulant may be implemented as part or all of an electronic device through software, hardware, or a combination of software and hardware. The electronic device may be a server or a terminal. The server in the embodiment of the present application may be a single server or a server cluster composed of multiple servers. The terminal in the embodiment of the present application may be a smart phone, a personal computer, a tablet computer, a wearable device, an intelligent robot, or other intelligent hardware devices. In the following method embodiments, the execution subject is an electronic device as an example for explanation.

[0065] According to an embodiment of the present invention, an embodiment of a method for predicting the dosage of a 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.

[0066] In this embodiment, a method for predicting the dosage of a coagulant is provided, which can be used in the above-mentioned electronic device. Figure 1 FIG. 4 is a flow chart of a method for predicting the dosage of a coagulant according to an embodiment of the present invention. Figure 1 As shown, the process includes the following steps:

[0067] Step S101, obtaining the optimal stirring intensity gradient of the coagulation tank.

[0068] Specifically, the coagulation effect of the coagulant not only depends on the dosage of the coagulant, but also on factors such as the pH value of the water (an indicator for measuring the acidity and alkalinity of the solution) and the water flow velocity gradient. Among the above factors, except for the water flow velocity gradient G value (that is, the optimal stirring intensity gradient G value of the coagulation tank), which can be fixed after the optimal value is determined, other values ​​change with the change of water quality. Therefore, it is necessary to first determine the optimal stirring intensity gradient G value of the coagulation tank.

[0069] Specifically, a unimodal function corresponding to the effluent turbidity and the stirring intensity gradient value is obtained, and based on the unimodal function, a coagulation stirring experiment is carried out using the golden section method, and the optimal stirring intensity gradient of the coagulation tank is determined based on the experimental results.

[0070] Furthermore, the single-peak function corresponding to the effluent turbidity and stirring intensity gradient value is as follows: Figure 2As shown in the figure, according to the unimodal function, the 0.618 method (i.e., the golden section method) is used to determine the optimal stirring intensity gradient of the coagulation tank; where it is assumed that the experimental range corresponding to the coagulation stirring experiment is [a, b], a and b are both the stirring intensity gradient of the coagulation tank, and the first experimental point x2 is selected at the 0.618 position of the experimental range, which can be expressed as:

[0071] x2=a+0.618×(ba) (3)

[0072] The second experimental point is selected at the symmetrical point x1 of the first experimental point x2, that is, at the 0.382 position of the experimental range. The calculation formula for the second experimental point is as follows:

[0073] x1=a+0.382×(ba) (4)

[0074] Among them, x1 represents the second experimental point.

[0075] Suppose f(x1) and f(x2) represent the experimental results of points x1 and x2, and when f(x) represents the residual turbidity, the smaller its value is, the better the effect is; if f(x2) is better than f(x1), according to the principle of "selecting the best and eliminating the worst", remove the experimental range [a,x1] and continue the experiment in the remaining range [x1,b]; if the experimental result of f(x2) is worse than the experimental result of f(x1), also according to the principle of "selecting the best and eliminating the worst", remove the experimental range (x2,b) and continue the experiment in the remaining range [a,x2]; if the experimental effects of f(x2) and f(x1) are the same, remove the experimental ranges at both ends and continue the experiment in the remaining experimental range [x1,x2]; according to the properties of unimodal functions, the above three methods can determine the optimal stirring intensity gradient of the coagulation tank, and the optimal point will not be lost; repeat the above steps until a satisfactory experimental point is found and relatively good experimental results are obtained.

[0076] Further, according to experience, the coagulation tank stirring intensity gradient is generally taken as 500-1000 / s. Assuming a=500 / s, b=1000 / s, there are 11 groups of coagulation tank stirring intensity gradients of 500 / s, 691 / s, 736 / s, 747 / s, 749 / s, 750 / s, 751 / s, 753 / s, 764 / s, 809 / s and 1000 / s as experimental points. According to these 11 groups of coagulation tank stirring intensity gradients, 11 groups of effluent turbidity values ​​are obtained, and the coagulation tank stirring intensity gradient corresponding to the smallest effluent turbidity value is selected as the optimal coagulation tank stirring intensity gradient; wherein, the specific steps of selecting 11 groups of experimental points in the experimental range of 500-1000 / s are shown in Table 1 below:

[0077] Table 1:

[0078] a b <![CDATA[x2=a+0.618(b-a)]]> <![CDATA[x1=a+0.382(b-a)]]> 500 1000 809 691 691 809 764 736 736 764 753 747 747 753 751 749

[0079] Step S102, determining the actual operation data of the water plant based on the optimal stirring intensity gradient of the coagulation tank, and processing the actual operation data of the water plant to obtain a training set, a validation set and a test set.

[0080] Specifically, the coagulation effect of the coagulant is not only related to the flow rate of treated water, but also affected by many factors such as raw water quality, temperature and sedimentation process; among them, water volume and turbidity, as key parameters affecting the coagulant addition flow rate, need to be monitored in real time in the coagulant addition control system of the water plant; and temperature is one of the main factors affecting the coagulation effect. When the temperature is too low, the viscosity of the water will increase, thereby increasing the movement resistance between the colloidal particles, resulting in the weakening of Brownian motion, which is not conducive to the destabilization of the colloidal particles, thereby worsening the coagulation and sedimentation effect.

[0081] Furthermore, in actual water plant operation, among all indicators related to the coagulation effect of coagulants, only the stirring intensity gradient of the coagulation tank needs no adjustment after the optimal stirring intensity gradient of the coagulation tank is determined, and other indicators change with the change of influent; after determining the optimal stirring intensity gradient of the coagulation tank, only the actual operation data of the water plant after the optimal stirring intensity gradient of the coagulation tank is determined is collected, such as selecting the operation data one year later.

[0082] Furthermore, assuming that the specific operating data indicators are characteristic vectors and the coagulant dosage is a label vector, in order to reduce the data dimension as much as possible and save the model calculation time, the grey correlation analysis can be used to analyze the correlation between the raw water indicators and the coagulant dosage. The larger the R value (correlation value), the higher the correlation. The indicators with R values ​​greater than 0.9 are selected, that is, the indicators with a higher correlation are selected, including water inlet, raw water turbidity, raw water pH and raw water temperature as characteristic vectors.

[0083] Specifically, due to special circumstances such as human detection errors and failures in the reagent dosing system during data collection, there are abnormal values ​​and missing values ​​in the actual operation data of the water plant, which require preprocessing for subsequent model construction; preprocessing mainly includes:

[0084] 1) The three sigma criterion was used to eliminate outliers in each variable.

[0085] 2) For missing data, the average value of the three data before and after the missing value of each variable is used to replace it.

[0086] 3) The maximum and minimum normalization method is used to normalize each variable to eliminate the influence of dimension. After preprocessing, valid data is obtained.

[0087] Furthermore, the actual operation data of the water plant after pretreatment are divided into three parts: training set, validation set and test set. Among them, 80% of the actual operation data of the water plant after pretreatment are divided into training set and validation set by cross-validation method, with a fold of 4, that is, the ratio of training set to validation set is 3:1, and the remaining 20% ​​of the actual operation data of the water plant after pretreatment are constructed as the test set; the inlet water volume, raw water turbidity, raw water pH and raw water temperature are selected as feature vectors, and the coagulant dosage is the label vector.

[0088] Step S103: construct a multi-layer learning model, where the multi-layer learning model includes a base learner layer consisting of multiple base learners and a meta learner layer consisting of one meta learner.

[0089] Specifically, the multi-layer learning model adopts the Stacking integration model, which consists of two layers: the first layer is the base learner layer, which is composed of multiple algorithms with different principles; the second layer is the meta-learner layer, which integrates the prediction results of the base learning layer using an algorithm that is not prone to overfitting; since different algorithms have different learning principles, the prediction results will show the unique advantages and disadvantages of each algorithm; the Stacking integration model makes decisions by combining multiple algorithms, seeking multiple opinions, and integrating algorithm advantages. Even if the prediction result of a certain data on a certain algorithm is not ideal, other algorithms can correct it, thereby further improving the prediction accuracy of the model.

[0090] Furthermore, the training set was used to train algorithms such as Ridge (a regularization method for linear regression), KNR (an instance-based learning algorithm), XGBoost (an efficient machine learning algorithm based on the gradient boosting framework), and Lasso (a regularization method for linear regression used for feature selection and coefficient shrinkage). The test set was used for prediction evaluation, and the prediction effect of a single algorithm was analyzed. The fitting degree effect was analyzed based on the error index. The algorithm with the lowest fitting degree according to the evaluation results was used as the meta-learner, and the other three algorithms were used as three base learners to establish a Stacking framework.

[0091] Step S104, training the multi-layer learning model using the training set, the validation set and the test set to obtain a coagulant dosage prediction model.

[0092] Step S105, predicting the coagulant dosage using the coagulant dosage prediction model to obtain the optimal coagulant dosage.

[0093] The method for predicting the dosage of coagulant provided in the present embodiment obtains the optimal stirring intensity gradient of the coagulant tank; determines the actual operation data of the water plant based on the optimal stirring intensity gradient of the coagulant tank, and processes the actual operation data of the water plant to obtain a training set, a validation set and a test set; constructs a multi-layer learning model, the multi-layer learning model includes a base learner layer composed of multiple base learners and a meta learner layer composed of a meta learner; trains the multi-layer learning model with the training set, the validation set and the test set to obtain a coagulant dosage prediction model; predicts the coagulant dosage with the coagulant dosage prediction model to obtain the optimal coagulant dosage, wherein, by constructing a multi-layer learning model and training the multi-layer learning model with the training set, the validation set and the test set, the coagulant dosage prediction model is obtained, which realizes the accurate prediction of the optimal coagulant dosage and the efficient use of coagulants, and reduces the consumption and production cost of coagulants.

[0094] In this embodiment, a method for predicting the dosage of a coagulant is provided, which can be used in the above-mentioned electronic device. Figure 3 FIG. 4 is a flow chart of a method for predicting the dosage of a coagulant according to an embodiment of the present invention. Figure 3 As shown, the process includes the following steps:

[0095] Step S301, obtain the optimal stirring intensity gradient of the coagulation tank. Figure 1 Step S101 of the illustrated embodiment will not be described in detail here.

[0096] Step S302: determine the actual operation data of the water plant based on the optimal stirring intensity gradient of the coagulation tank, and process the actual operation data of the water plant to obtain a training set, a validation set and a test set. Figure 1 Step S102 of the illustrated embodiment will not be described in detail here.

[0097] Step S303: construct a multi-layer learning model, which includes a base learner layer composed of multiple base learners and a meta learner layer composed of a meta learner. Figure 1 Step S103 of the illustrated embodiment will not be described in detail here.

[0098] Step S304, training the multi-layer learning model using the training set, the validation set and the test set to obtain a coagulant dosage prediction model.

[0099] Specifically, the above step S304 includes:

[0100] Step S3041, using the training set, the validation set and the test set to train multiple base learners respectively, to obtain the verification results of the base learners and the test results of the base learners.

[0101] In some optional implementations, the above step S3041 includes:

[0102] Step a1, using the training set to perform parallel cross-training on multiple base learners respectively, to obtain multiple trained base learners.

[0103] Specifically, three base learners are cross-trained four times in parallel to obtain multiple trained base learners.

[0104] Step a2, using the verification set to verify the trained multiple base learners to obtain the verification results of the base learners.

[0105] Specifically, the validation set is used to validate multiple base learners after training, that is, the three base learners are validated four times to obtain the validation results y of the base learners. 1,ver .

[0106] Step a3, using the test set to test multiple base learners respectively, to obtain the test results of the base learners.

[0107] Specifically, the three base learners after training are tested using the test set to obtain the test results y 1,test .

[0108] Step S3042: Concatenate the verification result of the base learner and the test result of the base learner to obtain a meta-learning layer training set and a meta-learning layer test set.

[0109] Specifically, the verification result y 1,ver And the test result y 1,test To integrate, that is, to verify the result y 1,ver The 4 verifications are spliced ​​vertically and the test results y are calculated 1,test The average of the four prediction results of the vertical splicing of the verification results and the average of the prediction results corresponding to the test results are spliced, and the integrated data is divided into the meta-learning layer training set x 2,train With the meta-learning layer test set x 2,test .

[0110] Step S3043, using the meta-learning layer training set and the meta-learning layer test set to test the meta-learner, and obtain the prediction result of the coagulant dosage.

[0111] In some optional implementations, the above step S3043 includes:

[0112] Step b1: train the meta-learner using the meta-learning layer training set to obtain a trained meta-learner.

[0113] Specifically, in the meta-learning layer, the meta-learning layer training set x is used 2,trainThe meta-learner is trained to obtain a trained meta-learner.

[0114] Step b2: Use the meta-learning layer test set to test the trained meta-learner to obtain the prediction result of the coagulant dosage.

[0115] Specifically, in the meta-learning layer, the meta-learning layer test set x is used 2,test The trained meta-learner is tested, and the output result is the predicted result y of the coagulant dosage. 2,pre .

[0116] Step S3044, evaluating the prediction results of the coagulant dosage, and constructing a coagulant dosage prediction model based on the evaluation results.

[0117] Specifically, the predicted result of coagulant dosage y 2,pre The actual measured value of coagulant dosage was compared and evaluated to determine the fitting effect of the coagulant dosage prediction model.

[0118] In some optional implementations, the above step S3043 includes:

[0119] Step c1, obtaining the measured value of the coagulant dosage, and calculating the error index based on the measured value of the coagulant dosage and the predicted result of the coagulant dosage.

[0120] Specifically, using R 2 The prediction results of coagulant dosage were evaluated by three error indicators: coefficient of determination, RMSE (Root Mean Squared Error) and MAPE (Mean Absolute Percentage Error). 2 The calculation formula is as follows:

[0121]

[0122] The calculation formula of RMSE is as follows:

[0123]

[0124] The calculation formula of MAPE is as follows:

[0125]

[0126] Among them, y i is the predicted result of coagulant dosage; f i is the measured value of coagulant dosage; f i It is the measured average value of coagulant dosage.

[0127] Step c2, obtaining evaluation conditions, and comparing the evaluation conditions with the error index.

[0128] Step c3: If the error index meets the evaluation conditions, the multi-layer learning model is used as the coagulant dosage prediction model.

[0129] Specifically, assume that the evaluation condition is: R 2 The closer it is to 1, the closer RMSE is to 0, the closer MAPE is to 0, and the better the prediction effect. The fitting effect of the multi-layer learning model is judged according to the evaluation conditions. If the fitting effect meets the standard, the multi-layer learning model is used as the prediction model for the dosage of coagulant.

[0130] Step S305: Use the coagulant dosage prediction model to predict the coagulant dosage to obtain the optimal coagulant dosage. Figure 1 Step S105 of the illustrated embodiment will not be described in detail here.

[0131] The method for predicting the dosage of coagulant provided in this embodiment trains multiple base learners by using a training set, a validation set and a test set to obtain the verification results of the base learners and the test results of the base learners; concatenates the verification results of the base learners and the test results of the base learners to obtain a meta-learning layer training set and a meta-learning layer test set; tests the meta-learner by using the meta-learning layer training set and the meta-learning layer test set to obtain the prediction results of the dosage of coagulant; evaluates the prediction results of the dosage of coagulant, and constructs a coagulant dosage prediction model based on the evaluation results; trains the multi-layer learning model by using the training set, the validation set and the test set, thereby realizing the training, verification and testing of the coagulant dosage prediction model, so that the coagulant dosage prediction model integrates multiple algorithms, makes up for the shortcomings of a single model, and makes the prediction of the optimal coagulant dosage more reliable by giving full play to the advantages of each algorithm.

[0132] The following is a specific example to illustrate the specific steps of a method for predicting the dosage of a coagulant.

[0133] Embodiment 1:

[0134] like Figure 4 As shown, the specific steps of the method for predicting the dosage of coagulant include:

[0135] 1) Determine the optimal G value (i.e. the optimal stirring intensity gradient).

[0136] 2) Obtain the actual operation data of the water plant.

[0137] 3) Process the actual operation data of the water plant to obtain the training set and test set.

[0138] 4) Use the training set to train the stacking model (i.e., the multi-layer learning model). If the stacking model meets the error requirements, the training is completed and a coagulant dosage prediction model is obtained; if the stacking model does not meet the error requirements, the stacking model is repeatedly trained until the stacking model meets the error requirements.

[0139] 5) Input the test set into the coagulant dosage prediction model to obtain the prediction results and evaluation.

[0140] In this embodiment, a device for predicting the dosage of coagulant is also provided, which is used to implement the above embodiments and preferred implementations, and the descriptions that have been made will not be repeated. As used below, the term "module" can be a combination of software and / or hardware that implements a predetermined function. Although the device described in the following embodiments is preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.

[0141] This embodiment provides a device for predicting the dosage of coagulant. Figure 5 As shown, including:

[0142] The acquisition module 501 is used to obtain the optimal stirring intensity gradient of the coagulation tank.

[0143] The processing module 502 is used to determine the actual operation data of the water plant based on the optimal stirring intensity gradient of the coagulation tank, and process the actual operation data of the water plant to obtain a training set, a validation set and a test set.

[0144] The construction module 503 is used to construct a multi-layer learning model, which includes a base learner layer composed of multiple base learners and a meta learner layer composed of one meta learner.

[0145] The training module 504 is used to train the multi-layer learning model using the training set, the validation set and the test set to obtain a coagulant dosage prediction model.

[0146] The prediction module 505 is used to predict the dosage of the coagulant using the coagulant dosage prediction model to obtain the optimal coagulant dosage.

[0147] In some optional implementations, the acquisition module 501 is further used to:

[0148] The unimodal function corresponding to the effluent turbidity and the stirring intensity gradient value is obtained. Based on the unimodal function, the coagulation stirring experiment is carried out using the golden section method. The optimal stirring intensity gradient of the coagulation tank is determined based on the experimental results.

[0149] In some optional implementations, the training module 504 includes:

[0150] The training unit is used to train multiple base learners using a training set, a validation set and a test set to obtain a validation result of the base learner and a test result of the base learner.

[0151] The concatenation unit is used to concatenate the verification result of the base learner and the test result of the base learner to obtain a meta-learning layer training set and a meta-learning layer test set.

[0152] The testing unit is used to test the meta-learner using the meta-learning layer training set and the meta-learning layer test set to obtain the prediction result of the coagulant dosage.

[0153] The evaluation unit is used to evaluate the prediction results of the coagulant dosage and build a coagulant dosage prediction model based on the evaluation results.

[0154] In some optional implementations, the training unit includes:

[0155] The first training subunit is used to perform parallel cross-training on multiple base learners respectively using the training set to obtain multiple trained base learners.

[0156] The verification subunit is used to verify the multiple base learners after training using the verification set to obtain the verification results of the base learners.

[0157] The first testing subunit is used to test the multiple base learners respectively using the test set to obtain the test results of the base learners.

[0158] In some optional embodiments, the test unit includes:

[0159] The second training subunit is used to train the meta-learner using the meta-learning layer training set to obtain a trained meta-learner.

[0160] The second testing subunit is used to test the trained meta-learner using the meta-learning layer test set to obtain a prediction result of the coagulant dosage.

[0161] In some optional embodiments, the evaluation unit includes:

[0162] The calculation subunit is used to obtain the measured value of the coagulant dosage, and calculate the error index based on the measured value of the coagulant dosage and the predicted result of the coagulant dosage.

[0163] The comparison subunit is used to obtain the evaluation condition and compare the evaluation condition with the error index.

[0164] As a subunit, if the error index meets the evaluation conditions, the multi-layer learning model is used as a coagulant dosage prediction model.

[0165] 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.

[0166] The device for predicting the dosage of coagulant 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.

[0167] The embodiment of the present invention also provides a computer device having the above Figure 5 The device for predicting the dosage of coagulant is shown.

[0168] See also Figure 6 , Figure 6 is a schematic diagram of the structure of a computer device provided by an optional embodiment of the present invention, such as Figure 6 As 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 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. 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 6 A processor 10 is taken as an example.

[0169] 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.

[0170] The memory 20 stores instructions executable by at least one processor 10, so that the at least one processor 10 executes the method shown in the above embodiment.

[0171] 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.

[0172] 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.

[0173] 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 6 The example of connecting through bus is taken in the following.

[0174] The input device 30 can receive input digital or character information, and generate key signal input related to the user settings and function control of the computer device, such as a touch screen, a keypad, a mouse, a track pad, a touch pad, an indicator bar, one or more mouse buttons, a trackball, a joystick, etc. The output device 40 may include a display device, an auxiliary lighting device (e.g., an LED) and a tactile feedback device (e.g., a vibration motor), etc. The above-mentioned display device includes but is not limited to a liquid crystal display, a light emitting diode, a display and a plasma display. In some optional embodiments, the display device can be a touch screen.

[0175] 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.

[0176] 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.

[0177] 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 are all within the scope defined by the appended claims.

Claims

1. A method for predicting the dosage of a coagulant, characterized in that: include: Obtain the optimal stirring intensity gradient of the coagulation tank; Determining actual operation data of the water plant based on the optimal stirring intensity gradient of the coagulation tank, and processing the actual operation data of the water plant to obtain a training set, a validation set and a test set; Constructing a multi-layer learning model, wherein the multi-layer learning model includes a base learner layer composed of a plurality of base learners and a meta learner layer composed of a meta learner; The multi-layer learning model is trained using the training set, the validation set and the test set to obtain a coagulant dosage prediction model; The coagulant dosage prediction model is used to predict the coagulant dosage to obtain the optimal coagulant dosage.

2. The method according to claim 1, characterized in that The method of obtaining the optimal stirring intensity gradient of the coagulation tank comprises: A unimodal function corresponding to the effluent turbidity and the stirring intensity gradient value is obtained, and based on the unimodal function, a coagulation stirring experiment is performed using the golden section method, and the optimal stirring intensity gradient of the coagulation tank is determined based on the experimental results.

3. The method according to claim 1, characterized in that The multi-layer learning model is trained by using the training set, the validation set and the test set to obtain a coagulant dosage prediction model, including: Using the training set, the validation set and the test set to train the multiple base learners respectively, to obtain validation results of the base learners and test results of the base learners; Concatenate the verification result of the base learner and the test result of the base learner to obtain a meta-learning layer training set and a meta-learning layer test set; The meta-learner is tested using the meta-learning layer training set and the meta-learning layer test set to obtain a prediction result of the coagulant dosage; The prediction result of the coagulant dosage is evaluated, and the coagulant dosage prediction model is constructed based on the evaluation result.

4. The method according to claim 3, characterized in that The method of using the training set, the verification set, and the test set to respectively train the multiple base learners to obtain verification results of the base learners and test results of the base learners includes: Using the training set to perform parallel cross-training on the multiple base learners respectively to obtain multiple trained base learners; Using the verification set to verify the trained multiple base learners to obtain verification results of the base learners; The multiple base learners are tested respectively using the test set to obtain test results of the base learners.

5. The method according to claim 3, characterized in that: The meta-learner is tested by using the meta-learning layer training set and the meta-learning layer test set to obtain a prediction result of the coagulant dosage, including: Using the meta-learning layer training set to train the meta-learner to obtain a trained meta-learner; The trained meta-learner is tested using the meta-learning layer test set to obtain a prediction result of the coagulant dosage.

6. The method according to claim 3, characterized in that The method of evaluating the prediction result of the coagulant dosage and constructing the coagulant dosage prediction model based on the evaluation result includes: Obtaining a measured value of the coagulant dosage, and calculating error indicators based on the measured value of the coagulant dosage and the predicted result of the coagulant dosage; Acquiring an evaluation condition, and comparing the evaluation condition with the error indicator; If the error index meets the evaluation condition, the multi-layer learning model is used as the coagulant dosage prediction model.

7. A device for predicting the dosage of coagulant, characterized in that: The device comprises: An acquisition module is used to obtain the optimal stirring intensity gradient of the coagulation tank; A processing module, used for determining the actual operation data of the water plant based on the optimal stirring intensity gradient of the coagulation tank, and processing the actual operation data of the water plant to obtain a training set, a validation set and a test set; A construction module, used to construct a multi-layer learning model, wherein the multi-layer learning model includes a base learner layer composed of multiple base learners and a meta learner layer composed of one meta learner; A training module, used to train the multi-layer learning model using the training set, the validation set and the test set to obtain a coagulant dosage prediction model; The prediction module is used to predict the dosage of the coagulant using the coagulant dosage prediction model to obtain the optimal coagulant dosage.

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 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 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 method for predicting the dosage of coagulant agent according to any one of claims 1 to 6.

Citation Information

Cited By

  • Intelligent feces treatment system and method

    CN120736670A