Method, device and equipment for dosing control in water treatment process and medium

By calculating the mixed water inlet flow during the water treatment process and using the LSTM network to generate a drug dosing prediction model, the problem of poor drug dosing control in the existing technology is solved, more accurate drug dosing control is achieved, and the water treatment effect is improved .

CN118993268AActive Publication Date: 2024-11-22HNAC TECH

Patent Information

Application Number
CN202411199226.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-29
Publication Date
2024-11-22
Estimated Expiration
2044-08-29

AI Technical Summary

Technical Problem

The existing intelligent dosing system has poor drug dosing control effect during water treatment and lacks combination with the actual process, resulting in inaccurate prediction of dosing during water treatment.

Method used

By obtaining the current time of water inlet flow, reflux flow, flocculation influencing factors and polymer aluminum chloride PAC dosage, the mixed water inlet flow is calculated, and the target dosage prediction model is generated using LSTM long and short-term memory network training, combined with the optimal weight Dosing control is carried out, time scale misalignment of input variables and output variables is considered, and multi-dimensional multiplexing is performed to improve prediction accuracy.

Benefits of technology

It significantly improves the accuracy and effectiveness of dosing control in the water treatment process, ensures refined control of dosing, reduces energy consumption, and improves the water quality treatment effect.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118993268A_ABST
    Figure CN118993268A_ABST
Patent Text Reader

Abstract

The invention discloses a method, a device, equipment and a medium for dosing control in a water treatment process, and the method comprises the following steps: acquiring water inlet flow, reflux flow, flocculation influence factors, pre-filtration turbidity and PAC dosing amount at the current moment; summing the water inlet flow and the backflow flow to obtain the mixed water inlet flow at the current moment; the mixed water inlet flow, the flocculation influence factors, the pre-filtration turbidity and the PAC dosage are input into a target dosing prediction model, a target dosing prediction value is output, and the target dosing prediction model is generated through fitting according to the mixed water inlet flow, the initial dosing prediction value and the optimal weight; the initial dosing prediction value is obtained based on an initial dosing prediction model, and the optimal weight is calculated based on a fitting function corresponding to the mixed water inlet flow. The core parameter of the mixed water inlet flow is introduced, the target dosing prediction model is obtained through multi-dimensional multiplexing of the mixed water inlet flow, the target dosing prediction value can be accurately obtained, and the dosing control effect in the water treatment process is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of water treatment technology, and in particular to a method, device, equipment and medium for controlling dosing in a water treatment process. Background Art

[0002] The flocculation and sedimentation process with added chemicals is the core treatment unit of the water treatment process in the water plant. Flocculation and sedimentation refers to the water treatment process in which the flocculant causes the suspended particles in the water to condense and precipitate. After the coagulant is added to the water, the colloids and dispersed particles of the suspended matter collide with each other and condense to form flocs due to the effect of molecular attraction. During the sedimentation process, the size and mass continue to increase, and the sedimentation rate gradually accelerates. The purpose of removing impurities from the effluent is achieved through the sedimentation of particles. Among them, the refined control of flocculant addition is the key to water quality and energy consumption.

[0003] The currently used intelligent dosing systems mostly use data-driven methods such as artificial neural networks to directly or indirectly predict the dosage of water treatment processes in water plants. However, the data-driven process lacks integration with the actual process, resulting in poor dosing control effects in the water treatment process. Summary of the invention

[0004] The present application provides a method, device, equipment and medium for controlling dosing in a water treatment process, which can more accurately obtain the dosing amount to improve the effect of dosing control in the water treatment process.

[0005] In a first aspect, the present application provides a method for controlling dosing in a water treatment process, comprising:

[0006] Obtain the current influent flow, reflux flow, flocculation influencing factors, turbidity before filtration and PAC dosage;

[0007] Sum the water inlet flow and the return flow to obtain a mixed water inlet flow at the current moment;

[0008] The mixed water inflow flow, the flocculation influencing factors, the turbidity before filtration and the PAC dosage are input into the target dosage prediction model, and the target dosage prediction value is output; the target dosage prediction model is generated by fitting the mixed water inflow flow, the initial dosage prediction value and the optimal weight; the initial dosage prediction value is obtained based on the initial dosage prediction model, and the initial dosage prediction model is generated by training the LSTM long short-term memory network based on the mixed water inflow flow, the flocculation influencing factors, the turbidity before filtration and the PAC dosage, and the optimal weight is calculated based on the fitting function corresponding to the mixed water inflow flow;

[0009] The dosing of the water treatment process at the current moment is controlled according to the target dosing prediction value.

[0010] Optionally, the method further comprises:

[0011] An initial data sequence of the water treatment process is obtained based on the same time interval collection; the initial data sequence includes water inflow, return flow, flocculation influencing factors, PAC dosage and pre-filtration turbidity at multiple moments;

[0012] Sum the inflow flow and the return flow at each moment to obtain the mixed inflow flow at each moment;

[0013] Aligning the mixed water inflow rate, flocculation influencing factors, PAC dosage at the initial moment among the multiple moments with the turbidity before filtration at the target moment according to a discrete integral function to obtain an intermediate data sequence; the intermediate data sequence includes the mixed water inflow rate, flocculation influencing factors, PAC dosage and turbidity before filtration at the aligned multiple moments;

[0014] Performing data filtering and interpolation processing on the intermediate data sequence to obtain a target data sequence;

[0015] Based on the target data sequence and the training initial medication dosing prediction value corresponding to the target data sequence, the LSTM network is trained to obtain the initial medication dosing prediction model;

[0016] A fitting function is obtained according to the numerical relationship between a preset flow interval and the mixed water inlet flow rate; the preset flow interval is set based on the design treatment scale and the comprehensive variation coefficient;

[0017] Inputting the mixed water inlet flow into the fitting function and outputting the optimal weight;

[0018] Inputting the mixed water inflow, the flocculation influencing factors, the pre-filtration turbidity and the PAC dosage into the initial dosing prediction model to obtain the initial dosing prediction value;

[0019] A target dosing prediction model is generated according to the product of the mixed water inlet flow rate, the initial dosing prediction value and the optimal weight; the target dosing prediction model is used to output the target dosing prediction value.

[0020] Optionally, the training of the LSTM network based on the target data sequence and the training initial medication prediction value corresponding to the target data sequence to obtain the initial medication prediction model includes:

[0021] Establishing an initial input sample set and an initial output sample set according to the training initial dosing prediction value corresponding to the target data sequence;

[0022] Normalizing the initial input sample set and the initial output sample set respectively to obtain a target input sample set and a target output sample set; the target input sample set includes target input parameter vectors at multiple moments, and the target output sample set includes target output parameter vectors at multiple moments;

[0023] Based on a preset number of iterations, calling the target input sample set and the target output sample set to train the LSTM network to obtain a training output result;

[0024] The training output result is denormalized to obtain the initial medication prediction model.

[0025] Optionally, the LSTM network includes a plurality of LSTM cells, each of the plurality of LSTM cells includes a forget gate, an input gate, an output gate, a cell state, and a hidden state; calling the target input sample set and the target output sample set to train the LSTM network to obtain a training output result includes:

[0026] Traversing the target input parameter vectors at the multiple moments as the target input parameter vector at the current moment;

[0027] Inputting the target input parameter vector at the current moment and the hidden state at the previous moment into a forget gate to obtain a forget gate output at the current moment; the forget gate output is used to represent the cell state at the current moment obtained after selectively forgetting the cell state at the previous moment;

[0028] Inputting the target input parameter vector at the current moment and the hidden state at the previous moment into an input gate to obtain an input gate output at the current moment; the input gate output is used to represent information in the target input parameter vector at the current moment to be added to the cell state at the current moment;

[0029] Inputting the target input parameter vector at the current moment, the hidden state at the previous moment, and the input gate output at the current moment into the output gate to obtain the output gate output at the current moment; the output gate output is used to represent the information in the cell state at the current moment to be added to the hidden state at the current moment;

[0030] The output gate output at the current moment is used as the predicted output parameter vector at the current moment; the output gate output is used to compare with the target output parameter vector to calculate the loss function so as to update the LSTM network;

[0031] Input the output of the output gate at the current moment into the forget gate at the next moment, and perform the step of traversing the target input parameter vectors at the multiple moments as the target input parameter vector at the current moment, until the target input parameter vector at the last moment among the multiple moments is obtained;

[0032] The updated LSTM network is obtained as the training output result.

[0033] Optionally, obtaining a fitting function according to a numerical relationship between a preset flow interval and the mixed water inlet flow rate includes:

[0034] If the mixed water inflow rate is less than the designed treatment scale, a polynomial fitting function is obtained;

[0035] If the mixed water inflow rate is not less than the designed treatment scale, and the mixed water inflow rate is not greater than the product of the designed treatment scale and the comprehensive variation coefficient, a linear fitting function is obtained;

[0036] If the mixed water inflow rate is greater than the product of the designed treatment scale and the comprehensive variation coefficient, a Gaussian fitting function is obtained;

[0037] Wherein, the comprehensive variation coefficient is greater than 1.

[0038] Optionally, aligning the mixed water inflow rate, flocculation influencing factors, PAC dosing value at the initial moment among the multiple moments with the pre-filtration turbidity at the target moment according to the discrete integral function to obtain an intermediate data sequence includes:

[0039] Calculate the lag time corresponding to the mixed water inlet flow rate at the initial moment according to the discrete integral function;

[0040] Sum the initial moment and the lag time corresponding to the initial moment to obtain the target moment;

[0041] The mixed water inflow rate, flocculation influencing factors, and PAC dosing value at the initial moment are aligned with the pre-filtration turbidity at the target moment to obtain the intermediate data sequence.

[0042] Optionally, performing data filtering and interpolation processing on the intermediate data sequence to obtain a target data sequence includes:

[0043] The aligned multiple moments in the intermediate data sequence are used as multiple data points; each of the multiple data points includes the mixed water flow rate, the flocculation influencing factor, the PAC dosage and the turbidity before filtration;

[0044] Calculating the median of the intermediate data sequence;

[0045] Performing outlier detection and corresponding outlier replacement on each of the plurality of data points according to the median and a preset threshold, wherein the preset threshold is set based on the median absolute deviation; the median absolute deviation is calculated based on the median, and the median absolute deviation is used to measure the degree of dispersion of the data points;

[0046] After completing outlier detection on a plurality of the data points and corresponding outlier replacement, the target data sequence is obtained.

[0047] In a second aspect, the present application also provides a device for controlling dosing in a water treatment process, characterized in that it comprises:

[0048] An acquisition unit is used to obtain the current inflow flow, reflux flow, flocculation influencing factors, turbidity before filtration and polyaluminium chloride PAC dosage;

[0049] A summing unit, used for summing the water inlet flow and the return flow to obtain a mixed water inlet flow at a current moment;

[0050] A prediction unit, used for inputting the mixed water inflow flow, the flocculation influencing factors, the turbidity before filtration and the PAC dosage into a target dosing prediction model, and outputting a target dosing prediction value; the target dosing prediction model is generated by fitting the mixed water inflow flow, the initial dosing prediction value and the optimal weight; the initial dosing prediction value is obtained based on the initial dosing prediction model, and the initial dosing prediction model is generated by training the LSTM long short-term memory network based on the mixed water inflow flow, the flocculation influencing factors, the turbidity before filtration and the PAC dosage, and the optimal weight is calculated based on the fitting function corresponding to the mixed water inflow flow;

[0051] A control unit is used to control the dosing of the water treatment process at the current moment according to the target dosing prediction value.

[0052] Optionally, the device further includes a model training unit, wherein the model training unit includes:

[0053] The sample collection subunit is used to collect and obtain the initial data sequence of the water treatment process based on the same time interval; the initial data sequence includes the inflow flow, the return flow, the flocculation influencing factors, the PAC dosage and the turbidity before filtration at multiple moments;

[0054] A summing subunit is used to sum the inflow flow and the return flow at each moment to obtain the mixed inflow flow at each moment;

[0055] A data alignment subunit is used to align the mixed water inflow rate, flocculation influencing factors, PAC dosage at the initial moment among the multiple moments with the turbidity before filtration at the target moment according to a discrete integral function to obtain an intermediate data sequence; the intermediate data sequence includes the mixed water inflow rate, flocculation influencing factors, PAC dosage and turbidity before filtration at the aligned multiple moments;

[0056] A data filtering processing subunit, used for performing data filtering and interpolation processing on the intermediate data sequence to obtain a target data sequence;

[0057] A training subunit, configured to train the LSTM network based on the target data sequence and the training initial medication prediction value corresponding to the target data sequence to obtain the initial medication prediction model;

[0058] A fitting function obtaining subunit is used to obtain a fitting function according to a numerical relationship between a preset flow interval and the mixed water inlet flow rate; the preset flow interval is set based on a design treatment scale and a comprehensive variation coefficient;

[0059] A weight output subunit, used for inputting the mixed water inlet flow into the fitting function and outputting an optimal weight;

[0060] An input subunit, used for inputting the mixed water flow rate, the flocculation influencing factor, the pre-filtration turbidity and the PAC dosage into the initial dosing prediction model to obtain the initial dosing prediction value;

[0061] A generating subunit is used to generate a target dosing prediction model according to the product of the mixed water inlet flow, the initial dosing prediction value and the optimal weight; the target dosing prediction model is used to output the target dosing prediction value.

[0062] Optionally, the training subunit includes:

[0063] A sample establishment module, used to establish an initial input sample set and an initial output sample set according to the target data sequence and the training initial dosing prediction value corresponding to the target data sequence;

[0064] A normalization processing module, used to perform normalization processing on the initial input sample set and the initial output sample set respectively to obtain a target input sample set and a target output sample set; the target input sample set includes target input parameter vectors at multiple moments, and the target output sample set includes target output parameter vectors at multiple moments;

[0065] A training module, used to call the target input sample set and the target output sample set to train the LSTM network based on a preset number of iterations to obtain a training output result;

[0066] The denormalization module is used to denormalize the training output results to obtain the initial drug addition prediction model.

[0067] Optionally, the LSTM network includes a plurality of LSTM cells, each of the plurality of LSTM cells includes a forget gate, an input gate, an output gate, a cell state and a hidden state; the training module is specifically used for:

[0068] Traversing the target input parameter vectors at the multiple moments as the target input parameter vector at the current moment;

[0069] Inputting the target input parameter vector at the current moment and the hidden state at the previous moment into a forget gate to obtain a forget gate output at the current moment; the forget gate output is used to represent the cell state at the current moment obtained after selectively forgetting the cell state at the previous moment;

[0070] Inputting the target input parameter vector at the current moment and the hidden state at the previous moment into an input gate to obtain an input gate output at the current moment; the input gate output is used to represent information in the target input parameter vector at the current moment to be added to the cell state at the current moment;

[0071] Inputting the target input parameter vector at the current moment, the hidden state at the previous moment, and the input gate output at the current moment into the output gate to obtain the output gate output at the current moment; the output gate output is used to represent the information in the cell state at the current moment to be added to the hidden state at the current moment;

[0072] The output gate output at the current moment is used as the predicted output parameter vector at the current moment; the output gate output is used to compare with the target output parameter vector to calculate the loss function so as to update the LSTM network;

[0073] Input the output of the output gate at the current moment into the forget gate at the next moment, and perform the step of traversing the target input parameter vectors at the multiple moments as the target input parameter vector at the current moment, until the target input parameter vector at the last moment among the multiple moments is obtained;

[0074] The updated LSTM network is obtained as the training output result.

[0075] Optionally, the fitting function obtains a subunit, specifically for:

[0076] If the mixed water inflow rate is less than the designed treatment scale, a polynomial fitting function is obtained;

[0077] If the mixed water inflow rate is not less than the designed treatment scale, and the mixed water inflow rate is not greater than the product of the designed treatment scale and the comprehensive variation coefficient, a linear fitting function is obtained;

[0078] If the mixed water inflow rate is greater than the product of the designed treatment scale and the comprehensive variation coefficient, a Gaussian fitting function is obtained;

[0079] Wherein, the comprehensive variation coefficient is greater than 1.

[0080] Optionally, the data alignment subunit is specifically used to:

[0081] Calculate the lag time corresponding to the mixed water inlet flow rate at the initial moment according to the discrete integral function;

[0082] Sum the initial moment and the lag time corresponding to the initial moment to obtain the target moment;

[0083] The mixed water inflow rate, flocculation influencing factors, and PAC dosing value at the initial moment are aligned with the pre-filtration turbidity at the target moment to obtain the intermediate data sequence.

[0084] Optionally, the data filtering processing subunit is specifically used to:

[0085] The aligned multiple moments in the intermediate data sequence are used as multiple data points; each of the multiple data points includes the mixed water flow rate, the flocculation influencing factor, the PAC dosage and the turbidity before filtration;

[0086] Calculating the median of the intermediate data sequence;

[0087] Performing outlier detection and corresponding outlier replacement on each of the plurality of data points according to the median and a preset threshold, wherein the preset threshold is set based on the median absolute deviation; the median absolute deviation is calculated based on the median, and the median absolute deviation is used to measure the degree of dispersion of the data points;

[0088] After completing outlier detection on a plurality of the data points and corresponding outlier replacement, the target data sequence is obtained.

[0089] In a third aspect, the present application further provides an electronic device, the electronic device comprising a processor and a memory:

[0090] The memory is used to store computer programs;

[0091] The processor is used to execute the method provided in the first aspect according to the computer program.

[0092] In a fourth aspect, the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium is used to store a computer program, and the computer program is used to execute the method provided in the first aspect above.

[0093] It can be seen that this application has the following beneficial effects:

[0094] The present application provides a method, device, equipment and medium for controlling dosing in a water treatment process. In the method, the influent flow rate, reflux flow rate, flocculation influencing factors, turbidity before filtration and polyaluminium chloride (PAC) dosing amount at the current moment are obtained; the influent flow rate and the reflux flow rate are summed to obtain the mixed influent flow rate at the current moment; the mixed influent flow rate, flocculation influencing factors, turbidity before filtration and PAC dosing amount are input into a target dosing prediction model, and a target dosing prediction value is output. The target dosing prediction value is used to indicate dosing control of the water treatment process at the current moment. The target dosing prediction model is generated by fitting the mixed influent flow rate, the initial dosing prediction value and the optimal weight; the initial dosing prediction value is obtained based on the initial dosing prediction model, and the initial dosing prediction model is generated by training an LSTM long short-term memory network based on the mixed influent flow rate, the flocculation influencing factors, the turbidity before filtration and the PAC dosing amount, and the optimal weight is calculated based on the fitting function corresponding to the mixed influent flow rate. In this way, the core parameter of mixed water inlet flow rate is introduced, which not only takes into account the traditional water inlet flow rate, but also the influence of the return flow rate on dosing control, and calculates the optimal weight according to the fitting function corresponding to the mixed water inlet flow rate. At the same time, the mixed water inlet flow rate is input into the initial dosing prediction model to obtain the initial dosing prediction value, and finally the target dosing prediction model is obtained. That is, the target dosing prediction model is obtained through the multi-dimensional reuse of the core parameter of the mixed water inlet flow rate, which can more accurately obtain the target dosing prediction value, thereby improving the dosing control effect of the water treatment process. BRIEF DESCRIPTION OF THE DRAWINGS

[0095] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present application. For ordinary technicians in this field, other drawings can also be obtained based on these drawings.

[0096] Figure 1 This is a flow chart of a method for controlling dosing in a water treatment process according to an embodiment of the present application;

[0097] Figure 2 This is a schematic diagram of an algorithm flow for controlling dosing in a water treatment process according to an embodiment of the present application;

[0098] Figure 3 This is a diagram showing the effect of data filtering processing in an embodiment of the present application;

[0099] Figure 4 This is a schematic diagram of an LSTM long short-term memory network structure in an embodiment of the present application;

[0100] Figure 5a This is a fitting function curve effect diagram corresponding to a mixed water inlet flow rate in an embodiment of the present application;

[0101] Figure 5b This is another fitting function curve effect diagram corresponding to the mixed water inlet flow rate in the embodiment of the present application;

[0102] Figure 6 This is a schematic diagram of the prediction effect of a target dosing prediction model in an embodiment of the present application;

[0103] Figure 7 A schematic diagram of the structure of a device 700 for controlling dosing in a water treatment process provided in an embodiment of the present application;

[0104] Figure 8 A schematic diagram of the structure of an electronic device 800 provided in an embodiment of the present application. DETAILED DESCRIPTION

[0105] The multiple involved in the embodiments of the present application means greater than or equal to two. It should be noted that in the description of the embodiments of the present application, the words "first", "second", etc. are only used for the purpose of distinguishing the description, and cannot be understood as indicating or implying relative importance, nor can they be understood as indicating or implying an order.

[0106] In order to make the above-mentioned purposes, features and advantages of the present application more obvious and easy to understand, the embodiments of the present application are further described in detail below in conjunction with the accompanying drawings and specific implementation methods. It is understood that the specific embodiments described herein are only used to explain the present application and are not intended to limit the present application. In addition, it should be noted that, for ease of description, only the parts related to the present application are shown in the accompanying drawings, not all structures.

[0107] First, a brief description of the water treatment process:

[0108] Water treatment is the process of treating natural water sources that do not meet the requirements of human life and production into water quality that meets the requirements of human life and production.

[0109] The main process units of the water plant are: water intake pump room-grid-flocculation sedimentation tank-V-type filter tank-intermediate lifting pump room-ozone activated carbon tank-clear water tank-water delivery pump room. Among them, flocculation is the process of adding electrolytes to the raw water to make the colloids and suspended matter that are not easy to precipitate in the water aggregate into floccules that are easy to precipitate. Sedimentation is the process of separating suspended particles from water under the action of gravity. Filtration refers to the process of separating solid matter from water when the filtered water passes through the filter medium. After the mud and water are separated, the supernatant of the flocculation sedimentation tank discharge and the V-type filter backwash discharge is returned to the front end of the grid to participate in water production.

[0110] Usually, polyaluminium chloride (PAC) is added as a flocculant before the flocculation sedimentation tank to carry out physical and chemical processes such as double-layer compression, adsorption and electrical neutralization on the colloidal particles and fine suspended matter in the raw water, so that the colloidal particles and fine suspended particles in the water can aggregate with each other and separate mud and water in the subsequent sedimentation area.

[0111] Among them, the instruments installed at the front end of the flocculation sedimentation tank mainly include inlet flow, return flow, inlet turbidity, pH, and temperature; the instruments installed at the end of the flocculation sedimentation tank mainly include pre-filtration turbidity.

[0112] The parameter variables of the dosing process are collected by sensors to the edge programmable logic controller (PLC) module for preliminary processing and transmitted to the intelligent dosing controller module. The parameters such as inlet flow, reflux flow, inlet turbidity, and pool pH value are started for data cleaning and other processes, and then transmitted to the data modeling module. The dosing neural network prediction model is obtained through training to obtain the dosing prediction value.

[0113] However, the applicant has found that in the prior art, parameters such as influent flow rate, influent turbidity, water temperature, pH value, etc. are usually simply used as single input variables of weights for model training, which does not take into account the actual operation process of the water treatment process, resulting in poor model training results. In addition, in the existing water treatment process, the dosing action interval is often relatively long due to the slowness of the flocculation and sedimentation process itself, resulting in a large lag. However, the prior art does not consider the misalignment of the input variable and the output variable on the time scale, which leads to the phenomenon of mismatched mapping relationships, and ultimately makes it difficult for the model training accuracy to meet the standards. The present application redesigns the core parameter of the mixed influent flow rate through expert knowledge and reuses it in multiple dimensions, thereby significantly improving the accuracy of the prediction model. At the same time, the present application solves the problem of mapping misalignment and improves the model training accuracy by adding a lag calculation link.

[0114] Based on this, the present application provides a method, device, equipment and medium for dosing control in a water treatment process. In the method, the influent flow, reflux flow, flocculation influencing factors, turbidity before filtration and polyaluminium chloride (PAC) dosing amount at the current moment are obtained; the influent flow and the reflux flow are summed to obtain the mixed influent flow at the current moment; the mixed influent flow, flocculation influencing factors, turbidity before filtration and polyaluminium chloride (PAC) dosing amount are input into a target dosing prediction model, and a target dosing prediction value is output. The target dosing prediction value is used to indicate the dosing control of the water treatment process at the current moment. The target dosing prediction model is generated by fitting the mixed influent flow, the initial dosing prediction value and the optimal weight; the initial dosing prediction value is obtained based on the initial dosing prediction model, and the initial dosing prediction model is generated by training a long short-term memory (LSTM) network based on the mixed influent flow, flocculation influencing factors, turbidity before filtration and PAC dosing amount, and the optimal weight is calculated based on the fitting function corresponding to the mixed influent flow.

[0115] In this way, the core parameter of mixed water inlet flow is introduced, and the actual operation process of the water treatment process is considered, that is, not only the traditional water inlet flow is considered, but also the influence of the return flow on the dosing control is considered; and the optimal weight is calculated according to the fitting function corresponding to the mixed water inlet flow, and the mixed water inlet flow is input into the initial dosing prediction model to obtain the initial dosing prediction value, wherein the initial dosing prediction model is obtained by training based on the aligned input variables and output variables, and finally the target dosing prediction model is obtained. That is, the embodiment of the present application considers the misalignment of the input variables and the output variables on the time scale, so that the initial dosing prediction model generated by fitting has a good effect, so that the target dosing prediction model obtained by multi-dimensional multiplexing fitting of the core parameter of the mixed water inlet flow can more accurately obtain the target dosing prediction value, thereby improving the dosing control effect of the water treatment process.

[0116] To facilitate understanding of the specific implementation of the method for controlling dosing in a water treatment process provided in an embodiment of the present application, an explanation will be given below with reference to the accompanying drawings.

[0117] It should be noted that the subject implementing the method for controlling dosing in a water treatment process may be the device for controlling dosing in a water treatment process provided in the embodiment of the present application, and the device for controlling dosing in a water treatment process may be carried in an electronic device or a functional module of an electronic device. The electronic device in the embodiment of the present application may be any device capable of implementing the method for controlling dosing in a water treatment process in the embodiment of the present application, for example, an Internet of Things (IoT) device.

[0118] See also Figure 1, is a flow chart of a method for controlling dosing in a water treatment process according to an embodiment of the present application. The method can be applied to a method for controlling dosing in a water treatment process, and the device for controlling dosing in a water treatment process can be as follows: Figure 7 The device 700 for controlling dosing in a water treatment process is shown, or the device for controlling dosing in a water treatment process can also be integrated in Figure 8 Functional modules in the electronic device 800 are shown.

[0119] like Figure 1 As shown, the embodiments of the present application may include, for example:

[0120] S1: Obtain the current influent flow, reflux flow, flocculation influencing factors, turbidity before filtration and polyaluminium chloride (PAC) dosage.

[0121] It should be noted that the current moment can be regarded as the moment when the dosing control of the water treatment process is required. The inlet flow rate, return flow rate, flocculation influencing factors, pre-filtration turbidity and PAC dosage are obtained based on sensor acquisition and edge module calculation and processing. The inlet flow rate can be represented by Q, Q r Indicates the return flow rate, N tu_out Indicates the turbidity before filtration, and L indicates the dosage of PAC. The flocculation influencing factors characterize the parameter variables that affect the flocculation effect. The flocculation influencing factors may include the influent turbidity, the influent pH value, and the influent temperature. Among them, N tu_in Indicates the turbidity of the influent water, T p Indicates the inlet water temperature.

[0122] In a possible implementation, the flocculation influencing factors may also include at least one or more of chemical oxygen demand (COD), ammonia nitrogen, total nitrogen, total phosphorus, conductivity and chlorophyll a. The flocculation influencing factors may be selected according to the actual situation of the water plant instruments, and the embodiments of the present application are not limited to this.

[0123] S2: Sum the inlet flow rate and the return flow rate to obtain the mixed inlet flow rate at the current moment.

[0124] It should be noted that in the embodiment of the present application, in addition to the traditional water inlet flow rate Q, the return flow rate Q is also considered. r The effect of PAC dosage L is to use the synthesized Q′ as the input of the subsequent target dosage prediction model. Specifically, the formula Q′=Q+Q r .

[0125] S3: Input the mixed water flow rate, flocculation influencing factors, pre-filtration turbidity and PAC dosage into the target dosing prediction model, and output the target dosing prediction value.

[0126] Among them, the target dosing prediction model is generated based on the mixed water inlet flow rate, the initial dosing prediction value and the optimal weight fitting; the initial dosing prediction value is obtained based on the initial dosing prediction model, and the initial dosing prediction model is generated by training the LSTM network based on the mixed water inlet flow rate, flocculation influencing factors, pre-filtration turbidity and PAC dosing amount, and the optimal weight is calculated based on the fitting function corresponding to the mixed water inlet flow rate.

[0127] It should be noted that in the embodiment of the present application, an initial dosing prediction model is established through an LSTM network. The LSTM network is a variant of a recurrent neural network (RNN) and is used to process sequence data. By using the gating mechanism of the LSTM network to solve the gradient vanishing and gradient exploding problems in traditional RNNs, it can better capture long-term dependencies and avoid the failure of the late prediction model due to excessive time.

[0128] In a possible implementation, the initial dosing prediction model can also be generated based on CNN-LSTM training, where CNN-LSTM is a hybrid model of a convolutional neural network (CNN) and a long short-term memory network (LSTM). It should be noted that the embodiment of the present application does not limit the type of neural network for generating the initial dosing prediction model, and any neural network that can be associated with and trained by a person skilled in the art should be regarded as part of the embodiment of the present application.

[0129] S4: Control the dosing of the water treatment process at the current moment according to the target dosing prediction value.

[0130] In this way, the target dosing prediction model in the embodiment of the present application is obtained based on the multi-dimensional multiplexed fitting of the mixed water inlet flow rate, so the target dosing prediction value can be obtained more accurately, thereby improving the dosing control effect of the water treatment process. Moreover, because the target dosing prediction model is generated based on the mixed water inlet flow rate, the initial dosing prediction value and the optimal weight, wherein the initial dosing prediction value is obtained from the initial dosing prediction model, and the initial dosing prediction model is obtained by training based on the aligned input variables and output variables, it is precisely because the misalignment of the input variables and the output variables on the time scale is taken into account that the accuracy of the output of the initial dosing prediction model can be improved, thereby further improving the accuracy of the target dosing prediction model.

[0131] In a possible implementation, the process of obtaining the target dosing prediction model can be found in Figure 2 The algorithm flow diagram of the water treatment process dosing control shown in the figure, the process of obtaining the target dosing prediction model may include the following steps:

[0132] S10: Acquire an initial data sequence of the water treatment process based on the same time interval.

[0133] It should be noted that the initial data sequence includes the influent flow rate, return flow rate, flocculation influencing factors, PAC dosage and turbidity before filtration at multiple times. The influent flow rate can be represented by Q, Q r Indicates the return flow rate, N tu_out Indicates the turbidity before filtration. In the present embodiment, the factors affecting flocculation include the turbidity of the influent water N tu_in , pH value of inlet water and inlet water temperature T p For example.

[0134] S20: Sum the inflow flow rate and the return flow rate at each moment to obtain the mixed inflow flow rate at each moment.

[0135] S30: Align the mixed water flow rate, flocculation influencing factors, PAC dosage at the initial moment among the multiple moments with the turbidity before filtration at the target moment according to the discrete integral function to obtain an intermediate data sequence.

[0136] It should be noted that the intermediate data sequence includes the mixed influent flow rate, flocculation influencing factors, PAC dosage and pre-filtration turbidity at multiple moments after alignment.

[0137] In a possible implementation, S30 may include S301, calculating the lag time corresponding to the mixed water inlet flow at the initial moment according to a discrete integral function; S302, summing the initial moment and the lag time corresponding to the initial moment to obtain the target moment; S303, aligning the mixed water inlet flow at the initial moment, the flocculation influencing factors, the PAC dosage and the pre-filtration turbidity at the target moment to obtain an intermediate data sequence.

[0138] As an example, the mixed influent flow rate Q′, influent turbidity N tu_in , pH value of inlet water, inlet water temperature T p , PAC dosage and turbidity before filtration N tu_out With the same sampling time interval n (min), based on the same time axis, at time t0, the discrete integral function is used to solve the lag time t minutes (min), and the timestamp of the real turbidity data corresponding to time t0 is calculated by t0+t to complete the directional addressing, so as to "align" the mixed water flow rate with the turbidity before filtration, eliminate the lag error between input and output, and further align the mixed water flow rate Q' and the inlet turbidity N at time t0. tu_in , pH value of inlet water, inlet water temperature T p , PAC dosage, and turbidity N before filtration at t0+t tu_outAlignment is performed to achieve data matching on the time axis, and the aligned target data sequence is used as the model input and output to participate in modeling. This is one of the reuses of the mixed water inlet flow rate Q′.

[0139] The discrete integral function is shown in formula (1):

[0140]

[0141] In the above formula (1), Q' represents the mixed water flow rate, and its unit is cubic meters per hour (m 3 / h), V represents the effective volume of the flocculation sedimentation tank, and its unit is cubic meter (m 3 ), n represents the sampling time interval, and its unit is minute (min).

[0142] That is, in the embodiment of the present application, the lag time t corresponding to the mixed water inlet flow Q' at the initial time t0 is obtained by utilizing the quantitative relationship between the sum of the mixed water inlet flow Q' from the initial time t0 to the lag time and the effective volume V of the flocculation sedimentation tank.

[0143] S40: Perform data filtering and interpolation processing on the intermediate data sequence to obtain the target data sequence.

[0144] It should be noted that data filtering is used to remove the interference noise contained in the data to achieve the purpose of smooth waveform. The data filtering process in the embodiment of the present application can be, for example, the Hampel filtering algorithm, which is a classic outlier value detection and replacement method, combined with the median and median absolute deviation (Mean Absolute Deviation, MAD), can effectively remove the influence of outliers, and has good robustness, and is independent of the distribution assumption of the data, and is widely applicable to data types. Of course, other data filtering methods can also be used, such as the 3 Sigma method to perform data filtering on the intermediate data sequence, and the embodiment of the present application does not limit the data filtering processing method, and any person skilled in the art can associate and implement the data filtering processing method and should be regarded as a part of the embodiment of the present application.

[0145] In a possible implementation, the effect of using the Hampel filter algorithm to process the intermediate data sequence can be seen in Figure 3 The effect diagram of data filtering processing is shown below. The data filtering and interpolation processing process of the intermediate data sequence is described in detail in combination with the specific implementation steps:

[0146] S40 may include the following steps:

[0147] S41, taking the aligned multiple moments in the intermediate data sequence as multiple data points.

[0148] Each of the multiple data points includes mixed water flow, flocculation influencing factors, PAC dosage and turbidity before filtration.

[0149] S42, calculate the median of the intermediate data sequence.

[0150] As an example, take x m Indicates the median. Specifically, sort the middle data sequence and take the value in the middle as x m , see formula (2).

[0151] If the number n of data in the intermediate data sequence is an odd number, the median is the middle value after sorting; if the number n of data in the intermediate data sequence is an even number, the median is the average of the two middle numbers after sorting.

[0152] [x1 x2…x m …x n-1 x n ]Formula (2)

[0153] S43, performing outlier detection and corresponding outlier replacement on each data point among the multiple data points according to the median and the preset threshold.

[0154] It should be noted that the preset threshold is set based on the median absolute deviation; the median absolute deviation is calculated based on the median, and the median absolute deviation is used to measure the degree of dispersion of data points.

[0155] Among them, x can be used mad represents the median absolute deviation, the median absolute deviation x mad It is an indicator to measure the degree of dispersion of data, which represents the median of the absolute value of the difference between the data and the median.

[0156] As an example, for each data point, calculate the absolute value of its difference from the median, and then take the median of the differences as x mad , see formula (3).

[0157]

[0158] Among them, set the corresponding preset threshold x lim Please refer to formula (4) for the process.

[0159] x lim =k×x mad Formula (4)

[0160] Specifically, for each data point, calculate whether it is within the corresponding preset threshold range, see formula (5).

[0161] |x n -xm |≤x lim Formula (5)

[0162] Specifically, when the data x n Not within the preset threshold range, i.e. |x n -x m |>x lim When x n =x m .

[0163] S44, after completing outlier detection on multiple data points and corresponding outlier replacement, a target data sequence is obtained.

[0164] In this way, by performing multi-level optimization on the input data, possible fault errors in the original data, that is, the intermediate data sequence, can be processed in advance, thereby ensuring the cleanliness and accuracy of the input variables for subsequent model training.

[0165] S50: Based on the target data sequence and the training initial medication prediction value corresponding to the target data sequence, the LSTM network is trained to obtain an initial medication prediction model.

[0166] In order to improve the model training effect, the embodiment of the present application adopts a supervised training method. During the model training process, an initial dosing prediction value corresponding to the target data sequence can be set. Then, in a possible implementation, S50 may include:

[0167] S51, establishing an initial input sample set and an initial output sample set according to the target data sequence and the training initial dosing prediction value corresponding to the target data sequence.

[0168] As an example, the initial input sample set includes multiple input layer parameter vectors, each input layer parameter vector X = [Q′, N tu_in ,PH,T p ,L,N tu_out ], the initial output sample set includes multiple output layer parameter vectors, each output layer parameter vector Y = [L pre ], where Q' is the mixed water flow rate, N tu_in is the turbidity of the influent, PH is the pH value of the pool, T p is the pool temperature, N tu_out is the turbidity before filtration, L is the PAC dosage value, N tu_out is the turbidity before filtration, at this time L pre It is the training initial dosing prediction value, which indicates the initial dosing prediction value set during the training process.

[0169] S52, normalizing the initial input sample set and the initial output sample set respectively to obtain a target input sample set and a target output sample set.

[0170] The target input sample set includes target input parameter vectors at multiple moments (also called multiple time steps), and the target output sample set includes target output parameter vectors at multiple moments.

[0171] As an example, the initial input sample set and the initial output sample set may be normalized using the following formula (6).

[0172]

[0173] Among them, x min is the minimum value among multiple parameter vectors (including input layer parameter vector and output layer parameter vector), x max is the maximum value among multiple parameter vectors, x0 is the current value of multiple parameter vectors, x max and x min is obtained based on the same data dimension, for example, for Q′, x min It is the minimum value among multiple Q′ in multiple parameter vectors.

[0174] S53, based on the preset number of iterations, calling the target input sample set and the target output sample set to train the LSTM network to obtain the training output result.

[0175] In a possible implementation, the number of iterations E is preset. p =300, sample batch size B ch =600, MAE is selected as the regression model indicator, Adam optimizer is used for parameter estimation, and a total of 4 layers of network are set when modeling the LSTM network. Figure 4 As shown in the LSTM network structure diagram, the first layer is the input layer InputLayer (for example, the dimension is set to 6). In the figure, taking InputLayer's (None, 1, 6) as an example, the first parameter represents the batch size, None indicates that this dimension is dynamic, that is, the batch size can only be determined at runtime; the second parameter represents the time step, and the third parameter describes the dimension of the input feature, which can be regarded as the input vector of each time step will contain 6 dimensional features; the second layer is the LSTM layer (for example, the dimension is set to 64), and the third layer is the LSTM layer (for example, the dimension is set to 32). The second and third layers are both LSTM layers, and the hidden layer dimensions are set to 64 and 32 respectively. The fourth layer is the output layer Dense (for example, the dimension is set to 1).

[0176] S54, denormalizing the training output results to obtain an initial dosing prediction model.

[0177] As an example, the training output result can be denormalized using the formula (7) shown below, so that the initial dosing prediction value output by the initial dosing prediction model can be within the range of the initial data.

[0178]

[0179] Among them, y min is the minimum value among multiple output layer parameter vectors, y max is the maximum value among multiple output layer parameter vectors, y is the training output result, and y0 is the training output result after denormalization.

[0180] In a possible implementation, the LSTM network includes an input layer, an LSTM layer and an output layer, the LSTM layer includes multiple LSTM cells, and each of the multiple LSTM cells includes a forget gate, an input gate, an output gate, a cell state and a hidden state; then in the embodiment of the present application, the target input sample set and the target output sample set are called to train the LSTM network to obtain the training output result, including:

[0181] S531, traverse the target input parameter vectors at multiple moments as the target input parameter vector at the current moment.

[0182] Among them, the target input parameter vector is processed by the input layer.

[0183] S532, inputting the target input parameter vector at the current moment and the hidden state at the previous moment into the forget gate to obtain the forget gate output at the current moment;

[0184] Among them, the forget gate is used to selectively update the cell state at the current moment, and the forget gate output is used to represent the cell state at the current moment obtained after selectively forgetting the cell state at the previous moment.

[0185] As an example, h is quantized by the Sigmoid function. t-1 (represents the hidden state of the previous moment) and x t (represents the input at the current moment) and outputs a number between 0 and 1, where 1 represents complete retention and 0 represents complete forgetfulness. f is the weight matrix, b f is the bias term, f t is the output of the forget gate. For details, please refer to formula (8).

[0186] f t =σ(W f ·[h t-1 ,x t ]+b f ) Formula (8)

[0187] S533, input the target input parameter vector at the current moment and the hidden state at the previous moment into the input gate to obtain the input gate output at the current moment.

[0188] The input gate is used to input and determine the stored information in the cell state, and the input gate output is used to represent the information in the target input parameter vector at the current moment to be added to the cell state at the current moment.

[0189] As an example, the input gate processing includes two steps: first, the Sigmoid layer determines the weight of the input in the update, that is, the information that needs to be updated, and the candidate vector is constructed and calculated through the tanh function For details, please refer to formula (9) and formula (10).

[0190] i t =σ(W i ·[h t-1 ,x t ]+b f ) Formula (9)

[0191]

[0192] Then, update the cell state C at the previous moment t-1 , C t-1 Add the cell state at the previous moment after the forget gate to form C t , multiply the cell state at the previous moment by f t , indicating the selective memory of the cell state at the previous moment, adding the obtained value Get the current cell state C t , please refer to formula (11) for details.

[0193]

[0194] Among them, C t is the cell state at the current moment, C t-1 is the cell state at the last moment, W i and W c is the weight matrix, b c is the bias term.

[0195] S534, input the target input parameter vector at the current moment, the hidden state at the previous moment, and the input gate output at the current moment into the output gate to obtain the output gate output at the current moment.

[0196] The output gate is used to output based on the cell state at the current moment, and the output gate output is used to represent the information in the cell state at the current moment to be added to the hidden state at the current moment.

[0197] As an example, the target input parameter vector at the current moment is input into the Sigmoid layer, and then the current cell state is normalized to between -1 and 1 through the tanh layer, and a basic product operation is performed on it and the output of the Sigmoid layer to determine the output data. For details, please refer to formula (12) and formula (13).

[0198] o t =σ(W o ·[h t-1 ,x t ]+b o ) Formula (12)

[0199] h t =o t ×tanh(C t ) Formula (13)

[0200] Among them, t is the output gate output, W o is the weight matrix, b o is the bias term, h t is the hidden state at the current moment.

[0201] In this way, the modular chain network composed of LSTM cells can continuously learn from the input and thus make predictions about the future.

[0202] S535, taking the output gate output at the current moment as the predicted output parameter vector at the current moment.

[0203] Among them, the output of the output gate is used to compare with the target output parameter vector to calculate the loss function in order to update the LSTM network. Specifically, the output of the output gate can be input to the output layer to obtain the predicted output parameter vector, and then the value of the loss function is calculated by the predicted output parameter vector and the target output parameter vector. The LSTM network is continuously updated through back propagation to complete the training of the LSTM network.

[0204] S536, the output gate at the current moment outputs the input to the forget gate at the next moment, and the target input parameter vectors of the traversal of the multiple moments are taken as the target input parameter vector at the current moment, until the target input parameter vector of the last moment among the multiple moments is obtained.

[0205] S537, obtaining an updated LSTM network as a training output result.

[0206] S60: Obtaining a fitting function according to a numerical relationship between a preset flow range and a mixed water inlet flow rate;

[0207] It should be noted that the preset flow range is set based on the design treatment scale and the comprehensive variation coefficient; among them, the design treatment scale refers to the treatment capacity determined by the water treatment facilities (such as sewage treatment plants, water supply plants, etc.) during the design phase, which is the basis for the design and construction of water treatment facilities, that is, the maximum amount of water or pollutants that can be treated under normal operating conditions, which can usually be determined based on the city’s population, water consumption, water quality standards and technical feasibility; the comprehensive variation coefficient is a comprehensive indicator that describes the changes in water quantity or water quality in time and space. The comprehensive variation coefficient is introduced to more accurately describe and handle the complex and changeable water quantity and water quality conditions in practice, so as to ensure that the water treatment facilities can operate stably and meet the treatment requirements. The comprehensive variation coefficient is usually set according to the outdoor water supply design specifications, generally greater than 1, such as 1.2, 1.0, 1.5, etc.

[0208] In a possible implementation, a fitting function that is more in line with the actual situation can be determined based on the flow interval corresponding to the mixed water inlet flow. Figure 5a and Figure 5b If the fitting function curve effect diagram corresponding to the mixed water inlet flow rate is shown, S60 may include:

[0209] S61, if the mixed water inflow rate is less than the designed treatment scale, a polynomial fitting function is obtained;

[0210] S62, if the mixed water inflow rate is not less than the design treatment scale, and the mixed water inflow rate is not greater than the product of the design treatment scale and the comprehensive variation coefficient, a linear fitting function is obtained;

[0211] S63, if the mixed water inflow rate is greater than the product of the design treatment scale and the comprehensive variation coefficient, a Gaussian fitting function is obtained.

[0212] Among them, the comprehensive variation coefficient is greater than 1, and the design treatment scale and the product of the design treatment scale and the comprehensive variation coefficient are the upper and lower limits of the optimal flow range, respectively. Figure 2 In the figure, F1(x), F2(x), and F3(x) are used to represent the polynomial fitting function, the linear fitting function, and the Gaussian fitting function, respectively.

[0213] It should be noted that K d Indicates the comprehensive coefficient of variation, Q d represents the design processing scale, the optimal flow range [Q d ,Q d ×K d ]; when Q′ and Q d When Q′ is close to the optimal flow rate range [Q d ,Q d ×K d], the polynomial fitting is more in line with the actual performance characteristics. When Q′ is greater than the optimal flow interval [Q d ,Q d ×K d ], Gaussian fitting is used. When Q′ is in the optimal flow range, it generally presents a linear correlation. That is, if Q′<Q d , then the polynomial fitting function is obtained. The fitting effect can be found in Figure 5a If Q d ≤Q′≤Q d ×K d , then the linear fitting function is obtained. If Q′>Q d ×K d , then the Gaussian fitting function is obtained. The fitting effect can be found in Figure 5b , where the fitting function corresponding to the mixed water inlet flow rate can be obtained according to the following formula (14):

[0214]

[0215] In the polynomial fitting function, a1 is x 3 The coefficient of a2 is x 2 The coefficient of a, a3 is the coefficient of x, a4 is the constant term, a1, a2, a3 and a4 can be any real number; in the Gaussian fitting function, a1 and a2 represent the peak value, indicating the peak position of the Gaussian curve, and is the center position of the Gaussian curve, a1, a2, b1, b2, c1 and c2 are all constants; in the linear fitting function, k is the slope, indicating the inclination of the linear function graph, p is the intercept, and k and p are constants.

[0216] S70: Input the mixed water inlet flow into the fitting function and output the optimal weight.

[0217] It should be noted that the mixed water flow is input into the corresponding fitting function, and the corresponding optimal weight is output, where W can be used opt represents the optimal weight.

[0218] S80: Input the mixed water flow rate, flocculation influencing factors, pre-filtration turbidity and PAC dosage into the initial dosing prediction model to obtain the initial dosing prediction value.

[0219] As an example, we can use L pre It represents the initial dosing prediction value output by the initial dosing prediction model.

[0220] S90: Generate a target dosing prediction model according to the product of the mixed water inlet flow rate, the initial dosing prediction value and the optimal weight; the target dosing prediction model is used to output the target dosing prediction value.

[0221] As an example, PAC opt represents the target dosing prediction model, then PAC opt =W opt ×Q′×L pre Obtain a target dosing prediction model.

[0222] Thus, in the embodiment of the present application, the water inlet flow rate and the water outlet flow rate are combined into a mixed water inlet flow rate and cleaned together with other parameters. This is the first application. The data after data alignment is input into the modeling process. After the initial dosing prediction model is obtained through training, the mixed water inlet flow rate is input into the initial dosing prediction model to calculate the output prediction value L pre At this time, the mixed flow Q′ is calculated by the curve fitting formula to obtain the optimal weight W opt , for the second application, W opt , L pre And the mixed water flow rate is obtained after data fusion to obtain the target dosing model PAC opt This is the third application. In summary, it is the triple application process of expert rules in water treatment dosing control.

[0223] Please note that, see Figure 6 As shown in the schematic diagram of the prediction effect of the target dosing prediction model, it can be seen that the predicted value is relatively close to the actual original data, that is, the target dosing prediction value generated by the target dosing prediction model provided by the embodiment of the present application can improve the effect of dosing control in the water treatment process.

[0224] See also Figure 7 The embodiment of the present application also provides a device 700 for controlling dosing in a water treatment process, which is characterized by comprising:

[0225] The acquisition unit 701 is used to obtain the influent flow rate, the reflux flow rate, the flocculation influencing factors, the turbidity before filtration and the dosage of polyaluminium chloride PAC at the current moment;

[0226] A summing unit 702, used for summing the inflow flow and the return flow to obtain a mixed inflow flow at a current moment;

[0227] The prediction unit 703 is used to input the mixed water inflow flow, the flocculation influencing factors, the turbidity before filtration and the PAC dosage into a target dosing prediction model, and output a target dosing prediction value; the target dosing prediction model is generated by fitting the mixed water inflow flow, the initial dosing prediction value and the optimal weight; the initial dosing prediction value is obtained based on the initial dosing prediction model, and the initial dosing prediction model is generated by training the LSTM long short-term memory network based on the mixed water inflow flow, the flocculation influencing factors, the turbidity before filtration and the PAC dosage, and the optimal weight is calculated based on the fitting function corresponding to the mixed water inflow flow;

[0228] The control unit 704 is used to control the dosing of the water treatment process at the current moment according to the target dosing prediction value.

[0229] Optionally, the device 700 further includes a model training unit 705, wherein the model training unit 705 includes:

[0230] The sample collection subunit is used to collect and obtain the initial data sequence of the water treatment process based on the same time interval; the initial data sequence includes the inflow flow, the return flow, the flocculation influencing factors, the PAC dosage and the turbidity before filtration at multiple moments;

[0231] A summing subunit is used to sum the inflow flow and the return flow at each moment to obtain the mixed inflow flow at each moment;

[0232] A data alignment subunit is used to align the mixed water inflow rate, flocculation influencing factors, PAC dosage at the initial moment among the multiple moments with the turbidity before filtration at the target moment according to a discrete integral function to obtain an intermediate data sequence; the intermediate data sequence includes the mixed water inflow rate, flocculation influencing factors, PAC dosage and turbidity before filtration at the aligned multiple moments;

[0233] A data filtering processing subunit, used for performing data filtering and interpolation processing on the intermediate data sequence to obtain a target data sequence;

[0234] A training subunit, configured to train the LSTM network based on the target data sequence and the training initial medication prediction value corresponding to the target data sequence to obtain the initial medication prediction model;

[0235] A fitting function obtaining subunit is used to obtain a fitting function according to a numerical relationship between a preset flow interval and the mixed water inlet flow rate; the preset flow interval is set based on a design treatment scale and a comprehensive variation coefficient;

[0236] A weight output subunit, used for inputting the mixed water inlet flow into the fitting function and outputting an optimal weight;

[0237] An input subunit, used for inputting the mixed water flow rate, the flocculation influencing factor, the pre-filtration turbidity and the PAC dosage into the initial dosing prediction model to obtain the initial dosing prediction value;

[0238] A generating subunit is used to generate a target dosing prediction model according to the product of the mixed water inlet flow, the initial dosing prediction value and the optimal weight; the target dosing prediction model is used to output the target dosing prediction value.

[0239] Optionally, the training subunit includes:

[0240] A sample establishment module, used to establish an initial input sample set and an initial output sample set according to the target data sequence and the training initial dosing prediction value corresponding to the target data sequence;

[0241] A normalization processing module, used to perform normalization processing on the initial input sample set and the initial output sample set respectively to obtain a target input sample set and a target output sample set; the target input sample set includes target input parameter vectors at multiple moments, and the target output sample set includes target output parameter vectors at multiple moments;

[0242] A training module, used to call the target input sample set and the target output sample set to train the LSTM network based on a preset number of iterations to obtain a training output result;

[0243] The denormalization module is used to denormalize the training output results to obtain the initial drug addition prediction model.

[0244] Optionally, the LSTM includes a plurality of LSTM cells, each of the plurality of LSTM cells includes a forget gate, an input gate, an output gate, a cell state and a hidden state; the training module is specifically used for:

[0245] Traversing the target input parameter vectors at the multiple moments as the target input parameter vector at the current moment;

[0246] Inputting the target input parameter vector at the current moment and the hidden state at the previous moment into a forget gate to obtain a forget gate output at the current moment; the forget gate output is used to represent the cell state at the current moment obtained after selectively forgetting the cell state at the previous moment;

[0247] Inputting the target input parameter vector at the current moment and the hidden state at the previous moment into an input gate to obtain an input gate output at the current moment; the input gate output is used to represent information in the target input parameter vector at the current moment to be added to the cell state at the current moment;

[0248] Inputting the target input parameter vector at the current moment, the hidden state at the previous moment, and the input gate output at the current moment into the output gate to obtain the output gate output at the current moment; the output gate output is used to represent the information in the cell state at the current moment to be added to the hidden state at the current moment;

[0249] The output gate output at the current moment is used as the predicted output parameter vector at the current moment; the output gate output is used to compare with the target output parameter vector to calculate the loss function so as to update the LSTM;

[0250] Input the output of the output gate at the current moment into the forget gate at the next moment, and perform the step of traversing the target input parameter vectors at the multiple moments as the target input parameter vector at the current moment, until the target input parameter vector at the last moment among the multiple moments is obtained;

[0251] The updated LSTM is obtained as the training output result.

[0252] Optionally, the fitting function obtains a subunit, specifically for:

[0253] If the mixed water inflow rate is less than the designed treatment scale, a polynomial fitting function is obtained;

[0254] If the mixed water inflow rate is not less than the designed treatment scale, and the mixed water inflow rate is not greater than the product of the designed treatment scale and the comprehensive variation coefficient, a linear fitting function is obtained;

[0255] If the mixed water inflow rate is greater than the product of the designed treatment scale and the comprehensive variation coefficient, a Gaussian fitting function is obtained;

[0256] Wherein, the comprehensive variation coefficient is greater than 1.

[0257] Optionally, the data alignment subunit is specifically used to:

[0258] Calculate the lag time corresponding to the mixed water inlet flow rate at the initial moment according to the discrete integral function;

[0259] Sum the initial moment and the lag time corresponding to the initial moment to obtain the target moment;

[0260] The mixed water inflow rate, flocculation influencing factors, and PAC dosing value at the initial moment are aligned with the pre-filtration turbidity at the target moment to obtain the intermediate data sequence.

[0261] Optionally, the data filtering processing subunit is specifically used to:

[0262] The aligned multiple moments in the intermediate data sequence are used as multiple data points; each of the multiple data points includes the mixed water flow rate, the flocculation influencing factor, the PAC dosage and the turbidity before filtration;

[0263] Calculating the median of the intermediate data sequence;

[0264] Performing outlier detection and corresponding outlier replacement on each of the plurality of data points according to the median and a preset threshold, wherein the preset threshold is set based on the median absolute deviation; the median absolute deviation is calculated based on the median, and the median absolute deviation is used to measure the degree of dispersion of the data points;

[0265] After completing outlier detection on a plurality of the data points and corresponding outlier replacement, the target data sequence is obtained.

[0266] It should be noted that the specific implementation method of the device 700 and the technical effects achieved can be found in Figure 2 The relevant description in the method shown.

[0267] In addition, the present application embodiment also provides an electronic device 800, such as Figure 8 As shown, the electronic device 800 includes a processor 801 and a memory 802:

[0268] The memory 802 is used to store computer programs;

[0269] The processor 801 is used to execute according to the computer program Figure 2 The method provided.

[0270] In addition, an embodiment of the present application further provides a computer-readable storage medium, which is used to store a computer program, and the computer program is used to execute the method for controlling dosing in a water treatment process provided in an embodiment of the present application.

[0271] Through the description of the above implementation methods, it can be known that those skilled in the art can clearly understand that all or part of the steps in the above-mentioned embodiment method can be implemented by means of software plus a general hardware platform. Based on such an understanding, the technical solution of the present application can be embodied in the form of a software product, which can be stored in a storage medium, such as a read-only memory (ROM) / RAM, a magnetic disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network communication device such as a router) to execute the methods described in each embodiment of the present application or some parts of the embodiments.

[0272] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment. The device embodiment described above is only schematic, in which the modules described as separate components may or may not be physically separated, and the components displayed as modules may or may not be physical modules, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules can be selected according to actual needs to achieve the goals of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative work.

[0273] The above is only a preferred embodiment of the present application and is not intended to limit the protection scope of the present application. It should be noted that, for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the present application, and these improvements and modifications should also be regarded as the protection scope of the present application.

Claims

1. A method for controlling dosing in a water treatment process, characterized in that: include: Obtain the current influent flow, reflux flow, flocculation influencing factors, turbidity before filtration and PAC dosage; Sum the water inlet flow and the return flow to obtain a mixed water inlet flow at the current moment; The mixed water inflow flow rate, the flocculation influencing factors, the turbidity before filtration and the PAC dosage are input into the target dosage prediction model, and the target dosage prediction value is output; the target dosage prediction model is generated by fitting the mixed water inflow flow rate, the initial dosage prediction value and the optimal weight; the initial dosage prediction value is obtained based on the initial dosage prediction model, and the initial dosage prediction model is generated by training the LSTM long short-term memory network based on the mixed water inflow flow rate, the flocculation influencing factors, the turbidity before filtration and the PAC dosage, and the optimal weight is calculated based on the fitting function corresponding to the mixed water inflow flow rate; The dosing of the water treatment process at the current moment is controlled according to the target dosing prediction value.

2. The method according to claim 1, characterized in that The method further comprises: An initial data sequence of the water treatment process is obtained based on the same time interval collection; the initial data sequence includes water inflow, return flow, flocculation influencing factors, PAC dosage and pre-filtration turbidity at multiple moments; Sum the inflow flow and the return flow at each moment to obtain the mixed inflow flow at each moment; Aligning the mixed water inflow rate, flocculation influencing factors, PAC dosage at the initial moment among the multiple moments with the turbidity before filtration at the target moment according to a discrete integral function to obtain an intermediate data sequence; the intermediate data sequence includes the mixed water inflow rate, flocculation influencing factors, PAC dosage and turbidity before filtration at the aligned multiple moments; Performing data filtering and interpolation processing on the intermediate data sequence to obtain a target data sequence; Based on the target data sequence and the training initial medication dosing prediction value corresponding to the target data sequence, the LSTM network is trained to obtain the initial medication dosing prediction model; A fitting function is obtained according to the numerical relationship between a preset flow interval and the mixed water inlet flow rate; the preset flow interval is set based on the design treatment scale and the comprehensive variation coefficient; Inputting the mixed water inlet flow into the fitting function and outputting the optimal weight; Inputting the mixed water inflow, the flocculation influencing factors, the pre-filtration turbidity and the PAC dosage into the initial dosing prediction model to obtain the initial dosing prediction value; A target dosing prediction model is generated according to the product of the mixed water inlet flow rate, the initial dosing prediction value and the optimal weight; the target dosing prediction model is used to output the target dosing prediction value.

3. The method according to claim 2, characterized in that The step of training the LSTM network based on the target data sequence to obtain the initial medication prediction model includes: Establishing an initial input sample set and an initial output sample set according to the target data sequence and the training initial dosing prediction value corresponding to the target data sequence; Normalizing the initial input sample set and the initial output sample set respectively to obtain a target input sample set and a target output sample set; the target input sample set includes target input parameter vectors at multiple moments, and the target output sample set includes target output parameter vectors at multiple moments; Based on a preset number of iterations, calling the target input sample set and the target output sample set to train the LSTM network to obtain a training output result; The training output result is denormalized to obtain the initial medication prediction model.

4. The method according to claim 3, characterized in that The LSTM network includes a plurality of LSTM cells, each of which includes a forget gate, an input gate, an output gate, a cell state, and a hidden state; calling the target input sample set and the target output sample set to train the LSTM network to obtain a training output result, including: Traversing the target input parameter vectors at the multiple moments as the target input parameter vector at the current moment; Inputting the target input parameter vector at the current moment and the hidden state at the previous moment into a forget gate to obtain a forget gate output at the current moment; the forget gate output is used to represent the cell state at the current moment obtained after selectively forgetting the cell state at the previous moment; Inputting the target input parameter vector at the current moment and the hidden state at the previous moment into an input gate to obtain an input gate output at the current moment; the input gate output is used to represent information in the target input parameter vector at the current moment to be added to the cell state at the current moment; Inputting the target input parameter vector at the current moment, the hidden state at the previous moment, and the input gate output at the current moment into the output gate to obtain the output gate output at the current moment; the output gate output is used to represent the information in the cell state at the current moment to be added to the hidden state at the current moment; The output gate output at the current moment is used as the predicted output parameter vector at the current moment; the output gate output is used to compare with the target output parameter vector to calculate the loss function so as to update the LSTM network; Input the output of the output gate at the current moment into the forget gate at the next moment, and perform the step of traversing the target input parameter vectors at the multiple moments as the target input parameter vector at the current moment, until the target input parameter vector at the last moment among the multiple moments is obtained; The updated LSTM network is obtained as the training output result.

5. The method according to claim 2, characterized in that: The step of obtaining a fitting function according to the numerical relationship between the preset flow interval and the mixed water inlet flow rate includes: If the mixed water inflow rate is less than the designed treatment scale, a polynomial fitting function is obtained; If the mixed water inflow rate is not less than the designed treatment scale, and the mixed water inflow rate is not greater than the product of the designed treatment scale and the comprehensive variation coefficient, a linear fitting function is obtained; If the mixed water inflow rate is greater than the product of the designed treatment scale and the comprehensive variation coefficient, a Gaussian fitting function is obtained; Wherein, the comprehensive variation coefficient is greater than 1.

6. The method according to claim 2, characterized in that The method of aligning the mixed water inflow rate, flocculation influencing factors, and PAC dosing value at the initial moment among the multiple moments with the turbidity before filtration at the target moment according to the discrete integral function to obtain an intermediate data sequence includes: Calculate the lag time corresponding to the mixed water inlet flow rate at the initial moment according to the discrete integral function; Sum the initial moment and the lag time corresponding to the initial moment to obtain the target moment; The mixed water inflow rate, flocculation influencing factors, and PAC dosing value at the initial moment are aligned with the pre-filtration turbidity at the target moment to obtain the intermediate data sequence.

7. The method according to claim 2, characterized in that The performing data filtering and interpolation processing on the intermediate data sequence to obtain the target data sequence includes: The aligned multiple moments in the intermediate data sequence are used as multiple data points; each of the multiple data points includes the mixed water flow rate, the flocculation influencing factor, the PAC dosage and the turbidity before filtration; Calculating the median of the intermediate data sequence; Performing outlier detection and corresponding outlier replacement on each of the plurality of data points according to the median and a preset threshold, wherein the preset threshold is set based on the median absolute deviation; the median absolute deviation is calculated based on the median, and the median absolute deviation is used to measure the degree of dispersion of the data points; After completing outlier detection on a plurality of the data points and corresponding outlier replacement, the target data sequence is obtained.

8. A device for controlling dosing in a water treatment process, characterized in that: include: An acquisition unit is used to obtain the current inflow flow, reflux flow, flocculation influencing factors, turbidity before filtration and polyaluminium chloride PAC dosage; A summing unit, used for summing the water inlet flow and the return flow to obtain a mixed water inlet flow at a current moment; A prediction unit, inputting the mixed water inflow flow, the flocculation influencing factors, the turbidity before filtration and the PAC dosage into a target dosing prediction model, and outputting a target dosing prediction value; the target dosing prediction model is generated by fitting the mixed water inflow flow, the initial dosing prediction value and the optimal weight; the initial dosing prediction value is obtained based on the initial dosing prediction model, and the initial dosing prediction model is generated by training the LSTM long short-term memory network based on the mixed water inflow flow, the flocculation influencing factors, the turbidity before filtration and the PAC dosage, and the optimal weight is calculated based on the fitting function corresponding to the mixed water inflow flow; A control unit is used to control the dosing of the water treatment process at the current moment according to the target dosing prediction value.

9. An electronic device, characterized in that: The electronic device comprises a processor and a memory: The memory is used to store computer programs; The processor is configured to execute the method according to any one of claims 1 to 7 according to the computer program.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium is used to store a computer program, and the computer program is used to execute the method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Water purification flocculation precipitation dosing control technology

    CN110054274A

  • Seawater coagulation dosing method based on model prediction

    CN111783289A

  • Sewage treatment dosage prediction method and system based on LSTM-Attention

    CN117235595A

  • Flocculant dosage determination method based on double-branch frequency enhanced Legendre memory model

    CN118155741A

  • Water purification plant coagulant intelligent dosing method based on machine learning

    CN118335216A

Cited By

  • Intelligent monitoring system for sewage treatment in coal chemical industry

    CN120117678A

  • Chemical adding control method, device, product and equipment in water treatment process

    CN120398235A

  • Intelligent water plant PAC adding control method, system, equipment and medium

    CN120469380A

  • Micro-nano air flotation phosphorus removal real-time control method, device and equipment based on neural network model and medium

    CN121704203A