Drug dosage prediction method, device and equipment for sewage treatment, storage medium and program product

By constructing a multi-objective function and using a dynamic multi-objective particle swarm optimization algorithm to optimize the drug dosage prediction model, the problem of lack of scientific basis for drug dosage in wastewater treatment is solved, the accuracy and stability of drug dosage are improved, and the availability of water quality and sludge is ensured.

CN121787671AInactive Publication Date: 2026-04-03广州崇实自动控制科技有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-01-13
Publication Date
2026-04-03
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

The dosage of chemicals in existing wastewater treatment processes lacks scientific basis, resulting in significant differences in the quality of the treated water and the properties of the sludge.

Method used

A multi-objective function is constructed, and the model parameters of the drug dosage prediction model are optimized by dynamic multi-objective particle swarm optimization algorithm. Long short-term memory network is used to predict drug dosage.

Benefits of technology

This improved the accuracy and stability of drug dosage prediction, ensured the availability of water and sludge, and achieved relative stability of water quality.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121787671A_ABST
    Figure CN121787671A_ABST
Patent Text Reader

Abstract

The invention discloses a drug dosage prediction method, device and equipment for sewage treatment, a storage medium and a program product, and relates to the technical field of sewage treatment.The drug dosage prediction method for sewage treatment comprises the steps that model parameters of a drug dosage prediction model serve as optimization targets, and a multi-objective function is constructed; performing model parameter optimization iteration based on the multi-objective function through a dynamic multi-objective particle swarm algorithm to obtain target model parameters; constructing a drug dosage prediction model based on the target model parameters; and predicting the drug dosage for sewage treatment based on the drug dosage prediction model. Due to the fact that the model parameters of the drug dosage prediction model are optimized, the stability and accuracy of model prediction are improved; the optimized drug dosage prediction model is used for predicting the drug dosage for sewage treatment, so that the treatment result is relatively stable, and the availability of water and sludge is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of wastewater treatment technology, and in particular to methods, apparatus, equipment, storage media and program products for predicting the dosage of chemicals used in wastewater treatment. Background Technology

[0002] Industrialization and urbanization have exacerbated global water pollution problems. With increasing awareness of environmental protection and public health safety, wastewater treatment has become a pressing issue.

[0003] Wastewater treatment typically involves the use of chemicals to remove particulate matter from the water, regulate water quality parameters, and assist in biodegradation, thereby ensuring effluent safety and improving sludge properties. Currently, chemical dosing in wastewater treatment is often based on experience, resulting in significant variations in the treated water quality and sludge properties. Summary of the Invention

[0004] The main objective of this application is to provide a method, apparatus, equipment, storage medium, and program product for predicting the dosage of chemicals used in wastewater treatment, aiming to solve the technical problem that existing wastewater treatment chemical dosing is based on experience and results in significant differences in the quality of the treated water and the properties of the sludge.

[0005] To achieve the above objectives, this application proposes a method for predicting the dosage of chemicals used in wastewater treatment, the method comprising: The model parameters of the drug dosage prediction model are used as optimization objectives to construct a multi-objective function; Based on the aforementioned multi-objective function, the model parameters are optimized iteratively using a dynamic multi-objective particle swarm optimization algorithm to obtain the target model parameters; A drug dosage prediction model is constructed based on the target model parameters; The drug dosage prediction model is used to predict the drug dosage for wastewater treatment.

[0006] In one embodiment, the step of obtaining the target model parameters by iteratively optimizing the model parameters based on the multi-objective function and using a dynamic multi-objective particle swarm optimization algorithm includes: A random particle swarm is generated, and the velocity and position of the particles in the swarm are initialized. The current fitness value of a particle in the particle swarm is determined based on the multi-objective function, and the fitness value is used to characterize the quality of the particle. Based on the current fitness value, the particles in the particle swarm are dynamically allocated to the dynamic optimization space; The particles are screened based on the spatial parameters of the dynamic optimization space to obtain an optimized solution set; The optimal positions of individuals and the global optimal positions in the particle swarm are updated based on the optimized solution set. Returning to the step of determining the current fitness value of particles in the particle swarm based on the multi-objective function, the velocity and position of the particles are iteratively updated to obtain the target model parameters.

[0007] In one embodiment, the step of dynamically allocating particles in the particle swarm based on the current fitness value to obtain a dynamic optimization space includes: The vector angle between the particle and the reference direction vector is determined based on the current fitness value; The reference direction vector corresponding to the smallest vector angle is taken as the target reference direction vector of the particle. The particles are assigned to the dynamic optimization space corresponding to the target reference direction vector.

[0008] In one embodiment, the spatial parameters include the number of current optimized solutions and the number of effective spaces; the step of filtering the particle swarm based on the spatial parameters of the dynamic optimization space to obtain an optimized solution set includes: The limit value of the optimization solution in the dynamic optimization space is determined based on the effective space quantity and the preset number of optimization solutions in the dynamic optimization space. An optimal solution selection strategy is determined based on the optimal solution limit and the current number of optimal solutions. Based on the aforementioned optimal solution screening strategy, optimal solutions in each of the dynamic optimization spaces are screened to obtain an optimal solution set.

[0009] In one embodiment, the step of updating the individual optimal positions and the global optimal positions in the particle swarm based on the optimized solution set includes: The current fitness value of a particle in the optimized solution set is compared with the fitness value corresponding to the individual optimal position of the particle. If the current fitness value is not lower than the fitness value corresponding to the individual's optimal position, then the current position of the particle is taken as the individual's optimal position. The maximum current fitness value of the optimal particle in the optimized solution set is compared with the fitness value corresponding to the global optimal position of the particle swarm; the optimal particle is the particle with the largest fitness value in the particle swarm. If the maximum current fitness value is not lower than the fitness value corresponding to the global optimal position, then the current position corresponding to the optimal particle is taken as the global optimal position of the particle swarm.

[0010] In one embodiment, the drug dosage prediction model includes a first drug dosage prediction model and a second drug dosage prediction model, and the step of constructing the drug dosage prediction model based on the target model parameters includes: The target model parameters are used as model parameters for the long short-term memory network model to construct a first drug dosage prediction model. The preset training data is input into the first drug dosage prediction model for training to obtain the second drug dosage prediction model.

[0011] Furthermore, to achieve the above objectives, this application also proposes a wastewater treatment drug dosage prediction device, which includes: The preprocessing module is used to construct a multi-objective function by taking the model parameters of the drug dosage prediction model as the optimization objective; The iterative optimization module is used to perform iterative optimization of model parameters based on the multi-objective function and through a dynamic multi-objective particle swarm optimization algorithm to obtain the target model parameters. The model building module is used to build a drug dosage prediction model based on the target model parameters; The data prediction module is used to predict the dosage of drugs for wastewater treatment based on the drug dosage prediction model.

[0012] In addition, to achieve the above objectives, this application also proposes a wastewater treatment drug dosage prediction device, the device comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, the computer program being configured to implement the steps of the wastewater treatment drug dosage prediction method as described above.

[0013] In addition, to achieve the above objectives, this application also proposes a storage medium, which is a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, it implements the steps of the wastewater treatment drug dosage prediction method described above.

[0014] In addition, to achieve the above objectives, this application also provides a computer program product, which includes a computer program that, when executed by a processor, implements the steps of the wastewater treatment drug dosage prediction method described above.

[0015] One or more technical solutions proposed in this application have at least the following technical effects: This application constructs a multi-objective function by using the model parameters of a drug dosage prediction model as the optimization objective; based on the multi-objective function, iterative optimization of the model parameters is performed using a dynamic multi-objective particle swarm optimization algorithm to obtain the target model parameters; a drug dosage prediction model is constructed based on the target model parameters; and the drug dosage prediction model is used to predict the drug dosage for wastewater treatment. Because the model parameters of the drug dosage prediction model are optimized, the stability and accuracy of the model prediction are improved; the optimized drug dosage prediction model is used to predict the drug dosage for wastewater treatment, resulting in relatively stable treatment results and improved usability of water and sludge. Attached Figure Description

[0016] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.

[0017] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0018] Figure 1 A flowchart illustrating the method for predicting the dosage of chemicals for wastewater treatment as described in Embodiment 1 of this application; Figure 2 Example diagram of a scenario provided in Embodiment 1 of the wastewater treatment drug dosage prediction method of this application; Figure 3 This is a flowchart illustrating Example 2 of the wastewater treatment drug dosage prediction method of this application. Figure 4 This is a flowchart illustrating Example 3 of the wastewater treatment drug dosage prediction method of this application. Figure 5 This is a schematic diagram of the module structure of the wastewater treatment drug dosage prediction device according to an embodiment of this application; Figure 6 This is a schematic diagram of the equipment structure of the hardware operating environment involved in the wastewater treatment drug dosage prediction method in the embodiments of this application.

[0019] The purpose, features, and advantages of this application will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation

[0020] It should be understood that the specific embodiments described herein are merely illustrative of the technical solutions of this application and are not intended to limit this application.

[0021] To better understand the technical solution of this application, a detailed description will be provided below in conjunction with the accompanying drawings and specific implementation methods.

[0022] The main solution of this application embodiment is as follows: using the model parameters of the drug dosage prediction model as the optimization objective to construct a multi-objective function; based on the multi-objective function, iteratively optimizing the model parameters through a dynamic multi-objective particle swarm optimization algorithm to obtain the target model parameters; constructing a drug dosage prediction model based on the target model parameters; and predicting the drug dosage for wastewater treatment based on the drug dosage prediction model.

[0023] It should be noted that the executing entity in this embodiment can be a computing service device with data processing, network communication, and program execution functions, such as a computer or server, or an electronic device or virtual device capable of performing the above functions. The following description uses a wastewater treatment drug dosage prediction device (hereinafter referred to as the prediction device) as an example to illustrate this embodiment and the subsequent embodiments.

[0024] Based on this, embodiments of this application provide a method for predicting the dosage of chemicals used in wastewater treatment, referring to... Figure 1 and Figure 2 , Figure 1 This is a schematic flowchart of the wastewater treatment drug dosage prediction method provided in Embodiment 1 of this application. Figure 2 This is a scenario example diagram provided for Embodiment 1 of the wastewater treatment drug dosage prediction method of this application.

[0025] In this embodiment, the method for predicting the dosage of chemicals for wastewater treatment includes steps S10 to S40: Step S10: Use the model parameters of the drug dosage prediction model as the optimization objective to construct a multi-objective function; Step S20: Based on the multi-objective function, the model parameters are optimized iteratively using the dynamic multi-objective particle swarm optimization algorithm to obtain the target model parameters.

[0026] In this embodiment, the drug dosage prediction model can be a network model built based on a Long Short-Term Memory (LSTM) network. This model can predict the drug dosage for wastewater treatment. The drug dosage prediction model can include several LSTM neurons, which can form several layers. Within the same layer, LSTM neurons can interact laterally. Each LSTM, when processing the input at the current time step, can receive hidden states and cell states from LSTM neurons at the previous time step. The hidden state is equivalent to the short-term memory of the layer at the previous time step, and the positive state is equivalent to the important information accumulated by the layer from the beginning of the sequence. In different layers at the same time step, LSTM neurons in the previous layer can output hidden states to LSTM neurons in the next layer, enabling the network to learn higher-level patterns. At the end of the last layer, the output hidden state of the last time step can be extracted. This hidden state condenses the global spatiotemporal feature information of the entire input data. By inputting this global spatiotemporal feature information into a fully connected layer (not shown in the figure), it can be mapped to the final predicted drug dosage value.

[0027] It should be noted that, due to the difficulty in selecting hyperparameters in Long Short-Term Memory (LSTM) networks, this application embodiment uses a dynamic multi-objective particle swarm optimization algorithm, which improves the multi-objective particle swarm optimization algorithm, to optimize the model parameters in LSM networks. This avoids the difficulty in selecting hyperparameters in LSM networks and improves the accuracy of prediction.

[0028] In some embodiments of this application, the model parameters used as optimization targets may include: learning rate, number of neurons in the hidden layer, weights, number of layers in the long short-term memory network, and other model parameters that directly affect the final prediction effect. These are not specifically limited in this application. Optimizing model parameters using a dynamic multi-objective particle swarm optimization algorithm can effectively prevent the model from getting stuck in local optima and enhance the network's update and learning capabilities.

[0029] It is understandable that in multi-objective task optimization, the objective function can be used as the fitness evaluation method for each task objective. By comprehensively evaluating multiple task objectives through multiple objective functions (i.e., multi-objective functions), multiple conflicting optimization objectives can be comprehensively considered, thereby finding a relatively balanced solution, i.e., the Pareto optimal solution set. Then, the target model parameters of the drug dosage prediction model can be determined from the Pareto optimal solution set.

[0030] In some embodiments of this application, the algorithm for optimizing and iterating the model parameters can also be a multi-objective particle swarm optimization algorithm, an ant colony optimization algorithm, etc., and this application does not limit this.

[0031] In its specific implementation, the prediction device of this application embodiment can construct a multi-objective function using model parameters as optimization targets, and perform fitness evaluation based on the multi-objective function to iterate the position and velocity of particles in the particle swarm, thereby obtaining a Pareto optimal solution set. By selecting the target model parameters from the Pareto optimal solution set as the model parameters of the drug dosage prediction model, the problem of inaccurate model prediction due to difficulties in selecting hyperparameters is avoided.

[0032] Step S30: Construct a drug dosage prediction model based on the target model parameters; Step S40: Predict the dosage of drugs for wastewater treatment based on the drug dosage prediction model.

[0033] It should be noted that the drug dosage prediction model can be trained and constructed by using the target model parameters as the initial model parameters and wastewater treatment data such as water parameters, drug dosage, and treatment results. The trained drug dosage prediction model can predict appropriate drug dosages based on input water parameters. Even with complex water parameters, the drug dosage prediction model of this application can maintain relatively stable effluent quality.

[0034] This application's embodiments construct a multi-objective function by using the model parameters of a drug dosage prediction model as the optimization objective; based on the multi-objective function, iterative optimization of the model parameters is performed using a dynamic multi-objective particle swarm optimization algorithm to obtain target model parameters; a drug dosage prediction model is constructed based on the target model parameters; and the drug dosage prediction model is used to predict the drug dosage for wastewater treatment. Compared to traditional experience-based drug dosage control, this application improves the accuracy of drug dosage prediction in wastewater treatment by constructing a drug dosage prediction model; by optimizing the model parameters of the drug dosage prediction model, the stability and accuracy of the model prediction are improved; and by using the optimized drug dosage prediction model to predict the drug dosage for wastewater treatment, the treatment results are relatively stable, improving the usability of water and sludge.

[0035] Based on the first embodiment of this application, in the second embodiment of this application, the content that is the same as or similar to that in the first embodiment described above can be referred to the above description, and will not be repeated hereafter. Based on this, please refer to... Figure 3 , Figure 3 This is a flowchart illustrating Example 2 of the method for predicting the dosage of chemicals for wastewater treatment in this application.

[0036] like Figure 4As shown in the embodiments of this application, the step of obtaining the target model parameters by iteratively optimizing the model parameters based on the multi-objective function and using a dynamic multi-objective particle swarm optimization algorithm includes: Step S21: Randomly generate a particle swarm and initialize the velocity and position of the particles in the particle swarm; Step S22: Determine the current fitness value of each particle in the particle swarm based on the multi-objective function. The fitness value characterizes the quality of the particle.

[0037] As is understandable, in multi-objective particle swarm optimization (PSO) algorithms, the particle swarm is a group of multiple particles. Each particle can represent a potential solution to the optimization problem (i.e., a combination of a set of model parameters). The core attributes of a particle can include position and velocity, where position represents the current parameter value of the model, and velocity determines the direction and step size of the particle's movement.

[0038] It should be understood that by generating a randomly distributed swarm of particles, the particles can cover different regions in the search space, preventing the algorithm from converging to a local optimum too early, thereby enabling the exploration of different combinations of model parameters.

[0039] It is understandable that by evaluating the current fitness value of particles in a particle swarm using a multi-objective function, the quality of particles in the swarm can be represented.

[0040] In some embodiments of this application, the multi-objective function can be represented as follows: ; Where n represents the number of optimization objectives, that is, the number of model parameters that need to be optimized. Used to represent the objective function corresponding to the nth optimization objective.

[0041] In some embodiments of this application, the fitness value is used to evaluate the merits of the model parameters. Therefore, the prediction error, model complexity, and prediction efficiency of the drug dosage prediction model constructed based on these model parameters can be used as multi-objective functions.

[0042] In some embodiments of this application, the root mean square error can be used as the prediction error function for evaluating prediction performance, specifically as follows: ; in, Used to represent root mean square error N Used to indicate the number of training sets. Used to represent actual values, Used to represent model predictions.

[0043] Understandably, the smaller the root mean square error, the more reasonable the model parameters of the drug dosage prediction model are set, and the stronger the model's versatility. By determining the current fitness value of the particle swarm, dynamic allocation of each particle in the swarm can be achieved.

[0044] Step S23: Based on the current fitness value, dynamically allocate the particles in the particle swarm to obtain a dynamic optimization space; Step S24: Based on the spatial parameters of the dynamic optimization space, the particles are screened to obtain an optimized solution set; Step S25: Update the individual optimal positions and the global optimal positions in the particle swarm based on the optimized solution set.

[0045] It should be noted that, based on the current fitness value of a particle, particles in the particle swarm can be allocated to determine the dynamic optimization space corresponding to each particle. By using the spatial parameters corresponding to the dynamic optimization space, particles in the dynamic optimization space can be filtered to obtain the optimal solution set. Based on the current fitness value of each particle in the optimal solution set, the optimal position of each individual particle in the particle swarm and the global optimal position can be updated.

[0046] It is understandable that the aforementioned set of optimized solutions is the set of optimized solutions. These optimized solutions are the particle velocities and positions that enable the model parameters to reach their optimal or near-optimal states.

[0047] It should be understood that the aforementioned individual optimal position is the position corresponding to the highest fitness value in the history of the particle during the search process; the global optimal position is the position with the highest fitness value found in the entire particle swarm. Through continuous iterative optimization, the individual optimal position and the global optimal position are constantly updated, and the multi-objective particle swarm optimization algorithm can gradually converge to obtain a non-dominated solution set.

[0048] It should be noted that for each particle in the particle swarm, the current fitness value can be compared with the fitness value corresponding to the particle's individual optimal position. If the particle's current position dominates the individual optimal position, that is, if the current fitness value corresponding to the particle's current position is greater than the fitness value corresponding to the individual optimal position, then the particle's current position can be taken as the particle's individual optimal position. If the particle's individual optimal position dominates the particle's current position, then the individual optimal position remains unchanged. If the individual optimal position and the current position do not dominate each other, then one of the positions can be randomly selected as the new individual optimal position. In this embodiment, when they do not dominate each other, the current position can be taken as the individual optimal position. The method for determining the global optimal position can refer to the method for determining the individual optimal position described above, and this embodiment will not elaborate on it further. Specifically, the step of updating the individual optimal position and the global optimal position in the particle swarm based on the optimized solution set includes: comparing the current fitness value of a particle in the optimized solution set with the fitness value corresponding to the individual optimal position of the particle; if the current fitness value is not lower than the fitness value corresponding to the individual optimal position, then the current position of the particle is taken as the individual optimal position of the particle; comparing the maximum current fitness value of the optimal particle in the optimized solution set with the fitness value corresponding to the global optimal position of the particle swarm; the optimal particle is the particle with the largest fitness value in the particle swarm; if the maximum current fitness value is not lower than the fitness value corresponding to the global optimal position, then the current position corresponding to the optimal particle is taken as the global optimal position of the particle swarm.

[0049] Step S26: Return to the step of determining the current fitness value of the particles in the particle swarm based on the multi-objective function, and iteratively update the velocity and position of the particles to obtain the target model parameters.

[0050] It should be noted that the above optimized solution set can be used as the set of model parameters to be selected. By continuously iterating and updating the velocity and position of the particles, the target model parameters corresponding to the drug dosage prediction model can be determined based on the optimized solution set obtained at this time when the iteration termination condition is met.

[0051] This embodiment of the application initializes the velocity and position of particles in a randomly generated particle swarm; determines the current fitness value of the particles in the swarm based on a multi-objective function, whereby the fitness value characterizes the quality of the particles; dynamically allocates the particles in the swarm to a dynamic optimization space based on the current fitness value; filters the particles based on the spatial parameters of the dynamic optimization space to obtain an optimized solution set; updates the optimal positions of individual particles and the global optimal position in the swarm based on the optimized solution set; and returns to the step of determining the current fitness value of the particles in the swarm based on the multi-objective function to iteratively update the velocity and position of the particles to obtain the target model parameters. Because the allocation is done dynamically within the particle swarm, the problem of poor model search ability caused by different particle aggregation levels is reduced, thus improving the accuracy of prediction.

[0052] Based on the first and / or second embodiments of this application, in the third embodiment of this application, the content that is the same as or similar to the first and / or second embodiments described above can be referred to the above description and will not be repeated hereafter. Based on this, please refer to... Figure 4 , Figure 4 This is a flowchart illustrating Example 3 of the wastewater treatment drug dosage prediction method of this application.

[0053] like Figure 4 As shown in the embodiments of this application, the step of dynamically allocating particles in the particle swarm to the dynamic optimization space based on the current fitness value includes: Step S231: Determine the vector angle between the particle and the reference direction vector based on the current fitness value; Step S232: The reference direction vector corresponding to the smallest vector angle is taken as the target reference direction vector of the particle; Step S233: Assign the particles to the dynamic optimization space corresponding to the target reference direction vector.

[0054] In this embodiment, to achieve dynamic particle allocation, the particle search space can be divided into several sub-regions, i.e., the search space can be divided into several dynamic optimization spaces. Each dynamic optimization space can correspond to a reference direction vector. During optimization, the vector angle between the particle and the reference direction vector can be determined using the particle's current fitness value. The particle is then assigned to the reference direction vector with the smallest vector angle as its target reference direction vector, thus allocating the particle to the dynamic optimization space corresponding to the target reference direction vector. This dynamic allocation mechanism ensures a uniform distribution of particles in the search space, avoids clustering in local areas, and improves the robustness of the model.

[0055] In some embodiments of this application, it can be based on particles iCurrent fitness value F i With reference direction vector d k Determine the angle between the vectors θ i,k : .

[0056] It should be noted that, in order to reduce the problem of poor search capability caused by different degrees of clustering of optimal solutions in the archive, this application embodiment also designs a method for filtering particles to obtain optimal solutions based on the spatial parameters of the dynamic optimization space. Specifically, the spatial parameters include the current number of optimal solutions and the effective space quantity; the step of filtering the particle swarm based on the spatial parameters of the dynamic optimization space to obtain an optimal solution set includes: determining the optimal solution limit of the dynamic optimization space based on the effective space quantity and the preset number of optimal solutions; determining the optimal solution filtering strategy based on the optimal solution limit and the current number of optimal solutions; and filtering the optimal solutions in each of the dynamic optimization spaces based on the optimal solution filtering strategy to obtain an optimal solution set.

[0057] It should be noted that when the dynamic optimization space is allocated to particles, this space can be considered as the effective space, and the number of effective spaces mentioned above is also the number of dynamic optimization spaces allocated to particles. For an effective space, there may be multiple particles allocated in it, and the number of current optimization solutions is also the number of particles allocated in the effective space.

[0058] In some embodiments of this application, the method for determining the optimized solution limit value can be as follows: ; in, Used to indicate the first t The limit of the optimization solution in the dynamic optimization space during each iteration. O Used to represent the number of preset optimized solutions in the archive. H ( t ) is used to represent the first t The number of dynamic optimization spaces (i.e., the number of effective spaces) containing the optimal solution during each iteration.

[0059] It is understandable that when the effective space decreases, a sufficient number of optimal solutions can be retained to ensure the particle's exploration ability in the search space; conversely, when the effective space gradually increases, optimal solutions with better convergence can be retained to accelerate the algorithm's convergence. Based on this, the selection strategy for optimal solutions in the dynamic optimization space in this application embodiment can be as follows: If the number of optimal solutions in the solution set is no greater than the optimization limit, all optimal solutions in the dynamic subspace are retained to enhance the algorithm's search capability in the dynamic optimization space. If the number of optimal solutions in the solution set is greater than the optimization limit, the Pareto dominance strategy is used to determine the dominance capability of particles in the dynamic optimization space to obtain non-dominated solutions and an updated solution set. If the number of optimal solutions in the updated solution set is still greater than the optimization limit, further judgment can be made based on the size of the vector angle, retaining non-dominated solutions with smaller vector angles to ensure that the number of optimal solutions in the solution set does not exceed the optimization limit.

[0060] It should be noted that the partitioned dynamic optimization space can be viewed as a search subspace enhanced for a specific direction. The above filtering strategy makes the number of optimization solutions in each dynamic optimization space more even, thereby reducing the problem of poor search capability caused by varying degrees of clustering of optimization solutions in the database. Once filtering is complete, all optimization solutions in the dynamic optimization spaces can be merged to obtain a new set of optimization solutions.

[0061] It is understandable that through continuous iteration, one or more sets of optimal model parameters can be found in the particle swarm optimization. Based on user needs, target model parameters can be determined from these parameters, and then used as the initial model parameters for the Long Short-Term Memory (LSTM) network model to construct a first drug dosage prediction model. By inputting preset training data and preset test data into the first drug dosage prediction model for training and testing, a trained second drug dosage prediction model can be obtained when the test results are satisfactory. That is, the drug dosage prediction model includes a first drug dosage prediction model and a second drug dosage prediction model. The step of constructing the drug dosage prediction model based on the target model parameters includes: using the target model parameters as the model parameters of the LSM network model to construct the first drug dosage prediction model; and inputting preset training data into the first drug dosage prediction model for training to obtain the second drug dosage prediction model.

[0062] This embodiment determines the vector angle between the particle and the reference direction vector based on the current fitness value; the reference direction vector corresponding to the smallest vector angle is taken as the target reference direction vector of the particle; the particle is assigned to the dynamic optimization space corresponding to the target reference direction vector; the limit of the optimization solution in the dynamic optimization space is determined based on the effective space quantity and the preset number of optimization solutions; the optimization solution selection strategy is determined based on the optimization solution limit and the current number of optimization solutions; and the optimization solutions in each dynamic optimization space are selected based on the optimization solution selection strategy to obtain the optimization solution set. Because the algorithm averages the search possibilities in each direction by assigning particles to different dynamic optimization spaces and selecting optimization solutions in each dynamic optimization space, the robustness of the model is improved.

[0063] It should be noted that the above examples are only for understanding this application and do not constitute a limitation on the method for predicting the dosage of drugs for wastewater treatment in this application. Any simple modifications based on this technical concept are within the scope of protection of this application.

[0064] This application also provides a device for predicting the dosage of chemicals used in wastewater treatment. Please refer to [link / reference]. Figure 4 , Figure 4 This is a schematic diagram of the module structure of the wastewater treatment drug dosage prediction device according to an embodiment of this application. The wastewater treatment drug dosage prediction device includes: Preprocessing module 10 is used to construct a multi-objective function by taking the model parameters of the drug dosage prediction model as the optimization objective; Iterative optimization module 20 is used to perform model parameter optimization iteration based on the multi-objective function and through dynamic multi-objective particle swarm optimization algorithm to obtain target model parameters; Model building module 30 is used to build a drug dosage prediction model based on the target model parameters; The data prediction module 40 is used to predict the amount of drugs to be added for wastewater treatment based on the drug dosage prediction model.

[0065] The wastewater treatment chemical dosage prediction device provided in this application employs the wastewater treatment chemical dosage prediction method described in the above embodiments, which can solve the technical problem that existing wastewater treatment chemical dosage is based on experience and results in significant differences between the treated water quality and sludge properties. Compared with the prior art, the beneficial effects of the wastewater treatment chemical dosage prediction device provided in this application are the same as those of the wastewater treatment chemical dosage prediction method provided in the above embodiments, and other technical features in the wastewater treatment chemical dosage prediction device are the same as those disclosed in the methods of the above embodiments, and will not be repeated here.

[0066] This application provides a wastewater treatment drug dosage prediction device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the wastewater treatment drug dosage prediction method in the above embodiment 1.

[0067] The following is for reference. Figure 6 This document illustrates a schematic diagram of a wastewater treatment drug dosage prediction device suitable for implementing embodiments of this application. The wastewater treatment drug dosage prediction device in this application may include, but is not limited to, mobile terminals such as mobile phones, laptops, digital radio receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Description), PMPs (Portable Media Players), and in-vehicle terminals (e.g., in-vehicle navigation terminals), as well as fixed terminals such as digital TVs and desktop computers. Figure 6 The wastewater treatment drug dosage prediction device shown is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of this application.

[0068] like Figure 6As shown, the wastewater treatment chemical dosage prediction device may include a processing unit 1001 (e.g., a central processing unit, a graphics processor, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 1002 or a program loaded from a storage device 1003 into a random access memory (RAM) 1004. The RAM 1004 also stores various programs and data required for the operation of the wastewater treatment chemical dosage prediction device. The processing unit 1001, ROM 1002, and RAM 1004 are interconnected via a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Typically, the following systems can be connected to I / O interface 1006: input devices 1007 including, for example, touchscreens, touchpads, keyboards, mice, image sensors, microphones, accelerometers, gyroscopes, etc.; output devices 1008 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 1003 including, for example, magnetic tapes, hard disks, etc.; and communication devices 1009. Communication device 1009 allows the wastewater treatment chemical dosage prediction device to communicate wirelessly or wiredly with other devices to exchange data. Although wastewater treatment chemical dosage prediction devices with various systems are shown in the figures, it should be understood that it is not required to implement or possess all the systems shown. More or fewer systems can be implemented alternatively.

[0069] Specifically, according to the embodiments disclosed in this application, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments disclosed in this application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device, or installed from storage device 1003, or installed from ROM 1002. When the computer program is executed by processing device 1001, it performs the functions defined in the methods of the embodiments disclosed in this application.

[0070] The wastewater treatment chemical dosage prediction device provided in this application, employing the wastewater treatment chemical dosage prediction method described in the above embodiments, can solve the technical problem that existing wastewater treatment chemical dosage is based on experience-driven methods, resulting in significant differences in the quality of treated water and the properties of sludge. Compared with the prior art, the beneficial effects of the wastewater treatment chemical dosage prediction device provided in this application are the same as those of the wastewater treatment chemical dosage prediction method provided in the above embodiments, and other technical features of this wastewater treatment chemical dosage prediction device are the same as those disclosed in the previous embodiment method, and will not be repeated here.

[0071] It should be understood that the various parts disclosed in this application can be implemented using hardware, software, firmware, or a combination thereof. In the description of the above embodiments, specific features, structures, materials, or characteristics can be combined in any suitable manner in one or more embodiments or examples.

[0072] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

[0073] This application provides a computer-readable storage medium having computer-readable program instructions (i.e., a computer program) stored thereon, the computer-readable program instructions being used to execute the wastewater treatment drug dosage prediction method in the above embodiments.

[0074] The computer-readable storage medium provided in this application may be, for example, a USB flash drive, but is not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to: electrical connections having one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, system, or device. The program code contained on the computer-readable storage medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination thereof.

[0075] The aforementioned computer-readable storage medium may be included in the wastewater treatment drug dosage prediction device; or it may exist independently and not be assembled into the wastewater treatment drug dosage prediction device.

[0076] The aforementioned computer-readable storage medium carries one or more programs that, when executed by the wastewater treatment chemical dosage prediction device, cause the wastewater treatment chemical dosage prediction device to: The model parameters of the drug dosage prediction model are used as optimization objectives to construct a multi-objective function; Based on the aforementioned multi-objective function, the model parameters are optimized iteratively using a dynamic multi-objective particle swarm optimization algorithm to obtain the target model parameters; A drug dosage prediction model is constructed based on the target model parameters; The drug dosage prediction model is used to predict the drug dosage for wastewater treatment.

[0077] Computer program code for performing the operations of this application can be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, and C++, and conventional procedural programming languages ​​such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a Local Area Network (LAN) or a Wide Area Network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0078] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.

[0079] The modules described in the embodiments of this application can be implemented in software or hardware. The names of the modules do not necessarily limit the functionality of the unit itself.

[0080] The readable storage medium provided in this application is a computer-readable storage medium that stores computer-readable program instructions (i.e., a computer program) for executing the above-described wastewater treatment drug dosage prediction method. This solves the technical problem that existing wastewater treatment drug dosage methods are based on experience and result in significant differences in the quality of the treated water and the properties of the sludge. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided in this application are the same as those of the wastewater treatment drug dosage prediction method provided in the above embodiments, and will not be elaborated upon here.

[0081] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the wastewater treatment drug dosage prediction method described above.

[0082] The computer program product provided in this application can solve the technical problem that existing wastewater treatment chemical dosing is based on experience and results in significant differences in the quality of the treated water and the properties of the sludge. Compared with the prior art, the beneficial effects of the computer program product provided in this application are the same as those of the wastewater treatment chemical dosing prediction method provided in the above embodiments, and will not be repeated here.

[0083] The above description is only a part of the embodiments of this application and does not limit the scope of protection of this application. All equivalent structural transformations made under the technical concept of this application and using the content of this application specification and drawings, or direct / indirect applications in other related technical fields, are included in the scope of protection of this application.

Claims

1. A method for predicting the dosage of chemicals used in wastewater treatment, characterized in that, The method includes: The model parameters of the drug dosage prediction model are used as optimization objectives to construct a multi-objective function; Based on the aforementioned multi-objective function, the model parameters are optimized iteratively using a dynamic multi-objective particle swarm optimization algorithm to obtain the target model parameters; A drug dosage prediction model is constructed based on the target model parameters; The drug dosage prediction model is used to predict the drug dosage for wastewater treatment.

2. The method for predicting the dosage of chemicals for wastewater treatment as described in claim 1, characterized in that, The step of obtaining the target model parameters by iteratively optimizing the model parameters based on the multi-objective function and using a dynamic multi-objective particle swarm optimization algorithm includes: A random particle swarm is generated, and the velocity and position of the particles in the swarm are initialized. The current fitness value of a particle in the particle swarm is determined based on the multi-objective function, and the fitness value is used to characterize the quality of the particle. Based on the current fitness value, the particles in the particle swarm are dynamically allocated to the dynamic optimization space; The particles are screened based on the spatial parameters of the dynamic optimization space to obtain an optimized solution set; The optimal positions of individuals and the global optimal positions in the particle swarm are updated based on the optimized solution set. Returning to the step of determining the current fitness value of particles in the particle swarm based on the multi-objective function, the velocity and position of the particles are iteratively updated to obtain the target model parameters.

3. The method for predicting the dosage of chemicals for wastewater treatment as described in claim 2, characterized in that, The step of dynamically allocating particles in the particle swarm based on the current fitness value to obtain a dynamic optimization space includes: The vector angle between the particle and the reference direction vector is determined based on the current fitness value; The reference direction vector corresponding to the smallest vector angle is taken as the target reference direction vector of the particle. The particles are assigned to the dynamic optimization space corresponding to the target reference direction vector.

4. The method for predicting the dosage of chemicals for wastewater treatment as described in claim 2, characterized in that, The spatial parameters include the number of current optimized solutions and the number of effective spaces; the step of filtering the particle swarm based on the spatial parameters of the dynamic optimization space to obtain an optimized solution set includes: The limit value of the optimization solution in the dynamic optimization space is determined based on the effective space quantity and the preset number of optimization solutions in the dynamic optimization space. An optimal solution selection strategy is determined based on the optimal solution limit and the current number of optimal solutions. Based on the aforementioned optimal solution screening strategy, optimal solutions in each of the dynamic optimization spaces are screened to obtain an optimal solution set.

5. The method for predicting the dosage of chemicals for wastewater treatment as described in claim 2, characterized in that, The step of updating the individual optimal positions and the global optimal positions in the particle swarm based on the optimized solution set includes: The current fitness value of a particle in the optimized solution set is compared with the fitness value corresponding to the individual optimal position of the particle. If the current fitness value is not lower than the fitness value corresponding to the individual's optimal position, then the current position of the particle is taken as the individual's optimal position. The maximum current fitness value of the optimal particle in the optimized solution set is compared with the fitness value corresponding to the global optimal position of the particle swarm; the optimal particle is the particle with the largest fitness value in the particle swarm. If the maximum current fitness value is not lower than the fitness value corresponding to the global optimal position, then the current position corresponding to the optimal particle is taken as the global optimal position of the particle swarm.

6. The method for predicting the dosage of chemicals for wastewater treatment as described in claim 1, characterized in that, The drug dosage prediction model includes a first drug dosage prediction model and a second drug dosage prediction model. The step of constructing the drug dosage prediction model based on the target model parameters includes: The target model parameters are used as model parameters for the long short-term memory network model to construct a first drug dosage prediction model. The preset training data is input into the first drug dosage prediction model for training to obtain the second drug dosage prediction model.

7. A device for predicting the dosage of chemicals used in wastewater treatment, characterized in that, The wastewater treatment drug dosage prediction device includes: The preprocessing module is used to construct a multi-objective function by taking the model parameters of the drug dosage prediction model as the optimization objective; The iterative optimization module is used to perform iterative optimization of model parameters based on the multi-objective function and through a dynamic multi-objective particle swarm optimization algorithm to obtain the target model parameters. The model building module is used to build a drug dosage prediction model based on the target model parameters; The data prediction module is used to predict the dosage of drugs for wastewater treatment based on the drug dosage prediction model.

8. A device for predicting the dosage of chemicals used in wastewater treatment, characterized in that, The device includes: a memory, a processor, and a wastewater treatment drug dosage prediction program stored in the memory and executable on the processor, the wastewater treatment drug dosage prediction program being configured to implement the steps of the wastewater treatment drug dosage prediction method as described in any one of claims 1 to 6.

9. A storage medium, characterized in that, The storage medium stores a wastewater treatment drug dosage prediction program, which, when executed by a processor, implements the steps of the wastewater treatment drug dosage prediction method as described in any one of claims 1 to 6.

10. A computer program product, characterized in that, The computer program product includes a computer program that, when executed by a processor, implements the steps of the wastewater treatment drug dosage prediction method as described in any one of claims 1 to 6.