Hydropower station reservoir level prediction analysis method and system and storage medium
By introducing three-dimensional terrain modeling and graph neural networks in reservoir water level prediction and constructing a directed weighted graph structure, the problem of insufficient expression of basin terrain structure in traditional methods is solved, and high-precision and fast-response water level prediction is achieved.
Patent Information
- Application Number
- CN202510669636.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-23
- Publication Date
- 2025-09-05
AI Technical Summary
Traditional reservoir water level prediction methods lack the spatial precision of upstream impacts on basin topography and hydrological processes, are unable to fully utilize modern digital elevation models and remote sensing observation data, and are difficult to adapt to nonlinear evolution and sudden changes in hydrological processes, resulting in insufficient prediction accuracy and response speed.
A three-dimensional digital terrain model is used to divide the watershed into regular grids, and a directed weighted graph structure is constructed. Combined with a graph neural network model, the reservoir water level increment is predicted through training with historical hydrological data, realizing the hydrological flow connection between spatial nodes and the spatiotemporal feature coupling modeling.
It improves the accuracy and reliability of reservoir water level prediction, can dynamically adapt to changes in complex river basin structures, and improves the scientific nature and response speed of prediction.
Smart Images

Figure CN120598100A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of reservoir water level prediction, and in particular to a method, system and storage medium for predicting and analyzing the water level of a hydropower station reservoir. Background Art
[0002] In the operation and management of hydropower stations, accurate prediction of reservoir water levels is a key link in ensuring dam scheduling safety, reasonable storage and discharge control, and timely flood control response. Especially during the flood season or extreme weather conditions, rapid changes in water levels are directly related to downstream safety, equipment operating boundaries, and scheduling strategy formulation. Compared with ordinary water storage reservoirs, hydropower station reservoirs have higher requirements for the timeliness and responsiveness of water level changes. The prediction results must not only have sufficient lead time, but also be able to dynamically reflect the driving effect of complex hydrological processes in the basin on water level changes. Therefore, in this application scenario, the hydrological modeling method needs to take into account the prediction accuracy, response speed and dynamic adaptability of the system.
[0003] Traditional reservoir water-level prediction methods primarily include statistically analyzed regression models, empirical formulas, and hydrological and hydraulic simulation models. These methods often focus on reservoir sites, inferring water levels through rainfall-runoff relationships or water balance equations. However, they typically rely on pre-defined formula structures or discrete parameters, neglecting hydrological interactions between spatial nodes in the upstream basin and the influence of topographic structure on flow paths. Furthermore, these methods rely less on basin spatial data and are unable to fully utilize modern digital elevation models and remote sensing observations, limiting their responsiveness and generalization capabilities to complex basin structures.
[0004] The main shortcomings of existing technologies are: First, they lack a detailed spatial representation of upstream influences on the basin's topographic structure and hydrological processes, failing to systematically map "multi-source spatial hydrological inputs" to water level changes; second, models are often based on point time series, failing to capture the dynamic evolution of the basin as a whole; and third, prediction logic is often based on static parameters or empirical structures, making it difficult to adapt to the nonlinear evolution, sudden events, or cumulative transmission effects between nodes in the hydrological process. Therefore, to meet the practical need for accurate prediction of hydropower station reservoir water levels, a new method is needed that integrates spatial topology, hydrological temporal evolution, and graphical model reasoning capabilities to improve the scientific nature and dynamic adaptability of predictions.
[0005] The above information disclosed in this Background section is only for enhancement of understanding of the background of the present disclosure and therefore it may contain information that does not form the prior art that is already known to a person of ordinary skill in the art. Summary of the Invention
[0006] The object of the present invention is to provide a method, system and storage medium for predicting and analyzing the water level of a hydropower station reservoir, so as to solve the problems raised in the above background technology.
[0007] To achieve the above object, the present invention provides the following technical solutions:
[0008] A method for predicting and analyzing the water level of a hydropower station reservoir comprises the following steps:
[0009] Define the affected watershed of the target reservoir and obtain digital elevation model data of the affected watershed. Build a three-dimensional digital terrain model of the affected watershed. Use the three-dimensional digital terrain model to divide the affected watershed into multiple regular grids. Define the center position of each grid as a spatial node, and set the spatial node of the regular grid where the reservoir is located as the master control node.
[0010] For each spatial node, the elevation values of all grid points within the grid cell to which it belongs are extracted, and the representative elevation value of the node is calculated using the elevation difference method. The main confluence direction and confluence node of each spatial node are determined using watershed analysis. The hydrological flow connection relationship between spatial nodes is established, and edge weights are assigned to construct a directed weighted graph structure.
[0011] Collect continuous historical hydrological data from each spatial node and reservoir water level data from the master node. The hydrological data includes rainfall, soil moisture, evaporation, and surface runoff with timestamps. The continuous historical hydrological data and reservoir water level data from the active node are divided into multiple time steps according to fixed time intervals.
[0012] The reservoir water level increment at the next time step relative to the previous time step is calculated based on the reservoir water level data. The directed weighted graph structure and the hydrological data of each spatial node at the previous time step are used as the feature input of the graph neural network model, and the reservoir water level increment at the next time step relative to the previous time step is used as the feature output to train the graph neural network model.
[0013] The hydrological data of each spatial node at the current moment is obtained in real time. The directed weighted graph structure and the hydrological data of each spatial node at the current moment are input into the trained graph neural network model to obtain the predicted reservoir water level increment for the next time step. Based on the predicted reservoir water level increment and the reservoir water level data of the active node at the current moment, the reservoir water level at the next time step is analyzed.
[0014] Furthermore, when setting the impact basin of the target reservoir, the center coordinate of the target reservoir is used as the center point of the target grid at layer 0, and the maximum number of horizontal and vertical layers is set to L respectively. x and L y , and set the target grid to be a square with a side length of G, with the 0th layer target grid as the center, and expand outward with the maximum number of layers in the horizontal and vertical directions as the range limit, to form a side length of G*(2L x +1)×G*(2L y+1) of the rectangular impact basin, when dividing the regular grid, all the standard grids have the same size and are square grids, and the number of grids of the digital elevation model covered by all regular grid cells is the same.
[0015] Furthermore, the specific logic of using the elevation difference method to calculate the representative elevation value of the node is as follows:
[0016] For each spatial node, all the digital elevation model raster data covered in the corresponding regular grid are extracted to form an elevation value set. Based on this set, the representative elevation value is calculated using the elevation difference method. The formula is:
[0017]
[0018] Among them, Hre i and express They represent the representative elevation value of the i-th regular grid and the average value of all digital elevation model grid data in the regular grid, max(H i ) and min(H i ) represent the maximum and minimum values of all digital elevation model raster data in the i-th regular grid, α H is the height adjustment factor, and α H ∈[0,1].
[0019] Furthermore, when establishing the hydrological flow connection relationship between spatial nodes, the flow direction is limited to 8 possible directions, corresponding to the 8 adjacent regular grids around the regular grid where the spatial node is located, and the slope rate of each adjacent regular grid is calculated based on the following formula:
[0020]
[0021] in, represents the slope rate between the i-th regular grid and its adjacent j-th regular grid, represents the representative elevation value of the jth regular grid adjacent to the i-th regular grid, represents the distance between the spatial nodes of the i-th regular grid and its adjacent j-th regular grid, j represents the number of the adjacent regular grid, j is a positive integer, and j∈[1,8];
[0022] Select Let The largest regular grid spatial node is used as the confluence node of the i-th regular grid water flow. The main confluence direction is from the i-th regular grid spatial node to the confluence node. If all slope drop rates are less than or equal to 0, it means that the regular grid corresponding to the spatial node is a local depression and is marked as no flow direction.
[0023] When assigning edge weights, the formula for calculating edge weights is:
[0024]
[0025] in, represents the edge weight of the main confluence direction of the i-th regular grid, is the flow deviation angle of the i-th regular grid, which is the angle between the main confluence direction of the i-th regular grid and the line connecting the spatial node of the i-th regular grid and the main control node;
[0026] The directed weighted graph structure includes the coordinates of each spatial node, the inflow node of each spatial node, the corresponding main confluence direction and edge weight.
[0027] Furthermore, the specific logic for collecting continuous historical hydrological data from each spatial node and reservoir water level data from the master control node is as follows:
[0028] Set a unified acquisition time span, that is, the start timestamp and the end timestamp are the same, and select the time step as the modeling time unit to ensure that the collected hydrological data and reservoir water level data are time-stamped, indicating the time step of their occurrence, and correspond one-to-one with the spatial nodes, forming the historical hydrological data time series data of each spatial node and the reservoir water level time series data of the master node
[0029] A unified time step is set, and the historical hydrological data time series data of each spatial node and the reservoir water level time series data of the master node are divided into multiple time steps. Each time step corresponds to the historical hydrological data of the spatial node and the reservoir water level data of the master node with a fixed timestamp.
[0030] Furthermore, the method for training the graph neural network model is:
[0031] Calculate the water level increment based on the water level data of the master node in two adjacent time steps. The water level increment is the water level value in the t+1th time step minus the water level value in the tth time step. This is used as the water level increment in the t+1th time step relative to the tth time step, forming a continuous water level increment sequence.
[0032] At each time step t, the hydrological input data of all spatial nodes is obtained to form a spatial node feature set at time step t. The spatial node feature set at time step t is combined with the constructed directed weighted graph structure to form a training set at time step t. The water level increment between the t+1 time step and the t time step is used as the supervision label of the training set at time step t. Multiple training sample pairs are constructed through all time steps to form a training dataset.
[0033] A graph neural network model is used to learn and train the training data set. The model input is the training set at each time step, and the model output is the water level increment at the corresponding time step. During the training process, a loss function based on the error between the predicted value and the label value is used to update the parameters. After the training is completed, a graph neural network model for prediction tasks is obtained.
[0034] Furthermore, the graph neural network model includes a graph convolution module, a time series encoding module and a regression prediction module. The graph convolution module consists of three layers of graph attention convolution layers. The first layer has an input dimension of 4 and an output dimension of 64, the second layer has an input dimension of 64 and an output dimension of 128, and the third layer has an input dimension of 128 and an output dimension of 64. The graph convolution layer uses an attention mechanism with edge weights to aggregate spatial node features. The edge weights participate in the attention score calculation. The ReLU function is used as the activation function between all graph convolution layers.
[0035] The time series encoding module is composed of a layer of gated recurrent units, the input dimension of the GRU is 64, and the hidden state dimension is 64, which is used to dynamically model the graph convolution output of each spatial node in the time series. The regression prediction module is composed of a layer of fully connected neural network, with an input dimension of 64 and an output dimension of 1. The input is the GRU hidden state of the master node at the end of the time series, and the output is a real-number water level increment prediction value. During the model training process, the mean square error is used as the loss function to calculate the average value of the square of the error between the model-predicted water level increment and the actual water level increment as the model training target. The Adam optimizer is used to update the model parameters, the initial learning rate is set to 0.001, the total number of training rounds (Epoch) is set to 500 rounds, and all training samples are used for forward propagation and backpropagation updates in each round. Dropout operation is applied after the output of the graph convolution layer, and the Dropout probability is set to 0.2;
[0036] After the training is completed, the model parameters are saved, and the resulting graph neural network model is used to input the spatial node hydrological data of the current time step and the corresponding directed weighted graph structure in the real-time prediction stage, and output the water level increment prediction value of the master node in the next time step.
[0037] Furthermore, when analyzing the reservoir water level at the next time step, the time step length from the next time step to the current moment is the same as the fixed time interval length when the continuous historical hydrological data and the reservoir water level data of the active node are divided into multiple time steps according to the fixed time interval. The result of the reservoir water level analysis is the predicted value of the reservoir water level at the next time step, and the formula based on it is:
[0038] h(t+1)=h(t)+Δh(t+1)
[0039] Among them, h(t+1) represents the predicted value of the reservoir water level in the next time step, h(t) represents the reservoir water level data at the current moment, and Δh(t+1) represents the predicted reservoir water level increment.
[0040] The present invention further provides a hydropower station reservoir water level prediction and analysis system, which is used to execute the above-mentioned hydropower station reservoir water level prediction and analysis method, including:
[0041] The regional delineation module is used to define the affected basin of the target reservoir and obtain the digital elevation model data of the affected basin, construct a three-dimensional digital terrain model of the affected basin, divide the affected basin into multiple regular grids through the three-dimensional digital terrain model, define the center position of each grid as a spatial node, and set the spatial node of the regular grid where the reservoir is located as the main control node;
[0042] The flow direction construction module is used to extract the elevation values of all grid points in the grid cell to which each spatial node belongs, calculate the representative elevation value of the node using the elevation difference method, determine the main confluence direction and confluence node of each spatial node using watershed analysis, establish the hydrological flow direction connection relationship between spatial nodes, assign edge weights, and construct a directed weighted graph structure;
[0043] The data acquisition module is used to collect continuous historical hydrological data from each spatial node and reservoir water level data from the master node. The hydrological data includes rainfall, soil moisture, evaporation, and surface runoff with timestamps. The continuous historical hydrological data and reservoir water level data from the active node are divided into multiple time steps according to fixed time intervals.
[0044] The model training module is used to calculate the reservoir water level increment at the next time step relative to the previous time step based on the reservoir water level data. The directed weighted graph structure and the hydrological data of each spatial node at the previous time step are used as the feature input of the graph neural network model, and the reservoir water level increment at the next time step relative to the previous time step is used as the feature output to train the graph neural network model.
[0045] The data analysis module is used to obtain the hydrological data of each spatial node at the current moment in real time, input the directed weighted graph structure and the hydrological data of each spatial node at the current moment into the trained graph neural network model, obtain the predicted reservoir water level increment for the next time step, and analyze the reservoir water level in the next time step based on the predicted reservoir water level increment and the reservoir water level data of the active node at the current moment.
[0046] The present invention further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the above-mentioned method for predicting and analyzing the water level of a hydropower station reservoir.
[0047] Compared with the prior art, the present invention has the following beneficial effects:
[0048] This paper introduces a regular grid division mechanism based on three-dimensional terrain modeling and a spatiotemporal learning framework of graph neural networks into water level prediction, realizing a unified modeling path from hydrological element collection to water level prediction. By fusing digital elevation models with hydrological data, constructing spatial nodes and their water flow connections, and assigning edge weights, a directed weighted graph reflecting the actual hydrological conduction path is formed. This enables water level prediction to move beyond point data analysis and move towards modeling the coordinated changes in hydrological conditions within the entire affected basin.
[0049] The introduction of graph neural networks enables the model to have the ability to learn nonlinear influence relationships between nodes, while taking into account spatial topology and time series characteristics. By constructing a unified framework that integrates terrain structure, hydrological processes and machine learning capabilities, it realizes the coupled modeling of spatial distribution characteristics and temporal dynamic characteristics, thereby improving the accuracy and reliability of water level prediction. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] Figure 1 Schematic diagram of the overall method flow of the present invention;
[0051] Figure 2 This is a schematic diagram of the settings of the affected watershed in the present invention;
[0052] Figure 3 Schematic diagram of the construction of the directed weighted graph structure in the present invention;
[0053] Figure 4 This is a schematic diagram of the training results of the neural network model in the present invention;
[0054] Figure 5 This is a historical hydrological diagram of the present invention;
[0055] Figure 6 A three-dimensional schematic diagram of the terrain affecting the watershed in the present invention;
[0056] Figure 7 A top view schematic diagram of the terrain affecting the watershed in the present invention;
[0057] Figure 8 This is a schematic diagram of the hydrological flow network in the present invention;
[0058] Figure 9 This is a schematic diagram of the reservoir water level prediction results in the present invention;
[0059] Figure 10 It is a schematic diagram of the overall system structure of the present invention. DETAILED DESCRIPTION
[0060] In order to make the objectives, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below with reference to specific embodiments.
[0061] It should be noted that, unless otherwise defined, the technical or scientific terms used in the present invention should have the usual meanings understood by people with ordinary skills in the field to which the present invention belongs. The "first", "second" and similar words used in the present invention do not indicate any order, quantity or importance, but are only used to distinguish different components. "Include" or "comprise" and similar words mean that the elements or objects appearing before the word include the elements or objects listed after the word and their equivalents, without excluding other elements or objects. "Connect" or "connected" and similar words are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. "Up", "down", "left", "right" and the like are only used to indicate relative position relationships. When the absolute position of the object being described changes, the relative position relationship may also change accordingly.
[0062] Example:
[0063] See also Figures 1-9 , the present invention provides a technical solution:
[0064] A method for predicting and analyzing the water level of a hydropower station reservoir comprises the following steps:
[0065] Step 1: Set the affected basin of the target reservoir and obtain the digital elevation model data of the affected basin, build a three-dimensional digital terrain model of the affected basin, divide the affected basin into multiple regular grids through the three-dimensional digital terrain model, define the center position of each grid as a spatial node, and set the spatial node of the regular grid where the reservoir is located as the main control node.
[0066] Digital elevation model data is digitized geospatial data that represents the elevation of the earth's surface. It is one of the most basic data in geographic information systems and hydrological simulations. Digital elevation model (DEM) records the altitude of every geographic location on the earth's surface in a regular grid format. Its data structure is usually a two-dimensional matrix, and each pixel corresponds to a specific geographic coordinate and an elevation value. DEM is mainly used to reflect surface morphological features, such as ridges, valleys, slopes, etc.
[0067] Sources of DEM data include satellite remote sensing, aerial photogrammetry, LiDAR laser radar, and drone photogrammetry. After obtaining the DEM data of the target reservoir area, the DEM is imported into professional geographic information software platforms such as ArcGIS, QGIS, Global Mapper, or modeling software such as SketchUp and Surfer. The elevation values are mapped one-to-one with the XY coordinates and rendered as a three-dimensional relief map. By using TIN (triangulated irregular network) or contour interpolation algorithms in the software, the original elevation data can be converted into a continuous three-dimensional surface. The grid is divided at a fixed spatial resolution (for example, 10 meters × 10 meters or 30 meters × 30 meters). In the GIS platform, a regular grid is generated through the "raster resampling" or "create fishnet" functions, cutting the entire three-dimensional terrain surface into a series of small units. Each grid unit inherits the elevation value and other attributes of its location, such as slope, aspect, and water flow direction.
[0068] In this embodiment, when setting the affected basin of the target reservoir, the center coordinate of the target reservoir is used as the center point of the target grid at the 0th layer, and the maximum number of horizontal and vertical layers is set to L, L, and L, respectively. x and L y , and set the target grid to be a square with a side length of G, with the 0th layer target grid as the center, and expand outward with the maximum number of layers in the horizontal and vertical directions as the range limit, to form a side length of G*(2L x +1)×G*(2L y +1) of the rectangular impact basin, when dividing the regular grid, all the standard grids have the same size and are square grids, and the number of grids of the digital elevation model covered by all regular grid cells is the same.
[0069] The purpose of constructing a square grid is to discretize continuous spatial data into regular units to facilitate numerical simulation and spatial analysis. In reservoir water volume analysis, it is necessary to calculate rainfall, runoff, evaporation, infiltration and other processes at every location in the basin. These processes are usually calculated step by step on discrete units through mathematical models.
[0070] A square grid can be represented in memory as a two-dimensional array, with each grid cell having the same area. This allows for accurate estimation of water volume change indicators such as rainfall per unit area and runoff. The grid orientation (i.e., the direction in which the grid is arranged) defaults to north, which is consistent with the map coordinate axes. In other words, the edges of the grid are parallel to the longitude and latitude lines or the X and Y axes in the projected coordinate system. This setup facilitates alignment with basic geographic data. Topographic maps, land use maps, remote sensing images, and other data are usually based on true north, so setting the grid orientation in this way maintains spatial consistency.
[0071] The center coordinates of the target reservoir are the starting point for constructing the entire grid system. After manually marking the remote sensing image or map and loading the remote sensing image or reservoir vector boundary in the GIS software, the "geometric center" of the reservoir can be directly selected as the reference point, or the reservoir inlet position can be selected as the center point.
[0072] This implementation uses the center of the reservoir as the origin and constructs a unified regular grid system on a two-dimensional plane by setting the maximum number of horizontal and vertical expansion layers. During the construction process, each regular grid unit has the same geometric size and is square. In order to ensure that each grid has consistent terrain accuracy, the number of digital elevation model (DEM) grids covered by each grid in space is also consistent, that is, each regular grid unit is mapped to the same number of DEM pixels. Traditional methods often determine the impact area through flow direction analysis and watershed watersheds. Although it fits the natural terrain, the resulting shape is complex and not easy to grid and uniformly model. The method used in this embodiment constructs a unified, rectangular, regularly distributed grid system, which can greatly simplify the data structure and facilitate the use of standard structures such as arrays and tensors for rapid calculations in numerical simulations.
[0073] Step 2: For each spatial node, extract the elevation values of all grid points in the grid unit to which it belongs, calculate the representative elevation value of the node using the elevation difference method, use watershed analysis to determine the main confluence direction and confluence node of each spatial node, establish the hydrological flow connection relationship between spatial nodes, assign edge weights, and construct a directed weighted graph structure.
[0074] In this embodiment, the specific logic of calculating the representative elevation value of the node using the elevation difference method is as follows:
[0075] For each spatial node, all the digital elevation model raster data covered in the corresponding regular grid are extracted to form an elevation value set. Based on this set, the representative elevation value is calculated using the elevation difference method. The formula is:
[0076]
[0077] Among them, Hre i and express They represent the representative elevation value of the i-th regular grid and the average value of all digital elevation model grid data in the regular grid, max(H i ) and min(H i ) represent the maximum and minimum values of all digital elevation model raster data in the i-th regular grid, α H is the height adjustment factor, and α H ∈[0,1].
[0078] In this embodiment, for each regular grid cell, not only the average value of the elevation data it covers is used to describe the elevation, but also the elevation fluctuations in the area (i.e., the difference between the maximum and minimum values) are introduced for correction. The purpose of this is to retain local terrain characteristics while smoothing the model, and to improve the sensitivity and accuracy of the model in simulating water flow, terrain response, etc., so as to avoid the "terrain flattening" problem caused by simply using the average value, especially in areas with complex micro-topography such as slopes, gullies, and dams.
[0079] For regular grid cells, all grid elevation values within their coverage area are extracted from the digital elevation model. The average value represents the overall elevation level of the cell, and the maximum and minimum values are used to reflect the elevation fluctuation (terrain change range) within the area. On the basis of the average elevation, a certain proportion of the height difference is added so that the final representative elevation can reflect the undulating trend of the terrain. Indicates the height level of the basic terrain and is the most important reference for elevation data. max(H i )―min(H i ) represents the fluctuation amplitude of the terrain inside the grid, that is, the terrain relief. The height adjustment factor controls the influence weight of the elevation relief on the final representative elevation. i It is ultimately used to represent the "topographic control value" of the grid in the model, which combines the overall height and local terrain characteristics. By introducing the height difference term, the model can be made more sensitive to highlands or lowlands, and is particularly suitable for simulating processes with strong terrain driving, such as water flow paths and water storage area identification.
[0080] The height adjustment factor is a parameter with a value range of [0,1] that is used to adjust the degree of influence of elevation differences. When setting this value, if the study area has complex terrain and large slope variations, the height adjustment factor should be appropriately increased (e.g., 0.5-0.8) to enhance the ability to capture local terrain changes. If the terrain is relatively flat, a smaller value (e.g., 0.1-0.3) can be selected to avoid amplifying errors due to elevation fluctuations. For terrain-sensitive simulations such as flooding and flow direction determination, a higher height adjustment factor can be selected. For analyses that focus more on average levels, such as groundwater levels and water storage balance, a lower height adjustment factor can be selected.
[0081] Furthermore, in this embodiment, when establishing the hydrological flow direction connection relationship between spatial nodes, the water flow direction is limited to 8 possible directions. Corresponding to the 8 adjacent regular grids around the regular grid where the spatial node is located, the slope rate of each adjacent regular grid is calculated based on the following formula:
[0082]
[0083] in, represents the slope rate between the i-th regular grid and its adjacent j-th regular grid, represents the representative elevation value of the jth regular grid adjacent to the i-th regular grid, Represents the distance between the spatial nodes of the i-th regular grid and its adjacent j-th regular grid, j represents the number of the adjacent regular grid, j is a positive integer, and j∈[1,8].
[0084] In this embodiment, establishing the hydrological flow connection relationship between spatial nodes is a key step in realizing water flow path simulation and hydrological process modeling. This step constructs the hydraulic connection between grids by introducing the eight-adjacent direction model and the slope calculation method, thereby simulating how water flows from high to low on the terrain surface under natural conditions.
[0085] The water flow direction is limited to 8 possible directions. It establishes possible flow direction connections between each regular grid cell and the 8 adjacent grids around it. These 8 directions are: up, down, left, right, upper left, upper right, lower left, and lower right, forming a 3×3 grid framework centered on the current grid. This can cover almost all dominant directions of surface water flow and better simulate the actual flow path. The calculation method of the slope rate reflects the "unit distance height difference" of water flowing from the current grid to a certain adjacent grid. It is a key indicator for judging the preferred direction of water flow. Water tends to flow along the direction with a larger slope rate because the potential energy loss of this path is minimized. In a regular square grid, the distance between adjacent cells is a computable constant.
[0086] By introducing slope rate as the basis for judging water flow instead of just using elevation difference, it has a more refined hydrodynamic meaning. The actual water flow path depends not only on the height difference, but also on the "height difference per unit length", that is, the slope. In flat areas, although the elevation difference is small, the slope rate can still reflect subtle flow trends. As an indicator for judging water flow path, the slope rate helps to capture the influence of low-lying areas, waterways, micro-topography, etc. on flow direction. In each grid unit, the system will compare its slope rate with the 8 adjacent grids, and select the largest slope rate as the main direction of water flow, thereby establishing a "flow connection relationship" between spatial nodes.
[0087] This example, based on a "spatial topology + terrain-driven mechanism," establishes hydrological connections between regular grids, a core process for converting terrain data into hydrological information. Compared to traditional methods based solely on elevation differences, the inclusion of slope factor accounts for spatial distance, resulting in a simulation that is more realistic and authentic to geographic reality. Combined with the representative elevation values obtained using the elevation difference method previously described, this method further enhances the physical plausibility and spatial continuity of the flow path simulation.
[0088] Select Let The largest regular grid spatial node is used as the confluence node of the i-th regular grid water flow. The main confluence direction is from the i-th regular grid spatial node to the confluence node. If all slope drop rates are less than or equal to 0, it means that the regular grid corresponding to the spatial node is a local depression and is marked as no flow direction.
[0089] When assigning edge weights, the formula for calculating edge weights is:
[0090]
[0091] in, represents the edge weight of the main confluence direction of the i-th regular grid, is the flow deviation angle of the i-th regular grid, which is the angle between the main confluence direction of the i-th regular grid and the line connecting the spatial node of the i-th regular grid and the main control node;
[0092] The directed weighted graph structure includes the coordinates of each spatial node, the inflow node of each spatial node, the corresponding main confluence direction and edge weight.
[0093] By calculating the slope ratio between each adjacent regular grid and the current grid, the direction with the largest slope ratio is selected to ensure that water naturally flows in the steepest downhill direction. If the slope ratio of all adjacent grids of a regular grid is less than 0, it means that the area where the regular grid is located has no natural water flow direction. In this case, it indicates that the area is a local depression, meaning that water cannot flow further here, which may lead to water accumulation or accumulation. In this case, the water flow direction cannot be determined. Therefore, it is necessary to mark the regular grid as a node with no flow direction to avoid its incorrect use in subsequent water path tracing or confluence calculations.
[0094] After determining the confluence node for each regular grid, the next step is to assign a weight to each flow edge. This weight reflects the strength and directional priority of the flow. The slope reflects the "intensity" of the flow. A greater slope indicates greater potential energy for the flow and, therefore, a greater "intensity" of the flow. Therefore, flow paths with greater slopes should have higher weights. The flow deviation angle measures the degree of deviation between the flow path and the actual flow target. A smaller deviation angle indicates that the flow is closer to the target direction. By introducing the cosine value of the deviation angle, the weight is further modified to ensure that the flow preferentially flows in the direction closest to the target.
[0095] For each water flow edge, its slope rate is calculated, and the flow deviation angle is calculated based on the connection angle between the two grids. The weight of each edge is calculated, and finally the weighted value of each edge in the graph structure is obtained. A directed weighted graph is constructed. The nodes in the graph represent regular grids, the edges represent the water flow direction, and the edge weight reflects the strength and directional priority of the water flow.
[0096] A graph structure represents the path of water flow. Each node in the graph represents a spatial node, and each directed edge represents the flow of water from one node to another. The weight of the edges determines the preferred path of water flow. Using this graph, we can analyze the convergence path of water flow, find the optimal flow route, and simulate the propagation process of water flow.
[0097] In this way, this embodiment transforms the complex water flow propagation process into a clearly structured and easy-to-calculate graphical model, which can effectively simulate the natural flow direction of water. Water flows from high to low, and the direction with the largest slope drop rate is selected as the water flow path, which conforms to the water flow characteristics of natural terrain. It can identify depression areas without outlets and avoid the wrong flow direction in the model. Through edge weight design, the slope drop rate and flow deviation angle are comprehensively considered to further improve the accuracy and physical rationality of the model. Using the graph theory structure, path calculation, flow direction simulation and impact analysis can be quickly performed, which is suitable for large-scale geographic information systems (GIS) and hydrological simulation scenarios.
[0098] Step 3: Collect continuous historical hydrological data from each spatial node and reservoir water level data from the master node. The hydrological data include rainfall, soil moisture, evaporation, and surface runoff with timestamps. Divide the continuous historical hydrological data and reservoir water level data from the active node into multiple time steps according to fixed time intervals.
[0099] In this embodiment, the specific logic for collecting continuous historical hydrological data of each spatial node and reservoir water level data of the master control node is as follows:
[0100] Set a unified collection time span, that is, the start timestamp and the end timestamp are the same, and select the time step as the modeling time unit to ensure that the collected hydrological data and reservoir water level data are time-stamped, indicating the time step of their occurrence, and correspond one-to-one with the spatial nodes, forming the historical hydrological data time series data of each spatial node and the reservoir water level time series data of the master node;
[0101] A unified time step is set, and the historical hydrological data time series data of each spatial node and the reservoir water level time series data of the master node are divided into multiple time steps. Each time step corresponds to the historical hydrological data of the spatial node and the reservoir water level data of the master node with a fixed timestamp.
[0102] Setting a unified acquisition time span, that is, selecting a start and end timestamp, ensures that the collected data is continuous and consistent in time. This is done to avoid time mismatches or missing data and ensure synchronization and temporal comparability between different data sources. The temporal consistency of hydrological data and reservoir water level data is very important because hydrological model calculations rely on continuous time series data. If the data timestamps are not unified, the model will not be able to correctly capture the dynamic characteristics of water flow and water level changes. Setting a unified time span ensures that the collected data are within the same time frame from start to end, avoiding errors caused by inconsistent data time points.
[0103] The time step setting determines the frequency of data collection and the calculation accuracy of the model. Depending on the specific application scenario, the step size is usually set to hours, days or shorter time intervals. A unified time step helps to standardize all data for more accurate time series analysis. In hydrological modeling, the time step directly affects the level of detail of the simulation and the response time of the model. Shorter time steps can usually capture more subtle changes, but the amount of calculation is greater; longer time steps are suitable for processing macro-hydrological processes and reducing computational complexity. If the time step size is not unified, it will not only affect the stability and accuracy of the model, but may also cause some important hydrological phenomena to be ignored or mishandled. Therefore, a unified time step can ensure the consistency of the model's calculation logic and avoid errors caused by inconsistent time scales.
[0104] In this embodiment, an appropriate time step is selected (for example, 1 hour or 1 day), and it is ensured that all historical hydrological data and reservoir water level data can be segmented according to this time step. The data in each time step should cover all hydrological elements (such as rainfall, soil moisture, evaporation, and surface runoff, etc.) and reservoir water level data within that time period.
[0105] In this step, it is necessary to collect continuous hydrological data from each spatial node and reservoir water level data from the master node. These data not only contain specific hydrological variables, but also have timestamps. The timestamp can clearly identify the collection time of each data point, thereby realizing the time serialization and time series analysis of the data. Hydrological models usually rely on time series analysis to predict future hydrological conditions. For example, the temporal trend of changes in data such as rainfall, soil moisture, and evaporation directly affects the changes in water flow and the fluctuations in reservoir water levels. Therefore, hydrological data must be provided in the form of a time series, and the historical hydrological data of each spatial node must correspond one-to-one to a specific timestamp to ensure that the data of each node at each time step is valid and is sorted and processed according to the time series.
[0106] The hydrological process is dynamic, so it is necessary to convert the change process in a long time period into small time units through time step division, so as to facilitate the refined calculation and analysis of the data in each time step. The entire historical hydrological data is divided into multiple time periods according to the set time step. Each time period corresponds to all hydrological data within a fixed timestamp, ensuring that the data in each time step corresponds to the spatial node and reservoir water level data to form a complete time series data.
[0107] Step 4: Calculate the reservoir water level increment in the next time step relative to the previous time step based on the reservoir water level data. Use the directed weighted graph structure and the hydrological data of each spatial node in the previous time step as the feature input of the graph neural network model, and use the reservoir water level increment in the next time step relative to the previous time step as the feature output to train the graph neural network model.
[0108] In this embodiment, the method for training the graph neural network model is:
[0109] Calculate the water level increment based on the water level data of the master node in two adjacent time steps. The water level increment is the water level value in the t+1th time step minus the water level value in the tth time step. This is used as the water level increment in the t+1th time step relative to the tth time step, forming a continuous water level increment sequence.
[0110] At each time step t, the hydrological input data of all spatial nodes is obtained to form a spatial node feature set at time step t. The spatial node feature set at time step t is combined with the constructed directed weighted graph structure to form a training set at time step t. The water level increment between the t+1 time step and the t time step is used as the supervision label of the training set at time step t. Multiple training sample pairs are constructed through all time steps to form a training dataset.
[0111] A graph neural network model is used to learn and train the training data set. The model input is the training set at each time step, and the model output is the water level increment at the corresponding time step. During the training process, a loss function based on the error between the predicted value and the label value is used to update the parameters. After the training is completed, a graph neural network model for prediction tasks is obtained.
[0112] In this example, the graph neural network model is trained to predict reservoir water level trends. The key is to closely integrate time-series hydrological data with spatial topology, construct dynamic feature inputs, and use supervised learning to optimize the model. This process begins with constructing a sequence of water level increments. By combining graph structure feature inputs with supervised labels, it gradually achieves intelligent prediction that integrates time and space.
[0113] The logical basis of training is to express the water level change of the reservoir as "increments between adjacent time steps" to obtain a relative change. This method avoids the trend error and cumulative offset that may be caused by directly predicting the absolute water level, and highlights the "instantaneous driving" effect of the hydrological state on the water level change in each time step. It is conducive to the model focusing on causal relationship mining at a short time scale. By performing incremental calculations on each pair of consecutive time steps in the complete time series, a water level increment sequence can be constructed to be used as the output target of the model.
[0114] At each time step, the corresponding hydrological status data, including rainfall, evaporation, soil moisture and surface runoff, are collected from each regular grid node within the spatial range. These constitute the feature set of the spatial node at the current time. Since a directed weighted graph structure has been established in the early stage, describing the main convergence direction and edge weights between nodes, the system can combine this graph structure with the node feature set of the current time step to construct the input of the graph neural network. In the graph structure, each node not only contains its own feature information, but can also perceive the status of its upstream and downstream nodes through the propagation mechanism of the graph, thereby enhancing the model's ability to learn spatial correlations.
[0115] During graph neural network training, each training sample consists of two parts: an input graph consisting of the graph structure of time steps and node features; and an output label, the water level increment. By traversing the entire time series, each pair of time steps can be constructed into a training sample, ultimately forming a multi-period training dataset. This construction method allows every time step to participate in training, allowing the model to learn the dynamic mapping relationship between basin hydrological conditions and reservoir water level responses over the entire time period.
[0116] The graph neural network model is adopted because its unique structure can simulate non-Euclidean relationships between spatial entities, making it particularly suitable for handling irregular water flow connections between hydrological nodes. Unlike traditional time series prediction models, GNN not only considers the historical state of each node but also learns the comprehensive impact of upstream nodes on downstream water levels through an edge weight propagation mechanism. In actual training, loss functions such as mean squared error (MSE) are used to measure the deviation between the model output and the actual water level increment. The network weights are continuously adjusted and the model parameters are optimized through a backpropagation mechanism, ultimately forming a graph neural network prediction model with generalization capabilities. This not only fully embodies the concept of spatiotemporal coupled modeling, but also explicitly encodes the flow convergence logic in the spatial structure into the model structure, greatly improving prediction accuracy and model interpretability. More importantly, this modeling approach is highly versatile and scalable, and can be replicated and applied in scenarios with multiple reservoirs, multiple river basins, and multiple time scales.
[0117] Furthermore, the graph neural network model includes a graph convolution module, a time series encoding module and a regression prediction module. The graph convolution module is composed of three layers of graph attention convolution layers. The input dimension of the first layer is 4 and the output dimension is 64. The input dimension of the second layer is 64 and the output dimension is 128. The input dimension of the third layer is 128 and the output dimension is 64. The graph convolution layer uses an attention mechanism with edge weights to aggregate spatial node features. The edge weights participate in the attention score calculation. The ReLU function is used as the activation function between all graph convolution layers.
[0118] The time series encoding module is composed of a layer of gated recurrent units, the input dimension of the GRU is 64, and the hidden state dimension is 64, which is used to dynamically model the graph convolution output of each spatial node in the time series. The regression prediction module is composed of a layer of fully connected neural network, with an input dimension of 64 and an output dimension of 1. The input is the GRU hidden state of the master node at the end of the time series, and the output is a real-number water level increment prediction value. During the model training process, the mean square error is used as the loss function to calculate the average value of the square of the error between the model-predicted water level increment and the actual water level increment as the model training target. The Adam optimizer is used to update the model parameters, the initial learning rate is set to 0.001, the total number of training rounds (Epoch) is set to 500 rounds, and all training samples are used for forward propagation and backpropagation updates in each round. Dropout operation is applied after the output of the graph convolution layer, and the Dropout probability is set to 0.2;
[0119] After the training is completed, the model parameters are saved, and the resulting graph neural network model is used to input the spatial node hydrological data of the current time step and the corresponding directed weighted graph structure in the real-time prediction stage, and output the water level increment prediction value of the master node in the next time step.
[0120] The graph neural network model extracts features from spatial relationships through a graph neural network, models temporal dynamics through a sequence network, and ultimately outputs predictions of future water level changes through a regression layer. The model first processes the hydrological characteristics of each node in the spatial structure through a graph convolution module. This part utilizes a three-layer graph attention layer (GAT). Each layer aggregates node features using an attention mechanism with edge weights. The initial feature dimension of the input node is 4 (representing four types of hydrological characteristics: rainfall, evaporation, soil moisture, and runoff). The output dimension of the first layer is 64, the second layer is 128, and the third layer shrinks to 64. This "dimensionality increase-encoding-compression" structural design can first improve feature expression capabilities and then focus on useful information.
[0121] The introduction of the attention mechanism enables the model to automatically learn the "importance" of influences between nodes, rather than simply averaging adjacent features. Crucially, this attention weight not only considers the characteristics of the nodes themselves but also incorporates edge weights (composed of flow gradient and directional deviation) into the scoring mechanism. This means that the "flow priority" in spatial relationships is explicitly incorporated into the model learning process. The use of the ReLU activation function enhances the model's nonlinear expressiveness while improving the stability and convergence speed of the training process.
[0122] The graph convolution module processes spatial node relationships at each time step. To model the continuous evolution of time, the model incorporates a time series encoding module, the Gated Recurrent Unit (GRU), with both an input dimension and a hidden state dimension of 64. This module is connected to the output of the graph convolution module. The GRU structure captures the dynamic evolution of node features over time through its internal gating mechanism (update gate and reset gate), effectively modeling the "lagged relationships" and "historical dependencies" between hydrological variables. This mechanism is particularly suitable for processing geophysical processes such as rainfall, runoff, and water level rise that require time accumulation.
[0123] The graph convolution results of each spatial node at different time steps are input into the GRU in chronological order, forming a time series. The hidden state output by the GRU represents the "comprehensive historical response" of the node in the time series, providing dynamic context for subsequent water level prediction.
[0124] After graph convolution and GRU encoding, the model inputs the GRU hidden state of the master node at the end of the time series (i.e., the current time step) into a fully connected regression layer, which outputs a real value representing the predicted water level increment at the next time step. This regression module has an input dimension of 64 and an output dimension of 1, forming a standard linear regression output layer.
[0125] During the training process, the model uses mean square error (MSE) as the loss function to measure the gap between the water level increment output by the model and the actual water level increment. The advantage of mean square error is that it can amplify the penalty for samples with large deviations, thereby driving the model to approach the target more precisely. The Adam optimizer is used for training, and the initial learning rate is 0.001. This is an adaptive learning rate algorithm suitable for processing parameter optimization in deep nonlinear networks. The number of training rounds is set to 500 rounds, and each round traverses the entire training set for forward propagation and gradient update. To prevent overfitting, the Dropout mechanism is applied after the graph convolution output, with a dropout rate of 0.2, so that the network remains robust during training and avoids overfitting on specific nodes or features.
[0126] After model training is complete, the saved parameters can be used for real-time water level prediction. During the prediction phase, only the spatial node hydrological characteristics and graph structure of the current time step need to be input. After graph convolution and GRU encoding, the regression module directly outputs the water level increment for the next time step. Because the entire model is an end-to-end design, prediction speed is fast and the results are stable, making it suitable for deployment in practical business systems such as water resource scheduling, flood warning, and real-time water level monitoring.
[0127] Step 5: Obtain the hydrological data of each spatial node at the current moment in real time, input the directed weighted graph structure and the hydrological data of each spatial node at the current moment into the trained graph neural network model, obtain the predicted reservoir water level increment for the next time step, and analyze the reservoir water level at the next time step based on the predicted reservoir water level increment and the reservoir water level data of the active node at the current moment.
[0128] In this embodiment, when analyzing the reservoir water level at the next time step, the time step length from the next time step to the current moment is the same as the fixed time interval length when the continuous historical hydrological data and the reservoir water level data of the active node are divided into multiple time steps according to the fixed time interval. The result of the reservoir water level analysis is the predicted value of the reservoir water level at the next time step, and the formula based on it is:
[0129] h(t+1)=h(t)+Δh(t+1)
[0130] Among them, h(t+1) represents the predicted value of the reservoir water level in the next time step, h(t) represents the reservoir water level data at the current moment, and Δh(t+1) represents the predicted reservoir water level increment.
[0131] In this embodiment, step 5 is the key link in applying the results of all previous modeling and training work to the real-time reservoir water level prediction scenario. This step is to convert the current hydrological state into a prediction of the water level increment in the next time step through the graph neural network model, and accumulate it with the current water level to obtain the predicted water level value, realizing efficient and dynamic water level prediction analysis.
[0132] At the current moment, hydrological data from each spatial node is first collected in real time, including rainfall, soil moisture, evaporation, and surface runoff. This data represents the current hydrological state of the entire basin and constitutes the feature set of the spatial node at the current time step. Similar to the historical training phase, this node feature data is combined with a pre-built directed weighted graph structure as the input of the graph neural network, maintaining consistency with the input structure of the training phase and ensuring smooth migration of the model to the real-time operating environment. By inputting the newly collected hydrological data into the model, the system can quickly complete the structured representation of the data and enter the prediction phase.
[0133] The trained graph neural network model (including a graph convolution module, a GRU temporal encoding module, and a regression module) is called to process the graph input data at the current moment. First, the graph convolution layer aggregates the hydrological features of each node using edge weights to extract spatial relationship features. Then, the GRU module combines the hidden state of the previous time step with the feature encoding of the current node to achieve continuous modeling of temporal dynamics. Finally, the hidden state of the master node at the current time step is input into the regression module, which outputs the predicted water level increment.
[0134] The "next time step" referred to in the predicted water level increment corresponds exactly to the time interval used during model training. After obtaining the predicted water level increment, the predicted water level for the next time step is calculated based on the current measured reservoir water level. The entire graph neural network model operates as follows for real-time prediction: The input is the current spatial hydrological state and graph structure. The graph convolution module extracts spatially dependent features, the GRU module captures temporal trends, and the regression module outputs future water level changes. Essentially, the model learns the nonlinear mapping from "current basin state to water level response" through a spatiotemporal fusion mechanism, enabling it to quickly make decisions based on real-time hydrological trends.
[0135] See also Figure 10 The present invention further provides a hydropower station reservoir water level prediction and analysis system, which is used to execute the above-mentioned hydropower station reservoir water level prediction and analysis method, including:
[0136] The regional delineation module is used to define the affected basin of the target reservoir and obtain the digital elevation model data of the affected basin, construct a three-dimensional digital terrain model of the affected basin, divide the affected basin into multiple regular grids through the three-dimensional digital terrain model, define the center position of each grid as a spatial node, and set the spatial node of the regular grid where the reservoir is located as the main control node;
[0137] The flow direction construction module is used to extract the elevation values of all grid points in the grid cell to which each spatial node belongs, calculate the representative elevation value of the node using the elevation difference method, determine the main confluence direction and confluence node of each spatial node using watershed analysis, establish the hydrological flow direction connection relationship between spatial nodes, assign edge weights, and construct a directed weighted graph structure;
[0138] The data acquisition module is used to collect continuous historical hydrological data from each spatial node and reservoir water level data from the master node. The hydrological data includes rainfall, soil moisture, evaporation, and surface runoff with timestamps. The continuous historical hydrological data and reservoir water level data from the active node are divided into multiple time steps according to fixed time intervals.
[0139] The model training module is used to calculate the reservoir water level increment at the next time step relative to the previous time step based on the reservoir water level data. The directed weighted graph structure and the hydrological data of each spatial node at the previous time step are used as the feature input of the graph neural network model, and the reservoir water level increment at the next time step relative to the previous time step is used as the feature output to train the graph neural network model.
[0140] The data analysis module is used to obtain the hydrological data of each spatial node at the current moment in real time, input the directed weighted graph structure and the hydrological data of each spatial node at the current moment into the trained graph neural network model, obtain the predicted reservoir water level increment for the next time step, and analyze the reservoir water level in the next time step based on the predicted reservoir water level increment and the reservoir water level data of the active node at the current moment.
[0141] The present invention further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the above-mentioned method for predicting and analyzing the water level of a hydropower station reservoir.
[0142] The storage medium may be a magnetic disk, an optical disk, a read-only memory, a random access memory, a flash memory, a hard disk, or a solid-state drive, etc.; further, the storage medium may include a combination of the aforementioned types of memory. It is understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by the computer, processor, or hardware, the methods shown in the above embodiments are implemented.
[0143] The above formulas are all dimensionless and numerical calculations. The formulas are obtained by collecting a large amount of data and performing software simulation to obtain the most recent real situation. The preset parameters in the formulas are set by technicians in this field according to actual conditions.
[0144] The above embodiments can be implemented in whole or in part by software, hardware, firmware, or any other combination thereof. When implemented using software, the above embodiments can be implemented in whole or in part in the form of a computer program product. Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented by electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed by hardware or software depends on the specific application and design constraints of the technical solution.
[0145] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, and may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment as needed.
[0146] The above is only a specific implementation method of the present application, but the scope of protection of the present application is not limited thereto. Any technician familiar with this technical field can easily think of changes or replacements within the technical scope disclosed in this application, which should be covered by the scope of protection of the present application.
Claims
1. A method for predicting and analyzing the water level of a hydropower station reservoir, characterized in that: The specific steps include: Define the affected watershed of the target reservoir and obtain digital elevation model data of the affected watershed. Build a three-dimensional digital terrain model of the affected watershed. Use the three-dimensional digital terrain model to divide the affected watershed into multiple regular grids. Define the center position of each grid as a spatial node, and set the spatial node of the regular grid where the reservoir is located as the master control node. For each spatial node, the elevation values of all grid points within the grid cell to which it belongs are extracted, and the representative elevation value of the node is calculated using the elevation difference method. The main confluence direction and confluence node of each spatial node are determined using watershed analysis. The hydrological flow connection relationship between spatial nodes is established, and edge weights are assigned to construct a directed weighted graph structure. Collect continuous historical hydrological data from each spatial node and reservoir water level data from the master node. The hydrological data includes rainfall, soil moisture, evaporation, and surface runoff with timestamps. The continuous historical hydrological data and reservoir water level data from the active node are divided into multiple time steps according to fixed time intervals. The reservoir water level increment at the next time step relative to the previous time step is calculated based on the reservoir water level data. The directed weighted graph structure and the hydrological data of each spatial node at the previous time step are used as the feature input of the graph neural network model, and the reservoir water level increment at the next time step relative to the previous time step is used as the feature output to train the graph neural network model. The hydrological data of each spatial node at the current moment is obtained in real time. The directed weighted graph structure and the hydrological data of each spatial node at the current moment are input into the trained graph neural network model to obtain the predicted reservoir water level increment for the next time step. Based on the predicted reservoir water level increment and the reservoir water level data of the active node at the current moment, the reservoir water level at the next time step is analyzed.
2. A method for predicting and analyzing the water level of a hydropower station reservoir according to claim 1, characterized in that: When setting the impact basin of the target reservoir, the center coordinate of the target reservoir is used as the center point of the target grid at level 0, and the maximum number of horizontal and vertical layers is set to L. x and L y , and set the target grid to be a square with a side length of G, with the 0th layer target grid as the center, and expand outward with the maximum number of layers in the horizontal and vertical directions as the range limit, to form a side length of G*(2L x +1)×G*(2L y +1) of the rectangular impact basin, when dividing the regular grid, all the standard grids have the same size and are square grids, and the number of grids of the digital elevation model covered by all regular grid cells is the same.
3. A method for predicting and analyzing water level of a hydropower station reservoir according to claim 1, characterized in that: The specific logic of calculating the representative elevation value of the node using the elevation difference method is as follows: For each spatial node, all the digital elevation model raster data covered in the corresponding regular grid are extracted to form an elevation value set. Based on this set, the representative elevation value is calculated using the elevation difference method. The formula is: Among them, Hre i and express They represent the representative elevation value of the i-th regular grid and the average value of all digital elevation model grid data in the regular grid, max(H i ) and min(H i ) represent the maximum and minimum values of all digital elevation model raster data in the i-th regular grid, α H is the height adjustment factor, and α H ∈[0,1].
4. A method for predicting and analyzing the water level of a hydropower station reservoir according to claim 3, characterized in that: When establishing the hydrological flow connection relationship between spatial nodes, the flow direction is limited to 8 possible directions, corresponding to the 8 adjacent regular grids around the regular grid where the spatial node is located. The slope rate of each adjacent regular grid is calculated based on the following formula: in, represents the slope rate between the i-th regular grid and its adjacent j-th regular grid, represents the representative elevation value of the jth regular grid adjacent to the i-th regular grid, represents the distance between the spatial nodes of the i-th regular grid and its adjacent j-th regular grid, j represents the number of the adjacent regular grid, j is a positive integer, and j∈[1,8]; Select Let The largest regular grid spatial node is used as the confluence node of the i-th regular grid water flow. The main confluence direction is from the i-th regular grid spatial node to the confluence node. If all slope drop rates are less than or equal to 0, it means that the regular grid corresponding to the spatial node is a local depression and is marked as no flow direction. When assigning edge weights, the formula for calculating edge weights is: in, represents the edge weight of the main confluence direction of the i-th regular grid, is the flow deviation angle of the i-th regular grid, which is the angle between the main confluence direction of the i-th regular grid and the line connecting the spatial node of the i-th regular grid and the main control node; The directed weighted graph structure includes the coordinates of each spatial node, the inflow node of each spatial node, the corresponding main confluence direction and edge weight.
5. A method for predicting and analyzing the water level of a hydropower station reservoir according to claim 4, characterized in that: The specific logic for collecting continuous historical hydrological data of each spatial node and reservoir water level data of the master control node is as follows: Set a unified acquisition time span, that is, the start timestamp and the end timestamp are the same, and select the time step as the modeling time unit to ensure that the collected hydrological data and reservoir water level data are time-stamped, indicating the time step of their occurrence, and correspond one-to-one with the spatial nodes, forming the historical hydrological data time series data of each spatial node and the reservoir water level time series data of the master node A unified time step is set, and the historical hydrological data time series data of each spatial node and the reservoir water level time series data of the master node are divided into multiple time steps. Each time step corresponds to the historical hydrological data of the spatial node and the reservoir water level data of the master node with a fixed timestamp.
6. A method for predicting and analyzing water level of a hydropower station reservoir according to claim 1, characterized in that: The method for training the graph neural network model is: Calculate the water level increment based on the water level data of the master node in two adjacent time steps. The water level increment is the water level value in the t+1th time step minus the water level value in the tth time step. This is used as the water level increment in the t+1th time step relative to the tth time step, forming a continuous water level increment sequence. At each time step t, the hydrological input data of all spatial nodes is obtained to form a spatial node feature set at time step t. The spatial node feature set at time step t is combined with the constructed directed weighted graph structure to form a training set at time step t. The water level increment between the t+1 time step and the t time step is used as the supervision label of the training set at time step t. Multiple training sample pairs are constructed through all time steps to form a training dataset. A graph neural network model is used to learn and train the training data set. The model input is the training set at each time step, and the model output is the water level increment at the corresponding time step. During the training process, a loss function based on the error between the predicted value and the label value is used to update the parameters. After the training is completed, a graph neural network model for prediction tasks is obtained.
7. A method for predicting and analyzing water level of a hydropower station reservoir according to claim 1, characterized in that: The graph neural network model includes a graph convolution module, a time series encoding module and a regression prediction module. The graph convolution module consists of three layers of graph attention convolution layers. The first layer has an input dimension of 4 and an output dimension of 64, the second layer has an input dimension of 64 and an output dimension of 128, and the third layer has an input dimension of 128 and an output dimension of 64. The graph convolution layer uses an attention mechanism with edge weights to aggregate spatial node features. The edge weights participate in the attention score calculation. The ReLU function is used as the activation function between all graph convolution layers. The time series encoding module is composed of a layer of gated recurrent units, the input dimension of the GRU is 64, and the hidden state dimension is 64, which is used to dynamically model the graph convolution output of each spatial node in the time series. The regression prediction module is composed of a layer of fully connected neural network, with an input dimension of 64 and an output dimension of 1. The input is the GRU hidden state of the master node at the end of the time series, and the output is a real-number water level increment prediction value. During the model training process, the mean square error is used as the loss function to calculate the average value of the square of the error between the model-predicted water level increment and the actual water level increment as the model training target. The Adam optimizer is used to update the model parameters, the initial learning rate is set to 0.001, the total number of training rounds (Epoch) is set to 500 rounds, and all training samples are used for forward propagation and backpropagation updates in each round. Dropout operation is applied after the output of the graph convolution layer, and the Dropout probability is set to 0.2; After the training is completed, the model parameters are saved, and the resulting graph neural network model is used to input the spatial node hydrological data of the current time step and the corresponding directed weighted graph structure in the real-time prediction stage, and output the water level increment prediction value of the master node in the next time step.
8. A method for predicting and analyzing water level of a hydropower station reservoir according to claim 1, characterized in that: When analyzing the reservoir water level at the next time step, the time step length from the next time step to the current moment is the same as the fixed time interval length when the continuous historical hydrological data and the reservoir water level data of the active node are divided into multiple time steps according to the fixed time interval. The result of the reservoir water level analysis is the predicted value of the reservoir water level at the next time step, and the formula based on it is: h(t+1)=h(t)+Δh(t+1) Among them, h(t+1) represents the predicted value of the reservoir water level in the next time step, h(t) represents the reservoir water level data at the current moment, and Δh(t+1) represents the predicted reservoir water level increment.
9. A hydropower station reservoir water level prediction and analysis system, characterized by: The prediction and analysis system is used to execute the method for predicting and analyzing the water level of a hydropower station reservoir according to any one of claims 1 to 8, comprising: The regional delineation module is used to define the affected basin of the target reservoir and obtain the digital elevation model data of the affected basin, construct a three-dimensional digital terrain model of the affected basin, divide the affected basin into multiple regular grids through the three-dimensional digital terrain model, define the center position of each grid as a spatial node, and set the spatial node of the regular grid where the reservoir is located as the main control node; The flow direction construction module is used to extract the elevation values of all grid points in the grid cell to which each spatial node belongs, calculate the representative elevation value of the node using the elevation difference method, determine the main confluence direction and confluence node of each spatial node using watershed analysis, establish the hydrological flow direction connection relationship between spatial nodes, assign edge weights, and construct a directed weighted graph structure; The data acquisition module is used to collect continuous historical hydrological data from each spatial node and reservoir water level data from the master node. The hydrological data includes rainfall, soil moisture, evaporation, and surface runoff with timestamps. The continuous historical hydrological data and reservoir water level data from the active node are divided into multiple time steps according to fixed time intervals. The model training module is used to calculate the reservoir water level increment at the next time step relative to the previous time step based on the reservoir water level data. The directed weighted graph structure and the hydrological data of each spatial node at the previous time step are used as the feature input of the graph neural network model, and the reservoir water level increment at the next time step relative to the previous time step is used as the feature output to train the graph neural network model. The data analysis module is used to obtain the hydrological data of each spatial node at the current moment in real time, input the directed weighted graph structure and the hydrological data of each spatial node at the current moment into the trained graph neural network model, obtain the predicted reservoir water level increment for the next time step, and analyze the reservoir water level in the next time step based on the predicted reservoir water level increment and the reservoir water level data of the active node at the current moment.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps of the method for predicting and analyzing the water level of a hydropower station reservoir according to any one of claims 1 to 8.
Citation Information
Cited By
Surface water storage capacity monitoring method and system based on air-space-ground water multi-source cooperation
CN121327479A
End-to-end drainage basin flood risk influence forecasting method based on physical constraint
CN121390891A
Hydropower station underground powerhouse flooding fault rapid simulation prediction method and prediction system
CN121580585A
Water conservancy digital twinning informatization management system and method
CN122198458A