Method and system for intelligently constructing two-dimensional hydrodynamic model based on large language model

Through an intelligent system based on large language models, the automated construction of two-dimensional hydrodynamic model is realized, which solves the problems of relying on manual experience, time-consuming and local errors in traditional methods, and improves the efficiency and accuracy of model construction.

CN119989995AActive Publication Date: 2025-05-13NANJING HYDRAULIC RES INST

Patent Information

Application Number
CN202510482022.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-17
Publication Date
2025-05-13
Estimated Expiration
2045-04-17

AI Technical Summary

Technical Problem

The construction of traditional two-dimensional hydrodynamic models relies on a lot of manual experience. The process of regional division, grid generation and terrain interpolation is cumbersome, time-consuming and prone to local errors, and lacks methods of full-process automation and high-precision construction.

Method used

An intelligent system based on large language model is adopted, and the automated construction of two-dimensional hydrodynamic model is realized through intelligent partitioning of area blocks, adaptive mesh generation and terrain interpolation optimization modules. The system includes modules such as terrain feature extraction, facility recognition, vector boundary recognition, adaptive grid generation, multi-algorithm interpolation engine and water level-storey verifier.

Benefits of technology

It realizes integrated intelligent modeling from data preprocessing to model deployment, improves the efficiency and accuracy of model construction, reduces manual intervention and local errors, and solves the problems of time-consuming and cumbersome adjustments in traditional methods.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119989995A_ABST
    Figure CN119989995A_ABST
Patent Text Reader

Abstract

The invention discloses a method and system for intelligently constructing a two-dimensional hydrodynamic model based on a large language model, and relates to the technical field of artificial intelligence and hydraulic numerical simulation, and the system comprises an intelligent region block division module which is used for analyzing geographic information data through the large language model LLM, recognizing topographic features and engineering facilities, and dividing region blocks; the self-adaptive grid generation module is used for setting different grid types and dynamically setting grid density according to different partitions; the terrain interpolation optimization module is used for selecting an interpolation algorithm to calculate a grid unit terrain and solve an optimal grid terrain based on a water level-reservoir capacity relationship verification result, and checking and marking an elevation abnormal mutation grid unit; and the two-dimensional hydrodynamic model construction module is used for outputting the grid and the time sequence data to a configuration file according to the format requirement of the target two-dimensional hydrodynamic model, and constructing the two-dimensional hydrodynamic model. According to the method, the problems of dependence on artificial experience, long time consumption of grid division and tedious adjustment are effectively solved, and integrated intelligent modeling is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of artificial intelligence and hydraulic numerical simulation, and in particular to a method and system for intelligently constructing a two-dimensional hydrodynamic model based on a large language model. Background Art

[0002] Currently, two-dimensional hydrodynamic models have important applications in water resources management, flood prevention and early warning, etc. However, traditional modeling methods rely on a lot of manual experience, and the process of regional division, grid generation and terrain interpolation is cumbersome, time-consuming and prone to local errors.

[0003] How to use artificial intelligence technology to automate the entire modeling process and improve model accuracy and construction efficiency has become a technical problem that needs to be solved urgently. Summary of the invention

[0004] In view of the problems existing in the existing system for intelligently constructing a two-dimensional hydrodynamic model based on a large language model, the present invention is proposed. Therefore, the problem to be solved by the present invention is how to provide a system and system for intelligently constructing a two-dimensional hydrodynamic model based on a large language model.

[0005] In order to solve the above technical problems, the present invention provides the following technical solutions: In a first aspect, the present invention provides a system for intelligently constructing a two-dimensional hydrodynamic model based on a large language model, which includes a regional block intelligent division module for parsing geographic information data through a large language model LLM, identifying terrain features and engineering facilities, and dividing deep water areas, beach-wet alternating zones, shorelines, river channel areas, and engineering facility areas; Adaptive grid generation module, used to set grid generation rules and different grid types. The river channel area is a structured grid, and other areas are unstructured grids. Different grid densities can be dynamically set according to different partitions. The terrain interpolation optimization module is used to verify the results based on the water level-reservoir capacity relationship, select the interpolation algorithm to calculate the grid unit terrain, solve the optimal grid terrain, and check and mark the grid units with abnormal elevation changes; The two-dimensional hydrodynamic model construction module is used to output the grid and time series data into a configuration file according to the target two-dimensional hydrodynamic model format requirements to construct a two-dimensional hydrodynamic model.

[0006] As a preferred solution of the system for intelligently constructing a two-dimensional hydrodynamic model based on a large language model according to the present invention, the region block intelligent division module includes: The terrain feature extraction submodule builds a terrain semantic parsing algorithm, extracts contour lines from DEM data, divides deep water areas, beach-wet alternation zones, and shoreline boundaries according to the set contour line thresholds, and generates boundary vectors for each area based on the division results; The facility identification submodule integrates an image recognition model, detects engineering facilities through a pre-trained image recognition model, and outputs facility boundary vector data; The vector boundary recognition submodule recognizes the terrain feature extraction submodule, the facility recognition submodule, and the manually uploaded vector layers, and generates the region block boundary according to the vector layers; The area block generation submodule generates polygonal area blocks including river channels, deep water areas, beach-wet alternating zones and engineering facilities based on the area block boundary vector files.

[0007] As a preferred solution of the system for intelligently constructing a two-dimensional hydrodynamic model based on a large language model according to the present invention, the adaptive grid generation module includes: The grid type decider selects the structured or unstructured grid algorithm according to the area type, where the river channel area adopts the structured grid; Dynamic density controller, adaptively setting grid density based on large language model LLM; The dynamic density controller comprises: Manual intervention interface: Provides a visual interface to receive the grid size threshold of a specific area set by the user; Intelligent recommendation unit: when there is no manual setting, it generates the recommended grid size according to the total area of ​​the calculation domain; Density gradient zone generator: set sparse grids for deep water areas, set dense grids from the beach-wet alternation zone to the shoreline area, and set encrypted grids around water conservancy facilities; Mesh drawing unit: through the large language model LLM integration call software program, using structured and unstructured mesh generation methods, to generate and optimize the mesh; The transition layer generation unit configures multi-level transition layers in different density intervals, inserts gradient mesh layers between adjacent areas with density differences exceeding 50%, and sets the adjacent mesh size ratio to at least 1.5:1.

[0008] As a preferred solution of the system for intelligently constructing a two-dimensional hydrodynamic model based on a large language model according to the present invention, the terrain interpolation optimization module includes the following contents: Multi-algorithm interpolation engine: Integrates the inverse distance weighted method, Kriging interpolation and natural neighbor method, and selects the initial interpolation algorithm according to the spatial distribution and terrain characteristics of DEM data in different regional blocks; Water level-reservoir capacity verifier: compares the root mean square error of the simulated water level-reservoir capacity curve with the measured data. If the error exceeds 5%, it triggers the interpolation algorithm switching or parameter adjustment to find different optimal interpolation algorithms suitable for each area block; Elevation Anomaly Detector: Calculates the elevation gradient between a grid cell and its neighbors , when the elevation gradient When the grid cell is marked as abnormal, the spatial distribution heat map of the abnormal grid is displayed, and the interpolation algorithm reset suggestion and manual value revision option are pushed to the user. , is the average elevation of the area.

[0009] As a preferred solution of the system for intelligently constructing a two-dimensional hydrodynamic model based on a large language model according to the present invention, the terrain interpolation optimization module includes the following contents: Multi-algorithm interpolation engine: Integrates the inverse distance weighted method, Kriging interpolation and natural neighbor method, and selects the initial interpolation algorithm according to the spatial distribution and terrain characteristics of DEM data in different regional blocks; Water level-reservoir capacity verifier: compares the root mean square error of the simulated water level-reservoir capacity curve with the measured data. If the error exceeds 5%, it triggers the interpolation algorithm switching or parameter adjustment to find different optimal interpolation algorithms suitable for each area block; Elevation Anomaly Detector: Calculates the elevation gradient between a grid cell and its neighbors , when the elevation gradient When the grid cell is marked as abnormal, the spatial distribution heat map of the abnormal grid is displayed, and the interpolation algorithm reset suggestion and manual value revision option are pushed to the user. , is the average elevation of the area.

[0010] As a preferred solution of the system for intelligently constructing a two-dimensional hydrodynamic model based on a large language model according to the present invention, the multi-algorithm interpolation engine includes the following contents: IDW interpolation elevation values The calculation formula is: , ; In the formula, For known points The elevation value of For point Treat interpolation points The influence weight of the elevation value; Points to be interpolated and known points The Euclidean distance of is the distance attenuation parameter; Kriging interpolation method to interpolate elevation values The calculation formula is: ; In the formula, For known points The elevation value of It is determined by solving the Kriging equations. The calculation formula is: ; In the formula, is the semi-coefficient of variation; Represents a known point With prediction point The variance function value between ; is the weight to be solved; μ is the Lagrange multiplier; and are the indices of known data points. is the identifier of the equation row, It is the traversal operator of the equation series, and its value range is 1, 2, …, n; Natural neighbor method to interpolate elevation values The calculation formula is: ; In the formula, To be inserted The new Thiessen polygons and the original points The overlapping area of ​​Thiessen polygons; is the total area of ​​the Thiessen polygons of the points to be inserted; m is the number of natural neighbor points.

[0011] As a preferred solution of the system for intelligently constructing a two-dimensional hydrodynamic model based on a large language model according to the present invention, the water level-storage capacity verifier includes the following contents: Calculate the storage capacity: ; ; ; Where: k is the grid unit number; is the total amount of grid cells; is the grid area, , are the vertical and horizontal coordinates of the vertex, is the effective water depth of the unit, is the bottom elevation constant, h is the water level; is the simulated storage capacity value; The error of water level-reservoir capacity relationship is defined as: ; Algorithm adjustment is triggered when the following conditions are met: ; or ; Where: is the number of measured water level-reservoir capacity data points, For the Water level value, is the simulated storage capacity value, is the measured storage capacity value, For all measured water level intervals.

[0012] As a preferred solution of the system for intelligently constructing a two-dimensional hydrodynamic model based on a large language model according to the present invention, the selection of the initial interpolation algorithm includes the following contents: Record historical interpolation schemes and error data, build an interpolation algorithm optimization knowledge base, and record the mapping relationship between DEM features and optimal interpolation algorithms of historical cases for initial algorithm recommendation; Construct a multidimensional feature vector based on region type, point cloud density, grid size, elevation standard deviation, data missing rate and computational domain area to record the mapping relationship between historical DEM features and the optimal interpolation algorithm; Normalize the feature vector: ; ; ; In the formula, Original eigenvalues; For the The standardized value of the feature; Features The historical average value of Features The standard deviation of historical data; is the point cloud density, is the grid size, is the elevation standard deviation, is the data missing rate, A is the area of ​​the calculation domain; is the total number of samples; For the The sample eigenvalues; is the feature vector; Adopt incremental learning and weight decay strategies to dynamically update the knowledge base, retain valid cases within 12 months and reduce the weight of expired data; For new tasks, the neural network model is used to learn the nonlinear mapping relationship between terrain features and the optimal interpolation algorithm, match the Top5 historical cases, and recommend the interpolation solution with the lowest root mean square error (RMSE) through the inner product similarity and error tolerance threshold. The historical case storage structure is expressed as: ; In the formula, Indicates Topographical features of the historical case studies; is the optimal interpolation algorithm, For the The accuracy of the interpolation algorithm in each case; is the timestamp of case entry; M is the total number of historical cases; The inner product similarity calculation is performed, and the calculation formula is: ; ; In the formula, Interpolation problem is needed for the current situation; The knowledge base feature vector of historical cases; is the modulus of the vector; No. The timeliness weight of historical cases, is the current timestamp, The timestamp of case entry. is the attenuation coefficient, T 0 is the time normalization constant.

[0013] In the second aspect, the present invention provides a method for intelligently constructing a two-dimensional hydrodynamic model based on a large language model, which includes: fusing DEM data, satellite images and water conservancy facilities vector layers through a large language model LLM, extracting terrain contours and spatial distribution of engineering facilities, and performing intelligent regional division, dividing deep water areas, beach-wet alternating zones, shorelines, river channels and engineering facilities areas; The grid division rules are generated by the large language model LLM, a structured grid is generated in the river channel area, an unstructured grid is generated in other areas, and the grid type is determined; When there is a manually set value, the manually set grid size is used; when there is no manually set value, the recommended grid size is generated according to the total area of ​​the calculation domain, and the multi-level grid density band is generated according to the recommended reference size. A gradient grid layer is inserted between adjacent areas with a density difference of more than 50%, and the grid is drawn to generate an adaptive grid; Select a multi-scale interpolation algorithm to calculate the grid terrain elevation, verify the interpolation accuracy by combining the water level-reservoir capacity curve, switch the interpolation algorithm or adjust the parameter weights; Parse the target two-dimensional hydrodynamic model configuration file format requirements, output the optimized grid and boundary as a structured configuration file according to the format requirements, integrate the configuration file and the executable package, and complete the construction of the two-dimensional hydrodynamic model.

[0014] In a third aspect, the present invention provides a computer device, comprising a memory and a processor, wherein the memory stores a computer program, wherein: when the processor executes the computer program, it implements the steps of a system for intelligently constructing a two-dimensional hydrodynamic model based on a large language model.

[0015] In a fourth aspect, the present invention provides a computer-readable storage medium having a computer program stored thereon, wherein: when the computer program is executed by a processor, the system implements the steps of intelligently constructing a two-dimensional hydrodynamic model based on a large language model.

[0016] It effectively solves the technical bottlenecks of traditional modeling methods such as reliance on manual experience, time-consuming meshing, and cumbersome adjustments, and realizes integrated intelligent modeling from data preprocessing to model deployment. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0018] Figure 1 A system architecture diagram for intelligently constructing a two-dimensional hydrodynamic model based on a large language model; Figure 2 This is a schematic diagram of the original digital elevation model DEM data; Figure 3 Schematic diagram of regional block division; Figure 4 It is a grid schematic diagram; Figure 5 This is a schematic diagram of grid interpolation; Figure 6 Schematic diagram of grid interpolation optimization results. DETAILED DESCRIPTION

[0019] In order to make the above-mentioned purposes, features and advantages of the present invention more understandable, the specific implementation methods of the present invention are described in detail below in conjunction with the drawings of the specification. Obviously, the described embodiments are part of the embodiments of the present invention, but not all of them. Based on the embodiments of the present invention, all other embodiments obtained by ordinary persons in the art without creative work should fall within the scope of protection of the present invention.

[0020] In the following description, many specific details are set forth to facilitate a full understanding of the present invention, but the present invention may also be implemented in other ways different from those described herein, and those skilled in the art may make similar generalizations without violating the connotation of the present invention. Therefore, the present invention is not limited to the specific embodiments disclosed below.

[0021] Secondly, the term "one embodiment" or "embodiment" as used herein refers to a specific feature, structure, or characteristic that may 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 necessarily refer to the same embodiment, nor is it a separate or selective embodiment that is mutually exclusive with other embodiments.

[0022] Embodiment 1

[0023] Reference Figure 1-Figure 6 , which is the first embodiment of the present invention, provides a system for intelligently constructing a two-dimensional hydrodynamic model based on a large language model, including: 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.

[0024] Software environment: Build a Python programming environment and install various required libraries, including but not limited to the GDAL library for geographic information processing, the 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.

[0025] 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.

[0026] Intelligent division module of regional blocks: used to parse geographic information data through the large language model LLM, identify terrain features and engineering facilities, and divide deep water areas, alternating beach and wetland zones, coastlines, river channel areas, and engineering facility areas; Specifically, the terrain feature extraction submodule inputs DEM terrain data, such as Figure 2 As shown, a terrain semantic parsing algorithm is automatically constructed through a large language model (LLM) to parse geographic information data, identify terrain elevation features, extract contour lines, and divide deep water areas, beach-wet alternating zones, coastlines, etc. according to elevation thresholds to generate different boundary vectors; The facility identification submodule uses LLM to integrate image recognition models, such as the YOLO model, to detect engineering facilities through pre-trained image recognition models and output facility boundary vector data; The vector boundary recognition submodule recognizes the terrain feature extraction submodule, the facility recognition submodule, and the manually uploaded vector layers, and generates the region block boundary according to the vector layers; The area block generation submodule generates polygonal area blocks including river channels, deep water areas, beach-wet alternating zones and engineering facilities according to the area block boundary vector file, and numbers them in sequence, such as Figure 3 shown.

[0027] Adaptive grid generation module: used to set grid generation rules and different grid types. The river channel area is a structured grid, and other areas are unstructured grids. Different grid densities can be dynamically set according to different partitions. Specifically, the grid type decider selects the structured or unstructured grid algorithm according to the region type, where the river channel region adopts the structured grid; the LLM selects the structured or unstructured grid algorithm according to the region type, where the river channel region adopts the structured grid and the rest of the regions adopt the unstructured grid; The system provides a visual interface to receive the grid size threshold for a specific area set by the user. If there is no manual setting, LLM generates a recommended grid size based on the total area S (km²) of the computational domain. , where K is the adjustment factor; in this embodiment, d=500m is set.

[0028] Dynamic density controller, adaptively setting grid density based on large language model LLM; dynamically setting density according to different partitions: setting sparse grid for deep water area (d x ≥2d, 1000m in this example), dense grids are set from the beach-wet alternation zone to the shoreline area (d m ≤d / 2, 250m in this embodiment), set up a dense grid around the water conservancy project facilities ( ≤d / 3, 100m in this embodiment); Multi-level transition layers are configured in different density intervals, and gradient mesh layers are inserted between adjacent areas with density differences exceeding 50% to ensure that the ratio of adjacent mesh sizes is ≤1.5:1, so as to achieve smooth transition and avoid mesh mutations.

[0029] The LLM integration calls the proprietary NHRI_GRID software program to automatically generate and optimize the grid. The final grid generation result is as follows: Figure 4 shown.

[0030] Terrain interpolation optimization module: used to set grid generation rules and different grid types. The river channel area is a structured grid, and other areas are unstructured grids. Different grid densities can be dynamically set according to different partitions. Specifically, the multi-algorithm interpolation engine integrates the inverse distance weighted method, Kriging interpolation and natural neighbor method. The initial interpolation algorithm is selected according to the spatial distribution and terrain characteristics of the DEM data of different regional blocks. Through LLM, the initial interpolation algorithm and initial parameters are selected for different regional blocks to perform grid terrain interpolation. The interpolation results are as follows: Figure 5 shown.

[0031] IDW interpolation elevation values The calculation formula is: , ; In the formula, For known points The elevation value of For point Treat interpolation points The influence weight of the elevation value; Points to be interpolated and known points The Euclidean distance of is the distance attenuation parameter; Kriging interpolation method to interpolate elevation values The calculation formula is: ; In the formula, For known points The elevation value of It is determined by solving the Kriging equations. The calculation formula is: ; In the formula, is the semi-coefficient of variation; Represents a known point With prediction point The variance function value between ; is the weight to be solved; μ is the Lagrange multiplier; and are the indices of known data points. is the identifier of the equation row, It is the traversal operator of the equation series, and its value range is 1, 2, …, n; Natural neighbor method to interpolate elevation values The calculation formula is: ; In the formula, To be inserted The new Thiessen polygons and the original points The overlapping area of ​​Thiessen polygons; is the total area of ​​the Thiessen polygons of the points to be inserted; m is the number of natural neighbor points.

[0032] Choosing an initial interpolation algorithm involves the following: Record historical interpolation schemes and error data, build an interpolation algorithm optimization knowledge base, and record the mapping relationship between DEM features and optimal interpolation algorithms of historical cases for initial algorithm recommendation for subsequent tasks; Construct a multidimensional feature vector based on region type, point cloud density, grid size, elevation standard deviation, data missing rate and computational domain area to record the mapping relationship between historical DEM features and the optimal interpolation algorithm; Feature vector construction: Standardization: ; ; ; In the formula, Original eigenvalues; For the The standardized value of the feature; Features The historical average value of Features The standard deviation of historical data; is the point cloud density, is the grid size, is the elevation standard deviation, is the data missing rate, A is the area of ​​the calculation domain; is the total number of samples; For the The sample eigenvalues; is the feature vector.

[0033] Adopt incremental learning and weight decay strategies to dynamically update the knowledge base, retain valid cases within 12 months and reduce the weight of expired data; For new tasks, the neural network model is used to learn the nonlinear mapping relationship between terrain features and the optimal interpolation algorithm, match the Top5 historical cases, and recommend the interpolation solution with the lowest root mean square error (RMSE) through the inner product similarity and error tolerance threshold. The calculation method is as follows: Historical case storage structure: ; In the formula, Indicates Topographical features of the historical case studies; is the optimal interpolation algorithm, For the The accuracy of the interpolation algorithm in each case; is the timestamp of case entry; M is the total number of historical cases.

[0034] Calculate the inner product similarity: ; ; In the formula, Interpolation problem is needed for the current situation; The knowledge base feature vector of historical cases; is the modulus of the vector; No. The timeliness weight of historical cases, is the current timestamp, The timestamp of case entry. is the attenuation coefficient, T 0 is the time normalization constant (the number of seconds in a 12-month).

[0035] Parameter adjustments include the following: IDW parameter adjustment group: Power: Dynamically adjust the distance attenuation exponent , when the interpolation result is too smooth, increase p, and when there is local distortion, reduce p; Search radius: Adaptively set the maximum search radius based on the DEM point density to avoid extrapolation distortion. , where is the average distance between neighboring points; Neighborhood points: constrain the minimum number of valid points , where is the total number of interpolation points; Kriging parameter adjustment group: Variogram model: select spherical, exponential or Gaussian model; Sill value: Sill value C is the maximum value of the variation function, indicating the degree of spatial variation of the data. , where is the total variance of the data; Nugget value: Nugget value Refers to the variance at zero distance, indicating measurement error or variation on a small scale. , where C is the base value; Range R: The distance from the variogram to the base value, indicating the range of spatial correlation between data. , where is the average distance between neighboring points; Natural Neighbor Method Parameter Adjustment Group: Neighborhood point number constraint: Set the maximum number of neighborhood points to avoid redundant calculations in high-density areas; When the error of a single algorithm exceeds the limit, the IDW-Kriging-NNI hybrid interpolation is started, and the weight ratio of each interpolation algorithm is dynamically allocated by the large language model LLM according to the complexity of the local terrain.

[0036] Water level-reservoir capacity verifier: Verify the accuracy of the interpolation result based on the water level-reservoir capacity curve, calculate the root mean square error RMSE and the determination coefficient R 2 If the error exceeds 5%, the interpolation algorithm switching or parameter adjustment is triggered to find different optimal interpolation algorithms suitable for each area block; the parameters are automatically adjusted, and the errors of different interpolation algorithms are calculated, and different interpolation algorithms suitable for each area block are selected. The grid terrain after optimizing the interpolation algorithm is as follows Figure 6 shown.

[0037] The storage capacity is calculated using the following formula: ; ; ; Where: k is the grid unit number; is the total amount of grid cells; is the grid area, , are the vertical and horizontal coordinates of the vertex respectively, and the vertex coordinates are sorted counterclockwise, and (x5,y5)=(x1y1); is the effective water depth of the unit, is the bottom elevation constant, h is the water level; is the simulated storage capacity value.

[0038] Defining the water level-reservoir capacity relationship error , the expression is: ; Algorithm adjustment is triggered when the following conditions are met: ; or ; Where: is the number of measured water level-reservoir capacity data points, For the Water level value, is the simulated storage capacity value, is the measured storage capacity value, For all measured water level intervals.

[0039] Elevation Anomaly Detector: Calculates the elevation gradient between a grid cell and its neighbors , when the elevation gradient When the grid cell is marked as abnormal, the spatial distribution heat map of the abnormal grid is displayed, and the interpolation algorithm reset suggestion and manual value revision option are pushed to the user. , is the average elevation of the area.

[0040] Two-dimensional hydrodynamic model construction module: The two-dimensional hydrodynamic model construction module driven by the large language model includes grid file generation, boundary file generation, etc. It is used to output the configuration file of the grid and time series data according to the target two-dimensional hydrodynamic model format requirements and automatically construct the two-dimensional hydrodynamic model.

[0041] Specifically, the format parsing unit: LLM parses the configuration file and input file format requirements of the target two-dimensional hydrodynamic model; and generates a grid structure file of the two-dimensional hydrodynamic model that meets the format requirements.

[0042] Automatic configuration unit: Generate dat file according to target format from grid node coordinates and terrain elevation.

[0043] Boundary setting unit: Output the manually marked boundary as boundary configuration dat file according to the format requirements, and convert the boundary time series data into the boundary input dat file of the target format. According to the boundary grid input in the user instruction, generate a boundary setting file that meets the format requirements, process the time series data, including reading different formats (txt, Excel), data cleaning, unit conversion, and generate a time series file that meets the format requirements.

[0044] Model generation unit: packages the two-dimensional hydrodynamic model execution program and input files to generate a two-dimensional hydrodynamic model.

[0045] Furthermore, the present embodiment also provides a method for intelligently constructing a two-dimensional hydrodynamic model based on a large language model, including: fusing DEM data, satellite images, and a water conservancy facility vector layer through a large language model LLM, extracting terrain contours and spatial distribution of engineering facilities, and performing intelligent regional division, dividing the deep water area, beach-wet alternating zone, shoreline, river channel, and engineering facility area; The grid division rules are generated by the large language model LLM, a structured grid is generated in the river channel area, an unstructured grid is generated in other areas, and the grid type is determined; When there is a manually set value, the manually set grid size is used; when there is no manually set value, the recommended grid size is generated according to the total area of ​​the calculation domain, and the multi-level grid density band is generated according to the recommended reference size. A gradient grid layer is inserted between adjacent areas with a density difference of more than 50%, and the grid is drawn to generate an adaptive grid; Select a multi-scale interpolation algorithm to calculate the grid terrain elevation, and verify the interpolation accuracy by combining the water level-reservoir capacity curve. When RMSE>5%, automatically switch the interpolation algorithm or adjust the parameter weight; Parse the target two-dimensional hydrodynamic model configuration file format requirements, output the optimized grid and boundary as a structured configuration file according to the format requirements, integrate the configuration file and the executable package, and complete the construction of the two-dimensional hydrodynamic model.

[0046] This embodiment also provides a computer device, which is suitable for a system that intelligently constructs a two-dimensional hydrodynamic model based on a large language model, including: a memory and a processor; the memory is used to store computer-executable instructions, and the processor is used to execute computer-executable instructions to implement all or part of the steps of the method described in the embodiment of the present invention as proposed in the above embodiment.

[0047] This embodiment also provides a storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the system in any optional implementation of the above embodiment is executed. The storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (Static Random Access Memory, referred to as SRAM), electrically erasable programmable read-only memory (Electrically Erasable Programmable Read-Only Memory, referred to as EEPROM), erasable programmable read-only memory (Erasable Programmable Read Only Memory, referred to as EPROM), programmable read-only memory (Programmable Red-Only Memory, referred to as PROM), read-only memory (Read-Only Memory, referred to as ROM), magnetic memory, flash memory, magnetic disk or optical disk.

[0048] The storage medium proposed in this embodiment and the data storage method proposed in the above embodiment belong to the same inventive concept. The technical details not fully described in this embodiment can be found in the above embodiment, and this embodiment has the same beneficial effects as the above embodiment.

[0049] Embodiment 2

[0050] Reference Figure 2 - Figure 6 , a system for intelligently constructing a two-dimensional hydrodynamic model based on a large language model is provided for the second embodiment of the present invention. In order to verify the beneficial effects of the present invention, scientific demonstration is carried out through simulation experiments.

[0051] Input data description: 1. Grid files: wangge.shp, wangge.txt (including grid unit number, node number, edge, elevation); 2. Boundary setting instructions: bj.yml (defines boundary grid cells and morphological templates); 3. Boundary time series data: tides_2023.csv (time format: YYYYMMDDHHMM); 4. River network hydrodynamic model execution program: 2D.exe; LLM instructions, the instructions are as follows: 1 Generate river network hydrodynamic model file package; 2 The flow boundary grid unit is, and the water level boundary grid unit is 3 The boundary time series are interpolated to 1 hour intervals; 4 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: Grid file: network.dat; contains the grid number, node number, edge number, and elevation; Boundary file: contains the cells and of the boundary mesh; 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: 2D.zip.

[0053] The process code is as follows: import deepseek from deepseek.geo import HydroProcessor class HydroSmartWorkflow: def __init__(self): self.llm = deepseek.LLM self.geo_engine = HydroProcessor() self.knowledge = self.llm.load_knowledge("hydro_rules") def execute_workflow(self, dem_path, config): """Complete execution process""" # Phase 1: Intelligent Region Division water_level = config.get("normal_water_level", "5.0m") zones = self.region_partition(dem_path, water_level) # Phase 2: Adaptive mesh generation grid = self.generate_adaptive_grid(zones) # Stage 3: Terrain interpolation optimization storage_curve = config.get("storage_curve") best_interp = self.optimize_interpolation(grid, storage_curve) # Stage 4: Automatic model construction model_pkg = self.build_model(grid, best_interp, config) return model_pkg def region_partition(self, dem_path, water_level): """Intelligent regional division""" # Water level semantic analysis parsed_level = self.llm.parse_value(water_level, unit="m") Multimodal terrain analysis analysis_prompt = f""" Based on DEM data and benchmark water level {parsed_level}m: 1. Calculate water depth = water level elevation - ground elevation 2. Classification by water depth: - Deep water area: water depth ≥ 2m - Transition zone: 1m≤water depth<2m - Shoreline area: water depth <1m 3. Output GeoJSON format partition vector """ zones = self.llm.geo_analysis(dem_path, analysis_prompt) return self.geo_engine.validate_zones(zones) def generate_adaptive_grid(self, zones): """Adaptive mesh generation""" # Get grid parameter suggestions param_prompt = f""" Recommended grid parameters based on region type: {zones.metadata} rule: - Deep water area: unstructured grid, size 1000m - Transition zone: unstructured grid, size 250m - Shoreline area: unstructured grid, boundary density increased to 100m - Engineering facility area: unstructured grid, with boundaries increased to 100m - River channel area: structured grid, size 500*200m """ grid_params = self.llm.generate_params(param_prompt) # Perform mesh generation return self.geo_engine.generate_grid( zones, params=grid_params, adapter=NHRI_GRIDAdapter def optimize_interpolation(self, grid, storage_curve): """Interpolation algorithm optimization""" # Knowledge base search similar_cases = self.knowledge.search( features={ "terrain_type": grid.metadata['terrain_class'], "data_quality": grid.metadata['data_score'] } # Algorithm comparison candidates = ["IDW", "Kriging", "NNI"] best_method = None min_error = float('inf') for method in candidates: # Perform interpolation dem_interp = self.geo_engine.interpolate(grid, method) # Storage capacity verification computed_curve = self.calculate_storage_curve(dem_interp) rmse = self.compare_curves(storage_curve, computed_curve) def calculate_storage_curve(dem): volumes = [] for level in [10.0, 15.0]: # Calculate the volume below the water level volume = np.sum(level - dem[dem < level] * cell_area) volumes.append(volume) return volumes # Record knowledge self.knowledge.record_case(method, rmse) if rmse < min_error: best_method = method min_error = rmse return best_method def build_model(self, grid, interp_method, config): """Automatic model building""" # Parsing natural language instructions cmd_parser = """ Extract key parameters from user instructions: - Boundary type (flow / water level) - Time step - Output format requirements """ params = self.llm.parse_config(config["user_command"], cmd_parser) # Generate configuration file return ModelBuilder().compile( grid=grid, interp_method=interp_method, params=params ) In summary, this method effectively solves the technical bottlenecks of traditional modeling methods, such as reliance on manual experience, time-consuming meshing, and cumbersome adjustments, and realizes integrated intelligent modeling from data preprocessing to model deployment.

[0054] 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 preferred embodiments, those skilled in the art should understand that the technical solutions of the present invention may be modified or replaced by equivalents without departing from the spirit and scope of the technical solutions of the present invention, which should all be included in the scope of the claims of the present invention.

Claims

1. A system for intelligently constructing a two-dimensional hydrodynamic model based on a large language model, characterized by: include, The regional block intelligent division module is used to parse geographic information data through the large language model LLM, identify terrain features and engineering facilities, and divide deep water areas, beach-wet alternating zones, coastlines, river channel areas, and engineering facility areas; Adaptive grid generation module, used to set grid generation rules and different grid types. The river channel area is a structured grid, and other areas are unstructured grids. Different grid densities can be dynamically set according to different partitions. The terrain interpolation optimization module is used to verify the results based on the water level-reservoir capacity relationship, select the interpolation algorithm to calculate the grid unit terrain, solve the optimal grid terrain, and check and mark the grid units with abnormal elevation changes; The two-dimensional hydrodynamic model construction module is used to output the grid and time series data into a configuration file according to the target two-dimensional hydrodynamic model format requirements to construct a two-dimensional hydrodynamic model.

2. The system for intelligently constructing a two-dimensional hydrodynamic model based on a large language model according to claim 1, characterized in that: The region block intelligent division module includes: The terrain feature extraction submodule builds a terrain semantic parsing algorithm, extracts contour lines from DEM data, divides deep water areas, beach-wet alternation zones, and shoreline boundaries according to the set contour line thresholds, and generates boundary vectors for each area based on the division results; The facility identification submodule integrates an image recognition model, detects engineering facilities through a pre-trained image recognition model, and outputs facility boundary vector data; The vector boundary recognition submodule recognizes the terrain feature extraction submodule, the facility recognition submodule, and the manually uploaded vector layers, and generates the region block boundary according to the vector layers; The area block generation submodule generates polygonal area blocks including river channels, deep water areas, alternating wet and shoal zones, and engineering facilities based on the area block boundary vector files.

3. The system for intelligently constructing a two-dimensional hydrodynamic model based on a large language model as claimed in claim 2, characterized in that: The adaptive grid generation module comprises: The grid type decider selects structured or unstructured grid algorithm according to the area type, where the river channel area adopts structured grid; Dynamic density controller, adaptively setting grid density based on large language model LLM; The dynamic density controller comprises: Manual intervention interface: Provides a visual interface to receive the grid size threshold of a specific area set by the user; Intelligent recommendation unit: when there is no manual setting, it generates the recommended grid size according to the total area of ​​the calculation domain; Density gradient zone generator: set sparse grids for deep water areas, set dense grids from the beach-wet alternation zone to the shoreline area, and set encrypted grids around water conservancy facilities; Mesh drawing unit: through the large language model LLM integration call software program, using structured and unstructured mesh generation methods, to generate and optimize the mesh; The transition layer generation unit configures multi-level transition layers in different density intervals, inserts gradient mesh layers between adjacent areas with density differences exceeding 50%, and sets the adjacent mesh size ratio to at least 1.5:

1.

4. The system for intelligently constructing a two-dimensional hydrodynamic model based on a large language model as claimed in claim 3, characterized in that: The terrain interpolation optimization module includes the following contents: Multi-algorithm interpolation engine: Integrates the inverse distance weighted method, Kriging interpolation and natural neighbor method, and selects the initial interpolation algorithm based on the spatial distribution and terrain characteristics of DEM data in different regional blocks; Water level-reservoir capacity verifier: compares the root mean square error of the simulated water level-reservoir capacity curve with the measured data. If the error exceeds 5%, it triggers the interpolation algorithm switching or parameter adjustment to find different optimal interpolation algorithms suitable for each area block; Elevation Anomaly Detector: Calculates the elevation gradient between a grid cell and its neighbors , when the elevation gradient When the grid cell is marked as abnormal, the spatial distribution heat map of the abnormal grid is displayed, and the interpolation algorithm reset suggestion and manual value revision option are pushed to the user. , is the average elevation of the area.

5. The system for intelligently constructing a two-dimensional hydrodynamic model based on a large language model as claimed in claim 4, characterized in that: The multi-algorithm interpolation engine includes the following: IDW interpolation elevation values The calculation formula is: , ; In the formula, For known points The elevation value of For point Treat interpolation points The influence weight of the elevation value; Points to be interpolated and known points The Euclidean distance of is the distance attenuation parameter; Kriging interpolation method to interpolate elevation values The calculation formula is: ; In the formula, For known points The elevation value of It is determined by solving the Kriging equations. The calculation formula is: ; In the formula, is the semi-coefficient of variation; Represents a known point With prediction point The variance function value between ; is the weight to be solved; μ is the Lagrange multiplier; and are the indices of known data points. is the identifier of the equation row, It is the traversal operator of the equation series, and its value range is 1, 2, …, n; Natural neighbor method to interpolate elevation values The calculation formula is: ; In the formula, To be inserted The new Thiessen polygons and the original points The overlapping area of ​​Thiessen polygons; is the total area of ​​the Thiessen polygons of the points to be inserted; m is the number of natural neighbor points.

6. The system for intelligently constructing a two-dimensional hydrodynamic model based on a large language model as claimed in claim 5, characterized in that: The water level-storage capacity verifier includes the following: Calculate the storage capacity: ; ; ; Where: k is the grid unit number; is the total amount of grid cells; is the grid area, , are the vertical and horizontal coordinates of the vertex, is the effective water depth of the unit, is the bottom elevation constant, h is the water level; is the simulated storage capacity value; Defining the water level-reservoir capacity relationship error for: ; Algorithm adjustment is triggered when the following conditions are met: ; or ; Where: is the number of measured water level-reservoir capacity data points, For the Water level value, is the simulated storage capacity value, is the measured storage capacity value, For all measured water level intervals.

7. The system for intelligently constructing a two-dimensional hydrodynamic model based on a large language model as claimed in claim 6, characterized in that: The selection of the initial interpolation algorithm includes the following contents: Record historical interpolation schemes and error data, build an interpolation algorithm optimization knowledge base, and record the mapping relationship between DEM features and optimal interpolation algorithms of historical cases for initial algorithm recommendation; Construct a multidimensional feature vector based on region type, point cloud density, grid size, elevation standard deviation, data missing rate and computational domain area to record the mapping relationship between historical DEM features and the optimal interpolation algorithm; Normalize the feature vector: ; ; ; In the formula, Original eigenvalues; For the The standardized value of the feature; Features The historical average value of Features The standard deviation of historical data; is the point cloud density, is the grid size, is the elevation standard deviation, is the data missing rate, A is the area of ​​the calculation domain; is the total number of samples; For the The sample eigenvalues; is the feature vector; Adopt incremental learning and weight decay strategies to dynamically update the knowledge base, retain valid cases within 12 months and reduce the weight of expired data; For new tasks, the neural network model is used to learn the nonlinear mapping relationship between terrain features and the optimal interpolation algorithm, match the Top5 historical cases, and recommend the interpolation solution with the lowest root mean square error (RMSE) through the inner product similarity and error tolerance threshold. The historical case storage structure is expressed as: ; In the formula, Indicates Topographical features of the historical cases; is the optimal interpolation algorithm, For the The accuracy of the interpolation algorithm in each case; Timestamp for case entry; M is the total number of historical cases; The inner product similarity calculation is performed, and the calculation formula is: ; ; In the formula, Interpolation problem is needed for the current situation; The knowledge base feature vector of historical cases; is the modulus of the vector; No. The timeliness weight of historical cases, is the current timestamp, The timestamp of case entry. is the attenuation coefficient, T 0 is the time normalization constant.

8. A method for intelligently constructing a two-dimensional hydrodynamic model based on a large language model, based on the system for intelligently constructing a two-dimensional hydrodynamic model based on a large language model according to any one of claims 1 to 7, characterized in that: include, Through the large language model (LLM), DEM data, satellite images and water conservancy facilities vector layer are integrated to extract terrain contours and spatial distribution of engineering facilities, and to carry out intelligent regional division, including deep water area, beach-wet alternating zone, coastline, river channel and engineering facilities area; The grid division rules are generated by the large language model LLM, structured grids are generated in the river channel area, unstructured grids are generated in other areas, and the grid type is determined; When there is a manually set value, the manually set grid size is used; when there is no manually set value, the recommended grid size is generated according to the total area of ​​the calculation domain, and the multi-level grid density band is generated according to the recommended reference size. A gradient grid layer is inserted between adjacent areas with a density difference of more than 50%, and the grid is drawn to generate an adaptive grid; Select a multi-scale interpolation algorithm to calculate the grid terrain elevation, verify the interpolation accuracy by combining the water level-reservoir capacity curve, switch the interpolation algorithm or adjust the parameter weights; Parse the target two-dimensional hydrodynamic model configuration file format requirements, output the optimized grid and boundary as a structured configuration file according to the format requirements, integrate the configuration file and the executable package, and complete the construction of the two-dimensional hydrodynamic model.

9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: When the processor executes the computer program, the steps of the method for intelligently constructing a two-dimensional hydrodynamic model based on a large language model as described in claim 8 are implemented.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method for intelligently constructing a two-dimensional hydrodynamic model based on a large language model as described in claim 8 are implemented.

Citation Information

Patent Citations

  • Two-dimensional hydrodynamic water quality model construction method

    CN110188483A

  • Hydrodynamic water quality model self-adaptive grid generation method

    CN110188484A

  • Method and device for simulating and predicting drainage basin water environment based on multi-model coupling

    CN114117848A

  • River type reservoir effective storage capacity analysis method and device and electronic equipment

    CN114861473A

  • Flood disaster prediction method and device, equipment and storage medium

    CN118886331A

Cited By

  • Road slope digital elevation model partition reconstruction method based on unmanned aerial vehicle

    CN120088424A

  • Method for Regionally Reconstructing Digital Elevation Model of Highway Slope Based on UAV

    CN120088424B

  • Hall thruster discharge chamber structure simulation optimization method based on finite element analysis

    CN120354679A

  • Port blocking process line planning method and system

    CN120906090A

  • A method and system for planning a stentoplasty procedure

    CN120906090B