Rapid prediction and early warning method, system, medium and equipment for short-term water pollution
By constructing a water quality prediction algorithm model and using the Dilicre process, combining the long and short memory neural network model for rainfall and flow prediction, the short-term water quality prediction problem under data scarcity is solved, and more efficient water quality warning and safety management are achieved.
Patent Information
- Application Number
- CN202411116806.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-15
- Publication Date
- 2024-11-26
- Estimated Expiration
- 2044-08-15
AI Technical Summary
The prior art is difficult to achieve accurate short-term water quality prediction and early warning in the absence of data, especially under the conditions of scarcity of data, which leads to an increase in the risk of missing early warning of pollution incidents and affects water quality safety management.
By obtaining location data, rainfall data and flow data, a water quality prediction algorithm model is constructed, the equation is judged using the Dilicre process and hydrological state coefficients, and the long and short memory neural network model is combined to predict future rainfall and flow, thereby achieving prediction of future water quality and Early warning.
It improves the efficiency of short-term water quality assessment and early warning, reduces the risk of missing early warnings for pollution incidents, enhances water quality safety management capabilities, and can make accurate water quality predictions under scarcity conditions.
Smart Images

Figure CN118673407B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of water quality prediction, and more specifically, to a method, system, medium and equipment for rapid prediction and early warning of short-term water pollution. Background Art
[0002] Carrying out rapid prediction and early warning of short-term water pollution in key areas such as important drinking water sources, water resource protection areas and bathing beaches is of great significance for protecting regional water quality safety. In water bodies that lack real-time water quality monitoring, manual testing is usually used. However, due to the low sampling frequency of manual testing and the fact that the water quality testing process from sampling to obtaining results requires a waiting time of 24 to 48 hours or even longer, relying solely on standard laboratory methods, water pollution may break out during this period, causing serious harm. If water quality prediction and forecasting can be carried out quickly before pollution occurs, so as to discover possible pollution, it is of great significance to protect the water ecological environment and avoid the pollution damage caused by it.
[0003] At present, there are many methods for short-term rapid water quality prediction and forecasting, such as multivariate linear regression, generalized least squares method, logistic regression, random forest, support vector machine, artificial neural network and mechanism model, etc. These methods have a common requirement, that is, they need a large number of input parameters and external conditions. For mechanism models, integrated information such as rainfall and external pollution sources are the main external conditions. But in general, under general conditions, it is difficult to fully grasp the rich data sets including measured water quality data, inflow data of surrounding pollution sources and rainfall data. The sampling frequency of historical data is not enough and the data is relatively scarce, which makes it difficult for such methods to accurately predict and forecast water quality. Most of the methods such as non-mechanism models rely on supervised learning and require a rich historical training set to conduct preliminary training of the model in order to achieve future prediction and forecasting. This makes the simulation accuracy of the model that simply uses water quality data as historical data for prediction have an important relationship with the size and quality of the training set. Moreover, compared with rainfall and flow data, water quality data is more complex and random, and it is difficult to accurately predict it using regression prediction, neural networks, etc.; while rainfall and flow data have obvious time-varying characteristics and can be better predicted using existing time series prediction methods; therefore, how to make full use of rainfall and flow data to carry out short-term water quality forecasting and early warning in the absence of certain types of data is the main difficulty in this field. Summary of the invention
[0004] The purpose of the present invention is to provide a method, system, medium and equipment for rapid prediction and early warning of short-term water pollution, which can improve the efficiency of short-term water quality assessment and early warning, reduce the risk of missing pollution event warnings, and can adapt to water quality prediction and early warning under conditions of data scarcity, thereby improving the safety management capabilities of water quality.
[0005] The present invention provides a method, system, medium and equipment for rapid prediction and early warning of short-term water pollution. The method for rapid prediction and early warning of short-term water pollution comprises the following steps:
[0006] S1: Obtain a data set, which includes location data, rainfall data, flow data, and water quality data;
[0007] S2: Construct a water quality prediction algorithm model, and use the data set to train the water quality prediction algorithm model to obtain a trained water quality prediction algorithm model;
[0008] S3: Obtain future rainfall and flow prediction model; according to the data set, use the future rainfall and flow prediction model to obtain future rainfall data and future flow data;
[0009] S4: Based on the future rainfall data and future flow data, the trained water quality prediction algorithm model is used to obtain the probability distribution of the water quality grade range where the future short-term water quality indicators are located;
[0010] S5: According to the probability distribution of the water quality grade interval where the future short-term water quality indicators are located, the water quality level of the future water quality is obtained.
[0011] Furthermore, step S2 of the above-mentioned method for rapid prediction and early warning of short-term water pollution specifically includes:
[0012] S21: obtaining a rainfall state group and a flow state group, wherein the rainfall state group includes a drought group, a medium-humidity group, a high-humidity group and an ultra-high-humidity group, and the flow state group includes a low-flow group, a medium-flow group, a high-flow group and an ultra-high-humidity group;
[0013] S22: According to the rainfall state group and the flow state group, a hydrological state coefficient judgment equation is constructed, and the first hydrological state coefficient and the second hydrological state coefficient are obtained according to the hydrological state coefficient judgment equation:
[0014] ,
[0015] Among them, Kp1 is the first hydrological state coefficient, Kf1 is the second hydrological state coefficient, p is the cumulative rainfall in the three days before the historical data was recorded, and f is the ratio of the cumulative flow in the three days before the historical data was recorded to the cumulative flow of all the historical data recorded; Dp, Mp, Ep and Hp are rainfall group categories obtained based on the cumulative rainfall, among which Dp is the drought group, Mp is the medium-humidity group, Ep is the high-humidity group, and Hp is the super-high-humidity group; Lf, Mf, Ef and Hf are flow group categories obtained based on the cumulative flow, Lf is the low-flow group, Mf is the medium-flow group, Ef is the high-flow group, and Hf is the super-high-humidity group;
[0016] S23: obtaining an ensemble forecast hydrological state group, the ensemble forecast hydrological state group including an ultra-high hydrological state, a high hydrological state, a medium hydrological state and a low hydrological state;
[0017] S24: according to the first hydrological state coefficient and the second hydrological state coefficient, using the Dirichlet process, obtaining the probability of each ensemble forecast hydrological state in the ensemble forecast hydrological state group;
[0018] S25: Obtaining a water quality state coefficient according to a preset water quality standard;
[0019] S26: Based on the ensemble forecast hydrological state group and the probability of each ensemble forecast hydrological state, a water quality prediction operator is constructed, such as the formula:
[0020] ,
[0021] Where y is the water quality prediction operator, x is each ensemble forecast hydrological state in the ensemble forecast hydrological state group, P(y|x) represents the distribution probability of water quality concentration in each group of water quality state coefficient under the ensemble forecast hydrological state condition, P(x|y) is the hydrological state under the condition of known water quality concentration, and the hydrological state includes super high hydrological state, high hydrological state, medium hydrological state and low hydrological state; P(y) is the distribution probability of water quality concentration, and P(x) is the probability of ensemble forecast hydrological state x;
[0022] S27: Obtain a water quality prediction algorithm model based on the rainfall state group, the flow state group, the first hydrological state coefficient, the second hydrological state coefficient, the ensemble forecast hydrological state group, the probability of the ensemble forecast hydrological state, the water quality state coefficient, and the water quality prediction operator; use the data set to train the water quality prediction algorithm model to obtain the probability of the ensemble forecast hydrological state, the distribution probability of water quality concentration, and the hydrological state under known water quality concentration conditions; obtain a trained water quality prediction algorithm model based on the probability of the ensemble forecast hydrological state, the distribution probability of water quality concentration, and the hydrological state under known water quality concentration conditions.
[0023] Furthermore, the rainfall data of the above-mentioned rapid prediction and early warning method for short-term water pollution include the daily average rainfall at each monitoring site, the flow data include the daily average flow at each monitoring site, and the water quality data include the daily average water quality concentration at each monitoring site.
[0024] Furthermore, the data set of the above-mentioned rapid prediction and early warning method for short-term water pollution is obtained by data cleaning the hydrological and water quality data of the monitoring site, and the data cleaning includes: for null values and 0 values, the non-0 value and non-null value of the time point closest to the time point where the data point is located are used as the value of the time point where the data point is located; for data values lower than the minimum preset limit value, the minimum preset limit value is used as the value of the data point; for data values higher than the maximum preset limit value, the maximum preset limit value is used as the value of the data point; if there are multiple monitoring sites at the same geographical location, each monitoring site is treated as a sample site separately.
[0025] The present invention also provides a system, comprising the following modules:
[0026] The data acquisition module is configured to: acquire a data set, the data set including location data, rainfall data, flow data and water quality data;
[0027] The model building and training module is configured to: build a water quality prediction algorithm model, train the water quality prediction algorithm model using a data set, and obtain a trained water quality prediction algorithm model;
[0028] The hydrological prediction module is configured to: obtain a future rainfall and flow prediction model; and obtain future rainfall data and future flow data using the future rainfall and flow prediction model according to the data set;
[0029] The hydrology-water quality prediction module is configured as follows: based on future rainfall data and future flow data, using the trained water quality prediction algorithm model, the probability distribution of the water quality grade interval where the future short-term water quality indicators are located is obtained;
[0030] The water quality result acquisition module is configured to obtain the water quality level of the future water quality according to the probability distribution of the water quality level interval where the future short-term water quality indicators are located.
[0031] Furthermore, the model building and training modules of the above system are specifically configured as follows:
[0032] Obtaining a rainfall state group and a flow state group, wherein the rainfall state group includes a drought group, a medium-humidity group, a high-humidity group and an ultra-high-humidity group, and the flow state group includes a low-flow group, a medium-flow group, a high-flow group and an ultra-high-humidity group;
[0033] According to the rainfall state group and the flow state group, the hydrological state coefficient judgment equation is constructed. According to the hydrological state coefficient judgment equation, the first hydrological state coefficient and the second hydrological state coefficient are obtained:
[0034] ,
[0035] Among them, Kp1 is the first hydrological state coefficient, Kf1 is the second hydrological state coefficient, p is the cumulative rainfall in the three days before the historical data was recorded, and f is the ratio of the cumulative flow in the three days before the historical data was recorded to the cumulative flow of all the historical data recorded; Dp, Mp, Ep and Hp are rainfall group categories obtained based on the cumulative rainfall, among which Dp is the drought group, Mp is the medium-humidity group, Ep is the high-humidity group, and Hp is the super-high-humidity group; Lf, Mf, Ef and Hf are flow group categories obtained based on the cumulative flow, Lf is the low-flow group, Mf is the medium-flow group, Ef is the high-flow group, and Hf is the super-high-humidity group;
[0036] Acquire the ensemble forecast hydrological state group, which includes super-high hydrological state, high hydrological state, medium hydrological state and low hydrological state;
[0037] According to the first hydrological state coefficient and the second hydrological state coefficient, the probability of each ensemble forecast hydrological state in the ensemble forecast hydrological state group is obtained by using the Dirichlet process;
[0038] According to the preset water quality standard, the water quality state coefficient is obtained;
[0039] According to the ensemble forecast hydrological state group and the probability of each ensemble forecast hydrological state, a water quality prediction operator is constructed, as shown in the formula:
[0040] ,
[0041] Where y is the water quality prediction operator, x is each ensemble forecast hydrological state in the ensemble forecast hydrological state group, P(y|x) represents the distribution probability of water quality concentration in each group of water quality state coefficient under the ensemble forecast hydrological state condition, P(x|y) is the hydrological state under the condition of known water quality concentration, and the hydrological state includes super high hydrological state, high hydrological state, medium hydrological state and low hydrological state; P(y) is the distribution probability of water quality concentration, and P(x) is the probability of ensemble forecast hydrological state x;
[0042] A water quality prediction algorithm model is obtained according to the rainfall state group, the flow state group, the first hydrological state coefficient, the second hydrological state coefficient, the ensemble forecast hydrological state group, the probability of the ensemble forecast hydrological state, the water quality state coefficient, and the water quality prediction operator; the water quality prediction algorithm model is trained using the data set to obtain the probability of the ensemble forecast hydrological state, the distribution probability of water quality concentration, and the hydrological state under known water quality concentration conditions; a trained water quality prediction algorithm model is obtained according to the probability of the ensemble forecast hydrological state, the distribution probability of water quality concentration, and the hydrological state under known water quality concentration conditions.
[0043] Furthermore, the rainfall data of the above system includes the daily average rainfall of each monitoring site, the flow data includes the daily average flow of each monitoring site, and the water quality data includes the daily average water quality concentration of each monitoring site.
[0044] Furthermore, the data set of the above system is obtained by data cleaning the hydrological and water quality data of the monitoring site, and the data cleaning includes: for null values and 0 values, the non-0 value and non-null value of the time point closest to the time point where the data point is located are used as the value of the time point where the data point is located; for data values lower than the minimum preset limit value, the minimum preset limit value is used as the value of the data point; for data values higher than the maximum preset limit value, the maximum preset limit value is used as the value of the data point; if there are multiple monitoring sites at the same geographical location, each monitoring site is treated as a sample site separately.
[0045] The present invention also provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps of the above-mentioned method for rapid prediction and early warning of short-term water pollution are implemented.
[0046] The present invention also provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, the steps of the above-mentioned method for rapid prediction and early warning of short-term water pollution are implemented.
[0047] The implementation of the method, system, medium and equipment for rapid prediction and early warning of short-term water pollution provided by the present invention has the following beneficial effects:
[0048] The present invention starts with seeking the main factors driving water quality changes, groups and divides rainfall and flow data, forms a hydrological state coefficient judgment equation, and obtains hydrological state parameters; based on the Dirichlet process, the hydrological state group of rainfall and flow is used to deduce the collective hydrological state; a prediction model with the collective hydrological state as the independent variable and water quality as the dependent variable is constructed; a long-short memory neural network model or a regression prediction model is used to obtain rainfall and flow predictions under future conditions; a water quality prediction model is used to realize water quality prediction under future hydrological conditions, and water quality early warning is carried out; the problem of failure of short-term water quality prediction due to insufficient information is solved, the efficiency of short-term water quality assessment and early warning can be improved, the risk of missing pollution event early warning can be reduced, and the safety management capability of water quality can be improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] The present invention will be further described below with reference to the accompanying drawings and embodiments, in which:
[0050] Figure 1 It is a flow chart of the rapid prediction and early warning method of short-term water pollution provided by the present invention;
[0051] Figure 2 It is a schematic diagram of the process of the rapid prediction and early warning method of short-term water pollution provided by the present invention;
[0052] Figure 3 It is a schematic diagram of a rapid prediction and early warning system for short-term water pollution provided by the present invention;
[0053] Figure 4 It is a structural block diagram of the computer device provided by the present invention. DETAILED DESCRIPTION
[0054] In order to have a clearer understanding of the technical features, purposes and effects of the present invention, specific embodiments of the present invention are now described in detail with reference to the accompanying drawings.
[0055] Figure 1 A schematic diagram of a rapid prediction and early warning method for short-term water pollution in this embodiment is shown. In this embodiment, the rapid prediction and early warning method for short-term water pollution includes the following steps:
[0056] S1: Obtain a data set, which includes location data, rainfall data, flow data, and water quality data;
[0057] Specifically, the rainfall data of the above-mentioned rapid prediction and early warning method for short-term water pollution includes the daily average rainfall of each monitoring station, the flow data includes the daily average flow of each monitoring station, and the water quality data includes the daily average water quality concentration of each monitoring station;
[0058] Specifically, the data set of the above-mentioned rapid prediction and early warning method of short-term water pollution is obtained by data cleaning of the hydrological and water quality data of the monitoring station, and the data cleaning includes: for null values and 0 values, the non-0 value and non-null value of the time point closest to the time point where the data point is located are used as the value of the time point where the data point is located; for data values lower than the minimum preset limit value, the minimum preset limit value is used as the value of the data point; for data values higher than the maximum preset limit value, the maximum preset limit value is used as the value of the data point; if there are multiple monitoring stations at the same geographical location, each monitoring station is treated as a sample station separately;
[0059] S2: Construct a water quality prediction algorithm model, and use the data set to train the water quality prediction algorithm model to obtain a trained water quality prediction algorithm model;
[0060] Specifically, step S2 of the above-mentioned method for rapid prediction and early warning of short-term water pollution specifically includes:
[0061] S21: obtaining a rainfall state group and a flow state group, wherein the rainfall state group includes a drought group, a medium-humidity group, a high-humidity group and an ultra-high-humidity group, and the flow state group includes a low-flow group, a medium-flow group, a high-flow group and an ultra-high-humidity group;
[0062] S22: According to the rainfall state group and the flow state group, a hydrological state coefficient judgment equation is constructed, and the first hydrological state coefficient and the second hydrological state coefficient are obtained according to the hydrological state coefficient judgment equation:
[0063] ,
[0064] Among them, Kp1 is the first hydrological state coefficient, Kf1 is the second hydrological state coefficient, p is the cumulative rainfall in the three days before the historical data was recorded, and f is the ratio of the cumulative flow in the three days before the historical data was recorded to the cumulative flow of all the historical data recorded; Dp, Mp, Ep and Hp are rainfall group categories obtained based on the cumulative rainfall, among which Dp is the drought group, Mp is the medium-humidity group, Ep is the high-humidity group, and Hp is the super-high-humidity group; Lf, Mf, Ef and Hf are flow group categories obtained based on the cumulative flow, Lf is the low-flow group, Mf is the medium-flow group, Ef is the high-flow group, and Hf is the super-high-humidity group;
[0065] S23: obtaining an ensemble forecast hydrological state group, the ensemble forecast hydrological state group including an ultra-high hydrological state, a high hydrological state, a medium hydrological state and a low hydrological state;
[0066] S24: according to the first hydrological state coefficient and the second hydrological state coefficient, using the Dirichlet process, obtaining the probability of each ensemble forecast hydrological state in the ensemble forecast hydrological state group;
[0067] S25: Obtaining a water quality state coefficient according to a preset water quality standard;
[0068] Specifically, the preset water quality standard is the surface water environmental quality standard of the People's Republic of China;
[0069] Specifically, the water quality status coefficient includes normal, lightly polluted, moderately polluted and heavily polluted, wherein normal corresponds to Class I-II water in the surface water environmental quality standard of the People's Republic of China, lightly polluted corresponds to Class III water in the surface water environmental quality standard of the People's Republic of China, moderately polluted corresponds to Class IV water in the surface water environmental quality standard of the People's Republic of China, and heavily polluted corresponds to super Class IV water in the surface water environmental quality standard of the People's Republic of China;
[0070] S26: Based on the ensemble forecast hydrological state group and the probability of each ensemble forecast hydrological state, a water quality prediction operator is constructed, such as the formula:
[0071] ,
[0072] Where y is the water quality prediction operator, x is each ensemble forecast hydrological state in the ensemble forecast hydrological state group, P(y|x) represents the distribution probability of water quality concentration in each group of water quality state coefficient under the ensemble forecast hydrological state condition, P(x|y) is the hydrological state under the condition of known water quality concentration, and the hydrological state includes super high hydrological state, high hydrological state, medium hydrological state and low hydrological state; P(y) is the distribution probability of water quality concentration, and P(x) is the probability of ensemble forecast hydrological state x;
[0073] S27: obtaining a water quality prediction algorithm model according to the rainfall state group, the flow state group, the first hydrological state coefficient, the second hydrological state coefficient, the ensemble forecast hydrological state group, the probability of the ensemble forecast hydrological state, the water quality state coefficient, and the water quality prediction operator; training the water quality prediction algorithm model using the data set to obtain the probability of the ensemble forecast hydrological state, the distribution probability of the water quality concentration, and the hydrological state under the condition of known water quality concentration; obtaining a trained water quality prediction algorithm model according to the probability of the ensemble forecast hydrological state, the distribution probability of the water quality concentration, and the hydrological state under the condition of known water quality concentration;
[0074] S3: Obtain future rainfall and flow prediction model; according to the data set, use the future rainfall and flow prediction model to obtain future rainfall data and future flow data;
[0075] Preferably, the future rainfall and flow prediction model is obtained according to a long short-term memory network model LSTM;
[0076] Optionally, the future rainfall and flow prediction model is obtained according to a regression prediction model;
[0077] S4: Based on the future rainfall data and future flow data, the trained water quality prediction algorithm model is used to obtain the probability distribution of the water quality grade range where the future short-term water quality indicators are located;
[0078] S5: According to the probability distribution of the water quality grade interval where the future short-term water quality indicators are located, the water quality level of the future water quality is obtained;
[0079] Specifically, the probability distribution of the water quality level interval where the future short-term water quality indicators are located is compared among the four levels of normal, lightly polluted, moderately polluted and heavily polluted, and the level with the largest probability distribution is selected as the water quality level where the future water quality will be located;
[0080] Specifically, step S5 also includes: if the water quality level of the future water quality is greater than the preset water quality warning threshold, a water quality exceeding standard warning is issued; if the water quality level of the future water quality is not greater than the preset water quality warning threshold, the water quality level of the future water quality is output.
[0081] This embodiment provides a system, including the following modules:
[0082] The data acquisition module is configured to: acquire a data set, the data set including location data, rainfall data, flow data and water quality data;
[0083] The model building and training module is configured to: build a water quality prediction algorithm model, train the water quality prediction algorithm model using a data set, and obtain a trained water quality prediction algorithm model;
[0084] The hydrological prediction module is configured to: obtain a future rainfall and flow prediction model; and obtain future rainfall data and future flow data using the future rainfall and flow prediction model according to the data set;
[0085] The hydrology-water quality prediction module is configured as follows: based on future rainfall data and future flow data, using the trained water quality prediction algorithm model, the probability distribution of the water quality grade interval where the future short-term water quality indicators are located is obtained;
[0086] The water quality result acquisition module is configured to obtain the water quality level of the future water quality according to the probability distribution of the water quality level interval where the future short-term water quality indicators are located.
[0087] Specifically, the model building and training modules of the above system are specifically configured as follows:
[0088] Obtaining a rainfall state group and a flow state group, wherein the rainfall state group includes a drought group, a medium-humidity group, a high-humidity group and an ultra-high-humidity group, and the flow state group includes a low-flow group, a medium-flow group, a high-flow group and an ultra-high-humidity group;
[0089] According to the rainfall state group and the flow state group, the hydrological state coefficient judgment equation is constructed. According to the hydrological state coefficient judgment equation, the first hydrological state coefficient and the second hydrological state coefficient are obtained:
[0090] ,
[0091] Among them, Kp1 is the first hydrological state coefficient, Kf1 is the second hydrological state coefficient, p is the cumulative rainfall in the three days before the historical data was recorded, and f is the ratio of the cumulative flow in the three days before the historical data was recorded to the cumulative flow of all the historical data recorded; Dp, Mp, Ep and Hp are rainfall group categories obtained based on the cumulative rainfall, among which Dp is the drought group, Mp is the medium-humidity group, Ep is the high-humidity group, and Hp is the super-high-humidity group; Lf, Mf, Ef and Hf are flow group categories obtained based on the cumulative flow, Lf is the low-flow group, Mf is the medium-flow group, Ef is the high-flow group, and Hf is the super-high-humidity group;
[0092] Acquire the ensemble forecast hydrological state group, which includes super-high hydrological state, high hydrological state, medium hydrological state and low hydrological state;
[0093] According to the first hydrological state coefficient and the second hydrological state coefficient, the probability of each ensemble forecast hydrological state in the ensemble forecast hydrological state group is obtained by using the Dirichlet process;
[0094] According to the preset water quality standard, the water quality state coefficient is obtained;
[0095] According to the ensemble forecast hydrological state group and the probability of each ensemble forecast hydrological state, a water quality prediction operator is constructed, as shown in the formula:
[0096] ,
[0097] Where y is the water quality prediction operator, x is each ensemble forecast hydrological state in the ensemble forecast hydrological state group, P(y|x) represents the distribution probability of water quality concentration in each group of water quality state coefficient under the ensemble forecast hydrological state condition, P(x|y) is the hydrological state under the condition of known water quality concentration, and the hydrological state includes super high hydrological state, high hydrological state, medium hydrological state and low hydrological state; P(y) is the distribution probability of water quality concentration, and P(x) is the probability of ensemble forecast hydrological state x;
[0098] A water quality prediction algorithm model is obtained according to the rainfall state group, the flow state group, the first hydrological state coefficient, the second hydrological state coefficient, the ensemble forecast hydrological state group, the probability of the ensemble forecast hydrological state, the water quality state coefficient, and the water quality prediction operator; the water quality prediction algorithm model is trained using the data set to obtain the probability of the ensemble forecast hydrological state, the distribution probability of water quality concentration, and the hydrological state under known water quality concentration conditions; a trained water quality prediction algorithm model is obtained according to the probability of the ensemble forecast hydrological state, the distribution probability of water quality concentration, and the hydrological state under known water quality concentration conditions.
[0099] Specifically, the rainfall data of the above system includes the daily average rainfall of each monitoring site, the flow data includes the daily average flow of each monitoring site, and the water quality data includes the daily average water quality concentration of each monitoring site.
[0100] Specifically, the data set of the above system is obtained by cleaning the hydrological and water quality data of the monitoring site, and the data cleaning includes: for null values and 0 values, the non-0 value and non-null value of the time point closest to the time point where the data point is located are used as the value of the time point where the data point is located; for data values lower than the minimum preset limit value, the minimum preset limit value is used as the value of the data point; for data values higher than the maximum preset limit value, the maximum preset limit value is used as the value of the data point; if there are multiple monitoring sites at the same geographical location, each monitoring site is treated as a sample site separately.
[0101] In some embodiments, the above-mentioned rapid prediction and early warning method for short-term water pollution can also be implemented in the following manner.
[0102] like Figure 2 As shown, it is a flow chart of the rapid prediction and early warning method for short-term water pollution provided by the present invention. This embodiment is described by taking the TP water quality prediction of 20 stations in Tuojiang River in the next three days as an example; the rapid prediction and early warning method for short-term water pollution includes the following steps:
[0103] S1. Establish a model data set for 20 stations in Tuojiang River. The data set includes the location data (latitude and longitude) of the station to be predicted, as well as its historical meteorological data (mainly rainfall), hydrological data (flow) and water quality data (TP concentration); the historical data should be more than 14 days of monitoring values, and the average value of each day is taken as the value of the day;
[0104] S2. Clean the data in the dataset. For null values and 0 values, replace them with the non-0 value closest to the time. For values lower or higher than the maximum and minimum limit values, replace them with the maximum or minimum limit values. If there are multiple monitoring stations at the same location, each station is treated as a sample station.
[0105] S3. According to the rainfall, the collected historical data are divided into hydrological state groups, wherein the rainfall is divided into a drought group, a medium-humidity group, a high-humidity group and an ultra-high-humidity group;
[0106] S4. According to the flow rate, the collected data is divided into a low flow group, a medium flow group, a high flow group and an ultra-high humidity group;
[0107] S5. According to the hydrological state group defined in S3-S4, construct the hydrological state coefficient judgment equation to obtain Kp1 and Kf1:
[0108] ,
[0109] Among them, p is the cumulative rainfall in the three days before the historical data was recorded, f is the ratio of the cumulative flow in the three days before the historical data was recorded to the cumulative flow of all the historical data recorded; Dp, Mp, Ep, Hp are the rainfall group categories obtained based on the cumulative rainfall, which are drought group, medium-humidity group, high-humidity group and super-high-humidity group respectively; Lf, Mf, Ef and Hf are the flow group categories obtained based on the cumulative flow, which are low-flow group, medium-flow group, high-flow group and super-high-humidity group respectively;
[0110] S6. Based on the Dirichlet process, the probability of the ensemble forecast hydrological state x is derived using the first hydrological state coefficient Kp1 and the second hydrological state coefficient Kf1;
[0111] S7. Based on the Surface Water Environmental Quality Standard, define the water quality status group Kw, which is divided into normal, lightly polluted, moderately polluted and severely polluted, corresponding to Class I-II water, similar III, Class IV water and Class V-inferior V water in the water quality standard respectively; in the grouping judgment of TP, according to the provisions of Table 1 of the Surface Water Environmental Quality Standard, the water quality concentration of 20 stations is used for judgment, among which the TP concentration is less than or equal to 0.1 for the normal group, the concentration is greater than 0.1 and less than or equal to 0.2 for light pollution, the concentration is greater than 0.2 and less than or equal to 0.3 for moderate pollution, and the concentration is greater than 0.3 for severe pollution;
[0112] S8. Construct a water quality prediction operator y and define the relationship between the probability of y concentration distribution and the hydrological state x. The two conform to the following formula:
[0113] ,
[0114] Among them, y is the water quality prediction operator, x is the hydrological state, and P is the probability; P(y|x) represents the distribution probability of water quality concentration in each group of Kw under the hydrological state; P(x|y) is the hydrological state under the condition of known water quality concentration; P(y) is the distribution probability of water quality concentration;
[0115] S9. Using the 21-day historical data of rainfall, flow and water quality obtained from monitoring in the Tuojiang River Basin, probability calculation is performed to obtain parameters such as P(x), P(y) and P(x|y) of the water body; further, the historical data is divided into training data set and verification data set in a ratio of 8:2 to realize the training of the water quality prediction algorithm model in the process of S2-S8;
[0116] S10. Use Python language to call the PyTorch framework to build a long short-term memory network model LSTM. Use the historical measured 3-month hourly rainfall and flow data to train and verify the model;
[0117] S11, using the model trained in S10, input the historical data of 21 days, predict the rainfall and flow for the next 3 days, obtain the daily average rainfall and flow data for the next 3 days, import the process described in S2-S8 for simulation, obtain the parameters such as P(x) and P(x|y) under future conditions, and then obtain the probability distribution P(y|x) of the water quality grade interval where the future short-term water quality indicators are located;
[0118] S12. Compare the probabilities of P(y|x) in the four levels of normal, lightly polluted, moderately polluted and heavily polluted. The group with the largest probability distribution is the water quality level in the future.
[0119] S13, setting the water quality warning threshold to Class III standard, comparing the relationship between the water quality warning threshold and the predicted water quality level, if the predicted water quality level is greater than Class III standard, it is moderately polluted or severely polluted, then a water quality exceeding standard warning is issued, otherwise no alarm is issued. Figure 3 Shown is a schematic diagram of a rapid prediction and early warning system for short-term water pollution provided by the present invention.
[0120] This embodiment provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the above-mentioned rapid prediction and early warning method for short-term water pollution are implemented. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only memory (ROM), a random access memory (RAM), a flash memory (Flash Memory), a hard disk (HDD) or a solid-state drive (SSD), etc.; the storage medium can also include a combination of the above-mentioned types of memory.
[0121] This embodiment provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, the steps of the above-mentioned method for rapid prediction and early warning of short-term water pollution are implemented.
[0122] like Figure 4 As shown, the computer device may include: at least one processor 121, such as a CPU (Central Processing Unit), at least one communication interface 123, a memory 124, and at least one communication bus 122. Among them, the communication bus 122 is used to realize the connection and communication between these components. Among them, the communication interface 123 may include a display screen (Display), a keyboard (Keyboard), and the optional communication interface 123 may also include a standard wired interface and a wireless interface. The memory 124 may be a high-speed RAM memory (Random Access Memory, volatile random access memory), or a non-volatile memory (non-volatile memory), such as at least one disk memory. The memory 124 may also be at least one storage device located away from the aforementioned processor 121. Among them, the memory 124 stores an application program, and the processor 121 calls the program code stored in the memory 124 to perform any of the above method steps. Among them, the communication bus 122 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The communication bus 122 can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 4Only one line is used to represent it, but it does not mean that there is only one bus or one type of bus. Among them, the memory 124 may include a volatile memory (English: volatile memory), such as a random access memory (English: random-access memory, abbreviated: RAM); the memory may also include a non-volatile memory (English: non-volatile memory), such as a flash memory (English: flash memory), a hard disk drive (English: hard disk drive, abbreviated: HDD) or a solid-state drive (English: solid-state drive, abbreviated: SSD); the memory 124 may also include a combination of the above-mentioned types of memory. Among them, the processor 121 may be a central processing unit (English: central processing unit, abbreviated: CPU), a network processor (English: network processor, abbreviated: NP) or a combination of CPU and NP. Among them, the processor 121 may also specifically include a hardware chip. The above-mentioned hardware chip may be an application-specific integrated circuit (English: application-specific integrated circuit, abbreviated: ASIC), a programmable logic device (English: programmable logic device, abbreviated: PLD) or a combination thereof. The PLD can be a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL), or any combination thereof. Optionally, the memory 124 is also used to store program instructions. The processor 121 can call the program instructions to implement the rapid prediction and early warning method for short-term water pollution as in the present embodiment.
[0123] The embodiments of the present invention are described above in conjunction with the accompanying drawings, but the present invention is not limited to the above-mentioned specific implementation modes, which are merely illustrative rather than restrictive. Under the guidance of the present invention, ordinary technicians in this field can also make many forms without departing from the scope of protection of the present invention and the claims, all of which are within the protection of the present invention.
Claims
1. A rapid prediction and early warning method for short-term water pollution, characterized in that: The following steps are involved: S1: Acquire a data set, wherein the data set includes location data, rainfall data, flow data, and water quality data; S2: constructing a water quality prediction algorithm model, and using the data set to train the water quality prediction algorithm model to obtain a trained water quality prediction algorithm model; S3: Obtain a future rainfall and flow prediction model; according to the data set, use the future rainfall and flow prediction model to obtain future rainfall data and future flow data; S4: according to the future rainfall data and the future flow data, using the trained water quality prediction algorithm model, obtain the probability distribution of the water quality grade interval where the future short-term water quality index is located; S5: Obtaining the water quality level of the future water quality according to the probability distribution of the water quality level interval of the future short-term water quality indicator; Step S2 specifically includes: S21: Acquire a rainfall state group and a flow state group, wherein the rainfall state group includes a drought group, a medium-humidity group, a high-humidity group and an ultra-high-humidity group, and the flow state group includes a low-flow group, a medium-flow group, a high-flow group and an ultra-high-humidity group; S22: constructing a hydrological state coefficient judgment equation according to the rainfall state group and the flow state group, and obtaining a first hydrological state coefficient and a second hydrological state coefficient according to the hydrological state coefficient judgment equation: , in, Kp1 is the first hydrological state coefficient, Kf1 is the second hydrological state coefficient, p is the cumulative rainfall in the three days before the historical data is recorded. f It is the ratio of the cumulative flow rate of the three days before the historical data is recorded to the cumulative flow rate of all the historical data recorded; Dp、Mp、Ep and Hp is the rainfall group category based on the cumulative rainfall, where Dp For the drought group, Mp Medium humidity group, Ep For the high humidity group, Hp It is the ultra-high humidity group; Lf, Mf, Ef and Hf is the flow group category obtained based on the cumulative flow, Lf For the low flow group, Mf For the middle stream group, E For the high flow group, Hf It is the ultra-high humidity group; S23: Acquire an ensemble forecast hydrological state group, wherein the ensemble forecast hydrological state group includes an ultra-high hydrological state, a high hydrological state, a medium hydrological state, and a low hydrological state; S24: obtaining the probability of each ensemble forecast hydrological state in the ensemble forecast hydrological state group by using a Dirichlet process according to the first hydrological state coefficient and the second hydrological state coefficient; S25: Obtaining a water quality state coefficient according to a preset water quality standard; S26: According to the ensemble forecast hydrological state group and the probability of each ensemble forecast hydrological state, a water quality prediction operator is constructed, such as the formula: , Where y is the water quality prediction operator, x is each ensemble forecast hydrological state in the ensemble forecast hydrological state group, P(y|x) represents the distribution probability of water quality concentration in each group of water quality state coefficient under the ensemble forecast hydrological state condition, P(x|y) is the hydrological state under the condition of known water quality concentration, and the hydrological state includes super high hydrological state, high hydrological state, medium hydrological state and low hydrological state; P(y) is the distribution probability of water quality concentration, P(x) is the ensemble forecast hydrological state x probability; S27: obtaining a water quality prediction algorithm model according to the rainfall state group, the flow state group, the first hydrological state coefficient, the second hydrological state coefficient, the ensemble forecast hydrological state group, the probability of the ensemble forecast hydrological state, the water quality state coefficient, and the water quality prediction operator; training the water quality prediction algorithm model using the data set to obtain the probability of the ensemble forecast hydrological state, the distribution probability of the water quality concentration, and the hydrological state under the condition of known water quality concentration; obtaining a trained water quality prediction algorithm model according to the probability of the ensemble forecast hydrological state, the distribution probability of the water quality concentration, and the hydrological state under the condition of known water quality concentration; The water quality status coefficient includes normal, lightly polluted, moderately polluted and heavily polluted, among which normal corresponds to Class I-II water in the surface water environmental quality standard of the People's Republic of China, lightly polluted corresponds to Class III water in the surface water environmental quality standard of the People's Republic of China, moderately polluted corresponds to Class IV water in the surface water environmental quality standard of the People's Republic of China, and heavily polluted corresponds to water beyond Class IV in the surface water environmental quality standard of the People's Republic of China.
2. The rapid prediction and early warning method for short-term water pollution according to claim 1 is characterized in that: The rainfall data includes the daily average rainfall value at each monitoring site, the flow data includes the daily average flow value at each monitoring site, and the water quality data includes the daily average water quality concentration value at each monitoring site.
3. The rapid prediction and early warning method for short-term water pollution according to claim 1 is characterized in that: The data set is obtained by cleaning the hydrological and water quality data of the monitoring site, and the data cleaning includes: for null values and 0 values, the non-0 value and non-null value of the time point closest to the time point where the data point is located are used as the value of the time point where the data point is located; for data values lower than the minimum preset limit value, the minimum preset limit value is used as the value of the data point; for data values higher than the maximum preset limit value, the maximum preset limit value is used as the value of the data point; if there are multiple monitoring sites at the same geographical location, each monitoring site is treated as a sample site separately.
4. A system, characterized in that: Includes the following modules: A data acquisition module is configured to: acquire a data set, the data set including location data, rainfall data, flow data and water quality data; The model building and training module is configured to: build a water quality prediction algorithm model, train the water quality prediction algorithm model using the data set, and obtain a trained water quality prediction algorithm model; The hydrological prediction module is configured to: obtain a future rainfall and flow prediction model; and obtain future rainfall data and future flow data based on the data set using the future rainfall and flow prediction model; The hydrology-water quality prediction module is configured to: obtain the probability distribution of the water quality grade interval of the future short-term water quality index according to the future rainfall data and the future flow data and using the trained water quality prediction algorithm model; The water quality result acquisition module is configured to obtain the water quality level of the future water quality according to the probability distribution of the water quality level interval of the future short-term water quality index. The model construction and training module is specifically configured as follows: Acquire a rainfall state group and a flow state group, wherein the rainfall state group includes a drought group, a medium-humidity group, a high-humidity group and an ultra-high-humidity group, and the flow state group includes a low-flow group, a medium-flow group, a high-flow group and an ultra-high-humidity group; According to the rainfall state group and the flow state group, a hydrological state coefficient judgment equation is constructed, and according to the hydrological state coefficient judgment equation, a first hydrological state coefficient and a second hydrological state coefficient are obtained: , in, Kp1 is the first hydrological state coefficient, Kf1 is the second hydrological state coefficient, p is the cumulative rainfall in the three days before the historical data is recorded. f It is the ratio of the cumulative flow rate of the three days before the historical data is recorded to the cumulative flow rate of all the historical data recorded; Dp、Mp、Ep and Hp is the rainfall group category based on the cumulative rainfall, where Dp For the drought group, Mp Medium humidity group, Ep For the high humidity group, Hp It is the ultra-high humidity group; Lf, Mf, Ef and Hf is the flow group category obtained based on the cumulative flow, Lf For the low flow group, Mf For the middle stream group, E For the high flow group, Hf It is the ultra-high humidity group; Acquire an ensemble forecast hydrological state group, wherein the ensemble forecast hydrological state group includes an ultra-high hydrological state, a high hydrological state, a medium hydrological state, and a low hydrological state; According to the first hydrological state coefficient and the second hydrological state coefficient, using the Dirichlet process, obtaining the probability of each ensemble forecast hydrological state in the ensemble forecast hydrological state group; According to the preset water quality standard, the water quality state coefficient is obtained; According to the ensemble forecast hydrological state group and the probability of each ensemble forecast hydrological state, a water quality prediction operator is constructed, such as the formula: , Where y is the water quality prediction operator, x is each ensemble forecast hydrological state in the ensemble forecast hydrological state group, P(y|x) represents the distribution probability of water quality concentration in each group of water quality state coefficient under the ensemble forecast hydrological state condition, P(x|y) is the hydrological state under the condition of known water quality concentration, and the hydrological state includes super high hydrological state, high hydrological state, medium hydrological state and low hydrological state; P(y) is the distribution probability of water quality concentration, P(x) is the ensemble forecast hydrological state x probability; According to the rainfall state group, the flow state group, the first hydrological state coefficient, the second hydrological state coefficient, the ensemble forecast hydrological state group, the probability of the ensemble forecast hydrological state, the water quality state coefficient, and the water quality prediction operator, a water quality prediction algorithm model is obtained; the water quality prediction algorithm model is trained using the data set to obtain the probability of the ensemble forecast hydrological state, the distribution probability of the water quality concentration, and the hydrological state under the condition of known water quality concentration; according to the probability of the ensemble forecast hydrological state, the distribution probability of the water quality concentration, and the hydrological state under the condition of known water quality concentration, a trained water quality prediction algorithm model is obtained; The water quality status coefficient includes normal, lightly polluted, moderately polluted and heavily polluted, among which normal corresponds to Class I-II water in the surface water environmental quality standard of the People's Republic of China, lightly polluted corresponds to Class III water in the surface water environmental quality standard of the People's Republic of China, moderately polluted corresponds to Class IV water in the surface water environmental quality standard of the People's Republic of China, and heavily polluted corresponds to water beyond Class IV in the surface water environmental quality standard of the People's Republic of China.
5. The system according to claim 4, characterized in that The rainfall data includes the daily average rainfall of each monitoring site, the flow data includes the daily average flow of each monitoring site, and the water quality data includes the daily average water quality concentration of each monitoring site.
6. The system according to claim 4, characterized in that The data set is obtained by cleaning the hydrological and water quality data of the monitoring site, and the data cleaning includes: for null values and 0 values, the non-0 value and non-null value of the time point closest to the time point where the data point is located are used as the value of the time point where the data point is located; for data values lower than the minimum preset limit value, the minimum preset limit value is used as the value of the data point; for data values higher than the maximum preset limit value, the maximum preset limit value is used as the value of the data point; if there are multiple monitoring sites at the same geographical location, each monitoring site is treated as a sample site separately.
7. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method for rapid prediction and early warning of short-term water pollution as claimed in any one of claims 1 to 3 are implemented.
8. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the steps of the method for rapid prediction and early warning of short-term water pollution as claimed in any one of claims 1-3 are implemented.
