Tailing pond water treatment dosing quantity prediction method based on historical output inverse modeling
By using a forward prediction model for effluent water quality based on a GRU neural network, the problem of predicting the dosage of chemicals when the information at the influent is unstable is solved, enabling real-time adjustment of the dosage and forming a reusable knowledge base, thereby improving the stability and economy of tailings pond water treatment.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SHENZHEN ZHONGJIN LINGNAN NONFEMET COMPANY
- Filing Date
- 2026-02-28
- Publication Date
- 2026-06-02
AI Technical Summary
Existing technologies rely on multi-source information from the inlet for predicting chemical dosage, which suffers from incomplete equipment configuration, high sensor failure rate, and high maintenance costs. This makes it difficult to obtain stable information over a long period of time, and manual adjustment of chemical dosage based on experience is unstable and has high operating costs.
A forward prediction model for effluent water quality based on GRU neural network is adopted. Historical effluent water quality index data is used to predict the dosage, and a calculation function for the dosage adjustment is constructed. Combined with smoothing constraints and penalty terms, real-time or near-real-time adjustment is achieved.
It enables the prediction of chemical dosage without relying on inlet water information, and can adjust the dosage in real time or near real time. It forms a reusable and iteratively optimized knowledge base, avoiding the phenomenon of over- or under-dosing due to human experience, thus improving treatment efficiency and reducing operating costs.
Smart Images

Figure CN121747761B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of tailings wastewater treatment technology, specifically a method for predicting the dosage of chemicals used in tailings pond water treatment based on historical output reverse modeling. Background Technology
[0002] Industrial wastewater is generated during the production process of mining enterprises. This wastewater needs to be treated to meet standards before it can be discharged. Industrial wastewater treatment requires the addition of chemicals, which involves the dosage. In existing technologies, the prediction of the required chemical dosage for industrial wastewater treatment often relies on multi-source information from the influent. This multi-source information typically includes parameters such as influent flow rate, turbidity, pH value, suspended solids concentration, temperature, and environmental conditions. This multi-source information is used as input data and fed into a mechanistic model or data-driven model to predict the dosage.
[0003] Existing technologies rely on multi-source information from the water inlet. However, due to various reasons such as imperfect on-site detection equipment configuration, harsh sensor operating environment, high failure rate, and high maintenance cost, it is often difficult to obtain multi-source information from the water inlet in a long-term, stable, and complete manner. As a result, the model often cannot calculate the dosage prediction based on the multi-source information from the water inlet, or the calculation results have large errors.
[0004] To avoid or reduce reliance on multi-source information from the influent, some existing technologies rely on manual experience to determine the dosage. Operators adjust the dosage based on changes in water quality. This reliance on manual adjustment has significant drawbacks, including substantial differences in experience among personnel, making it difficult to guarantee the stability and optimality of dosage measurements. Furthermore, the lack of systematic modeling of the complex nonlinear relationship between chemicals and impurities in the water makes it difficult to establish a reusable and iteratively optimized objective knowledge base. It also hinders real-time or near-real-time adjustments based on water quality changes, leading to insufficient or excessive dosages, affecting industrial wastewater treatment effectiveness, and increasing operating costs. Summary of the Invention
[0005] To address the shortcomings of existing technologies, the purpose of this invention is to provide a method for predicting the dosage of chemicals used in tailings dam water treatment based on inverse modeling of historical outputs, which can solve the problems described in the background technology.
[0006] The technical solution to achieve the objective of this invention is: a method for predicting the dosage of chemicals for tailings dam water treatment based on inverse modeling of historical output, comprising the following steps:
[0007] Obtain historical datasets, which include effluent water quality index data and actual chemical dosage. The effluent water quality index data includes multiple water quality indicators, at least one of which is wastewater flow rate.
[0008] A forward prediction model for effluent water quality based on a GRU neural network was constructed. This model uses historical datasets as input to obtain predicted effluent water quality values.
[0009] A calculation function for adjusting the dosage is constructed based on the difference between the predicted water quality value at the outlet and the preset target water quality index data at the outlet.
[0010] The dosage adjustment amount that meets specific conditions in the calculation function is taken as the final dosage adjustment amount, and the dosage at the next sampling time is determined to be the dosage of the previous dosage plus the final dosage adjustment amount.
[0011] Furthermore, the water quality indicators at the outlet also include pH value, CODcr, ammonia nitrogen content, total arsenic content, total cadmium content, total lead content, and total zinc content.
[0012] Furthermore, historical water quality index data at the effluent end are obtained according to the sampling period, and corresponding water quality index data at the effluent end are obtained at each sampling time. At sampling time t, m items of water quality index data at the effluent end are obtained, which constitute an effluent end water quality index data vector. , , This represents the first of several water quality indicators at sampling time t. Water quality indicators .
[0013] Furthermore, the historical dataset at sampling time t for: , , This indicates the time when the dosage of the last medication changed. This indicates the time at which the dosage of the medicine changed. express The actual amount of pesticide added that was recorded.
[0014] Furthermore, after obtaining the historical dataset, and before inputting the historical dataset into the forward prediction model for water quality at the effluent end, the process also includes preprocessing and normalization of each data item in the historical dataset in sequence. The preprocessing includes removing outlier data and supplementing missing data.
[0015] Furthermore, with As input, sampling time Predicted water quality at the outlet The output of the gated recurrent unit (GRU) of the water quality forward prediction model at the outlet end is represented by the forward mapping relationship as shown in formula ①:
[0016] ①
[0017] in, , , , , This represents the wastewater flow rate at sampling time t in the water quality index data at the outlet. Indicates the sampling time in the water quality index data at the outlet. Wastewater flow rate below
[0018] Convert formula ① to formula ②:
[0019] ②
[0020] In the formula, , This represents the output layer parameters of the GRU neural network.
[0021] use The samples are input into the forward prediction model for effluent water quality for supervised training. The training loss function during the training process... as follows:
[0022]
[0023] In the formula, This represents the batch processing quantity, which is a constant. This represents the smoothing constraint weight coefficient. and They represent the sampling times respectively. Sampling time Predicted water quality at the outlet. Indicates the sampling time Obtain m water quality index data at the outlet and construct an outlet water quality index data vector.
[0024] Furthermore, the difference between the predicted water quality value at the outlet and the preset target water quality index data at the outlet is... With preset The difference , This indicates the preset target water quality index data at the outlet.
[0025] Furthermore, regarding the value To perform weighted processing, a comprehensive prediction bias index is obtained. :
[0026]
[0027] In the formula, This represents the weighting coefficients corresponding to each effluent indicator. , This refers to the total number of multiple water quality indicators.
[0028] In the prediction deviation index Based on this, a calculation model for the dosage adjustment is constructed, and the dosage adjustment amount in the dosage adjustment calculation model is... Defined as:
[0029]
[0030] The dosage adjustment amount The calculation is performed using the following nonlinear function, which serves as the calculation function. The calculation formula is shown below:
[0031]
[0032] In the formula, Represents the bias sensitivity coefficient. This indicates the adjustment coefficient for drug dosage. , These represent the upper and lower limits of the preset dosage of the drug, respectively.
[0033] Furthermore, , , .
[0034] Furthermore, the specific condition is the condition that satisfies formulas ③ and ④:
[0035] ③
[0036] ④
[0037] In the formula, Constraints are introduced for the process of adjusting the dosage. This represents the sensitivity coefficient matrix of the dosage to effluent parameters. This represents the smoothing weighting coefficient for manual drug administration. This indicates the maximum dosage adjustment for a single dose. This indicates the minimum dosage adjustment for a single medication.
[0038] The beneficial effects of this invention are as follows: This invention employs a forward prediction model for effluent water quality based on a GRU neural network. This model can predict changes in water quality indicators in advance, effectively capturing the dynamic characteristics of water quality changes. Based on historical data and current dosage, it predicts future effluent water quality. This trend-based prediction can anticipate changes in effluent water quality, thereby allowing for advance adjustment of the dosage and achieving real-time or near-real-time dosage adjustment. Furthermore, by introducing smoothing constraints and penalty terms, it avoids excessive or insufficient dosage adjustments due to human experience. In addition, it can be repeatedly executed within each dosing cycle, forming a closed-loop control and creating a reusable and iteratively optimized objective knowledge base. In summary, this invention does not rely on or is not entirely dependent on multi-source information from the influent end, and does not require human experience to determine the dosage, enabling real-time or near-real-time dosage prediction. Attached Figure Description
[0039] Figure 1 This is a flowchart illustrating a preferred embodiment of the present invention;
[0040] Figure 2 This is a schematic diagram of the framework of the forward prediction model for water quality at the outlet. Detailed Implementation
[0041] The present invention will be further described below with reference to the accompanying drawings and specific embodiments:
[0042] like Figures 1-2 As shown, the method for predicting the dosage of chemicals for tailings dam water treatment based on inverse modeling of historical output includes the following steps:
[0043] Step 1: Obtain historical datasets. Historical datasets include water quality index data at the effluent end and the actual dosage of chemicals added. Water quality index data at the effluent end includes multiple water quality indicators.
[0044] For example, the water quality indicators include eight items: pH value, CODcr (chemical oxygen demand), ammonia nitrogen content, total arsenic content, total cadmium content, total lead content, total zinc content, and wastewater flow rate.
[0045] It is understandable that the historical water quality index data at the outlet can be obtained from historical data sampled according to the sampling period, for example, the sampling period is based on... The sampling period is 3 minutes (or other durations) to collect water quality monitoring data from the tailings dam outlet over the past two years, thus obtaining historical water quality index data. This sampling period yields multiple historical water quality index data points, resulting in a multi-item water quality index at sampling time t. At sampling time t, m items (e.g., m=8, i.e., 8 items) of water quality index data are obtained and combined to form a water quality index data vector at the outlet. , , This represents the first of several water quality indicators at sampling time t. Water quality indicators .
[0046] In practical applications, data is typically recorded only when the dosage changes. Therefore, to reflect the continuity of dosage, the actual dosage added at sampling time t is recorded. This refers to the dosage during the time interval between the last recorded change in dosage and the current change in dosage. , This indicates the time when the dosage of the last medication changed. This indicates the time at which the dosage of the medicine changed. express The actual amount of pesticide added that was recorded.
[0047] Therefore, the historical dataset at sampling time t have .
[0048] For example, after obtaining the historical dataset, the process also includes preprocessing and normalizing each data item in the historical dataset in sequence.
[0049] The purpose of preprocessing is to remove outlier data, specifically data on water quality indicators that exceed physically reasonable ranges or have a rate of change exceeding preset thresholds. It also includes supplementing missing data, such as by using the difference between adjacent time points or historical averages. Since outlier removal and missing value supplementation are existing technologies, the specific implementation methods will not be elaborated here.
[0050] Because the dimensions of various water quality indicators are different, normalization is performed to remove the dimensions. For example, normalization can be achieved by comparing the indicators to their maximum and minimum values, i.e., by using the following formula: Since normalization is also an existing technology, it will not be elaborated here.
[0051] Step 2: with As input, sampling time Predicted water quality at the outlet As the output of the Gated Recurrent Unit (GRU) in the pre-built GRU neural network, it can be represented by the forward mapping relationship as shown in Equation ①:
[0052] ①
[0053] in, This represents a forward prediction model for effluent water quality based on a GRU neural network. , , , , This represents the wastewater flow rate at sampling time t in the effluent water quality index data, which is also the 8th data item in the effluent water quality index data. Indicates the sampling time in the water quality index data at the outlet. Wastewater flow rate.
[0054] refer to Figure 2 , Figure 2 This is a schematic diagram of the framework of the forward prediction model for water quality at the outlet, with the GRU neural network serving as the forward prediction model for water quality at the outlet.
[0055] Understandably, due to the significant time correlation and dynamic lag characteristics of water treatment processes, the system state at a single moment is insufficient to fully characterize the evolution of water quality. Therefore, it is necessary to utilize the sampling time... Data up to sampling time t (i.e., N=10) is used as input to the forward prediction model of effluent water quality, and the sampling time is used as input to the forward prediction model of effluent water quality. Predicted water quality at the outlet As output.
[0056] Among them, the constructed GRU neural network serves as a forward prediction model for water quality at the effluent end.
[0057] Understandably, the GRU neural network is an existing neural network model, for the first... At each time step, the state update process of the GRU neural network update gate is as follows:
[0058]
[0059] In the formula, This indicates the state of the gate in the GRU neural network update. , , These represent the trainable parameter matrix, update gate, and bias term of the GRU neural network, respectively.
[0060] The state update process of the reset gate in the GRU neural network is as follows:
[0061]
[0062] In the formula, This indicates the state of the reset gate in the GRU neural network. , , These represent the trainable parameter matrix, reset gate, and bias term of the GRU neural network, respectively. It is the sigmoid activation function.
[0063] The candidate hidden state update process of the GRU neural network is as follows:
[0064]
[0065] In the formula, This represents a candidate hidden state in a GRU neural network. , , These represent the trainable parameter matrix, hidden state, and bias term of the GRU neural network, respectively.
[0066] The hidden state of the GRU neural network is updated as follows:
[0067]
[0068] In the formula, Indicates the updated value at the 1st position. Hidden states at each time step This represents the Hadamard product. The hyperparameters of the GRU neural network are: time window length 10, number of hidden layer units 16.
[0069] Since GRU neural networks are existing technology, other specific structural details will not be elaborated upon, that is, the internal structure of GRU neural networks will not be described in detail.
[0070] After processing all the inputs (input sequence) for all states, the final hidden state of the GRU neural network is obtained according to its own structure. As a comprehensive representation of the current dynamic characteristics, the above formula ① can be transformed into formula ②:
[0071] ②
[0072] In the formula, , This represents the output layer parameters of the GRU neural network.
[0073] use The samples are input into the forward prediction model for effluent water quality for supervised training. The training loss function during the training process... as follows:
[0074]
[0075] In the formula, This represents the batch processing quantity, which is a constant. In this embodiment, , In this embodiment, the smoothing constraint weight coefficients are represented. , and They represent the sampling times respectively. Sampling time Predicted water quality at the outlet. Indicates the sampling time Obtain m water quality index data at the outlet and construct an outlet water quality index data vector.
[0076] During training, the learning rate used for training the forward prediction model of water quality at the outlet is... Of course, the learning rate can be adjusted according to the actual situation.
[0077] Step 3: Based on the obtained With preset The difference is used to calculate the adjustment amount of the dosage. Compared to the current sampling time The next sampling time Dosage The dosage of the previous dose In addition to adjusting the dosage , This indicates the preset target water quality index data at the outlet.
[0078] Understandably, similarly, . This indicates the first of the target effluent water quality index data. Water quality indicators.
[0079] With preset Difference for: This indicates the trend and degree to which the actual effluent water quality data deviates from the preset target effluent water quality data, while keeping the current dosage unchanged.
[0080] Considering the varying degrees of importance of different effluent water quality indicators in the water treatment process, the above differences are... After weighting, a comprehensive prediction bias index is obtained. :
[0081]
[0082] In the formula, , This represents the weighting coefficients corresponding to each effluent indicator, used to reflect the degree of influence of different water quality indicators on discharge compliance or treatment effectiveness. Indicates the first The weighting coefficients corresponding to the effluent indicators. When When, it indicates that the predicted water quality is showing a deteriorating trend. When the predicted effluent quality meets or exceeds the target requirements, it indicates that the effluent quality is expected to be satisfactory. Since general effluent monitoring does not monitor useless indicators, the weighting coefficients for each effluent indicator are all set to 1.
[0083] In the prediction deviation index Based on this, a calculation model for dosage adjustment was constructed to simulate the behavior of manually adjusting the dosage of chemicals according to changes in water quality. The dosage adjustment calculation model is used to calculate the dosage adjustment amount. Defined as:
[0084]
[0085] The dosage adjustment amount The calculation is performed using the following nonlinear function, and the formula is shown below:
[0086]
[0087] In the formula, This represents the deviation sensitivity coefficient, used to adjust the degree of deviation amplification. It is a constant. In this embodiment, . This represents the adjustment coefficient for drug dosage, which is also a constant. , These represent the preset upper limit (maximum) and lower limit (minimum) of the drug dosage, respectively, which are preset values.
[0088] It is understandable that the definition of this nonlinear function does not come from a fixed empirical model, but is a mathematical abstraction of human adjustment behavior. Its parameters can be calibrated according to different water treatment conditions, so as to adaptively adjust the dosage range under different operating conditions.
[0089] Introduce constraints to the dosage adjustment process. And construct an optimization problem as shown in formula ③:
[0090] ③
[0091] In the formula, The sensitivity coefficient matrix representing the effect of chemical dosage on effluent parameters can be determined based on historical datasets. This represents the smoothing weighting coefficient for manual dosing. The first term on the right-hand side of the formula measures the deviation between the predicted effluent quality and the target effluent quality, while the second term is a penalty term for manual dosing adjustment, used to suppress large adjustments in dosing dosage due to manual experience.
[0092] The constraints also include the following formula ④:
[0093] ④
[0094] In the formula, This indicates the maximum dosage adjustment for a single dose. This indicates the minimum dosage adjustment for a single medication.
[0095] This will satisfy both formulas ③ and ④. As the dosage adjustment amount If the solution satisfies formula ③, then it is a solution to formula ③, meaning the final dosage is based on satisfying both formulas mentioned above. The calculation yields, that is, we have .
[0096] This invention addresses the challenge of predicting chemical dosage even when complete multi-source information at the inlet is lacking. Instead of directly using historical manual chemical dosage as a control basis, it first simulates the dynamic response relationship of the system through a forward prediction model and introduces a penalty term for excessive manual chemical dosing to recalculate and correct the dosage. Furthermore, to address the difficulty in modeling the mechanism of water treatment processes, this invention proposes a method for constructing a forward prediction model for effluent water quality based on the fusion of trends of key influencing factors.
[0097] The embodiments disclosed in this specification are merely illustrative of one aspect of the invention, and the scope of protection of the invention is not limited to these embodiments. Any other functionally equivalent embodiments fall within the scope of protection of the invention. Those skilled in the art can make various other corresponding changes and modifications based on the technical solutions and concepts described above, and all such changes and modifications should fall within the scope of protection of the claims of this invention.
Claims
1. A method for predicting the dosage of chemicals used in tailings dam water treatment based on inverse modeling of historical output, characterized in that, Includes the following steps: Obtain historical datasets, which include effluent water quality index data and actual chemical dosage. The effluent water quality index data includes multiple water quality indicators, at least one of which is wastewater flow rate. A forward prediction model for effluent water quality based on a GRU neural network was constructed. This model uses historical datasets as input to obtain predicted effluent water quality values. A calculation function for adjusting the dosage is constructed based on the difference between the predicted water quality value at the outlet and the preset target water quality index data at the outlet. The dosage adjustment amount that meets specific conditions in the calculation function is taken as the final dosage adjustment amount, and the dosage at the next sampling time is determined to be the dosage of the previous dosage plus the final dosage adjustment amount. Historical water quality index data at the effluent end are obtained according to the sampling period, and corresponding water quality index data at the effluent end are obtained at each sampling time. At sampling time t, m items of water quality index data at the effluent end are obtained, which are then used to construct an effluent end water quality index data vector. , , This represents the first of several water quality indicators at sampling time t. Water quality indicators , Historical dataset at sampling time t for: , , This indicates the time when the dosage of the last medication changed. This indicates the time at which the dosage of the medicine changed. express The actual amount of pesticide added as recorded. by As input, sampling time Predicted water quality at the outlet The output of the gated recurrent unit (GRU) of the water quality forward prediction model at the outlet end is represented by the forward mapping relationship as shown in formula ①: ① in, , , , , This represents the wastewater flow rate at sampling time t in the water quality index data at the outlet. Indicates the sampling time in the water quality index data at the outlet. Wastewater flow rate below Convert formula ① to formula ②: ② In the formula, , This represents the output layer parameters of the GRU neural network. use The samples are input into the forward prediction model for effluent water quality for supervised training. The training loss function during the training process... as follows: In the formula, This represents the batch processing quantity, which is a constant. This represents the smoothing constraint weight coefficient. and They represent the sampling times respectively. Sampling time Predicted water quality at the outlet. Indicates the sampling time Obtain m water quality index data at the effluent end and construct a water quality index data vector at the effluent end. The difference between the predicted water quality value at the outlet and the preset target water quality index data at the outlet is... With preset The difference , This indicates the preset target water quality index data at the outlet. For the value To perform weighted processing, a comprehensive prediction bias index is obtained. : In the formula, This represents the weighting coefficients corresponding to each effluent indicator. , This refers to the total number of multiple water quality indicators. In the prediction deviation index Based on this, a calculation model for the dosage adjustment is constructed, and the dosage adjustment amount in the dosage adjustment calculation model is... Defined as: The dosage adjustment amount The calculation is performed using the following nonlinear function, which serves as the calculation function. The calculation formula is shown below: In the formula, Represents the bias sensitivity coefficient. This indicates the adjustment coefficient for drug dosage. , These represent the upper and lower limits of the preset dosage of the drug, respectively. The specific conditions are those that satisfy formulas ③ and ④: ③ ④ In the formula, Constraints are introduced for the process of adjusting the dosage. This represents the sensitivity coefficient matrix of the dosage to effluent parameters. This represents the smoothing weighting coefficient for manual drug administration. This indicates the maximum dosage adjustment for a single dose. This indicates the minimum dosage adjustment for a single medication.
2. The tailings dam water treatment chemical dosage prediction method based on historical output reverse modeling according to claim 1, characterized in that, The water quality indicators at the outlet also include pH value, CODcr, ammonia nitrogen content, total arsenic content, total cadmium content, total lead content, and total zinc content.
3. The tailings dam water treatment chemical dosage prediction method based on historical output reverse modeling according to claim 1, characterized in that, After obtaining the historical dataset, and before inputting the historical dataset into the forward prediction model of the effluent water quality, the process also includes preprocessing and normalization of each data item in the historical dataset. The preprocessing includes removing outlier data and supplementing missing data.
4. The method for predicting the dosage of chemicals for tailings dam water treatment based on historical output reverse modeling according to claim 1, characterized in that, , , 。