A method for predicting water quality in river monitoring sections
By using data-driven water quality prediction methods in river monitoring sections, combining DA-RNN, NeuralProphet and XGBoost models, and using meteorological forecast data to correct water quality prediction results, the problem of accurate reflection of river water quality changes was solved, and accurate prediction and proactive prevention and control of future water quality changes were achieved.
Patent Information
- Application Number
- CN202211037894.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-26
- Publication Date
- 2025-09-16
- Estimated Expiration
- 2042-08-26
AI Technical Summary
Existing technologies are unable to accurately reflect the complex water quality changes in rivers and lack data-driven water quality prediction methods, resulting in passive water pollution prevention and control and the susceptibility to sudden water quality accidents such as blue-green algae outbreaks.
A data-driven water quality prediction method is adopted. The historical water quality data of river monitoring sections and weather forecast data are used, combined with DA-RNN, NeuralProphet and XGBoost models to predict the time series changes of key water quality indicators, and the prediction results are corrected by weather forecast data.
It improves the accuracy of water quality predictions at river monitoring sections, enables proactive early warning and intervention of future water quality changes, and reduces the occurrence of water quality accidents.
Smart Images

Figure CN115526378B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of water quality prediction of a monitoring section in river water quality management, and in particular to a method for predicting water quality of a river monitoring section. Background Art
[0002] In river water quality management, a lack of in-depth understanding of future trends in key water quality indicators has led to a lack of proactive water pollution prevention and control. Passive management is prone to sudden water quality incidents such as blue-green algae blooms. Accurately predicting future temporal changes in key water quality indicators would provide early warnings of potential pollution incidents, strengthen proactive intervention, and facilitate preventive measures. This would help maintain and improve the water environment.
[0003] The patent specification with publication number CN111105061A discloses a method for predicting river water quality. The prediction method includes: obtaining the inflow flow of the surface runoff of the predicted river; hydrodynamically coupling the inflow flow with a preset hydrodynamic model, and simulating the water flow conditions of the predicted river to obtain water volume information of the predicted river; coupling the water volume information with a preset water quality model, and inputting the time series to be predicted to obtain the water quality distribution information corresponding to the predicted river in the time series.
[0004] The specification with announcement number CN108345964B discloses a water quality prediction method based on a water quality model. The method includes: establishing a one-dimensional water quality model for the river network or river section area of the water quality area to be predicted according to the lattice Boltzmann method; establishing a two-dimensional water quality model for the key prediction area in the water quality area to be predicted according to the lattice Boltzmann method; the grid width at the boundary of the two-dimensional water quality model is equal to the river section width at the boundary of the one-dimensional water quality model; according to the conservation of mass and momentum of solute particles, the boundaries of the one-dimensional water quality model and the two-dimensional water quality model are coupled to obtain a coupled water quality model; the coupled water quality model is a model obtained by coupling the one-dimensional water quality model and the two-dimensional water quality model; and predicting the water quality area to be predicted based on the coupled model to obtain parameter prediction results for the area to be predicted.
[0005] The water quality prediction technologies of the above two patents are mostly based on water quality mechanism models, which cannot reflect the complex water quality changes in rivers and lack data-driven water quality prediction machine learning technology.
[0006] Therefore, developing a data-driven machine learning method for water quality prediction to more accurately predict changes in water quality in river monitoring sections is of great significance for changing water quality management strategies from "post-control" to "pre-prevention" and improving the surface water environment. Summary of the Invention
[0007] The purpose of the present invention is to provide a method for predicting water quality of a river monitoring section. The method uses the historical water quality data of the river monitoring section to predict the temporal changes of key water quality indicators in future time periods. Secondly, the forecast data of future weather conditions by meteorological forecast technology is used as an external variable with known future values to correct the prediction results of key water quality indicators to improve accuracy.
[0008] A method for predicting water quality of a river monitoring section comprises the following steps:
[0009] (1) Monitor and record historical water quality data and meteorological data, sort them by time series, and construct a sequence format data set;
[0010] (2) building a prediction model for the sequence format data set constructed in step (1) to predict the changing trend of the target water quality parameters;
[0011] (3) using the recent data in the sequence format dataset constructed in step (1) to build a prediction model using the NeuralProphet method to predict the periodicity of the target water quality parameters;
[0012] (4) combining the change trend of the target water quality parameter obtained in step (2) and step (3) with the periodic prediction result to predict the temporal change of the target water quality parameter;
[0013] (5) The predicted value of the time series change of the target water quality parameter in step (4) and the measured value of the time series change of the meteorological index at the corresponding time are used as independent variables, and the measured value of the time series change of the target water quality parameter at the corresponding time is used as the dependent variable, and a mapping relationship is established;
[0014] (6) In the actual water quality prediction process, the temporal changes of the target water quality parameters are preliminarily predicted using step (4), and then, combined with the meteorological forecast data, the mapping relationship established in step (5) is used to correct the prediction results of the temporal changes of the target water quality parameters.
[0015] This plan makes targeted predictions on the trends, periodicity and deviations of water quality changes, and more accurately predicts the temporal changes of key water quality indicators in river monitoring sections in future time periods.
[0016] Preferably, in step (1), automatic water quality monitoring stations are arranged at each monitoring section of the river to monitor and record historical water quality data and meteorological data.
[0017] Preferably, in step (2), the sequence format dataset constructed in step (1) is used to perform prediction modeling using the DA-RNN method.
[0018] Preferably, in step (3), the recent data in the sequence format data set constructed in step (1) is used to build a prediction model using the NeuralProphet method.
[0019] Preferably, the change trend in step (4) is combined with the periodic prediction result, and the expression is:
[0020]
[0021] Where, It represents the predicted value of the time series change of the water quality index to be predicted at time t in the future; Indicates the indicator change trend at the future time t predicted by DA-RNN; Represents the periodic changes of indicators at time t in the future predicted by NeuralProphet; Indicates that the periodic changes of the indicators predicted by NeuralProphet at time t in the future are affected by special events. represents the prediction error term.
[0022] Preferably, in step (5), XGBoost is used to establish a mapping relationship, and its expression is:
[0023]
[0024] Where, represents the corrected predicted value of the i-th water quality index, w i,j Represents x i,j The weight of x i,j It represents the j-th independent variable affecting the i-th water quality index, including the predicted value of the water quality index preliminarily predicted by DA-RNN and NeuralProphet and the medium-term meteorological forecast data.
[0025] Beneficial effects of the present invention:
[0026] The present invention firstly predicts the temporal changes of key water quality indicators in future time periods based on the historical water quality data of the river monitoring section; secondly, it uses the forecast data of future weather conditions by meteorological forecast technology as external variables with known future values to correct the prediction results of key water quality indicators to improve the accuracy. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] Figure 1 This is a schematic diagram of the water quality monitoring section of a city's river basin;
[0028] Figure 2 is a flow chart of the method of the present invention;
[0029] Figure 3This is a comparison chart of the predicted value and the measured value of total nitrogen in the next week at monitoring section 1# in an embodiment of the present invention;
[0030] Figure 4 This is a comparison chart of the predicted value and the measured value of total phosphorus in the 1# monitoring section in the next week in an embodiment of the present invention. DETAILED DESCRIPTION
[0031] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.
[0032] like Figure 1 As shown in Figure 1, a river basin in a certain city covers an area of approximately 84 square kilometers. The basin's abundant water resources provide a strong foundation for the stable development of various industries within and surrounding areas. However, with rapid economic development and increasing urbanization, water consumption in the region has increased rapidly, leading to large-scale discharge of industrial and domestic wastewater. The quality of the city's surface waters has deteriorated, and water quality-related water shortages have become increasingly prominent.
[0033] A water quality prediction method for a river monitoring section in this embodiment is as follows: Figure 2 As shown, the following steps are included:
[0034] (1) Automatic water quality monitoring stations were set up at 7 monitoring sections of the river in the area. The historical water quality data and meteorological data from January 1, 2021 to January 31, 2022 were monitored and recorded, and the data were sorted in time series to construct a sequence format dataset.
[0035] (2) A DA-RNN prediction model was constructed for this sequence-formatted dataset to predict the changing trends of the target water quality parameters. The optimal DA-RNN parameters were determined using grid search, where batchsize = 64, nhidden_encoder = 128, nhidden_decoder = 128, ntimestep = 10, epochs = 10000, and learning_rate = 0.003.
[0036] (3) The NeuralProphet method was used to build a prediction model based on the data of the past 60 days in the sequence format dataset to predict the periodicity of the target water quality parameters. The optimal parameters of NeuralProphet were determined by grid search, with epochs = 300, learning_rate = 0.01, and changepoints = 730.
[0037] (4) Combining the obtained change trend of the target water quality parameters with the periodic prediction results, the time series change of the target water quality parameters is predicted. The process can be expressed as:
[0038]
[0039] Where, It represents the predicted value of the time series change of the water quality index to be predicted at time t in the future; Indicates the indicator change trend at the future time t predicted by DA-RNN; Represents the periodic changes of indicators at time t in the future predicted by NeuralProphet; Indicates that the periodic changes of the indicators predicted by NeuralProphet at time t in the future are affected by special events. represents the prediction error term.
[0040] (5) The predicted values of the time series changes of the target water quality parameters and the measured values of the time series changes of the meteorological indicators at the corresponding time are used as independent variables, and the measured values of the time series changes of the target water quality parameters at the corresponding time are used as dependent variables. XGBoost is used to establish the following mapping relationship:
[0041]
[0042] Where, represents the corrected predicted value of the i-th water quality index, w i,j Represents x i,j The weight of x i,j The jth independent variable that influences the i-th water quality indicator is represented by the water quality indicator predicted using the DA-RNN and NeuralProphet models, as well as the mid-range weather forecast data. The optimal DA-RNN parameters were determined using a grid search: learning_rate = 0.01, colsample_bylevel = 0.9, max_depth = 8, and n_estimators = 500.
[0043] (6) In the actual water quality prediction process, the temporal changes of the target water quality parameters are preliminarily predicted using step (4), and then, combined with the meteorological forecast data, the mapping relationship established in step (5) is used to correct the prediction results of the temporal changes of the target water quality parameters.
[0044] Although the present invention has been described in detail with reference to the aforementioned embodiments, it is still possible for those skilled in the art to modify the technical solutions described in the aforementioned embodiments, or to make equivalent substitutions for some of the technical features therein. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.
Claims
1. A method for predicting water quality at a river monitoring section, characterized in that: The following steps are involved: (1) Monitor and record historical water quality data and meteorological data, sort them by time series, and construct a sequence format data set; (2) The sequence format data set constructed in step (1) is used to build a prediction model to predict the changing trend of the target water quality parameters, and the sequence format data set is used to build a prediction model using the DA-RNN method; (3) Using the recent data in the sequence format data set constructed in step (1) to build a prediction model, predict the periodicity of the target water quality parameter, and using the NeuralProphet method to build a prediction model for the recent data in the sequence format data set; (4) Combining the change trend of the target water quality parameters obtained in steps (2) and (3) with the periodic prediction results, the time series change of the target water quality parameters is predicted, and the expression is: Where, It represents the predicted value of the time series change of the water quality index to be predicted at time t in the future; Indicates the indicator change trend at the future time t predicted by DA-RNN; Represents the periodic changes of indicators at time t in the future predicted by NeuralProphet; Indicates that the periodic changes of the indicators predicted by NeuralProphet at time t in the future are affected by special events. Represents the prediction error term; (5) The predicted value of the time series change of the target water quality parameter in step (4) and the measured value of the time series change of the meteorological index at the corresponding time are used as independent variables, and the measured value of the time series change of the target water quality parameter at the corresponding time is used as the dependent variable. A mapping relationship is established using XGBoost, and its expression is: Where, represents the corrected predicted value of the i-th water quality index, express The weight of represents the jth independent variable that affects the i-th water quality index, including the water quality index prediction value preliminarily predicted by DA-RNN and NeuralProphet and the medium-term meteorological forecast data; (6) in the actual water quality prediction process, the temporal change of the target water quality parameter is preliminarily predicted by step (4), and then combined with the meteorological forecast data, the mapping relationship established in step (5) is used to correct the prediction result of the temporal change of the target water quality parameter.
2. The method for predicting water quality of a river monitoring section according to claim 1, characterized in that: In step (1), automatic water quality monitoring stations are arranged at each monitoring section of the river to monitor and record historical water quality data and meteorological data.
Citation Information
Patent Citations
A water quality prediction method and system based on a water quality model
CN108345964B
River water quality prediction method, prediction device and terminal
CN111105061A