Flood season water quality monitoring method and system based on variable speed integral PID (Proportion Integration Differentiation) controller
By using a variable-speed integral PID controller-based approach, combined with sensor networks and iterative optimization algorithms, the problems of slow response and insufficient adaptability of traditional PID controllers in flood season water quality control are solved. This approach enables precise and timely control of water quality during the flood season, improving the real-time performance and reliability of water quality monitoring.
Patent Information
- Application Number
- CN202511454510.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-13
- Publication Date
- 2025-11-14
AI Technical Summary
Traditional PID controllers are ill-suited for handling complex water quality changes and dynamic control under extreme weather conditions during flood season water quality monitoring. This results in slow response times and a tendency to over- or under-adjust, failing to meet the flexibility and adaptability requirements of flood season water quality control.
A method based on variable speed integral PID controller is adopted. Pollutant concentration and water level fluctuation data are acquired through sensor network to generate weighted gradient information. Combined with historical data, comprehensive trend analysis is performed. Variable speed control coefficients are calculated using variable speed integral PID control algorithm, and the control coefficients are refined through iterative optimization algorithm to adjust the operating parameters of water quality control equipment.
It enables precise and timely control of water quality changes during the flood season, improves the real-time nature and reliability of monitoring and early warning, ensures the accuracy and stability of water quality control, avoids unnecessary alarms, and safeguards the safety of water resources and the ecological environment.
Smart Images

Figure CN120949544A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of automatic control technology, and in particular to a method and system for monitoring water quality during the flood season based on a variable speed integral PID controller. Background Technology
[0002] With the increasing frequency of global climate change and extreme weather events, water quality changes during the flood season are becoming increasingly complex. Especially under extreme weather conditions such as torrential rains and floods, the drastic fluctuations in water levels and pollutant concentrations place higher demands on water quality monitoring and regulation. Traditional water quality monitoring methods rely heavily on manual sampling and periodic testing, which suffers from problems such as untimely data collection, insufficient accuracy, and delayed response, making it difficult to address the impacts of water quality changes in real time. Furthermore, the dynamic changes in water levels and pollutant concentrations during the flood season often prevent traditional water quality monitoring methods from providing rapid and accurate water quality control strategies during emergency responses.
[0003] PID control, as a classic feedback control strategy, has been widely used in water quality regulation systems. Its simplicity, ease of use, and high efficiency enable it to provide stable control performance in various application scenarios. However, traditional PID controllers use fixed control parameters. This parameter setting method often fails to provide precise regulation when facing complex water quality changes during the flood season. Especially under dynamic changes in pollutant concentrations and water level fluctuations, traditional PID control algorithms exhibit slow response speeds and are prone to over- or under-adjustment, failing to meet the flexibility and adaptability requirements of flood season water quality regulation. Most existing PID-based water quality monitoring methods fail to fully consider the impact of environmental factors such as pollutant concentration fluctuations, precipitation, and water level changes on water quality during the flood season. Therefore, achieving precise and real-time water quality regulation under complex water quality changes and extreme weather conditions during the flood season remains a technical challenge.
[0004] To address this issue, this application proposes a method for monitoring water quality during the flood season based on a variable speed integral PID controller. This method not only improves the real-time performance and accuracy of water quality monitoring but also effectively addresses the dynamic changes in water quality during the flood season. Summary of the Invention
[0005] To address the aforementioned technical issues, this application provides a method and system for monitoring water quality during the flood season based on a variable speed integral PID controller, which is used to dynamically monitor and regulate water quality changes during the flood season and accurately control pollutant concentrations.
[0006] In a first aspect, this application provides a method for monitoring water quality during the flood season based on a variable-speed integral PID controller, the method comprising: Step S1: Acquire pollutant concentration data and water level fluctuation parameters in the water body during the flood season through a sensor network, and fuse the pollutant concentration data and the water level fluctuation parameters to obtain the current water quality status index; Step S2: Extract time-series variation data of pollutant concentrations based on the current water quality status indicators, calculate concentration gradient information, perform freshness analysis on the concentration gradient information, and generate weighted gradient information. Step S3: The weighted gradient information is fused with historical water quality monitoring data to determine the comprehensive gradient trend. Based on the comprehensive gradient trend, the initial update value of the variable speed control coefficient is obtained through the variable speed integral PID control algorithm. Step S4: If the initial update value exceeds the preset range, an iterative optimization algorithm is used to obtain the refined variable speed control coefficient. The operating parameters of the water quality control equipment are adjusted according to the refined variable speed control coefficient, and the dynamic control results of the water quality during the flood season are output.
[0007] Secondly, this application provides a flood season water quality monitoring system based on a variable speed integral PID controller, the system comprising: The acquisition module acquires pollutant concentration data and water level fluctuation parameters in water bodies during the flood season through a sensor network, and fuses the pollutant concentration data and the water level fluctuation parameters to obtain the current water quality status index. The analysis module extracts time-series variation data of pollutant concentrations based on the current water quality status indicators, calculates concentration gradient information, performs freshness analysis on the concentration gradient information, and generates weighted gradient information. The generation module integrates the weighted gradient information with historical water quality monitoring data to determine the comprehensive gradient trend, and obtains the preliminary update value of the variable speed control coefficient through the variable speed integral PID control algorithm based on the comprehensive gradient trend. If the initial update value exceeds the preset range, the adjustment module uses an iterative optimization algorithm to obtain the refined variable speed control coefficient. Based on the refined variable speed control coefficient, the operating parameters of the water quality control equipment are adjusted, and the dynamic control results of the water quality during the flood season are output.
[0008] Compared with the prior art, the beneficial effects of the present invention are at least as follows: This application acquires mercury pollutant concentration and water level fluctuation parameters in real time through a sensor network. After fusing these data, a current water quality status index is obtained, accurately reflecting the dynamic changes of pollutants in the water body. Then, based on the current water quality status index, time-series variation data of pollutant concentration is extracted and concentration gradient information is calculated, enabling analysis of the rate and trend of pollutant concentration changes over time. Especially in dynamic environments, it can promptly capture changes in pollutant diffusion. Next, freshness analysis is performed, and weighted gradient information is generated through weighted processing to ensure a more accurate response to changes in pollutant concentration. Further improvement in sensitivity to current water quality is achieved through correction of the freshness score. Subsequently, combined with historical water quality monitoring data, the weighted gradient information is fused with historical data through a dynamic weight allocation mechanism, ensuring an organic combination of real-time and historical data, thus better reflecting the long-term trend of water quality changes. This process uses a variable-speed integral PID control algorithm to calculate the initial update value of the variable-speed control coefficient, realizing the dynamic adaptation of the water quality control equipment to water quality changes.
[0009] If the initial update value exceeds the preset range, the variable speed control coefficient is further refined through an iterative optimization algorithm to ensure the accuracy and stability of system regulation. Then, the initial optimized value is adjusted using a flow fluctuation correction factor to compensate for the impact of water level fluctuations and flow velocity changes on pollutant diffusion, thus optimizing the response intensity of water quality regulation. Finally, by comparing the adjusted optimized value with a preset threshold, it is ensured that the variable speed control coefficient meets the safety requirements of water quality regulation, avoiding unnecessary alarms and ensuring system safety. In summary, this application, through multi-level optimization and correction, makes water quality regulation more accurate and timely, effectively responding to changes in pollutant concentration in water bodies, while improving the real-time performance and reliability of monitoring and early warning. Attached Figure Description
[0010] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0011] Figure 1 This is a schematic diagram of an embodiment of the flood season water quality monitoring method based on a variable speed integral PID controller in this application. Figure 2 This is a schematic diagram of an embodiment of a flood season water quality monitoring system based on a variable speed integral PID controller, as described in this application. Detailed Implementation
[0012] This application provides a method and system for monitoring water quality during the flood season based on a variable-speed integral PID controller. The terms "first," "second," "third," "fourth," etc. (if present) in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments described herein can be implemented in a sequence other than that illustrated or described herein. Furthermore, the terms "comprising" or "having" and any variations thereof are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or device that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or devices.
[0013] For ease of understanding, the specific process of the embodiments of this application is described below. Please refer to [link / reference]. Figure 1 One embodiment of the flood season water quality monitoring method based on a variable speed integral PID controller in this application includes: Step S1: Obtain pollutant concentration data and water level fluctuation parameters in the water body during the flood season through a sensor network, and fuse the pollutant concentration data and water level fluctuation parameters to obtain the current water quality status index.
[0014] Specifically, a sensor network is deployed at different locations in the water body during the flood season. The sensor network includes multiple water quality sensors and water level sensors. The water quality sensors are used to monitor the concentration of pollutants in the water in real time, such as the concentration data of pollutants like chemical oxygen demand (COD), ammonia nitrogen (NH3-N), and total phosphorus (TP). The water level sensors are used to acquire water level fluctuation parameters, which reflect changes in water level and flow rate. After data acquisition, the pollutant concentration data and water level fluctuation parameters are transmitted to the data processing center in real time via a wireless network. First, preprocessing is performed, including data denoising and time-series synchronization, to ensure the accuracy and timeliness of the data. Then, data fusion technology is used to combine the pollutant concentration data and water level fluctuation parameters to generate a comprehensive water quality status index. The fusion process uses a weighted average or multivariate regression model to integrate the time-series data of water level changes and pollutant concentrations into a comprehensive index that can reflect the severity of water pollution and the dynamic characteristics of water quality fluctuations. In the calculation of water quality status indicators, the weights of various pollutants and water level parameters are adjusted according to different application scenarios and needs. For example, during the flood season, water level fluctuations may have a significant impact on water quality, so the weight of water level fluctuation parameters in the water quality status indicators can be appropriately increased, making the indicators more closely reflect the actual situation. The detailed calculation process of the current water quality status indicators will be explained later. By integrating pollutant concentration data with water level fluctuation parameters, accurate water quality status indicators can be generated, providing comprehensive data support for real-time monitoring and control of water quality during the flood season.
[0015] Step S2: Extract time-series variation data of pollutant concentrations based on current water quality status indicators, calculate concentration gradient information, perform freshness analysis on concentration gradient information, and generate weighted gradient information.
[0016] Specifically, since water quality change is a continuous process, pollutant concentrations exhibit different rates and patterns of change over time. Therefore, freshness analysis of these concentration changes is necessary to more accurately capture the latest trends in pollutant changes. First, time-series data of pollutant concentrations in the water body are extracted based on water quality status indicators, recording pollutant concentration values at different time points. To ensure data accuracy and timeliness, a timed sampling mechanism is adopted to periodically acquire pollutant concentration data, forming a continuous time series. Then, based on the extracted time-series data, the gradient information of pollutant concentrations is calculated. The gradient information measures the rate and direction of pollutant concentration change by comparing the concentration changes between two consecutive time points. Next, freshness analysis is performed on the obtained concentration gradient information. Freshness analysis adjusts the weight of gradient information based on the time difference between the concentration data collection time and the current time. If the concentration change data is relatively new, it means that the data better reflects the current state of the water body, and therefore it is given a higher weight. The freshness score not only considers the time difference but also combines environmental factors (such as water temperature, flow rate, and weather conditions) to make the weight of gradient information more accurate and adaptable to the dynamic changes in the water environment. Finally, based on the weights generated by the freshness analysis, the concentration gradient information is weighted to obtain weighted gradient information, ensuring that newer data receives more attention in dynamic water quality changes, and improving the accuracy of pollutant concentration change trends through weighting.
[0017] Step S3: Integrate the weighted gradient information with historical water quality monitoring data to determine the comprehensive gradient trend, and obtain the preliminary update value of the variable speed control coefficient through the variable speed integral PID control algorithm based on the comprehensive gradient trend.
[0018] Specifically, the generated weighted gradient information is fused with historical water quality monitoring data. Historical water quality monitoring data typically includes water quality-related information such as pollutant concentration, flow rate, and temperature over a previous period. This data reflects long-term water quality change trends. During the fusion process, methods such as weighted averaging or regression analysis are used to combine historical water quality monitoring data with current weighted gradient information to generate a comprehensive gradient trend. This comprehensive gradient trend reflects the overall direction and rate of water quality change. Next, a variable-speed integral PID control algorithm is used to analyze this comprehensive gradient trend and calculate the preliminary update values of the variable-speed control coefficients. The variable-speed integral PID control algorithm is an improved PID control algorithm that dynamically adjusts PID parameters according to the rate of water quality change, enabling the system to respond sensitively under different water quality conditions. In this process, the adjustment of control coefficients is based on the comprehensive gradient trend, ensuring real-time performance and control accuracy in response to water quality changes. Specifically, the algorithm first analyzes the change patterns of pollutant concentrations based on historical data and the current gradient trend to predict water quality changes over a future period. Then, by adjusting the integral, proportional, and derivative coefficients of the PID controller, preliminary update values of the variable-speed control coefficients that conform to water quality changes are obtained. The comprehensive gradient trend better reflects the long-term changes in water quality, while the application of the variable speed integral PID control algorithm ensures the dynamic adjustment of the control coefficient, improving the accuracy and flexibility of water quality regulation.
[0019] Step S4: If the initial update value exceeds the preset range, an iterative optimization algorithm is used to obtain the refined variable speed control coefficient. The operating parameters of the water quality control equipment are adjusted according to the refined variable speed control coefficient, and the dynamic control results of the water quality during the flood season are output.
[0020] Specifically, the first step is to determine whether the initially updated variable speed control coefficient exceeds a preset reasonable range. This range is set based on water quality monitoring needs and equipment capabilities to ensure the control coefficient is within an appropriate control range. When the initial update value exceeds this range, it indicates that the existing control parameters cannot meet the water quality regulation requirements and further optimization is needed. To optimize the control coefficient, an iterative optimization algorithm is used. Commonly used optimization algorithms include gradient descent or genetic algorithms. Based on the current initial update value and actual feedback from water quality changes, the control coefficient is gradually adjusted. The iterative process continuously calculates and adjusts the error until the control coefficient finally converges to a suitable refined value. During the optimization process, error constraints are also considered, such as sensor accuracy requirements and the fluctuation range of real-time water quality data, to ensure that the optimized control coefficient meets the actual regulation requirements. After optimization, the refined variable speed control coefficient is obtained and used to adjust the operating parameters of the water quality control equipment. These parameters may include the treatment rate of the water treatment equipment, the opening and closing degree of the flow regulating valve, and the start and stop time of the pump station. All these adjustments are optimized based on the refined control coefficient to achieve the ideal water quality regulation effect. By refining the variable speed control coefficient using an iterative optimization algorithm, we can ensure more accurate control results under complex water quality changes during the flood season. This avoids over- or under-adjustment caused by control coefficients that are too large or too small. This precise control not only improves the efficiency of water quality management but also effectively responds to the dynamic changes in water quality during the flood season, ensuring the safety of water resources and the stability of the ecological environment.
[0021] In one specific embodiment, obtaining the current water quality status index includes the following steps: Pollutant concentration data are sampled according to a preset monitoring rate to obtain a real-time concentration sequence; Water level fluctuation parameters are obtained using water level sensors to generate water level fluctuation sequences. By integrating real-time concentration sequences and water level fluctuation sequences, the comprehensive water quality influencing factors are calculated. Based on the comprehensive water quality influencing factors, the current water quality status indicators are determined.
[0022] Specifically, pollutant concentration data is first sampled at a preset monitoring rate to obtain a real-time concentration sequence. The sampling frequency is set to once per minute to ensure the timeliness of the pollutant concentration data. When encountering sudden changes in pollutant concentration, the sampling frequency can be appropriately increased to reflect concentration fluctuations in real time. Through real-time data acquisition, the time-series data of pollutant concentration can effectively capture the dynamic changes in the concentration of pollutants such as mercury in the water body. Subsequently, water level fluctuation parameters are obtained through a water level sensor to generate a water level fluctuation sequence. The water level fluctuation sequence records the water level changes in the water body within a specific time period, reflecting the fluctuation of water flow in the basin or water body. Next, the real-time concentration sequence and the water level fluctuation sequence are fused to calculate the comprehensive water quality impact factor. In the fusion process, the pollutant concentration series and water level fluctuation series are first time-aligned to ensure their synchronization. Then, the influence factor is calculated using a weighted summation method. The formula for the influence factor is: Influence Factor = Average value of concentration series * Weight of concentration series + Standard deviation of water level fluctuation * Weight of water level series. The weight of the concentration series is assumed to be 0.6, and the weight of the water level series is 0.4. The weight of the concentration series reflects the dominant role of pollutant concentration on water quality, while the weight of the water level series considers the impact of water level fluctuations on pollutant diffusion. Under the influence of seasonal variations, especially during the rainy season, a seasonal correction factor of 1.2 is introduced to enhance the impact of water level fluctuations, thus better reflecting the strong effect of water level fluctuations on water quality. Finally, based on the comprehensive water quality influence factor, the current water quality status index is determined. This index integrates the influence of pollutant concentration and water level fluctuations, characterizing the pollution status of the water body and the role of water level changes in pollutant diffusion.
[0023] In one specific embodiment, extracting time-series variation data of pollutant concentrations based on current water quality indicators and calculating concentration gradient information specifically includes the following steps: Extract time-series variation data of pollutant concentrations based on current water quality indicators; The gradient vector of time-series data is determined using a concentration gradient calculation method. By analyzing the fluctuation amplitude, the magnitude and direction of the gradient vector can be obtained; By combining the magnitude and direction of the gradient vector, concentration gradient information of pollutant concentration changes is generated.
[0024] Specifically, based on the current water quality status indicators, the time-series change data of pollutant concentration is extracted. The concentration data of mercury pollutants in the water body is collected in real time through a sensor network. The concentration data is arranged in chronological order to form a time series. For example, the sensor samples once per minute and records the mercury concentration data at each time point, such as C(t1), C(t2), C(t3), etc. The collected concentration series is [0.3 mg / L, 0.6 mg / L, 0.9 mg / L], which records the changes in pollutant concentration in different time periods.
[0025] Next, a concentration gradient calculation method is used to calculate the gradient vector based on the extracted time-series data. The gradient vector represents the rate and direction of change in pollutant concentration. The calculation steps are as follows: Calculate the difference in concentration over time based on the time-series change data. The difference represents the magnitude of concentration change between adjacent time points; for example, the difference between C(t2) and C(t1) is 0.6 - 0.3 = 0.3 mg / L. The gradient vector is calculated using the finite difference method. The gradient vector is the rate of change obtained by dividing the concentration difference between adjacent time points by the time interval. Assuming the time interval... For a time interval of 1 hour, the gradient vector can be expressed as (0.6-0.3) / 1=0.3 and (0.9-0.6) / 1=0.3, resulting in a gradient vector [0.3, 0.3]. This reflects the rate of concentration change per hour. Based on this, the magnitude and direction of the gradient vector are obtained through fluctuation amplitude analysis. The magnitude represents the rate of concentration change, while the direction represents the trend of concentration change. For example, the Euclidean norm (the magnitude of the vector) of the gradient vector is calculated as the magnitude. Assuming the gradient vector is [0.3, 0.3], its Euclidean norm is: magnitude = The direction is determined by the sign of the vector. If the gradient vector value is positive, it indicates that the pollutant concentration is increasing; conversely, it indicates a decrease. Combining the magnitude and direction of the gradient vector, gradient information of pollutant concentration changes is generated. Through the above implementation method, the gradient information of mercury pollutant concentration is accurately calculated and analyzed, reflecting the changing trend and diffusion range of pollutants in water bodies, thereby providing strong support for subsequent water quality control and precise management of pollutant diffusion.
[0026] In one specific embodiment, performing freshness analysis on the concentration gradient information to generate weighted gradient information specifically includes the following steps: The time difference of concentration gradient information is calculated and corrected by combining environmental data to generate a freshness score; If the freshness score is higher than the preset threshold, then the concentration gradient information with a freshness score higher than the preset threshold will be assigned a high weight value. Calculate the weighting coefficient for each concentration gradient based on the response time delay and the preset correction coefficient; Weighted gradient information is generated by fusing weighting coefficients with concentration gradient information and then smoothed.
[0027] Specifically, the time difference of concentration gradient information is first calculated and corrected using environmental data to generate a freshness score. The detailed calculation method will be explained later. If the freshness score is higher than a preset threshold, a higher weight is assigned to the concentration gradient information with a freshness score above the preset threshold. The preset threshold is set to 0.7. When the freshness score exceeds 0.7, a higher weight (e.g., 0.9) is given to the concentration gradient information. If the freshness score is lower than 0.7, a lower weight (e.g., 0.5) is assigned. The weighting coefficient for each concentration gradient information is calculated based on the response time delay and a preset correction coefficient. The response time delay refers to the actual time elapsed from data acquisition to gradient calculation. It can be measured through sensor network logs. For example, if the delay is 3 seconds and the preset correction coefficient is 1.2 (considering factors such as terrain and signal transmission), the weighting coefficient is calculated as follows: Weighting coefficient = A correction factor is applied; for example, if the delay is 3 seconds and the standard delay is 1 second, the correction factor is 1.2, resulting in a weighting factor of 3.6. Finally, the weighting factor is fused with the concentration gradient information. For example, if the gradient vector is [2.5, -1.3] and the weighting factor is 4.8, the weighted result is [12, -6.24]. Subsequently, the weighted gradient information is smoothed to eliminate data noise. For example, a moving average filter is used to smooth the weighted gradient information, with a window size of 5. The smoothed value for each point is obtained by calculating the average of the five data points before and after it, thereby reducing the impact of sudden noise on the results. This implementation accurately reflects the timeliness of the concentration gradient information and weights and optimizes the gradient information based on real-time data. It considers not only data freshness and transmission delay but also environmental factors (such as topographical influences) for adjustment, thus generating weighted gradient information that better reflects actual water quality changes.
[0028] In one specific embodiment, calculating the time difference of concentration gradient information and correcting it with environmental data to generate a freshness score specifically includes the following steps: Calculate the time difference between the collection time of the concentration gradient information and the current time, and input the time difference into a preset exponential decay function to obtain a preliminary freshness score; Acquire environmental data, including real-time water temperature, flow rate, and weather data, calculate the corresponding correction factors, and correct the initial freshness score. The correction factors are jointly calculated using a multiple regression model. The corrected freshness score is then weighted and fused with the concentration gradient information to generate the final freshness score.
[0029] Specifically, by collecting the timestamp of each gradient information and comparing it with the current system time, the time difference, i.e., the data delay, is calculated. For example, if the timestamp of the sensor data collection is t1 and the current time is t2, then the time difference is t2-t1. Based on this time difference, the freshness score is calculated using the exponential decay function. The formula is: ,in, For the initial score, t represents the time difference, the initial score. It is usually set to 1, indicating that the initial data has the highest weight, and the decay constant is... The diffusion rate of different pollutants is preset, typically to 10 minutes or longer. The larger the time difference, the more significant the attenuation effect, thus reducing the freshness score and ensuring the score reflects the real-time data. Then, environmental data is acquired, including real-time water temperature, flow rate, and weather data, and corresponding correction factors are calculated for each. Specifically: water temperature has a significant impact on the diffusion rate of pollutants. Generally, the higher the water temperature, the faster the chemical reaction rate and pollutant diffusion rate in the water. Assuming that for every 1°C increase in temperature, the pollutant diffusion rate increases by 5%, the water temperature correction factor can be expressed as: Water temperature correction factor = 1 + k1 × (water temperature - reference temperature), where k1 is an empirical constant, and the reference temperature is a set reference temperature (e.g., 25°C). Setting k1 = 0.05 means that for every 1°C increase, the pollutant diffusion rate increases by 5%. Water flow velocity also affects pollutant diffusion; the faster the water flow, the faster the pollutants spread. Therefore, the flow velocity correction factor is calculated based on the actual flow velocity: Flow velocity correction factor = 1 + k2 × flow velocity, where k2 is an empirical constant. Assuming k2 = 0.1, this means that for every 1 m / s increase in flow velocity, the pollutant diffusion rate increases by 10%. Weather factors such as precipitation and wind speed affect water level fluctuations and the dynamic characteristics of water bodies, thus affecting pollutant diffusion. Especially during the rainy season, heavy precipitation intensifies water level fluctuations, accelerating pollutant diffusion. Therefore, the weather correction factor is calculated based on a weighted average of precipitation and wind speed: Weather correction factor = 1 + k3 × precipitation + k4 × wind speed, where k3 and k4 are empirical constants representing the weights of precipitation and wind speed on diffusion. A multiple regression model is used to jointly calculate water temperature correction factors, flow velocity correction factors, and weather data correction factors. Specifically, these variables are linked to the freshness score to derive a comprehensive correction factor. The basic form of the regression model can be written as: Freshness Correction Factor = α + β1 × Water Temperature Correction Factor + β2 × Flow Velocity Correction Factor + β3 × Weather Correction Factor, where α is a constant term (bias term), and β1, β2, and β3 are regression coefficients, representing the weight of each correction factor on the freshness score. Regression coefficients β1, β2, and β3 are estimated using historical data (such as historically monitored water temperature, flow velocity, and weather data, and actual pollutant dispersion) through regression analysis. These coefficients reflect the relative influence of each environmental factor on the freshness score correction. After calculating the environmental correction factors, the product of the initial freshness score and the environmental correction factors is used as the corrected freshness score. Dynamically correcting the freshness score of concentration gradient information by combining environmental factors such as water temperature, flow velocity, and weather not only improves the accuracy of the freshness score but also adjusts the weights according to different environmental conditions, making the water quality monitoring system more adaptable and real-time.
[0030] In one specific embodiment, fusing weighted gradient information with historical water quality monitoring data to determine the comprehensive gradient trend specifically includes the following steps: The weighted gradient information is integrated with historical water quality monitoring data through a dynamic weight allocation mechanism; Based on the seasonal adjustment factor, the fused data is corrected to generate corrected gradient information; The difference between the corrected gradient information and the historical average gradient is calculated, and the comprehensive gradient trend is determined based on the difference.
[0031] Specifically, to effectively integrate real-time and historical water quality monitoring data, the system dynamically allocates weights based on current water quality indicators. For example, if the current water quality data is relatively fresh, the system will assign a higher weight to the weighted gradient information, reflecting the dominant role of real-time pollutant concentration changes. Historical data, on the other hand, is used to supplement long-term trends and is given a lower weight. Next, the integrated data is corrected using a seasonal adjustment factor to generate corrected gradient information. Since seasonal variations significantly impact water quality, especially during rainy or dry seasons when water levels and pollutant diffusion rates fluctuate considerably, a seasonal adjustment factor is used to correct the integrated data. For instance, during the rainy season, water levels fluctuate more, water flow speeds increase, and pollutant diffusion accelerates, thus a higher value (e.g., 1.2) is assigned to the seasonal factor. During the dry season, due to lower water levels and slower concentration changes, the seasonal factor may be 0.8. By adjusting the seasonal factor, the system can more accurately reflect the impact of different seasons on water quality changes, thereby improving the accuracy of water quality monitoring. Finally, the difference between the corrected gradient information and the historical average gradient is calculated. Based on this difference, the comprehensive gradient trend is determined. The difference calculation compares the current water quality change with the historical average trend. If the difference between the corrected gradient information and the historical average gradient is positive and exceeds a preset threshold (e.g., 0.5), it indicates that the mercury concentration in the water body is increasing; if the difference is negative and exceeds the threshold, it indicates that the concentration is decreasing. By combining real-time and historical data, the long-term trend of pollutant concentration in the water body can be accurately determined. The introduction of a seasonal adjustment factor allows the monitoring results to flexibly respond to water quality fluctuations in different seasons, while the difference calculation ensures the directional judgment of water quality changes.
[0032] In one specific embodiment, obtaining the preliminary updated values of the transmission control coefficients specifically includes the following steps: The comprehensive gradient trend is input into the variable speed integral PID control algorithm to calculate the dynamic response value of pollutant concentration changes; Establish a pollutant diffusion model and determine the diffusion rate of pollutants in water bodies based on the pollutant diffusion model; Obtain the constraint factors of topographic factors on pollutant diffusion, simulate the propagation path of pollutants under complex terrain, and calculate the correction value of the constraint factors by combining historical water quality monitoring data. Based on the dynamic response value, diffusion rate, and corrected constraint factor, calculate the preliminary update value of the variable speed control coefficient.
[0033] Specifically, the comprehensive gradient trend is input into the variable-speed integral PID control algorithm. This algorithm uses the comprehensive gradient trend in real-time data to calculate the dynamic response value of pollutant concentration changes. The dynamic response value reflects the fluctuation of pollutant concentration in the water body, establishing a pollutant diffusion model. Based on this model, the diffusion rate of pollutants in the water body is determined. The pollutant diffusion model is usually based on the diffusion equation of Fick's law to describe the propagation process of solutes in fluids. This model estimates the diffusion rate of pollutants by inputting data such as the flow velocity, temperature, and pollutant concentration of the water body. Subsequently, the constraint factor of topographic factors on pollutant diffusion is obtained, and the propagation path of pollutants under complex terrain is simulated. Topographic factors such as slope and river curvature have a significant impact on pollutant diffusion. Therefore, it is necessary to combine topographic impact assessment to adjust the results of the diffusion model. Specifically, topographic impact assessment can quantify the slope and river curvature in the water body through a Geographic Information System (GIS). For example, assuming a river slope of 15 degrees, the constraint factor calculated by the sine function is 0.8, indicating the hindering effect of slope on diffusion. Furthermore, the constraint factors are adjusted based on historical water quality monitoring data to ensure the accuracy of the topographic impact assessment. For example, in mountain streams with steep slopes, diffusion is more strongly restricted, and the constraint factor may be adjusted to 0.7. Finally, the preliminary updated value of the variable speed control coefficient is calculated based on the dynamic response value, diffusion rate, and the adjusted constraint factor. Specifically, the dynamic response value, diffusion rate, and constraint factor are combined and weighted summed or multiplied to obtain the preliminary updated value of the variable speed control coefficient. Assuming a dynamic response value of 0.4, a diffusion rate of 0.2, and a constraint factor of 0.8, the preliminary updated value is calculated as follows: Preliminary Update Value = 0.4 × 0.2 × 0.8 = 0.064. The preliminary updated value characterizes the control intensity of the water quality control equipment, reflects the dynamic changes in pollutant concentration in the water body, and provides a basis for equipment adjustments.
[0034] In one specific embodiment, obtaining the refined transmission control coefficients using an iterative optimization algorithm specifically includes the following steps: The gradient descent algorithm is used to iteratively optimize the initial update value. Combined with the sensor accuracy requirements, the error constraints in the optimization process are determined to obtain the initial optimized value. Obtain real-time water level fluctuation parameters to calculate flow fluctuation correction factor, and adjust the preliminary optimized value based on flow fluctuation correction factor; The adjusted initial optimization value is compared again with the preset threshold to determine whether it exceeds the preset range. If not, the refined gear control coefficient is obtained.
[0035] Specifically, the initial update value is calculated in the variable-speed integral PID control algorithm, and may exceed the preset safety range. To correct this value, a gradient descent algorithm is used for optimization. Gradient descent is an optimization method that adjusts parameters along the negative gradient direction by calculating the gradient of the objective function. Specifically, the gradient descent algorithm updates the initial update value step by step by calculating the partial derivative of the error function until it converges to a stable value. Assuming the initial update value is 0.85 and the learning rate is set to 0.01, after several iterations, the update value may be adjusted to 0.75. Iterative optimization helps to quickly converge to a stable value when water quality indicators change, thereby improving the accuracy of control. Secondly, considering the sensor accuracy requirements, error constraints are determined during the optimization process. During iterative optimization, it is crucial to ensure that the optimization process does not cause the results to deviate from the actual pollutant concentration. The sensor accuracy requirement is typically ±0.05 ppm. Therefore, if the deviation exceeds this accuracy requirement during optimization, the optimization algorithm will adjust the step size to ensure the reliability of the results. In different scenarios, such as seasonal changes, the error constraint can also be dynamically adjusted according to the actual situation. For example, in the high-flow season with high water levels in summer, the error constraint can be adjusted to ±0.03 ppm to adapt to seasonal water flow changes. Next, real-time water level fluctuation parameters are obtained to calculate the flow fluctuation correction factor, and the initial optimized value is adjusted based on the flow fluctuation correction factor. First, real-time water level data is obtained through a water level sensor to calculate the flow fluctuation parameters. Then, the correction factor is calculated based on the flow fluctuation. Assuming a flow rate of 2 m³ / s, the correction factor can be set to 1.2. By applying the correction factor to the initial optimized value, the adjusted optimized value will reflect the impact of water level fluctuations on pollutant diffusion. For example, if the initial optimized value is 0.75, after flow fluctuation correction, the adjusted value is 0.9. Finally, the adjusted preliminary optimized value is compared again with the preset threshold to determine if it exceeds the preset range. Assuming the preset safe range for the control coefficient is 0.6 to 0.8, if the adjusted preliminary optimized value is 0.9, exceeding the upper limit, further adjustments are needed until the control coefficient meets the safe range. If the adjusted optimized value is within the range, it is directly output as the refined variable speed control coefficient. Through iterative optimization, the variable speed control coefficient that meets the water quality control requirements can be accurately calculated, effectively improving the responsiveness and accuracy of water quality control. This not only optimizes the operating efficiency of the water quality control equipment but also ensures that unnecessary alarms are not triggered during the control process, thereby achieving precise management of mercury pollutant concentration control.
[0036] In one specific embodiment, outputting the dynamic control results of water quality during the flood season specifically includes the following steps: Based on the adjusted operating parameters, control the pollutant treatment rate of the water quality control equipment; A linkage alarm triggering mechanism is used to determine whether an alarm for excessive pollutant concentrations has been triggered. The pollutant concentration data after regulation is obtained, and the regulation results are corrected using an error compensation method. Based on the corrected regulation results, the final regulation effect is output.
[0037] Specifically, by collecting real-time water quality monitoring data (such as mercury pollutant concentration and water level fluctuations) and combining it with previously calculated variable speed control coefficients, the operating parameters of the equipment, such as pump speed and filtration intensity, are adjusted. The equipment operating parameters are updated based on the calculated adjustment values. If water level fluctuations are large or pollutant concentrations are high, the treatment rate is increased, for example, by increasing pump speed and the flow rate of the filter material, thereby achieving an initial reduction in mercury pollutant concentration. Next, an alarm trigger mechanism is activated to determine whether a pollutant concentration exceeding the standard alarm has been triggered. Based on the adjusted operating parameters and real-time monitored mercury pollutant concentration gradient information, the deviation between the current concentration and a preset safety threshold is calculated. For example, data fusion from sensor networks is used to compare the concentration gradient information with historical data and incorporate seasonal adjustment factors to calculate the deviation between the current pollutant concentration and the safety threshold. If the deviation exceeds the preset threshold, the alarm mechanism is triggered. For example, in remote mountainous mining areas, a rapid increase in concentration may trigger an alarm, indicating abnormal water quality changes. Simultaneously, water level sensor data is used to assess the risk of pollutant diffusion, and pollutant diffusion models and terrain impact assessments are used to determine the potential range of pollutant diffusion, thus providing a basis for subsequent emergency response. The process involves acquiring pollutant concentration data after regulation and correcting the regulation results using an error compensation method. First, the real-time monitored concentration data is compared with the equipment's regulation results to calculate the error value. This error value is derived from the initial update value of the variable-speed integral algorithm and the refined variable-speed control coefficient. Then, a gradient descent iterative optimization method is used to compensate for the error value. This iterative optimization process ensures more accurate regulation results and avoids unnecessary over- or under-regulation. Finally, based on the corrected regulation results, the final regulation effect is output. This effect characterizes the real-time control status of mercury pollutant concentration. This result is used for subsequent water quality management and regulation decisions. If the regulation results show that the mercury pollutant concentration is still at a dangerous level, further control measures may be triggered, such as increasing treatment intensity or issuing an emergency alarm. The steps of dynamically adjusting the control equipment, triggering real-time alarms, and optimizing error compensation ensure the timeliness, accuracy, and reliability of water quality regulation. This method not only improves the precision of mercury pollutant concentration control but also effectively responds to complex environmental changes, ensuring water resource security and ecological stability.
[0038] The above describes a flood season water quality monitoring method based on a variable-speed integral PID controller in the embodiments of this application. The following describes a flood season water quality monitoring system based on a variable-speed integral PID controller in the embodiments of this application. Please refer to [link to relevant documentation]. Figure 2One embodiment of a flood season water quality monitoring system based on a variable speed integral PID controller in this application includes: The acquisition module acquires pollutant concentration data and water level fluctuation parameters in the water body during the flood season through a sensor network, and fuses the pollutant concentration data and water level fluctuation parameters to obtain the current water quality status indicators; The analysis module extracts time-series variation data of pollutant concentrations based on current water quality indicators, calculates concentration gradient information, performs freshness analysis on the concentration gradient information, and generates weighted gradient information. The generation module integrates weighted gradient information with historical water quality monitoring data to determine the comprehensive gradient trend. Based on the comprehensive gradient trend, it obtains the preliminary update value of the variable speed control coefficient through the variable speed integral PID control algorithm. If the initial update value exceeds the preset range, the adjustment module uses an iterative optimization algorithm to obtain the refined variable speed control coefficient. Based on the refined variable speed control coefficient, the operating parameters of the water quality control equipment are adjusted, and the dynamic control results of the water quality during the flood season are output.
[0039] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0040] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it 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 all or part of the 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 to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0041] The above-described embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application.
Claims
1. A method for monitoring water quality during the flood season based on a variable-speed integral PID controller, characterized in that, The method includes: Step S1: Acquire pollutant concentration data and water level fluctuation parameters in the water body during the flood season through a sensor network, and fuse the pollutant concentration data and the water level fluctuation parameters to obtain the current water quality status index; Step S2: Extract time-series variation data of pollutant concentrations based on the current water quality status indicators, calculate concentration gradient information, perform freshness analysis on the concentration gradient information, and generate weighted gradient information. Step S3: The weighted gradient information is fused with historical water quality monitoring data to determine the comprehensive gradient trend. Based on the comprehensive gradient trend, the initial update value of the variable speed control coefficient is obtained through the variable speed integral PID control algorithm. Step S4: If the initial update value exceeds the preset range, an iterative optimization algorithm is used to obtain the refined variable speed control coefficient. The operating parameters of the water quality control equipment are adjusted according to the refined variable speed control coefficient, and the dynamic control results of the water quality during the flood season are output.
2. The method according to claim 1, characterized in that, The current water quality status indicators include: The pollutant concentration data are sampled according to a preset monitoring rate to obtain a real-time concentration sequence; The water level fluctuation parameters are obtained using a water level sensor, and a water level fluctuation sequence is generated. By combining the real-time concentration sequence and the water level fluctuation sequence, the comprehensive water quality impact factor is calculated. Based on the comprehensive water quality influencing factors, the current water quality status indicators are determined.
3. The method according to claim 1, characterized in that, Based on the current water quality status indicators, time-series variation data of pollutant concentrations are extracted, and concentration gradient information is calculated, including: Extract time-series variation data of pollutant concentrations based on current water quality indicators; The gradient vector of the time-series change data is determined using a concentration gradient calculation method. The magnitude and direction of the gradient vector are obtained through fluctuation amplitude analysis; By combining the magnitude and direction of the gradient vector, concentration gradient information of pollutant concentration changes is generated.
4. The method according to claim 1, characterized in that, Freshness analysis is performed on the concentration gradient information to generate weighted gradient information, including: The time difference of the concentration gradient information is calculated and corrected by combining environmental data to generate a freshness score; If the freshness score is higher than a preset threshold, then a high weight value is assigned to the concentration gradient information whose freshness score is higher than the preset threshold; Calculate the weighting coefficient for each concentration gradient based on the response time delay and the preset correction coefficient; The weighting coefficients are fused with the concentration gradient information to generate weighted gradient information, which is then smoothed.
5. The method according to claim 4, characterized in that, The time difference of the concentration gradient information is calculated and corrected using environmental data to generate a freshness score, including: Calculate the time difference between the collection time of the concentration gradient information and the current time, and input the time difference into a preset exponential decay function to obtain a preliminary freshness score; Environmental data, including real-time water temperature, flow rate and weather data, are acquired, and corresponding correction factors are calculated for each. The initial freshness score is then corrected, and the correction factors are calculated jointly using a multiple regression model. The corrected freshness score is then weighted and fused with the concentration gradient information to generate the final freshness score.
6. The method according to claim 1, characterized in that, The weighted gradient information is fused with historical water quality monitoring data to determine the comprehensive gradient trend, including: The weighted gradient information is fused with the historical water quality monitoring data through a dynamic weight allocation mechanism; Based on the seasonal adjustment factor, the fused data is corrected to generate corrected gradient information; The difference between the corrected gradient information and the historical average gradient is calculated, and the comprehensive gradient trend is determined based on the difference.
7. The method according to claim 1, characterized in that, Obtaining the initial updated values of the transmission control coefficients includes: The comprehensive gradient trend is input into the variable speed integral PID control algorithm to calculate the dynamic response value of the pollutant concentration change; Establish a pollutant diffusion model and determine the diffusion rate of pollutants in water bodies based on the pollutant diffusion model; Obtain the constraint factors of topographic factors on pollutant diffusion, simulate the propagation path of pollutants under complex terrain, and calculate the correction value of the constraint factors by combining historical water quality monitoring data. Based on the dynamic response value, the diffusion rate, and the corrected constraint factor, calculate the initial update value of the variable speed control coefficient.
8. The method according to claim 1, characterized in that, The refined gear control coefficients obtained using an iterative optimization algorithm include: The gradient descent algorithm is used to iteratively optimize the initial update value. Combined with the sensor accuracy requirements, the error constraints in the optimization process are determined to obtain the initial optimized value. Calculate the flow fluctuation correction factor by obtaining real-time water level fluctuation parameters, and adjust the preliminary optimized value based on the flow fluctuation correction factor; The adjusted initial optimization value is compared again with the preset threshold to determine whether it exceeds the preset range. If not, the refined gear control coefficient is obtained.
9. The method according to claim 1, characterized in that, The output of dynamic water quality control results during the flood season includes: Based on the adjusted operating parameters, control the pollutant treatment rate of the water quality control equipment; A linkage alarm triggering mechanism is used to determine whether an alarm for excessive pollutant concentrations has been triggered. The pollutant concentration data after regulation is obtained, and the regulation results are corrected using an error compensation method. Based on the corrected regulation results, the final regulation effect is output.
10. A flood season water quality monitoring system based on a variable-speed integral PID controller, used to implement the flood season water quality monitoring method based on a variable-speed integral PID controller as described in any one of claims 1-9, characterized in that, The system includes: The acquisition module acquires pollutant concentration data and water level fluctuation parameters in water bodies during the flood season through a sensor network, and fuses the pollutant concentration data and the water level fluctuation parameters to obtain the current water quality status index. The analysis module extracts time-series variation data of pollutant concentrations based on the current water quality status indicators, calculates concentration gradient information, performs freshness analysis on the concentration gradient information, and generates weighted gradient information. The generation module integrates the weighted gradient information with historical water quality monitoring data to determine the comprehensive gradient trend, and obtains the preliminary update value of the variable speed control coefficient through the variable speed integral PID control algorithm based on the comprehensive gradient trend. If the initial update value exceeds the preset range, the adjustment module uses an iterative optimization algorithm to obtain the refined variable speed control coefficient. Based on the refined variable speed control coefficient, the operating parameters of the water quality control equipment are adjusted, and the dynamic control results of the water quality during the flood season are output.
Citation Information
Cited By
Garden fountain control method and system based on sensing technology
CN121478007A
Garden fountain control method and system based on sensing technology
CN121478007B