Large-scale river network gradient correction method

By constructing a directed weighted graph for parallel processing and adaptively smoothing the river network gradient, the problems of poor smoothing effect and low computational efficiency in large-scale river networks are solved, and efficient gradient correction is achieved, which is suitable for large-scale river networks.

CN120672607APending Publication Date: 2025-09-19TSINGHUA UNIVERSITY
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202510758601.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-09
Publication Date
2025-09-19

AI Technical Summary

Technical Problem

Existing technologies have problems in large-scale river network gradient correction, such as poor smoothing effect, difficulty in processing two-dimensional river networks, and low computational efficiency. In particular, when the local fluctuations of DEM are large, negative gradients and abnormal gradients are prone to occur, and existing methods are difficult to apply to large-scale river networks.

Method used

By constructing a directed weighted graph, the path with the largest accumulated weight is automatically searched, a one-dimensional linear vector is derived and adaptively smoothed, and parallel computing is combined to achieve the correction of the river gradient in the entire basin.

Benefits of technology

It realizes automatic correction of multi-starting point parallel gradient of large-scale river network, improves calculation efficiency, reduces negative gradient and abnormal gradient phenomenon, and is suitable for large-scale river network.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120672607A_ABST
    Figure CN120672607A_ABST
Patent Text Reader

Abstract

The invention provides a large-scale river network gradient correction method. The method comprises the steps that S1, a directed weighted graph is constructed according to the upstream and downstream relation of all river reaches in a river network; s2, automatically searching a path which contains an exit node and has the maximum weight accumulation in the graph, exporting the searched path as a one-dimensional linear vector, and removing the one-dimensional linear vector from the graph to obtain a set of sub-graphs and the one-dimensional linear vector; s3, repeating the step S2, performing multi-starting-point parallel traversal processing on each directed weighted graph, realizing river network disassembly, and obtaining a one-dimensional linear vector set; s4, constructing point elements with intervals on each linear vector, sequentially reading the elevation of the DEM grid where the point elements are located according to a spatial inclusion relation, and adaptively smoothing all river reach elevation points in the linear vectors through a sliding window to realize single river channel gradient correction; and S5, adopting a parallel computing mode, and realizing the whole watershed river gradient correction through the steps S2-S4. By adopting the scheme, the multi-starting-point parallel gradient correction of the large-scale river network is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data processing technology, and in particular to a method and device for correcting the gradient of a large-scale river network. Background Art

[0002] Digital river networks not only carry information about the basin's topography and geomorphology but also serve as a fundamental basis for simulating watershed processes, river ecosystems, and the operation of water conservancy projects. Digital river network attributes include upstream and downstream relationships, reach lengths, and gradients. The accuracy of these attributes directly impacts the reliability of related research. The gradient of the river channel, which reflects geomorphic information such as the longitudinal profile of the river channel, serves as a fundamental boundary condition for calculating processes such as river flow movement and sediment erosion and deposition.

[0003] Currently, river network identification methods based on surface runoff still dominate. When extracting river networks, these methods fill the original DEM (Digital Elevation Model) to ensure that all "flows" in the grid converge to the watershed outlet. The river gradient calculated based on the post-filling DEM can have a gradient of zero at the fill site, meaning that the water flows downstream into completely flat "flat land." Alternatively, an abnormally large gradient can appear in a local area downstream of the fill site, creating a sudden "waterfall" phenomenon in the downstream river channel. These drastic changes in gradient can severely distort the calculation of river flow movement and sediment erosion and deposition. The original DEM exhibits significant local fluctuations, often exhibiting negative gradients, meaning that the water surface downstream is higher than upstream. Therefore, it cannot be directly used for calculating river gradients and flow evolution.

[0004] To address this common problem, river network gradient correction is required. The existing relevant technologies are summarized as follows:

[0005] Prior art 1 (CN118736152A A method, device and medium for digital riverbed reconstruction based on DEM, 2024): Convert the vector digital river network into a grid with the same resolution as the DEM; traverse each river grid in turn, and correct the elevation of the river grid through the 8 adjacent non-river grids; after completing the initial correction, perform a secondary correction on the basis of the initial correction to obtain the final river network.

[0006] Prior art 2 (CN116976123A A method for automatic correction of river network elevation, 2023): Perform inverse distance weighted spatial interpolation on river surface vector data to determine riverbed DEM interpolation data; smooth the riverbed DEM interpolation data using a weighted average method; and fuse the smoothed DEM data with the original DEM data for reconstruction.

[0007] Existing technology 3 (Ma Yongyong. Research on river channel topography reconstruction and multi-resolution data fusion methods for hydrodynamic simulation [D]. Xi'an University of Technology, 2023.): Define the river channel boundary and obtain the elevation value of the deep point of the cross section, and reconstruct the river channel topography using multiple smooth interpolation methods and resolutions.

[0008] Existing Technology 4 (Kong Qiao, Han Lu, Liu Xingpo, et al. A method for reconstructing riverbed digital topography using SRTM DEM [J]. Journal of Geo-Information Science, 2021, 23(03): 385-394.): Based on a strong local weighted regression function, for each tributary of the selected river network to the basin outlet river channel, MATLAB was used to read the corresponding DEM elevation data for smoothing. DEM smoothing was completed for three river channels in a small watershed of 24.5 square kilometers.

[0009] When smoothing the DEM grid in the river channel, the existing technologies 1 and 2 only consider the 8 adjacent grid points, and the smoothing is performed at the grid scale. There are two problems: on the one hand, when the local fluctuation of the DEM exceeds the 3×3 window, a negative gradient is still likely to occur when calculating the river section scale gradient; on the other hand, this method does not have directionality when smoothing the DEM data and lacks emphasis on the flow direction.

[0010] Existing technique 3 smooths a one-dimensional linear river channel. However, in the real world, river basins consist of two-dimensional river networks composed of multiple one-dimensional channels. The influx of water and sediment from large tributaries significantly impacts the flow and sediment flow of the main stream. Existing technique 3 lacks the technical means to smooth all river sections in a two-dimensional river network.

[0011] When converting a two-dimensional river network into a one-dimensional river channel, the existing technology 4 adopts the method of traversing all source tributaries to the basin outlet. That is, for each tributary river channel in the two-dimensional river network, the DEM of the main river channel will be repeatedly calculated when DEM smoothing is performed. The calculation amount is large and it is difficult to apply to large-scale and large-scale river networks. Summary of the Invention

[0012] The present application aims to solve one of the technical problems in the related art at least to a certain extent.

[0013] To this end, the first purpose of this application is to propose a method for correcting the gradient of a large-scale river network, which solves the problems of poor smoothing effect, difficulty in processing two-dimensional river networks, and low computational efficiency in existing methods, and realizes automatic correction of the gradient of a large-scale river network with multiple starting points and in parallel.

[0014] The second object of this application is to provide a computer device.

[0015] A third object of the present application is to provide a non-transitory computer-readable storage medium.

[0016] To achieve the above objectives, the first embodiment of the present application proposes a large-scale river network gradient correction method, including:

[0017] Step S1: construct a directed weighted graph based on the upstream and downstream relationships of each river section in the river network;

[0018] Step S2: Automatically search for a path in the directed weighted graph that contains an exit node and has the largest cumulative weight, export the searched path into a one-dimensional linear vector and remove it from the graph, so that the original graph is converted into a collection of subgraphs and one-dimensional linear vectors;

[0019] Step S3: Repeat step S2, traverse and process each directed weighted graph in parallel with multiple starting points to disassemble the river network and obtain a one-dimensional linear vector set;

[0020] Step S4: For each linear vector, a point feature with intervals is constructed on it, and the elevation of the DEM grid where the point feature is located is read in sequence according to the spatial inclusion relationship. The elevation points of all river sections in the linear vector are adaptively smoothed using a sliding window to achieve single river gradient correction;

[0021] Step S5: Using parallel computing, through steps S2-S4, the river gradient correction of the entire basin is realized.

[0022] To achieve the above-mentioned purpose, the second embodiment of the present invention proposes a computer device, including: a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the above-mentioned large-scale river network gradient correction method is implemented.

[0023] In order to achieve the above-mentioned objectives, the third aspect of the present invention proposes a non-temporary computer-readable storage medium, which, when the instructions in the storage medium are executed by a processor, can execute the above-mentioned large-scale river network gradient correction method.

[0024] The large-scale river network gradient correction method and device of the embodiment of the present application first constructs a directed weighted graph based on the upstream and downstream relationship of each river section in the river network. Secondly, the path containing the exit node and the largest cumulative weight value in the graph is automatically searched, and the path with the largest cumulative weight value is derived as a one-dimensional linear vector and removed from the graph. The graph is thus converted into a set of multiple subgraphs and one-dimensional linear vectors. The above process is repeated, and multiple starting points are used to traverse and process each subgraph in parallel until the river network is converted into a set of multiple one-dimensional linear vectors. After that, each one-dimensional linear vector is processed as follows: (1) For each river channel, a point feature is constructed on the vector using an adaptive algorithm, and the elevation of the DEM data where the point feature is located is read in sequence according to the spatial relationship. (2) According to a certain window size, the elevation points of all river sections in the linear vector are adaptively smoothed. (3) All river sections in the river network are traversed, and the river section gradient is corrected according to the river section elevation points, thereby realizing the correction of the gradient of a single river channel. Finally, a parallel computing method is used to simultaneously correct the gradient of multiple river channels to realize the correction of the river channel gradient in the entire basin.

[0025] 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 practice of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] 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:

[0027] Figure 1 A schematic flow chart of a large-scale river network gradient correction method provided in Example 1 of the present application;

[0028] Figure 2 A technical roadmap for the embodiments of this application;

[0029] Figure 3 A schematic diagram of a river network according to an embodiment of the present application;

[0030] Figure 4 This is a schematic diagram of the river network disassembly results of an embodiment of the present application;

[0031] Figure 5 This is a schematic diagram of the effect of single river gradient correction in an embodiment of the present application;

[0032] Figure 6 Schematic diagram comparing the gradients of all river sections before and after correction in the embodiment of the present application. DETAILED DESCRIPTION

[0033] The following describes in detail embodiments of the present application, examples of which 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.

[0034] The following describes the large-scale river network gradient correction method and device of the embodiment of the present application with reference to the accompanying drawings.

[0035] Figure 1 A flow chart of a large-scale river network gradient correction method provided in Example 1 of the present application.

[0036] like Figure 1 As shown in FIG, the large-scale river network gradient correction method includes the following steps:

[0037] Step S1: construct a directed weighted graph based on the upstream and downstream relationships of each river section in the river network;

[0038] In this embodiment, "directed" refers to the upstream and downstream relationship between river sections; "weight" can be parameters such as the length, width, and catchment area of ​​the corresponding river section, which can be intelligently calibrated based on the effect of the gradient calculation. No specific limitation is made here. Since the "weight" is specified, the path selection when splitting the river network is more directional and can be matched with different gradient correction area emphases.

[0039] Step S2: Automatically search for a path in the directed weighted graph that contains an exit node and has the largest cumulative weight, and export the searched path as a one-dimensional linear vector and remove it from the graph, so that the original graph is converted into a collection of subgraphs and one-dimensional linear vectors;

[0040] In this embodiment, an “exit node” refers to a river section in the input digital river network that has no downstream.

[0041] In this embodiment, "one-dimensional linear vector" refers to a one-dimensional vector file containing one or more river sections, which can be an SHP file and is not specifically limited here; "subgraph" refers to the graph retained after the path with the largest cumulative weight value is removed from the original graph. The direction and weight remain unchanged, and only the exit node changes.

[0042] Step S3: Repeat step S2, traverse and process each directed weighted graph in parallel with multiple starting points to disassemble the river network and obtain a one-dimensional linear vector set;

[0043] In this embodiment, when subgraphs still exist after the operation, the above operation is repeated on the subgraphs until all subgraphs are disassembled; the operation on each subgraph is independent, and the parallel computing method is used to optimize the overall computing efficiency.

[0044] Step S4: For each linear vector, a point feature with intervals is constructed on it, and the elevation of the DEM grid where the point feature is located is read in sequence according to the spatial inclusion relationship. The elevation points of all river sections in the linear vector are adaptively smoothed through a sliding window to achieve single river gradient correction;

[0045] In this embodiment, the interval of point elements can be a fixed value or related to the total length of the river; the size of the sliding window can be a fixed value or related to the total length of the river; the weight calculation method during smoothing can be inversely proportional to the distance; the selection of the above methods and the category and value of each parameter are intelligently calibrated according to the effect of the basin river network gradient calculation. The intelligent calibration method can be a genetic algorithm or a convolutional neural network, etc., which is not specifically limited here.

[0046] Step S6: Using parallel computing, through steps S2-S4, the river gradient correction of the entire basin is achieved.

[0047] The large-scale river network gradient correction method of the embodiment of the present application first constructs a directed weighted graph based on the upstream and downstream relationships of each river section in the river network. Secondly, the path containing the exit node and the largest cumulative weight value in the graph is automatically searched, and the path with the largest cumulative weight value is derived as a one-dimensional linear vector and removed from the graph. The graph is thus converted into a set of multiple subgraphs and one-dimensional linear vectors. The above process is repeated, and multiple starting points are used to traverse and process each subgraph in parallel until the river network is converted into a set of multiple one-dimensional linear vectors. After that, each one-dimensional linear vector is processed as follows: (1) For each river channel, a point feature is constructed on the vector using an adaptive algorithm, and the elevation of the DEM data where the point feature is located is read in sequence according to the spatial relationship. (2) According to a certain window size, the elevation points of all river sections in the linear vector are adaptively smoothed. (3) All river sections in the river network are traversed, and the river section gradient is corrected according to the river section elevation points, thereby realizing the correction of the gradient of a single river channel. Finally, a parallel computing method is used to simultaneously correct the gradient of multiple river channels to realize the correction of the river channel gradient in the entire basin.

[0048] This embodiment adopts Figure 2 The technology roadmap shown in Figure 2 As shown in the figure, the first task is to split the river network into independent one-dimensional river channel vectors using graph theory. Finally, the gradient correction of all river sections is completed based on adaptive intelligent smoothing.

[0049] Specifically, if Figure 2 As shown, the process includes:

[0050] 1) River network map construction: Import the river network of the target basin and Figure 3For example, we read the upstream and downstream relationships of each river section. We generate a directed graph based on the upstream and downstream relationships of each river section, assigning equal weights to all river sections. The method used is the NetworkX library in Python.

[0051] 2) River network disassembly: Search all source basins and find the path with the largest cumulative weight from the source basin to the basin outlet. The path with the largest cumulative weight is exported as a one-dimensional linear vector and removed from the graph. The graph is transformed into a collection of multiple subgraphs and one-dimensional linear vectors. A recursive algorithm is used to transform the river network into a collection of multiple one-dimensional linear vectors. The disassembly effect is as follows: Figure 4 shown.

[0052] 3) Intelligent correction of single river gradient: point features are constructed at certain intervals on the vector, and the elevation of the DEM data where the point features are located is read in sequence according to the spatial relationship. The elevation points of all river sections in the linear vector are smoothed in a weighted average manner according to a certain window size. The point feature interval and the sliding window size are fixed values ​​of 12.5m and 1000m respectively. In the sliding average processing, the weight of each point is equal. The effect of single river gradient correction is as follows: Figure 5 As shown, it can be seen that the current parameter combination can meet the requirements of gradient correction (there is no abnormal negative gradient, zero gradient and large gradient). If the current parameter combination does not meet the requirements of gradient correction, an intelligent optimization algorithm such as a genetic algorithm can be used to calibrate the appropriate parameter combination.

[0053] 4) Correction of river gradient for the entire basin: A parallel computing method is used to simultaneously correct the gradient of multiple channels. The number of CPUs used for parallel computing is the minimum of the total number of channels and the number of available CPUs. According to the calculation conditions of this embodiment, 160 is used here, which means that the gradient correction of 160 channels can be processed simultaneously, greatly speeding up the speed of basin-scale river gradient correction. The method used is the multiprocessing library in Python.

[0054] This embodiment completes the gradient correction for the upper reaches of the Qingjian River Basin in the Loess Plateau. The number of river sections in the basin is 3244. A total of 3187 river sections were found to have errors in the gradient and completed the gradient correction. It took about 15 seconds. The gradient distribution before and after the correction is as follows: Figure 6 shown.

[0055] In order to implement the above embodiments, the present invention further proposes a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the method described in the above embodiments is implemented.

[0056] In order to implement the above embodiments, the present invention further proposes a non-transitory computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the method of the above embodiments is implemented.

[0057] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example" or "some examples" 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 expressions of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art can combine and combine different embodiments or examples described in this specification and features of different embodiments or examples without contradiction.

[0058] 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 the technical features being referred to. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of such features. Throughout the description of this application, "plurality" means at least two, for example, two, three, etc., unless otherwise specifically defined.

[0059] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, segment or portion of code comprising one or more 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 be performed out of the order shown or discussed, including performing functions in a substantially simultaneous manner or in the reverse order depending on the functions involved, which should be understood by those skilled in the art to which the embodiments of the present application belong.

[0060] The logic and / or steps represented in the flowcharts or otherwise described herein, for example, can be considered as a sequenced list of executable instructions for implementing the 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 (e.g., a computer-based system, a system including a processor, or other system that can fetch and execute instructions from an instruction execution system, apparatus, or device). For purposes of this specification, a "computer-readable medium" can be any device that can contain, store, communicate, propagate, or transport a program 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 the following: an electrical connection with one or more wires (electronic devices), a portable computer disk cartridge (magnetic device), random access memory (RAM), read-only memory (ROM), erasable and programmable read-only memory (EPROM or flash memory), fiber optic devices, and a portable compact disc read-only memory (CDROM). Furthermore, 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, for example, by optically scanning the paper or other medium and then editing, interpreting or processing it in another suitable manner if necessary, and then storing it in a computer memory.

[0061] It should be understood that various parts of the present application can be implemented using hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented using software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented using hardware, as in another embodiment, any one of the following technologies known in the art or a combination thereof can be used to implement: a discrete logic circuit having a logic gate circuit for implementing a logic function on a data signal, an application-specific integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.

[0062] Those skilled in the art will understand that all or part of the steps in the method of the above embodiment can be completed by instructing related hardware through a program, and the program can be stored in a computer-readable storage medium. When the program is executed, it includes one or a combination of the steps of the method embodiment.

[0063] In addition, the functional units in the various embodiments 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 a 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.

[0064] 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 is understood that the above embodiments are exemplary and should not be construed as limiting the present application. Persons skilled in the art may make changes, modifications, substitutions, and variations to the above embodiments within the scope of the present application.

Claims

1. A large-scale river network gradient correction method, characterized in that: include: Step S1: construct a directed weighted graph based on the upstream and downstream relationships of each river section in the river network; Step S2: Automatically search for a path in the directed weighted graph that contains an exit node and has the largest cumulative weight, export the searched path into a one-dimensional linear vector and remove it from the graph, so that the original graph is converted into a collection of subgraphs and one-dimensional linear vectors; Step S3: Repeat step S2, traverse and process each directed weighted graph in parallel with multiple starting points to disassemble the river network and obtain a one-dimensional linear vector set; Step S4: For each linear vector, a point feature with intervals is constructed on it, and the elevation of the DEM grid where the point feature is located is read in sequence according to the spatial inclusion relationship. The elevation points of all river sections in the linear vector are adaptively smoothed using a sliding window to achieve single river gradient correction; Step S5: Using parallel computing, through steps S2-S4, the river gradient correction of the entire basin is realized.

2. The method according to claim 1, wherein The step S1 specifically includes: Construct a directed graph based on the upstream and downstream relationship of the river section; Determine the weight of each river section and construct a directed weighted graph.

3. The method according to claim 1, wherein The outlet node represents a river section without downstream in the input digital river network.

4. The method according to claim 1, wherein The one-dimensional linear vector is a one-dimensional vector file containing one or more river sections, and the subgraph is the graph retained after the path with the maximum cumulative weight value is removed from the original graph. After removal, the direction and weight remain unchanged, and the exit node changes.

5. The method according to any one of claims 2 to 4, characterized in that: The method further comprises: According to the results of the river network gradient calculation, at least one of the weight of the river section, the interval of the point elements, the size of the sliding window, and the weight calculation method during the smoothing process is adjusted, and the river network gradient is corrected until the optimal value is achieved; The method further comprises: intelligently calibrating the efficiency of the selection of any one of the methods described in claims 1-5 and the types and values ​​of the parameters according to the calculation of the gradient of the river network in the basin.

6. A computer device, characterized in that: The method comprises a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the method according to any one of claims 1 to 5 is implemented.

7. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 5 is implemented.

Citation Information

Patent Citations

  • Backbone river network extraction method based on graph theory and maximum flow algorithm

    CN113191637A

  • Method, system and terminal for analyzing river-lake river network sediment flux space transfer change

    CN116049605A

  • Automatic river network elevation correction method and device, computer equipment and medium

    CN116976123A