River network hydrodynamic model construction method and system based on large language model reasoning

By introducing a large language model to the construction of river network hydrodynamic model, the river network topology structure and identifying water conservancy projects are automatically extracted, and the problems of low efficiency and poor adaptability of traditional methods are solved, and the intelligent construction and efficient automation of river network hydrodynamic model are realized.

CN119918469AActive Publication Date: 2025-05-02NANJING HYDRAULIC RES INST

Patent Information

Application Number
CN202510413230.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-03
Publication Date
2025-05-02
Estimated Expiration
2045-04-03

AI Technical Summary

Technical Problem

The construction of traditional river network hydrodynamic model relies on manual extraction of river network topology, which is inefficient and cannot automatically generate topological relationships, resulting in long modeling cycles and poor adaptability.

Method used

Using a method based on a large language model, the DEM data is filled and flow direction matrix is ​​generated by integrating GIS programs, the confluence accumulation is automatically analyzed, the river network grid is extracted, and the river channel spatial distribution and water conservancy projects are analyzed through the large language model, and the topological relationship diagram is generated, and the river network hydrodynamic model is finally automatically generated.

Benefits of technology

The intelligent construction of the river network hydrodynamic model has been realized, the modeling efficiency has been improved, manual intervention has been reduced, and the adaptability and automation of the model has been enhanced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119918469A_ABST
    Figure CN119918469A_ABST
Patent Text Reader

Abstract

The invention discloses a river network hydrodynamic model construction method and system based on large language model reasoning, and belongs to the technical field of hydrological modeling and artificial intelligence crossing, and the method comprises the steps: carrying out the filling of original DEM data, and calculating a water flow direction matrix; iteratively calculating and analyzing the optimal confluence cumulant, and extracting a river network grid; outputting a river network grid of a specified level through an instruction of specifying the level of the output river network; coding the river network grids into a format described by a natural language to train a large language model; analyzing the spatial distribution of the river channel through a large language model, and generating a topological structure diagram containing nodes and directed edges; identifying a water conservancy project through a large language model, and generating a water conservancy project object and position information thereof; according to the river network hydrodynamic model construction method and system based on large language model reasoning, the problems that a traditional method depends on manual intervention and is low in modeling efficiency are solved, and high technical innovation and practical application value are achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the cross-technical field of hydrological modeling and artificial intelligence, and specifically relates to a method and system for constructing a river network hydrodynamic model based on large language model reasoning. Background Art

[0002] The construction of traditional river network hydrodynamic models relies on manual extraction of river network topological structures, which is inefficient. In existing methods, river network extraction based on DEM data usually requires manual setting of runoff accumulation thresholds, and cannot automatically generate topological relationships, resulting in a long modeling cycle and poor adaptability. In addition, the generation of river network hydrodynamic model files relies on manual configuration, and the modeling work is cumbersome. Therefore, it is necessary to develop a new river network hydrodynamic model construction method and system based on large language model reasoning to solve existing problems. Summary of the invention

[0003] The purpose of the present invention is to provide a method and system for constructing a river network hydrodynamic model based on large language model reasoning to solve the above-mentioned problems.

[0004] To achieve the above object, the present invention provides the following technical solution: a method for inferring water system topology and automatically constructing a river network hydrodynamic model based on a large language model, comprising the following steps: Step S1: Integrate the GIS program through the large language model, fill the original DEM data, generate the water flow direction matrix based on the D8 algorithm, perform the optimal confluence accumulation analysis through the large language model, and extract the river network grid; specify the level of the output river network through the command, and output the river network grid of the specified level; Step S2: Encode the river network grid into a natural language description structure and train a large language model; Step S3: parsing the spatial distribution of the river channel through the trained large language model to generate a topological relationship graph containing nodes and directed edges; Step S4: integrating the image recognition function through the large language model, identifying the water conservancy project, generating water conservancy project objects such as reservoirs and sluice gates and the location information of the water conservancy project objects; Step S5: using the large language model to superimpose the topological relationship diagram of step S3 and the water conservancy project objects and the location information of the water conservancy project objects in step S4, and inferring the final river network topological structure; Step S6: according to the target river network hydrodynamic model specification, convert the final river network topology into a structured configuration file and output it; Step S7: converting the data into a model input format according to the target river network hydrodynamic model specification; Step S8: Automatically generate the final river network hydrodynamic model according to the configuration file and model input format.

[0005] Preferably, the encoding method for encoding the river network grid into a natural language description structure in step S2 is: converting the position (x, y), flow direction, and cumulative runoff of each river unit into key-value pair text, and the flow direction is 8-direction encoding; specific format example: {"ID":1, "x":1024,"y":768,"direction":NE,"accumulation":150,"neighbors": [{"ID": 2,"relative_position":"E"},{"ID": 6, "relative_position":"SE"},{"ID": 7, "relative_position": "NE"}].

[0006] Preferably, the step S3 analyzes the spatial distribution of the river channel through a large language model to generate a topological relationship diagram containing nodes and directed edges, including: identifying river network intersections as topological nodes, and judging the upstream and downstream connection relationship of the river channel section through the water flow direction matrix; performing logical verification on isolated river channel sections, and if they are not connected to the main river channel, marking abnormal paths and triggering manual review reminders.

[0007] Preferably, the image recognition in step S4 includes: through the input high-resolution satellite image, the large language model automatically identifies the water conservancy projects therein, such as reservoirs, sluices, etc., and for each identified facility, classifies it and outputs the corresponding water conservancy object and its specific geographical location. For example, the types of water conservancy facilities include reservoirs and sluices.

[0008] Preferably, the results of superimposing step S3 and step S4 using the large language model in step S5 include: the large language model superimposes water conservancy objects and their specific geographical locations on the basis of the original river network topology, reflects how facilities such as reservoirs and gates affect the water flow path, and generates the final river network topology.

[0009] Preferably, the conversion into a structured configuration file in step S6 includes: generating a river network structure file based on a topological relationship; automatically generating a cross-section distribution based on a river channel length and a preset cross-section spacing; converting cross-section morphological parameters into a model cross-section file; the cross-section morphological parameters include a bottom width and a slope coefficient.

[0010] Preferably, the step S7 of converting the data into a model input format includes: generating a boundary condition time series file based on historical hydrological data, such as water level data, flow data, water level-flow relationship curve, etc.

[0011] Preferably, the automatic generation of the final river network hydrodynamic model in step S8 includes: based on the configuration file and the target river network hydrodynamic model input file, calling the target river network hydrodynamic model execution program to automatically generate the final river network hydrodynamic model.

[0012] Preferably, the generating of the river network structure file according to the topological relationship comprises: a dat file of the river network consisting of node numbers, including the river section number, the upstream node number, the downstream node number, and the large language model outputting the topological structure inferred according to the text file; Automatically generate section distribution based on river length and preset section spacing, including: According to the length of the river channel and the set section spacing, the large language model calculates the number of sections and forms a dat file containing the section number and section spacing; Converting the cross-section morphological parameters into model cross-section files includes: the original cross-section parameters are in Excel format, which are converted into DAT format that can be read by the river network hydrodynamic model; Automatically generating input files for boundary condition parameters includes: using a large language model to convert Excel, CSV and other table files into DAT format, and the boundary condition parameters include: time series such as water level flow data.

[0013] Preferably, the step S6 converts the final river network topology into a structured configuration file and outputs it according to the target river network hydrodynamic model specification, wherein a rule engine is set according to the format requirements of the target river network hydrodynamic model, and the upstream and downstream boundary identifiers of the river network hydrodynamic model are automatically assigned according to the node connection sequence in the topological relationship, and a configuration file that conforms to the format of the target river network hydrodynamic model is generated; the specific method includes: generating files and converting the formats through a large language model to generate a text file in txt or dat format, and only the format requirement instructions for the large language model conversion need to be given, wherein the rule engine refers to the requirements and instructions for the target file format; the conversion code is a commonly used python file generation code, which is automatically generated by the large language model, and can be directly implemented by the current mainstream large language models; The present invention further provides a river network hydrodynamic model construction system based on large language model reasoning, comprising the following modules: DEM processing module: fills the original digital elevation model data, calculates the water flow direction matrix based on the D8 algorithm, and generates the river network grid according to the dynamically optimized confluence accumulation threshold; Topological reasoning module: Receives river network data, analyzes the spatial distribution of rivers through a pre-trained large language model, receives high-definition satellite images, identifies water conservancy projects such as reservoirs and sluices through integrated image recognition functions, generates a topological relationship diagram containing nodes and edges, and outputs a visualized topological structure; nodes include: source, intersection, water conservancy project; edges are river sections; River network hydrodynamic model generation module: According to the target river network hydrodynamic model specifications, the topological relationship is converted into a structured configuration file, including river channel parameters, boundary conditions and cross-section distribution files.

[0014] Preferably, the DEM processing module optimizes parameters through a dynamic feedback mechanism, specifically: based on the resolution of the digital elevation model, the terrain type and historical experience, the initial convergence accumulation threshold range is generated by the large language model; the threshold is iteratively adjusted using a heuristic method, and the threshold intelligent iterative calculation is performed using mean change point analysis; The mean change point method specifically includes: Calculate river network density: , In the formula, y is the digital river network density, km / km 2 ; L is the length of the river network, km; A is the basin area, km 2 ; Compute multiple threshold fits: , where x is the threshold value, y is the digital river network density; It represents the power of the fitting function, that is, the power of the power function of the fitted function, which is calculated by the scattered fitting of the threshold and the river network density. Figure 4 , k represents the coefficient of the fitting function; Calculate each threshold value and the river network density formed by it to form a sequence format; The sum of the squares of the deviations of the total sample S and the sum of the squares of the deviations on both sides of the change point The difference of shows a trend of rising first and then falling as the threshold increases, so each curve has a peak point, which is the optimal confluence accumulation threshold point. n ( n ≥2) sequence, change point ( =1,2,…,n) Divide the sequence into two segments, calculate the sum of squares of the deviations of the two segments and superimpose them to obtain the sum of the sum of squares of the deviations on both sides of the change point , the sum of the total sample deviation square S and the sum of the deviation squares on both sides of the change point The maximum value of the difference is the optimal confluence accumulation threshold point. The calculation formula is: ; ; In the formula, Indicates The sample value corresponding to the sequence is the river network density value; , , They are the mean on the left side of the change point, the mean on the right side, and the overall mean of the sample; is the sum of the squares of the deviations on both sides of the change point; =1, 2, …, -1; = , +1, …, n ; n Indicates the sequence number. The threshold will be calculated multiple times iteratively. For example, from 500 to 50000, each trial value is a sequence. S is the total sample deviation sum of squares; By calculating multiple threshold fits , the sum of the sum of squares of the deviations of the total sample S and the sum of squares of the deviations on both sides of the change point The difference in value shows a trend of first rising and then falling as the threshold value increases, so each curve has a peak point, which is the optimal catchment area threshold point.

[0015] Generate a river network grid based on the optimal confluence accumulation threshold, set the specified river network classification number, and output the corresponding level river network.

[0016] Preferably, the training of the topological reasoning module includes: automatically realizing the conversion of raster data into natural language description, converting the river network raster into a coordinate sequence; identifying its starting point, turning point, end point and intersection point; identifying the type of intersection point. Receiving high-definition satellite images, automatically identifying water conservancy projects such as reservoir sluices through integrated image recognition functions, and converting them into nodes.

[0017] Preferably, the target river network hydrodynamic model specification includes: setting a rule engine according to the target river network hydrodynamic model format requirements, and performing the following operations: automatically assigning upstream and downstream boundary identifiers according to the topological node connection order; automatically generating river network structure files, cross-section morphology files and boundary condition time series files according to the target river network hydrodynamic model format requirements.

[0018] Preferably, the topological reasoning module includes: converting the river network grid data into a natural language description or structured JSON data containing a spatial coordinate sequence; that is, encoding the river network grid into a natural language description format, specifically reading the attributes of the grid through a gis program, wherein the attributes include coordinates, runoff accumulation and other attribute values, etc.; the large language model is mainly an integrated program. The specific format after conversion: {"ID":1, "x":1024, "y":768, "direction":NE, "accumulation":150, "neighbors": [{ "ID": 2, "relative_position": "E"},{ "ID": 6, "relative_position": "SE"},{ "ID": 7, "relative_position": "NE"}]; The large language model is used to infer the river starting point, i.e. the source, the confluence point, the flow direction relationship, and the confluence relationship between the main and tributary rivers; To identify water conservancy projects such as reservoirs and sluice gates, the large language model will integrate and call computer vision models, such as the YOLO model, to identify reservoir dams in satellite images and realize image recognition functions.

[0019] This river network hydrodynamic model construction method and system based on large language model reasoning realizes the intelligentization of river network topological structure analysis and river network hydrodynamic model configuration by integrating geographic information system (GIS) data processing and the reasoning ability of the large language model; realizes the intelligentization of river network topological structure analysis and river network hydrodynamic model configuration through the technology of automatic generation of river network hydrodynamic model by topological structure; realizes the whole process automation from DEM data to river network hydrodynamic model construction by integrating the spatial reasoning ability of the large language model and the hydrological analysis technology, which solves the problem of traditional methods relying on manual intervention and low modeling efficiency, and has high technical innovation and practical application value. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] Figure 1 It is a schematic diagram of the system architecture of the present invention; Figure 2 It is a schematic diagram of DEM data of the present invention; Figure 3 This is a schematic diagram of the dynamic threshold optimization process of the present invention; Figure 4 It is a schematic diagram of fitting the river network density and the catchment area threshold value of the present invention; Figure 5 It is a schematic diagram of the difference between the total sample deviation square sum S and the sum of the deviation square sum Si on both sides of the change point of the present invention; Figure 6 It is a schematic diagram of the river network grid of the present invention; Figure 7 This is a schematic diagram of the river network topology structure of the present invention; Figure 8 A schematic diagram of a river network grid of a water conservancy project is added to the present invention; Fig. 9 A schematic diagram of the topological structure of a water conservancy project is added to the present invention. DETAILED DESCRIPTION

[0021] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0022] The present invention provides Figure 1 A system based on large language model inference of water system topology and automatic construction of river network hydrodynamic model is shown in the paper, including the following modules: DEM processing module: performs depression filling processing on the original digital elevation model data, calculates the water flow direction matrix based on the D8 algorithm, and generates a river network grid according to the dynamically optimized confluence accumulation threshold; the DEM processing module of this embodiment is a DEM processing module driven by a large language model: Topological reasoning module: receives initial river network data, analyzes the spatial distribution of rivers through a pre-trained large language model, receives high-definition satellite images, identifies water conservancy projects such as reservoirs and sluices through integrated image recognition functions, generates a topological relationship diagram containing nodes and edges, and outputs a visualized topological structure; nodes include: source, intersection, water conservancy project; edges are river sections; River network hydrodynamic model generation module: According to the target model specification, the topological relationship is converted into a structured configuration file, including river channel parameters, boundary conditions and section distribution files. In this embodiment, the river network hydrodynamic model generation module is a river network hydrodynamic model generation module driven by a large language model.

[0023] The DEM processing module optimizes parameters through a dynamic feedback mechanism. The digital elevation model is called Digital Elevation Model in English, abbreviated as DEM. Specifically, based on the resolution of the digital elevation model, terrain type and historical experience, the initial convergence accumulation threshold range is generated by the large language model; Figure 3 As shown, the threshold is iteratively adjusted using a heuristic method, and the threshold intelligent iterative calculation is performed using mean change point analysis; The mean change point method specifically includes: Calculate river network density: , In the formula, yis the digital river network density, km / km 2 ; L is the length of the river network, km; A is the basin area, km 2 ; Compute multiple threshold fits: , where x is the threshold value, y is the digital river network density; It represents the power of the fitting function, that is, the power of the power function of the fitted function, which is calculated by the scattered fitting of the threshold and the river network density. Figure 4 , k represents the coefficient of the fitting function; Calculate each threshold value and the river network density formed by it to form a sequence format, as shown in Table 1: Table 1: River network density sequence format sequence Threshold River network density 1 2000 1.12 2 5000 1.00 …… …… …… 10 100000 0.2 like Figure 5 As shown, the sum of the squares of the deviations of the total sample S and the sum of the squares of the deviations on both sides of the change point The difference of shows a trend of rising first and then falling as the threshold increases, so each curve has a peak point, which is the optimal confluence accumulation threshold point. n ( n ≥2) sequence, change point ( =1,2,…,n) divide the sequence into two segments, calculate the sum of squares of the deviations of the two segments and superimpose them to obtain , the total sample deviation sum of squares S and The maximum value of the difference is the optimal confluence accumulation threshold point. The calculation formula is: ; ; In the formula, Indicates The sample value corresponding to the sequence is the river network density value; , , They are the mean on the left side of the change point, the mean on the right side, and the overall mean of the sample; is the sum of the squares of the deviations on both sides of the change point; =1, 2, …, -1; = , +1, …, n ; n It represents the sequence number. The threshold will be calculated iteratively for multiple times. For example, from 500 to 50000, each trial value is a sequence. S is the total sample deviation sum of squares. By calculating multiple threshold fits , the sum of the sum of squares of the deviations of the total sample S and the sum of squares of the deviations on both sides of the change point The difference in value shows a trend of first rising and then falling as the threshold value increases, so each curve has a peak point, which is the optimal catchment area threshold point.

[0024] Generate a river network grid based on the optimal confluence accumulation threshold, set the specified river network classification number, and output the corresponding level river network.

[0025] The training of the topological reasoning module includes: automatically converting raster data into natural language description, converting the river network raster into a coordinate sequence; identifying its starting point, turning point, end point and intersection point; identifying the type of intersection point. Receive high-definition satellite images, automatically identify water conservancy projects such as reservoir sluices through integrated image recognition functions, and convert them into nodes.

[0026] The target river network hydrodynamic model specification includes: setting a rule engine according to the target river network hydrodynamic model format requirements, and performing the following operations: automatically allocating upstream and downstream boundary identifiers according to the topological node connection sequence; and automatically generating a river network structure file, a cross-section morphology file, and a boundary condition time series file according to the target river network hydrodynamic model format requirements.

[0027] Preferably, the topological reasoning module includes: converting the river network grid data into a natural language description or structured JSON containing a spatial coordinate sequence; specifically reading the attributes of the grid through a gis program, including coordinates, attribute values ​​such as runoff accumulation, etc.; the large language model is mainly an integrated program. The specific format after conversion: {"ID":1,"x":1024,"y":768,"direction":NE,"accumulation":150,"neighbors":[{"ID":2,"relative_position":"E"},{"ID": 6,"relative_position":"SE"},{"ID": 7,"relative_position": "NE"}].

[0028] The starting point of the river, i.e. the source, the confluence point, the flow direction relationship and the confluence relationship between the main and tributary rivers are inferred through the large language model; Water conservancy projects such as reservoirs and sluice gates can be identified through image recognition. The large language model will integrate and call computer vision models, such as the YOLO model, to identify reservoir dams in satellite images.

[0029] System construction and environment configuration Hardware environment: Choose appropriate hardware devices based on the amount of data and computational complexity. For example, for large-scale DEM data processing, it is recommended to use a server with a multi-core CPU, high memory capacity, and high-performance GPU to accelerate the reasoning of large language models and complex data calculations. At the same time, ensure that the storage device has sufficient space and read and write speed to store raw data, intermediate results, and the final generated model file.

[0030] Software environment: Build a Python programming environment and install various required libraries, including but not limited to the GDAL library for geographic information processing, PyTorch or TensorFlow framework for deep learning, and NumPy, Pandas and other libraries for data processing and analysis. At the same time, configure the environment required for the large language model (LLM) to run and install related model dependency packages and tools.

[0031] Data preparation and preprocessing: Collect original data: Obtain high-precision original digital elevation model (DEM) data from authoritative data sources to ensure that the data covers the target study area and that the resolution and accuracy of the data meet the modeling requirements. At the same time, collect other auxiliary data related to the study area, such as land use type data, meteorological data, etc., for subsequent use in model construction and analysis.

[0032] Data quality check: Perform quality checks on the collected DEM data, including checking the integrity of the data and whether there are missing values ​​or outliers. Use visualization tools to view the overall distribution of the data to ensure that there are no obvious errors or deviations in the data. Repair or reacquire problematic data.

[0033] The system module operation and method steps are as follows: DEM processing module driven by large language model: firstly, the original DEM data is processed to fill the depressions and eliminate the small depressions in the data; The water flow direction matrix is ​​calculated based on the D8 algorithm to determine the water flow direction of each grid cell. The specific calculation process follows the principle of the D8 algorithm and determines the water flow direction based on the elevation difference between adjacent grids. The river network classification standard and the expected river network level are specified, and the optimal runoff accumulation threshold is determined by using the large language model through a dynamic feedback mechanism and the mean change point method to generate river network raster data.

[0034] Large language model topology reasoning module: The generated river network data is input into this module, and the pre-trained large language model analyzes the spatial distribution of the river; The model identifies the river intersections in the river network grid as topological nodes, determines the upstream and downstream connection relationship of the river segment based on the water flow direction matrix, and generates directed edges; Automatically assign upstream and downstream identifiers based on the node connection order. The rule example is as follows: If the node has only one downstream connection point, it is marked as the upstream boundary; If the node is the intersection of multiple rivers, it is marked as an internal node; If the node has no downstream connection point, it is marked as a downstream boundary; Perform logic check on isolated river sections, and determine whether they can be connected to the main river channel by analyzing their spatial relationship with surrounding river channels and water flow direction. If they cannot be connected, they are marked as abnormal paths. The nodes are numbered from upstream to downstream, first the main stream and then the tributaries, and the same requirement applies to the river channel numbering; Receive high-definition satellite images, automatically identify water conservancy projects such as reservoirs and sluice gates through integrated image recognition functions, output the corresponding water conservancy project type and its specific geographical location, and convert it into nodes; Reasoning generates the topological structure relationship between nodes and edges, and outputs topological structure data and visual topological images.

[0035] Large language model driven river network hydrodynamic model generation module: Automatically assign upstream and downstream boundary identifiers based on the topological relationship output by the large language model topology reasoning module; Automatically generate cross-section distribution based on the river length in the topological relationship and the preset cross-section spacing settings; Using the built-in rule engine, the cross-sectional morphological data, such as the width and depth of the river channel, are automatically converted into model cross-sectional files according to the input specifications of the target river network hydrodynamic model. At the same time, the boundary condition parameters, such as time series of water level and flow data, are automatically generated into input files according to the format requirements of the target model.

[0036] The specific technical process in this embodiment is as follows: Module 1: DEM processing driven by large language models Input data: DEM raster data, such as Figure 2 As shown; Mission Instructions: 1. Call the GIS hydrological analysis function to fill the depressions; calculate the D8 flow direction matrix; and generate the runoff accumulation matrix; 2. Based on DEM resolution, terrain type and historical experience, the initial runoff accumulation threshold range is generated by the large language model; the optimal runoff accumulation threshold point is found by iterative trial calculation using the mean change point method; 3. Using the Gravelius classification method, the main river is level 1, the tributaries that flow into the level 1 river are level 2, and so on. In this case, the output river network is required to be level 2.

[0037] 4. Output the river network grid containing the first-level and second-level rivers, such as Figure 6 As shown; Output data: 1. Large language model adjustment record: Pre-judgment: The threshold range is 2000-20000; Iteration 1: Threshold = 2000, River Density = 1.11, SS i =0.9; Iteration 2: Threshold = 5000, River network density = 0.72, SS i =1.4; Iteration 3: Threshold = 10000, River network density = 0.52, SS i =1.67 Iteration 4: Threshold = 20000, River network density = 0.38, SS i =1.6 The optimal flow accumulation threshold is 10000.

[0038] 2. River network raster file Module 2: Topological Structure Reasoning This module uses the reasoning ability of the large language model. The large language model prompts the design as follows: Input data: river network raster; satellite image data.

[0039] Mission Instructions: 1. Convert the river network raster into a natural language format that can be understood by the large language model: A list of cells, each cell contains the serial number (ID), coordinates (x, y), flow direction (direction, 8 directions), accumulation, and neighbors; Specific format example: {"ID":1, "x":1024, "y":768, "direction":NE, "accumulation":150, "neighbors": [{ "ID": 2, "relative_position": "E"}, { "ID": 6, "relative_position": "SE"}, { "ID": 7, "relative_position": "NE"}].

[0040] 2. Upstream node judgment: accumulation is minimum and there is no upstream unit. Downstream node judgment: accumulation is maximum and there is no downstream unit.

[0041] 3. Path tracing: Starting from the upstream boundary, connect the downstream units in sequence according to the D8 flow direction, ignoring the areas with conflicting flow directions, and end at the downstream boundary.

[0042] 4. Intersection point: ≥2 independent rivers converge, and all inflow edges must be marked.

[0043] 5. Water conservancy project identification: Through the input of high-resolution satellite images, the large language model automatically identifies the water conservancy project facilities. If there is no water conservancy project, the river network topology diagram is directly output, such as Figure 7 As shown; if a water conservancy project is identified, the corresponding water conservancy project type and its specific geographical location are output, and the location of the water conservancy project is superimposed on the original river network grid, such as Figure 8 shown.

[0044] 6. Water conservancy project settings: A node is generated for each upstream and downstream of the gate, and the river between the two nodes participates in the river channel numbering normally; a reservoir type node is generated separately for the reservoir, and the connection between the reservoir and the node does not participate in the river channel numbering, such as Fig. 9 shown.

[0045] 7. Exception handling: Marking isolated units that cannot be connected.

[0046] 8. Output the final topology structure file and visual topology structure image.

[0047] Output requirements: Output various information of nodes, rivers, and water conservancy projects in the following natural language format: "nodes": [ { "id": "N1", / / Node 1 (upstream boundary) "type": "source", / / Type is source "x": 100, / / horizontal axis 100 "y": 100, / / vertical coordinate 100 "accumulation": 1, / / Accumulation of confluence = 1 "inflows": [], / / No inflow edge (source) "outflow": "E1" / / outflow edge is E1 }, { "id": "N2", / / Node 2 (intersection point) "type": "confluence", / / The type is a confluence "x": 150, / / horizontal axis 150 "y": 250, / / vertical coordinate 250 "inflows": ["E1"], / / The inflow edge contains E1 "outflow": "E2" / / outflow edge is E2 } … { "id": "N7", / / Node 7 (downstream boundary) "type": "outlet", / / type is outlet "x": 300, / / horizontal axis 300 "y": 300, / / vertical coordinate 300 "inflows": ["E2"], / / The inflow edge contains E2 "outflow": [] / / No outflow edge (export) } ], "edges": [ { "id": "E1", / / Edge 1 "from": "N1", / / Starting node N1 "to": "N2", / / target node N2 "length": 75.3, / / length 100 units } { "id": "E7", / / side 7 "from": "N1", / / Starting node N8 "to": "N2", / / target node N2 "length": 75.3, / / length 100 units } "reservoir": [ { "id": "R1", / / Reservoir 1 "from": "[]", / / No starting node "to": "N2", / / target node N10 "type": "reservoir", / / Reservoir } "gate": [ { "id": "G1", / / Gate 1 "from": "N5", / / Starting node N5 "to": "N6", / / target node N6 "type": "gate", / / sluice gate }; Module 3: The river network hydrodynamic model generation module driven by the large language model streamlines the modeling of the river network hydrodynamic model, including river network generation, section generation, boundary file generation, etc., and integrates the core codes and instruction sets of these modules to form a complete process.

[0048] River network generation: parse the topological structure, analyze the upstream and downstream boundaries, and generate a river network structure file that meets the format requirements.

[0049] Section generation: Generate section distribution and section morphology files that meet format requirements based on the spacing rules (equidistant or dynamic adjustment) and morphological data input in the user's instructions.

[0050] Boundary file generation: Process time series data, including reading different formats (txt, Excel), data cleaning, unit conversion, and generating time series files that meet format requirements.

[0051] Input data description: 1. Topological structure files: network.gml, network.json (including nodes, rivers, and water conservancy project connections); Figure 8 As shown; 2. Section generation instructions: xs_rules.yml (define spacing rules and shape templates); 3. Original cross-section data: survey_data.xlsx (measured cross-section point cloud); 4. Boundary time series data: tides_2023.csv (time format: YYYYMMDDHHMM); 5. River network hydrodynamic model execution program: 1D.exe; LLM instructions, the instructions are as follows: 1 Generate river network hydrodynamic model file package; 2. The section spacing is distributed at 500m intervals; 3. The river channel parameters are automatically derived using the Manning formula / or the values ​​are specified for each river section; 4 The boundary time series are interpolated to 1 hour intervals; 5 The calculation time step is 1s, the calculation period is 72 hours, and the calculation starts from January 1, 2025.

[0052] Output data in the following format: River network file: network.dat; contains the river segment number, starting node number, and model upstream and downstream boundary node numbers; Section distribution file: sections.dat; contains section number, section spacing, and section roughness; Section shape file: sections_001.dat; contains the section number and its corresponding shape: X distance from the left bank, Z corresponding point elevation; Boundary input file: input.dat; contains time series data such as flow and water level; Model control file: control.dat; contains model calculation step length and calculation time; Model package file: 1D.zip.

[0053] This river network hydrodynamic model construction method and system based on large language model reasoning realizes the intelligentization of river network topological structure analysis and river network hydrodynamic model configuration by integrating geographic information system (GIS) data processing and the reasoning ability of the large language model; realizes the intelligentization of river network topological structure analysis and river network hydrodynamic model configuration through the technology of automatically generating river network hydrodynamic model interface through topological structure; realizes the whole process automation from DEM data to river network hydrodynamic model construction by integrating the spatial reasoning ability of the large language model and hydrological analysis technology, which solves the problem of traditional methods relying on manual intervention and low modeling efficiency, and has high technical innovation and practical application value.

[0054] Finally, it should be noted that the above is only a preferred embodiment of the present invention and is not intended to limit the present invention. Although the present invention has been described in detail with reference to the aforementioned embodiments, it is still possible for those skilled in the art to modify the technical solutions described in the aforementioned embodiments or to make equivalent substitutions for some of the technical features therein. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the protection scope of the present invention.

Claims

1. A method for constructing a river network hydrodynamic model based on large language model reasoning, characterized in that: include: Fill the original DEM data and calculate the water flow direction matrix; The large language model automatically calculates and analyzes the optimal runoff accumulation and extracts the river network grid; By specifying the output river network level command, the river network raster of the specified level is output; Encoding the river network grid into a natural language description format to train a large language model; The spatial distribution of the river is analyzed through a large language model to generate a topological relationship graph containing nodes and directed edges; Identify water conservancy projects through a large language model and generate water conservancy project objects and their location information; The topological relationship diagram and water conservancy project objects and their location information are superimposed, and the large language model is used to infer the final river network topology structure; According to the specifications of the target river network hydrodynamic model, the final river network topology is converted into a structured configuration file and input into the target river network hydrodynamic model to generate the final river network hydrodynamic model.

2. The method for constructing a river network hydrodynamic model based on large language model reasoning according to claim 1, characterized in that: The encoding of the river network grid into a natural language description format includes: converting the location, water flow direction and accumulated flow of each river unit into key-value pair text.

3. The method for constructing a river network hydrodynamic model based on large language model reasoning according to claim 2, characterized in that: The water flow direction is coded in 8 directions.

4. The method for constructing a river network hydrodynamic model based on large language model reasoning according to claim 1, characterized in that: The target river network hydrodynamic model specification includes: setting a rule engine according to the target river network hydrodynamic model format requirements, automatically allocating upstream and downstream boundary identifiers of the target river network hydrodynamic model according to the node connection order in the topological relationship, and generating a configuration file that conforms to the target river network hydrodynamic model format.

5. The method for constructing a river network hydrodynamic model based on large language model reasoning according to claim 4 is characterized in that: The rules include: Each river channel section has only one upstream node and one downstream node, wherein the upstream node determination method includes: the accumulation is minimum and there is no upstream unit, and the downstream node determination method includes: the accumulation is maximum and there is no downstream unit; The intersection point must connect ≥ 2 rivers, and the classification method is Gravelius classification; The node numbers are from upstream to downstream, first the main stream and then the tributaries; A node is generated upstream and downstream of the gate, and the river between the two nodes is normally included in the river channel numbering; Reservoirs generate reservoir type nodes separately, and the connection between reservoirs and nodes does not participate in river channel numbering.

6. The method for constructing a river network hydrodynamic model based on large language model reasoning according to claim 1, characterized in that: The generation of a topological relationship graph including nodes and directed edges includes: identifying river intersections in a river network grid as topological nodes; determining upstream and downstream connection relationships of river sections according to water flow directions, and generating directed edges; performing a logic check on isolated river sections, and if they are not connected to the main river, marking abnormal paths and triggering manual review reminders.

7. The method for constructing a river network hydrodynamic model based on large language model reasoning according to claim 1, characterized in that: The converting the final river network topology into a structured configuration file comprises: generating a river network structure file according to the topological relationship; Generate section distribution files based on river length and preset section spacing; Automatically convert cross-sectional morphology data into model cross-sectional files; Generate boundary condition parameters into input file.

8. The method for constructing a river network hydrodynamic model based on large language model reasoning according to claim 1, characterized in that: The identification of water conservancy projects through a large language model includes: through the input of high-resolution satellite images, the large language model identifies the water conservancy project facilities in the satellite images; if there are no water conservancy projects, a river network topology diagram is output; if a water conservancy project is identified, the corresponding water conservancy project type and the geographical location of the water conservancy project are output, and the geographical location of the water conservancy project is superimposed on the original river network grid.

9. The method for constructing a river network hydrodynamic model based on large language model reasoning according to claim 1, characterized in that: The calculation and analysis of the optimal flow accumulation includes: calculating the river network density: ; Where: y Indicates the digital river network density, the unit is km / km 2 ; L Indicates the length of the river network in km; A Indicates the drainage area in km 2 ; Compute multiple threshold fits ; Where: x represents the threshold value, y represents the digital river network density, represents the power of the fitting function, and k represents the coefficient of the fitting function; against n ( n ≥2) sequence, change point ( =1,2,…,n) Divide the sequence into two segments, calculate the sum of squares of the deviations of the two segments and superimpose them to obtain the sum of the sum of squares of the deviations on both sides of the change point , the total sample deviation sum of squares S The sum of the squares of the deviations on both sides of the change point The maximum value of the difference is the optimal confluence accumulation threshold; the formula is as follows: ; ; In the formula, Indicates The sample value corresponding to the sequence is the river network density value; , , They represent the mean on the left side of the change point, the mean on the right side, and the overall mean of the sample respectively; is the sum of the squares of the deviations on both sides of the change point; =1, 2, …, -1; = , +1, …, n ; S It represents the total sample deviation sum of squares; n Indicates the serial number.

10. A river network hydrodynamic model construction system based on large language model reasoning, characterized by: include: The DEM processing module is used to fill the original digital elevation model data, calculate the water flow direction matrix, and use the large language model to optimize the calculation of the optimal convergence accumulation threshold to generate a user-specified graded river network grid; A topological reasoning module is used to receive data from the DEM processing module, analyze the spatial distribution of the river channel through a pre-trained large language model, receive high-definition satellite images, and identify water conservancy projects; infer and generate a topological relationship diagram containing nodes and directed edges, and output topological structure data and visual topological images; The river network hydrodynamic model generation module is used to assign upstream and downstream boundary identifiers of the river network hydrodynamic model according to the node connection order in the topological relationship; according to the structural requirements and input specifications of the target river network hydrodynamic model, the topological relationship is converted into a structured configuration file, and a model file including model parameters, river channel parameters, and boundary conditions is generated to construct the river network hydrodynamic model.

Citation Information

Patent Citations

  • Fast coding method for a large quantity of sub-basins on basis of digital river network

    CN108804804A

  • Method for automatically dividing and encoding one-dimensional model calculation unit of river network area

    CN112163322A

  • Method for identifying upstream and downstream hydrometric stations of river channel based on existing GIS data

    CN115730025A

  • Dynamic generation method for topological structure of watershed silt dam system

    CN116310172A

Cited By

  • DEM landform analysis method based on large language model

    CN120407750A

  • Hydrodynamic analysis scheduling method, system and equipment based on large language model

    CN121213295A