A method and system for constructing a flood safety knowledge graph by combining machine learning with traditional mechanism models
By combining machine learning with traditional mechanism models, a flood safety knowledge graph is constructed, which solves the problems of insufficient accuracy and long calculation time of existing flood forecasting methods, achieves accurate and timely water level forecasting, and supports flood prevention and water conservancy project scheduling.
Patent Information
- Application Number
- CN202410245453.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-03-05
- Publication Date
- 2024-09-03
- Estimated Expiration
- 2044-03-05
AI Technical Summary
Existing flood forecasting methods have problems such as insufficient accuracy, long calculation time, a large number of boundary condition constraints and high professional knowledge requirements for model construction, making it difficult to achieve accurate and timely flood forecasting.
Using machine learning combined with traditional mechanism models to build a one-dimensional hydrodynamic model through the Saint-Venant equations, combined with the machine learning model to identify key influencing factors and automatic optimization of parameters, build a flood safety knowledge map to achieve accurate and timely monitoring of water levels at key control sections forecast.
An accurate and timely real-time water level forecast model has been formed, which quantifies the threshold and timing of downward flood volume in each scenario, and accurately describes the flood change patterns in river flood control control sections, providing scientific basis to support flood prevention and control and water conservancy project scheduling, and reducing flood losses.
Smart Images

Figure CN117993495B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of hydrological forecasting, and in particular to a method and system for constructing a flood safety knowledge graph by combining machine learning with a traditional mechanism model. Background Art
[0002] For a long time, how to achieve the "four prediction" functions of accurate flood forecasting, long warning period, scientific plan, and fast rehearsal, and build a smart water conservancy system with digital twin basins as the core, has always been a hot issue in the field of hydrology and water resources. At present, flood forecasting is mainly based on empirical forecasting and hydrodynamic models. The empirical forecasting method has the problem of insufficient accuracy and is even more difficult to apply in extreme scenarios; the hydrodynamic model method takes a long time to calculate and has poor timeliness. In addition, the model construction requires a large number of boundary conditions, requires high professional knowledge, and is not convenient to use. Summary of the invention
[0003] In response to the problems in existing flood forecasting methods, the present invention proposes a method and system for constructing a flood safety knowledge graph by combining machine learning with traditional mechanism models. By combining the machine learning model, the nonlinear response relationship between the water level of key control sections and other hydrological factors is calculated, and an accurate and timely real-time water level forecasting model can be formed to calculate the water level changes under various boundary conditions and form a maximum flood safety knowledge graph.
[0004] In order to achieve the above object, the present invention is implemented by the following technical solutions:
[0005] A method for constructing a flood safety knowledge graph by combining machine learning with a traditional mechanism model, the method comprising:
[0006] The mechanism model is used to simulate and calculate the changes in the basin's hydrological situation, including:
[0007] Measure river network sections, collect river section data, water level data, flow data and rainfall data in the basin and perform data preprocessing;
[0008] According to the collected river section data, water level data and flow data, a one-dimensional hydrodynamic model is constructed based on the Saint-Venant equations; model calibration and model verification are performed to determine whether the accuracy of the one-dimensional hydrodynamic model meets the requirements; if not, the model calibration and verification are performed again; if yes, the runoff is calculated as the boundary condition of the one-dimensional hydrodynamic model, and the water level of the key control section under typical working conditions is simulated and calculated;
[0009] The knowledge graph of flood safety in the river basin is constructed through machine learning models, including:
[0010] The boundary condition factors of the one-dimensional hydrodynamic model are used as input conditions, and the simulation calculation results are used as training samples to identify key influencing factors and automatically optimize parameters to build a machine learning model; wherein the boundary condition factors include upstream flow, downstream water level or tidal level data, and interval inflow flow;
[0011] By using the machine learning model, the nonlinear relationship between the water level of the key control section and the key influencing factors is analyzed, and the water level of the key control section under different influencing factors is calculated;
[0012] The maximum upstream flow is inferred based on the water level of the key control section and the downstream boundary, and a flood safety knowledge map is drawn based on the water level of the key control section and the downstream water level or tidal level data as the conditional matrix.
[0013] As a preferred solution of the present invention, the one-dimensional hydrodynamic model is constructed based on the Saint-Venant equations, specifically comprising:
[0014] The one-dimensional hydrodynamic model is based on the one-dimensional open channel unsteady flow equation, and its theoretical basis is the Saint-Venant equations, including the continuity equation and the motion equation;
[0015] The continuity equation is:
[0016]
[0017] In the formula, A represents the cross-sectional area of the water flow, in m 2 ; t represents time, unit is s; Q represents net flow of river section, unit is m 3 / s; x represents the distance along the water flow direction, in meters; q represents the lateral inflow per unit length of the river section, including uniform lateral inflow and concentrated lateral inflow, in meters 3 / s;
[0018] The equation of motion is:
[0019]
[0020] Where g is the acceleration due to gravity, in m 2 / s; α is the momentum correction coefficient; h is the water depth, in m; C is the Xie Cai coefficient; n is the riverbed roughness, R is the hydraulic radius, in m;
[0021] The Saint-Venant equations are discretized using a 6-point Abbott-Ionescu implicit finite difference format, and a computational grid is formed by alternately arranging the grids in the order of water level-flow-water level, and the time step Δt of the water level point and the flow point calculations are the same;
[0022] The continuous equation is discretized as:
[0023] The equation of motion is discretized as:
[0024] Where j represents the jth grid point in the calculation grid; α, β, and γ are functions of the flow width and external input δ, respectively, which vary with the flow and water depth at time s and the flow at time s+1 / 2; δ j represents the external input at grid point j;
[0025] They represent the flow rates at grid point j-1, grid point j, and grid point j+1 at time s+1 respectively; They represent the water depths at grid point j-1, grid point j, and grid point j+1 at time s+1 respectively.
[0026] As a preferred solution of the present invention, the model calibration specifically calibrates the riverbed roughness n, sets the riverbed roughness n according to different river sections, and calibrates the model based on synchronous hydrological test data;
[0027] Historical flood data were collected for model verification, and the Nash efficiency coefficient NSE was used to evaluate the simulation results of the one-dimensional hydrodynamic model. The calculation formula of the Nash efficiency coefficient NSE is as follows:
[0028]
[0029] In the formula, M is the number of data in the data set, is the measured value of the mth data, is the model simulation value of the mth data, is the average value of all measured values in the data set.
[0030] As a preferred solution of the present invention, the method for calculating runoff generation and convergence as the boundary condition of the one-dimensional hydrodynamic model includes:
[0031] Collect the basin's multi-year rainfall data, use Thiessen polygons to divide the units to calculate the surface rainfall, and use the basin's empirical reasoning formula to calculate the rainfall runoff in the tributary catchment area;
[0032] The weight of each rain gauge in each sub-basin is calculated according to the area of the sub-basin divided by Thiessen polygon, and the rainfall weight matrix of the Thiessen polygon surface is obtained. The confluence is calculated according to the inference formula method.
[0033] The calculated rainfall runoff and confluence are used as boundary conditions of the one-dimensional hydrodynamic model.
[0034] As a preferred solution of the present invention, the method for simulating and calculating the water level of a key control section under typical working conditions includes:
[0035] Analyze the frequency of long-term historical measured downstream water level or tide level data, calculate the highest tidal level with different recurrence periods, and select key control sections and control water levels according to the basin flood control standards;
[0036] According to historical data, downstream water level or tide level data with different recurrence periods are selected as typical operating conditions, and combined with interval inflow data, the key control section water level H1 corresponding to different upstream flow data is calculated.
[0037] As a preferred solution of the present invention, the importance of each influencing factor is evaluated by calculating the Gini coefficient and the Pearson correlation coefficient, and the key influencing factors are identified, specifically including:
[0038] Given a dataset D of influencing factors, the calculation formula for the Gini coefficient of dataset D is:
[0039]
[0040]
[0041] In the formula, Gini(D) is the Gini coefficient of the data set D; K represents the number of categories of influencing factors, p k represents the proportion of the k-th impact factor in the data set D; Gini(D, A) represents the Gini coefficient of impact factor A in the data set D;
[0042] When calculating the Gini coefficient of influencing factor A, the data set D is divided into two subsets, D1 and D2, according to the value of influencing factor A, and the Gini coefficient corresponding to each value is calculated. After weighting, the Gini coefficient of influencing factor A is obtained;
[0043] The calculation formula of the Pearson correlation coefficient is:
[0044]
[0045] In the formula, r represents the Pearson correlation coefficient; X i , Y i denote the i-th observed value of variable X and variable Y respectively, Represents the mean of the observed values of variable X and variable Y respectively; I represents the number of observed values;
[0046] The automatic parameter optimization specifically involves automatically optimizing the model parameters using a Bayesian optimization algorithm.
[0047] As a preferred embodiment of the present invention, the algorithms used by the machine learning model include random forest algorithm, long short-term memory algorithm, support vector machine algorithm and decision tree algorithm;
[0048] When the algorithm used by the machine learning model is specifically a random forest algorithm, the machine learning model constructed after key influencing factor identification and parameter automatic optimization is specifically a random forest proxy model;
[0049] The analysis of the nonlinear relationship between the water level of the key control section and each influencing factor, and the calculation of the water level of the key control section under different influencing factors, specifically includes:
[0050] According to the given upstream flow data, downstream water level or tide level data and interval inflow data, the water level H1 of the key control section under different combinations is calculated by the random forest proxy model.
[0051] As a preferred solution of the present invention, the method of inversely calculating the upstream maximum flow rate based on the water level of the key control section and the downstream boundary, and drawing a flood safety knowledge map based on the water level of the key control section and the downstream water level or tidal level data as a conditional matrix includes:
[0052] A random forest regression model was constructed. According to the calculation results of the random forest proxy model, the downstream water level or tide level data and the key control section water level H1 were used as input conditions to form a conditional grid matrix of 0.01 m, and the maximum upstream downstream safety flow Q under different discharge time conditions was reversely output. max , forming a threshold graph as a flood safety knowledge graph.
[0053] A system for constructing a flood safety knowledge graph by combining machine learning with a traditional mechanism model, the system comprising: a mechanism model module for simulating and calculating changes in the hydrological situation of a river basin and a machine learning model module for constructing a flood safety knowledge graph of the river basin;
[0054] The mechanism model module specifically includes:
[0055] Data collection module, used to collect river section data, water level data, flow data and rainfall data in the basin and perform data preprocessing;
[0056] One-dimensional hydrodynamic model module, which is used to construct a one-dimensional hydrodynamic model based on the Saint-Venant equations according to the collected river section data, water level data and flow data, and simulate and calculate the water level of key control sections under typical working conditions, including a model construction unit, a model calibration unit, a model verification unit and a boundary condition calculation unit;
[0057] The model building unit is used to discretize the Saint-Venant equations using a 6-point Abbott-Ionescu implicit finite difference format, and to form a calculation grid in an alternating order of water level-flow-water level, and the calculation time step of the water level point and the flow point is the same;
[0058] The model calibration unit is used to calibrate the riverbed roughness n, set the riverbed roughness n according to different river sections, and perform model calibration based on synchronous hydrological test data;
[0059] The model verification unit is used to collect historical flood data for model verification, and use the Nash efficiency coefficient NSE to evaluate the simulation results of the one-dimensional hydrodynamic model;
[0060] The boundary condition calculation unit is used to calculate the flow generation and convergence as the boundary condition of the one-dimensional hydrodynamic model;
[0061] The machine learning module specifically includes:
[0062] The machine learning model building module is used to take the boundary condition factors of the one-dimensional hydrodynamic model as input conditions, the simulation calculation results as training samples, identify key influencing factors and automatically optimize parameters to build a machine learning model;
[0063] An analysis module, used to analyze the nonlinear relationship between the water level of the key control section and the key influencing factors through the machine learning model, and calculate the water level of the key control section under different influencing factors;
[0064] The flood safety knowledge graph construction module is used to construct a random forest regression model. According to the calculation results of the machine learning model, the downstream water level or tide level data and the key control section water level H1 are respectively formed into a conditional grid matrix with a value of 0.01m as input conditions, and the upstream maximum downstream safety flow Q under different discharge time conditions is reversely output. max , forming a threshold graph as a flood safety knowledge graph.
[0065] Compared with the prior art, the beneficial effects of the present invention are: simulating typical working conditions through hydrodynamic models, simulating and calculating changes in hydrological situations, and quantifying flood discharge thresholds and flood discharge timing under various situations; combining random forest machine learning methods to establish a response relationship between flood discharge thresholds and downstream water levels / tide levels, flood discharge time, control water levels and other factors, and finely describing the changing laws of floods in river flood control sections, forming an accurate and timely real-time water level forecasting model, clarifying the safe flood discharge threshold, drawing threshold maps, and constructing high-precision safe flood discharge maps under different situations, which can provide a scientific basis for accurate decision-making on water conservancy events, and provide scientific guidance for flood disaster prevention and control in river basins and water conservancy project scheduling; supporting the construction of knowledge graphs, providing an intelligent kernel for digital twin river basins and digital twin water conservancy projects, realizing accurate and timely river basin flood control, water resources management and allocation, and minimizing river basin flood losses. BRIEF DESCRIPTION OF THE DRAWINGS
[0066] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative labor.
[0067] in:
[0068] Figure 1 is a flow chart of the method of the present invention;
[0069] Figure 2 Schematic diagram of solving equations using a 6-point Abbott-Ionescu implicit finite difference format in an embodiment of the present invention;
[0070] Figure 3 A flow chart of a method for constructing a random forest proxy model in an embodiment of the present invention;
[0071] Figure 4 This is a schematic diagram of the knowledge graph of flood safety in accordance with an embodiment of the present invention;
[0072] Figure 5 It is a schematic diagram of the modular structure of the system of the present invention. DETAILED DESCRIPTION
[0073] In order to make the purpose, technical solution and advantages of the embodiment of the present invention clearer, the technical solution of the embodiment of the present invention will be clearly and completely described below in conjunction with the drawings of the embodiment of the present invention. Obviously, the described embodiment is a part of the embodiment of the present invention, not all of the embodiments. Based on the described embodiment of the present invention, all other embodiments obtained by ordinary technicians in this field belong to the scope of protection of the present invention.
[0074] like Figure 1-Figure 4 As shown, it is an embodiment of the present invention, which provides a method for constructing a flood safety knowledge graph by combining machine learning with a traditional mechanism model, including the following steps:
[0075] S1: Simulate and calculate the changes in the basin's hydrological situation through a mechanism model, including:
[0076] S11: Measure river network sections, collect river section data, water level data, flow data and rainfall data in the basin, and perform data preprocessing to eliminate unreasonable data;
[0077] S12: Based on the collected river section data, water level data and flow data, a one-dimensional hydrodynamic model is constructed based on the Saint-Venant equations;
[0078] In a specific embodiment, a one-dimensional hydrodynamic model is constructed based on the Saint-Venant equations, specifically including:
[0079] The one-dimensional hydrodynamic model is based on the one-dimensional open channel unsteady flow equation, and its theoretical basis is the Saint-Venant equations, including the continuity equation and the motion equation;
[0080] The continuity equation is:
[0081]
[0082] In the formula, A represents the cross-sectional area of the water flow, in m 2 ; t represents time, unit is s; Q represents net flow of river section, unit is m 3 / s; x represents the distance along the water flow direction, in meters; q represents the lateral inflow per unit length of the river section, including uniform lateral inflow and concentrated lateral inflow, in meters 3 / s;
[0083] The equation of motion is:
[0084]
[0085] Where g is the acceleration due to gravity, in m 2 / s; α is the momentum correction coefficient; h is the water depth, in m; C is the Xie Cai coefficient; n is the riverbed roughness, R is the hydraulic radius, in m;
[0086] The Saint-Venant equations are discretized using the 6-point Abbott-Ionescu implicit finite difference scheme, and the computational grid is arranged alternately in the order of water level-discharge-water level, and the time step Δt of the water level point and the discharge point calculation is the same;
[0087] The continuous equation is discretized as:
[0088] The equation of motion is discretized as:
[0089] Where j represents the jth grid point in the calculation grid; α, β, and γ are functions of the flow width and external input δ, respectively, and vary with the flow and water depth at time s and the flow at time s+1 / 2; δ j represents the external input at grid point j;
[0090] They represent the flow rates at grid point j-1, grid point j, and grid point j+1 at time s+1 respectively; Respectively represent the water depths at grid point j-1, grid point j, and grid point j+1 at time s+1;
[0091] S13: Perform model calibration and model verification to determine whether the accuracy of the one-dimensional hydrodynamic model meets the requirements; if not, re-calibrate and verify the model; if yes, calculate the runoff as the boundary condition of the one-dimensional hydrodynamic model, and simulate and calculate the water level of the key control section under typical working conditions;
[0092] In one embodiment, the model calibration specifically calibrates the riverbed roughness n, sets the riverbed roughness n according to different river sections, and calibrates the model based on synchronous hydrological test data;
[0093] Historical flood data were collected to verify the model, and the Nash-Sutcliffe efficiency coefficient (NSE) was used to evaluate the simulation results of the one-dimensional hydrodynamic model. The calculation formula of the Nash efficiency coefficient NSE is as follows:
[0094]
[0095] In the formula, M is the number of data in the data set, is the measured value of the mth data, is the model simulation value of the mth data, is the average value of all measured values in the data set.
[0096] S14: Calculate runoff as boundary conditions for a one-dimensional hydrodynamic model using the following methods:
[0097] Collect the basin's multi-year rainfall data, use Thiessen polygons to divide the units to calculate the surface rainfall, and use the basin's empirical reasoning formula to calculate the rainfall runoff in the tributary catchment area;
[0098] The weight of each rain gauge in each sub-basin is calculated according to the area of the sub-basin divided by Thiessen polygon, and the rainfall weight matrix of the Thiessen polygon surface is obtained. The confluence is calculated according to the inference formula method.
[0099] The calculated rainfall runoff and confluence are used as boundary conditions of the one-dimensional hydrodynamic model.
[0100] S15: Simulate and calculate the water level of key control sections under typical working conditions, including:
[0101] Conduct frequency analysis on the long-term historical measured downstream water level or tide level data, calculate the highest tide levels with different recurrence periods, and select key control sections and control water levels according to the basin flood control standards;
[0102] According to historical data, downstream water level or tide level data with different recurrence periods are selected as typical operating conditions, and combined with interval inflow data, the key control section water level H1 corresponding to different upstream flow data is calculated.
[0103] S2: Construct a knowledge graph of flood safety in the basin through machine learning models, including:
[0104] S21: The boundary condition factors of the one-dimensional hydrodynamic model are used as input conditions, and the simulation calculation results are used as training samples. The key influencing factors are identified and the parameters are automatically optimized to build a machine learning model;
[0105] The boundary condition factors include upstream flow, downstream water level or tide level data, and interval inflow flow;
[0106] In a specific embodiment, the importance of each influencing factor is evaluated by calculating the Gini coefficient and the Pearson correlation coefficient to identify the key influencing factors;
[0107] The Gini coefficient is used to characterize the characteristic importance of each influencing factor, avoiding the blindness and subjectivity of the selection of influencing factors; the Pearson correlation coefficient is calculated to describe the linear correlation between two variables, thereby solving the autocorrelation problem of each influencing factor and avoiding the information redundancy caused by the multiple or repeated consideration of related factors when selecting parameters;
[0108] Specifically, given a data set D of influencing factors, the calculation formula of the Gini coefficient of data set D is:
[0109]
[0110]
[0111] In the formula, Gini(D) is the Gini coefficient of the data set D; K represents the number of categories of influencing factors, p k represents the proportion of the k-th impact factor in the data set D; Gini(D, A) represents the Gini coefficient of impact factor A in the data set D;
[0112] When calculating the Gini coefficient of influencing factor A, the data set D is divided into two subsets, D1 and D2, according to the value of influencing factor A, and the Gini coefficient corresponding to each value is calculated. After weighting, the Gini coefficient of influencing factor A is obtained;
[0113] The calculation formula of Pearson correlation coefficient is:
[0114]
[0115] In the formula, r represents the Pearson correlation coefficient; X i , Y i denote the i-th observed value of variable X and variable Y respectively, Represents the mean of the observed values of variable X and variable Y respectively; I represents the number of observed values;
[0116] In one embodiment, the automatic optimization of parameters is specifically to automatically optimize the model parameters using a Bayesian optimization algorithm;
[0117] Optionally, the algorithm used by the machine learning model includes but is not limited to a random forest algorithm, a long short-term memory algorithm, a support vector machine algorithm, and a decision tree algorithm;
[0118] The algorithm used in the machine learning model in this embodiment is specifically a random forest algorithm, which constructs a random forest proxy model by identifying key influencing factors and automatically optimizing parameters to achieve rapid and accurate water level forecasting;
[0119] The advantage of random forest is that it can automatically select the best features for splitting, avoiding the problems of overfitting and high variance; at the same time, random forest can also handle a large number of features and samples and is suitable for various types of data sets.
[0120] S22: Through machine learning models, the nonlinear relationship between the water level of key control sections and key influencing factors is analyzed, and the water level of key control sections under different influencing factors is calculated;
[0121] In one embodiment, step S22 specifically includes: calculating the key control section water level H1 under different combinations through a random forest proxy model according to given upstream flow data, downstream water level or tide level data and interval inflow data;
[0122] S23: Reverse the upstream maximum flow rate based on the water level of the key control section and the downstream boundary, and draw a knowledge map of flood safety based on the water level of the key control section and the downstream water level or tidal level data as the conditional matrix;
[0123] In one embodiment, step S23 specifically includes:
[0124] A random forest regression model was constructed. According to the calculation results of the random forest proxy model, the downstream water level or tide level data and the key control section water level H1 were used as input conditions to form a conditional grid matrix of 0.01 m, and the maximum upstream downstream safety flow Q under different discharge time conditions was reversely output. max , forming a threshold graph as a flood safety knowledge graph.
[0125] Taking the Tanjiang River Basin in Guangdong Province as an example, a knowledge map of flood safety was drawn. The Tanjiang River Basin is a tidal river section, and the downstream boundary is the tide level. This method is also applicable to non-tidal river sections.
[0126] S1: Simulate and calculate the changes in the basin's hydrological regime through a mechanism model;
[0127] S11: Measure river network sections, collect river section data, water level data, flow data and rainfall data in the basin, and perform data preprocessing to eliminate unreasonable data;
[0128] S12: Based on the collected river section data, water level data and flow data, a one-dimensional hydrodynamic model is constructed based on the Saint-Venant equations;
[0129] S13: Perform model calibration and model verification to determine whether the accuracy of the one-dimensional hydrodynamic model meets the requirements; if not, re-calibrate and verify the model; if yes, calculate the runoff as the boundary condition of the one-dimensional hydrodynamic model, and simulate and calculate the water level of the key control section under typical working conditions;
[0130] The main parameters of the one-dimensional hydrodynamic model are the riverbed roughness n. This time, the riverbed roughness n is set according to different river sections. The synchronous hydrological test data from July 29 to July 31, 2022 in the Tanjiang River Basin were collected. Guanchong Station is used as the lower boundary of the model, and Changsha Station, Shizui Station, and Sanjiangkou Station are used as reference data for model calibration. The model was calibrated according to the synchronous hydrological test data. The Nash coefficients of the water level all reached above 0.96, and the Nash coefficients of the flow all reached above 0.9, and the overall calibration effect was good. The roughness value zone calibration results are 0.032 in the upstream section of the main stream and 0.015 in the downstream end section, and the roughness of the tributary rivers is uniformly set to 0.032.
[0131] A one-dimensional hydrodynamic model was used to simulate the hydrological process in the Tanjiang River Basin during Typhoon Mangkhut from September 15 to September 17, 2018. The verification results showed that the Nash coefficient of the water level was above 0.97, and the simulation effect was good. This model can be used to study the flood evolution of the Tanjiang River Basin.
[0132] S14: Calculate runoff as boundary conditions for a one-dimensional hydrodynamic model;
[0133] The rainfall runoff in the Tanjiang River Basin is an uncontrolled area. Therefore, when a flood disaster occurs, the upstream water can only be regulated by the Heshan Sluice. Therefore, this study focuses on the impact of the discharge of the Heshan Sluice on the water level, and analyzes the safe discharge threshold of the Heshan Sluice corresponding to the flood control requirements of the key control section. Considering the impact of rainfall runoff on flood discharge, the basin's multi-year rainfall data was collected, and the surface rainfall was calculated by using the Thiessen polygon to divide 75 units. The rainfall runoff of the 26 tributary catchments was calculated through an empirical model, and the results were used as the boundary conditions of the hydrodynamic model. During the typhoon storm surge, the rainfall data during the "Mangkhut" typhoon was used, and the maximum value of the total rainfall runoff in the basin was 3800m 3 / s, average rainfall flow is 914m 3 / s, and the other tidal types use the average rainfall flow in September 2018, which is 100m 3 / s. Calculate the runoff according to the inference formula method of the Guangdong Province Storm Runoff Calculation Chart.
[0134] S15: Simulate and calculate the water level of key control sections under typical working conditions;
[0135] Conduct frequency analysis on the long-term historical measured downstream water level or tide level data, calculate the highest tide levels with different recurrence periods, and select key control sections and control water levels according to the basin flood control standards;
[0136] According to the "Revision Report on the Comprehensive Planning of the Jiangmen River Basin in Guangdong Province (2005-2030)", the flood control standard along the mainstream of the Tanjiang River is set at a 30-year flood. However, due to historical reasons, there is no embankment project in the Changsha Station section. The current warning water level is 2.0m, and the flood control standard is considered to be once in 5 years. The two control sections of Changsha Station and Shizui Station were selected, and a frequency analysis was conducted based on the measured water levels of Changsha Station and Shizui Station from 1976 to 2021. According to the results of the frequency analysis, the two control sections of Changsha Station and Shizui Station were selected. The control water level of Changsha Station is 2.40 meters for a 5-year flood, and the control water level of Shizui Station is 2.43 meters for a 30-year flood.
[0137] According to historical data, downstream water level or tide level data with different recurrence periods are selected as typical operating conditions, and combined with interval inflow data, the key control section water level H1 corresponding to different upstream flow data is calculated.
[0138] S2: Construct a knowledge graph of flood safety in a river basin through machine learning models;
[0139] The boundary condition factors of the one-dimensional hydrodynamic model are used as input conditions, and the simulation calculation results are used as training samples. The machine learning model is constructed after the key influencing factors are identified and the parameters are automatically optimized.
[0140] After calculation, the greatest impact on the river water level in the embodiment is the downstream water level / tidal level H; followed by the upstream flow Q; and the remaining 10 major interval inflows Q i , including tributary inflows and reservoir inflows.
[0141] The specific methods for training and testing machine learning algorithms are:
[0142] The algorithm used in the machine learning model in this embodiment is specifically a random forest algorithm, which constructs a random forest proxy model by identifying key influencing factors and automatically optimizing parameters to achieve rapid and accurate water level forecasting;
[0143] This example extracts 3860 hours of hourly data from the mechanism model calculation as the training set, and uses 200 hours of hourly data from storm surges and dragon boat floods in the historical period as the test set. The training set is used to train the machine learning algorithm, and the test set is used to verify the accuracy of the machine learning algorithm. This example uses downstream water level or tide level data H, time t, and 10 main interval water inflow Q i , upstream discharge flow data Q and other 12 factors are used as input conditions of the random forest proxy model. The nonlinear response relationship between the water level of the key control section and other hydrological factors is calculated through random forest, and the water level H1 of the key control section is output to form an accurate and timely real-time water level forecast model for the key section.
[0144] A random forest regression model was constructed. According to the calculation results of the random forest proxy model, the downstream water level or tide level data and the key control section water level H1 were used as input conditions to form a conditional grid matrix of 0.01 m, and the maximum upstream downstream safety flow Q under different discharge time conditions was reversely output. max , forming a threshold graph as a flood safety knowledge graph.
[0145] The specific technical process of the random forest machine learning algorithm in this embodiment is as follows:
[0146] 1. Operating Environment
[0147] 1. Equipped with PyCharm
[0148] 2. Import related libraries
[0149] import pandas as pd
[0150] import numpy as np
[0151] from sklearn.ensemble import RandomForestRegressor
[0152] from scipy.stats import pearsonr
[0153] from sklearn.metrics import mean_squared_error
[0154] from sklearn.preprocessing import MinMaxScaler
[0155] from bayes_opt import BayesianOptimization
[0156] 2. Import data
[0157] 1. Sample set: 4060 groups, each group is time t, downstream water level / tide level H, upstream flow Q, and the remaining 10 main interval inflows Q i .
[0158] 2. Characteristic variables: 4060, key control section water level H1.
[0159] III. Methods
[0160] 1. Divide the training set (3860 groups) and the test set (200 groups) into txt files respectively.
[0161] Importing training dataset
[0162] train_data=pd.read_csv('traindata.txt',index_col=0,sep='\t')
[0163] train_data=train_data.dropna(axis=0,how='any')
[0164] Importing prediction dataset
[0165] test_data=pd.read_csv('testdata.txt',index_col=0,sep='\t')
[0166] test_data=test_data.dropna(axis=0,how='any')
[0167] 2. Random Forest Machine Learning Algorithm
[0168]
[0169]
[0170] 3. Random Forest Knowledge Graph Algorithm
[0171] import pandas as pd
[0172] from sklearn.ensemble import RandomForestRegressor
[0173] import numpy as np
[0174] import matplotlib.pyplot as plt
[0175] #Read data
[0176] data=pd.read_csv('your_data.txt',sep='\t')
[0177] #Extract features and target values
[0178] H_values = data['H'].values
[0179] H1_values = data['H1'].values
[0180] Q_values = data['Q'].values
[0181] #Build feature matrix
[0182] features=np.column_stack((H_values,H1_values))
[0183] #Build a random forest regression model
[0184] rf_model=RandomForestRegressor(n_estimators=50,random_state=42)
[0185] #Train model
[0186] rf_model.fit(features,Q_values)
[0187] #Generate grid points
[0188] grid_H,grid_H1=np.meshgrid(np.linspace(min(H_values),
[0189] max(H_values)),np.linspace(min(H1_values),max(H1_values)))
[0190] #Convert the grid point data into a one-dimensional array
[0191] grid_data=np.column_stack((grid_H.ravel(),grid_H1.ravel()))
[0192] #Use the model to make predictions
[0193] predicted_Q_grid=rf_model.predict(grid_data)
[0194] #Convert the prediction results into a grid shape
[0195] predicted_Q_grid=predicted_Q_grid.reshape(grid_H.shape)
[0196] #Draw a matrix color block diagram
[0197] plt.figure(figsize=(10,8))
[0198] plt.pcolormesh(grid_H,grid_H1,predicted_Q_grid,cmap='viridis',shading='auto')
[0199] plt.scatter(H_values,H1_values,c=Q_values,cmap='viridis',edgecolors='k',linewidths=0.5,alpha=0.8)
[0200] plt.colorbar(label="Qmax value")
[0201] plt.xlabel('H')
[0202] plt.ylabel('H1')
[0203] plt.show()
[0204] The above process includes the main parameter settings and calling functions of the random forest machine learning algorithm for water level prediction and map drawing.
[0205] like Figure 5 As shown, another embodiment of the present invention provides a system for constructing a flood safety knowledge graph by combining machine learning with a traditional mechanism model, including a mechanism model module for simulating and calculating changes in the hydrological situation of a river basin and a machine learning model module for constructing a flood safety knowledge graph of a river basin;
[0206] The mechanism model module specifically includes:
[0207] Data collection module, used to collect river section data, water level data, flow data and rainfall data in the basin and perform data preprocessing;
[0208] One-dimensional hydrodynamic model module, which is used to construct a one-dimensional hydrodynamic model based on the Saint-Venant equations according to the collected river section data, water level data and flow data, and simulate and calculate the water level of key control sections under typical working conditions, including a model construction unit, a model calibration unit, a model verification unit and a boundary condition calculation unit;
[0209] The model building unit is used to discretize the Saint-Venant equations using a 6-point Abbott-Ionescu implicit finite difference format, and the computational grid is arranged alternately in the order of water level-discharge-water level, and the calculation time step of the water level point and the discharge point is the same;
[0210] The model calibration unit is used to calibrate the riverbed roughness n. The riverbed roughness n is set according to different river sections and the model calibration is performed based on synchronous hydrological test data.
[0211] The model verification unit is used to collect historical flood data for model verification and use the Nash efficiency coefficient to evaluate the simulation results of the one-dimensional hydrodynamic model;
[0212] The boundary condition calculation unit is used to calculate the flow generation and convergence as the boundary conditions of the one-dimensional hydrodynamic model;
[0213] The machine learning model module specifically includes:
[0214] The machine learning model building module is used to take the boundary condition factors of the one-dimensional hydrodynamic model as input conditions, the simulation calculation results as training samples, identify key influencing factors and automatically optimize parameters to build a machine learning model;
[0215] The analysis module is used to analyze the nonlinear relationship between the water level of the key control section and the key influencing factors through a machine learning model, and calculate the water level of the key control section under different influencing factors;
[0216] The flood safety knowledge graph construction module is used to construct a random forest regression model. According to the calculation results of the machine learning model, the downstream water level or tide level data and the key control section water level H1 are respectively formed into a conditional grid matrix with a value of 0.01m as input conditions, and the upstream maximum downstream safety flow Q under different discharge time conditions is reversely output. max , forming a threshold graph as a flood safety knowledge graph.
[0217] To sum up, the present invention simulates typical working conditions through a hydrodynamic model, simulates and calculates changes in hydrological situations, and quantifies flood discharge thresholds and flood discharge timing under various situations; combined with random forest machine learning methods, a response relationship between the flood discharge threshold and downstream water level / tide level, flood discharge time, control water level and other factors is established, and a detailed description of the changing law of floods in the flood control section of the river is given to form an accurate and timely real-time water level forecast model, clarify the safe flood discharge threshold, draw a threshold map, and construct a high-precision safe flood discharge map under different situations, which can provide a scientific basis for accurate decision-making on water conservancy events, and provide scientific guidance for flood disaster prevention and control in the basin and scheduling of water conservancy projects; support the construction of knowledge graphs, provide an intelligent kernel for digital twin basins and digital twin water conservancy projects, realize accurate and timely basin flood control, water resources management and allocation, and minimize basin flood losses.
[0218] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any other combination. When implemented using software, it can be implemented in whole or in part in the form of a computer program product, which includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function according to the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. The storage medium can be a read-only memory, a disk or an optical disk, etc.
[0219] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of various changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A method for constructing a flood safety knowledge graph by combining machine learning with traditional mechanism models, characterized in that: The method comprises: The mechanism model is used to simulate and calculate the changes in the basin's hydrological situation, including: Measure river network sections, collect river section data, water level data, flow data and rainfall data in the basin and perform data preprocessing; According to the collected river section data, water level data and flow data, a one-dimensional hydrodynamic model is constructed based on the Saint-Venant equations; Perform model calibration and model verification to determine whether the accuracy of the one-dimensional hydrodynamic model meets the requirements; if not, re-calibrate and verify the model; if yes, calculate the runoff as the boundary condition of the one-dimensional hydrodynamic model, and simulate and calculate the water level of the key control section under typical working conditions; The knowledge graph of flood safety in the river basin is constructed through machine learning models, including: The boundary condition factors of the one-dimensional hydrodynamic model are used as input conditions, and the simulation calculation results are used as training samples to identify key influencing factors and automatically optimize parameters to build a machine learning model; wherein the boundary condition factors include upstream flow, downstream water level or tidal level data, and interval inflow flow; By using the machine learning model, the nonlinear relationship between the water level of the key control section and the key influencing factors is analyzed, and the water level of the key control section under different influencing factors is calculated; The maximum upstream flow is inferred based on the water level of the key control section and the downstream boundary, and a flood safety knowledge map is drawn based on the water level of the key control section and the downstream water level or tidal level data as the conditional matrix.
2. According to claim 1, a method for constructing a flood safety knowledge graph by combining machine learning with a traditional mechanism model is characterized in that: The one-dimensional hydrodynamic model is constructed based on the Saint-Venant equations, specifically including: The one-dimensional hydrodynamic model is based on the one-dimensional open channel unsteady flow equation, and its theoretical basis is the Saint-Venant equations, including the continuity equation and the motion equation; The continuity equation is: ; In the formula, A Indicates the cross-sectional area of water flow, in m 2 ; t Indicates time, the unit is s; Q Indicates the net flow of the river section, in m 3 / s; x Indicates the distance along the water flow direction, in meters; q It indicates the lateral inflow per unit length of river section, including uniform lateral inflow and concentrated lateral inflow, in m 3 / s; The equation of motion is: ; In the formula, g is the acceleration due to gravity, in m 2 / s; α is the momentum correction factor; h is the water depth in m; C is Xiecai coefficient; n is the riverbed roughness, R is the hydraulic radius, in m; The Saint-Venant equations are discretized using the 6-point Abbott-Ionescu implicit finite difference scheme, and the computational grid is arranged alternately in the order of water level-discharge-water level, and the time step ∆𝑡 for the calculation of water level points and discharge points is the same; The continuous equation is discretized as: ; The equation of motion is discretized as: ; In the formula, j represents the jth grid point in the computational grid; α , β , γ They are overcurrent width and external input The function of s The flow rate and water depth at the moment and s +1 / 2 moment the flow rate changes; Represented at the grid point j External input at , , Represents the grid points j -1 location, grid point j Grid points j +1 in s +1 flow rate at time; , , Represents the grid points j -1 location, grid point j Grid points j +1 in s +1 moment of water depth.
3. According to claim 1, a method for constructing a flood safety knowledge graph by combining machine learning with a traditional mechanism model is characterized in that: The model calibration is specifically for the riverbed roughness n The riverbed roughness is calibrated according to different river sections. n Set up and calibrate the model based on synchronous hydrological test data; Collect historical flood data for model validation and use Nash efficiency coefficient NSE Evaluate the simulation results of the one-dimensional hydrodynamic model, the Nash efficiency coefficient NSE The calculation formula is as follows: ; In the formula, M is the number of data in the dataset, is the measured value of the 𝑚th data, is the model simulation value of the 𝑚th data, is the average value of all measured values in the data set.
4. According to claim 1, a method for constructing a flood safety knowledge graph by combining machine learning with a traditional mechanism model is characterized in that: The method of calculating the flow generation and convergence as the boundary condition of the one-dimensional hydrodynamic model includes: Collect the basin's multi-year rainfall data, use Thiessen polygons to divide the units to calculate the surface rainfall, and use the basin's empirical reasoning formula to calculate the rainfall runoff in the tributary catchment area; The weight of each rain gauge in each sub-basin is calculated according to the area of the sub-basin divided by Thiessen polygon, and the rainfall weight matrix of the Thiessen polygon surface is obtained. The confluence is calculated according to the inference formula method. The calculated rainfall runoff and confluence are used as boundary conditions of the one-dimensional hydrodynamic model.
5. According to claim 1, a method for constructing a flood safety knowledge graph by combining machine learning with a traditional mechanism model is characterized in that: The method for simulating and calculating the water level of a key control section under typical working conditions includes: Analyze the frequency of long-term historical measured downstream water level or tide level data, calculate the highest tidal level with different recurrence periods, and select key control sections and control water levels according to the basin flood control standards; According to historical data, downstream water level or tide level data with different recurrence periods are selected as typical operating conditions, and combined with interval inflow data, the key control section water level H1 corresponding to different upstream flow data is calculated.
6. According to claim 1, a method for constructing a flood safety knowledge graph by combining machine learning with a traditional mechanism model is characterized in that: The importance of each influencing factor was evaluated by calculating the Gini coefficient and Pearson correlation coefficient, and key influencing factors were identified, including: Given a dataset D of influencing factors, the calculation formula for the Gini coefficient of dataset D is: ; ; Where Gini(D) is the Gini coefficient of data set D; K Indicates the number of categories of impact factors, Indicates the first k The proportion of impact factors of the same class; Gini(D, A) represents the Gini coefficient of impact factor A in data set D; When calculating the Gini coefficient of influencing factor A, the data set D is divided into two subsets, D1 and D2, according to the value of influencing factor A, and the Gini coefficient corresponding to each value is calculated. After weighting, the Gini coefficient of influencing factor A is obtained; The calculation formula of the Pearson correlation coefficient is: ; In the formula, r represents the Pearson correlation coefficient; Respectively represent variables X and variables Y No. i Observations, , Respectively represent variables X and variables Y The mean of the observed values; I represents the number of observations; The automatic parameter optimization specifically involves automatically optimizing the model parameters using a Bayesian optimization algorithm.
7. According to claim 1, a method for constructing a flood safety knowledge graph by combining machine learning with a traditional mechanism model is characterized in that: The algorithms used in the machine learning model include random forest algorithm, long short-term memory algorithm, support vector machine algorithm and decision tree algorithm; When the algorithm used by the machine learning model is specifically a random forest algorithm, the machine learning model constructed after key influencing factor identification and parameter automatic optimization is specifically a random forest proxy model; The analysis of the nonlinear relationship between the water level of the key control section and each influencing factor, and the calculation of the water level of the key control section under different influencing factors, specifically includes: According to the given upstream flow data, downstream water level or tide level data and interval inflow data, the water level H1 of the key control section under different combinations is calculated by the random forest proxy model.
8. The method of constructing a flood safety knowledge graph by combining machine learning with a traditional mechanism model according to claim 7 is characterized in that: The method of inverting the upstream maximum flow rate based on the water level of the key control section and the downstream boundary, and drawing the flood safety knowledge map based on the water level of the key control section and the downstream water level or tidal level data as the condition matrix includes: A random forest regression model was constructed. According to the calculation results of the random forest proxy model, the downstream water level or tide level data and the key control section water level H1 were used as input conditions to form a conditional grid matrix of 0.01 m, and the maximum upstream downstream safety flow Q under different discharge time conditions was reversely output. max , forming a threshold graph as a flood safety knowledge graph.
9. A system for constructing a flood safety knowledge graph based on a method of combining machine learning with a traditional mechanism model as described in any one of claims 1 to 8, characterized in that: The system includes: a mechanism model module for simulating and calculating changes in the hydrological situation of the basin and a machine learning model module for constructing a knowledge graph of flood safety in the basin; The mechanism model module specifically includes: Data collection module, used to collect river section data, water level data, flow data and rainfall data in the basin and perform data preprocessing; One-dimensional hydrodynamic model module, which is used to construct a one-dimensional hydrodynamic model based on the Saint-Venant equations according to the collected river section data, water level data and flow data, and simulate and calculate the water level of key control sections under typical working conditions, including a model construction unit, a model calibration unit, a model verification unit and a boundary condition calculation unit; The model building unit is used to discretize the Saint-Venant equations using a 6-point Abbott-Ionescu implicit finite difference format, and to form a calculation grid in an alternating order of water level-flow-water level, and the calculation time step of the water level point and the flow point is the same; The model calibration unit is used to calibrate the riverbed roughness n The riverbed roughness is calibrated according to different river sections. n Set up and calibrate the model based on synchronous hydrological test data; The model verification unit is used to collect historical flood data for model verification, using the Nash efficiency coefficient NSE evaluating simulation results of the one-dimensional hydrodynamic model; The boundary condition calculation unit is used to calculate the flow generation and convergence as the boundary condition of the one-dimensional hydrodynamic model; The machine learning model module specifically includes: The machine learning model building module is used to take the boundary condition factors of the one-dimensional hydrodynamic model as input conditions, the simulation calculation results as training samples, identify key influencing factors and automatically optimize parameters to build a machine learning model; An analysis module, used to analyze the nonlinear relationship between the water level of the key control section and the key influencing factors through the machine learning model, and calculate the water level of the key control section under different influencing factors; The flood safety knowledge graph construction module is used to construct a random forest regression model. According to the calculation results of the machine learning model, the downstream water level or tide level data and the key control section water level H1 are respectively formed into a conditional grid matrix with a value of 0.01m as input conditions, and the upstream maximum downstream safety flow Q under different discharge time conditions is reversely output. max , forming a threshold graph as a flood safety knowledge graph.
