Pesticide pollution treatment control method and system based on Internet of Things

Through IoT sensors and intelligent optimization algorithms, the process parameters of the agricultural pollution treatment system are adjusted in real time, which solves the problem of untimely parameter adjustment in rural sewage treatment, and improves the treatment efficiency and effect.

CN120406163AInactive Publication Date: 2025-08-01HUZHOU HENGSHITONG ENVIRONMENTAL ENGINEERING CO LTD

Patent Information

Application Number
CN202510897656.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-01
Publication Date
2025-08-01
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

The existing agricultural pollution treatment system cannot adjust the process parameters in a timely manner, resulting in a reduction in treatment efficiency and effect, especially when rural sewage discharge is irregular and has large instantaneous changes.

Method used

Sewage water quality data is collected through IoT sensors, pretreatment is performed using time series analysis and long-term and short-term memory neural network model to predict future water quality changes, build a multi-objective optimization model and use particle swarm optimization algorithm to solve it, obtain the optimal process parameters, and adjust the operating status of the sewage treatment system in real time.

Benefits of technology

It realizes dynamic adjustment of treatment process parameters based on water quality index data, improves the efficiency and effect of agricultural pollution treatment, ensures that the water effluent meets standards and reduces the instability of equipment operation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120406163A_ABST
    Figure CN120406163A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of information, and discloses an agricultural sewage treatment control method and system based on the Internet of Things, and the method comprises the steps: obtaining sewage water quality data in different time periods, and carrying out the preprocessing of the data, and obtaining standard water quality data; extracting time sequence data of the water quality indexes from the water quality indexes, and obtaining smoothed time sequence data by using a time sequence analysis method; according to the smoothed time sequence data, through a trained long-short-term memory neural network model, obtaining prediction data of a future time sequence of the water quality index; according to the prediction data, constructing an objective function of an optimization problem so as to establish a multi-objective optimization model; solving the multi-objective optimization model by adopting a particle swarm optimization algorithm to obtain an optimal combination of process parameters; and converting the optimal combination into a control instruction, issuing the control instruction to execution equipment of the sewage treatment system, and controlling the operation state of the execution equipment. According to the method, the process parameters can be adjusted in time, and the efficiency and the effect of agricultural pollution treatment are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of agricultural sewage treatment, and particularly to an agricultural sewage treatment control method and system based on the Internet of Things. Background Art

[0002] In the prior art, an agricultural sewage treatment control method is to deploy sensors and intelligent devices in sewage treatment facilities to monitor key parameters such as influent water quality, aeration demand, and equipment operation status in real time. The system automatically adjusts operations such as aeration volume, chemical dosage, and return treatment according to preset control strategies to ensure that the sewage treatment effect reaches the best state. However, rural sewage discharges irregularly and changes instantaneously, and a single preset control strategy is difficult to accurately adapt to these changes, resulting in the inability to timely adjust key process parameters such as aeration volume and chemical dosage, reducing the efficiency of agricultural sewage treatment.

[0003] In summary, in the existing agricultural sewage treatment process, process parameters cannot be adjusted in a timely manner, resulting in a reduction in the treatment effect and efficiency of agricultural sewage. Summary of the Invention

[0004] The present invention provides an agricultural sewage treatment control method and system based on the Internet of Things to realize the adjustment of treatment process parameters and improve the efficiency and effect of agricultural sewage treatment.

[0005] In a first aspect, to solve the above technical problems, the present invention provides an intelligent scheduling method for a vehicle-mounted mobile charging system, including: Obtaining sewage water quality data for different time periods; Preprocessing the sewage water quality data to obtain standard sewage water quality data; Extracting time series data of water quality indicators from the standard sewage water quality data, and performing smoothing processing through a time series analysis method to obtain the smoothed time series data; wherein, the water quality indicators include chemical oxygen demand, ammonia nitrogen, total phosphorus, and total nitrogen; According to the smoothed time series data, through a trained long short-term memory neural network model, obtaining prediction data of the future time series of water quality indicators; According to the prediction data, setting pollutant emission concentration limits and sludge concentration limits as constraint conditions, constructing an objective function for an optimization problem, and thus establishing a multi-objective optimization model; Using a particle swarm optimization algorithm to solve the multi-objective optimization model to obtain an optimal combination of process parameters; wherein, the process parameters include aeration volume, chemical dosage, and sludge return ratio; Converting the optimal combination into a control instruction and sending it to the execution device of the sewage treatment system to control the operation status of the execution device.

[0006] In an alternative embodiment, the preprocessing of the sewage water quality data to obtain standard sewage water quality data includes: Perform wavelet decomposition on the sewage water quality data to obtain high-frequency components, and determine whether the high-frequency components exceed a preset high-frequency threshold; When the high-frequency components exceed the preset high-frequency threshold, perform filtering to obtain denoised water quality data; Obtain the data points before and after the missing values in the denoised water quality data, and fill them using linear interpolation according to the numerical change trend of the data points before and after to obtain complete sewage water quality data; Use the isolation forest algorithm to detect the complete sewage water quality data, obtain an anomaly score, and determine whether the anomaly score exceeds a preset anomaly score threshold; When the anomaly score exceeds the preset anomaly score threshold, perform correction processing to obtain standard sewage water quality data.

[0007] In an alternative embodiment, the extraction of the time series data of the water quality indicators from the standard sewage water quality data and the smoothing through the time series analysis method to obtain the smoothed time series data, where the water quality indicators include chemical oxygen demand, ammonia nitrogen, total phosphorus, and total nitrogen, includes: Extract the time series data of the water quality indicators from the standard sewage water quality data, and use the exponential smoothing method to smooth the time series data to obtain the smoothed time series data.

[0008] In an alternative embodiment, the obtaining of the predicted data of the future time series of the water quality indicators based on the smoothed time series data through a trained long short-term memory neural network model includes: Construct a long short-term memory neural network model, set the time step and the number of neurons, initialize the model parameters, and determine the network structure; Obtain historical sewage water quality data and divide it into training set data and test set data; Use the training set data to train the long short-term memory neural network model to obtain a trained prediction model; Use the test set data to verify the trained prediction model. If the prediction error exceeds the preset error threshold, adjust the model parameters and retrain until the prediction error meets the requirements; Based on the trained prediction model, input the smoothed time series data to obtain the predicted data of the future time series of the water quality indicators.

[0009] In an alternative embodiment, the setting of the pollutant emission concentration limit and the sludge concentration limit as constraint conditions according to the predicted data, constructing the objective function of the optimization problem, and thus establishing a multi-objective optimization model includes: Set the pollutant emission concentration limit and the sludge concentration limit as constraint conditions according to the predicted data; Construct an objective function based on the constraint conditions, with the pollutant emission concentration and the sludge concentration as the optimization objectives; Solve the objective function through a multi-objective optimization algorithm to obtain the optimal combination of the pollutant emission concentration and the sludge concentration; If the optimal combination meets the preset constraint conditions, establish a multi-objective optimization model using the objective function at this time; If the optimal combination does not meet the preset constraint conditions, adjust the constraint conditions and solve again until the optimal combination meets the preset constraint conditions.

[0010] In an alternative embodiment, the particle swarm optimization algorithm is used to solve the multi-objective optimization model to obtain the optimal combination of process parameters; wherein, the process parameters include the aeration rate, the chemical dosage, and the sludge return ratio, and it includes: Use the particle swarm optimization algorithm to pre-establish a particle coding method, determine the initial range of the particle position and velocity, and generate an initial particle swarm; Among them, particle coding represents the combination of the aeration rate, the chemical dosage, and the sludge return ratio to be optimized as the position of the particle, and the velocity of the particle represents the change direction and amplitude of the parameters; Calculate the fitness value of each particle according to the objective function and the constraint conditions, and judge whether the particle position meets the preset optimization objective according to the fitness value; If the particle position meets the preset optimization objective, record the current optimal solution; if the particle position does not meet the preset optimization objective, update the particle velocity and position, and recalculate the fitness value until it meets the preset optimization objective; Obtain the optimal combination of process parameters by iteratively updating the particle swarm, and judge whether it meets the requirements of the multi-objective optimization model; If the optimal combination meets the requirements of the multi-objective optimization model, output the optimal solution; if the optimal combination does not meet the requirements of the multi-objective optimization model, adjust the particle swarm initialization strategy and re-perform the optimization calculation until the requirements are met.

[0011] In an alternative embodiment, converting the optimal combination into a control instruction and sending it to the execution device of the sewage treatment system to control the operating state of the execution device includes: Call a preset instruction conversion function to convert the optimal combination data into a control instruction; Determine the adjustment values of the operating parameters of the aerator, the chemical dosing pump, and the sludge return pump according to the control instruction; Use a real-time data acquisition module to obtain the current operating state data of the execution device; Compare the adjusted value of the operating parameter with the current operating status data to determine whether there is a deviation; If there is a deviation, call the device control module and send an adjustment instruction to the aerator, chemical dosing pump, and sludge return pump.

[0012] In an optional implementation manner, after converting the optimal combination into a control instruction and sending it to the execution device of the sewage treatment system to control the operating status of the execution device, the method further includes: Use a real-time monitoring module to obtain the actual concentration values of chemical oxygen demand, ammonia nitrogen, total phosphorus, and total nitrogen in the effluent of the sewage treatment system; Call a preset model calculation module to obtain the predicted concentration values of chemical oxygen demand, ammonia nitrogen, total phosphorus, and total nitrogen; Calculate the deviation values of chemical oxygen demand, ammonia nitrogen, total phosphorus, and total nitrogen based on the actual concentration values and the predicted concentration values; Determine whether the deviation values of chemical oxygen demand, ammonia nitrogen, total phosphorus, and total nitrogen exceed a preset threshold; If the deviation value exceeds the preset threshold, re-collect the concentration values of chemical oxygen demand, ammonia nitrogen, total phosphorus, and total nitrogen; According to the re-collected water quality data, re-solve the optimal combination of process parameters, update the control instruction until the deviation does not exceed the preset deviation threshold when executing the control instruction.

[0013] In a second aspect, the present invention provides an agricultural sewage treatment control system based on the Internet of Things, mainly including: A data acquisition module for acquiring sewage water quality data at different time periods; A data preprocessing module for preprocessing the sewage water quality data to obtain standard sewage water quality data; A time series analysis module for extracting time series data of water quality indicators from the standard sewage water quality data and performing smoothing processing through a time series analysis method to obtain smoothed time series data; wherein, the water quality indicators include chemical oxygen demand, ammonia nitrogen, total phosphorus, and total nitrogen; A prediction module for obtaining predicted data of the future time series of water quality indicators through a trained long short-term memory neural network model based on the smoothed time series data; A model construction module for setting pollutant emission concentration limits and sludge concentration limits as constraint conditions based on the predicted data, constructing an objective function for an optimization problem, and thus establishing a multi-objective optimization model; A model solution module for solving the multi-objective optimization model using a particle swarm optimization algorithm to obtain the optimal combination of process parameters; wherein, the process parameters include aeration volume, chemical dosing amount, and sludge return ratio; An instruction issuing module, configured to convert the optimal combination into a control instruction and issue it to the execution device of the sewage treatment system to control the operating state of the execution device.

[0014] In a third aspect, the present invention also provides an electronic device, including a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor. When the processor executes the computer program, the above-mentioned Internet of Things-based rural sewage treatment control method is implemented.

[0015] Compared with the prior art, the present invention has the following beneficial effects: (1) The present invention collects sewage water quality data through Internet of Things sensors and preprocesses it, ensuring the accuracy of subsequent analysis and prediction.

[0016] (2) The present invention smooths time series data through a time series analysis method and uses a long short-term memory neural network model to predict future water quality changes based on the smoothed time series data, which helps to adjust treatment process parameters in advance to cope with water quality changes.

[0017] (3) The present invention establishes a multi-objective optimization model based on the water quality index prediction results and uses a particle swarm optimization algorithm to solve it, which helps to find the best treatment process parameters and improve treatment efficiency.

[0018] (4) While the execution device operates according to the optimized process parameters, the present invention also conducts real-time monitoring of sewage water quality data, thereby performing real-time dynamic adjustment of treatment process parameters, improving the efficiency and effect of rural sewage treatment.

[0019] In summary, the present invention can adjust treatment process parameters according to water quality index data, thereby updating the optimal control instruction, and at the same time improving the efficiency and effect of rural sewage treatment. Description of the Drawings

[0020] Figure 1 It is a flowchart of an Internet of Things-based rural sewage treatment control method of the present invention.

[0021] Figure 2 It is a schematic structural diagram of an Internet of Things-based rural sewage treatment control system of the present invention. Detailed Embodiments

[0022] Next, the technical solutions of the present invention will be clearly and completely described in conjunction with the embodiments. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all of the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.

[0023] Reference Figure 1 , a rural sewage treatment control method based on the Internet of Things in this embodiment includes the following steps: S1. Obtain sewage water quality data at different time periods; S2. Preprocess the sewage water quality data to obtain standard sewage water quality data; S3. Extract the time series data of water quality indicators from the standard sewage water quality data, and perform smoothing processing through time series analysis methods to obtain the smoothed time series data; among them, the water quality indicators include chemical oxygen demand, ammonia nitrogen, total phosphorus, and total nitrogen; S4. According to the smoothed time series data, obtain the predicted data of the future time series of water quality indicators through the trained long short-term memory neural network model; S5. According to the predicted data, set the pollutant emission concentration limit and sludge concentration limit as constraint conditions, construct the objective function of the optimization problem, and thus establish a multi-objective optimization model; S6. Use the particle swarm optimization algorithm to solve the multi-objective optimization model to obtain the optimal combination of process parameters; among them, the process parameters include aeration volume, chemical agent dosage, and sludge return ratio; S7. Convert the optimal combination into a control instruction and send it to the execution device of the sewage treatment system to control the operating state of the execution device.

[0024] In step S1, obtain sewage water quality data at different time periods.

[0025] Among them, collect the sewage water quality data of the sewage treatment system at different time periods through Internet of Things sensors; the sewage water quality data reflects the characteristics such as the pollutant content, physical properties, and chemical properties in the sewage. Common physical property indicators include temperature, turbidity, etc., and common chemical property indicators include chemical oxygen demand, ammonia nitrogen, total phosphorus, total nitrogen, etc.

[0026] Exemplarily, the intelligent collection of water quality data of the sewage treatment system is realized through Internet of Things sensors. The chemical oxygen demand sensor adopts the optical measurement principle and measures the content of organic matter in water by the absorption of light with a specific wavelength, and can monitor the change of organic matter concentration in sewage in real time. The ammonia nitrogen sensor adopts the ion selective electrode method and detects by measuring the potential difference generated by the ammonia nitrogen ion concentration. In the denitrification process, by controlling the aeration volume and reflux ratio, the influent ammonia nitrogen is reduced from 30 mg / L to below 5 mg / L. The sensor can adjust the process parameters in time according to the water quality change to ensure the denitrification effect. The total phosphorus monitoring adopts the colorimetric method principle and conducts on-line detection by using the phosphomolybdenum blue color reaction. In the phosphorus removal process, phosphorus removal agents are added to reduce the total phosphorus from 4 mg / L to 0.5 mg / L. The sensor data can guide the dosage of the agent, which not only ensures the effluent compliance but also avoids over-dosing. The total nitrogen sensor adopts the ultraviolet spectrophotometry method to monitor the denitrification effect in real time. By adjusting the operation time of the anaerobic, anoxic and aerobic sections, the total nitrogen is reduced from 40 mg / L to 15 mg / L. The sensor data reflects the denitrification effect and can adjust the process operation parameters in time. The data collected by these sensors are transmitted to the sewage treatment monitoring platform through the Internet of Things gateway to realize real-time monitoring and remote control. The platform can automatically adjust the process parameters such as aeration volume, reflux ratio, agent dosing, etc. according to the water quality change trend. The sensor layout positions include key nodes such as the inlet, biochemical pool, and effluent of the secondary sedimentation tank, forming a complete data monitoring network. By comparing the influent and effluent indexes of different process units, the treatment effect can be evaluated and the operation plan can be optimized. The system can also analyze the historical data, summarize the water quality change rules, and provide a basis for process improvement. This intelligent monitoring system significantly improves the automation level and operation efficiency of sewage treatment.

[0027] In step S2, the sewage water quality data is preprocessed to obtain standard sewage water quality data, including: Perform wavelet decomposition on the sewage water quality data to obtain high-frequency components, and judge whether the high-frequency components exceed a preset high-frequency threshold; When the high-frequency components exceed the preset high-frequency threshold, perform filtering processing to obtain denoised water quality data; Obtain the front and back data points of the missing values in the denoised water quality data, and fill them by using the linear interpolation method according to the numerical change trend of the front and back data points to obtain complete sewage water quality data; Use the isolation forest algorithm to detect the complete sewage water quality data, obtain the anomaly score, and judge whether the anomaly score exceeds a preset anomaly score threshold; When the anomaly score exceeds the preset anomaly score threshold, perform correction processing to obtain standard sewage water quality data.

[0028] Among them, wavelet decomposition is a time-frequency analysis method that can decompose sewage water quality data into sub-signals of different frequencies. First, apply wavelet decomposition technology to the collected sewage water quality data to decompose the data into different frequency components, including low-frequency components and high-frequency components. The low-frequency components usually contain the main trends of the data, while the high-frequency components contain the rapidly changing parts of the data, and these rapid changes are caused by noise. Then, set a high-frequency threshold to distinguish normal fluctuations from noise. If the analysis results show that the intensity of the high-frequency components exceeds this preset threshold, it is considered that these high-frequency components are mainly noise. Finally, filter these high-frequency components that exceed the threshold, such as setting the high-frequency coefficients that exceed the threshold to zero, or applying other filtering techniques to weaken the influence of these components.

[0029] In practical applications, when wavelet decomposition is to be performed on the chemical oxygen demand data of sewage, the high-frequency threshold can be set to five milligrams per liter. When the high-frequency components exceed this threshold, abnormal fluctuations are removed through filtering. For example, if the chemical oxygen demand concentration is 200 mg / L during a certain period, and the high-frequency component obtained through wavelet decomposition is 10 mg / L, which exceeds the high-frequency component threshold, the high-frequency component that exceeds the threshold will be set to zero or weakened, thereby smoothing the data.

[0030] Regarding the problem of missing data, linear interpolation is a practical repair method. First, identify the positions of the missing values in the sewage water quality data, and then obtain the data points before and after these missing values. By analyzing the values of these data points before and after, determine the trend of data change. Then, apply the linear interpolation method, which assumes that the data changes linearly between two known points before and after, so as to calculate the values that the missing positions should have. Using the linear interpolation method, fill in the data during the missing period to make the data curve smoother and more continuous. Among them, the calculation formula of the linear interpolation method is as follows:

[0031] In the formula, represents the interpolation result at time t, and respectively represent the values of two known data points before and after the missing data, and t1 and t2 respectively represent the times corresponding to these two data points.

[0032] Exemplarily, assume that there is a set of sewage chemical oxygen demand (COD) data arranged in chronological order, and the data at a certain time point is missing. The known data points are as follows: at time point t1 = 1 hour, the COD value is 120 mg / L; at time point t3 = 3 hours, the COD value is 160 mg / L. Through the linear interpolation method, it can be calculated that at t2 = 2 hours, the COD value is 140 mg / L.

[0033] The isolation forest algorithm identifies outliers by calculating the degree of anomaly in a data point. When processing sewage quality data, the isolation forest algorithm was used to detect the data. The algorithm first obtained an anomaly score for each data item. The anomaly score was determined by calculating the average path length of the data point across all trees. In an isolation forest, the construction process of each tree can be viewed as gradually separating data points through random partitioning in multidimensional space. The path length h(x) refers to the number of partitions required from the root node to isolate the data point x.

[0034] The calculation formula for the anomaly score is as follows:

[0035] Where, represents the abnormality score, represents the average path length of data point x, Indicates the average path length correction factor when the data size is n.

[0036] It should be noted that the closer the score is to 1, the more likely it is an outlier; the closer the score is to 0, the more likely it is a normal point. The isolation forest algorithm constructs an isolation tree by randomly selecting features and segmentation values to identify outliers in the data. Next, determine whether these anomaly scores exceed the preset anomaly score threshold. When the anomaly score exceeds the preset anomaly score threshold, it indicates that these data items may be outliers; illustratively, the preset anomaly score threshold can be set to 0.8. At this time, correction processing is performed, such as using the mean, median or model-based method to replace these outliers, thereby obtaining standard sewage water quality data. When the anomaly score does not exceed the preset anomaly score threshold, it indicates that these data items are normal, and are directly output as standard water quality data. This process helps to improve the overall quality and reliability of the data set, and provides a more accurate basis for subsequent data analysis and model building.

[0037] In step S3, time series data of water quality indicators are extracted from the standard sewage quality data, and smoothed by a time series analysis method to obtain smoothed time series data; wherein the water quality indicators include chemical oxygen demand, ammonia nitrogen, total phosphorus, and total nitrogen, including: Time series data of water quality indicators are extracted from the standard sewage quality data, and the time series data are smoothed using an exponential smoothing method to obtain smoothed time series data.

[0038] It's important to note that exponential smoothing is a commonly used technique for processing time series data. It smooths data fluctuations by assigning different weights to data from different periods. In wastewater treatment, this method can effectively eliminate random fluctuations in water quality indicators and highlight long-term trends.

[0039] Taking the chemical oxygen demand (COD) index as an example, when extracting the time series from the pre-treated sewage water quality data, it is first necessary to determine an appropriate time interval. In practical applications, sampling can be carried out once per hour to construct continuous time series data. The extracted data contains the specific values of COD at different time points, which reflect the changes in the organic matter content during the sewage treatment process. When selecting the smoothing coefficient, it needs to be adjusted according to the actual situation. A larger smoothing coefficient will make the smoothing result closer to the actual observed value, while a smaller smoothing coefficient will produce a smoother trend line. For example, when processing the COD data, when the smoothing coefficient is set to 0.3, it can better balance the sensitivity and stability of the data. The original data shows that the COD fluctuates within a range of 200 to 400 mg / L within a day. After exponential smoothing processing, the overall change trend is more clearly shown.

[0040] The treatment of the ammonia nitrogen index is also a typical case. During the treatment process, the original data may fluctuate due to equipment errors or environmental factors. By extracting the data at different time points to form a time series, the application of the exponential smoothing method can effectively reduce the impact of these fluctuations. When the smoothing coefficient is set to 0.4, it can retain the important features of the data while eliminating short-term fluctuations. The processed data more clearly reflects the change law of the ammonia nitrogen concentration, which helps to adjust the process parameters in a timely manner.

[0041] The treatment of the total phosphorus index reflects the application value of the exponential smoothing method on different time scales. Considering that the change of the total phosphorus concentration is relatively slow, a smaller smoothing coefficient such as 0.2 can be adopted, which can better reflect the long-term change trend.

[0042] In step S4, according to the smoothed time series data, through the trained long short-term memory neural network model, the predicted data of the future time series of the water quality index is obtained, including: Construct a long short-term memory neural network model, set the time step and the number of neurons, initialize the model parameters, and determine the network structure; Obtain the historical sewage water quality data and divide it into training set data and test set data; Use the training set data to train the long short-term memory neural network model to obtain a trained prediction model; Use the test set data to verify the trained prediction model. If the prediction error exceeds the preset error threshold, adjust the model parameters and retrain until the prediction error meets the requirements; Based on the trained prediction model, input the smoothed time series data to obtain the predicted data of the future time series of the water quality index.

[0043] It should be noted that for the application of the long short-term memory neural network model in water quality prediction, it is first necessary to reasonably construct the network structure. Taking the prediction of chemical oxygen demand as an example, the model can be set with a three-layer network structure. The input layer receives the historical data of the previous seven days, the hidden layer is set with 64 neurons, and the output layer predicts the values for the next three days. Considering the periodic change characteristics of the sewage water quality, it is more appropriate to select one day as the time step. In terms of data division, the water quality monitoring data for two years can be divided into a training set and a test set according to a ratio of seven to three. Taking the actual operation data of a certain rural sewage treatment as an example, the historical data of chemical oxygen demand shows that its change range is between 200 and 400 milligrams per liter. To ensure the training effect of the model, it is necessary to normalize the data. The training set data contains 500 consecutive sample points, and the test set data contains 200 sample points. During the model training process, the learning rate is initially set to 0.01, the batch size is selected as 16, and the number of training epochs is 200.

[0044] Exemplarily, when the prediction error threshold is set to 10%, after about 150 epochs of training, the prediction error of the model begins to stabilize below the threshold. If the prediction error exceeds the threshold, the model performance can be optimized by adjusting the number of neurons or changing the learning rate. The construction of the prediction model for the ammonia nitrogen index also follows a similar principle. Considering that the ammonia nitrogen concentration is significantly affected by temperature, in addition to the historical concentration data, the temperature data can also be added as an auxiliary feature to the input layer of the model. It is worth noting that this multi-feature input method can improve the prediction accuracy of the model. For example, the ammonia nitrogen concentration fluctuates between 20 and 40 milligrams per liter, and the model can better capture this change pattern after training. Since the changes in the two indicators of total phosphorus and total nitrogen are relatively slow, a longer time step, such as three days, can be adopted for the prediction model. In the model verification stage, two indicators, namely the root mean square error and the mean absolute error, can be used to comprehensively evaluate the model performance. When the prediction error is controlled within 8%, the prediction results of the model can better reflect the change trends of these two indicators. Based on the trained model, by inputting the latest water quality data, the future water quality change trend can be predicted. The prediction results can be presented in the form of a curve graph, including the predicted values and confidence intervals of each indicator. This visualization method intuitively shows the change trends of water quality indicators and helps to detect potential water quality anomalies in a timely manner.

[0045] In step S5, according to the prediction data, set the pollutant emission concentration limit and the sludge concentration limit as constraint conditions, and construct the objective function of the optimization problem, thereby establishing a multi-objective optimization model, including: According to the prediction data, set the pollutant emission concentration limit and the sludge concentration limit as constraint conditions; According to the constraint conditions, construct the objective function, and the objective function takes the pollutant emission concentration and the sludge concentration as the optimization objectives; Solve the objective function through a multi-objective optimization algorithm to obtain the optimal combination of pollutant emission concentration and sludge concentration; If the optimal combination meets the preset constraint conditions, establish a multi-objective optimization model using the objective function at this time; If the optimal combination does not meet the preset constraint conditions, adjust the constraint conditions and solve again until the optimal combination meets the preset constraint conditions.

[0046] Among them, the multi-objective optimization of the sewage treatment system requires reasonable setting of constraint conditions and objective functions. For main pollutants such as chemical oxygen demand, ammonia nitrogen, and total phosphorus, the emission limits can be set according to the emission standards and actual operating conditions. In typical constraint condition settings, the chemical oxygen demand does not exceed 50 milligrams per liter, the ammonia nitrogen does not exceed 5 milligrams per liter, and the total phosphorus does not exceed 0.5 milligrams per liter. The control of sludge concentration is crucial for the stable operation of the system. Generally, the mixed liquor suspended solids concentration is controlled between 3,000 and 5,000 milligrams per liter. The construction of the objective function needs to consider both pollutant emission concentration and sludge concentration. Taking the requirements of a certain sewage treatment as an example, the effluent water quality objective can be set as the minimum deviation between the main pollutant concentration and the emission standard, and the sludge concentration objective can be set as maintaining within the optimal process control range. There is a certain competitive relationship between these two objectives because a higher sludge concentration is beneficial to improving the treatment efficiency but will increase the sludge disposal burden at the same time.

[0047] In the process of multi-objective optimization solution, the non-dominated sorting genetic algorithm can be used. This algorithm evolves the population through genetic operations such as selection, crossover, and mutation, and at the same time introduces crowding degree calculation to maintain the diversity of solutions and avoid the algorithm converging to a local optimal solution prematurely. This algorithm is particularly suitable for dealing with optimization problems with conflicting objectives and can effectively find a set of balanced solutions. This algorithm can quickly search for the optimal solution set while ensuring the diversity of the population.

[0048] Taking actual operational data from a wastewater treatment plant as an example, the initial population was set to 200 individuals, and the number of evolutionary generations was 500. Through crossover and mutation operations, the algorithm converged to a good solution set after approximately 300 generations. Selecting the optimal combination requires comprehensive consideration of multiple factors. If the optimal solution meets the pollutant emission concentration limits, including chemical oxygen demand (COD) less than 40 mg / L, ammonia nitrogen less than 4 mg / L, and total phosphorus less than 0.4 mg / L, and maintains a sludge concentration of approximately 4,000 mg / L, the solution is considered feasible. If certain indicators exceed the constraints, the constraints need to be appropriately relaxed and re-optimized. For example, the COD limit could be adjusted to 45 mg / L, or the sludge concentration range could be expanded to 3,500 to 4,500 mg / L. In practical applications, the implementation of optimization results also needs to consider the feasibility of process adjustments. For example, for a treatment capacity of 50,000 tons per day, the optimization model recommends increasing the sludge concentration from 3,500 mg / L to 4,000 mg / L, while also appropriately extending the aeration time. This adjustment plan not only ensures that the water output meets standards but also reduces energy consumption. Tracking and monitoring revealed that the adjusted operating status can be maintained stably, and all indicators are superior to the original plan. This demonstrates the practical applicability of the results of the multi-objective optimization model.

[0049] In step S6, the particle swarm optimization algorithm is used to solve the multi-objective optimization model to obtain the optimal combination of process parameters; wherein the process parameters include aeration rate, reagent dosage and sludge return ratio, including: Using the particle swarm optimization algorithm, the particle encoding method is pre-established, the initial range of particle position and velocity is determined, and the initial particle swarm is generated; Among them, particle coding is to express the combination of aeration volume, chemical dosage and sludge return ratio to be optimized as the position of the particle, and the velocity of the particle represents the direction and amplitude of the parameter change; According to the objective function and constraints, the fitness value of each particle is calculated, and the fitness value is used to determine whether the particle position meets the preset optimization goal; If the particle position meets the preset optimization goal, the current optimal solution is recorded; if the particle position does not meet the preset optimization goal, the particle speed and position are updated, and the fitness value is recalculated until the preset optimization goal is met; By iteratively updating the particle swarm, the optimal process parameter combination is obtained to determine whether it meets the requirements of the multi-objective optimization model; If the optimal combination meets the requirements of the multi-objective optimization model, the optimal solution is output; if the optimal combination does not meet the requirements of the multi-objective optimization model, the particle swarm initialization strategy is adjusted and the optimization calculation is re-performed until the requirements are met.

[0050] It should be noted that the particle coding adopts the real number coding method. The operating parameters of aeration rate, chemical dosage, and sludge return ratio are used as variables to be optimized, and each particle represents a potential solution. The application of the particle swarm optimization algorithm in the sewage treatment system requires scientific and reasonable setting of parameters and initial conditions. Taking a certain sewage treatment as an example, the value range of the aeration rate is set between 100 and 300 cubic meters per hour, the chemical dosage range is 0.5 to 2 grams per cubic meter, and the sludge return ratio range is 30% to 80%. In the initialization of particle positions and velocities, in order to ensure the uniformity of the search space, a random uniform distribution is used to generate the initial particle swarm. For a sewage treatment system with a scale of 100,000 tons per day, the initial particle swarm size is set to 50, and the maximum number of iterations is 200. The upper limit of the velocity of each particle is set to 20% of the corresponding variable range, which can maintain a good search ability while ensuring convergence.

[0051] The calculation of the fitness value needs to consider two aspects: pollutant emission concentration and sludge concentration. It is calculated by weighted calculation of pollutant emission concentration and sludge concentration. The weight is used to balance the contribution of the objective function and can be adjusted according to the situation. The pollutant emission concentration evaluation indicators include the concentrations of pollutants such as chemical oxygen demand, ammonia nitrogen, and total phosphorus. According to the obtained fitness value, it is judged whether the position of the particle meets the preset optimization goal, that is, the obtained fitness value is compared with the preset fitness value threshold. Exemplarily, the fitness threshold can be set to 100; when the obtained fitness value does not exceed the preset fitness threshold, it is determined that the particle position meets the optimization goal. If the position of the particle meets the optimization goal, it is recorded as the current optimal solution. If the particle position does not meet the preset optimization goal, the particle velocity and position are updated, and the fitness value is recalculated until the preset optimization goal is met; In the process of updating the particle position, an inertia weight is introduced to balance the global search and local search capabilities. The inertia weight decreases with the number of iterations, with an initial value of 0.9 and a final value of 0.4. This dynamic adjustment strategy enables the algorithm to have a strong global search ability in the initial stage and pay more attention to local fine search in the later stage. Through multiple update iterations, it gradually approaches the optimal solution that can meet the requirements of the multi-objective optimization model; among them, meeting the requirements of the multi-optimization model not only needs to meet the optimization goal but also needs to meet the constraint conditions. If the solution after update iteration does not meet the requirements of the multi-objective optimization model, it is necessary to adjust the initialization strategy of the particle swarm (such as resetting the initial position range, adjusting the weight, etc.) and re-perform the optimization calculation.

[0052] Among them, there is an obvious correlation between the aeration rate and the sludge return ratio. A higher sludge return ratio is beneficial to improving the biological treatment efficiency, but it is necessary to correspondingly increase the aeration rate to maintain a sufficient dissolved oxygen level. It should be noted that when the sludge return ratio is controlled between 50% and 60%, the system operates relatively stably. At this time, the corresponding optimal aeration rate is about 200 cubic meters per hour, and the chemical phosphorus removal agent dosage is 1.2 grams per cubic meter. During operation, the optimized system operates well, and all the effluent indicators meet the standards stably. The combination of the obtained aeration rate, agent dosage, and sludge return ratio meets the requirements of the multi-objective optimization model, which indicates that the particle swarm optimization algorithm can effectively solve the multi-objective optimization problem of the sewage treatment system.

[0053] In step S7, convert the optimal combination into a control instruction and send it to the execution device of the sewage treatment system to control the operating state of the execution device, including: Call the preset instruction conversion function to convert the optimal combination data into a control instruction; According to the control instruction, determine the adjustment values of the operating parameters of the aerator, chemical dosing pump, and sludge return pump; Use the real-time data acquisition module to obtain the current operating state data of the execution device; Compare the adjustment values of the operating parameters with the current operating state data to determine whether there is a deviation; If there is a deviation, call the device control module and send an adjustment instruction to the aerator, chemical dosing pump, and sludge return pump.

[0054] Among them, the instruction conversion function in the sewage treatment system converts the parameters obtained by the optimization algorithm into specific device control instructions. Taking the actual required air volume of 200 cubic meters per hour for the aeration rate as an example, the system needs to convert it into the operating frequency instruction of the aerator. Assuming the rated air volume of the aerator is 500 cubic meters per hour, the corresponding operating frequency should be set to 40%. The operating frequency is determined by the ratio of the actual required air volume to the rated air volume and is expressed as a percentage. Similarly, if the chemical phosphorus removal agent dosage is 1.2 grams per cubic meter and the rated flow rate of the chemical dosing pump is 5 liters per hour, the system will calculate that the operating frequency of the chemical dosing pump is 35%. When the sludge return ratio is set to 55%, the system needs to combine the current influent flow rate and convert it into the operating frequency of the sludge return pump.

[0055] The establishment of control instructions needs to consider the operating characteristics and safety limits of the equipment. Taking the aeration system as an example, when the dissolved oxygen concentration measured by the on-line dissolved oxygen meter is 2 mg / L, the system will calculate the required operating frequency adjustment amount of the aerator according to the preset dissolved oxygen control curve. The dosing system needs to dynamically adjust the dosing amount according to the changes in the influent water quality indicators. For example, when the total phosphorus concentration in the influent water increases, the system automatically increases the dosing amount. The equipment control module executes the instructions in a gradient adjustment manner. For example, when the operating frequency of the aerator needs to be increased from 40% to 50%, the control system will adjust it step by step in five times, increasing by 2% each time, with a three-minute interval between each adjustment to avoid violent fluctuations in the system. In the control of the dosing system, if it is detected that the total phosphorus in the effluent is on the high side, the system will gradually increase the dosing amount, with the increase amplitude not exceeding 5% of the current value each time.

[0056] The deviation judgment of operating parameters needs to consider measurement errors and system response time. The practice of a certain sewage treatment shows that the allowable fluctuation range of dissolved oxygen is ±15% of the target value. If it exceeds this range, an adjustment instruction will be triggered. The adjustment of the sludge return ratio needs to consider the change trend of the sludge concentration. When the sludge concentration in the sedimentation tank continues to increase, the system will appropriately increase the return ratio, with the adjustment amplitude controlled within 5% each time to ensure the stable operation of the biochemical system.

[0057] After step S7, the method further includes: Using a real-time monitoring module to obtain the actual concentration values of chemical oxygen demand, ammonia nitrogen, total phosphorus, and total nitrogen in the effluent of the sewage treatment system; Invoking a preset model calculation module to obtain the predicted concentration values of chemical oxygen demand, ammonia nitrogen, total phosphorus, and total nitrogen; Calculating the deviation values of chemical oxygen demand, ammonia nitrogen, total phosphorus, and total nitrogen according to the actual concentration values and the predicted concentration values; Judging whether the deviation values of chemical oxygen demand, ammonia nitrogen, total phosphorus, and total nitrogen exceed the preset deviation threshold; If the deviation value exceeds the preset deviation threshold, re-collect the concentration values of chemical oxygen demand, ammonia nitrogen, total phosphorus, and total nitrogen; According to the re-collected water quality data, re-solve the optimal combination of process parameters, update the control instructions until the deviation does not exceed the preset deviation threshold when the control instructions are executed.

[0058] It should be noted that the real-time monitoring module is a key component of the sewage treatment system, which continuously collects the effluent water quality data through on-line analyzers. These on-line analyzers collect data every thirty minutes to ensure the real-time nature of the monitoring data. The deviation calculation is carried out by comparing the measured value with the predicted value. The warning thresholds set for a certain sewage treatment are as follows: the deviation of chemical oxygen demand does not exceed 15%, the deviation of ammonia nitrogen does not exceed 20%, the deviation of total phosphorus does not exceed 10%, and the deviation of total nitrogen does not exceed 15%. When the measured chemical oxygen demand of the effluent is fifty milligrams per liter and the predicted value is forty milligrams per liter, the deviation rate is 25%, exceeding the threshold and triggering a warning.

[0059] Threshold judgment needs to consider the importance degree and fluctuation characteristics of water quality indicators. As the main assessment indicators, the thresholds of chemical oxygen demand and ammonia nitrogen are set relatively strictly. It has been found in practice that when the deviation of ammonia nitrogen exceeds the threshold, it is often related to the abnormal operation of the aeration system. For example, when the measured value of ammonia nitrogen is three milligrams per liter and the predicted value is two milligrams per liter, the system automatically increases the aeration volume. The data review mechanism verifies abnormal data through repeated sampling. When it is found that the deviation of total phosphorus exceeds the threshold, the system continuously collects data three times within ten minutes. If all three data show excessive deviation, it indicates that there is indeed an abnormal treatment effect and the process parameters need to be adjusted in time. Once an abnormality is found, the system immediately starts the optimization calculation to generate new control instructions.

[0060] The update of control instructions adopts a progressive method to avoid drastic fluctuations in parameters. When it is detected that the total nitrogen removal effect decreases, the system first increases the internal reflux ratio and at the same time slightly adjusts the aeration volume, continuously tracking the changes in the effluent indicators. Practice shows that through this method, while ensuring the treatment effect, the stable operation of the system can be maintained. The complete feedback adjustment process usually takes six to eight hours, during which the system continuously monitors various indicators until the deviation falls back within the threshold range.

[0061] For the convenience of understanding the present invention, some preferred embodiments of the present invention will be further described below.

[0062] In this embodiment, a rural sewage treatment system needs to optimize the aeration volume, chemical agent dosage, and sludge reflux ratio to ensure that the effluent water quality meets the standards and at the same time improve the treatment efficiency. The working process is as follows: Step 1: Obtain the sewage water quality data in different time periods; Step 2: Pretreat the sewage water quality data to obtain the standard sewage water quality data; Step 3: Extract the time series data of water quality indicators from the standard sewage water quality data, and perform smoothing processing through the time series analysis method to obtain the smoothed time series data; among them, the water quality indicators include chemical oxygen demand, ammonia nitrogen, total phosphorus, and total nitrogen; Step 4: Based on the smoothed time series data, obtain the predicted data of the future time series of water quality indicators through the trained long short-term memory neural network model; Step 5: According to the predicted data, set the pollutant emission concentration limit and the sludge concentration limit as constraint conditions, construct the objective function of the optimization problem, and thus establish a multi-objective optimization model; Step 6: Use the particle swarm optimization algorithm to solve the multi-objective optimization model to obtain the optimal combination of process parameters; among them, the process parameters include aeration volume, chemical agent dosage, and sludge return ratio; Step 7: Convert the optimal combination into a control instruction and send it to the execution device of the sewage treatment system to control the operating state of the execution device.

[0063] Referring to Figure 2 , the present invention provides an agricultural sewage treatment control system based on the Internet of Things, mainly including: A data acquisition module for acquiring sewage water quality data at different time periods; A data preprocessing module for preprocessing the sewage water quality data to obtain standard sewage water quality data; A time series analysis module for extracting the time series data of water quality indicators from the standard sewage water quality data and performing smoothing processing through a time series analysis method to obtain the smoothed time series data; among them, the water quality indicators include chemical oxygen demand, ammonia nitrogen, total phosphorus, and total nitrogen; A prediction module for obtaining the predicted data of the future time series of water quality indicators through the trained long short-term memory neural network model based on the smoothed time series data; A model construction module for setting the pollutant emission concentration limit and the sludge concentration limit as constraint conditions according to the predicted data, constructing the objective function of the optimization problem, and thus establishing a multi-objective optimization model; A model solving module for using the particle swarm optimization algorithm to solve the multi-objective optimization model to obtain the optimal combination of process parameters; among them, the process parameters include aeration volume, chemical agent dosage, and sludge return ratio; An instruction sending module for converting the optimal combination into a control instruction and sending it to the execution device of the sewage treatment system to control the operating state of the execution device.

[0064] It should be noted that the agricultural sewage treatment control system based on the Internet of Things provided in the embodiment of the present invention is used to execute all the process steps of the agricultural sewage treatment control method based on the Internet of Things in the above embodiment, and their working principles and beneficial effects correspond one by one, so they will not be elaborated here.

[0065] An embodiment of the present invention further provides an electronic device. The electronic device includes: a processor, a memory, and a computer program stored in the memory and executable on the processor, such as an agricultural sewage treatment control program based on the Internet of Things. When the processor executes the computer program, the steps in each of the above-described method embodiments of the agricultural sewage treatment control system based on the Internet of Things are implemented, such as Figure 1 the step S1 shown. Alternatively, when the processor executes the computer program, the functions of each module / unit in each of the above-described device embodiments are implemented, such as the model solving module.

[0066] Exemplarily, the computer program may be divided into one or more modules / units, and the one or more modules / units are stored in the memory and executed by the processor to complete the present invention. The one or more modules / units may be a series of computer program instruction segments capable of performing specific functions, and the instruction segments are used to describe the execution process of the computer program in the electronic device.

[0067] The electronic device may be a computing device such as a desktop computer, a notebook, a palm computer, and a smart tablet. The electronic device may include, but is not limited to, a processor and a memory. Those skilled in the art can understand that the above components are merely examples of the electronic device and do not constitute a limitation on the electronic device. The electronic device may include more or fewer components than the above, or combine some components, or different components. For example, the electronic device may further include an input / output device, a network access device, a bus, etc.

[0068] The so-called processor may be a central processing unit (CPU), or may also be other general-purpose processors, digital signal processors (DSPs), application specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc. The processor is the control center of the electronic device and connects various parts of the entire electronic device through various interfaces and lines.

[0069] The memory can be used to store the computer program and / or modules. By running or executing the computer program and / or modules stored in the memory, and invoking the data stored in the memory, the processor can implement various functions of the electronic device. The memory mainly includes a program storage area and a data storage area. Among them, the program storage area can store an operating system, application programs required for at least one function (such as a sound playback function, an image playback function, etc.); the data storage area can store data created according to the use of the mobile phone (such as audio data, phone book, etc.). In addition, the memory can include high-speed random access memory, and can also include non-volatile memory, such as a hard disk, memory, plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, at least one magnetic disk storage device, flash memory device, or other volatile solid-state storage devices.

[0070] Among them, if the modules / units integrated in the electronic device are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on such an understanding, to implement all or part of the processes in the above-mentioned embodiment methods of the present invention, it can also be completed by a computer program instructing relevant hardware. The computer program can be stored in a computer-readable storage medium. When the computer program is executed by the processor, the steps of the above-mentioned various method embodiments can be implemented. Among them, the computer program includes computer program code, and the computer program code can be in the form of source code, object code, executable file, or some intermediate form, etc. The computer-readable medium can include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disc, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signal, telecommunication signal, and software distribution medium, etc. It should be noted that the content included in the computer-readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, the computer-readable medium does not include electrical carrier signals and telecommunication signals.

[0071] It should be noted that the device embodiments described above are merely illustrative. 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 distributed to multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment. In addition, in the attached drawings of the device embodiments provided by the present invention, the connection relationship between the modules indicates that there is a communication connection between them, which can be specifically implemented as one or more communication buses or signal lines. Those of ordinary skill in the art can understand and implement it without creative efforts.

[0072] The above-disclosed are only the preferred embodiments of the present invention. Of course, the scope of the rights of the present invention cannot be limited thereby. Those of ordinary skill in the art can understand all or part of the processes of implementing the above embodiments, and the equivalent changes made according to the claims of the present invention still fall within the scope covered by the present invention.

Claims

1. An agricultural sewage treatment control method based on the Internet of Things, characterized in that, The method includes: Obtaining sewage water quality data for different time periods; Preprocessing the sewage water quality data to obtain standard sewage water quality data; Extracting the time series data of water quality indicators from the standard sewage water quality data, and performing smoothing processing through time series analysis methods to obtain the smoothed time series data; wherein, the water quality indicators include chemical oxygen demand, ammonia nitrogen, total phosphorus, and total nitrogen; According to the smoothed time series data, through the trained long short-term memory neural network model, obtaining the predicted data of the future time series of water quality indicators; According to the predicted data, setting the pollutant emission concentration limit and sludge concentration limit as constraint conditions, constructing the objective function of the optimization problem, thereby establishing a multi-objective optimization model; Using the particle swarm optimization algorithm to solve the multi-objective optimization model to obtain the optimal combination of process parameters; wherein, the process parameters include aeration volume, chemical agent dosage, and sludge return ratio; Converting the optimal combination into a control command and sending it to the execution device of the sewage treatment system to control the operating state of the execution device.

2. The IoT-based agricultural sewage treatment control method according to claim 1, wherein The preprocessing of the sewage water quality data to obtain standard sewage water quality data includes: Performing wavelet decomposition on the sewage water quality data to obtain high-frequency components, and judging whether the high-frequency components exceed a preset high-frequency threshold; When the high-frequency components exceed the preset high-frequency threshold, performing filtering processing to obtain denoised water quality data; Obtaining the front and back data points of the missing values in the denoised water quality data, and filling them using the linear interpolation method according to the numerical change trend of the front and back data points to obtain complete sewage water quality data; Using the isolation forest algorithm to detect the complete sewage water quality data, obtaining the anomaly score, and judging whether the anomaly score exceeds a preset anomaly score threshold; When the anomaly score exceeds the preset anomaly score threshold, performing correction processing to obtain standard sewage water quality data.

3. The method for controlling agricultural sewage treatment based on the Internet of Things according to claim 1, characterized in that The extracting the time series data of water quality indicators from the standard sewage water quality data and performing smoothing processing through time series analysis methods to obtain the smoothed time series data, wherein the water quality indicators include chemical oxygen demand, ammonia nitrogen, total phosphorus, and total nitrogen, includes: Extracting the time series data of water quality indicators from the standard sewage water quality data, and performing smoothing processing on the time series data using the exponential smoothing method to obtain the smoothed time series data.

4. The method for controlling agricultural sewage treatment based on the Internet of Things according to claim 1, wherein, The obtaining the predicted data of the future time series of water quality indicators according to the smoothed time series data through the trained long short-term memory neural network model includes: Constructing a long short-term memory neural network model, setting the time step and the number of neurons, initializing the model parameters, and determining the network structure; Obtaining historical sewage water quality data and dividing it into training set data and test set data; Training the long short-term memory neural network model using the training set data to obtain a trained prediction model; Validating the trained prediction model using the test set data. If the prediction error exceeds the preset error threshold, adjusting the model parameters and retraining until the prediction error meets the requirements; Based on the trained prediction model, the smoothed time series data is input to obtain the predicted data of the future time series of water quality indicators.

5. The agricultural sewage treatment control method based on the Internet of Things according to claim 1, characterized in that, According to the predicted data, setting the pollutant emission concentration limit and the sludge concentration limit as constraint conditions, constructing the objective function of the optimization problem, so as to establish a multi-objective optimization model, including: According to the predicted data, setting the pollutant emission concentration limit and the sludge concentration limit as constraint conditions; According to the constraint conditions, constructing the objective function, where the objective function takes the pollutant emission concentration and the sludge concentration as the optimization objectives; Through the multi-objective optimization algorithm, solving the objective function to obtain the optimal combination of the pollutant emission concentration and the sludge concentration; If the optimal combination meets the preset constraint conditions, then establish a multi-objective optimization model using the objective function at this time; If the optimal combination does not meet the preset constraint conditions, then adjust the constraint conditions and solve again until the optimal combination meets the preset constraint conditions.

6. The method for controlling rural sewage treatment based on the Internet of Things according to claim 1, wherein Using the particle swarm optimization algorithm to solve the multi-objective optimization model to obtain the optimal combination of process parameters; where the process parameters include the aeration volume, the chemical agent dosage, and the sludge return ratio, including: Using the particle swarm optimization algorithm, pre-establishing the particle coding method, determining the initial range of the particle position and velocity, and generating the initial particle swarm; Among them, particle coding represents the combination of the aeration volume, the chemical agent dosage, and the sludge return ratio to be optimized as the position of the particle, and the velocity of the particle represents the change direction and amplitude of the parameter; According to the objective function and the constraint conditions, calculating the fitness value of each particle, and judging whether the particle position meets the preset optimization objective according to the fitness value; If the particle position meets the preset optimization objective, then record the current optimal solution; if the particle position does not meet the preset optimization objective, then update the particle velocity and position, and recalculate the fitness value until it meets the preset optimization objective; By iteratively updating the particle swarm, obtaining the optimal combination of process parameters, and judging whether it meets the requirements of the multi-objective optimization model; If the optimal combination meets the requirements of the multi-objective optimization model, then output the optimal solution; if the optimal combination does not meet the requirements of the multi-objective optimization model, then adjust the particle swarm initialization strategy and re-perform the optimization calculation until the requirements are met.

7. The control method for agricultural sewage treatment based on the Internet of Things according to claim 1, wherein, Converting the optimal combination into a control instruction and sending it to the execution device of the sewage treatment system to control the operating state of the execution device, including: Calling the preset instruction conversion function to convert the optimal combination data into a control instruction; According to the control instruction, determining the adjustment values of the operating parameters of the aerator, the chemical dosing pump, and the sludge return pump; Using the real-time data acquisition module to obtain the current operating state data of the execution device; Comparing the operating parameter adjustment value with the current operating state data to judge whether there is a deviation; If there is a deviation, then call the device control module to send an adjustment instruction to the aerator, the chemical dosing pump, and the sludge return pump.

8. The method for controlling rural sewage treatment based on the Internet of Things according to claim 1, characterized in that After converting the optimal combination into a control instruction and sending it to the execution device of the sewage treatment system to control the operating state of the execution device, the method further includes: Using the real-time monitoring module to obtain the actual concentration values of chemical oxygen demand, ammonia nitrogen, total phosphorus, and total nitrogen in the effluent of the sewage treatment system; Call the preset model calculation module to obtain the predicted concentration values of chemical oxygen demand, ammonia nitrogen, total phosphorus, and total nitrogen; Calculate the deviation values of chemical oxygen demand, ammonia nitrogen, total phosphorus, and total nitrogen based on the actual concentration values and the predicted concentration values; Judge whether the deviation values of chemical oxygen demand, ammonia nitrogen, total phosphorus, and total nitrogen exceed the preset deviation threshold; If the deviation value exceeds the preset deviation threshold, re-collect the concentration values of chemical oxygen demand, ammonia nitrogen, total phosphorus, and total nitrogen; According to the re-collected water quality data, re-solve the optimal combination of process parameters, update the control instruction until the deviation does not exceed the preset deviation threshold when the control instruction is executed.

9. An agricultural sewage treatment control system based on the Internet of Things, characterized in that, The system includes: A data acquisition module for acquiring sewage water quality data at different time periods; A data preprocessing module for preprocessing the sewage water quality data to obtain standard sewage water quality data; A time series analysis module for extracting the time series data of water quality indicators from the standard sewage water quality data and performing smoothing processing through a time series analysis method to obtain the smoothed time series data; wherein, the water quality indicators include chemical oxygen demand, ammonia nitrogen, total phosphorus, and total nitrogen; A prediction module for obtaining the predicted data of the future time series of water quality indicators through the trained long short-term memory neural network model according to the smoothed time series data; A model construction module for setting the pollutant discharge concentration limit and the sludge concentration limit as constraint conditions according to the predicted data, constructing the objective function of the optimization problem, and thus establishing a multi-objective optimization model; A model solving module for solving the multi-objective optimization model by using a particle swarm optimization algorithm to obtain the optimal combination of process parameters; wherein, the process parameters include aeration volume, chemical agent dosage, and sludge return ratio; An instruction issuing module for converting the optimal combination into a control instruction and issuing it to the execution device of the sewage treatment system to control the operating state of the execution device.

10. An electronic device, characterized in that, It includes a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor. When the processor executes the computer program, it implements the Internet of Things-based rural sewage treatment control method according to any one of claims 1 to 8.

Citation Information

Patent Citations

  • Multi-objective optimization method for urban sewage treatment process under multiple working conditions

    CN110032755A

  • Intelligent optimization control method for sewage treatment based on knowledge information

    CN113568311A

  • Hybrid scheduling method based on maximum consumption of new energy and optimal power generation cost

    CN114362241A

  • Optimization control method for sewage treatment process

    CN116360366A

  • Water quality prediction method and system based on time sequence

    CN116861777A

Cited By

  • Water affair treatment process optimization control method, system, equipment and medium

    CN120686639A

  • Sewage treatment method and system

    CN120736596A

  • Intelligent decision-making method, system and equipment for sewage medicament addition and medium

    CN120746224A

  • Intelligent regulation and control method and system for sewage treatment and program product

    CN120781306A

  • Sewage treatment process parameter optimization method and device, computer equipment and medium

    CN122264205A