Method for simulating flow space distribution of distributed hydrological model based on vector expression

Through a distributed hydrological model based on vector expression, using Python code to process rivers and flow files, and generate flow spatial distribution maps, the problem of insufficient flow space depiction of rivers in the basin is solved, and more accurate flow space distribution is achieved.

CN119783428AActive Publication Date: 2025-04-08CHINA YANGTZE POWER
View PDF 4 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

The traditional lumped model lacks spatial characterization of river flows in the basin, and the distributed hydrological model cannot accurately characterize the spatial distribution of flows, and the existing methods cannot obtain the flow distribution of the entire basin.

Method used

A distributed hydrological model based on vector expression is adopted, and a vector water system diagram is constructed by collecting time-by-time rainfall data, and a river file and flow file are processed using Python code to generate a flow spatial distribution map, and river hierarchical thresholds are adjusted to achieve accurate flow spatial distribution.

Benefits of technology

实现了更准确地展示分布式水文模型流量的空间特征,提高了流量空间展布的准确性。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119783428A_ABST
    Figure CN119783428A_ABST
Patent Text Reader

Abstract

The invention discloses a method for simulating flow space distribution by a distributed hydrological model based on vector expression. The method comprises the following steps: carrying out river network division and river flow simulation on a certain drainage basin by using a VIC model; generating a vector water system graph of the drainage basin according to a river file generated by VIC model river network division and a drainage basin boundary; according to the fusion unit and the river file, constructing a river number file in the vector water system graph of the drainage basin; based on the vector water system graph and a fusion unit, reconstructing the vector water system graph after the topological relation, and generating a list file of the flow corresponding to each numbered river in combination with the output flow file; and calculating the sum of all flow values related to each river, generating and forming an intermediate file, associating the intermediate file with the vector water system graph after the topological relation is reconstructed to obtain a non-standardized drainage basin flow spatial distribution graph, and performing color configuration to finally obtain a standardized drainage basin flow spatial distribution graph. According to the method, the accuracy of flow space distribution can be remarkably improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to a method for simulating flow space distribution by a distributed hydrological model based on vector expression, and belongs to the technical field of watershed simulation. Background Art

[0002] The traditional lumped model is insufficient in describing the spatial flow of rivers in a basin. The distributed hydrological model can not only describe the changes of river flow over time, but also describe the flow of rivers in the basin from a spatial scale. Furthermore, most traditional flow spatial distribution methods are based on raster files to distribute basin flow. This method will have problems such as unclear river distribution and inaccurate flow expression when generating rivers. How to effectively and accurately determine the flow value of each section of the river in the field of flow spatial distribution is a problem worth studying.

[0003] The river network division method based on the fusion of grid and sub-basin of hydrological model (VIC, Variable Infiltration Capacity model) uses high-resolution digital elevation model (Digital Elevation Model) data to extract real river characteristics, determine grid flow direction, and ensure the unity of the confluence path of each grid representing the region. The existing method must first determine the reasonable maximum catchment area point of each grid and use this point as the grid control point. On this basis, the flow direction information generated by the high-precision digital elevation model is used to obtain the range of the grid control unit, and the grid path between the grid control points is obtained, and the path length is used as the length of the river between grids. On the basis of this river network division, the VIC model uses the sub-basin confluence scheme to obtain the sub-basin response function, performs the regulation calculation in the sub-basin, uses the parameterization scheme to obtain the river confluence parameters, substitutes the diffusion wave formula to obtain the river response function, performs the river confluence calculation, and obtains the outlet section flow process. However, the existing technology cannot obtain the flow distribution in the entire basin space, and can only characterize the time evolution law of the flow. Summary of the invention

[0004] The purpose of the present invention is to overcome the shortcomings of the prior art and provide a method for simulating the spatial distribution of flow using a distributed hydrological model based on vector expression. The method of simulating flow using a distributed hydrological model based on vector expression can more accurately display the spatial characteristics of the distributed model flow.

[0005] To achieve the above object, the present invention is implemented by adopting the following technical solutions: The present invention provides a method for spatial distribution of flow simulation using a distributed hydrological model based on vector expression, comprising: Collect hourly rainfall data of a certain basin within a specified time, divide the river network and simulate the river flow of the basin within the specified time based on the distributed hydrological model, and obtain river files, basin boundary files, output flow files and fusion unit flow files; Based on the river file and the basin boundary file, construct a vector water system map of the basin within the specified time; Based on the fusion unit flow file and the river file, construct a river number file in the vector water system map of the basin within the specified time; Based on the river numbering file in the constructed vector water system map and the vector water system map, as well as the output flow file and the fusion unit flow file, a list file of the flow sizes corresponding to the numbered rivers in the vector water system map of the basin within the specified time and a vector water system map after reconstructing the topological relationship are generated; Based on the list file and the vector water system map after reconstructing the topological relationship, an intermediate file that can be associated with the vector water system map is generated, and the vector water system map after reconstructing the topological relationship is associated with the intermediate file to obtain a non-standardized flow spatial distribution map of the watershed within the specified time; According to the flow size within the specified time, the river classification threshold is adjusted to obtain a standardized flow spatial distribution map of the basin within the specified time.

[0006] Preferably, constructing the vector water system map of the watershed within the specified time based on the river file and the watershed boundary file is implemented based on Python code and includes: Read the ASC format raster data array of the river file; Traversing the raster data array, identifying adjacent cells with the same value, and converting the coordinates of these cells into line objects; The extracted line objects are saved in Shapefile format to obtain a vector water system map of the watershed within the specified time.

[0007] Preferably, during the traversal process, a breadth-first search algorithm is used to find connection paths between grids of the same value to ensure that the extracted lines are continuous; and boundary points of the lines are identified, and boundary and angle checks are performed to ensure that the lines conform to the actual conditions of the geographical features.

[0008] Preferably, the step of constructing a river number file in the vector water system map of the basin within the specified time based on the fusion unit flow file and the river file is implemented based on Python code and includes: Read the river segments in the river file and the fused unit grids in the fused unit flow file, and define a data processing function to convert the data of a specific field into a long integer suitable for calculation; Calculate the distance between the starting and ending points of the river segment and each fusion unit grid point, find the grid point with a distance less than the set limit as the best match, and generate the river number file in the vector water system map.

[0009] Preferably, the vector water system map after reconstructing the topological relationship includes: Read the attribute table and the first and last node coordinates of each shape in the vector water system map, and generate a dictionary containing unique node IDs, with the longitude and latitude of the node as the key; Starting from the designated outflow node, the topological relationship of the river is constructed upward using the breadth-first search algorithm; After the topology reconstruction is completed, the updated data is exported to a CSV file, and the attribute table of the vector water system map is updated at the same time to obtain the vector water system map after the topology relationship is reconstructed.

[0010] Preferably, the step of generating a list file of the flow rates of the numbered rivers in the vector water system diagram of the basin within the specified time period includes: Based on the output flow file, obtaining flow data of the watershed within the specified time; Based on the unique node ID of the river in the attribute table of the vector water system map after the topological relationship is reconstructed, the river number is obtained from the river number file; The river numbers are matched with the flow data to generate a list file of the flow sizes corresponding to the numbered rivers in the vector water system diagram of the basin within the specified time.

[0011] Preferably, based on the list file and the vector water system map after reconstructing the topological relationship, an intermediate file that can be associated with the vector water system map is generated, and the vector water system map after reconstructing the topological relationship is associated with the intermediate file to obtain a non-standardized flow spatial distribution map of the basin within the specified time, which is implemented based on Python code and includes: Read the river number file and the list file, and create a dictionary from river numbers to corresponding flow values; Traverse the dictionary, calculate the sum of all flow values ​​associated with each river, and store the result in a new column Q; Read the vector water system map after the topological relationship is reconstructed, extract the shape and record information, and create a new Shapefile file, copy the field definition in the vector water system map after the topological relationship is reconstructed and add a new field Q for storing the calculated flow value, so as to form an intermediate file; The vector water system map records, shapes and calculated flow values ​​after the reconstructed topological relationship are traversed, each calculated flow value is appended to the record, and these records and shape information are written into a newly created Shapefile file to generate a non-standardized flow spatial distribution map of the basin within the specified time.

[0012] Preferably, the adjusting the river classification threshold according to the flow size within the specified time to obtain a standardized flow spatial distribution map of the river basin within the specified time includes: According to the flow size within the specified time, the river classification threshold is adjusted, and the river classification color and picture background color are set using the standard river classification color setting file and the picture background color setting file to obtain a standardized flow spatial distribution map of the basin within the specified time.

[0013] Compared with the prior art, the present invention has the following beneficial effects: The present invention proposes a method for spatial distribution of flow simulation using a distributed hydrological model based on vector expression. Based on the river flow simulated by the VIC (Variable Infiltration Capacity) model, the relevant files generated by the model are reanalyzed using relevant Python code, and the original digitized flow and river information is displayed in the form of a vector water system map using hydrological analysis tools, which not only reflects the advantages of the distributed model in simulating the flow spatial scale, but also displays the flow process of the basin outlet section flow over time. BRIEF DESCRIPTION OF THE DRAWINGS

[0014] Figure 1 A flow chart of a method for simulating spatial distribution of flow using a distributed hydrological model based on vector expression provided in an embodiment of the present invention; Figure 2 It is a diagram showing the confluence solution of the VIC (Variable Infiltration Capacity) model in an embodiment of the present invention; Figure 3 This is a schematic diagram of the flow space distribution in an embodiment of the present invention without using the deployment method provided by the present invention; Figure 4 This is a schematic diagram of the spatial distribution of flow in a flood process using the deployment method provided by the present invention in an embodiment of the present invention. DETAILED DESCRIPTION

[0015] The specific implementation of the present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. The embodiments described below with reference to the accompanying drawings are illustrative and intended to be used to explain the present invention, but should not be construed as limiting the present invention.

[0016] It should be noted that the term "one embodiment" or "embodiment" of the present invention refers to a specific feature, structure or characteristic that can be included in at least one implementation of the present invention. The term "in one embodiment" that appears in different places in this specification does not refer to the same embodiment, nor is it a separate or selective embodiment that is mutually exclusive with other embodiments.

[0017] It should be emphasized here that the step marks mentioned below are not intended to limit the order of the steps, but it should be understood that the steps can be executed in the order mentioned in the embodiment, or in a different order from the embodiment, or several steps can be executed simultaneously. Example 1

[0018] like Figure 1 As shown, this embodiment 1 provides a method for simulating flow spatial distribution based on a distributed hydrological model expressed in vectors, including: S01: Based on the national digital elevation model with a spatial resolution of 30 meters, the VIC (Variable Infiltration Capacity) model is used to divide the river network and simulate the river flow in a certain basin at a specified time, and obtain the river (Basin_river.asc) file, basin boundary (Area.shp) file, output flow (Discharge.nc) file and fused unit flow (Q.csv) file; S02: Generate a vector water system map (River2.shp) of the basin using Python code (Raster_to_polyline.py) based on the river file and basin boundary file generated by the VIC model; S03: Based on the fused unit flow file and river file generated by the VIC model, use Python code (Gridcode_link.py) to construct the river number (Basin_up_river.csv) file in the vector water system map of the basin; S04: Based on the river number file and vector water system map in the vector water system map of the basin constructed above, and based on the output flow (Discharge.nc) file and fused unit flow (Q.csv) file generated by the VIC (Variable Infiltration Capacity) model, a Python code (Reconstrct_River_Topo.py) is used to generate a list (River_codelist2.csv) file of the flow size of each numbered river in the vector water system map at a specified time and a vector water system map (river_updated2.shp) after reconstructing the topological relationship; S05: Based on the list file of the flow size of each numbered river in the vector water system map of the watershed at the specified time generated above and the vector water system map after the topological relationship is reconstructed, use Python code (Add_River_Q.py) to generate an intermediate file (River_matchgrid.csv) that can be associated with the vector water system map, and associate the vector water system map after the topological relationship is reconstructed with the intermediate file to output the non-standardized flow spatial distribution map (Q.shp) of the watershed at the specified time; S06: Adjust the river classification threshold according to the flow size at the specified time. Set the river classification color and the image background color to obtain a standardized flow spatial distribution map of the basin at the specified time (Q_2020_8_15_00.shp).

[0019] The method based on the flow spatial distribution method in the embodiment of the present invention can more accurately display the spatial characteristics of the distributed hydrological model flow and improve the accuracy of the flow spatial distribution.

[0020] In a specific implementation of the embodiment of the present invention, in step S01, the specific steps include: S011: Collect hourly rainfall data of a certain basin within a specified period of time and pre-process the data to make it meet the input requirements of the VIC model, determine the basin boundary, and use hydrological processing tools to process the basin digital elevation model information.

[0021] S012: Run the VIC model to collect output files, namely the river (Basin_river.asc) file, basin boundary (Area.shp) file, output flow (Discharge.nc) file, and fused unit flow (Q.csv) file, so that the subsequent Python code can be run.

[0022] In a specific implementation of the embodiment of the present invention, in step S02, the specific implementation process is as follows: This step is based on Python code (Raster_to_polyline.py). The specific operation is to convert the ASC format raster data of the river (Basin_river.asc) file into the Shapefile format line data. Specifically, first read the ASC format raster data of the river (Basin_river.asc) file through the read_asc_file function, and use NumPy arrays for efficient data processing. Then use the array_to_lines_and_nodes function to traverse the raster data array, identify adjacent cells with the same value, and convert the coordinates of these cells into line objects. In this process, the trace_path function uses the breadth-first search (BFS) algorithm to find the connection path between rasters with the same value to ensure that the extracted lines are continuous. At the same time, the get_boundary_points function is used to identify the boundary points of the line, and the boundary and angle checks are performed to ensure that the line conforms to the actual situation of the geographical features. Finally, the save_lines_to_shapefile function is used to save the extracted lines in Shapefile format to obtain the vector water system map of the basin (River2.shp).

[0023] In a specific implementation of the embodiment of the present invention, in step S03, the specific implementation process is as follows: This step is implemented based on Python code (Gridcode_link.py). The specific operation is to match the river segment with the fused unit grid by calculating the distance. First, the CSV function library is used to read the CSV file of the river segment and fused unit grid generated by the VIC (Variable InfiltrationCapacity) model, and the data of the specific field is converted into a long integer suitable for calculation by defining the data processing function. Then, the function find_matching_grid_codes is used to calculate the distance between the starting point and the end point of the river segment and each fused unit grid point according to the given distance limit, and find the grid point with a distance less than the set limit as the best match. The whole process is designed to ensure that the best match between the river segment and the fused unit grid is found within a certain distance range, avoid incorrect matching, and finally generate a river number CSV file that is convenient for subsequent analysis and use.

[0024] In a specific implementation of the embodiment of the present invention, in step S04, the specific implementation process is as follows: S041: This step is implemented based on Python code (Reconstrct_River_Topo.py). The specific operation is to read geographic data in Shapefile format, use the Pandas library for data processing and analysis, and use the Tqdm library to display the processing progress. First, read the attribute table and the first and last node coordinates of each shape in the vector water system map (River2.shp), and then generate a dictionary containing unique node IDs, with the longitude and latitude of the node as the key. Next, starting from the specified outflow node (the longitude and latitude coordinates of the basin outlet section), the topological relationship of the river is constructed upward using the breadth-first search (BFS) algorithm. After completing the topological reconstruction, export the updated data to a CSV file, and update the attribute table of the vector water system map (River2.shp). The whole process includes reading Shapefile, generating unique node ID, building topological relationship, updating Shapefile attributes and exporting CSV. The function of the code is to reconstruct the topological structure of the rivers in the study area and obtain the updated vector water system map of a certain basin at a specified time (river_updated2.shp) for subsequent analysis and use.

[0025] S042: Based on the river numbering (Basin_up_river.csv) file in the study area vector water system map and the river unique node ID, topological relationship and flow size in the attribute table of the updated vector water system map of a certain basin at a specified time (river_updated2.shp), a list of the flow sizes corresponding to each numbered river can be obtained (River_codelist2.csv) file.

[0026] In a specific implementation of the embodiment of the present invention, in step S05, the specific implementation process is as follows: This step is implemented based on Python code (Add_River_Q.py). The specific operation is to extract the flow value from the list (River_codelist2.csv) file and integrate it into the Shapefile geographic data file of the river. The principle is to first read the river number (Basin_up_river.csv) file containing the matching information of the river and the fusion unit grid and the (River_codelist2.csv) file containing the river number and its corresponding flow value through the pandas library, and then create a dictionary corresponding to the number to the flow value for easy search. Then, use the tqdm library to display the progress bar, traverse the dictionary of matching information, calculate the sum of all flow values ​​related to each river, and store the result in a new column Q. After that, use the Shapefile library to read the vector water system map (river_updated2.shp) after the topological relationship is reconstructed, extract its shape and record information, and create a new Shapefile, copy the original field definition and add a new field Q to store the calculated flow value. Finally, the original records, shapes, and calculated Q values ​​are traversed, the Q value of each record is appended to the record, and these records and shape information are written to a new Shapefile to generate a non-standardized spatial flow distribution map (Q.shp) for the specified time in the basin.

[0027] In a specific implementation of the embodiment of the present invention, in step S06, the specific implementation method is: According to the flow size at the specified time, adjust the river classification threshold. At the same time, use the standard river classification color setting (Png_color_Q.ini) file and the picture background color setting (Bak_color_Q.ini) file to set the river classification color and picture background color, and obtain a standardized flow spatial distribution map of a certain river basin at a specified time (Q_2020_8_15_00.shp). Example 2

[0028] Based on the inventive concept of the above embodiment 1, this embodiment 2 adopts the method of the above embodiment 1 to take the Jialing River Basin (Tingzikou-Beibei section) as the example study area, and takes 0:00 on August 15, 2020 as the selected time of the method. The specific implementation process is as follows: First, the VIC (Variable Infiltration Capacity) model is used to divide the river network of a certain basin, including obtaining the flow direction and cumulative flow of the basin grid points based on the high-resolution digital elevation model, and determining the maximum catchment area point of the large grid based on the cumulative flow as the grid control point. The grid control point is used to search for the next control point downstream and judge the distance between the two control points. 0.5 times the grid length is used as the judgment standard to eliminate the control points that cannot represent the main catchment area of ​​the grid. If it is greater than 0.5 times the large grid length, it is considered to be a valid downstream grid control point, and the length of the confluence path between the two control points is the river distance between the two grids; otherwise, the downstream grid control point is replaced with a secondary control point, and the search continues downstream until the conditions are met. Using the control points and grid flow direction file of the final grid, search downstream until the first downstream grid control point is found, and the grid where the grid control point is located is the downstream grid of the grid. Using the control points and grid flow direction file of the finalized grid, search downstream until the first downstream grid control point is found. The grid where the grid control point is located is the downstream grid of the grid. The river distance between grids has been obtained in the first step. According to the position of the grid control point, the elevation of each grid control point is obtained from the high-resolution digital elevation model data, which represents the elevation of the entire grid. Sort the cumulative area of ​​the control point confluence from small to large, and search the upstream catchment area of ​​each control point in turn until the boundary or upstream control point is found. In this way, the catchment area and control area of ​​each control point can be obtained.

[0029] Then, according to the river (Basin_river.asc) file and basin boundary (Area.shp) generated by the VIC (Variable Infiltration Capacity) model river network division, the Python code (Raster_to_polyline.py) was used to construct the vector water system map (River2.shp) of the study area. Based on the flow (Discharge.nc) file output by the VIC (Variable Infiltration Capacity) model, the flow data of a certain basin outlet section within a specified time can be obtained. The Python code (Gridcode_link.py) was used to obtain the number (Basin_up_river.csv) file corresponding to each river in the vector water system map (River2.shp file) according to the river (Basin_river.asc) file.

[0030] Then, according to the fusion unit file generated by the VIC (Variable Infiltration Capacity) model, the river number (Basin_up_river.csv) file in the basin and the river flow data, the Python code (Reconstrct_River_Topo.py) was used to construct a list (River_codelist2.csv) file of the flow size corresponding to each numbered river in the vector water system map at the specified time, and a vector water system map (river_updated2.shp) with reconstructed topological relationship was generated.

[0031] Use Python code (Add_River_Q.py) to generate an intermediate (River_matchgrid.csv) file that can be associated with the vector water system map (river_updated2.shp) after reconstructing the topological relationship, and associate the vector water system map (river_updated2.shp) after reconstructing the topological relationship with the intermediate (River_matchgrid.csv) file to output a non-standardized flow spatial distribution map (Q.shp).

[0032] Finally, adjust the river classification threshold according to the flow size at the specified time. Set the river classification color and the image background color to obtain a standardized flow spatial distribution map (Q_2020_8_15_00.shp).

[0033] like Figure 2 The figure shows the principle of river network division of the VIC (Variable Infiltration Capacity) model in step S1 of this embodiment, indicating that the present invention performs subsequent flow distribution work on the basis of flow simulation by the distributed hydrological model - VIC (Variable Infiltration Capacity) model.

[0034] like Figure 3 and Figure 4 The figure shows the spatial distribution diagram of traffic flow when this method is adopted. Figure 3 This is the spatial distribution of flow without using the method of the present invention. Through the local enlarged image, it can be found that there will be unequal flow in a section of the river (that is, different colors). Figure 4 The spatial distribution of flow after the use of the present invention shows the flood process in the Jialing River Basin (Tingzikou-Beibei section) on August 15, 2020. Since the present invention adopts a code integration method, it can not only quickly generate the spatial distribution of flow in the study area at each moment, but also solve the problem of unequal river flow.

[0035] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.

[0036] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0037] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0038] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0039] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the above embodiments, ordinary technicians in the relevant field should understand that the specific implementation methods of the present invention can still be modified or replaced by equivalents. Any modification or equivalent replacement that does not depart from the spirit and scope of the present invention should be covered within the scope of protection of the claims of the present invention.

Claims

1. A method for simulating flow spatial distribution using a distributed hydrological model based on vector expression, characterized in that: include: Collect hourly rainfall data of a certain basin within a specified time, divide the river network and simulate the river flow of the basin within the specified time based on the distributed hydrological model, and obtain river files, basin boundary files, output flow files and fusion unit flow files; Based on the river file and the basin boundary file, construct a vector water system map of the basin within the specified time; Based on the fusion unit flow file and the river file, construct a river number file in the vector water system map of the basin within the specified time; Based on the river numbering file in the constructed vector water system map and the vector water system map, as well as the output flow file and the fusion unit flow file, a list file of the flow sizes corresponding to the numbered rivers in the vector water system map of the basin within the specified time and a vector water system map after reconstructing the topological relationship are generated; Based on the list file and the vector water system map after reconstructing the topological relationship, an intermediate file that can be associated with the vector water system map is generated, and the vector water system map after reconstructing the topological relationship is associated with the intermediate file to obtain a non-standardized flow spatial distribution map of the watershed within the specified time; According to the flow size within the specified time, the river classification threshold is adjusted to obtain a standardized flow spatial distribution map of the basin within the specified time.

2. According to the method of claim 1, the method of simulating flow spatial distribution by a distributed hydrological model based on vector expression is characterized in that: The constructing of the vector water system map of the watershed within the specified time based on the river file and the watershed boundary file is implemented based on Python code and includes: Read the ASC format raster data array of the river file; Traversing the raster data array, identifying adjacent cells with the same value, and converting the coordinates of these cells into line objects; The extracted line objects are saved in Shapefile format to obtain a vector water system map of the watershed within the specified time.

3. The method for simulating flow spatial distribution using a distributed hydrological model based on vector expression according to claim 2 is characterized in that: During the traversal process, a breadth-first search algorithm is used to find connection paths between grids with the same value to ensure that the extracted lines are continuous; and boundary points of the lines are identified, and boundary and angle checks are performed to ensure that the lines conform to the actual situation of the geographical features.

4. The method for simulating flow spatial distribution using a distributed hydrological model based on vector expression according to claim 1 is characterized in that: The step of constructing a river number file in the vector water system map of the watershed within the specified time based on the fusion unit flow file and the river file is implemented based on Python code and includes: Read the river segments in the river file and the fused unit grids in the fused unit flow file, and define a data processing function to convert the data of a specific field into a long integer suitable for calculation; Calculate the distance between the starting and ending points of the river segment and each fusion unit grid point, find the grid point with a distance less than the set limit as the best match, and generate the river number file in the vector water system map.

5. The method for simulating flow spatial distribution using a distributed hydrological model based on vector expression according to claim 1 is characterized in that: The vector water system map after reconstructing the topological relationship includes: Read the attribute table and the first and last node coordinates of each shape in the vector water system map, and generate a dictionary containing unique node IDs, with the longitude and latitude of the node as the key; Starting from the designated outflow node, the topological relationship of the river is constructed upward using the breadth-first search algorithm; After the topology reconstruction is completed, the updated data is exported to a CSV file, and the attribute table of the vector water system map is updated at the same time to obtain the vector water system map after the topology relationship is reconstructed.

6. The method for simulating flow spatial distribution using a distributed hydrological model based on vector expression according to claim 5 is characterized in that: The generating of a list file of the flow size corresponding to each numbered river in the vector water system diagram of the basin within the specified time includes: Based on the output flow file, obtaining flow data of the watershed within the specified time; Based on the unique node ID of the river in the attribute table of the vector water system map after the topological relationship is reconstructed, the river number is obtained from the river number file; The river numbers are matched with the flow data to generate a list file of the flow sizes corresponding to the numbered rivers in the vector water system diagram of the basin within the specified time.

7. The method for simulating flow spatial distribution using a distributed hydrological model based on vector expression according to claim 1 is characterized in that: The method of generating an intermediate file that can be associated with the vector water system map based on the list file and the vector water system map after the topological relationship is reconstructed, and associating the vector water system map after the topological relationship is reconstructed with the intermediate file to obtain a non-standardized flow spatial distribution map of the watershed within the specified time is implemented based on Python code, including: Read the river number file and the list file, and create a dictionary from river numbers to corresponding flow values; Traverse the dictionary, calculate the sum of all flow values ​​associated with each river, and store the result in a new column Q; Read the vector water system map after the topological relationship is reconstructed, extract the shape and record information, and create a new Shapefile file, copy the field definition in the vector water system map after the topological relationship is reconstructed and add a new field Q for storing the calculated flow value, so as to form an intermediate file; The vector water system map records, shapes and calculated flow values ​​after the reconstructed topological relationship are traversed, each calculated flow value is appended to the record, and these records and shape information are written into a newly created Shapefile file to generate a non-standardized flow spatial distribution map of the basin within the specified time.

8. The method for simulating flow spatial distribution using a distributed hydrological model based on vector expression according to claim 1 is characterized in that: The step of adjusting the river classification threshold according to the flow rate within the specified time to obtain a standardized flow spatial distribution map of the river basin within the specified time includes: According to the flow size within the specified time, the river classification threshold is adjusted, and the river classification color and picture background color are set using the standard river classification color setting file and the picture background color setting file to obtain a standardized flow spatial distribution map of the basin within the specified time.

Citation Information

Patent Citations

  • An area and drainage basin data programmed extraction method oriented to raster data

    CN109902115A

  • Distributed hydrological model-based flood forecasting method for small reservoirs in watershed lacking data

    CN118821363A

  • Distributed hydrological simulation method and device based on Xinanjiang model and medium

    CN118862732A

  • Scheduling method and system for operation of reservoirs to recharge freshwater for repelling saltwater intrusion under changing conditions

    US20240256746A1