Parallel method and apparatus for extracting river network in distributed memory architecture

By performing flow direction determination preprocessing and block processing on river vector or raster data under a distributed memory architecture, combined with non-blocking communication of multiple computing processes, the computational efficiency and memory requirements of existing river network extraction algorithms under high-resolution DEM data are solved, and efficient parallel extraction of large-scale river networks is achieved.

WO2026036445A1PCT designated stage Publication Date: 2026-02-19TSINGHUA UNIVERSITY
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2024/115950
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2024-08-15
Filing Date
2024-08-30
Publication Date
2026-02-19

AI Technical Summary

Technical Problem

Existing river network extraction algorithms are insufficient to meet the demands of DEM data resolution that has increased with the development of spatial information technology. They cannot improve computational efficiency and reduce memory requirements while ensuring river network accuracy, especially when processing raster digital river networks ranging from hundreds of billions to trillions.

Method used

A parallel approach under a distributed memory architecture is adopted. By preprocessing known river vector or raster data to determine the flow direction, processing DEM data in blocks, and using multiple computing processes to transmit the flow direction information of edge buffer rasters in a non-blocking communication manner, large-scale high-resolution river networks can be extracted in parallel.

Benefits of technology

While ensuring the accuracy of the river network, the computational efficiency was improved, the processable watershed area and DEM resolution were expanded, the memory capacity requirement for a single machine was reduced, and the structured extraction of raster digital river networks ranging from hundreds of billions to trillions was realized.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024115950_19022026_PF_FP_ABST
    Figure CN2024115950_19022026_PF_FP_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of data extraction, and in particular, to a parallel method and apparatus for extracting a river network in a distributed memory architecture. The method comprises: in a distributed memory architecture, performing flow direction determination preprocessing on a grid corresponding to a known river vector or grid data, and obtaining a preprocessing result; on the basis of the actual scale and shape of digital elevation model (DEM) data, dividing DEM data to be processed into blocks, and obtaining a block division result; on the basis of multiple calculation processes, determining a corresponding grid flow direction when the preprocessing result and the block division result are parallel, and obtaining a river network extraction result, flow direction information of an edge buffer grid being transmitted, according to actual need and in a non-communication blocking manner, between neighboring DEM data blocks in the DEM data to be processed. The present application can improve operation efficiency while ensuring the accuracy of an original river network, increase the area scale and DEM resolution of a watershed that can be processed by an algorithm, reduce the memory capacity requirement of a single machine, and implement large-scale river network extraction.
Need to check novelty before this filing date? Find Prior Art

Description

Parallel method and device for extracting river network under distributed memory architecture

[0001] Cross-reference to Related Applications

[0002] The present application claims priority from the Chinese patent application No. 202411123429.X entitled "Parallel method and device for extracting river network under distributed memory architecture" filed on August 15, 2024 with the State Intellectual Property Office of the People's Republic of China, and assigned to Tsinghua University. TECHNICAL FIELD

[0003] The present application relates to the technical field of data extraction, and in particular, to a parallel method and device for extracting river network under distributed memory architecture. BACKGROUND

[0004] In related technologies, mainstream river network extraction algorithms are basically extracted from digital elevation model (DEM) data. The extracted river network can include basic geometric information of each river section and source-sink flow topological relationship therebetween. These information has been widely applied in the fields of distributed rainfall runoff simulation of river basin, non-point source pollution simulation, and geomorphology analysis. Therefore, extracting high-precision river network provides necessary conditions for improving the precision of river basin rainfall runoff and environmental simulation and in-depth exploration of the internal structure of river, and has important scientific value.

[0005] However, the river network extraction algorithm in related technologies is difficult to meet the required running time and memory space when facing the increasing DEM data resolution with the development of spatial information technology. How to structurally reconfigure and functionally upgrade the serial program to complete the structured extraction of hundreds of billions to trillions of grid digital river network at one time is an urgent problem to be solved.

[0006] SUMMARY

[0007] The present application provides a parallel method and device for extracting river network under distributed memory architecture to solve the problem that the river network extraction algorithm in related technologies is difficult to meet the required running time and memory space when facing the increasing DEM data resolution with the development of spatial information technology, and how to structurally reconfigure and functionally upgrade the serial program to complete the structured extraction of hundreds of billions to trillions of grid digital river network at one time.

[0008] The first aspect embodiment of the present application provides a parallel method for extracting river network under a distributed memory architecture, comprising the following steps: under the distributed memory architecture, performing flow direction judgment preprocessing on a grid corresponding to known river vector or raster data to obtain a preprocessing result; dividing the to-be-processed DEM data according to the actual size and shape of the DEM data to obtain a division result; based on multiple computing processes, determining the corresponding grid flow direction according to the preprocessing result and the division result in parallel to obtain an extraction result of the river network, wherein the flow direction information of the edge buffer grid between the neighbor DEM data blocks in the to-be-processed DEM data is transmitted according to actual needs in a non-blocking communication mode.

[0009] Optionally, in an embodiment of the present application, the preprocessing of the grid corresponding to the known river vector or raster data to obtain the preprocessing result comprises: traversing all the known river grids processed by rasterization, finding the grids located at the DEM boundary and adding them to a node size balanced binary search tree; selecting and deleting the known river grid with the highest priority in the node size balanced binary search tree; pointing the flow direction of the grids that have never been added to the node size balanced binary search tree among the eight neighbors of the known river grid with the highest priority to the deleted grid, and adding the corresponding known river grid to the tree, until all the known river grids are added to and deleted from the node size balanced binary search tree, to obtain the grid flow direction of all the known river grids and the directly adjacent grids.

[0010] Optionally, in an embodiment of the present application, the multiple computing processes are divided into a master process and multiple computing processes, wherein the master process completes the pre-processing tasks of the DEM in sequence at the beginning of the program and before the start of parallel computing, and transmits the tasks to the corresponding computing processes in sequence through the MPI interface, including the range of the divided DEM and the boundary grid, and the known river grid; each computing process performs a corresponding computing process after receiving the task allocated by the master process.

[0011] Optionally, in an embodiment of the present application, after the parallel computing is completed, each computing process sends a transmission request message to the master process, and transmits the computing result in the DEM block allocated by the master process to the master process after receiving the confirmation transmission message sent by the master process, wherein the master process sends the confirmation transmission message to only one of the computing processes sending the transmission request message each time, and sends the confirmation transmission message to another process after receiving all the computing results of the process.

[0012] Optionally, in one embodiment of the present application, in the process of calculating the DEM data block responsible for itself, if the edge buffer grid of the DEM block responsible for itself is involved, the flow information thereof is collected as the message to be transmitted, and the adjacent computing process number to which the information needs to be sent is recorded, so that after the messages to be sent to the adjacent computing process are collected to exceed a preset number, all the information is transmitted to the adjacent computing process.

[0013] The second aspect embodiment of the present application provides a parallel device for extracting a river network under a distributed memory architecture, comprising: a processing module, configured to perform flow direction judgment preprocessing on a grid corresponding to known river vector or grid data under the distributed memory architecture to obtain a preprocessing result; a blocking module, configured to block the to-be-processed DEM data according to the actual size and shape of the DEM data to obtain a blocking result; and an extraction module, configured to determine the corresponding grid flow direction based on multiple computing processes according to the preprocessing result and the blocking result in parallel to obtain an extraction result of the river network, wherein the flow direction information of the edge buffer grid between the neighbor DEM data blocks in the to-be-processed DEM data is transmitted in a non-blocking communication mode according to actual needs.

[0014] Optionally, in one embodiment of the present application, the processing module comprises: a traversal unit, configured to traverse all the known river grids after rasterization processing, find out the grids located at the DEM boundary, and add the grids to a node size balanced binary search tree; a search unit, configured to select and delete the known river grid with the highest priority in the node size balanced binary search tree; and a processing unit, configured to point the flow direction of the grids that have never been added to the node size balanced binary search tree among the eight neighbors of the known river grid with the highest priority to the deleted grid, and add the corresponding known river grid to the tree, until all the known river grids are added to and deleted from the node size balanced binary search tree, to obtain the grid flow direction of all the known river grids and the directly adjacent grids.

[0015] Optionally, in one embodiment of the present application, the multiple computing processes are divided into a master process and multiple computing processes, wherein the master process completes the pre-processing task of the DEM in sequence at the beginning of the program and before the start of parallel computing, and transmits the blocked DEM and the range of the boundary grid in the blocking result and the known river grid to the corresponding computing process in sequence through an MPI interface; each computing process performs a corresponding computing process after receiving the task allocated by the master process.

[0016] Optionally, in one embodiment of the present application, after the parallel computation ends, each computing process sends a transmission request message to the master process, so as to transmit the computing result in the DEM block allocated to it to the master process after receiving an acknowledgement transmission message sent by the master process, wherein the master process sends the acknowledgement transmission message to only one of the computing processes sending the transmission request message each time after receiving the transmission request message, and sends the acknowledgement transmission message to another process after receiving all the computing result of the process.

[0017] Optionally, in one embodiment of the present application, during the computation of the DEM data block responsible for by each computing process, if the edge buffer grid of the DEM block responsible for by the computing process is involved, the flow direction information thereof is collected as a message to be transmitted, and the number of the adjacent computing process to which the information needs to be sent is recorded, so as to transmit all the information to the adjacent computing process after the messages to be sent to the adjacent computing process are collected to exceed a preset number.

[0018] The third aspect embodiment of the present application provides an electronic device, comprising a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the parallel method for extracting river network under the distributed memory architecture as described in the above embodiments.

[0019] The fourth aspect embodiment of the present application provides a computer readable storage medium, which stores a computer program, wherein the program is executed by a processor to implement the parallel method for extracting river network under the distributed memory architecture as described above.

[0020] The fifth aspect embodiment of the present application provides a computer program product, comprising a computer program, wherein the computer program is executed to implement the parallel method for extracting river network under the distributed memory architecture as described above.

[0021] The embodiments of the present application can apply parallel computation in the river network extraction computation process such as grid flow direction judgment based on digital elevation model data under the distributed memory architecture, to realize parallel extraction of large-scale high-resolution river network, thereby realizing improvement of operation efficiency under guarantee of original river network precision, improvement of the basin area scale and / or DEM resolution that can be processed by the algorithm, and reduction of the demand for single machine memory capacity, so as to realize one-time completion of structured extraction of hundreds of billions to trillions of grid digital river network. Thus, the problems such as difficulty of the river network extraction algorithm in related art in meeting the required operation time and memory space when facing the DEM data resolution that is continuously improved with the development of spatial information technology, how to perform structural reconstruction and functional upgrade on the serial program, and one-time completion of structured extraction of hundreds of billions to trillions of grid digital river network are solved.

[0022] Additional aspects and advantages of the present application will be made apparent from the following description with reference to the accompanying drawings. BRIEF DESCRIPTION OF DRAWINGS

[0023] The above and / or additional aspects and advantages of the present application will become apparent and be more readily understood from the following description, taken in conjunction with the accompanying drawings, in which:

[0024] Fig. 1 is a flow chart of a parallel method for extracting river network under distributed memory architecture according to an embodiment of the present application;

[0025] Fig. 2 is a known river network burning pretreatment diagram according to an embodiment of the present application;

[0026] Fig. 3 is a non-blocking communication and flow direction reassignment diagram according to an embodiment of the present application;

[0027] Fig. 4 is a DEM block diagram according to an embodiment of the present application;

[0028] Fig. 5 is a flow chart of a parallel method for extracting river network under distributed memory architecture according to an embodiment of the present application;

[0029] Fig. 6 is a structure diagram of a parallel device for extracting river network under distributed memory architecture according to an embodiment of the present application;

[0030] Fig. 7 is a structure diagram of an electronic device according to an embodiment of the present application.

[0031] Reference Signs:

[0032] 10 - parallel device for extracting river network under distributed memory architecture: 100 - processing module, 200 - block module and 300 - extraction module; 701 - memory, 702 - processor and 703 - communication interface. DETAILED DESCRIPTION

[0033] Embodiments of the present application are described in detail below with reference to the attached drawings. The embodiments described below are examples of the present application, and are not intended to limit the present application. The embodiments described below are intended to explain the present application, and are not intended to limit the present application.

[0034] A parallel method for extracting a river network under a distributed memory architecture and a device thereof are described below with reference to the accompanying drawings. In the related art mentioned in the background, the river network extraction algorithm is difficult to meet the required running time and memory space when facing the increasing DEM data resolution with the development of spatial information technology. How to restructure and upgrade the serial program to complete the structured extraction of the tera- to peta-level grid digital river network at one time, the present application provides a parallel method for extracting a river network under a distributed memory architecture. In this method, parallel computing can be applied to the grid flow direction judgment and other river network extraction calculation processes based on digital elevation model data under a distributed memory architecture, realizing parallel extraction of large-scale high-resolution river networks. Thus, the operation efficiency is improved under the guarantee of the original river network precision, the algorithm can process larger watershed area scale and / or DEM resolution, and the demand for single machine memory capacity is reduced, thereby realizing the structured extraction of tera- to peta-level grid digital river network at one time. Thus, the related art river network extraction algorithm is difficult to meet the required running time and memory space when facing the increasing DEM data resolution with the development of spatial information technology. How to restructure and upgrade the serial program to complete the structured extraction of the tera- to peta-level grid digital river network at one time and other problems are solved.

[0035] Before explaining the parallel method for extracting a river network under a distributed memory architecture provided by the embodiments of the present application, the system technology related to the embodiments of the present application is explained.

[0036] The river network is a hydrological system formed by all rivers including tributaries and main streams in the watershed intersecting with each other. Extracting high-precision river networks is the most critical foundation for building digital watersheds. On May 25, 2023, the Central Committee of the Communist Party of China and the State Council issued the "National Water Network Construction Planning Outline". It proposes to accelerate the construction of the national water network, build a modern high-quality water conservancy infrastructure network, and make major strategic deployments to solve water resources, water ecology, water environment, and water disaster problems. The national water network is based on natural rivers and lakes, uses water diversion and drainage projects as channels, uses storage projects as nodes, uses intelligent regulation and control as a means, integrates water resources optimization, flood control and disaster reduction, and water ecological system protection into one comprehensive system. The river network extracted from the terrain data is a digital description of the natural water network in the national water network. With meteorological, geological, ecological, and social information, it can provide relevant departments with scientific basis for simulating and predicting hydrology and flood processes, planning water resources storage projects, and reasonably scheduling water resources, which has important practical significance.

[0037] Further, in the embodiments of the present application, MPI (Message Passing Interface) parallel computing standard and its development and running environment are mainly but not limitedly used, and the algorithm can run in a computer and network hardware system with single machine to multi-machine distributed memory. The algorithm runs in the distributed memory architecture of the environment, which can improve the size of the drainage area and / or the resolution of DEM that the algorithm can handle, and can reduce the demand for single machine memory capacity. Generally, the program runs concurrently in a multi-computer system with network connection, transmits messages between different processes of a computer and different processes of different computers through the MPI interface, thereby concurrently processes the problem and improves the operation efficiency of large-scale high-resolution river network extraction, and can coordinate the use of memory space on different computers; the program can also run in a single computer system.

[0038] Specifically, FIG. 1 is a flowchart of a parallel method for extracting a river network in a distributed memory architecture according to an embodiment of the present application.

[0039] As shown in FIG. 1, the parallel method for extracting a river network in a distributed memory architecture includes the following steps:

[0040] In step S101, in the distributed memory architecture, the flow direction judgment preprocessing is performed on the grid corresponding to the known river vector or raster data, and a preprocessing result is obtained.

[0041] Those skilled in the art can understand that the distributed memory architecture refers to a computing system architecture in which memory resources are distributed among multiple independent processors or nodes, each node has its own independent memory space, and data exchange and sharing can be performed through a network or other communication mechanisms. This architecture has a wide range of applications in parallel computing, high-performance computing (HPC), and big data processing.

[0042] In some embodiments, in the parallel method for extracting a river network, the flow direction judgment preprocessing can be performed on the grid corresponding to the known river vector or raster data, and then the subsequent processing is performed based on the known river vector or raster data after the preprocessing.

[0043] River vector and raster data are commonly used data types in geographic information systems, which represent the spatial location and attribute information of rivers. Among them, river vector data is a data that represents the spatial location and shape of rivers with point, line, and surface vector graphic elements, containing attribute information such as the starting point, ending point, length, width, flow direction, and water depth of the river, which can clearly express the boundary and direction of the river. River raster data is a data that divides the spatial information of the river according to a certain grid size and represents the attribute value (such as water depth, flow rate, etc.) of each grid in digital form, usually containing grid water depth, flow rate, flow direction, and other physical parameters of the river, which is easy to analyze and process spatially.

[0044] Next, the process is further described.

[0045] Optionally, in an embodiment of the present application, the known river vector or raster data corresponding to the grid is preprocessed for flow direction judgment, and a preprocessing result is obtained, including: traversing all known river grids after grid processing, finding out the grid located at the DEM boundary and adding it to the node size balanced binary search tree; selecting the highest priority known river grid in the node size balanced binary search tree and deleting it from the tree; pointing the drainage direction of the grid that has never been added to the node size balanced binary search tree among the eight neighbors of the highest priority known river grid to the deleted grid, and adding the corresponding known river grid to the tree, until all known river grids are added to the node size balanced binary search tree and deleted, to obtain the grid flow direction of all known river grids and the directly adjacent grids.

[0046] Based on the related description of other embodiments, it can be understood that the present application can preprocess the grid corresponding to the known river vector or raster data for flow direction judgment, so as to utilize the known river vector or raster data after preprocessing for subsequent processing.

[0047] In some embodiments, in the case of known river vector or raster data, the present application can divide the grid flow direction judgment process of the known river burning algorithm into two independent stages. The first stage is to determine the grid flow direction of the known river and the directly adjacent grid, and the second stage is to determine the grid flow direction of all other land grids. The embodiment of the present application can be considered as preprocessing the grid corresponding to the known data for flow direction judgment. Specifically, the preprocessing process can be represented as follows:

[0048] (1) Initialization processing: traverse all known river grids after preprocessing, find out the only grid located at the boundary of the digital elevation model and add it to the node size balanced binary search tree.

[0049] (2) Priority grid update: select the highest priority known river grid in the node size balanced binary search tree and delete it from the tree.

[0050] (3) Confluence path extension: The confluence directions of the 8 neighbors of the just deleted grid, which have never joined the node size balanced binary search tree, are directed to the just deleted grid, and only the known river grids among them are added to the tree, to ensure that only known river grids are in the node size balanced binary search tree, and the flow directions of all the grids directly adjacent to the known river grids are determined.

[0051] (4) Loop processing: Steps (2) and (3) are looped in turn until all the known river grids are added to and deleted from the node size balanced binary search tree, at which time all the known river grids in the DEM and the flow directions of the grids directly adjacent to the known river grids are obtained.

[0052] For example, FIG. 2 is a known river network burning pre-processing diagram according to an embodiment of the present application. As shown in FIG. 2, the specific process of the first stage of forcing the flow direction of the nearby grid of the known river is shown. In FIG. 2(a), the first stage initialization is shown, and only the D1 known river outlet grid is added to the node size balanced binary search tree; in FIG. 2(b), D1 becomes the current priority grid of the first stage, and the confluence path extension is performed from D1, C2, D2, and E2 known river grids are judged to flow and added to the node size balanced binary search tree, and C1 and E1 land grids are judged to flow; in FIG. 2(c), after several rounds of operation in the first stage, G7 becomes the new priority grid of the first stage, and the confluence path extension is performed from G7, G8 known river grid is judged to flow and added to the node size balanced binary search tree, and F8 and H8 land grids are judged to flow. In FIG. 2(d), the first stage is formally ended, and the flow directions of all the known rivers and the grids directly adjacent to the known rivers are determined, and the known river grid flow direction pre-processing is completed.

[0053] In the process of using known river data to perform flow direction judgment pre-processing, the priority standard can be modified in the embodiments of the present application. That is, the priority standard of the grids leaving the node size balanced binary search tree one by one is modified in the known river burning algorithm in the embodiments of the present application. For example, in the depression filling and digging algorithm based on minimum cost search proposed by L. Wang and H. Liu in 2007, the elevation value is the only standard of the priority. In the known river burning algorithm in the embodiments of the present application, a hierarchical priority measurement is used, the known river number and the known river label value are added, and the river label value is regarded as the most important standard in the priority measurement, and the elevation value is regarded as a secondary factor.

[0054] Three situations can occur under the known river burn algorithm in the embodiments of the present application: first, known river cells are always given higher priority than land cells. Second, in the case of comparing two land cells, elevation is still the only criterion, and the one with lower elevation is given higher priority. In some special cases, when the elevations of two cells are equal, the cell that was inserted earlier to balance the binary search tree is given higher priority. Third, for the comparison between two known river cells, the one with the smaller known river number is given higher priority, and the elevation criterion is only enabled when the two known river cells have the same known river number.

[0055] Thus, the known river burn algorithm can achieve flow direction enforcement without specifying an elevation offset. Since known river cells are preferentially "flooded" in the process of judging the flow direction of a cell, known river cells can force their neighboring cells to flow towards them. Additionally, the hierarchical priority metric also ensures that the known river with a lower number can be "flooded" before the known river with a higher number, and land cells are more likely to flow along the path of the known river with a smaller number.

[0056] Further, the embodiments of the present application also extend and improve the confluence path. The known river burn algorithm adopts an additional rule for the order of entering the node size-balanced binary search tree, as shown in FIG. 2. The embodiments of the present application can determine whether the neighboring cells enter the node size-balanced binary search tree by checking whether the popped node size-balanced binary search tree cell is a known river cell and whether it is the source of a known river. If the neighboring cell is a cell not constrained by a known river or a known river source cell, as long as the cell has not been flooded, it can be added to the node size-balanced binary search tree. If the neighboring cell is a known river constrained non-source cell, it can only be added to the node size-balanced binary search tree when it has the same known river number as the current popped cell. At the same time, the flow direction of any cell is not allowed to completely pass through two known river cells with the same number or two cells on the same internal drainage area boundary, to ensure that the internal drainage area internal cells cannot flow out of the internal drainage area range through the internal drainage area boundary and the river that crosses the known river due to DEM elevation.

[0057] Further, the embodiments of the present application can also improve the treatment of depression. That is, the known river burning algorithm in the embodiments of the present application abandons the previous depression filling algorithm, and instead adopts a depression breakthrough algorithm to help determine the flow direction in the depression. In the depression breakthrough algorithm, the original elevation value of the grid is retained and plays a role in determining the relevant priority, and at the same time, the flood simulation will first take the steepest downward path to reach the minimum elevation value, and then gradually flood the depression by advancing along the least steep uphill. Therefore, the initial DEM condition can be well preserved and fully utilized in priority determination and other subsequent calculations, such as grid flow direction determination.

[0058] In addition, the embodiments of the present application can also enhance the hydrological flow direction. The known river burning algorithm, after conducting inward flood simulation under the guidance of the algorithm improved in priority criteria, confluence path and depression treatment, obtains relatively accurate all grid flow directions and sorted grid sequences. However, the curve of each known river is not completely preserved. In order to solve the problem of river short circuit, the algorithm in the embodiments of the present application adopts the principles of "hydrologically most reasonable" and "least branching", so that the grid flow direction of each known river should be directed to the most downstream neighbor, as close as possible in hydrology, and the grid-based main flow path on a known river contains as many grids as possible to reduce the tributaries in the flow path.

[0059] In step S102, the DEM data to be processed is divided into blocks according to the actual size and shape of the digital elevation model (DEM) data, and a block result is obtained.

[0060] It can be understood that the digital elevation model (Digital Elevation Model, DEM for short) is a kind of geographical data model that realizes digital simulation of ground terrain through limited terrain elevation data. DEM is a kind of entity ground model that records the elevation information of the earth's surface in digital form, and can reflect the local terrain characteristics of a certain resolution. DEM data is usually presented in the form of a grid, each grid cell contains a height value, in meters, describing the ground elevation information.

[0061] In other embodiments, in order to simplify the extraction process of the river network, the DEM data to be processed can also be divided into blocks according to the available number of computer processes and the actual size and shape of the DEM data when judging the grid flow direction. The specific process can be represented as follows:

[0062] First, the uppermost position and the lowermost position of each column in the DEM are preprocessed, and the size of the DEM sub-matrix is used as the answer to the binary search. According to the size, the column range of each column DEM sub-matrix in the DEM is calculated. The uppermost position and the lowermost position in the column range are calculated by the preprocessed uppermost position and the lowermost position of each column. Thus, the number of DEM sub-matrices required in the column range is calculated. The number of DEM sub-matrices required to fill the entire DEM grid under the current DEM sub-matrix size is calculated in turn. The result is compared with the input available computer process number, and the minimum value of the DEM sub-matrix size within the process number range is finally obtained.

[0063] It should be noted that before the parallel computing grid flow starts, it is not enough to only allocate the elevation information of a DEM sub-matrix to each computing process. In addition to the elevation information of each grid, the computing process also needs to know whether each grid in the DEM sub-matrix needs to be added to the node size balanced binary search tree in the parallel computing initialization. The grid nodes that need to be added to the tree in advance are the boundary grid of the entire DEM, the known river grid and the grid directly adjacent to it. The known river grid and the grid directly adjacent to it are determined in steps one to four in advance. The grid flow direction is determined, and the boundary grid can be regarded as a potential outlet.

[0064] In step S103, based on multiple computing processes, the corresponding grid flow direction is determined in parallel according to the preprocessing result and the blocking result to obtain the extraction result of the river network. The flow direction information of the edge buffer grid between the neighbor DEM data blocks in the DEM data to be processed is transmitted by using a non-blocking communication mode according to actual needs.

[0065] As a possible implementation manner, after obtaining the known river vector or grid data and the processing result and the DEM data blocking result, the embodiment of the application can transmit the DEM data block (including the edge buffer grid) and the known river information responsible for each computing process to each computing process, and respectively determine the grid flow direction of the DEM data block responsible for each computing process. After the computing process is completed, the grid flow direction and the calculation result of the subsequent steps can be collected to the main process and saved in turn, so that the parallel extraction of the high-resolution large-scale river network can be realized.

[0066] In the process of calculating the grid flow direction of the DEM data block responsible for each computing process, each computing process can transmit the flow direction information of the edge buffer grid of the DEM block responsible for each computing process to the related computing process as needed, so as to ensure that each computing process has global perception ability for the river flowing through the DEM blocks of different computing processes when carrying out the current DEM block calculation, and constantly updates the calculation process and result of the DEM block that may be affected.

[0067] For example, in the parallel computing grid flow direction, all processes can be distinguished into a main process and a computing process. The main process only includes one process, responsible for the pre-work, overall progress and subsequent work, and the computing process is all other processes except the main process, mainly responsible for computing the land grid flow direction in the allocated DEM block. The main process appears at the beginning of the program, and completes the reading of DEM, blocking and other pre-work in sequence before the start of parallel computing, and transmits the blocked DEM and the information such as the boundary grid of the entire DEM in each block, the known river grid and the grid directly adjacent to it (hereinafter referred to as the initial grid) to each computing process in turn through the MPI information network. After receiving the task allocated by the main process, the computing process can judge the grid flow direction by imitating the steps before parallelization. The specific process can be represented as follows:

[0068] (1) Initialization processing: add the initial grid received from the main process to the respective node size balanced binary search tree in order of priority. The grid with high priority is on the left side of the search tree, and the grid with low priority is on the right side.

[0069] (2) Priority grid update: delete the grid with the highest priority in the node size balanced binary search tree.

[0070] (3) Update correction of confluence path: judge whether to update the flow direction of at most 8 neighbor grids around the grid just deleted in (2) according to the maximum elevation value on the optimal confluence path of the grid, and if updated, the grid needs to be inserted into the tree.

[0071] (4) Message transmission: judge whether the just deleted grid is adjacent to the DEM block responsible by other processes. If adjacent to the DEM block responsible by several computing processes, the specific location information and priority information of the grid need to be temporarily collected as the message to be transmitted. When the message to be sent to a neighboring computing process is collected more than a certain value, it is transmitted to the neighboring computing process at one time.

[0072] (5) Loop processing: repeat steps (2)-(4), when the number of updated grid flow direction exceeds a certain value, execute the next step to receive messages.

[0073] (6) Message receiving: receive all grid information sent to the current computing process at one time, and insert all these grids into the node size balanced binary search tree according to the priority. If the tree is not empty, re-execute step (2) to update the priority grid. If the tree is empty, execute sub-step seven.

[0074] (7) Message waiting: the computing process turns into a waiting stage. The computing process waits for the message transmission of the neighbor computing process and the global message sent by the master process in the waiting stage. If there is message transmission of the neighbor computing process, it returns to step (6) for message receiving. If the master process transmits a continue waiting message, the waiting stage is maintained. If the master process transmits a global end, the grid flow direction of each grid in the DEM block responsible by the computing process is transmitted to the master process in turn.

[0075] After all the computing processes complete the calculation, the grid flow direction and the calculation results of the subsequent steps are summarized to the master process and saved in turn, so that the high-resolution large-scale river network parallel extraction can be realized.

[0076] In the process of extracting the river network, the embodiments of the present application can use, but are not limited to, the search method based on the minimum cost. That is, in the case of known river vector or grid data, thanks to the simplification of the flow direction judgment preprocessing of the grid corresponding to the known data, before parallelization, the elevation of the grid is the only priority standard in the node size balanced binary search tree. However, with the DEM being divided by each computing process, the single elevation information cannot completely restore the previous inward flood simulation. The original inward flood simulation essentially ensures that the grid selected and deleted one by one in the node size balanced binary search tree satisfies the principle that the maximum elevation value on the optimal flow path does not decrease strictly. To completely restore the inward flood simulation, after parallelization, the elevation value of the grid and the maximum elevation value on the optimal flow path need to be saved and inserted into the node size balanced binary search tree as the priority. The specific priority involves three layers of comparison: the first layer compares the elevation value, the grid with a lower elevation has a higher priority, in the case of the same elevation value, the second layer compares the maximum elevation value on the optimal flow path, the grid with a lower maximum elevation value on the optimal flow path has a higher priority, and in the case of the same comparison in the second layer, the third layer compares the position information to ensure that in the case of the same in the first two, the priority order has a definite result.

[0077] Further, in the process of the embodiments of the present application in each computing process for grid flow direction judgment and other calculations on the DEM data block responsible by itself, the non-blocking communication mode is mainly used to transmit the flow direction information of the edge buffer grid of the DEM block responsible by itself to the related computing process.

[0078] Firstly, the embodiment of the present application can perform message transmission between neighbor computing processes through non-blocking communication and computing update mode. This is mainly because each DEM block is set to be a square as much as possible, so each process has at most 8 neighbor computing processes, and each grid is adjacent to at most 3 other DEM blocks, and bidirectional message transmission is possible between neighbor computing processes. Since the DEM blocks responsible for each computing process only have one edge intersecting each other, the message received by each computing process must only be the position information and priority information of the peripheral grid. Considering that the time point when the peripheral grid joins the node size balanced binary search tree may be slightly lagging or ahead, the priority information needs to take into account the maximum elevation value on the optimal confluence path in advance. Therefore, when the peripheral grid joins the node size balanced binary search tree, the elevation value and the maximum elevation value on the optimal confluence path should both be set to the maximum elevation value on the optimal confluence path received, so that the maximum elevation value on the optimal confluence path becomes the first layer of priority comparison of the peripheral grid.

[0079] In addition, one of the great advantages of MPI parallel computing is non-blocking communication. That is, the sender of the message is allowed to return after the end of the sending instruction, directly proceed to the subsequent work, and can test at any time whether there is a completed sent message by using the instruction; the receiver of the message is allowed to return after the end of the receiving instruction, directly proceed to the subsequent work, and can test at any time whether there is a completed received message by using the instruction. Non-blocking communication gives the algorithm the possibility of overlapping computation and communication. In order to reduce the number of communications and communication time as much as possible, a buffering measure is adopted for communication between neighbor computing processes, that is, the messages that need to be transmitted are first stored in a buffer, and when the number is certain, transmission is performed, reducing the number of transmissions. At the same time, this measure also allows the process to receive information after a period of time, also reducing the number of receptions, greatly improving the running speed.

[0080] Although non-blocking communication greatly improves the running speed, it also brings the problem of message lag, that is, the confluence direction of the grid in the DEM block has been incorrectly pointed to other grids before being assigned the correct direction due to the existence of the optimal confluence path. Therefore, the embodiment of the present application can reassign the grid flow direction to make up for the message lag problem. Unlike the original known river burning algorithm, the priority grid deleted from the node size balanced binary search tree needs to be additionally checked for the grid flow direction of the grid whose flow direction has been determined among the eight grids adjacent to itself, and according to the elevation of itself and the maximum elevation value on the optimal confluence path, it is judged whether the grid flow direction of the neighbor grid can be pointed to itself to reduce the maximum elevation value on the optimal confluence path of the neighbor grid. If it can be reduced, the grid flow direction of the neighbor grid needs to be pointed to itself, and the grid flow direction is revalued, so that each grid is assigned a correct grid flow direction.

[0081] It should be noted that the end of a computing process task is not equivalent to the node size balanced binary search tree being empty and no new message being sent or received. Since each computing process only communicates with neighboring computing processes, there can be a chain reaction of reassigning the flow direction of some grids after an external non-neighbor computing process updates the optimal confluence path, thereby adding new tasks to the temporarily completed computing process. Therefore, the main process needs to aggregate the work progress of all computing processes and feed back to each computing process in the waiting stage in real time. The end instruction can be sent out only when all computing processes are in the waiting stage at the same time and there is no new information sent or received globally.

[0082] Figure 3 is a schematic diagram of non-blocking communication and flow direction reassignment in one embodiment of the present application. As shown in Figure 3, Figure 3 shows the non-blocking communication and grid flow direction reassignment operation in the grid flow direction judgment process. In Figure 3(a), since the No. 1 computing process has completed the flow direction judgment of the D6 grid, and the D6 grid is the edge buffer grid of the No. 3 computing process, the No. 1 computing process needs to send the maximum elevation value on the optimal confluence path of the D6 grid to the No. 3 computing process. Due to the characteristics of non-blocking communication, the No. 1 computing process sending the message will return to restart the calculation of the grid flow direction immediately after the message is sent to the MPI message space, and will not wait for the No. 3 computing process to receive the message. In Figure 3(b), the No. 3 computing process does not start receiving the D6 grid information from the No. 1 computing process until several rounds of calculation. At this time, the No. 1 and No. 3 computing processes have completed the flow direction judgment of the E6 grid, D7, and D8 grid, respectively, compared to Figure 3(a). After the No. 3 computing process receives the D6 grid information, the D6 grid will be updated as a potential outlet in the No. 3 computing process to reassign the flow direction of all nearby grids. After the grid flow direction reassignment operation, the D7, D8, D9, C9, and B9 grids in the No. 3 process are reassigned with the grid flow direction, and each grid is assigned with the correct grid flow direction.

[0083] Optionally, in one embodiment of the present application, the multiple computing processes are divided into a main process and multiple computing processes, wherein the main process completes the pre-task of the DEM in sequence at the beginning of the program and before the start of parallel computing, and transmits the task to the corresponding computing process through the MPI interface in sequence, including the range of the block DEM and the boundary grid in the block result and the known river grid. Each computing process performs the corresponding calculation process after receiving the task assigned by the main process.

[0084] Based on the related description of other embodiments, it can be understood that the parallel algorithm for extracting large-scale high-resolution river network under the distributed memory architecture mainly adopts a parallel algorithm structure including but not limited to 1 main process and several computing processes. When performing parallel computing of the grid flow direction, all processes can be divided into a main process and computing processes. Specifically as follows:

[0085] All processes are divided into a master process and computing processes. The master process is responsible for pre-work, progress planning, result collection, etc., such as task allocation before parallel computing starts and result collection after parallel computing ends. The computing processes are responsible for computing the flow direction of the DEM blocks allocated to them.

[0086] For example, the master process can complete the pre-reading of the DEM, blocking, and other pre-work in sequence before the start of parallel computing, and then transmit the blocked DEM, the range of the boundary grid, and other information such as the known river grid to each computing process through the MPI interface.

[0087] After receiving the task allocated by the master process, each computing process performs the flow direction judgment and other calculation processes according to the steps of river network extraction.

[0088] The embodiment itself can adopt a parallel algorithm structure including one master process and several computing processes, and each computing process is allocated a DEM block that does not overlap with other DEM blocks except for the edge grid. Each computing process performs flow direction judgment and other river network extraction calculations on all land grids in the allocated DEM block. However, since the D8 method is used to determine the flow direction, the flow direction of each grid points to one of the eight surrounding grids, except for the outlet, which causes the edge grid of the DEM block to point to a grid outside the current block. Therefore, when determining the flow direction of the grid in the DEM block, the edge buffer grid information around the DEM block needs to be considered.

[0089] Figure 4 is a schematic diagram of DEM blocking according to an embodiment of the present application. As shown in Figure 4, it shows how the DEM data is divided and allocated in the calculation domain. Figure 4(a) shows that a 12*12 DEM data is equally divided into four 6*6 DEM grid data calculation domains, and each computing process is responsible for calculating the flow direction of the remaining land grids in the calculation domain. Figure 4(b) shows the DEM block received by each computing process from the master process and the flow direction information of the grid in the block obtained through known river preprocessing. Due to the need for subsequent flow direction judgment, the computing process still needs to be responsible for the edge buffer grid information (gray grid in the figure) around the DEM block, i.e., the master process needs to send a 7*7 DEM data block to each computing process. Figure 4(c) shows how the entire Yellow River basin is divided into 11 DEM calculation domains of the same size and allocated to 11 computing processes.

[0090] Optionally, in one embodiment of the present application, after the parallel computation ends, each computing process sends a transmission request message to the master process, and transmits the computation result in the DEM block allocated to it to the master process after receiving the confirmation transmission message sent by the master process. The master process sends the confirmation transmission message to only one of the computing processes sending the transmission request message each time after receiving the transmission request message, and sends the confirmation transmission message to another process after receiving all the computation results of the process.

[0091] In some embodiments, after the parallel computation ends, each computing process can send a transmission request message to the master process, and transmit the computation result in the DEM block allocated to it to the master process after receiving the confirmation transmission message sent by the master process.

[0092] The master process sends the confirmation transmission message to only one of the computing processes sending the transmission request message each time after receiving the transmission request message, and sends the confirmation transmission message to another process after receiving all the computation results of the process, so as to ensure that only one process in the MPI communication network transmits the computation result message, and avoid the lack of space in the MPI communication network.

[0093] Finally, the master process performs vectorization output of the river network after collecting all the computation results transmitted by the computing processes, and realizes parallel extraction of a large-scale river network with high resolution.

[0094] Optionally, in one embodiment of the present application, during the computation of the DEM data block responsible for by each computing process, if the edge buffer grid of the DEM block responsible for by the computing process is involved, the flow direction information of the edge buffer grid is collected as a message to be transmitted, and the number of the adjacent computing process to which the information needs to be sent is recorded. When the number of messages to be sent to the adjacent computing process exceeds a preset number, all the information is transmitted to the adjacent computing process.

[0095] During the computation of the DEM data block responsible for by each computing process, if the edge buffer grid of the DEM block responsible for by the computing process is involved, the flow direction information of the edge buffer grid is temporarily collected as a message to be transmitted, and the number of the adjacent computing process to which the information needs to be sent is recorded. When the number of messages to be sent to the adjacent computing process exceeds a preset number, all the information is transmitted to the adjacent computing process.

[0096] Since the algorithm uses non-blocking communication to greatly improve efficiency, it also brings the problem of message lag. That is, there is a possibility that the grid confluence direction in the DEM block is calculated using only the block information, and the optimal confluence path exists in the DEM block responsible for other computing processes, so it is pointed to the wrong grid. Therefore, after obtaining the edge grid information transmitted by other computing processes, the grid flow direction needs to be revalued to compensate for the message lag problem. That is, in the flow direction judgment calculation caused by the update of the edge grid information, when deleting the grid from the node size balanced binary search tree, the eight adjacent grids of the grid to be deleted need to be checked. According to the elevation of the checked grid and the maximum elevation value on the existing confluence path of the checked grid, it is judged whether the flow direction of the checked grid can be directed to the grid to be deleted to reduce the maximum elevation value on the confluence path. If the maximum elevation value can be reduced, the flow direction of the checked grid needs to be directed to the grid to be deleted, and the grid flow direction is revalued, so that each grid that needs to be updated is assigned a correct grid flow direction, and the algorithm has global awareness of the river crossing different computing processes of the DEM block.

[0097] The application will be described in detail below with one specific embodiment.

[0098] Figure 5 is a flow chart of a parallel method for extracting a river network in a distributed memory architecture according to an embodiment of the application. As shown in Figure 5:

[0099] Step S501, in the case of known river vector or grid data, the flow direction judgment preprocessing is forced for the grid corresponding to the known data.

[0100] Step S502, the DEM data to be processed is blocked according to the number of available computer processes and the actual size and shape of the DEM data.

[0101] Step S503, the DEM data block (including the edge buffer grid) and the known river information responsible for each computing process are transmitted.

[0102] Step S504, each computing process performs grid flow direction judgment on the DEM data block responsible for itself.

[0103] Step S505, in the process of grid flow direction judgment, the flow direction information of the edge buffer grid is transmitted between adjacent grids as needed using a non-blocking communication method.

[0104] Step S506, after the computing process is completed, the grid flow direction and the calculation results of the subsequent steps are summarized to the main process and saved in sequence, realizing parallel extraction of high-resolution large-scale river networks.

[0105] The parallel method for extracting a river network under a distributed memory architecture provided in the embodiments of the present application can apply parallel computing in the process of grid flow direction judgment and other river network extraction calculation based on digital elevation model data under a distributed memory architecture, so as to realize parallel extraction of large-scale high-resolution river networks, thereby realizing improvement of operation efficiency under guarantee of original river network precision, improvement of the size of a drainage basin and / or DEM resolution that can be processed by the algorithm, and reduction of the demand for single machine memory capacity, so as to realize one-time structured extraction of river network of hundreds of billions to trillions of grids. In this way, the problems in the related art that the river network extraction algorithm cannot meet the required operation time and memory space when facing the increasing DEM data resolution with the development of spatial information technology, how to perform structural reconstruction and functional upgrade on the serial program, and one-time structured extraction of river network of hundreds of billions to trillions of grids are solved.

[0106] Secondly, the parallel device for extracting a river network under a distributed memory architecture provided in the embodiments of the present application is described with reference to the accompanying drawings.

[0107] FIG. 6 is a structural schematic diagram of the parallel device for extracting a river network under a distributed memory architecture according to the embodiments of the present application.

[0108] As shown in FIG. 6, the parallel device for extracting a river network under a distributed memory architecture 10 includes a processing module 100, a block dividing module 200, and an extraction module 300.

[0109] The processing module 100 is configured to perform flow direction judgment preprocessing on the grids corresponding to known river vector or grid data under a distributed memory architecture to obtain a preprocessing result.

[0110] The block dividing module 200 is configured to divide the to-be-processed DEM data according to the actual size and shape of the digital elevation model (DEM) data to obtain a block dividing result.

[0111] The extraction module 300 is configured to determine the corresponding grid flow direction based on the preprocessing result and the block dividing result in parallel to obtain an extraction result of the river network, wherein the flow direction information of the edge buffer grid between the neighbor DEM data blocks in the to-be-processed DEM data is transmitted in a non-blocking communication mode according to actual requirements.

[0112] Optionally, in an embodiment of the present application, the processing module 100 includes a traversal unit, a searching unit, and a processing unit.

[0113] The traversal unit is configured to traverse all known river grids after rasterization processing, find out the grids located at the DEM boundary, and add them to a node size balanced binary search tree; the searching unit is configured to select the known river grid with the highest priority in the node size balanced binary search tree and delete it from the tree;

[0114] The processing unit is configured to point the flow direction of the grid that has never joined the node size balanced binary search tree from the eight neighbors of the highest priority known river grid to the deleted grid, and add the corresponding known river grid into the tree until all the known river grids are added into the node size balanced binary search tree and deleted, so as to obtain the grid flow direction of all the known river grids and the directly adjacent grids.

[0115] Optionally, in an embodiment of the present application, the plurality of computing processes are divided into a main process and a plurality of computing processes, wherein the main process sequentially completes the pre-processing tasks of the DEM at the beginning of the program and before the start of parallel computing, and transmits the divided DEM and the range of the boundary grid and the known river grid in the divided result to the corresponding computing processes in sequence through the MPI interface; each computing process performs the corresponding computing process after receiving the task allocated by the main process.

[0116] Optionally, in an embodiment of the present application, after the parallel computing is completed, each computing process sends a transmission request message to the main process, so as to transmit the computing result in the DEM block allocated by the main process to the main process after receiving the confirmation transmission message sent by the main process, wherein the main process sends the confirmation transmission message to only one process in the computing processes sending the transmission request message each time after receiving the transmission request message, and sends the confirmation transmission message to another process after receiving all the computing results of the process.

[0117] Optionally, in an embodiment of the present application, in the process of computing the DEM data block responsible by each computing process, if the edge buffer grid of the DEM block responsible by itself is involved, the flow direction information thereof is collected as the message needing to be transmitted, and the number of the adjacent computing process needing to be sent is recorded, so as to transmit all the information to the adjacent computing process after the collected messages needing to be sent to the adjacent computing process exceed the preset number.

[0118] It should be noted that the foregoing explanation and description of the parallel method for extracting river network under the distributed memory architecture also applies to the parallel device for extracting river network under the distributed memory architecture of the embodiment, which will not be described here again.

[0119] The parallel device for extracting a river network under a distributed memory architecture provided by the embodiment of the present application can apply parallel computing in the process of grid flow judgment and other river network extraction calculation based on digital elevation model data under the distributed memory architecture, realize parallel extraction of large-scale high-resolution river networks, thereby realize the improvement of operation efficiency under the guarantee of the original river network precision, improve the basin area scale and / or DEM resolution that the algorithm can process, and reduce the demand for single machine memory capacity, thereby realizing one-time completion of the structured extraction of hundreds of billions to trillions of grid digital river networks. Thus, the problems such as how to perform structural reconstruction and functional upgrade on the serial program so as to realize one-time completion of the structured extraction of hundreds of billions to trillions of grid digital river networks are solved.

[0120] FIG. 7 is a structural schematic diagram of an electronic device provided by the embodiment of the present application. The electronic device can include:

[0121] The memory 701, the processor 702, and the computer program stored in the memory 701 and executable on the processor 702.

[0122] The processor 702 implements the parallel method for extracting a river network under a distributed memory architecture provided by the above-mentioned embodiments when executing the program.

[0123] Further, the electronic device further includes:

[0124] The communication interface 703 is used for communication between the memory 701 and the processor 702.

[0125] The memory 701 is used to store the computer program executable on the processor 702.

[0126] The memory 701 can include a high-speed RAM memory, and can also include a non-volatile memory such as at least one disk memory.

[0127] If the memory 701, the processor 702 and the communication interface 703 are implemented independently, the communication interface 703, the memory 701 and the processor 702 can be connected with each other through a bus and complete communication between each other. The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For convenience of representation, only one thick line is used in FIG. 7, but it does not mean that there is only one bus or only one type of bus.

[0128] Optionally, in a specific implementation, if the memory 701, the processor 702 and the communication interface 703 are integrated on a chip, the memory 701, the processor 702 and the communication interface 703 can complete communication between each other through an internal interface.

[0129] The processor 702 can be a Central Processing Unit (CPU), or an Application Specific Integrated Circuit (ASIC), or one or more integrated circuits configured to implement one or more embodiments of the present application.

[0130] The embodiment of the present application further provides a computer readable storage medium, which stores a computer program, and the program is executed by a processor to implement the parallel method for extracting a river network under a distributed memory architecture as described above.

[0131] The embodiment of the present application further provides a computer program product, which includes a computer program, and the computer program can run computer instructions, and the computer instructions are executed by a processor to implement the parallel method for extracting a river network under a distributed memory architecture provided by the embodiment of the present application.

[0132] In the description of the application, reference to "one embodiment", "some embodiments", "an example", "a specific example", or "some examples" means that a particular feature, structure, material, or characteristic being described is included in at least one embodiment or example of the application. The appearances of the phrase in various places in the specification are not necessarily all referring to the same embodiment or example. Furthermore, the described specific features, structures, materials, or characteristics can be combined in any suitable manner in one or more embodiments or examples. In addition, the usage of "N" means at least two, for example, two, three or the like, unless explicitly stated otherwise.

[0133] Furthermore, the terms "first", "second", or the like, are used merely as a designation of certain elements or features of the application, and do not imply or connote relative importance or a specific order of precedence. Thus, features defined with "first", "second", etc. can include at least one of the features, either explicitly or implicitly.

[0134] Any process or method descriptions or blocks in flow charts or otherwise described herein represent embodiments which can be managed as one or more modules, segments, or portions of code which include one or more executable instructions for implementing specific logic functions or steps, and alternate implementations are possible. In some embodiments, the processes and methods described can be executably encoded on a machine- readable medium in a data signal embodied in an electromagnetic signal, a wireless signal, or a propagated signal.

[0135] The logic and / or steps represented in the flowcharts and / or described herein, for example, can be considered as a sequence of executable instructions stored in a computer readable medium, which can be executed by an instruction execution system, apparatus or device, such as a computer-based system, a processor-based system, or other system that can fetch the instructions from the instruction execution system, apparatus or device and execute the instructions, or a combination of the above. For the purposes of this specification, a "computer readable medium" can be any apparatus that can contain, store, communicate, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus or device. The computer readable medium can be a computer readable storage medium or a computer readable signal medium. The computer readable storage medium can include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a propagation medium. The computer readable signal medium can include, but is not limited to, a computer readable medium that facilitates transfer of the program from one place to another. A specific example of a computer readable medium is a non-transitory computer-readable storage medium. A specific example of a computer readable signal medium is a source or destination of the computer readable medium. Another specific example of a computer readable signal medium is a computer readable signal travelling through space. Thus, a computer readable medium can take many forms of hardware to carry out the program for use by or in connection with the instruction execution system, apparatus or device.

[0136] It should be understood that aspects of the application can be implemented in hardware, software, firmware or combinations thereof. In the above embodiments, the N steps or methods can be implemented in software or firmware stored in a memory and executed by a suitable instruction execution system. If implemented in hardware and in another embodiment, the hardware can be implemented using any or a combination of the following technologies, which are each well known in the art: a discrete logic circuit(s) having logic gates for implementing logic functions upon an application of data signals, an application specific integrated circuit having appropriate combinational logic gates, a programmable gate array(s) (PGA), a field programmable gate array (FPGA), etc.

[0137] Those of skill in the art would understand that the steps of the methods carried out above can be carried out wholly or partly by a program instructing relevant hardware, and the program can be stored in a computer readable storage medium, and when executed, includes one or a combination of the steps of the method embodiments.

[0138] In addition, each of the functional units in the various embodiments of the present application can be integrated in one processing module, or each of the units can be physically present separately, or two or more units can be integrated in one module. The integrated module can be realized in the form of hardware or in the form of a software functional module. When the integrated module is realized in the form of a software functional module and sold or used as an independent product, it can also be stored in a computer readable storage medium.

[0139] The storage medium mentioned above can be a read-only memory, a magnetic disk or an optical disk, etc. Although the embodiments of the present application have been shown and described above, it should be understood that the above embodiments are exemplary and should not be construed as limiting the present application, and those skilled in the art can make changes, modifications, replacements and variations to the above embodiments within the scope of the present application.

Claims

1. A parallel method for extracting river networks under a distributed memory architecture, characterized in that, The method comprises the following steps: In a distributed memory architecture, the flow direction of the grid corresponding to the known river vector or grid data is determined for preprocessing, and a preprocessing result is obtained; According to the actual size and shape of the digital elevation model (DEM) data, the DEM data to be processed is divided into blocks, and a blocking result is obtained; Based on multiple computing processes, the corresponding grid flow direction is determined according to the preprocessing result and the blocking result in parallel to obtain the extraction result of the river network, wherein the flow direction information of the edge buffer grid between the neighbor DEM data blocks in the DEM data to be processed is transmitted in a non-blocking communication mode according to actual requirements.

2. The parallel method for extracting river networks under distributed memory architecture according to claim 1, wherein, The preprocessing of the grid corresponding to the known river vector or grid data to obtain the preprocessing result comprises: Traverse all the known river grids after rasterization processing, find the grids located at the DEM boundary and add them to the node size balanced binary search tree; Select the highest priority known river grid in the node size balanced binary search tree and delete it from the tree; Point the flow direction of the grid that has never been added to the node size balanced binary search tree among the eight neighbors of the highest priority known river grid to the deleted grid, and add the corresponding known river grid to the tree until all the known river grids are added to the node size balanced binary search tree and deleted, to obtain the grid flow direction of all the known river grids and the directly adjacent grids.

3. The parallel method for extracting river networks under distributed memory architecture according to claim 1, wherein, The multiple computing processes are divided into a main process and multiple computing processes, wherein the main process completes the pre-processing of the DEM in sequence at the beginning of the program and before the start of parallel computing, and transmits the tasks to the corresponding computing processes in sequence through the MPI interface; each computing process performs corresponding calculation process after receiving the task allocated by the main process.

4. The parallel method for extracting river networks under distributed memory architecture according to claim 3, wherein, After parallel computing is completed, each computing process sends a transmission request message to the main process, and transmits the calculation result in the DEM block allocated by the main process after receiving the confirmation transmission message sent by the main process, wherein the main process sends the confirmation transmission message to only one of the computing processes that sends the transmission request message each time, and sends the confirmation transmission message to another process after receiving all the calculation results of the process.

5. The parallel method of extracting river networks under distributed memory architecture according to claim 3 or 4, characterized in that, During the calculation of the DEM data block responsible for by each computing process, if the edge buffer grid of the DEM block is involved, the flow direction information of the edge buffer grid is collected as the message to be transmitted, and the number of the adjacent computing process to which the message needs to be sent is recorded, so that all the information is transmitted to the adjacent computing process after the number of messages to be sent to the adjacent computing process exceeds a preset number.

6. A parallel device for extracting a river network in a distributed memory architecture, comprising: a processing module configured to determine the flow direction of the grid corresponding to the known river vector or grid data for preprocessing in a distributed memory architecture, and obtain a preprocessing result; A block module is configured to block the DEM data to be processed according to the actual size and shape of the DEM data, and obtain a block result. An extraction module is configured to determine the corresponding grid flow direction based on the preprocessing result and the block result according to the multiple computing processes, and obtain an extraction result of the river network, wherein the edge buffer grid flow direction information between the neighbor DEM data blocks in the DEM data to be processed is transmitted in a non-blocking communication mode according to actual requirements.

7. The apparatus of claim 6, wherein, The processing module comprises: A traversal unit is configured to traverse all the known river grids after the rasterization processing, find out the grids located at the DEM boundary, and add the grids to a node size balanced binary search tree; A search unit is configured to select the known river grid with the highest priority in the node size balanced binary search tree and delete the grid from the tree; A processing unit is configured to point the flow direction of the grids that have never been added to the node size balanced binary search tree among the eight neighbors of the known river grid with the highest priority to the deleted grid, and add the corresponding known river grid to the tree, until all the known river grids are added to and deleted from the node size balanced binary search tree, so as to obtain the grid flow direction of all the known river grids and the directly adjacent grids.

8. An electronic device, comprising: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the parallel method for extracting the river network under the distributed memory architecture according to any one of claims 1-5. The program is executed by the processor to implement the parallel method for extracting the river network under the distributed memory architecture according to any one of claims 1-5.

9. A computer readable storage medium having stored thereon a computer program, characterized in that, The computer program is executed to implement the parallel method for extracting the river network under the distributed memory architecture according to any one of claims 1-5.

10. A computer program product comprising a computer program, characterized in that, ​

Citation Information

Patent Citations

  • Parallel method for large-area drainage basin extraction

    CN102915227A

  • Parallelization method of distributed hydrological simulation under cluster environment

    CN103092572A

  • Region scale soil erosion modeling-oriented terrain factor parallel computing method

    CN104392147A

  • Parallel analysis method for water area flow direction and cumulative convergence amount of CUDA architecture D8 algorithm

    CN114035966A