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

By performing parallel calculation of Hewang extraction under distributed memory architecture, using multiple computing processes and non-blocking communication, the running time and memory space problems of Hewang extraction algorithm under high-resolution DEM data are solved, and efficient 100 million yuan is achieved To trillion-level grid digital river network extraction.

CN118941596AActive Publication Date: 2024-11-12TSINGHUA UNIVERSITY
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
CN202411123429.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-15
Publication Date
2024-11-12
Estimated Expiration
2044-08-15

AI Technical Summary

Technical Problem

When facing high-resolution DEM data, existing river network extraction algorithms are difficult to meet the needs of running time and memory space, and cannot complete the structured extraction of raster digital river networks of hundreds of billions to trillions of rasters at one time.

Method used

Under the distributed memory architecture, through flow direction judgment preprocessing and blocking processing, multi-computing processes are used to parallel computing, and the flow direction information of edge buffer grids is transmitted using non-blocking communication methods to achieve parallel extraction of large-scale high-resolution river networks.

Benefits of technology

It improves computing efficiency, improves the basin area scale and DEM resolution that the algorithm can handle, reduces the demand for stand-alone memory capacity, and realizes structured extraction of raster digital river networks of hundreds of billions to trillions of rasters.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118941596A_ABST
    Figure CN118941596A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of data extraction, in particular to a parallel method and device for extracting a river network under a distributed memory architecture, and the method comprises the steps: carrying out the flow direction judgment preprocessing of a grid corresponding to a known river vector or grid data under the distributed memory architecture, and obtaining a preprocessing result; blocking the DEM data to be processed according to the actual scale and shape of the DEM data to obtain a blocking result; and on the basis of multiple calculation processes, determining a corresponding grid flow direction when the preprocessing result and the blocking result are parallel to obtain an extraction result of the river network, and transmitting flow direction information of an edge buffer grid between neighbor DEM data blocks in the DEM data to be processed by adopting a non-blocking communication mode according to actual requirements. The method can improve the operation efficiency under the condition of guaranteeing the original river network precision, improves the watershed area scale and DEM resolution which can be processed by the algorithm, reduces the single-machine memory capacity demand, and achieves the large-scale river network extraction.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data extraction technology, and in particular to a parallel method and device for extracting river networks under a distributed memory architecture. Background Art

[0002] In the related technologies, the mainstream river network extraction algorithm is basically to extract the river network from the digital elevation model (DEM) data. The extracted river network can include the basic geometric information of each section of the river and the source-confluence topological relationship between them. This information has been widely used in the fields of basin distributed rainfall runoff simulation, non-point source pollution simulation and geomorphic analysis. Therefore, extracting high-precision river networks provides the necessary conditions for improving the accuracy of basin rainfall runoff and environmental simulation and in-depth exploration of the internal structural laws of rivers, and has important scientific value.

[0003] However, the river network extraction algorithms in related technologies are unable to meet the required running time and memory space when faced with the ever-increasing resolution of DEM data as spatial information technology develops. How to restructure and upgrade the functions of serial programs to complete the structured extraction of digital river networks with hundreds of billions to trillions of grids in one go is an urgent problem to be solved. Summary of the invention

[0004] The present application provides a parallel method and device for extracting river networks under a distributed memory architecture to solve the problems that river network extraction algorithms in related technologies are difficult to meet the required running time and memory space when facing the DEM data resolution that is continuously improved with the development of spatial information technology, and how to restructure and upgrade the functions of serial programs to complete the structured extraction of digital river networks with hundreds of billions to trillions of grids at one time.

[0005] The first aspect of the present application provides a parallel method for extracting a river network under a distributed memory architecture, comprising the following steps: under the distributed memory architecture, preprocessing the grids corresponding to the known river vector or raster data for flow direction judgment to obtain a preprocessing result; dividing the DEM data to be processed into blocks according to the actual scale and shape of the digital elevation model DEM data to obtain a block result; based on multiple computing processes, determining the corresponding grid flow direction in parallel according to the preprocessing result and the block result to obtain a river network extraction result, wherein the flow direction information of the edge buffer grid is transmitted between neighboring DEM data blocks in the DEM data to be processed using a non-blocking communication method according to actual needs.

[0006] Optionally, in one embodiment of the present application, the flow direction determination preprocessing is performed on the rasters corresponding to the known river vector or raster data to obtain the preprocessing result, including: traversing all the known river rasters after rasterization processing, finding the rasters located at the DEM boundary and adding them to the node size balanced binary search tree; selecting the known river raster with the highest priority in the node size balanced binary search tree and deleting it from the tree; pointing the confluence direction of the rasters that have never been added to the node size balanced binary search tree among the 8 neighbors around the known river raster with the highest priority to the deleted raster, and adding the corresponding known river rasters to the tree, until all the known river rasters are added to the node size balanced binary search tree and deleted, so as to obtain the raster flow directions of all known river rasters and the rasters directly adjacent to them.

[0007] 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 DEM prerequisite tasks in sequence at the beginning of the program and before the start of parallel computing, and transmits the block DEM and boundary grid ranges and known river grids in the block results to the corresponding computing processes in sequence through the MPI interface; after receiving the tasks assigned by the main process, each computing process performs the corresponding calculation process.

[0008] Optionally, in one embodiment of the present application, after the parallel computing is completed, each computing process sends a transmission request message to the main process, so that after receiving the confirmation transmission message sent by the main process, the computing process transmits the computing results in the DEM block allocated to it to the main process, wherein, after receiving the transmission request message, the main process only sends the confirmation transmission message to one process in the computing process that sent the transmission request message each time, and sends the confirmation transmission message to another process after receiving all the computing results of the process.

[0009] Optionally, in one embodiment of the present application, during the calculation of the DEM data block for which each computing process is responsible, if the edge buffer grid of the DEM block for which it is responsible is involved, its flow direction information is collected as a message that needs to be transmitted, and the number of the adjacent computing process to be sent is recorded, so that after 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.

[0010] The second aspect of the present application provides a parallel device for extracting a river network under a distributed memory architecture, including: a processing module, which is used to perform flow direction judgment preprocessing on the grids corresponding to the known river vector or raster data under the distributed memory architecture to obtain a preprocessing result; a blocking module, which is used to block the DEM data to be processed according to the actual scale and shape of the digital elevation model DEM data to obtain a blocking result; an extraction module, which is used to determine the corresponding grid flow direction based on multiple computing processes in parallel according to the preprocessing result and the blocking result to obtain the river network extraction result, wherein the flow direction information of the edge buffer grid is transmitted between neighboring DEM data blocks in the DEM data to be processed using a non-blocking communication method according to actual needs.

[0011] Optionally, in one embodiment of the present application, the processing module includes: a traversal unit, used to traverse all known river rasters after rasterization processing, find the rasters located at the DEM boundary and add them to the node size balanced binary search tree; a search unit, used to select the known river raster with the highest priority in the node size balanced binary search tree and delete it from the tree; a processing unit, used to point the confluence direction of the rasters among the 8 neighbors around the known river raster with the highest priority that have never been added to the node size balanced binary search tree to the deleted raster, and add the corresponding known river rasters to the tree until all known river rasters are added to the node size balanced binary search tree and deleted, so as to obtain the raster flow directions of all known river rasters and the rasters directly adjacent to them.

[0012] 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 DEM prerequisite tasks in sequence at the beginning of the program and before the start of parallel computing, and transmits the block DEM and boundary grid ranges and known river grids in the block results to the corresponding computing processes in sequence through the MPI interface; after receiving the tasks assigned by the main process, each computing process performs the corresponding calculation process.

[0013] Optionally, in one embodiment of the present application, after the parallel computing is completed, each computing process sends a transmission request message to the main process, so that after receiving the confirmation transmission message sent by the main process, the computing process transmits the computing results in the DEM block allocated to it to the main process, wherein, after receiving the transmission request message, the main process only sends the confirmation transmission message to one process in the computing process that sent the transmission request message each time, and sends the confirmation transmission message to another process after receiving all the computing results of the process.

[0014] Optionally, in one embodiment of the present application, during the calculation of the DEM data block for which each computing process is responsible, if the edge buffer grid of the DEM block for which it is responsible is involved, its flow direction information is collected as a message that needs to be transmitted, and the number of the adjacent computing process to be sent is recorded, so that after 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.

[0015] The third aspect 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 networks under a distributed memory architecture as described in the above embodiment.

[0016] The fourth aspect of the present application provides a computer-readable storage medium, which stores a computer program. When the program is executed by a processor, it implements the above-mentioned parallel method for extracting river networks under a distributed memory architecture.

[0017] The fifth aspect of the present application provides a computer program product, including a computer program, which, when executed, is used to implement the above-mentioned parallel method for extracting river networks under a distributed memory architecture.

[0018] The embodiment of the present application can apply parallel computing to the river network extraction calculation process such as raster flow direction judgment based on digital elevation model data under a distributed memory architecture to achieve parallel extraction of large-scale high-resolution river networks, thereby achieving improved computing efficiency while ensuring the original river network accuracy, increasing the scale of the basin area that the algorithm can handle and / or the DEM resolution, and reducing the demand for single-machine memory capacity, thereby achieving one-time completion of the structured extraction of raster digital river networks of hundreds of billions to trillions. As a result, the problem that the river network extraction algorithm in the related art is difficult to meet the required running time and memory space when facing the DEM data resolution that is constantly improving with the development of spatial information technology, and how to restructure and upgrade the serial program to complete the structured extraction of raster digital river networks of hundreds of billions to trillions at one time is solved.

[0019] Additional aspects and advantages of the present application will be given in part in the description below, and in part will become apparent from the description below, or will be learned through the practice of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] The above and / or additional aspects and advantages of the present application will become apparent and easily understood from the following description of the embodiments in conjunction with the accompanying drawings, in which:

[0021] Figure 1A flowchart of a parallel method for extracting a river network in a distributed memory architecture provided according to an embodiment of the present application;

[0022] Figure 2 A known river network burning preprocessing diagram of an embodiment of the present application;

[0023] Figure 3 A schematic diagram of non-blocking communication and flow direction reassignment according to an embodiment of the present application;

[0024] Figure 4 A schematic diagram of DEM blocks according to an embodiment of the present application;

[0025] Figure 5 A flowchart of a parallel method for extracting a river network in a distributed memory architecture according to an embodiment of the present application;

[0026] Figure 6 It is a structural schematic diagram of a parallel device for extracting a river network under a distributed memory architecture according to an embodiment of the present application;

[0027] Figure 7 Schematic diagram of the structure of an electronic device according to an embodiment of the present application.

[0028] Reference numerals:

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

[0030] Embodiments of the present application are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present application, and should not be construed as limiting the present application.

[0031] The following describes the parallel method and device for extracting river networks under a distributed memory architecture according to an embodiment of the present application with reference to the accompanying drawings. In view of the fact that the river network extraction algorithm in the related art mentioned in the above background technology is difficult to meet the required running time and memory space when facing the DEM data resolution that is constantly improving with the development of spatial information technology, how to restructure and upgrade the function of the serial program, so as to complete the structured extraction of hundreds of billions to trillions of raster digital river networks at one time, the present application provides a parallel method for extracting river networks under a distributed memory architecture, in which parallel computing can be applied to river network extraction calculation processes such as raster flow direction judgment based on digital elevation model data under a distributed memory architecture, so as to achieve parallel extraction of large-scale high-resolution river networks, thereby achieving the improvement of computing efficiency while ensuring the original river network accuracy, increasing the scale of the basin area that can be processed by the algorithm and / or the DEM resolution, and reducing the demand for single-machine memory capacity, so as to achieve the structured extraction of hundreds of billions to trillions of raster digital river networks at one time. As a result, the problems of river network extraction algorithms in related technologies being unable to meet the required running time and memory space when faced with the ever-increasing resolution of DEM data with the development of spatial information technology, and how to restructure and upgrade the functions of serial programs to complete the structured extraction of digital river networks with hundreds of billions to trillions of grids in one go were solved.

[0032] Before explaining the parallel method for extracting river networks under a distributed memory architecture provided in an embodiment of the present application, the system technology involved in the embodiment of the present application is first explained.

[0033] The river network is a hydrological system composed of all rivers in a basin, including tributaries and main streams, which are intertwined and connected. Extracting high-precision river networks is the most critical foundation for building digital basins. The Outline of the National Water Network Construction Plan proposes to accelerate the construction of the national water network, build a modern high-quality water conservancy infrastructure network, and coordinate the major strategic deployment of solving water resources, water ecology, water environment, and water disasters. The national water network is a comprehensive system based on natural rivers and lakes, with diversion and drainage projects as channels, storage projects as nodes, and intelligent regulation as a means, integrating functions such as water resources optimization allocation, basin flood control and disaster reduction, and water ecosystem protection. The river network extracted based on terrain data is a digital description of the natural water network in the national water network, supplemented by meteorological, geological, ecological, and social information. It can provide corresponding scientific basis for relevant departments to simulate and predict hydrological and flood processes, plan water resources storage projects, and reasonably dispatch water resources, which has important practical significance.

[0034] Furthermore, the embodiments of the present application mainly but not limited to adopt the MPI (Message Passing Interface) parallel computing standard and its development and operation environment, and can be operated in a computer and network hardware system with distributed memory from a single machine to multiple machines. The algorithm runs under the distributed memory architecture of this environment, which can increase the scale of the basin area and / or DEM resolution that the algorithm can handle, and can reduce the demand for single-machine memory capacity. In general, the program runs concurrently in multiple computer systems with a network connection, and messages are passed between different processes of a certain computer and between different processes of different computers through the MPI interface, so as to process problems concurrently, improve the computational efficiency of large-scale high-resolution river network extraction, and coordinate the use of memory space on different computers; the program can also run in a single computer system.

[0035] Specifically, Figure 1 A flowchart of a parallel method for extracting river networks under a distributed memory architecture provided in an embodiment of the present application.

[0036] like Figure 1 As shown, the parallel method for extracting river networks under a distributed memory architecture includes the following steps:

[0037] In step S101, under the distributed memory architecture, flow direction determination preprocessing is performed on the grids corresponding to the known river vector or raster data to obtain a preprocessing result.

[0038] It is understood by those skilled in the art that the Distributed Memory Architecture here refers to a computing system architecture in which memory resources are distributed across multiple independent processors or nodes, each node has its own independent memory space, and data can be exchanged and shared through a network or other communication mechanism. This architecture has a wide range of applications in parallel computing, high performance computing (HPC), and big data processing.

[0039] In some embodiments, in the parallel method of extracting the river network, based on the river vector or raster data that has been known or obtained, it is possible to force the grids corresponding to these known data to be preprocessed for flow direction judgment, and then perform subsequent processing based on the known river vector or raster data that has been preprocessed.

[0040] River vector and raster data are commonly used data types in geographic information systems, which represent the spatial position and attribute information of rivers respectively. Among them, river vector data is data that uses vector graphic elements such as points, lines, and surfaces to represent the spatial position and shape of rivers. It contains attribute information such as the starting point, end point, length, width, flow direction, and water depth of the river, and can clearly express the boundary and direction of the river. River raster data is data that divides the spatial information of the river according to a certain grid size and represents the attribute value of each grid (such as water depth, flow velocity, etc.) in digital form. It usually contains physical parameters such as gridded water depth, flow velocity, and flow direction of the river, which is easy to perform spatial analysis and processing.

[0041] The process is further described below.

[0042] Optionally, in one embodiment of the present application, flow direction determination preprocessing is performed on the rasters corresponding to the known river vector or raster data to obtain the preprocessing results, including: traversing all known river rasters after rasterization processing, finding the rasters located at the DEM boundary and adding them to the node size balanced binary search tree; selecting the known river raster with the highest priority in the node size balanced binary search tree and deleting it from the tree; pointing the confluence direction of the rasters that have never been added to the node size balanced binary search tree among the 8 neighbors around the known river raster with the highest priority to the deleted raster, and adding the corresponding known river rasters to the tree, until all known river rasters are added to the node size balanced binary search tree and deleted, so as to obtain the raster flow directions of all known river rasters and the rasters directly adjacent to them.

[0043] Based on the relevant descriptions of other embodiments, it can be understood that the present application can perform flow direction judgment preprocessing on the grids corresponding to the known river vectors or raster data, so as to perform subsequent processing using the preprocessed known river vectors or raster data.

[0044] In some embodiments, in the case of known river vector or raster data, the present application can divide the raster flow direction judgment process of the known river burning algorithm into two independent stages. The first stage determines the raster flow direction for the known river and the raster directly adjacent to it, and the second stage determines the raster flow direction for all other land raster. The embodiment of the present application can perform flow direction judgment preprocessing on the raster that is regarded as corresponding to the known data in the first stage. Specifically, the preprocessing process can be expressed as follows:

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

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

[0047] (3) Confluence path expansion: The confluence directions of the eight neighboring grids that have never been added to the node-size-balanced binary search tree of the grid just deleted in (2) are directed to the grid just deleted, and only the known river grids are added to the tree to ensure that there are only known river grids in the node-size-balanced binary search tree, and the grid flow directions of all grids directly adjacent to the known rivers are determined.

[0048] (4) Loop processing: Repeat steps (2) and (3) in sequence until all known river rasters are added to the node-size-balanced binary search tree and deleted. At this point, the grid flow directions of all known river rasters in the DEM and the rasters directly adjacent to them are obtained.

[0049] For example, Figure 2 This is a known river network burning preprocessing diagram of an embodiment of the present application. Figure 2 As shown in the figure, it shows the specific process of the known river forcing the flow direction of the nearby grids in the first stage. Figure 2 (a) indicates the start of the first stage of initialization. Currently, only the D1 known river outlet grid is added to the node size balanced binary search tree; Figure 2 (b) indicates that D1 becomes the current priority grid in the first stage, and the confluence path expansion starts from D1. The known river grids of C2, D2, and E2 are determined to have flow directions and added to the node size balanced binary search tree. The land grids of C1 and E1 are determined to have flow directions; Figure 2 (c) indicates that after several rounds of operations in the first stage, G7 becomes the new priority grid in the first stage, and the confluence path expansion starts from G7. The known river grid of G8 is determined to have a flow direction and added to the node size balanced binary search tree. The land grids of F8 and H8 are determined to have a flow direction. Figure 2 (d) indicates that the first stage is officially over, the grid flow directions of all known rivers and directly adjacent grids are determined, and the preprocessing of the forced grid flow directions of known rivers is completed.

[0050] The embodiment of the present application can modify the priority standard in the process of preprocessing the flow direction judgment using known river data. That is, the priority standard of the grid leaving the node size balanced binary search tree one by one is modified in the known river burning algorithm in the embodiment of the present application. For example, in the related depression filling and excavation algorithm based on minimum cost search proposed by L. Wang and H. Liu in 2007, the elevation value is the only criterion for priority. In the known river burning algorithm in the embodiment of the present application, a hierarchical priority metric is adopted, and the known river number and the known river mark value are added, and the river mark value is used as the most important criterion in this priority metric, while the elevation value is regarded as a secondary factor.

[0051] Three situations may occur under the action of the known river burning algorithm in the embodiment of the present application: First, the known river raster is always given a higher priority than the land raster. Second, when comparing two land pixels, elevation is still the only criterion, and the one with the lower elevation is given a higher priority. In some special cases, when the elevations of two pixels are equal, the raster that is inserted earlier into the node size balanced binary search tree will be given a higher priority. Third, for the comparison between two known river rasters, the raster with a smaller known river number value is given a higher priority, and the elevation criterion is only enabled when the known river numbers of the two rasters are the same.

[0052] This allows the known river burning algorithm to implement flow direction enforcement without specifying an elevation offset. Since known river grids are "flooded" first in the grid flow determination process, known river grids can force neighboring grids to flow to them. Additionally, the hierarchical priority metric can ensure that lower-numbered known rivers are "flooded" before higher-numbered known rivers, and that land grids are more likely to flow into the path of lower-numbered known rivers.

[0053] Furthermore, the embodiment of the present application also expands and improves the confluence path. It is known that the river burning algorithm adopts additional rules for the order of entering the node size balanced binary search tree, such as Figure 2 As shown. The embodiment of the present application can determine whether the surrounding neighbor grids enter the node size balanced binary search tree by checking whether the grid point of the pop-up node size balanced binary search tree is a known river grid and whether it is the source of a known river. If the neighbor grid is a grid that is not constrained by a known river or a known river source grid, it can be added to the node size balanced binary search tree as long as the grid has not been flooded. If the neighbor grid is a non-source grid constrained by a known river, it can only be added to the node size balanced binary search tree if it has the same known river number as the current pop-up grid. At the same time, the flow direction of any grid is not allowed to completely pass through two known river grids with the same number or two grids at the same internal flow area boundary to ensure that the internal grid of the internal flow area cannot pass through the internal flow area boundary and flow out of the internal flow area range and the river that crosses the known river due to the DEM elevation.

[0054] Furthermore, the embodiments of the present application can also improve the depression processing. 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 priorities. At the same time, the flood simulation will first take the steepest descent path to reach the minimum elevation, and then gradually flood the depression by moving along the least steep uphill. Therefore, the initial DEM situation can be well preserved and fully used for priority determination and other subsequent calculations, such as grid flow direction determination.

[0055] In addition, the embodiments of the present application can also enhance the hydrological flow direction. After the known river burning algorithm simulates the inward flood under the guidance of the algorithm that improves the priority criteria, confluence path and depression processing, a relatively accurate flow direction of all grids and a sorted grid sequence are obtained. However, the curve of each known river is not completely preserved. In order to solve the problem of river short-circuiting, the algorithm in the embodiment of the present application adopts the principles of "most reasonable hydrology" and "minimum bifurcation", so that the grid flow direction of each known river should be towards the most downstream neighbor, as close as possible in hydrology, and at the same time, the gridded mainstream path on a known river is allowed to contain as many grids as possible to reduce tributaries in the flow path.

[0056] Step S102, dividing the DEM data to be processed into blocks according to the actual scale and shape of the digital elevation model DEM data to obtain a block result.

[0057] It is understood that a digital elevation model (DEM) is a geographic data model that uses limited terrain elevation data to achieve digital simulation of ground terrain. DEM is the elevation information of the earth's surface recorded in digital form. It is a physical ground model that can reflect local terrain features with a certain resolution. DEM data is usually presented in the form of a grid, and each grid cell contains a height value in meters to describe the ground elevation information.

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

[0059] First, the top and bottom positions of each column in the DEM are preprocessed, and the size of the DEM sub-matrix is ​​used as the answer for binary search. The column range in the DEM is calculated for each column of the DEM sub-matrix according to the size. The top and bottom positions in the column range are calculated by preprocessing the top and bottom positions of each column, thereby calculating the number of DEM sub-matrices required for this column range. Similarly, the number of matrices required to fill the entire DEM grid with the current DEM sub-matrix size is calculated, and the result is compared with the input number of available computer processes, and finally the minimum value of the DEM sub-matrix size within the process number range is obtained.

[0060] It should be noted that before the parallel calculation of grid flow direction begins, it is not enough to only allocate the elevation information of a DEM submatrix to each calculation process. In addition to the elevation information of each grid, the calculation process also needs to know whether each grid in the DEM submatrix it is responsible for needs to be added to the node size balanced binary search tree during the parallel calculation initialization. The grid nodes that need to be added to the tree in advance are the boundary grids of the entire DEM, the known river grids, and the grids directly adjacent to them. Among them, the known river grids and the grids directly adjacent to them have their grid flow directions determined in advance in steps one to four, and can be regarded as potential outlets like the boundary grids.

[0061] Step S103, based on the multi-computing process, the corresponding grid flow direction is determined according to the preprocessing results and the block results in parallel to obtain the river network extraction result, wherein the flow direction information of the edge buffer grid is transmitted by non-blocking communication between neighboring DEM data blocks in the DEM data to be processed according to actual needs.

[0062] As a possible implementation method, after obtaining the known river vector or raster data and processing results and DEM data segmentation results, the embodiment of the present application can transmit the DEM data block (including edge buffer grid) and known river information for each computing process, and each computing process can perform raster flow direction judgment on the DEM data block for which it is responsible. After the computing process completes the calculation, the raster flow direction and the calculation results of the subsequent steps can be summarized to the main process and saved in sequence, thereby realizing the parallel extraction of high-resolution large-scale river networks.

[0063] Among them, in the process of each computing process performing calculations such as grid flow direction judgment on the DEM data block it is responsible for, each computing process can use non-blocking communication to transmit the flow direction information of the edge buffer grid of the DEM block it is responsible for to the relevant computing process as needed, thereby ensuring that each computing process has global perception of the rivers passing through the DEM blocks of different computing processes when carrying out the current DEM block calculation, and continuously updates the calculation process and results of the DEM block it is responsible for that may be affected.

[0064] For example, when performing parallel calculation of raster flow direction, all processes can be divided into main process and calculation process. Among them, the main process includes only one process, which is responsible for pre-work, overall progress and follow-up work. The calculation process is all processes except the main process, which is mainly responsible for calculating the land raster flow direction in the assigned DEM block. The main process appears at the beginning of the program. Before the parallel calculation starts, it completes the pre-work such as reading and blocking of DEM in sequence, and transmits the information such as the blocked DEM and 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 calculation process in sequence through the MPI information network. After receiving the task assigned by the main process, the calculation process can perform raster flow direction judgment according to the steps before parallelization. The specific process can be expressed as follows:

[0065] (1) Initialization processing: The initial grids received from the main process are added to their respective node size balanced binary search trees in order of priority. The grids with high priority are on the left side of the search tree, and the grids with low priority are on the right side.

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

[0067] (3) Confluence path update and correction: The flow directions of up to 8 neighboring grids around the grid just deleted in (2) are updated based on the maximum elevation value on the optimal confluence path of the grid. If updated, they need to be inserted into the tree.

[0068] (4) Message transmission: Determine whether the raster just deleted is adjacent to the DEM block in charge of other processes. If it is adjacent to the DEM block in charge of several computing processes, its specific location information and priority information need to be temporarily collected as messages to be transmitted. When the number of messages to be sent to a neighboring computing process exceeds the set value, it is transmitted to the neighboring computing process at one time.

[0069] (5) Loop processing: Repeat steps (2)-(4). When the number of grids whose grid flow directions have been updated exceeds a specified value, execute the next step to receive the message.

[0070] (6) Message reception: Receive all grid information sent to its own computing process so far at one time, and insert all these grids into the node size balanced binary search tree according to priority. If the tree is not empty, re-execute step (2) to update the priority grid. If the tree is empty, execute sub-step 7.

[0071] (7) Message waiting: The computing process enters the waiting stage. In the waiting stage, the computing process waits for the message transmission of the neighbor computing process and the global message sent by the main process. If there is a message transmission from the neighbor computing process, it returns to step (6) to receive the message. If the main process sends a message to continue waiting, the waiting stage is maintained. If the main process sends a message that everything is over, the grid flow direction of each grid in the DEM block that it is responsible for is transmitted to the main process in turn.

[0072] After all calculation processes have completed the calculation, the calculation results of the grid flow direction and subsequent steps are summarized in the main process and saved in sequence, so that high-resolution and large-scale river network parallel extraction can be achieved.

[0073] Among them, the embodiment of the present application can, but is not limited to, adopt a search method based on minimum cost in the process of extracting the river network. That is, in the case of known river vector or raster data, thanks to the simplification of the flow direction judgment preprocessing for the raster corresponding to the known data, before parallelization, the elevation of the raster is the only priority criterion in the node size balanced binary search tree. However, as the DEM is divided up by various calculation processes, a single elevation information cannot completely restore the previous inward flood simulation. The original inward flood simulation essentially ensures that the rasters selected and deleted one by one in the node size balanced binary search tree all meet the principle that the maximum elevation value on the optimal confluence path is strictly not reduced. In order to completely restore the inward flood simulation, after parallelization, the elevation value of the raster and the maximum elevation value on the optimal confluence path need to be saved and recorded and inserted into the node size balanced binary search tree as a priority. The specific priority involves three levels of comparison: the first level compares elevation values, and grids with lower elevations have higher priorities. When the elevation values ​​are the same, the second level compares the maximum elevation values ​​on the optimal confluence path, and grids with lower maximum elevation values ​​on the optimal confluence path have higher priorities. When the second level is the same, the third level compares location information to ensure that the priority sorting has a definite result when the first two are the same.

[0074] Furthermore, in the embodiment of the present application, in the process in which each computing process performs calculations such as raster flow direction judgment on the DEM data block that it is responsible for, the flow direction information of the edge buffer raster of the DEM block that each computing process is responsible for is mainly but not limited to being transmitted as needed using a non-blocking communication method to the relevant computing process.

[0075] First, the embodiment of the present application can transmit messages between neighboring calculation processes through non-blocking communication and calculation update. This is mainly because each DEM block is set to a square as much as possible, so each process has at most 8 neighboring calculation processes, and each grid is adjacent to at most 3 other DEM blocks, and bidirectional message transmission may be performed between each neighboring calculation process. Since the DEM blocks responsible for each calculation process have only one edge intersecting each other, the message received by each calculation process must be only the location 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 delayed or advanced, the priority information needs to consider the maximum elevation value on the optimal convergence 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 convergence path should be set to the maximum elevation value on the received optimal convergence path, so that the maximum elevation value on the optimal convergence path becomes the first-level priority comparison of the peripheral grid.

[0076] In addition, a major advantage of MPI parallel computing is non-blocking communication. That is, the sender of the message is allowed to return after issuing the command and directly carry out the subsequent work, and can use the command to test whether the message has been sent at any time; the receiver of the message is allowed to return after receiving the command and carry out the subsequent work, and can use the command to test whether the message has been received at any time. Non-blocking communication makes it possible for algorithm calculation and communication to overlap. In order to reduce the number of communications and reduce the communication time as much as possible, the communication between neighbor calculation processes adopts buffering measures, that is, the messages to be transmitted are first stored in the buffer, and then transmitted when the number is certain, reducing the number of transmissions. At the same time, this measure also allows the process to receive information after a period of time, which also reduces the number of receptions and greatly improves the running speed.

[0077] Although non-blocking communication has a rapid improvement in operating speed, it also brings the problem of message lag, that is, the convergence direction of the grid in the DEM block has been mistakenly pointed to other grids before being assigned the correct direction because the grid in the optimal convergence path is located in the DEM block of other calculation processes. Therefore, the embodiment of the present application can reassign the grid flow direction to make up for the message lag problem. Different from the original known river burning algorithm, the priority grid deleted from the node size balanced binary search tree needs to additionally check the grid whose grid flow direction has been determined in the eight adjacent grids around itself, and judge whether the maximum elevation value on the optimal convergence path of the neighboring grid can be reduced by pointing the grid flow direction of the neighboring grid to itself according to its own elevation and the maximum elevation value on the optimal convergence path. If it can be reduced, the grid flow direction of the neighboring grid needs to be pointed to itself, and the grid flow direction is reassigned so that each grid is assigned the correct grid flow direction.

[0078] It should be noted that the complete completion of a computing process task does not mean that the node size balanced binary search tree is empty and no new messages are sent or received. Since each computing process only communicates with neighboring computing processes, there may be external non-neighboring computing processes that update the optimal confluence path and reassign some grid flow directions, thereby generating a chain reaction and adding new tasks to the computing process that has temporarily completed its work. Therefore, the main process needs to summarize the work progress of all computing processes and provide real-time feedback to each computing process in the waiting stage. The end instruction can be issued only when all computing processes are in the waiting stage at the same time and no new information is sent or received globally.

[0079] Figure 3 This is a schematic diagram of non-blocking communication and flow direction reassignment according to an embodiment of the present application. Figure 3 As shown, Figure 3 The non-blocking communication and grid flow direction reassignment operation in the process of grid flow direction judgment are demonstrated. Figure 3 In (a), since the calculation process No. 1 has completed the flow direction judgment of the D6 grid, and the D6 grid is the edge buffer grid of the calculation process No. 3, the calculation process No. 1 needs to send the maximum elevation value of the optimal confluence path of the D6 grid to the calculation process No. 3. Due to the characteristics of non-blocking communication, the calculation process No. 1 that sends the message will immediately return to restart the calculation of the grid flow direction after the message is sent to the MPI message space, and will not wait for the calculation process No. 3 to receive the message. Figure 3 In (b), the calculation process No. 3 starts to receive the D6 grid information from the calculation process No. 1 after several rounds of calculation. At this time, the calculation processes No. 1 and No. 3 are Figure 3 (a) The flow direction judgment of grid E6, grid D7, and grid D8 has been completed. After the calculation process No. 3 receives the information of grid D6, grid D6 will be used as a potential outlet in the calculation process No. 3 to re-update the flow direction of all nearby grids. After the grid flow direction re-assignment operation, grids D7, D8, D9, C9, and B9 in process No. 3 are re-assigned grid flow directions, so that each grid is assigned the correct grid flow direction.

[0080] Optionally, in one embodiment of the present application, multiple computing processes are divided into a main process and multiple computing processes, wherein the main process completes the DEM prerequisite tasks in sequence at the beginning of the program and before the start of parallel computing, and transmits the block DEM and boundary grid ranges and known river grids in the block results to the corresponding computing processes in sequence through the MPI interface; after receiving the task assigned by the main process, each computing process performs the corresponding calculation process.

[0081] Based on the relevant descriptions of other embodiments, it can be understood that the parallel algorithm for extracting large-scale high-resolution river networks under a distributed memory architecture mainly adopts a parallel algorithm structure including but not limited to one main process and several calculation processes. When performing parallel calculation of grid flow directions, all processes can be divided into main processes and calculation processes. The details are as follows:

[0082] All processes are divided into main processes and calculation processes. Among them, there is only one main process, which is responsible for pre-work, overall progress, result collection, etc., such as task allocation before the start of parallel computing and result collection after the end of parallel computing; the calculation process is all other processes except the main process, which is mainly responsible for calculating the raster flow direction in the DEM block it is assigned to, and other calculation quantities.

[0083] For example, at the beginning of the program, before the parallel computing starts, the main process can first complete the DEM pre-reading, blocking and other preliminary work in sequence, and transmit the block DEM and boundary grid range, known river grid and other information to each computing process in turn through the MPI interface.

[0084] After receiving the task assigned by the main process, each computing process performs the calculation process such as raster flow direction judgment according to the steps of river network extraction.

[0085] The embodiment itself can adopt a parallel algorithm structure including one main process and several computing processes, divide each computing process into non-overlapping DEM blocks except for the edge grids, and let each computing process perform grid flow direction judgment and other river network extraction calculations on all land grids on the assigned DEM block. However, since the D8 method is used to determine the grid flow direction, except for the outlet, the flow direction of each grid points to one of the surrounding 8 grids, resulting in the grid on the edge of the DEM block may point to the grid outside the current block. Therefore, when judging the flow direction for the grid in the DEM block, it is necessary to simultaneously consider the edge buffer grid information around the DEM block.

[0086] Figure 4 This is a schematic diagram of DEM block division according to an embodiment of the present application. Figure 4 As shown in the figure, it shows how to divide and allocate the computational domain of DEM data. Figure 4 (a) shows a 12*12 DEM data divided into four 6*6 DEM grid data computational domains. Each computational process is responsible for calculating the grid flow direction of the remaining land grids in the computational domain. Figure 4 (b) shows the DEM data block received by each computing process from the main process and the grid flow direction information obtained by preprocessing the known rivers in the data block. For the subsequent grid flow direction judgment, the computing process still needs the edge buffer grid information (gray grid in the figure) around the DEM block that it is responsible for, that is, the main 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 computational domains of equal size and assigned to 11 computational processes.

[0087] Optionally, in one embodiment of the present application, after the parallel computing is completed, each computing process sends a transmission request message to the main process, so that after receiving the confirmation transmission message sent by the main process, the main process transmits the calculation results in the DEM block allocated to it to the main process, wherein after receiving the transmission request message, the main process only sends a confirmation transmission message to one of the computing processes that sent the transmission request message each time, and sends a confirmation transmission message to another process after receiving all the calculation results of the process.

[0088] In some embodiments, after the parallel calculation is completed, each calculation process can send a transmission request message to the main process, and after receiving the confirmation transmission message sent by the main process, transmit the calculation results such as the raster flow direction in the DEM block allocated to it to the main process.

[0089] After receiving the transmission request message, the main process only sends a confirmation transmission message to one of the computing processes that issued the transmission request message each time. After receiving all the calculation results of the process, it sends a confirmation transmission message to the other process, ensuring that only one process in the MPI communication network is transmitting the calculation result message, avoiding insufficient space in the MPI communication network.

[0090] Finally, the main process collects the calculation results transmitted by all calculation processes and performs vectorized output of the river network, realizing high-resolution and large-scale parallel extraction of river networks.

[0091] Optionally, in one embodiment of the present application, during the calculation of the DEM data block for which each computing process is responsible, if the edge buffer grid of the DEM block for which it is responsible is involved, its flow direction information is collected as a message to be transmitted, and the number of the adjacent computing process to be sent is recorded, so that 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.

[0092] When each computing process performs raster flow direction judgment and other calculations on the DEM data block it is responsible for, if it involves the edge buffer grid of the DEM block it is responsible for, its flow direction information will be temporarily collected as the message to be transmitted, and the number of the adjacent computing process to be sent will be recorded. When the number of messages to be sent to an adjacent computing process exceeds the pre-set number, the information will be transmitted to the adjacent computing process in a one-time non-blocking communication method.

[0093] Since the algorithm uses a non-blocking communication method to greatly improve efficiency, it also brings the problem of message lag. That is, there is a possibility that when the grid confluence direction in the DEM block is calculated using only the information of this block, the optimal confluence path exists in the DEM block responsible for other calculation processes, and thus it is pointed to the wrong grid. Therefore, it is necessary to reassign the grid flow direction after obtaining the edge grid information transmitted by other calculation processes to compensate for the message lag problem. That is, in the flow direction judgment calculation caused by the update of edge grid information, when deleting a grid from the node size balanced binary search tree, it is necessary to additionally check the grids whose flow directions have been determined in the eight adjacent grids; and according to the elevation of the checked grid and the maximum elevation value on its existing confluence path, it is determined whether the maximum elevation value on its confluence path can be reduced by pointing the flow direction of the checked grid to the grid to be deleted. If the maximum elevation value can be reduced, the grid flow direction of the checked grid needs to be deleted and the grid flow direction needs to be reassigned so that each grid that needs to be updated and calculated is assigned the correct grid flow direction, allowing the algorithm to have global perception of rivers that cross DEM blocks in different calculation processes.

[0094] The present application is described in detail below with reference to a specific embodiment.

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

[0096] Step S501, when river vector or raster data is known, pre-processing of flow direction determination is performed for the raster corresponding to the known data.

[0097] Step S502, dividing the DEM data to be processed into blocks according to the number of available computer processes and the actual size and shape of the DEM data.

[0098] Step S503: transmit the DEM data block (including edge buffer grid) and known river information for each computing process.

[0099] Step S504: Each computing process determines the grid flow direction of the DEM data block for which it is responsible.

[0100] Step S505 , in the process of determining the grid flow direction, neighboring grids use a non-blocking communication method to transmit the flow direction information of the edge buffer grid as needed.

[0101] Step S506, after the calculation process completes the calculation, the grid flow direction and the calculation results of the subsequent steps are summarized into the main process and saved in sequence, so as to realize high-resolution large-scale river network parallel extraction.

[0102] According to the parallel method for extracting river networks under a distributed memory architecture proposed in the embodiment of the present application, parallel computing can be applied to river network extraction calculation processes such as raster flow direction judgment based on digital elevation model data under a distributed memory architecture to achieve parallel extraction of large-scale high-resolution river networks, thereby achieving improved computing efficiency while ensuring the original river network accuracy, increasing the scale of the basin area that can be processed by the algorithm and / or the DEM resolution, and reducing the demand for single-machine memory capacity, thereby achieving one-time completion of the structured extraction of raster digital river networks of hundreds of billions to trillions. Thus, the problems of the river network extraction algorithm in the related art being difficult to meet the required running time and memory space when facing the DEM data resolution that is constantly improving with the development of spatial information technology, and how to restructure and upgrade the serial program to complete the structured extraction of raster digital river networks of hundreds of billions to trillions at one time are solved.

[0103] Next, a parallel device for extracting river networks under a distributed memory architecture proposed according to an embodiment of the present application is described with reference to the accompanying drawings.

[0104] Figure 6 It is a structural diagram of a parallel device for extracting a river network under a distributed memory architecture according to an embodiment of the present application.

[0105] like Figure 6 As shown, the parallel device 10 for extracting river networks under a distributed memory architecture includes: a processing module 100, a blocking module 200 and an extraction module 300.

[0106] The processing module 100 is used to perform flow direction determination preprocessing on the grid corresponding to the known river vector or raster data under the distributed memory architecture to obtain the preprocessing result.

[0107] The block division module 200 is used to divide the DEM data to be processed into blocks according to the actual scale and shape of the digital elevation model DEM data to obtain a block division result.

[0108] The extraction module 300 is used to determine the corresponding grid flow direction based on the preprocessing results and the block results in parallel based on multiple computing processes to obtain the extraction result of the river network, wherein the flow direction information of the edge buffer grid is transmitted by non-blocking communication between neighboring DEM data blocks in the DEM data to be processed according to actual needs.

[0109] Optionally, in one embodiment of the present application, the processing module 100 includes: a traversal unit, a search unit and a processing unit.

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

[0111] A processing unit is used to point the confluence direction of the grids that have never been added to the node size balanced binary search tree among the 8 neighbors around the known river grid with the highest priority to the deleted grid, and add the corresponding known river grids to the tree until all known river grids are added to the node size balanced binary search tree and deleted, so as to obtain the grid flow directions of all known river grids and the grids directly adjacent to them.

[0112] Optionally, in one embodiment of the present application, multiple computing processes are divided into a main process and multiple computing processes, wherein the main process completes the DEM prerequisite tasks in sequence at the beginning of the program and before the start of parallel computing, and transmits the block DEM and boundary grid ranges and known river grids in the block results to the corresponding computing processes in sequence through the MPI interface; after receiving the task assigned by the main process, each computing process performs the corresponding calculation process.

[0113] Optionally, in one embodiment of the present application, after the parallel computing is completed, each computing process sends a transmission request message to the main process, so that after receiving the confirmation transmission message sent by the main process, the main process transmits the calculation results in the DEM block allocated to it to the main process, wherein after receiving the transmission request message, the main process only sends a confirmation transmission message to one of the computing processes that sent the transmission request message each time, and sends a confirmation transmission message to another process after receiving all the calculation results of the process.

[0114] Optionally, in one embodiment of the present application, during the calculation of the DEM data block for which each computing process is responsible, if the edge buffer grid of the DEM block for which it is responsible is involved, its flow direction information is collected as a message to be transmitted, and the number of the adjacent computing process to be sent is recorded, so that 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.

[0115] It should be noted that the aforementioned explanation of the embodiment of the parallel method for extracting a river network under a distributed memory architecture is also applicable to the parallel device for extracting a river network under a distributed memory architecture of this embodiment, and will not be repeated here.

[0116] According to the parallel device for extracting river networks under a distributed memory architecture proposed in the embodiment of the present application, parallel computing can be applied to river network extraction calculation processes such as raster flow direction judgment based on digital elevation model data under a distributed memory architecture to achieve parallel extraction of large-scale high-resolution river networks, thereby achieving improved computing efficiency while ensuring the original river network accuracy, increasing the scale of the basin area that can be processed by the algorithm and / or the DEM resolution, and reducing the demand for single-machine memory capacity, thereby achieving one-time completion of the structured extraction of raster digital river networks of hundreds of billions to trillions. Thus, the problems of the river network extraction algorithm in the related art being difficult to meet the required running time and memory space when facing the DEM data resolution that is constantly improving with the development of spatial information technology, and how to restructure and upgrade the serial program to complete the structured extraction of raster digital river networks of hundreds of billions to trillions at one time are solved.

[0117] Figure 7 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. The electronic device may include:

[0118] A memory 701 , a processor 702 , and a computer program stored in the memory 701 and executable on the processor 702 .

[0119] When the processor 702 executes the program, the parallel method for extracting a river network under a distributed memory architecture provided in the above embodiment is implemented.

[0120] Furthermore, the electronic device further comprises:

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

[0122] The memory 701 is used to store computer programs that can be executed on the processor 702 .

[0123] The memory 701 may include a high-speed RAM memory, and may also include a non-volatile memory (non-volatile memory), such as at least one disk memory.

[0124] 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 to each other through a bus and communicate with 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. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 7 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.

[0125] 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 communicate with each other through an internal interface.

[0126] The processor 702 may be a central processing unit (CPU), or an application specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present application.

[0127] An embodiment of the present application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the above-mentioned parallel method for extracting a river network under a distributed memory architecture.

[0128] An embodiment of the present application also provides a computer program product, including a computer program, which can run computer instructions. When the computer instructions are executed by a processor, the parallel method for extracting river networks under a distributed memory architecture provided in an embodiment of the present application is implemented.

[0129] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or N embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, without contradiction.

[0130] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include at least one of the features. In the description of this application, "N" means at least two, such as two, three, etc., unless otherwise clearly and specifically defined.

[0131] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, fragment or portion of code comprising one or N executable instructions for implementing the steps of a custom logical function or process, and the scope of the preferred embodiments of the present application includes alternative implementations in which functions may not be performed in the order shown or discussed, including performing functions in a substantially simultaneous manner or in reverse order depending on the functions involved, which should be understood by technicians in the technical field to which the embodiments of the present application belong.

[0132] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute instructions), or in combination with these instruction execution systems, devices or apparatuses. For the purpose of this specification, "computer-readable medium" can be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution system, device or apparatus, or in combination with these instruction execution systems, devices or apparatuses. More specific examples of computer-readable media (a non-exhaustive list) include the following: an electrical connection with one or N wirings (electronic devices), a portable computer disk box (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), a fiber optic device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be paper or other suitable medium on which the program is printed, since the program may be obtained electronically by optically scanning the paper or other medium and then editing, interpreting or processing in other suitable ways as necessary and then storing it in a computer memory.

[0133] It should be understood that the various parts of the present application can be implemented by hardware, software, firmware or a combination thereof. In the above embodiment, the N steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. If implemented by hardware, as in another embodiment, it can be implemented by any one or a combination of multiple of the following technologies known in the art: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.

[0134] A person skilled in the art may understand that all or part of the steps in the method for implementing the above-mentioned embodiment may be completed by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, which, when executed, includes one or a combination of the steps of the method embodiment.

[0135] In addition, each functional unit in each embodiment of the present application may be integrated into a processing module, or each unit may exist physically separately, or two or more units may be integrated into one module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it may also be stored in a computer-readable storage medium.

[0136] The storage medium mentioned above may 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 can be understood that the above embodiments are exemplary and cannot be understood as limiting the present application. A person of ordinary skill in the art may change, modify, replace and modify the above embodiments within the scope of the present application.

Claims

1. A parallel method for extracting river networks in a distributed memory architecture, characterized in that: The following steps are involved: Under the distributed memory architecture, the grids corresponding to the known river vector or raster data are preprocessed for flow direction judgment to obtain the preprocessing results; According to the actual scale and shape of the digital elevation model DEM data, the DEM data to be processed is divided into blocks to obtain the block results; Based on multiple computing processes, the corresponding grid flow direction is determined in parallel according to the preprocessing results and the block results to obtain the river network extraction result, wherein the flow direction information of the edge buffer grid is transmitted between neighboring DEM data blocks in the DEM data to be processed using a non-blocking communication method according to actual needs.

2. The parallel method for extracting river networks in a distributed memory architecture according to claim 1, characterized in that: The flow direction determination preprocessing is performed on the grid corresponding to the known river vector or grid data to obtain the preprocessing result, including: Traverse all known river grids after rasterization, find the grids located at the DEM boundary and add them to the node size balanced binary search tree; Selecting the known river grid with the highest priority in the node size balanced binary search tree and deleting it from the tree; The confluence direction of the grids that have never been added to the node-size balanced binary search tree among the 8 neighbors around the known river grid with the highest priority is pointed to the deleted grid, and the corresponding known river grids are added to the tree until all known river grids are added to the node-size balanced binary search tree and deleted, so as to obtain the grid flow directions of all known river grids and the grids directly adjacent to them.

3. The parallel method for extracting river networks in a distributed memory architecture according to claim 1, characterized in that: The multi-computing processes are divided into a main process and multiple computing processes, wherein the main process completes the DEM pre-task in sequence at the beginning of the program and before the start of parallel computing, and transmits the block DEM and boundary grid ranges and known river grids in the block results to the corresponding computing processes in sequence through the MPI interface; each computing process performs the corresponding computing process after receiving the task assigned by the main process.

4. The parallel method for extracting river networks in a distributed memory architecture according to claim 3, characterized in that: After the parallel calculation is completed, each computing process sends a transmission request message to the main process, so that after receiving the confirmation transmission message sent by the main process, the calculation result in the DEM block allocated to it is transmitted to the main process. After receiving the transmission request message, the main process only sends the confirmation transmission message to one process in the computing process that sent 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 for extracting river networks in a distributed memory architecture according to claim 3 or 4, characterized in that: During the calculation of the DEM data block for which each computing process is responsible, if the edge buffer grid of the DEM block for which the computing process is responsible is involved, the flow information thereof is collected as a message to be transmitted, and the number of the adjacent computing process to be sent is recorded, so that after 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.

6. A parallel device for extracting river networks in a distributed memory architecture, characterized in that: The processing module is used to perform flow direction determination preprocessing on the grids corresponding to the known river vector or raster data under the distributed memory architecture to obtain the preprocessing result; The block module is used to block the DEM data to be processed according to the actual scale and shape of the digital elevation model DEM data to obtain the block results; The extraction module is used to determine the corresponding grid flow direction based on the preprocessing results and the block results in parallel based on multiple computing processes to obtain the extraction result of the river network, wherein the flow direction information of the edge buffer grid is transmitted by non-blocking communication between neighboring DEM data blocks in the DEM data to be processed according to actual needs.

7. The device according to claim 6, characterized in that The processing module comprises: A traversal unit is used to traverse all known river grids after rasterization, find out the grids located at the boundary of DEM and add them to the node size balanced binary search tree; A search unit, used for selecting the known river grid with the highest priority in the node size balanced binary search tree and deleting it from the tree; A processing unit is used to point the confluence direction of the grids that have never been added to the node size balanced binary search tree among the 8 neighbors around the known river grid with the highest priority to the deleted grid, and add the corresponding known river grids to the tree until all known river grids are added to the node size balanced binary search tree and deleted, so as to obtain the grid flow directions of all known river grids and the grids directly adjacent to them.

8. An electronic device, characterized in that: include: 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 a parallel method for extracting a river network under a distributed memory architecture as described in any one of claims 1 to 5.

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

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed, it is used to implement the parallel method for extracting river networks under a distributed memory architecture as described in any one of claims 1 to 5.

Citation Information

Patent Citations

  • Numerical control with paramacro capability

    CA1187968A

  • Parallelization method of distributed hydrological simulation under cluster environment

    CN103092572A

  • Multiple access method for improving data transmission reliability and stability

    CN107040284A

  • Moving particle method parallel computing equivalent particle load balancing acceleration method

    CN110929456A

  • Traffic flow prediction parallel method based on chaos and reinforcement learning

    CN114463994A