Basin flood forecasting and dispatching model parallel computing method
By generalizing the rivers and nodes in the basin and dynamically allocating computing power, parallel calculation of the basin flood forecasting and scheduling model is realized, solving the problems of insufficient utilization of parallel computing resources and low computing efficiency in the existing technology, and improving the computing efficiency and the ability to meet real-time flood prevention work.
Patent Information
- Application Number
- CN202510536085.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-27
- Publication Date
- 2025-07-01
AI Technical Summary
In the existing flood forecasting and scheduling operations in the current basin, each forecasting and scheduling node on the same river follows the logical relationship between the front and back, and cannot split the calculation tasks of these nodes into parallel processing, resulting in insufficient utilization of parallel computing resources, low computing efficiency, and difficult to meet the real-time requirements of flood prevention work.
By generalizing the flood forecasting and water engineering scheduling nodes in the basin, a parallel calculation method for the basin flood forecasting and scheduling model that dynamically allocates between the generalized rivers and multiple cores of the CPU is established. The specific steps include: generalizing the river, dividing the flood forecast section nodes and flood control and dispatching water engineering nodes, structing the basin flood forecast model and water engineering scheduling model, determining the calculation time of each generalized river, determining the confluence correlation between the generalized rivers, and dynamically allocating computing power to perform parallel calculations.
Maximize the use of computing resources to achieve a reasonable acceleration ratio, effectively avoiding the waiting situation of calculations, and achieving better computing performance when computing power is insufficient, providing an effective way to improve model computing efficiency during flood prevention scheduling consultations.
Smart Images

Figure CN120234153A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of basin flood forecasting, and is particularly applicable to the parallel computing method of the basin flood forecasting and dispatching model. Background Art
[0002] The construction of intelligent water conservancy plays an indispensable role in the decision-making of basin flood forecasting and dispatching. This process requires the application of water conservancy professional models and the adoption of parallel computing technology to realize the online calculation of flood forecasting and dispatching and instantaneously feedback the results, so as to provide support for real-time dispatching decisions.
[0003] However, literature research shows that the existing parallel computing research on water conservancy professional models mostly focuses on grid-based models, such as distributed hydrological models and two-dimensional hydrodynamic models, and is rarely seen in the calculation of basin flood forecasting and dispatching based on river systems. This is because in the existing basin flood forecasting and dispatching operation process, the forecasting and dispatching nodes on the same river follow the front-back logical relationship, and the calculation of downstream nodes requires the calculation output results of upstream nodes as model inputs, and the calculation tasks of these nodes cannot be split for parallel processing. Therefore, serial computing or partial task parallel computing methods are mostly adopted, resulting in insufficient utilization of parallel computing resources and low computing efficiency, which are difficult to meet the real-time requirements of flood control work. Therefore, providing a method that can flexibly combine and apply various water conservancy professional models to realize the parallel computing of the basin flood forecasting and dispatching model is an urgent problem to be solved at present. Summary of the Invention
[0004] The purpose of the present invention is to provide a parallel computing method for the basin flood forecasting and dispatching model to solve the problem of realizing the parallel computing of the basin flood forecasting and dispatching model by using various water conservancy professional models.
[0005] To achieve the above purpose, the present invention adopts the following technical solutions: The parallel computing method for the basin flood forecasting and dispatching model of the present invention includes the following steps: S1, generalize the rivers within the basin calculation range; based on the actual rivers within the basin, separately generalize the rivers with flood forecasting and dispatching nodes into one river and calculate runoff yield and concentration; S2, generalize the flood forecasting section nodes and flood control dispatching water project nodes; divide the flood forecasting and dispatching nodes on the generalized river into flood forecasting section nodes and flood control dispatching water project nodes, and use the object-oriented method to represent the upstream node list, downstream nodes, and the river to which the nodes belong; S3, construct the basin flood forecasting model and the water project dispatching model; correspond the flood forecasting model to each flood forecasting section node; correspond the water project dispatching model to each flood control dispatching water project node; S4. Determine the calculation time consumption of each generalized river, and find the generalized river with the longest calculation time consumption in the basin. For the physical mechanism model, estimate the calculation time consumption according to the basin area of each generalized river. For the mathematical statistics model, estimate the calculation time consumption according to the number of flood forecasting and dispatching nodes included in each generalized river. S5. Determine the confluence correlation degree between generalized rivers to form a correlation matrix. S6. Dynamically allocate computing power. According to the number of CPU cores, and based on the criterion that there is no calculation waiting time for each node on the generalized river with the longest time consumption, and the criterion of using different CPU cores to calculate the generalized rivers with high correlation degree, allocate computing power and perform parallel computing.
[0006] Furthermore, in step S1, the rivers without flood forecasting and dispatching nodes and the rivers that flow into the main stream with flood forecasting and dispatching nodes are generalized together to calculate runoff yield and concentration.
[0007] Furthermore, in step S2, the flood forecasting section nodes include hydrological stations and water level stations; the flood control dispatching water project nodes include reservoirs and flood storage and detention areas.
[0008] Furthermore, in step S5, through the list of main streams into which each generalized river flows, when it is determined that any two generalized rivers flow into the same main stream, the reciprocal of the total number of items in the list of main streams through which they pass respectively is used as the confluence correlation degree between any two generalized rivers.
[0009] Furthermore, each generalized river is calculated node by node from upstream to downstream; before each node is calculated, the completion status of the upstream node is first confirmed.
[0010] Furthermore, when one generalized river directly flows into another generalized river, the confluence correlation degree is 1.
[0011] The advantages of the present invention are as follows: Based on the tree-shaped confluence relationship characteristics of the rivers in the basin, by generalizing the rivers in the basin, the flood forecasting and water project dispatching nodes in the rivers, a parallel computing method for the basin flood forecasting and dispatching model that dynamically allocates between generalized rivers and multiple CPU cores is established, maximizing the use of computing resources, achieving a reasonable speedup ratio, effectively avoiding the situation of calculation waiting, and achieving good calculation performance even when the computing power is lacking, providing an effective way to improve the model calculation efficiency during flood control dispatching consultation. Description of the Drawings
[0012] Figure 1 is the flow chart of the method of the present invention.
[0013] Figure 2 is the schematic diagram of the tree-shaped generalization method of the rivers in the basin in the method of the present invention.
[0014] Figure 3It is a schematic diagram of the smallest parallel unit in the basin in the method of the present invention.
[0015] Figure 4 It is a schematic diagram of the shortest calculation time-consuming in the basin in the method of the present invention.
[0016] Figure 5 It is a flow chart of computing power allocation in the method of the present invention.
[0017] Figure 6 It is a generalized diagram of flood forecasting and dispatching nodes in a certain basin in the embodiment of the present invention. Specific implementation manners
[0018] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.
[0019] As Figure 1 shown, the parallel computing method for the basin flood forecasting and dispatching model of the present invention includes the following steps: S1. Generalize the rivers within the basin calculation range, and take each generalized river as the smallest parallel unit. That is: according to the distribution of flood forecasting and dispatching nodes such as hydrological stations, water level stations, reservoirs, and flood storage and detention areas within the basin calculation range, generalize the actual rivers within the basin into parallel computing rivers, so as to ensure that there is only a main-branch relationship between the parallel computing rivers, and no series relationship. Although there is an inflow dependence between the parallel rivers that are main-branch to each other, this dependence occurs after the calculation of a single river is completed and does not affect the parallel computing itself. Based on this, the rivers with flood forecasting and dispatching nodes such as sections and water projects are generalized into a single river for runoff generation and concentration calculation, and the small tributaries without flood forecasting and dispatching nodes are not generalized separately, and their runoff generation and concentration calculations are included in the downstream nodes of their confluent main streams.
[0020] S2. Generalize the flood forecasting section nodes and flood control dispatching water project nodes. That is: generalize the flood forecasting and dispatching nodes on each generalized river within the basin calculation range into flood forecasting section nodes (including hydrological stations and water level stations) and flood control dispatching water project nodes (including reservoirs and flood storage and detention areas) respectively. Adopt an object-oriented manner to represent the flood forecasting and dispatching node class. To express the upstream and downstream relationships of the nodes, each node class includes the following attributes: upstream node list, downstream node, and the river to which it belongs.
[0021] S3. Construct a flood forecasting model and a water project scheduling model for the basin. That is: the flood forecasting model applied during flood forecasting operations for the said basin, and the water project scheduling model applied during flood control scheduling operations are split and transformed according to flood forecasting nodes and water project scheduling nodes, so as to ensure that the flood forecasting model corresponds to specific flood forecasting nodes and water project scheduling nodes respectively, and the water project scheduling model corresponds to specific water project scheduling nodes respectively.
[0022] S4. Determine the computing time consumption of each generalized river and find the generalized river with the longest computing time consumption in the basin. That is: for the physical mechanism model, its runoff generation and concentration computing time consumption is positively correlated with the basin area, and the computing time consumption is estimated according to the basin area of each generalized river; for the mathematical statistics model, its runoff generation and concentration computing time consumption is related to the number of flood forecasting and scheduling nodes, and the computing time consumption is estimated according to the number of flood forecasting and scheduling nodes included in each generalized river. At this time, the computing time consumption of the generalized river with the longest computing time consumption is the theoretical shortest computing time of the entire basin.
[0023] S5. Determine the confluence correlation degree between any two generalized rivers and form a correlation matrix , where n is the number of generalized rivers, is the confluence correlation degree between the i-th and j-th generalized rivers. Specifically: First, confirm the list of main streams into which each generalized river flows, that is, query the main streams into which it flows step by step until the main river within the basin calculation range to form a list; then, traverse the lists of main streams into which any two generalized rivers flow respectively until the same item is found, sum the quantities before the same item in the two lists of main streams into which they flow, and then take the reciprocal to obtain a value ranging from [0,1], that is, the confluence correlation degree between any two generalized rivers; the larger the value, the stronger the confluence relationship; finally, form a correlation matrix.
[0024] When one generalized river directly flows into another generalized river, the confluence correlation degree is 1.
[0025] S6. Dynamically allocate computing power and perform parallel computing. That is: Dynamically allocate CPU cores to the number of generalized rivers in the basin (i.e., the minimum parallel unit). If the number of generalized rivers is less than the number of CPU cores, each generalized river occupies one CPU core and all rivers can be executed in parallel. If the number of generalized rivers is greater than the number of CPU cores, then two or more generalized rivers must be processed by the same CPU core. At this time, dynamically allocate CPU cores to ensure that there is no computing waiting time for the nodes on the river with the longest computing time consumption. Based on this, when allocating CPU cores, evenly allocate according to the computing time consumption of each generalized river, and at the same time ensure that the generalized rivers with high confluence correlation degrees, that is, adjacent numbered generalized rivers, are allocated to different CPU cores.
[0026] Execute parallel computing according to the dynamic computing power grouping. For each single generalized river within a group, serial computing is performed node by node from the upstream to the downstream, starting from the highest-level leaf node and calculating up to the root node of the river. At the same time, before each node performs the calculation, it checks whether all the upstream nodes have completed the calculation (including the confluence of tributaries). If not, it continues to wait for notification from its upstream node. After each node completes the calculation, it marks itself as completed and simultaneously notifies the downstream node.
[0027] As Figure 2 shown, the entire computing power allocation flowchart of the parallel computing method for the basin flood forecasting and dispatching model described in the present invention is presented. As Figure 3 shown, it is a schematic diagram of generalized rivers in a certain basin. As Figure 4 shown, when the number of generalized rivers is less than the number of CPU cores, each generalized river occupies one CPU core, and all rivers can be executed in parallel. As Figure 4 shown. If the number of generalized rivers is greater than the number of CPU cores, then there must be two or more generalized rivers processed by the same CPU core. At this time, the CPU cores are dynamically allocated to ensure that there is no computing waiting time for the nodes on the river with the longest time consumption.
[0028] Assume that the number of generalized rivers is greater than the number of CPU cores. At this time, if generalized river 4 and river 5 are on the same CPU core, it will cause computing waiting at node 1. However, if generalized river 2 and river 5 are allocated to the same CPU core for serial computing, and the generalized river with fewer flood control nodes is calculated first during the serial computing, then the occurrence of computing waiting can be avoided to the greatest extent, ensuring the shortest computing time consumption for the entire basin.
[0029] As Figure 5 shown, the computing time consumption of generalized river 3 is the longest. Therefore, the computing power is allocated based on ensuring that there is no computing waiting time for the nodes on generalized river 3.
[0030] Embodiment 2 Taking the rivers within the region from Sanmenxia reservoir inflow to Lijin in the middle and lower reaches of the Yellow River Basin as an example, the specific implementation process of the parallel computing method for the basin flood forecasting and dispatching model described in the present invention is as follows: S1, Generalize the rivers within the calculation range from Sanmenxia reservoir inflow to Lijin in the middle and lower reaches of the Yellow River Basin as the smallest parallel unit, as Figure 6 shown. According to the distribution of flood forecasting and dispatching nodes such as hydrological stations, water level stations, reservoirs, flood detention and storage areas, etc. within the calculation range of the middle and lower reaches of the Yellow River Basin from Sanmenxia reservoir inflow to Lijin, the actual rivers within the basin calculation range are generalized into five parallel computing rivers: the main stream of the Yellow River, Luo River, Yi River, Qin River, and Dan River, so as to ensure that there is only a main-stream and tributary relationship among the parallel computing rivers, and no series relationship. Although there is an inflow dependence between the parallel rivers that are the main stream and tributaries of each other, this dependence occurs after the calculation of a single river is completed and does not affect the parallel computing itself.
[0031] S2. Generalize the flood forecast section nodes and flood control and operation water project nodes. The flood forecast and operation nodes on the rivers within the calculation range from the Sanmenxia reservoir inflow to Lijin in the middle and lower reaches of the Yellow River Basin are generalized into flood forecast sections (including hydrological stations and water level stations) and flood control and operation water projects (including reservoirs and flood storage and detention areas), and are represented as a flood forecast and operation node class in an object-oriented manner. To express the upstream and downstream relationships of the nodes, the node class includes the following attributes: list of upstream nodes, downstream node, and affiliated river.
[0032] S3. Reform the basin flood forecast model and water project operation model. That is: the flood forecast model applied during flood forecasting operations in the middle and lower reaches of the Yellow River Basin (from the Sanmenxia reservoir inflow to Lijin), and the water project operation model applied during flood control and operation, are split and reformed by code blocks according to the flood forecast and water project operation nodes, so as to ensure that the flood forecast model corresponds to specific flood forecast and water project operation nodes (referring to reservoir inflow floods), the water project operation model corresponds to specific water project operation nodes, and OpenMP is used for parallel processing of code blocks.
[0033] The flood forecast schemes adopted in the model are mainly divided into the flood forecast scheme for the area between the Sanmenxia and Huayuankou sections and the flood forecast scheme for the lower reaches of the Yellow River. The area between the Sanmenxia and Huayuankou sections is the main runoff generation and concentration area, with a large drainage area, complex underlying surface conditions, and uneven temporal and spatial distribution of rainfall. Therefore, the entire basin area is divided into blocks by each flood control section and flood control and operation water project as nodes. In the lower reaches of the Yellow River, it is mainly flood routing with less runoff generation and concentration, and there are levees on both sides. The water project operation schemes adopted in the model are mainly the open spillway operation schemes and command operation schemes of reservoirs such as Sanmenxia and Xiaolangdi on the main stream of the Yellow River, and reservoirs such as Luhun, Guxian, and Hekoucun on the tributaries, as well as flood storage and detention areas such as Dongping Lake and Beijindi. OpenMP is used for parallel processing of code blocks in the model.
[0034] S4. Determine the calculation time consumption of each generalized river. For the physical mechanism model, the calculation time consumption of runoff generation and concentration is positively correlated with the drainage area, and the calculation time consumption is estimated according to the drainage area of each generalized river; for the mathematical statistics model, the calculation time consumption of runoff generation and concentration is related to the number of flood forecast and operation nodes, and the calculation time consumption is estimated according to the number of flood forecast and operation nodes included in each generalized river.
[0035] Accordingly, for the five rivers of the main stream of the Yellow River, Luo River, Yi River, Qin River, and Dan River, the numbers of nodes are: 12, 6, 4, 5, and 2 respectively.
[0036] S5. Determine the confluence correlation degree between any two generalized rivers to form a correlation degree matrix , where n is the number of generalized rivers, is the confluence relevance between the i-th and j-th generalized rivers. Specifically: First, confirm the list of main rivers into which each generalized river flows, that is, query step by step the main rivers into which it flows until the main river within the basin calculation range is found, forming a list; then, traverse the lists of main rivers into which any two generalized rivers flow respectively until the same item is found, sum the numbers before the same item in the two lists of main rivers into which they flow, and then take the reciprocal to obtain a value ranging from [0,1], that is, the confluence relevance between any two generalized rivers; the larger the value, the stronger their confluence relationship; finally, form a relevance matrix.
[0037] S6, dynamically allocate computing power and perform parallel computing. That is: Dynamically allocate CPU cores to the number of generalized rivers in the basin (which is also the minimum parallel unit). If the number of generalized rivers is less than the number of CPU cores, each generalized river occupies one CPU core and all rivers can be executed in parallel. If the number of generalized rivers is greater than the number of CPU cores, then two or more generalized rivers must be processed by the same CPU core. At this time, dynamically allocate CPU cores to ensure that there is no computing waiting time for the nodes on the river with the longest time-consuming. Based on this, when allocating CPU cores, allocate them evenly according to the computing time-consuming of each generalized river, and at the same time ensure that the generalized rivers with high relevance in the confluence relationship are allocated to different CPU cores.
[0038] The simulation time of this embodiment is 192h, including a model warm-up period of 24h and a prediction period of 168h. For the case where the number of generalized rivers is less than the number of CPU cores, each generalized river is calculated in parallel among 5 CPU cores. For the case where the number of generalized rivers is greater than the number of CPU cores, after dynamic grouping, each group first calculates the river with fewer nodes to avoid waiting time-consuming.
[0039] When performing parallel computing, perform parallel computing according to the dynamic grouping. For each single generalized river within each group, perform serial computing node by node from upstream to downstream, starting from the highest-level leaf node and calculating to the root node of the river. At the same time, before each node calculates, check whether all the upstream nodes have been calculated (including the confluence of tributaries). For example, before calculating at the Heishiguan Station, it is necessary to ensure that the Baima Temple Station and the Longmen Town Station have both been calculated. If not, continue to wait for notification from its upstream node. After each node calculates, mark it as completed and at the same time notify the downstream node.
[0040] The computing time of this embodiment is the computing time-consuming of the Yellow River main stream with the longest time-consuming. In addition, the speedup ratio of separately calculating the Sanmenxia-Huayuankou section is better than that of the middle and lower reaches of the Yellow River from Sanmenxia Reservoir to Lijin. This is because the lower reaches of the Yellow River cannot be independently calculated in parallel with its upstream basin. This part needs to wait until the Sanmenxia-Huayuankou section is completely calculated before performing the calculation.
Claims
1. A parallel computing method for a basin flood forecasting and dispatching model, characterized in that: The following steps are involved: S1, rivers within the generalized watershed calculation range; Based on the actual rivers in the basin, the rivers with flood forecast and dispatch nodes are generalized as one river to calculate the runoff; S2, generalized flood forecast section nodes and flood control and water engineering nodes; Divide the flood forecasting and dispatching nodes on the generalized river into flood forecasting section nodes and flood control and dispatching water engineering nodes, and use an object-oriented method to represent the upstream node list, downstream node, and the river to which the node belongs; S3, constructing a basin flood forecasting model and a water project dispatching model; mapping the flood forecasting model to each flood forecasting section node; Correspond the water project dispatching model to each flood control dispatching water project node; S4, determine the calculation time of each generalized river, and find the generalized river with the longest calculation time in the basin; for the physical mechanism model, estimate the calculation time according to the basin area of each generalized river; for the mathematical statistics model, estimate the calculation time according to the number of flood forecasting and dispatching nodes contained in each generalized river; S5, determining the confluence correlation between the generalized rivers and forming a correlation matrix; S6, dynamically allocates computing power; according to the number of CPU cores, the computing power is allocated and parallel computing is performed according to the criterion of no computing waiting time for each node on the longest generalized river and the criterion of using different CPU cores to calculate the generalized river calculations with high correlation.
2. The parallel computing method for basin flood forecasting and dispatching model according to claim 1 is characterized by: In step S1, rivers without flood forecasting and dispatching nodes are generalized together with rivers with flood forecasting and dispatching nodes converging into the mainstream, and the runoff is calculated.
3. The parallel computing method for basin flood forecasting and dispatching model according to claim 1 is characterized by: In step S2, the flood forecast section nodes include hydrological stations and water level stations; the flood control and dispatching water project nodes include reservoirs and flood storage areas.
4. The parallel computing method for basin flood forecasting and dispatching model according to claim 1 is characterized by: Step S5 uses the list of mainstream streams that each generalized river merges into to determine the reciprocal of the sum of the number of items in the mainstream stream list that each of the two generalized rivers passes through when merging into the same mainstream, as the confluence correlation between the two generalized rivers.
5. The parallel computing method for basin flood forecasting and dispatching model according to claim 1 is characterized by: Each generalized river is calculated node by node from upstream to downstream; before calculating each node, the completion status of the upstream node is confirmed first.
6. The parallel computing method for basin flood forecasting and dispatching model according to claim 4 is characterized by: When one generalized river flows directly into another generalized river, the confluence correlation is 1.