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

By performing flow direction determination and block processing on river vector or raster data under a distributed memory architecture, and combining parallel computing with multiple computing processes, the problem of insufficient running time and memory space in existing river network extraction algorithms under high-resolution DEM data is solved, and efficient extraction of raster digital river networks of hundreds of billions to trillions of data is achieved.

CN118941596BActive Publication Date: 2026-07-21TSINGHUA UNIVERSITY
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
TSINGHUA UNIVERSITY
Filing Date
2024-08-15
Publication Date
2026-07-21

AI Technical Summary

Technical Problem

Existing river network extraction algorithms struggle to meet the demands of runtime and memory space requirements when faced with the ever-increasing resolution of DEM data as spatial information technology advances. They are unable to complete the structured extraction of raster digital river networks ranging from hundreds of billions to trillions of grids in a single operation.

Method used

By employing a distributed memory architecture, the flow direction of known river vector or raster data is preprocessed, DEM data is processed in blocks, and parallel computation is performed using multiple computing processes. Flow direction information of edge buffer rasters is transmitted using non-blocking communication, thereby achieving parallel extraction of the river network.

Benefits of technology

It improves computational efficiency, increases the scale of watersheds that can be processed and the resolution of DEMs, reduces the demand for single-machine memory capacity, and realizes the structured extraction of raster digital river networks ranging from hundreds of billions to trillions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118941596B_ABST
    Figure CN118941596B_ABST
Patent Text Reader

Abstract

The application 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, wherein the method comprises 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; according to the actual size and shape of digital elevation model (DEM) data, performing block division on the to-be-processed DEM data, to obtain a block division result; based on multiple computing processes, determining the corresponding grid flow direction according to the preprocessing result and the block division result in parallel, to obtain an extraction result of the river network, wherein the flow direction information of the edge buffer grid between neighbor DEM data blocks in the to-be-processed DEM data is transmitted in a non-blocking communication mode according to actual requirements. The application can improve the operation efficiency under the guarantee of the original river network precision, improve the basin area scale and DEM resolution that can be processed by the algorithm, reduce the demand for single-machine memory capacity, and realize large-scale river network extraction.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

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

[0002] In related technologies, the mainstream river network extraction algorithms are primarily based on Digital Elevation Model (DEM) data. The extracted river network can include basic geometric information of each river segment and the source-confluence topology relationships between them. This information is currently widely used in fields such as watershed distributed rainfall-runoff simulation, non-point source pollution simulation, and geomorphological analysis. Therefore, extracting high-precision river networks provides necessary conditions for improving the accuracy of watershed rainfall-runoff and environmental simulations and for in-depth exploration of the intrinsic structural laws of rivers, thus possessing significant scientific value.

[0003] However, the river network extraction algorithms in related technologies are struggling to meet the running time and memory requirements of DEM data resolution, which is constantly increasing with the development of spatial information technology. How to restructure and upgrade the serial program to complete the structured extraction of hundreds of billions to trillions of raster digital river networks in one go is an urgent problem to be solved. Summary of the Invention

[0004] This application provides a parallel method and apparatus for extracting river networks under a distributed memory architecture, in order to solve the problems of how river network extraction algorithms in related technologies cannot meet the required running time and memory space when facing the ever-increasing resolution of DEM data with the development of spatial information technology, and how to restructure and upgrade the serial program to complete the structured extraction of hundreds of billions to trillions of raster digital river networks in one go.

[0005] The first aspect of this application provides a parallel method for extracting river networks under a distributed memory architecture, comprising the following steps: under the distributed memory architecture, performing flow direction determination preprocessing on the gratings corresponding to known river vectors or grating data to obtain preprocessing results; 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 block division results; based on multiple computing processes, determining the corresponding grating flow direction according to the preprocessing results and the block division results in parallel to obtain the river network extraction results, wherein, in the DEM data to be processed, neighboring DEM data blocks transmit the flow direction information of edge buffer gratings using a non-blocking communication method according to actual needs.

[0006] Optionally, in one embodiment of this application, the preprocessing of the raster corresponding to the known river vector or raster data to determine the flow direction and obtain the preprocessing result includes: traversing all rasterized known river rasters, finding the rasters located at the DEM boundary and adding them to a 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 flow direction of the rasters among the 8 neighbors of the highest priority known river raster that have never been added to the node-size-balanced binary search tree to the deleted raster, and adding the corresponding known river raster to the tree, until all known river rasters have been added to the node-size-balanced binary search tree and deleted, so as to obtain the raster flow direction of all known river rasters and their directly adjacent rasters.

[0007] Optionally, in one embodiment of this application, the multiple computing processes are divided into a main process and multiple computing processes. The main process completes the pre-processing tasks of DEM sequentially at the beginning of the program and before the start of parallel computing, and transmits the block DEM and the range of the boundary grid and the known river grid in the block result 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 computing process.

[0008] Optionally, in one embodiment of this application, after the parallel computation is completed, each computation process sends a transmission request message to the main process to transmit the computation results in the DEM block it has been allocated to the main process after receiving the confirmation transmission message sent by the main process. In this case, after receiving the transmission request message, the main process sends the confirmation transmission message to only one of the computation processes that sent the transmission request message at a time, and sends the confirmation transmission message to the other process only after receiving all the computation results of that process.

[0009] Optionally, in one embodiment of this application, when each computing process is calculating the DEM data block it is responsible for, if it involves the edge buffer grid of the DEM block it is responsible for, it collects the flow information of the edge buffer grid as a message to be transmitted and records the neighboring computing process number to which it needs to be sent. After the number of messages to be sent to the neighboring computing process exceeds a preset number, all the information is transmitted to the neighboring computing process.

[0010] A second aspect of this application provides a parallel device for extracting river networks under a distributed memory architecture, comprising: a processing module for performing flow direction determination preprocessing on rasters corresponding to known river vectors or raster data under a distributed memory architecture to obtain a preprocessing result; a block segmentation module for segmenting 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 segmentation result; and an extraction module for determining the corresponding raster flow direction based on multiple computing processes, in parallel with the preprocessing result and the block segmentation result, to obtain the river network extraction result, wherein the flow direction information of the edge buffer rasters 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 this application, the processing module includes: a traversal unit, used to traverse all rasterized known river rasters, find the rasters located at the DEM boundary and add them to a node-size-balanced binary search tree; a search unit, used to select the highest priority known river raster in the node-size-balanced binary search tree and delete it from the tree; and a processing unit, used to direct the flow direction of the rasters that have never been added to the node-size-balanced binary search tree among the 8 neighbors of the highest priority known river raster to the deleted raster, and add the corresponding known river raster to the tree, until all known river rasters have been added to the node-size-balanced binary search tree and deleted, so as to obtain the raster flow direction of all known river rasters and their directly adjacent rasters.

[0012] Optionally, in one embodiment of this application, the multiple computing processes are divided into a main process and multiple computing processes. The main process completes the pre-processing tasks of DEM sequentially at the beginning of the program and before the start of parallel computing, and transmits the block DEM and the range of the boundary grid and the known river grid in the block result 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 computing process.

[0013] Optionally, in one embodiment of this application, after the parallel computation is completed, each computation process sends a transmission request message to the main process to transmit the computation results in the DEM block it has been allocated to the main process after receiving the confirmation transmission message sent by the main process. In this case, after receiving the transmission request message, the main process sends the confirmation transmission message to only one of the computation processes that sent the transmission request message at a time, and sends the confirmation transmission message to the other process only after receiving all the computation results of that process.

[0014] Optionally, in one embodiment of this application, when each computing process is calculating the DEM data block it is responsible for, if it involves the edge buffer grid of the DEM block it is responsible for, it collects the flow information of the edge buffer grid as a message to be transmitted and records the neighboring computing process number to which it needs to be sent. After the number of messages to be sent to the neighboring computing process exceeds a preset number, all the information is transmitted to the neighboring computing process.

[0015] A third aspect of this application provides an electronic device, including: 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 embodiments.

[0016] A fourth aspect of this application provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the parallel method for extracting river networks under a distributed memory architecture as described above.

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

[0018] This application's embodiments, under a distributed memory architecture, apply parallel computing based on digital elevation model data to river network extraction calculations such as raster flow direction determination. This enables parallel extraction of large-scale, high-resolution river networks, thereby improving computational efficiency while maintaining the original river network accuracy, increasing the scale of watershed areas and / or DEM resolution that the algorithm can handle, and reducing the demand for single-machine memory capacity. This allows for the simultaneous structured extraction of raster digital river networks ranging from hundreds of billions to trillions of data points. Therefore, it solves the problems in related technologies where river network extraction algorithms struggle to meet the required runtime and memory space when facing the ever-increasing resolution of DEM data with the development of spatial information technology. It also addresses how to restructure and upgrade serial programs to achieve the simultaneous structured extraction of raster digital river networks ranging from hundreds of billions to trillions of data points.

[0019] Additional aspects and advantages of this application will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of this application. Attached Figure Description

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

[0021] Figure 1This is a flowchart illustrating a parallel method for extracting river networks in a distributed memory architecture, according to an embodiment of this application.

[0022] Figure 2 This is a known river network burning preprocessing diagram according to an embodiment of this application;

[0023] Figure 3 This is a schematic diagram of non-blocking communication and flow reassignment according to an embodiment of this application;

[0024] Figure 4 This is a schematic diagram of DEM block division according to an embodiment of this application;

[0025] Figure 5 This is a flowchart illustrating a parallel method for extracting river networks in a distributed memory architecture, according to one embodiment of this application.

[0026] Figure 6 This is a schematic diagram of the structure of a parallel device for extracting river networks under a distributed memory architecture according to an embodiment of this application;

[0027] Figure 7 This is a schematic diagram of the structure of an electronic device according to an embodiment of this application.

[0028] Figure label:

[0029] 10- Parallel device for extracting river networks under a distributed memory architecture: 100- Processing module, 200- Blocking module and 300- Extraction module; 701- Memory, 702- Processor and 703- Communication interface. Detailed Implementation

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

[0031] The following description, with reference to the accompanying drawings, describes a parallel method and apparatus for extracting river networks under a distributed memory architecture, according to embodiments of this application. Addressing the issue that river network extraction algorithms in the aforementioned background art struggle to meet the required runtime and memory space demands when facing the ever-increasing resolution of DEM data due to the development of spatial information technology, and how to restructure and upgrade serial programs to achieve structured extraction of raster digital river networks ranging from hundreds of billions to trillions in a single operation, this application provides a parallel method for extracting river networks under a distributed memory architecture. In this method, parallel computing can be applied to river network extraction calculations such as raster flow direction determination based on digital elevation model data within a distributed memory architecture. This enables parallel extraction of large-scale, high-resolution river networks, thereby improving computational efficiency while maintaining the original river network accuracy, increasing the basin area and / or DEM resolution that the algorithm can handle, and reducing the demand for single-machine memory capacity. This allows for the structured extraction of raster digital river networks ranging from hundreds of billions to trillions in a single operation. This solves the problem that river network extraction algorithms in related technologies struggle to meet the required runtime and memory space when facing the ever-increasing resolution of DEM data as spatial information technology develops, and how to restructure and upgrade serial programs to complete the structured extraction of hundreds of billions to trillions of raster digital river networks in one go.

[0032] Before explaining the parallel method for extracting river networks under a distributed memory architecture provided in the embodiments of this application, the system technology involved in the embodiments of this application will be explained first.

[0033] A river network is a hydrological system formed by the interconnectedness of all rivers, including tributaries and main streams, within a river basin. Extracting high-precision river network data is the most crucial foundation for building a digital river basin. The "National Water Network Construction Plan Outline" proposes a major strategic deployment to accelerate the construction of a national water network, build a modern, high-quality water conservancy infrastructure network, and comprehensively address water resources, water ecology, water environment, and water disaster issues. The national water network is a comprehensive system based on natural rivers and lakes, using water diversion and drainage projects as channels, water storage projects as nodes, and intelligent regulation as a means, integrating functions such as optimized allocation of water resources, flood control and disaster reduction in the basin, and protection of aquatic ecosystems. The river network extracted from topographic data is a digital description of the natural water network within the national water network. Supplemented by meteorological, geological, ecological, and social information, it can provide relevant departments with corresponding scientific basis for simulating and predicting hydrological and flood processes, planning water resource storage projects, and rationally allocating water resources, thus possessing significant practical value.

[0034] Furthermore, the embodiments of this application primarily, but are not limited to, employing the MPI (Message Passing Interface) parallel computing standard and its development and runtime environment, enabling operation in computer and network hardware architectures ranging from single-machine to multi-machine distributed memory. Running the algorithm in this distributed memory architecture can improve the scale of watershed areas and / or DEM resolution that the algorithm can handle, and reduce the demand for single-machine memory capacity. Generally, the program runs concurrently on multiple computer systems with network connections, passing messages between different processes on a single computer and between different processes on different computers via the MPI interface, thereby concurrently processing the problem, improving the computational efficiency of large-scale high-resolution river network extraction, and coordinating the use of memory space on different computers; the program can also run on a single computer system.

[0035] Specifically, Figure 1 This is a flowchart illustrating a parallel method for extracting river networks under a distributed memory architecture, provided as an embodiment of this application.

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

[0037] In step S101, under the distributed memory architecture, the flow direction is determined by preprocessing the raster corresponding to the known river vector or raster data to obtain the preprocessing result.

[0038] As will be understood by those skilled in the art, distributed memory architecture here refers to a computing system architecture in which memory resources are distributed across multiple independent processors or nodes, each node having its own independent memory space, and data exchange and sharing can be achieved through networks or other communication mechanisms. This architecture has wide applications in parallel computing, high-performance computing (HPC), and big data processing.

[0039] In some embodiments, in the parallel method for extracting river networks, based on the known or obtained river vector or raster data, flow direction determination preprocessing can be performed on the raster corresponding to these known data, and then subsequent processing can be performed based on the preprocessed known river vector or raster data.

[0040] River vector and raster data are commonly used data types in Geographic Information Systems (GIS), representing the spatial location and attribute information of rivers, respectively. River vector data uses vector graphic elements such as points, lines, and polygons to represent the spatial location and shape of a river, containing attribute information such as the river's starting point, ending point, length, width, flow direction, and water depth, clearly expressing the river's boundaries and direction. River raster data divides the spatial information of a river into grids of a specific size, representing the attribute values ​​(such as water depth and flow velocity) of each grid in numerical form. It typically includes the river's gridded physical parameters such as water depth, flow velocity, and flow direction, facilitating spatial analysis and processing.

[0041] The process will now be explained in more detail.

[0042] Optionally, in one embodiment of this application, the flow direction of the rasters corresponding to the known river vectors or rasters is preprocessed to obtain the preprocessing result, including: traversing all known river rasters after rasterization, finding the rasters located at the DEM boundary and adding them to a 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 flow direction of the rasters that have never been added to the node-size-balanced binary search tree among the 8 neighbors of the highest priority known river raster to the deleted raster, and adding the corresponding known river raster 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 direction of all known river rasters and their directly adjacent rasters.

[0043] Based on the descriptions of other embodiments, it is understood that this application can perform flow direction determination preprocessing on the rasters corresponding to known river vectors or raster data, so as to use the preprocessed known river vectors or raster data for subsequent processing.

[0044] In some embodiments, given known river vectors or raster data, this application can divide the raster flow direction determination process of the known river burning algorithm into two independent stages. The first stage determines the raster flow direction for the known river and its directly adjacent raster, and the second stage determines the raster flow direction for all other land raster. Embodiments of this application can perform flow direction determination preprocessing on the raster considered in the first stage as corresponding to the known data. Specifically, the preprocessing process can be represented as follows:

[0045] (1) Initialization process: Traverse all preprocessed known river rasters, find the unique raster located on 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 highest priority known river grid in the node-size balanced binary search tree and delete it from the tree.

[0047] (3) Convergence path expansion: Point the converging direction of the 8 neighboring rasters of the raster that was just deleted in (2) that have never been added to the node size balanced binary search tree to the raster that was just deleted. Only add the known river rasters to the tree to ensure that there are only known river rasters in the node size balanced binary search tree, and that the flow direction of all rasters directly adjacent to the known river is determined.

[0048] (4) Iterative processing: Iterate through steps (2) and (3) until all known river grids are added to the node size balanced binary search tree and then deleted. At this point, the flow direction of all known river grids in the DEM and their directly adjacent grids is obtained.

[0049] For example, Figure 2 This is a known river network burning preprocessing diagram according to an embodiment of this application. (See diagram below.) Figure 2 The diagram illustrates the specific process of how a known river forces the flow direction of nearby grid cells in the first stage. Figure 2 (a) indicates the start of the first phase of initialization. Currently, only the known river outlet grid in D1 has been added to the node-size-balanced binary search tree. Figure 2 (b) indicates that D1 becomes the current priority grid in the first stage. The confluence path expansion starts from D1. The known river grids C2, D2, and E2 are determined to have their flow direction and added to the node size balanced binary search tree. The land grids C1 and E1 are determined to have their flow direction. Figure 2 (c) indicates that after several rounds of operations in the first stage, G7 becomes the new priority grid in the first stage. Starting from G7, the confluence path expansion is carried out. The known river grid G8 is determined to have its flow direction and added to the node size balanced binary search tree. The land grids F8 and H8 are determined to have their flow direction. Figure 2 (d) indicates that the first stage has officially ended, and the flow direction of all known rivers and their directly adjacent grids has been determined, completing the preprocessing of the forced grid flow direction of known rivers.

[0050] This application embodiment can modify the priority criterion during the preprocessing of flow direction determination using known river data. Specifically, the priority criterion for the grid-by-grid departure from the node-balanced binary search tree in this application embodiment is modified. For example, in the depression-filling and excavation algorithm based on minimum cost search proposed by L. Wang and H. Liu in 2007, the elevation value is the sole priority criterion. In the known river recording algorithm of this application embodiment, a hierarchical priority metric is adopted, incorporating the known river number and the known river marker value, with the river marker value being the most important criterion in this priority metric, while the elevation value is considered a secondary factor.

[0051] Under the known river burning algorithm in this application embodiment, three situations may occur: First, known river rasters are always given higher priority than land rasters. Second, when comparing two land pixels, elevation remains the sole criterion, with the one with lower elevation being given higher priority. In certain special cases, when the elevations of two pixels are equal, the raster that was inserted earlier into the size-balanced binary search tree will be given higher priority. Third, for comparisons between two known river rasters, the raster with the smaller known river ID value is given higher priority, while the elevation criterion is only activated when the known river IDs of the two rasters are the same.

[0052] This allows the known river burning algorithm to force flow direction without specifying an elevation offset. Since known river rasters are preferentially "submerged" during the raster flow direction determination process, they can force neighboring rasters to flow towards them. Additionally, the hierarchical priority metric ensures that lower-numbered known rivers are "submerged" before higher-numbered ones, while land rasters are more likely to flow onto paths of lower-numbered known rivers.

[0053] Furthermore, the embodiments of this application also extend and improve the confluence path. The known river burning algorithm employs additional rules regarding the order of entry into the size-balanced binary search tree, such as... Figure 2 As shown in the figure. This embodiment of the application determines whether neighboring grids should be added to the node-size-balanced binary search tree by checking whether a grid point in the popped node-size-balanced binary search tree is a known river grid and whether it is the source of a known river. If a neighboring grid is a grid not constrained by a known river or a grid at the source of a known river, it can be added to the node-size-balanced binary search tree as long as it has not been flooded. If a neighboring 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 currently popped grid. Simultaneously, the flow direction of any grid is not allowed to completely cross two known river grids with the same number or two grids on the same endorheic zone boundary, ensuring that grids within the endorheic zone cannot cross the endorheic zone boundary and flow out of the endorheic zone, and that rivers crossing known rivers due to DEM elevation are not allowed to enter the tree.

[0054] Furthermore, the embodiments of this application can further improve the handling of depressions. Specifically, the known river burning algorithm in these embodiments abandons the previous depression filling algorithm and instead employs a depression breakthrough algorithm to help determine the flow direction within the depressions. In the depression breakthrough algorithm, the original elevation values ​​of the raster are preserved and play a role in determining relevant priorities. Simultaneously, the flood simulation will first take the steepest descent path to reach the minimum elevation, and then gradually flood the depressions by advancing along the least steep uphill slope. Therefore, the initial DEM conditions can be well preserved and fully utilized for priority determination and other subsequent calculations, such as raster flow direction determination.

[0055] Furthermore, the embodiments of this application can enhance hydrological flow direction. After performing inward flood simulation using an algorithm that improves priority criteria, confluence paths, and depression handling, the known river burning algorithm obtains a relatively accurate flow direction for all grid cells and a sorted grid sequence. However, the curves of each known river are not completely preserved. To address the river channel short-circuiting problem, the algorithm in this application adopts the principles of "hydrologically optimal" and "minimum bifurcation," ensuring that the grid flow direction of each known river should face its downstream neighbor, making it as hydrologically similar as possible. Simultaneously, it ensures that the gridded main flow path of a known river contains as many grid cells as possible to reduce tributaries within the flow path.

[0056] Step S102: 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 the block division results.

[0057] As is understandable, a Digital Elevation Model (DEM) is a geographic data model that digitally simulates the terrain using limited topographic elevation data. A DEM is a digital record of the Earth's surface elevation information; it is a physical ground model capable of reflecting local terrain features at a certain resolution. DEM data is typically presented in raster format, with each raster cell containing a height value in meters, describing ground elevation information.

[0058] In other embodiments, to simplify the river network extraction process, when determining the raster flow direction, this 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 represented as follows:

[0059] First, the top and bottom positions of each column in the DEM are preprocessed. The size of the DEM subarray is used as the answer for a binary search. The column range of each DEM subarray in the DEM is calculated based on its size. The top and bottom positions of this column range are calculated using the preprocessed top and bottom positions of each column, thus calculating how many DEM subarrays are needed for this column range. This process is repeated to calculate how many subarrays are needed to fill the entire DEM grid with the current DEM subarray size. The result is compared with the number of available computer processes to finally obtain the minimum DEM subarray size within the process range.

[0060] It should be noted that simply assigning elevation information for one DEM submatrix to each computation process before parallel computation of grid flow direction is insufficient. In addition to the elevation information for each grid, the computation process also needs to determine whether each grid in its assigned DEM submatrix requires inclusion in a node-size-balanced binary search tree during parallel computation initialization. The grid nodes that need to be added to the tree in advance are the boundary grids of the entire DEM, known river grids, and their directly adjacent grids. The known river grids and their directly adjacent grids have their flow direction pre-determined in steps one through four and, like the boundary grids, can be considered potential outlets.

[0061] Step S103: Based on multiple computing processes, the corresponding raster flow direction is determined in parallel according to the preprocessing results and block results to obtain the river network extraction results. In this process, the flow direction information of the edge buffer raster is transmitted between neighboring DEM data blocks in the DEM data to be processed using a non-blocking communication method according to actual needs.

[0062] As one possible approach, after obtaining the processing results of known river vectors or raster data and the DEM data block results, this embodiment of the application can transmit the DEM data block (including edge buffer rasters) and known river information it is responsible for to each computing process, and each computing process can determine the raster flow direction for its own DEM data block. After the computing process completes the calculation, the raster flow direction and the calculation results of subsequent steps can be summarized to the main process and saved sequentially, thereby enabling parallel extraction of high-resolution large-scale river networks.

[0063] In the process of each computing process performing calculations such as raster flow direction determination on the DEM data blocks it is responsible for, each computing process can transmit the flow direction information of the edge buffer raster of the DEM block it is responsible for to the relevant computing processes as needed using non-blocking communication. This ensures that each computing process has a global awareness of the rivers crossing 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 computation of raster flow direction, all processes can be distinguished into a main process and computation processes. The main process consists of only one process, responsible for preliminary work, scheduling, and subsequent tasks. The computation processes comprise all other processes excluding the main process, primarily responsible for calculating the land raster flow direction within their assigned DEM blocks. The main process appears at the beginning of the program, sequentially completing preliminary work such as reading and partitioning the DEM before parallel computation begins. It then transmits the partitioned DEM, along with information such as the boundary rasters, known river rasters, and their directly adjacent rasters (hereinafter referred to as initial rasters) of each block, to each computation process via the MPI information network. After receiving the tasks assigned by the main process, the computation processes can determine the raster flow direction following the steps taken before parallelization. The specific process can be represented as follows:

[0065] (1) Initialization process: The initial grids received from the main process are added to the respective node-size balanced binary search trees in order of priority. Grids with higher priority are on the left side of the search tree, and grids with lower 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) Convergence path update correction: The flow direction of the grid cell that was just deleted in (2) is determined based on the maximum elevation value on the optimal convergence path of the grid cell. If it is updated, it needs to be inserted into the tree.

[0068] (4) Message transmission: Determine whether the recently deleted raster is adjacent to DEM blocks managed by other processes. If it is adjacent to DEM blocks managed by 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 collected to be sent to an adjacent computing process exceeds a predetermined value, they are transmitted to that adjacent computing process all at once.

[0069] (5) Loop processing: Repeat steps (2)-(4). When the number of grids that have been updated exceeds a specified value, proceed to the next step to receive messages.

[0070] (6) Message Reception: Receive all raster information sent to its own computing process so far at once, and insert all these rasters into the node-size-balanced binary search tree according to priority. If the tree is not empty, repeat step (2) to update the priority raster. If the tree is empty, execute sub-step seven.

[0071] (7) Message Waiting: The computation process transitions to a waiting phase. During this phase, the computation process waits for message transmissions from neighboring computation processes and for global messages sent by the main process. If a neighboring computation process is transmitting a message, the process returns to step (6) to receive the message. If the main process sends a "continue waiting" message, the waiting phase continues. If the main process sends a "complete all" message, the process sequentially transmits the raster flow direction of each raster in the DEM block it is responsible for to the main process.

[0072] After all computation processes have completed their calculations, the results of the raster flow direction and subsequent steps are summarized in the main process and saved sequentially, thus enabling parallel extraction of high-resolution large-scale river networks.

[0073] In this embodiment, the extraction of the river network may, but is not limited to, employ a search method based on minimum cost. That is, given known river vectors or raster data, thanks to the simplified preprocessing of forced flow direction determination for rasters corresponding to the known data, the raster elevation is the sole priority criterion in the node-size-balanced binary search tree before parallelization. However, as the DEM is divided among various computational processes, a single elevation information cannot fully reconstruct the previous inward flood simulation. The original inward flood simulation essentially ensured that each raster selected and deleted in the node-size-balanced binary search tree strictly adhered to the principle that the maximum elevation value on the optimal confluence path did not decrease. To fully reconstruct the inward flood simulation, after parallelization, both the raster elevation value and the maximum elevation value on the optimal confluence path need to be saved and inserted into the node-size-balanced binary search tree as priority. The specific priority involves three levels of comparison: The first level compares the elevation values, with grids having higher priority if the elevation values ​​are the same. The second level compares the maximum elevation values ​​on the optimal confluence path, with grids having higher priority if the maximum elevation values ​​on the optimal confluence path are lower. Finally, if the second level comparison is the same, the third level compares the location information to ensure that the priority ranking has a definite result if the first two are the same.

[0074] Furthermore, this application describes how, in the process of each computing process performing calculations such as raster flow direction determination for the DEM data blocks it is responsible for, the flow direction information of the edge buffer raster of the DEM block it is responsible for is transmitted to the relevant computing process on demand using a non-blocking communication method, in accordance with the embodiments of this application.

[0075] First, this embodiment of the application can transmit messages between neighbor calculation processes through non-blocking communication and computational update. This is mainly because each DEM block is set as square as possible, so each process has at most 8 neighbor calculation processes, and each grid is adjacent to at most 3 other DEM blocks. Bidirectional message transmission is possible between each neighbor calculation process. Since each calculation process's DEM blocks intersect with each other by only one edge, the message received by each calculation process is only the position information and priority information of the outer grid. Considering that the time when the outer grid is added to the node-size-balanced binary search tree may be slightly delayed or advanced, the priority information needs to take into account the maximum elevation value on the optimal sink path in advance. Therefore, when the outer grid is added to the node-size-balanced binary search tree, both the elevation value and the maximum elevation value on the optimal sink path should be set to the received maximum elevation value on the optimal sink path, so that the maximum elevation value on the optimal sink path becomes the first-level priority comparison for the outer grid.

[0076] Furthermore, a major advantage of MPI parallel computing lies in its non-blocking communication. This allows the message sender to return immediately after issuing a command, proceed directly to subsequent work, and test at any time whether the sent message has been completed; similarly, it allows the message receiver to return immediately after receiving a command, proceed directly to subsequent work, and test at any time whether the received message has been completed. Non-blocking communication allows for overlap between algorithm computation and communication. To minimize the number of communications and reduce communication time, communication between neighboring computation processes employs a buffering mechanism. Messages to be transmitted are first stored in a buffer, and then transmitted only when a certain number are reached, reducing the number of transmissions. This mechanism also allows processes to receive information after a certain period, further reducing the number of receptions and significantly improving running speed.

[0077] While non-blocking communication offers a significant speed improvement, it also introduces message lag. Specifically, the flow direction of a grid within a DEM block may be incorrectly assigned to another grid before the optimal flow path is assigned, as some grids in other computational processes' DEM blocks may have already been correctly identified. Therefore, this embodiment addresses this issue by reassigning grid flow directions to mitigate this lag. Unlike existing river burning algorithms, priority grids removed from a node-size-balanced binary search tree require additional checks on their eight neighboring grids to determine the flow direction of those grids. Based on their own elevation and the maximum elevation value on the optimal flow path, they determine whether pointing neighboring grids' flow directions towards themselves can reduce the maximum elevation value on the neighboring grids' optimal flow paths. If this reduction is successful, the neighboring grids' flow directions are then pointed towards themselves, reassigning the grid flow direction to ensure each grid is assigned the correct flow direction.

[0078] It's important to note that the completion of a computation process's task does not equate to an empty, size-balanced binary search tree with no new messages sent or received. Since each computation process only communicates with its neighboring processes, external non-neighboring processes might update the optimal flow path and reassign flow directions to some grid cells, creating a chain reaction that adds new tasks to temporarily completed processes. Therefore, the main process needs to summarize the progress of all computation processes and provide real-time feedback to those in the waiting phase. A termination command can only be issued when all computation processes are simultaneously in the waiting phase and there is no new information sent or received globally.

[0079] Figure 3 This is a schematic diagram illustrating non-blocking communication and flow reassignment according to an embodiment of this application. Figure 3 As shown, Figure 3 This demonstrates non-blocking communication and grid flow direction reassignment operations during grid flow direction determination. Figure 3 In (a), since computation process 1 has completed the flow direction determination for grid D6, and grid D6 is the edge buffer grid for computation process 3, computation process 1 needs to send the maximum elevation value on the optimal sink path of grid D6 to computation process 3. Due to the characteristics of non-blocking communication, computation process 1, which sends the message, will immediately return to restart the calculation of grid flow direction after the message is sent to the MPI message space, without waiting for computation process 3 to receive the message. Figure 3 In (b), computation process 3 only begins receiving D6 raster information from computation process 1 after several rounds of computation. At this point, computation process 1 is compared to computation process 3. Figure 3 (a) The flow direction determination for grids E6, D7, and D8 has been completed. After the third calculation process receives the information from grid D6, grid D6 will be used as a potential outlet in the third calculation process to update the flow direction of all nearby grids. After the grid flow direction reassignment operation, grids D7, D8, D9, C9, and B9 in the third process are reassigned with grid flow directions, ensuring that each grid is assigned the correct grid flow direction.

[0080] Optionally, in one embodiment of this application, the multiple computing processes are divided into a main process and multiple computing processes. The main process completes the pre-processing tasks of DEM in sequence at the beginning of the program and before the start of parallel computing, and transmits the block DEM and the range of the boundary grid and the known river grid in the block result 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 computing process.

[0081] Based on the descriptions of other embodiments, it is 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 computing processes. When performing parallel computation of grid flow direction, all processes can be distinguished as the main process and computing processes. Specifically:

[0082] All processes are divided into main processes and computation processes. There is only one main process, which is responsible for preliminary work, overall planning, and result collection, such as task allocation before parallel computing begins and result collection after parallel computing ends. The computation processes are all the other processes besides the main process, which are mainly responsible for calculating the raster flow direction and other computational workloads in the DEM blocks they are allocated.

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

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

[0085] The implementation can employ a parallel algorithm structure comprising one main process and several computational processes. Each computational process is assigned a non-overlapping DEM block (excluding edge grids), and each process performs river network extraction calculations, such as grid flow direction determination, on all land grids within its assigned DEM block. However, because the D8 method is used to determine grid flow direction, except for outlets, the flow direction of each grid points to one of its eight surrounding grids. This can lead to grids on the edge of a DEM block potentially pointing to grids outside the current block. Therefore, when determining the flow direction of grids within a DEM block, it is necessary to simultaneously consider the edge buffer grid information surrounding the DEM block.

[0086] Figure 4 This is a schematic diagram of DEM block division according to an embodiment of this application. Figure 4 The diagram illustrates how DEM data is partitioned and allocated into computational domains. Figure 4 (a) shows a 12*12 DEM data divided into four 6*6 DEM raster data computation domains. Each computation process is responsible for calculating the raster flow direction of the remaining land raster within the computation domain. Figure 4 (b) shows the DEM data block received by each computing process from the main process and the raster flow direction information obtained by preprocessing the known river within the data block. For the purpose of subsequent raster flow direction determination, the computing process still needs the edge buffer raster information (gray raster in the figure) around the DEM block 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 can be divided into 11 DEM computational domains of equal size and assigned to 11 computational processes.

[0087] Optionally, in one embodiment of this application, after the parallel computation is completed, each computation process sends a transmission request message to the main process, so as to transmit the computation results in the DEM block allocated to it to the main process after receiving the confirmation transmission message sent by the main process. In this case, after receiving the transmission request message, the main process sends a confirmation transmission message to only one of the computation processes that sent the transmission request message at a time, and sends a confirmation transmission message to the other process after receiving all the computation results of that process.

[0088] In some embodiments, after parallel computation is completed, each computation process can send a transmission request message to the main process. After receiving the confirmation transmission message from the main process, each process transmits the computation results, such as the raster flow direction in the DEM block it was allocated, to the main process.

[0089] After receiving a transmission request message, the main process sends an acknowledgment transmission message to only one of the computation processes that sent the transmission request message at a time. Only after receiving all the computation results from that process does it send an acknowledgment transmission message to the other process, ensuring that only one process is transmitting computation result messages in the MPI communication network and avoiding insufficient MPI communication network space.

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

[0091] Optionally, in one embodiment of this application, when each computing process is calculating the DEM data block it is responsible for, if it involves the edge buffer grid of the DEM block it is responsible for, it collects the flow information of the edge buffer grid as a message to be transmitted and records the neighboring computing process number to which it needs to be sent. After the number of messages to be sent to the neighboring computing process exceeds a preset number, all the information is transmitted to the neighboring computing process.

[0092] During the calculations performed by each computing process on the DEM data blocks under its responsibility, such as determining the raster flow direction, if the edge buffer raster of its own DEM block is involved, its flow direction information is temporarily collected as a message to be transmitted, and the adjacent computing process number to which it needs to be sent is recorded. When the number of messages to be sent to an adjacent computing process exceeds the pre-set number, this information is transmitted to that adjacent computing process all at once using a non-blocking communication method.

[0093] While the algorithm employs non-blocking communication to significantly improve efficiency, it also introduces message lag. Specifically, there's a possibility that when the flow direction of a grid cell in a DEM block is calculated using only the information of that block, it might be pointed to the wrong grid cell because the optimal flow path exists in a DEM block handled by another computation process. Therefore, after obtaining edge grid information from other computation processes, the grid flow direction needs to be reassigned to compensate for the message lag. That is, in the flow direction determination calculation caused by edge grid information updates, when deleting a grid from the node-size-balanced binary search tree, it's necessary to additionally check the grid cells with already determined flow directions among its eight neighboring grid cells; and based on the elevation of the checked grid cell and the maximum elevation value on its existing flow path, determine whether the flow direction of the checked grid cell can be redirected to the grid cell to be deleted, thereby reducing the maximum elevation value on its flow path. If the maximum elevation value can be reduced, then the raster flow direction of the raster to be checked needs to be reassigned to the raster to be deleted, so that each raster that needs to be updated is assigned the correct raster flow direction, so that the algorithm has global awareness of the rivers that cross DEM blocks in different calculation processes.

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

[0095] Figure 5 This is a flowchart illustrating a parallel method for extracting river networks in a distributed memory architecture, according to one embodiment of this application. Figure 5 As shown:

[0096] Step S501: Given the river vector or raster data, force the raster corresponding to the known data to undergo flow direction determination preprocessing.

[0097] Step S502: 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.

[0098] Step S503: Transmit the DEM data block (including edge buffer raster) and known river information that each computing process is responsible for.

[0099] In step S504, each calculation process determines the raster flow direction of the DEM data block it is responsible for.

[0100] In step S505, during the grid flow direction determination process, neighboring grids transmit the flow direction information of the edge buffer grid as needed using a non-blocking communication method.

[0101] Step S506: After the calculation process is completed, the raster flow direction and the calculation results of subsequent steps are summarized into the main process and saved sequentially to achieve high-resolution large-scale river network parallel extraction.

[0102] The parallel method for extracting river networks under a distributed memory architecture proposed in this application can apply parallel computing based on digital elevation model data to river network extraction calculations such as raster flow direction determination, achieving parallel extraction of large-scale high-resolution river networks. This improves computational efficiency while maintaining the original river network accuracy, increases the basin area and / or DEM resolution that the algorithm can handle, and reduces the memory requirements of a single machine. This allows for the structured extraction of raster digital river networks ranging from hundreds of billions to trillions of data points in a single operation. Therefore, this solves the problems in related technologies where river network extraction algorithms struggle to meet the required runtime and memory space when facing the ever-increasing resolution of DEM data with the development of spatial information technology. It also addresses how to restructure and upgrade serial programs to achieve the structured extraction of raster digital river networks ranging from hundreds of billions to trillions of data points in a single operation.

[0103] Next, referring to the accompanying drawings, a parallel apparatus for extracting river networks under a distributed memory architecture is described according to an embodiment of this application.

[0104] Figure 6 This is a schematic diagram of the structure of a parallel device for extracting river networks under a distributed memory architecture, according to an embodiment of this 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 block module 200, and an extraction module 300.

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

[0107] The segmentation module 200 is used to segment the DEM data to be processed into blocks according to the actual scale and shape of the digital elevation model (DEM) data, and obtain the segmentation results.

[0108] The extraction module 300 is used to determine the corresponding raster flow direction based on multiple computing processes, the preprocessing results and the block results in parallel, so as to obtain the river network extraction results. In this process, the flow direction information of the edge buffer raster is transmitted between neighboring DEM data blocks in the DEM data to be processed using a non-blocking communication method according to actual needs.

[0109] Optionally, in one embodiment of this 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 rasters after rasterization, find the rasters located at the DEM boundary and add them to the node-size-balanced binary search tree; the search unit is used to select the known river rasters with the highest priority in the node-size-balanced binary search tree and delete them from the tree.

[0111] The processing unit is used to direct the flow direction of the 8 neighboring rasters of the highest priority known river raster that have never been added to the node-size-balanced binary search tree to the deleted raster, and add the corresponding known river raster to the tree, until all known river rasters have been added to the node-size-balanced binary search tree and deleted, so as to obtain the raster flow direction of all known river rasters and their directly adjacent rasters.

[0112] Optionally, in one embodiment of this application, the multiple computing processes are divided into a main process and multiple computing processes. The main process completes the pre-processing tasks of DEM in sequence at the beginning of the program and before the start of parallel computing, and transmits the block DEM and the range of the boundary grid and the known river grid in the block result 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 computing process.

[0113] Optionally, in one embodiment of this application, after the parallel computation is completed, each computation process sends a transmission request message to the main process, so as to transmit the computation results in the DEM block allocated to it to the main process after receiving the confirmation transmission message sent by the main process. In this case, after receiving the transmission request message, the main process sends a confirmation transmission message to only one of the computation processes that sent the transmission request message at a time, and sends a confirmation transmission message to the other process after receiving all the computation results of that process.

[0114] Optionally, in one embodiment of this application, when each computing process is calculating the DEM data block it is responsible for, if it involves the edge buffer grid of the DEM block it is responsible for, it collects the flow information of the edge buffer grid as a message to be transmitted and records the neighboring computing process number to which it needs to be sent. After the number of messages to be sent to the neighboring computing process exceeds a preset number, all the information is transmitted to the neighboring computing process.

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

[0116] The parallel device for extracting river networks under a distributed memory architecture proposed in this application can apply parallel computing based on digital elevation model data in the river network extraction process, such as raster flow direction determination, under a distributed memory architecture. This enables parallel extraction of large-scale, high-resolution river networks, thereby improving computational efficiency while maintaining the original river network accuracy, increasing the scale of watershed area and / or DEM resolution that the algorithm can handle, and reducing the demand for single-machine memory capacity. This allows for the structured extraction of raster digital river networks ranging from hundreds of billions to trillions of data points in a single operation. Therefore, this solves the problems in related technologies where river network extraction algorithms struggle to meet the required runtime and memory space when facing the ever-increasing resolution of DEM data with the development of spatial information technology. It also addresses how to restructure and upgrade serial programs to achieve the structured extraction of raster digital river networks ranging from hundreds of billions to trillions of data points in a single operation.

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

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

[0119] When the processor 702 executes the program, it implements the parallel method for extracting river networks under a distributed memory architecture provided in the above embodiments.

[0120] Furthermore, electronic devices also include:

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

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

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

[0124] If the memory 701, processor 702, and communication interface 703 are implemented independently, then the communication interface 703, memory 701, and processor 702 can be interconnected via a bus to complete communication between them. 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. Buses can be categorized as address buses, data buses, control buses, etc. For ease of representation, Figure 7 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.

[0125] Optionally, in a specific implementation, if the memory 701, processor 702, and communication interface 703 are integrated on a single chip, then the memory 701, processor 702, and communication interface 703 can communicate with each other through an internal interface.

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

[0127] This application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the parallel method for extracting river networks under a distributed memory architecture as described above.

[0128] This application also provides a computer program product, including a computer program that can run computer instructions. When the computer instructions are executed by a processor, they implement the parallel method for extracting river networks under a distributed memory architecture provided in this application.

[0129] In the description of this specification, the references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of this application. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of different embodiments or examples.

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

[0131] Any process or method described in the flowchart or otherwise herein can be understood as representing a module, segment, or portion of code comprising one or N executable instructions for implementing custom logic functions or processes, and the scope of the preferred embodiments of this application includes additional implementations in which functions may be performed not in the order shown or discussed, including substantially simultaneously or in reverse order depending on the functions involved, as should be understood by those skilled in the art to which embodiments of this application pertain.

[0132] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as a sequenced list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by, or in conjunction with, an instruction execution system, apparatus, or device (such as a computer-based system, a processor-included system, or other system that can fetch and execute instructions from, an instruction execution system, apparatus, or device). For the purposes of this specification, "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transmit programs for use by, or in conjunction with, an instruction execution system, apparatus, or device. More specific examples (a non-exhaustive list) of computer-readable media include: an electrical connection having one or more wires (electronic device), a portable computer disk drive (magnetic device), random access memory (RAM), read-only memory (ROM), erasable and editable read-only memory (EPROM or flash memory), fiber optic devices, and portable optical disc read-only memory (CDROM). Alternatively, the computer-readable medium may be paper or other suitable media on which the program can be printed, since the program can be obtained electronically by optically scanning the paper or other medium, followed by editing, interpreting, or otherwise processing as necessary, and then stored in a computer memory.

[0133] It should be understood that the various parts of this application can be implemented using hardware, software, firmware, or a combination thereof. In the above embodiments, the N steps or methods can be implemented using software or firmware stored in memory and executed by a suitable instruction execution system. If implemented in hardware, as in another embodiment, it can be implemented using any one or more of the following techniques known in the art: discrete logic circuits having logic gates for implementing logical functions on data signals, application-specific integrated circuits (ASICs) having suitable combinational logic gates, programmable gate arrays (PGAs), field-programmable gate arrays (FPGAs), etc.

[0134] Those skilled in the art will understand that all or part of the steps of the methods in the above embodiments can be implemented by a program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, the program includes one or a combination of the steps of the method embodiments.

[0135] Furthermore, the functional units in the various embodiments of this application can be integrated into a processing module, or each unit can exist physically separately, or two or more units can be integrated into a module. The integrated module can be implemented in hardware or as a software functional module. If the integrated module is implemented as a software functional module and sold or used as an independent product, it can also be stored in a computer-readable storage medium.

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

Claims

1. A parallel method for extracting river networks under a distributed memory architecture, characterized in that, Includes the following steps: In a distributed memory architecture, flow direction determination preprocessing is performed on the rasters corresponding to known river vectors or raster data to obtain the preprocessing results. Based on 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 division results; Based on multiple computing processes, the corresponding raster flow direction is determined in parallel according to the preprocessing results and the block results to obtain the river network extraction results. In the DEM data to be processed, the flow direction information of the edge buffer raster is transmitted between neighboring DEM data blocks according to actual needs using a non-blocking communication method. The multi-computation process is divided into a main process and multiple computing processes. At the beginning of the program and before the parallel computing begins, the main process completes the pre-processing tasks of the DEM in sequence, and transmits the block DEM and the range of the boundary grid and the known river grid in the block result 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. During the calculation of the DEM data block under its responsibility, if the edge buffer grid of the DEM block under its responsibility is involved, the flow information of the edge buffer grid is collected as a message to be transmitted, and the adjacent calculation process number to which it needs to be sent is recorded. After the number of messages to be sent to the adjacent calculation process exceeds a preset number, all the information is transmitted to the adjacent calculation process.

2. The parallel method for extracting river networks under a distributed memory architecture according to claim 1, characterized in that, The preprocessing of determining the flow direction of the raster corresponding to the known river vector or raster data, to obtain the preprocessing result, includes: Traverse all known river rasters after rasterization, find the rasters 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; The flow direction of the 8 neighboring rasters of the highest priority known river raster that have never been added to the node-size-balanced binary search tree is pointed to the deleted raster, and the corresponding known river raster is added 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 direction of all known river rasters and their directly adjacent rasters.

3. The parallel method for extracting river networks under a distributed memory architecture according to claim 1, characterized in that, After parallel computation is completed, each computation process sends a transmission request message to the main process to transmit the computation results in the DEM block it was allocated to the main process after receiving the confirmation transmission message sent by the main process. The main process, after receiving the transmission request message, sends the confirmation transmission message to only one of the computation processes that sent the transmission request message at a time, and sends the confirmation transmission message to the other process only after receiving all the computation results of that process.

4. A parallel device for extracting river networks under a distributed memory architecture, characterized in that, The processing module is used to perform flow direction determination preprocessing on the rasters corresponding to the known river vector or raster data under a distributed memory architecture, and obtain the preprocessing results. The segmentation module is used to segment the DEM data to be processed into blocks according to the actual scale and shape of the digital elevation model (DEM) data, and obtain the segmentation results. The extraction module is used to determine the corresponding raster flow direction based on multiple computing processes, in parallel with the preprocessing results and the block division results, to obtain the river network extraction result. In this module, the flow direction information of the edge buffer raster is transmitted between neighboring DEM data blocks in the DEM data to be processed using a non-blocking communication method according to actual needs. The multi-computation process is divided into a main process and multiple computing processes. At the beginning of the program and before the parallel computing begins, the main process completes the pre-processing tasks of the DEM in sequence, and transmits the block DEM and the range of the boundary grid and the known river grid in the block result 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. During the calculation of the DEM data block under its responsibility, if the edge buffer grid of the DEM block under its responsibility is involved, the flow information of the edge buffer grid is collected as a message to be transmitted, and the adjacent calculation process number to which it needs to be sent is recorded. After the number of messages to be sent to the adjacent calculation process exceeds a preset number, all the information is transmitted to the adjacent calculation process.

5. The apparatus according to claim 4, characterized in that, The processing module includes: The traversal cell is used to traverse all known river rasters after rasterization, find the rasters located at the DEM boundary and add them to the node size-balanced binary search tree; The search unit is used to select the highest priority known river grid in the node-size-balanced binary search tree and delete it from the tree. The processing unit is used to direct the flow direction of the 8 neighboring rasters of the highest priority known river raster that have never been added to the node-size-balanced binary search tree to the deleted raster, and add the corresponding known river raster to the tree, until all known river rasters have been added to the node-size-balanced binary search tree and deleted, so as to obtain the raster flow direction of all known river rasters and their directly adjacent rasters.

6. An electronic device, characterized in that, include: A memory, a processor, and a computer program stored in the memory and executable on the processor, the processor executing the program to implement the parallel method for extracting river networks in a distributed memory architecture as described in any one of claims 1-3.

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

8. 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 in a distributed memory architecture as described in any one of claims 1-3.