Medicament adding control method and system
By combining the PID control algorithm and the random forest control method, the dosage of medicine is dynamically adjusted, which solves the problem that the dosage of medicine cannot be dynamically adjusted in the prior art, and accurately and intelligent dosage of medicine is realized, which improves the efficiency of sewage treatment and water effluent stability.
Patent Information
- Application Number
- CN202510461044.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-14
- Publication Date
- 2025-07-08
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The existing phosphorus removal agent dosage device cannot dynamically adjust the dosage of the agent, resulting in waste of the agent or inefficient treatment.
The drug delivery calculation model combining PID control algorithm and random forest control method is adopted. By obtaining water quality data and flow data in real time, the drug delivery dosage is dynamically adjusted, and the PID control coefficient is updated using the random forest algorithm to predict future control errors.
It has achieved rapid and accurate dynamic adjustment of the dosage of chemicals, improved the stability of the total effluent phosphorus in the sewage treatment system, and improved the treatment efficiency and accuracy.
Smart Images

Figure CN120276513A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of chemical dosing control, and in particular relates to a chemical dosing control method and system. Background Art
[0002] At present, in the process of sewage treatment, chemical phosphorus removal is a commonly used treatment method. Existing phosphorus removal chemical dosing devices mostly rely on manual operation, and the control of the dosing amount is not precise enough, resulting in waste of chemicals or poor treatment effects. Although some systems attempt to dose chemicals through simple automation control, they lack the ability to dynamically adjust according to real-time water quality data and cannot achieve precise control.
[0003] The above-mentioned prior art solutions have the following defects: The existing phosphorus removal chemical dosing devices cannot dynamically adjust the chemical dosing amount, resulting in waste of chemicals or low treatment efficiency, so there is room for improvement.
[0004] Therefore, how to design a control method that can quickly, dynamically, and precisely adjust the chemical dosing amount is a technical problem to be solved. Summary of the Invention
[0005] Based on this, in view of the problems of the prior art, it is necessary to provide a chemical dosing control method and system.
[0006] In a first aspect, an embodiment of the present application provides a chemical dosing control method, including the following steps: S1: Obtain the dosing system data at the current moment. The dosing system data includes the measured value of orthophosphorus in water quality, the target value of orthophosphorus in water quality, the influent flow rate data, the return flow rate data, and the actual chemical dosing flow rate; S2: Based on the measured value of orthophosphorus in water quality and the target value of orthophosphorus in water quality, obtain the chemical dosing deviation; S3: Based on the chemical dosing deviation and the chemical dosing correction deviation model, obtain the chemical dosing correction deviation; S4: Based on the chemical dosing correction deviation and the chemical dosing unit consumption adjustment model, obtain the chemical dosing unit consumption adjustment value; S5: Based on the chemical dosing unit consumption adjustment value, the initial chemical dosing unit consumption, the chemical dosing point flow rate, and the chemical dosing calculation model, obtain the current chemical dosing amount at the current moment; Among them, the chemical dosing calculation model is represented by the following formula: (1); Among them, is the current chemical dosing amount, is the chemical dosing flow rate, is the chemical dosing point flow rate, is the metal concentration of the chemical; Among them, is expressed by the following formula: (2); Among them, is the single consumption of chemical agent addition, and is expressed by the following formula: (3); Among them, is expressed by the following formula: (4); Among them, is the influent flow rate data, is the reflux flow rate data, is the initial dosage of chemical agent; is the adjustment value of the single consumption of chemical agent addition.
[0007] Preferably, the deviation of chemical agent addition is expressed by the following formula: (5); Among them, is the deviation of chemical agent addition, is the target value of orthophosphate in water quality, is the measured value of orthophosphate in water quality.
[0008] Preferably, the correction deviation model is expressed by the following formula: (6); Among them, is the correction deviation of chemical agent addition, is the deviation correction coefficient, is the proportional correction coefficient.
[0009] Preferably, the adjustment model of the single consumption of chemical agent addition is a PID control model, and is expressed by the following formula: (7); Among them, , and are respectively the proportional control coefficient, integral control coefficient and derivative control coefficient of the PID control model.
[0010] Preferably, , and are obtained by the following method: Judge whether the absolute difference between the adjustment value of the single consumption of chemical agent addition at the current moment and the target value of the adjustment of the single consumption of chemical agent addition is greater than the preset threshold; When the absolute difference between the chemical dosing unit consumption adjustment value and the chemical dosing unit consumption adjustment target value at the current moment is greater than the preset threshold, the coefficient adjustment model is used to obtain the 、 and ; Among them, the coefficient adjustment model is: (8); Among them, 、 and are the proportional control coefficient, integral control coefficient and derivative control coefficient of the PID control model at the previous moment respectively, 、 and are the predicted proportional control coefficient, predicted integral control coefficient and predicted derivative control coefficient of the PID control model at the current moment respectively, is the adjustment factor.
[0011] Preferably, 、 and are obtained by the following method: Obtain the chemical dosing amounts of the dosing system at all historical moments before the current moment to obtain a chemical dosing sample set; Obtain the actual error and predicted error of the chemical dosing sample set through the random forest algorithm; Based on the actual error and the predicted error, obtain the mixed error of the chemical dosing sample set; Based on the mixed error and the proportional coefficient calculation model, obtain the predicted proportional control coefficient 、predicted integral control coefficient and predicted derivative control coefficient of the PID control model at the current moment.
[0012] Preferably, the mixed error of the chemical dosing sample set is expressed by the following formula: (9); Among them, is the mixed error, is the actual error, predicted error, is the actual error weight, is the predicted error weight, .
[0013] Preferably, the proportional coefficient calculation model is expressed by the following formula: (10); (11); (12); Among them, , and are respectively the predicted proportional control coefficient, the predicted integral control coefficient, and the predicted derivative control coefficient of the PID control model at the previous moment of the current moment, is the mixed error at the previous moment of the current moment, is the time variable.
[0014] In a second aspect, an embodiment of the present application provides a chemical dosing control system, including: A data acquisition unit, configured to acquire dosing system data at the current moment, and the dosing system data includes the measured value of orthophosphorus in water quality, the target value of orthophosphorus in water quality, the influent flow data, the reflux flow data, and the actual chemical dosing flow; A first calculation unit, configured to obtain a chemical dosing deviation based on the measured value of orthophosphorus in water quality and the target value of orthophosphorus in water quality; A second calculation unit, configured to obtain a chemical dosing correction deviation based on the chemical dosing deviation and the chemical dosing correction deviation model; A third calculation unit, configured to obtain a chemical dosing unit consumption adjustment value based on the chemical dosing correction deviation and the chemical dosing unit consumption adjustment model; A result calculation unit, configured to obtain the current chemical dosing amount at the current moment based on the chemical dosing unit consumption adjustment value, the initial chemical dosing unit consumption, the chemical dosing point flow, and the chemical dosing calculation model; Among them, the chemical dosing calculation model is represented by the following formula: (1); Among them, is the current chemical dosing amount, is the chemical dosing flow, is the chemical dosing point flow, is the metal concentration of the chemical; Among them, is represented by the following formula: (2); Among them, is the chemical dosing unit consumption, and is represented by the following formula: (3); Among them, is represented by the following formula: (4); Among them, is the influent flow data, Return flow rate data, Initial dosage of the chemical agent; Is the adjusted value of the unit consumption of chemical agent dosing.
[0015] In a third aspect, an embodiment of the present application provides an electronic device, and the electronic device includes: A processor; A memory for storing executable instructions of the processor; The processor is configured to read the executable instructions from the memory and execute the executable instructions to implement the method described in the first aspect above.
[0016] Compared with the prior art, the present invention has the following beneficial effects: The present invention combines the advantages of the PID control algorithm and the random forest control method to establish a chemical agent dosing calculation model, which can quickly and accurately perform dynamic adjustment of the chemical agent dosage; the chemical agent dosing calculation model is established on the basis of PID control, and the proportional control coefficient, integral control coefficient, and differential control coefficient of PID are processed and updated by the random forest algorithm, and the structure at each moment can be used as a reference value for subsequent moments, making the processing process faster and more efficient; at the same time, the traditional PID algorithm only operates on past control errors and does not predict future control errors, which limits the control performance. The introduction of the random forest algorithm enables the method to limit and correct future control errors, making up for the control performance, thereby achieving more accurate control. The precise chemical agent dosing and phosphorus removal control method, device, computer device, and storage medium proposed by the present invention can realize precise and intelligent dosing of chemical agents, effectively promoting the stable compliance of the total phosphorus in the effluent of the sewage treatment system. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] By referring to the following drawings, the exemplary embodiments of the present invention can be more completely understood. The drawings are used to provide a further understanding of the embodiments of the present application and constitute a part of the specification. Together with the embodiments of the present application, they are used to explain the present invention and do not constitute a limitation to the present invention. In the drawings, the same reference numerals generally represent the same components or steps.
[0018] Figure 1 Is a flowchart of a chemical agent dosing control method provided by an embodiment of the present application; Figure 2 Is a schematic diagram of a chemical agent dosing control system provided by an embodiment of the present application; Figure 3 Is a schematic structural diagram of an electronic device provided by an embodiment of the present application. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0019] Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided so that the present disclosure can be more thoroughly understood and the scope of the present disclosure can be fully conveyed to those skilled in the art.
[0020] In the description of the present invention, it should be noted that the orientation or positional relationship indicated by the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer", etc. is based on the orientation or positional relationship shown in the drawings, and is only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore should not be construed as a limitation of the present invention. In addition, the terms "first", "second", and "third" are only used for descriptive purposes and should not be construed as indicating or implying relative importance.
[0021] In addition, the technical features involved in different embodiments of the present invention described below can be combined with each other as long as they do not conflict with each other.
[0022] Example 1 Referring to Figure 1 , this embodiment discloses a chemical dosing control method, which includes the following steps: S1: Obtain the dosing system data at the current moment. The dosing system data includes the measured value of orthophosphate in water quality, the target value of orthophosphate in water quality, the influent flow data, the return flow data, and the actual chemical dosing flow; Specifically, sensors are arranged at multiple places in the sedimentation tank to collect the data of the system. For example, at the influent port, the chemical dosing pump, the effluent port, or other places where data needs to be collected. Specifically included are: the measured value of orthophosphate in water quality, the target value of orthophosphate in water quality, the influent flow data, the return flow data, and the actual chemical dosing flow. The collected data is saved for subsequent use.
[0023] S2: Based on the measured value of orthophosphate in water quality and the target value of orthophosphate in water quality, obtain the chemical dosing deviation; Specifically, the chemical dosing deviation is represented by the following formula: (5); Wherein, is the chemical dosing deviation, is the target value of orthophosphate in water quality, is the measured value of orthophosphate in water quality.
[0024] S3: Based on the chemical dosing deviation and the chemical dosing correction deviation model, obtain the chemical dosing correction deviation; Specifically, the calibration deviation model is represented by the following formula: (6); Wherein, is the calibration deviation of chemical dosing, is the deviation correction coefficient, representing a coefficient for further correcting the original deviation, with a default value of 1 in the state of no correction, is the proportional correction coefficient, which is adjusted by random forest. is related to the PID coefficient corrected by random forest.
[0025] S4: Based on the calibration deviation of chemical dosing and the chemical dosing unit consumption adjustment model, obtain the adjusted value of chemical dosing unit consumption; Specifically, the dosing unit consumption refers to the amount of chemical to be dosed per unit volume of water per unit time. Specifically, it represents the amount of chemical to be dosed per liter of water (or per cubic meter of water) per unit time (such as per minute or per hour). The unit is usually milligrams per liter (mg / L) or grams per cubic meter (g / m³).
[0026] In this embodiment, the chemical dosing unit consumption adjustment model is a PID control model, which is represented by the following formula: (7); Wherein, , and are the proportional control coefficient, integral control coefficient, and derivative control coefficient of the PID control model, respectively.
[0027] Adjusting the values of , and in formula (7) can optimize the performance of the PID controller and make it achieve the best control effect in different application scenarios. Their specific meanings are as follows: (1) : The proportional control coefficient determines the influence degree of the current error (i.e., the difference between the set value and the actual value) on the controller output. The larger the current error, the faster the output of the controller changes. The higher the value of , the faster the system response speed, but too high
[0028] (2) : The integral control coefficient determines the influence of the accumulation of past errors on the controller output. The integral term can eliminate the steady-state error of the system and make the system tend to be stable during long-term operation. The higher the value of , the greater the cumulative influence of the system on past errors, which helps to eliminate long-term deviations, but too high
[0029] (3) : The differential control coefficient determines the impact of the error change rate on the controller output. The derivative term can predict the future error trend, thereby adjusting the controller output in advance and reducing overshoot and oscillation. The higher the value, the higher the sensitivity of the system to the error change, which helps to improve the dynamic performance of the system. However, too high may lead to noise amplification.
[0030] Specifically, 、 and are obtained in the following manner: (1) Determine whether the absolute difference between the chemical dosing unit consumption adjustment value at the current moment and the chemical dosing unit consumption adjustment target value is greater than a preset threshold; Specifically, the preset threshold is a fixed value set in advance, and it can also be adjusted adaptively according to the change of water quality.
[0031] (2) In response to the absolute difference between the chemical dosing unit consumption adjustment value at the current moment and the chemical dosing unit consumption adjustment target value being greater than the preset threshold, use the coefficient adjustment model to obtain the 、 and at the current moment; Among them, the coefficient adjustment model is: (8); Among them, 、 and are respectively the proportional control coefficient, integral control coefficient and differential control coefficient of the PID control model at the previous moment, 、 and are respectively the predicted proportional control coefficient, predicted integral control coefficient and predicted differential control coefficient of the PID control model at the current moment; is an adjustment factor, which can be determined according to the actual processing data accuracy of the PID control model.
[0032] Specifically, the proportional control coefficient, integral control coefficient and differential control coefficient of the PID of the present invention are processed and updated by the random forest algorithm, and the structure at each moment can be used as a reference value for the subsequent moment, making the processing process faster and more efficient; specifically, 、 and are obtained in the following manner: (1) Obtain the chemical dosing amounts of the dosing system at all historical moments before the current moment to obtain a chemical dosing sample set; (2) Obtain the actual error and predicted error of the chemical dosing sample set through the random forest algorithm; (3) Based on the actual error and the predicted error, obtain the mixed error of the chemical dosing sample set; (4) Based on the mixed error and the proportional coefficient calculation model, obtain the predicted proportional control coefficient, predicted integral control coefficient and predicted derivative control coefficient at the current moment.
[0033] Among them, the mixed error of the chemical dosing sample set is expressed by the following formula: (9); Among them, is the mixed error, is the actual error, predicted error, is the actual error weight, is the predicted error weight, . In a preferred embodiment, and both take the value of 0.5.
[0034] Specifically, the proportional coefficient calculation model is expressed by the following formula: (10); (11); (12); Among them, , and are respectively the predicted proportional control coefficient, predicted integral control coefficient, and predicted derivative control coefficient of the PID control model at the previous moment of the current moment, is the mixed error at the previous moment of the current moment, is the time variable. Among them, when calculating the differential term, a low-pass filter can be added to reduce noise, thereby improving the calculation accuracy and precision.
[0035] Specifically, Random Forest (RF) is an ensemble learning method that improves prediction accuracy and prevents overfitting by constructing multiple decision trees and taking their average results. The following is a detailed description of the specific processing process, training process, and acquisition of the final result of the parameters in the random forest.
[0036] Among them, the mathematical formula of the random forest can be expressed as: (13); Wherein: is the final predicted value, T is the number of decision trees in the random forest, is the predicted value of the
[0037] (1) Parameter Definition and Initialization Before using the random forest model, a series of key model parameters need to be defined and initialized. These parameters determine the structure and complexity of the model and affect its performance and generalization ability: n_estimators: This refers to the number of decision trees. Increasing the number of trees can improve the prediction ability and stability of the model, but it will also increase the computational burden.
[0038] max_depth: Set the maximum depth of each tree. By restricting the depth of the tree, the risk of overfitting can be effectively reduced.
[0039] min_samples_split: Define the minimum number of samples required for internal node re - splitting. This parameter helps control the growth rate of the tree and prevents over - subdivision.
[0040] min_samples_leaf: Specify the minimum number of samples required for a leaf node. It is also used to control the growth of the tree and ensure that each leaf node has sufficient data support.
[0041] max_features: Determine the maximum number of features to consider at each split. Set to "sqrt" (the square root of the total number of features), which increases the randomness of the model and reduces the risk of overfitting.
[0042] bootstrap: Decide whether to use sampling with replacement to construct the dataset for each tree. This option is enabled by default.
[0043] (2) Data Preparation Next, divide the entire dataset into a training set and a test set and perform necessary pre - processing steps: Split the dataset: Usually, the data is randomly divided according to a certain ratio (90% as the training set and 10% as the test set).
[0044] We have a dataset containing m samples , is the feature vector of the th sample, is the corresponding label or target value. First, divide the dataset into a training set and a test set in the ratio of , where is the proportion of the test set ( = 0.1 means 10% of the data is used as the test set).
[0045] Training set: contains samples; Test set: contains samples; , = split( ), specifically for the feature matrix and target vector: Feature matrix: Let be the original feature matrix, where is the number of features.
[0046] Target vector: Let be the target variable vector.
[0047] Then the final processing formula is: , , , = split( , , ) Standardization: That is, Zscore normalization, which standardizes the features so that the mean of each feature is 0 and the standard deviation is 1. The purpose of this is to eliminate the influence of different feature magnitude differences and ensure that the model can learn more effectively.
[0048] Among them, the formula for item A, calculating the mean and standard deviation (only based on the training set) is expressed as: (14); (15); Among them, the formula for item B of the training set is expressed as: (16); Among them, the formula for item C of the test set is expressed as: (17); Among them, and respectively represent the data after standardizing the th feature in the training set and the test set, ensuring the use of a consistent data preprocessing method during training and testing, thereby improving the stability and generalization ability of the model.
[0049] (3)Model Training Create a random forest model according to the parameters defined above and train it using the data in the training set. During the training process, each decision tree is constructed independently, and they jointly form a powerful integrated model.
[0050] (4)Result Obtaining Each decision tree in the random forest has a fixed hyperparameter configuration set before training, rather than being dynamically adjusted through an iterative optimization process like a neural network. Specifically, a new model is generated through the parameter adjustment in the previous "Parameter Definition and Initialization".
[0051] (5)Evaluate Model Performance Use the test set to evaluate the performance of the model and calculate the mean squared error (MSE) and the coefficient of determination R 2 Evaluation Metrics.
[0052] Among them, represents the true value, represents the predicted value, is the average of the actual values.
[0053] (18); (19); After the training is completed, save all the data in PKL format.
[0054] S5: Based on the adjusted value of the chemical dosage per unit consumption, the initial chemical dosage per unit consumption, the flow rate at the chemical dosing point, and the chemical dosing calculation model, obtain the current chemical dosage at the current moment; Among them, the chemical dosing calculation model is represented by the following formula: (1); Among them, is the current chemical dosage, is the chemical dosing flow rate, is the flow rate at the dosing point, is the metal concentration of the chemical; Among them, is represented by the following formula: (2); Among them, is the chemical dosage per unit consumption, which is represented by the following formula: (3); Among them, is represented by the following formula: (4); Among them, is the influent flow rate data, the return flow rate data, the initial dosage of the chemical agent; is the adjustment value of the chemical agent dosage per unit consumption.
[0055] Compared with the prior art, the present invention has the following beneficial effects: The present invention combines the advantages of the PID control algorithm and the random forest control method, establishes a chemical agent dosing calculation model, and can quickly and accurately perform dynamic adjustment of the chemical agent dosage; the chemical agent dosing calculation model is established on the basis of PID control, and the proportional control coefficient, integral control coefficient, and differential control coefficient of PID are processed and updated by the random forest algorithm, and the structure at each moment can be used as a reference value for the subsequent moment, making the processing process faster and more efficient; at the same time, the traditional PID algorithm only operates on the past control error and does not predict the future control error, which limits the control performance. The introduction of the random forest algorithm enables the method to limit and correct the future control error, making up for the control performance, thereby achieving more accurate control. The precise chemical agent dosing and phosphorus removal control method, device, computer equipment, and storage medium proposed by the present invention can achieve precise and intelligent dosing of chemical agents, effectively promoting the stable compliance of the total phosphorus in the effluent of the sewage treatment system.
[0056] Embodiment 2 Referring to Figure 2 , this embodiment discloses a chemical agent dosing control system, including: A data acquisition unit 201 for acquiring the dosing system data at the current moment. The dosing system data includes the measured value of orthophosphorus in water quality, the target value of orthophosphorus in water quality, the influent flow rate data, the return flow rate data, and the actual chemical agent dosing flow rate; A first calculation unit 202 for obtaining the chemical agent dosing deviation based on the measured value of orthophosphorus in water quality and the target value of orthophosphorus in water quality; A second calculation unit 203 for obtaining the chemical agent dosing correction deviation based on the chemical agent dosing deviation and the chemical agent correction deviation model; A third calculation unit 204 for obtaining the adjustment value of the chemical agent dosage per unit consumption based on the chemical agent dosing correction deviation and the chemical agent dosing per unit consumption adjustment model; A result calculation unit 205 for obtaining the current chemical agent dosage at the current moment based on the adjustment value of the chemical agent dosage per unit consumption, the initial chemical agent dosage per unit consumption, the chemical agent dosing point flow rate, and the chemical agent dosing calculation model; Among them, the chemical agent dosing calculation model is represented by the following formula: (1); Among them, is the current chemical agent dosage, is the chemical agent dosing flow rate, is the flow rate at the dosing point, is the metal concentration of the medicament; Among them, is represented by the following formula: (2); Among them, is the unit consumption of medicament dosing, which is represented by the following formula: (3); Among them, is represented by the following formula: (4); Among them, is the influent flow rate data, the recirculation flow rate data, the initial dosing amount of the medicament; is the adjustment value of the unit consumption of medicament dosing.
[0057] The system provided by the embodiments of the present application can implement the above method, and the system can be implemented in a software, hardware, or a combination of software and hardware manner. For example, the system can include integrated or separate functional modules or units to execute the corresponding steps in the above methods. In some implementation manners of the embodiments of the present application, the system provided by the embodiments of the present application and the method provided by the foregoing embodiments of the present application are based on the same inventive concept and have the same beneficial effects. Details are not described herein again.
[0058] Embodiment 3 The embodiment of the present application further provides an electronic device corresponding to the method provided by the foregoing embodiment. The electronic device can be an electronic device for a server, such as a server, including an independent server and a distributed server cluster, etc., to execute the above method; the electronic device can also be an electronic device for a client, such as a mobile phone, a laptop computer, a tablet computer, a desktop computer, etc., to execute the above method.
[0059] Please refer to Figure 3 , which shows a schematic diagram of an electronic device provided by some embodiments of the present application. As Figure 3 shown, the electronic device 30 includes: a processor 300, a memory 301, a bus 302, and a communication interface 303. The processor 300, the communication interface 303, and the memory 301 are connected through the bus 302; a computer program that can run on the processor 300 is stored in the memory 301, and when the processor 300 runs the computer program, it executes the method described above.
[0060] Among them, the memory 301 may include high-speed random access memory (RAM), and may also include non-volatile memory, such as at least one disk memory. The communication connection between the system network element and at least one other network element is implemented through at least one communication interface 303 (which can be wired or wireless), and the Internet, wide area network, local area network, metropolitan area network, etc. can be used.
[0061] The bus 302 can be an ISA bus, a PCI bus, an EISA bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. Among them, the memory 301 is used to store a program. After receiving an execution instruction, the processor 300 executes the program. Any implementation manner of the methods disclosed in the embodiments of the present application can be applied to the processor 300 or implemented by the processor 300.
[0062] The processor 300 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the integrated logic circuit in the hardware of the processor 300 or the instructions in software form. The above-mentioned processor 300 may be a general-purpose processor, including a central processing unit (CPU for short), a network processor (NP for short), etc.; it may also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components. It can implement or execute the various methods, steps and logic block diagrams disclosed in the embodiments of the present application. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc. The steps of the method disclosed in combination with the embodiments of the present application can be directly embodied as being executed and completed by the hardware decoding processor, or executed and completed by the combination of the hardware and software modules in the decoding processor. The software module may be located in a mature storage medium in the art such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. This storage medium is located in the memory 301, and the processor 300 reads the information in the memory 301 and combines its hardware to complete the steps of the above method.
[0063] The electronic device provided by the embodiments of the present application and the method provided by the embodiments of the present application are based on the same inventive concept and have the same beneficial effects as the methods adopted, run or implemented by them.
[0064] It should be noted that the flowcharts and block diagrams in the accompanying drawings illustrate the possible architectures, functions, and operations of systems, methods, and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagram may represent a module, a segment of a program, or a part of code, and the module, segment of a program, or part of code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order from that marked in the accompanying drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in the block diagram and / or flowchart, as well as the combination of blocks in the block diagram and / or flowchart, may be implemented by a dedicated hardware-based system that performs the specified functions or actions, or may be implemented by a combination of dedicated hardware and computer instructions.
[0065] Those skilled in the art can clearly understand that for the convenience and conciseness of description, the specific working processes of the systems, devices, and units described above can refer to the corresponding processes in the foregoing method embodiments, and will not be elaborated herein.
[0066] In several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are merely illustrative. For example, the division of the units is only a logical function division, and there may be other division methods in actual implementation. For another example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Another point is that the couplings, direct couplings, or communication connections shown or discussed among each other may be through some communication interfaces. The indirect couplings or communication connections of the devices or units may be in electrical, mechanical, or other forms.
[0067] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0068] In addition, the functional units in various embodiments of the present application may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit.
[0069] If the above-mentioned functions are implemented in the form of software function units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in various embodiments of this application. The aforementioned storage medium includes: various media that can store program codes, such as USB flash drives, mobile hard disks, read-only memories (ROM, Read-Only Memory), random access memories (RAM, Random Access Memory), magnetic disks, or optical discs.
[0070] Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of this application, rather than to limit them; although this application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: they can still modify the technical solutions described in the foregoing embodiments, or perform equivalent replacements on some or all of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the scope of the technical solutions of various embodiments of this application, and they should all be covered by the scope of the claims and the description of this application.
Claims
1. A method for controlling the dosing of a medicament, characterized in that, It includes the following steps: S1: Obtain the dosing system data at the current moment. The dosing system data includes the measured value of orthophosphate in water quality, the target value of orthophosphate in water quality, the influent flow rate data, the return flow rate data, and the actual chemical dosing flow rate; S2: Based on the measured value of orthophosphate in water quality and the target value of orthophosphate in water quality, obtain the chemical dosing deviation; S3: Based on the chemical dosing deviation and the chemical dosing correction deviation model, obtain the chemical dosing correction deviation; S4: Based on the chemical dosing correction deviation and the chemical dosing unit consumption adjustment model, obtain the chemical dosing unit consumption adjustment value; S5: Based on the chemical dosing unit consumption adjustment value, the initial chemical dosing unit consumption, the chemical dosing point flow rate, and the chemical dosing calculation model, obtain the current chemical dosing amount at the current moment; Among them, the chemical dosing calculation model is represented by the following formula: (1); Among them, is the current dosage of the agent, is the dosing flow rate of the agent, is the flow rate at the dosing point, is the metal concentration of the agent; Among them, It is expressed by the following formula: (2); Among them, is the single consumption of reagent addition, which is expressed by the following formula: (3); Among them, It is represented by the following formula: (4); Among them, is the influent flow rate data, is the return flow rate data, is the initial chemical dosage; is the adjustment value of the chemical dosage consumption per unit.
2. The method according to claim 1, characterized in that, The chemical dosing deviation is represented by the following formula: (5); Among them, is the dosing deviation of the reagent, is the target value of orthophosphate in water quality, is the measured value of orthophosphate in water quality.
3. The method according to claim 2, wherein The correction deviation model is represented by the following formula: (6); Among them, is the dosing correction deviation of the agent, is the deviation correction coefficient, is the proportional correction coefficient.
4. The method according to claim 3, wherein The chemical dosing unit consumption adjustment model is a PID control model and is represented by the following formula: (7); Among them, , and are the proportional control coefficient, integral control coefficient, and derivative control coefficient of the PID control model, respectively.
5. The method according to claim 4, characterized in that , and are obtained by the following method: Judge whether the absolute difference between the chemical dosing unit consumption adjustment value at the current moment and the chemical dosing unit consumption adjustment target value is greater than the preset threshold; When the absolute difference between the chemical dosing unit consumption adjustment value at the current moment and the chemical dosing unit consumption adjustment target value is greater than the preset threshold, the coefficient adjustment model is used to obtain the current moment's , and ; Among them, the coefficient adjustment model is: (8); Among them, , and are the proportional control coefficient, integral control coefficient, and derivative control coefficient of the PID control model at the previous moment, respectively. , and are the predicted proportional control coefficient, predicted integral control coefficient, and predicted derivative control coefficient of the PID control model at the current moment, respectively. is the adjustment factor.
6. The method according to claim 5, wherein , and are obtained by the following method: Obtain the chemical dosing amounts of the dosing system at all historical moments before the current moment to obtain a chemical dosing sample set; Obtain the actual error and the prediction error of the chemical dosing sample set through the random forest algorithm; Based on the actual error and the prediction error, obtain the mixed error of the chemical dosing sample set; Based on the hybrid error and proportional coefficient calculation model, obtain the predicted proportional control coefficient of the PID control model at the current moment , the predicted integral control coefficient and the predicted derivative control coefficient .
7. The method according to claim 6, wherein The mixed error of the chemical dosing sample set is represented by the following formula: (9); Among them, is the mixed error, is the actual error, is the predicted error, is the actual error weight, is the predicted error weight, .
8. The method according to claim 7, wherein The proportional coefficient calculation model is represented by the following formula: (10); (11); (12); Among them, , and are respectively the predicted proportional control coefficient, the predicted integral control coefficient, and the predicted derivative control coefficient of the PID control model at the previous moment of the current moment, is the mixed error at the previous moment of the current moment, is the time variable.
9. A chemical dosing control system, characterized in that, It includes: A data acquisition unit for obtaining the dosing system data at the current moment. The dosing system data includes the measured value of orthophosphate in water quality, the target value of orthophosphate in water quality, the influent flow rate data, the return flow rate data, and the actual chemical dosing flow rate; A first calculation unit for obtaining the chemical dosing deviation based on the measured value of orthophosphate in water quality and the target value of orthophosphate in water quality; A second calculation unit for obtaining the chemical dosing correction deviation based on the chemical dosing deviation and the chemical dosing correction deviation model; A third calculation unit for obtaining the chemical dosing unit consumption adjustment value based on the chemical dosing correction deviation and the chemical dosing unit consumption adjustment model; A result calculation unit for obtaining the current chemical dosing amount at the current moment based on the chemical dosing unit consumption adjustment value, the initial chemical dosing unit consumption, the chemical dosing point flow rate, and the chemical dosing calculation model; Among them, the chemical dosing calculation model is represented by the following formula: (1); Among them, is the current dosing amount of the chemical agent, is the dosing flow rate of the chemical agent, is the flow rate at the dosing point, is the metal concentration of the chemical agent; Among them, is expressed by the following formula: (2); Among them, is the single consumption of chemical agent addition, which is expressed by the following formula: (3); Among them, is expressed by the following formula: (4); Among them, is the influent flow rate data, the return flow rate data, the initial chemical dosage; is the adjustment value of the unit chemical consumption.
10. An electronic device, characterized in that, The electronic device includes: A processor; A memory for storing the executable instructions that can be executed by the processor; The processor is used to read the executable instructions from the memory and execute the executable instructions to implement the method described in any one of claims 1 to 8 above.