Method and System for Intelligently Constructing a Two-Dimensional Hydrodynamic Model Based on a Large Language Model

Through an intelligent construction system based on large language models, the area division, grid generation and terrain interpolation of the two-dimensional hydrodynamic model is automated, which solves the cumbersome and time-consuming problems of traditional modeling methods and realizes an efficient and accurate modeling process.

CN119989995BActive Publication Date: 2025-06-24NANJING HYDRAULIC RES INST
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510482022.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-04-17
Publication Date
2025-06-24
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, and the process of regional division, grid generation and terrain interpolation is cumbersome, time-consuming and prone to local errors.

Method used

An intelligent construction system based on large language models is adopted, and the modeling process is automated through intelligent partitioning of area blocks, adaptive mesh generation and terrain interpolation optimization modules to improve model accuracy and construction efficiency.

Benefits of technology

It realizes integrated intelligent modeling from data preprocessing to model deployment, improves modeling efficiency and accuracy, and reduces manual intervention and errors.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119989995B_ABST
    Figure CN119989995B_ABST
Patent Text Reader

Abstract

The present invention discloses a method and system for intelligently constructing a two-dimensional hydrodynamic model based on a large language model, which relates to the technical fields of artificial intelligence and hydraulic numerical simulation. It includes a regional block intelligent division module for parsing geographic information data through the large language model LLM, identifying topographic features and engineering facilities, and dividing regional blocks; an adaptive grid generation module for setting different grid types and dynamically setting grid densities according to different partitions; a topographic interpolation optimization module for selecting an interpolation algorithm to calculate the terrain of grid cells based on the verification results of the water level-storage capacity relationship, solving the optimal grid terrain, and checking and marking grid cells with abnormal sudden changes in elevation; and a two-dimensional hydrodynamic model construction module for outputting a configuration file according to the requirements of the target two-dimensional hydrodynamic model format with the grid and time series data, and constructing a two-dimensional hydrodynamic model. The present invention effectively solves the problems of relying on manual experience, long time-consuming grid dissection, and cumbersome adjustment, and realizes integrated intelligent modeling.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical fields of artificial intelligence and hydraulic numerical simulation, and particularly 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 the fields of water resources management, flood prevention warning, etc. However, traditional modeling methods rely on a large amount of manual experience, and the processes of regional division, grid generation, and terrain interpolation are cumbersome, time-consuming, and prone to local errors.

[0003] How to utilize artificial intelligence technology to achieve full-process automation of modeling, improve model accuracy and construction efficiency has become a technical problem to be urgently solved. 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 a system for intelligently constructing a two-dimensional hydrodynamic model based on a large language model.

[0005] To solve the above technical problems, the present invention provides the following technical solutions:

[0006] 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 the 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;

[0007] An adaptive grid generation module for setting grid generation rules, setting different grid types, with the river channel area being structured grids and other areas being unstructured grids, and dynamically setting different grid densities according to different partitions;

[0008] A terrain interpolation optimization module for selecting an interpolation algorithm to calculate the terrain of grid cells based on the verification results of the water level-storage relationship, solving the optimal grid terrain, and checking and marking grid cells with abnormal elevation mutations;

[0009] A two-dimensional hydrodynamic model construction module for outputting a configuration file according to the requirements of the target two-dimensional hydrodynamic model format with the grids and time series data, and constructing a two-dimensional hydrodynamic model.

[0010] As a preferred solution of the system for intelligently constructing a two-dimensional hydrodynamic model based on a large language model of the present invention, wherein: the regional block intelligent division module includes:

[0011] The terrain feature extraction sub-module constructs a terrain semantic parsing algorithm to extract contour lines from DEM data, divides the deep water area, the beach-wet alternating zone, and the shoreline boundary according to the set contour line threshold, and generates the boundary vectors of each region according to the division results;

[0012] The facility recognition sub-module integrates an image recognition model to detect engineering facilities through the pre-trained image recognition model and outputs the facility boundary vector data;

[0013] The vector boundary recognition sub-module recognizes the terrain feature extraction sub-module, the facility recognition sub-module, and the vector layer uploaded manually, and generates the regional block boundary according to the vector layer;

[0014] The regional block generation sub-module generates polygon regional blocks including river channels, deep water areas, beach-wet alternating zones, and engineering facilities according to the regional block boundary vector file.

[0015] 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, wherein: the adaptive grid generation module includes:

[0016] The grid type decision-maker selects a structured or unstructured grid algorithm according to the region type, and a structured grid is adopted for the river channel region;

[0017] The dynamic density controller adaptively sets the grid density based on the large language model LLM;

[0018] The dynamic density controller includes:

[0019] The manual intervention interface: provides a visual interface to receive the grid size threshold set by the user for a specific region;

[0020] The intelligent recommendation unit: when there is no manual setting, generates a recommended grid size according to the total area of the computational domain;

[0021] The density gradient band generator: sets sparse grids for the deep water area, dense grids for the beach-wet alternating zone to the shoreline area, and encrypted grids around water conservancy engineering facilities;

[0022] The grid drawing unit: integrally calls software programs through the large language model LLM, and uses structured and unstructured grid generation methods to generate and optimize grids;

[0023] The transition layer generation unit configures multi-level transition layers in different density intervals, inserts a gradient grid layer between adjacent regions with a density difference exceeding 50%, and sets the adjacent grid size ratio to at least 1.5:1.

[0024] 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, wherein: the terrain interpolation optimization module includes the following:

[0025] Multi - algorithm interpolation engine: Integrates the inverse distance weighting method, Kriging interpolation, and natural neighbor method, and selects the initial interpolation algorithm according to the spatial distribution and topographic features of DEM data in different regional blocks;

[0026] Water level - storage capacity validator: Compares the root - mean - square error between the simulated water level - storage capacity curve and the measured data. If the error exceeds 5%, it triggers the switching of the interpolation algorithm or parameter adjustment to find different optimal interpolation algorithms suitable for each regional block;

[0027] Elevation anomaly detector: Calculates the elevation gradient between grid cells and adjacent cells When the elevation gradient , mark the grid cell as abnormal, associate and display the heat map of the spatial distribution of abnormal grids, and push suggestions for resetting the interpolation algorithm and options for manual value assignment and revision to the user, where , is the regional average elevation.

[0028] As a preferred solution of the system for intelligently constructing a two - dimensional hydrodynamic model based on a large - language model of the present invention, wherein: The terrain interpolation optimization module includes the following:

[0029] Multi - algorithm interpolation engine: Integrates the inverse distance weighting method, Kriging interpolation, and natural neighbor method, and selects the initial interpolation algorithm according to the spatial distribution and topographic features of DEM data in different regional blocks;

[0030] Water level - storage capacity validator: Compares the root - mean - square error between the simulated water level - storage capacity curve and the measured data. If the error exceeds 5%, it triggers the switching of the interpolation algorithm or parameter adjustment to find different optimal interpolation algorithms suitable for each regional block;

[0031] Elevation anomaly detector: Calculates the elevation gradient between grid cells and adjacent cells When the elevation gradient , mark the grid cell as abnormal, associate and display the heat map of the spatial distribution of abnormal grids, and push suggestions for resetting the interpolation algorithm and options for manual value assignment and revision to the user, where , is the regional average elevation.

[0032] As a preferred solution of the system for intelligently constructing a two - dimensional hydrodynamic model based on a large - language model of the present invention, wherein: The multi - algorithm interpolation engine includes the following:

[0033] The calculation formula for the elevation value interpolated by the inverse distance weighting method is:

[0034] , ;

[0035] In the formula, is the elevation value of the known point ; is the influence weight of the elevation value of point on the interpolation point ; is the Euclidean distance between the interpolation point and the known point ; is the distance attenuation parameter;

[0036] The elevation value interpolated by the Kriging interpolation method is calculated by the formula:

[0037] ;

[0038] In the formula, is the elevation value of the known point ; The weight is determined by solving the Kriging equations, and the calculation formula is:

[0039] ;

[0040] In the formula, is the semivariogram; represents the variogram value between the known point and the prediction point ; is the weight to be solved; μ is the Lagrange multiplier; and are both indexes of the known data points, is the identifier of the equation row, is the traversal symbol of the equation column, and the value range is 1, 2,..., n;

[0041] The elevation value interpolated by the natural neighbor method is calculated by the formula:

[0042] ;

[0043] In the formula, is the overlapping area between the Thiessen polygon of the point to be interpolated and the Thiessen polygon of the original point ; is the total area of the Thiessen polygon of the point to be interpolated; m is the number of natural neighbor points.

[0044] 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, wherein: the water level - storage capacity validator includes the following:

[0045] Perform storage capacity calculation:

[0046] ;

[0047] ;

[0048] ;

[0049] where: k is the grid cell serial number; is the total number of grid cells; is the grid area, , are the horizontal and vertical coordinates of the vertex respectively, is the effective water depth of the cell, is the bottom elevation constant, h is the water level; is the simulated storage capacity value;

[0050] Define the water level - storage capacity relationship error as:

[0051] ;

[0052] The algorithm adjustment is triggered when the following conditions are met:

[0053] ;

[0054] or

[0055] ;

[0056] where: is the number of measured water level - storage capacity data points, is the th water level value, is the simulated storage capacity value, is the measured storage capacity value, is all measured water level intervals.

[0057] 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, wherein: the selected initial interpolation algorithm includes the following:

[0058] Record the historical interpolation scheme and error data, construct a knowledge base for optimizing the interpolation algorithm, and record the mapping relationship between DEM features - optimal interpolation algorithms of historical cases for initial algorithm recommendation;

[0059] Construct a multi - dimensional feature vector based on region type, point cloud density, grid size, elevation standard deviation, data missing rate, and computational domain area, and record the mapping relationship between historical DEM features and optimal interpolation algorithms;

[0060] Normalize the feature vector:

[0061] ;

[0062] ;

[0063] ;

[0064] Wherein, Original eigenvalue; is the value after standardizing the -th feature; is the historical data average value of feature , is the historical data standard deviation of feature ; is the point cloud density, is the grid size, is the elevation standard deviation, is the data missing rate, and A is the area of the calculation domain; is the total number of samples; is the -th feature value of the -th sample; is the feature vector;

[0065] Adopt the incremental learning and weight decay strategies to dynamically update the knowledge base, retain the valid cases within 12 months and reduce the weights of expired data;

[0066] For a new task, use the neural network model to learn the non-linear mapping relationship between the terrain features and the optimal interpolation algorithm, match the Top5 historical cases, and recommend the interpolation scheme with the lowest root mean square error RMSE through the joint of the inner product similarity and the error tolerance threshold. The storage structure of the historical cases is expressed as:

[0067] ;

[0068] Wherein, represents the terrain features of the -th historical case; is the optimal interpolation algorithm, is the accuracy of the interpolation algorithm in the -th case; is the timestamp when the case is stored in the database; M is the total number of historical cases;

[0069] Perform the inner product similarity calculation, and the calculation formula is:

[0070] ;

[0071] ;

[0072] Wherein, is the current problem to be interpolated; is the feature vector of the th historical case in the knowledge base; is the norm of the vector; The th historical case's timeliness weight, is the current timestamp, is the timestamp when the case is stored in the database, is the decay coefficient, T 0 is the time normalization constant.

[0073] In a 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 vector layers of water conservancy facilities through the large language model LLM, extracting topographic contour lines and the spatial distribution of engineering facilities, and performing intelligent regional division to divide into deep water areas, beach-wet alternating zones, shorelines, river channels, and engineering facility areas;

[0074] Generating grid division rules by the large language model LLM, generating structured grids in the river channel area and unstructured grids in other areas to determine the grid type;

[0075] When there are manually set values, use the manually set grid size; when there are no manually set values, generate a recommended grid size according to the total area of the computational domain, generate a multi-level grid density band according to the recommended reference size, insert a gradient grid layer between adjacent areas with a density difference exceeding 50%, and perform grid drawing to generate an adaptive grid;

[0076] Select a multi-scale interpolation algorithm to calculate the grid terrain elevation, verify the interpolation accuracy in combination with the water level-storage curve, and switch the interpolation algorithm or adjust the parameter weights;

[0077] Analyze the format requirements of the target two-dimensional hydrodynamic model configuration file, output the optimized grid and boundaries as a structured configuration file according to the format requirements, and integrate the configuration file and the executable program package to complete the construction of the two-dimensional hydrodynamic model.

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

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

[0080] It effectively solves the technical bottlenecks of traditional modeling methods that rely on manual experience, time-consuming mesh dissection, and cumbersome adjustment, and realizes integrated intelligent modeling from data preprocessing to model deployment. Description of the Drawings

[0081] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained based on these drawings.

[0082] Figure 1 It is the system architecture diagram for intelligently constructing a two-dimensional hydrodynamic model based on a large language model;

[0083] Figure 2 It is the schematic diagram of the original digital elevation model (DEM) data;

[0084] Figure 3 It is the schematic diagram of regional block division;

[0085] Figure 4 It is the schematic diagram of the grid;

[0086] Figure 5 It is the schematic diagram of grid interpolation;

[0087] Figure 6 It is the schematic diagram of the optimized result of grid interpolation. Detailed Embodiments

[0088] To make the above objects, features, and advantages of the present invention more understandable, the following will describe the detailed embodiments of the present invention in conjunction with the drawings of the specification. Obviously, the described embodiments are part of the embodiments of the present invention, not all of them. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.

[0089] Many specific details are set forth in the following description to facilitate a thorough understanding of the present invention. However, the present invention can also be implemented in other ways different from those described herein. Those skilled in the art can make similar extensions without departing from the connotation of the present invention. Therefore, the present invention is not limited by the specific embodiments disclosed below.

[0090] Secondly, the so-called "one embodiment" or "embodiment" herein refers to a specific feature, structure, or characteristic that can be included in at least one implementation of the present invention. The phrase "in one embodiment" appearing in different places in this specification does not necessarily refer to the same embodiment, nor is it an embodiment that is separate or selectively mutually exclusive with other embodiments.

[0091] Example 1

[0092] Reference Figures 1-6 , which is the first embodiment of the present invention. This embodiment provides a system for intelligently constructing a two-dimensional hydrodynamic model based on a large language model, including:

[0093] System setup and environment configuration:

[0094] Hardware environment: Select appropriate hardware devices according to the data volume 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 inference of the large language model and complex data calculations. At the same time, ensure that the storage device has sufficient space and read / write speed to store the original data, intermediate results, and the finally generated model files.

[0095] Software environment: Set up 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 libraries such as NumPy and Pandas for data processing and analysis. At the same time, configure the environment required for running the large language model (LLM), and install relevant model dependency packages and tools.

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

[0097] Regional block intelligent division module: 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, shorelines, river channels, and engineering facility areas;

[0098] Specifically, the terrain feature extraction sub-module inputs DEM terrain data, as Figure 2 shown, automatically constructs a terrain semantic parsing algorithm through the 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, shorelines, etc. according to elevation thresholds, generating different boundary vectors;

[0099] Facility identification sub-module, using the LLM to integrate an image recognition model, such as the YOLO model, to detect engineering facilities through a pre-trained image recognition model and output facility boundary vector data;

[0100] The vector boundary recognition sub-module recognizes the terrain feature extraction sub-module, the facility recognition sub-module, and the manually uploaded vector layer, and generates the regional block boundary according to the vector layer;

[0101] The regional block generation sub-module generates polygon regional blocks including river channels, deep water areas, beach-wet alternating zones, and engineering facilities according to the regional block boundary vector file, and numbers them in sequence, as Figure 3 shown.

[0102] The adaptive grid generation module is used to set grid generation rules, set different grid types, with structured grids for the river channel area and unstructured grids for other areas, and dynamically set different grid densities according to different partitions;

[0103] Specifically, the grid type decision-maker selects structured or unstructured grid algorithms according to the regional type, with structured grids for the river channel area; the LLM selects structured or unstructured grid algorithms according to the regional type, with structured grids for the river channel area and unstructured grids for the remaining areas;

[0104] The system provides a visual interface to receive the grid size threshold set by the user for a specific area. When there is no manual setting, the LLM generates a recommended grid size according to the total area S (km²) of the computational domain , where K is an adjustment factor; in this embodiment, d = 500m is set.

[0105] The dynamic density controller adaptively sets the grid density based on the large language model LLM; dynamically sets the density according to different partitions: sets sparse grids for the deep water area (d x ≥2d, which is 1000m in this embodiment), sets dense grids from the beach-wet alternating zone to the shoreline area (d m ≤d / 2, which is 250m in this embodiment), and sets encrypted grids around water conservancy engineering facilities ( ≤d / 3, which is 100m in this embodiment);

[0106] Configures multi-level transition layers in different density intervals, and inserts gradient grid layers between adjacent regions with a density difference exceeding 50% to ensure that the adjacent grid size ratio ≤ 1.5:1, achieving smooth transition and avoiding grid mutation.

[0107] Through the LLM, the NHRI_GRID software program with independent intellectual property rights is integrated and called to automatically generate and optimize the grid. The final grid generation result is as Figure 4 shown.

[0108] The terrain interpolation optimization module is used to set grid generation rules, set different grid types, with structured grids for the river channel area and unstructured grids for other areas, and dynamically set different grid densities according to different partitions;

[0109] Specifically, the multi-algorithm interpolation engine integrates the inverse distance weighting method, Kriging interpolation, and natural neighbor method. Based on the DEM data spatial distribution and terrain features of different regional blocks, the initial interpolation algorithm is selected. Through the LLM, for different regional blocks, the initial interpolation algorithm and initial parameters are selected for grid terrain interpolation, and the interpolation results are as Figure 5 shown.

[0110] The elevation value interpolated by the inverse distance weighting method has the following calculation formula:

[0111] , ;

[0112] In the formula, is the elevation value of the known point ; is the influence weight of point on the elevation value of the point to be interpolated ; is the point to be interpolated and the known point 's Euclidean distance; is the distance attenuation parameter;

[0113] The elevation value interpolated by the Kriging interpolation method has the following calculation formula:

[0114] ;

[0115] In the formula, is the elevation value of the known point ; The weight is determined by solving the Kriging equations, and the calculation formula is:

[0116] ;

[0117] In the formula, is the semivariogram; represents the variogram value between the known point and the prediction point ; is the weight to be solved; μ is the Lagrange multiplier; and are both indices of known data points, is the identifier of the equation row, is the traversal symbol of the equation column, and the value range is both 1, 2,..., n;

[0118] The elevation value interpolated by the natural neighbor method has the following calculation formula:

[0119] ;

[0120] In the formula, is the overlapping area between the new Thiessen polygon of the point to be interpolated and the Thiessen polygon of the original point ; is the total area of the Thiessen polygon of the point to be interpolated; is the number of natural neighbor points. m

[0121] The selection of the initial interpolation algorithm includes the following:

[0122] Record the historical interpolation schemes and error data, construct a knowledge base for optimizing interpolation algorithms, and record the mapping relationship between DEM features and optimal interpolation algorithms in historical cases for initial algorithm recommendation in subsequent tasks;

[0123] Construct a multi-dimensional feature vector based on region type, point cloud density, grid size, elevation standard deviation, data missing rate, and calculation domain area, and record the mapping relationship between historical DEM features and optimal interpolation algorithms;

[0124] Feature vector construction:

[0125] Normalization processing:

[0126] ;

[0127] ;

[0128] ;

[0129] In the formula, is the original feature value; is the value of the th feature after standardization; is the average value of the historical data of feature ; is the standard deviation of the historical data of feature ; is the point cloud density, is the grid size, is the elevation standard deviation, is the data missing rate, and A is the calculation domain area; is the total number of samples; is the th feature value of the th sample; is the feature vector.

[0130] Dynamically update the knowledge base using incremental learning and weight decay strategies, retain valid cases within 12 months, and reduce the weights of expired data;

[0131] ​For new tasks, use the neural network model to learn the non-linear mapping relationship between terrain features and the optimal interpolation algorithm, match the Top5 historical cases, and jointly recommend the interpolation scheme with the lowest root mean square error (RMSE) through the inner product similarity and error tolerance threshold. The calculation method is as follows:

[0132] Historical case storage structure:

[0133] ;

[0134] In the formula, represents the terrain features of the th historical case; is the optimal interpolation algorithm, is the accuracy of the interpolation algorithm in the th case; is the timestamp when the case is stored in the database; M is the total number of historical cases.

[0135] Perform the inner product similarity calculation:

[0136] ;

[0137] ;

[0138] In the formula, is the current interpolation problem; is the feature vector of the th historical case in the knowledge base; is the norm of the vector; is the timeliness weight of the th historical case, is the current timestamp, is the timestamp when the case is stored in the database, is the decay coefficient, T 0 is the time normalization constant (the number of seconds in 12 months).

[0139] Parameter adjustment includes the following:

[0140] Inverse distance weighting method parameter adjustment group:

[0141] Power: Dynamically adjust the distance decay exponent , increase p when the interpolation result is overly smooth, and decrease p when there are local distortions;

[0142] Search radius: Adaptively set the maximum search radius according to the DEM point density to avoid extrapolation distortion, , in the formula, is the average spacing of neighboring points;

[0143] Number of neighboring points: Constrain the minimum effective number of points , where is the total number of interpolation points;

[0144] Kriging parameter adjustment group:

[0145] Variogram model: Select a spherical model, exponential model, or Gaussian model;

[0146] Sill value: The sill value C is the maximum value of the variogram, representing the spatial variability of the data. , where is the total variance of the data;

[0147] Nugget value: The nugget value refers to the variance at zero distance, representing measurement error or variability at a small scale. , where C is the sill value;

[0148] Range R: The distance at which the variogram reaches the sill value, representing the spatial correlation range between data. , where is the average distance between neighboring points;

[0149] Natural neighbor method parameter adjustment group:

[0150] Neighbor point number constraint: Set the maximum number of neighbor points to avoid redundant calculations in high-density areas;

[0151] When the error of a single algorithm exceeds the limit, start the IDW-Kriging-NNI hybrid interpolation, and the weight ratio of each interpolation algorithm is dynamically allocated by the large language model LLM according to the local terrain complexity.

[0152] Water level - storage capacity validator: Verify the accuracy of the interpolation results according to the water level - storage capacity curve, and calculate the root mean square error RMSE and the coefficient of determination R 2 , if the error exceeds 5%, then trigger the interpolation algorithm switching or parameter adjustment, find different optimal interpolation algorithms suitable for each regional block; automatically adjust the parameters, calculate the errors of different interpolation algorithms, select different interpolation algorithms suitable for each regional block, and the grid terrain after optimizing the interpolation algorithm is as Figure 6 shown.

[0153] Perform the storage capacity calculation, and the calculation formula is:

[0154] ;

[0155] ;

[0156] ;

[0157] where: k is the grid cell number; is the total number of grid cells; is the grid area, , are the horizontal and vertical coordinates of the vertex respectively. The vertex coordinates are sorted counterclockwise, and (x5, y5) = (x1, y1); is the effective water depth of the unit, is the bottom elevation constant, and h is the water level; is the simulated storage capacity value.

[0158] Define the water level - storage capacity relationship error , and the expression is:

[0159] ;

[0160] When the following conditions are met, trigger the algorithm adjustment:

[0161] ;

[0162] or

[0163] ;

[0164] In the formula: is the number of measured water level - storage capacity data points, is the th water level value, is the simulated storage capacity value, is the measured storage capacity value, is all measured water level intervals.

[0165] Elevation anomaly detector: Calculate the elevation gradient between grid cells and adjacent cells , when the elevation gradient is met, mark the grid cell as abnormal, associate and display the heat map of the spatial distribution of abnormal grids, and push suggestions for resetting the interpolation algorithm and options for manual assignment revision to the user. Among them, , is the regional average elevation.

[0166] Two - dimensional hydrodynamic model construction module: A two - dimensional hydrodynamic model construction module driven by a large - language model, including grid file generation, boundary file generation, etc., for outputting a configuration file according to the requirements of the target two - dimensional hydrodynamic model format with grid and time - series data, and automatically constructing a two - dimensional hydrodynamic model.

[0167] Specifically, the format parsing unit: Parse the configuration file and input file format requirements of the target two - dimensional hydrodynamic model by the LLM; generate a grid structure file that meets the format requirements for the two - dimensional hydrodynamic model.

[0168] Automated configuration unit: Generate a dat file with grid node coordinates and terrain elevations in the target format.

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

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

[0171] Furthermore, this 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 vector layers of water conservancy facilities through the large language model LLM, extracting topographic contour lines and spatial distributions of engineering facilities, and performing intelligent regional division, dividing into deep water areas, beach-wet alternating zones, shorelines, river channels, and engineering facility areas;

[0172] Generate grid division rules by the large language model LLM, generate structured grids in the river channel area, and generate unstructured grids in other areas to determine the grid type;

[0173] When there is a manually set value, use the manually set grid size; when there is no manually set value, generate a recommended grid size according to the total area of the computational domain, generate a multi-level grid density band according to the recommended reference size, insert a gradient grid layer between adjacent areas with a density difference exceeding 50%, and perform grid drawing to generate an adaptive grid;

[0174] Select a multi-scale interpolation algorithm to calculate the grid terrain elevation, and verify the interpolation accuracy in combination with the water level-storage curve. When RMSE>5%, automatically switch the interpolation algorithm or adjust the parameter weights;

[0175] Analyze the format requirements of the target two-dimensional hydrodynamic model configuration file, output the optimized grid and boundary as a structured configuration file according to the format requirements, and integrate the configuration file and the executable program package to complete the construction of the two-dimensional hydrodynamic model.

[0176] This embodiment also provides a computer device, applicable to the situation of a system for intelligently constructing 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 the 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.

[0177] This embodiment also provides a storage medium, on which a computer program is stored. When the computer program is executed by a processor, it executes the system in any optional implementation manner of the above embodiment. Among them, 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 (SRAM for short), electrically erasable programmable read-only memory (EEPROM for short), erasable programmable read-only memory (EPROM for short), programmable read-only memory (PROM for short), read-only memory (ROM for short), magnetic memory, flash memory, magnetic disk or optical disc.

[0178] The storage medium proposed in this embodiment and the data storage method proposed in the above embodiment belong to the same inventive concept. Technical details not described in detail in this embodiment can be referred to the above embodiment, and this embodiment has the same beneficial effects as the above embodiment.

[0179] Embodiment 2

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

[0181] Input data description:

[0182] 1. Grid files: wangge.shp, wangge.txt (including grid cell numbers, node numbers, edges, elevations);

[0183] 2. Boundary setting instructions: bj.yml (defining boundary grid cells and morphological templates);

[0184] 3. Boundary time series data: tides_2023.csv (time format: YYYYMMDDHHMM);

[0185] 4. River network hydrodynamic model execution program: 2D.exe;

[0186] LLM instructions, the instructions are as follows:

[0187] 1 Generate a river network hydrodynamic model file package;

[0188] The 2 flow boundary grid cells are, and the water level boundary grid cells are

[0189] 3 The boundary time series interpolation is at 1-hour intervals;

[0190] 4 The calculation time step is 1 s, and the calculation is for 72 hours, starting from January 1, 2025.

[0191] Output data in the following format:

[0192] Grid file: network.dat; contains grid numbers, node numbers, edge numbers, and elevations;

[0193] Boundary file: contains the cells of the boundary grid and;

[0194] Boundary input file: input.dat; contains time series data such as flow and water level;

[0195] Model control file: control.dat; contains the model calculation step and calculation time;

[0196] Model package file: 2D.zip.

[0197] The process code is as follows:

[0198] import deepseek

[0199] from deepseek.geo import HydroProcessor

[0200] class HydroSmartWorkflow:

[0201] def __init__(self):

[0202] self.llm = deepseek.LLM

[0203] self.geo_engine = HydroProcessor()

[0204] self.knowledge = self.llm.load_knowledge("hydro_rules")

[0205] def execute_workflow(self, dem_path, config):

[0206] """Execute the complete process"""

[0207] # Phase 1: Intelligent area division

[0208] water_level = config.get("normal_water_level", "5.0m")

[0209] zones = self.region_partition(dem_path, water_level)

[0210] # Phase 2: Adaptive grid generation

[0211] grid = self.generate_adaptive_grid(zones)

[0212] # Phase 3: Terrain interpolation optimization

[0213] storage_curve = config.get("storage_curve")

[0214] best_interp = self.optimize_interpolation(grid, storage_curve)

[0215] # Phase 4: Automatic model construction

[0216] model_pkg = self.build_model(grid, best_interp, config)

[0217] return model_pkg

[0218] def region_partition(self, dem_path, water_level):

[0219] """Intelligent regional partitioning"""

[0220] # Water level semantic parsing

[0221] parsed_level = self.llm.parse_value(water_level, unit="m")

[0222] # Multimodal terrain analysis

[0223] analysis_prompt = f"""

[0224] Based on DEM data and the reference water level {parsed_level}m:

[0225] 1. Calculate water depth = water level elevation - ground elevation

[0226] 2. Divide by water depth:

[0227] - Deep water area: water depth ≥ 2m

[0228] - Transition area: 1m ≤ water depth < 2m

[0229] - Shoreline area: water depth < 1m

[0230] 3. Output partition vector in GeoJSON format

[0231] """

[0232] zones = self.llm.geo_analysis(dem_path, analysis_prompt)

[0233] return self.geo_engine.validate_zones(zones)

[0234] def generate_adaptive_grid(self, zones):

[0235] """Adaptive grid generation"""

[0236] # Obtain grid parameter suggestions

[0237] param_prompt = f"""

[0238] Recommend grid parameters according to area type:

[0239] {zones.metadata}

[0240] Rules:

[0241] - Deep water area: unstructured grid, size 1000m

[0242] - Transition area: unstructured grid, size 250m

[0243] - Shoreline area: unstructured grid, boundary encrypted to 100m

[0244] - Engineering facility area: unstructured grid, boundary encrypted to 100m

[0245] - River channel area: structured grid, size 500*200m

[0246] """

[0247] grid_params = self.llm.generate_params(param_prompt)

[0248] # Execute grid generation

[0249] return self.geo_engine.generate_grid(

[0250] zones,

[0251] params=grid_params,

[0252] adapter=NHRI_GRIDAdapter

[0253] def optimize_interpolation(self, grid, storage_curve):

[0254] """Optimize interpolation algorithm"""

[0255] # Knowledge base retrieval

[0256] similar_cases = self.knowledge.search(

[0257] features={

[0258] "terrain_type": grid.metadata['terrain_class'],

[0259] "data_quality": grid.metadata['data_score']

[0260] }

[0261] # Algorithm comparison and selection

[0262] candidates = ["IDW", "Kriging", "NNI"]

[0263] best_method = None

[0264] min_error = float('inf')

[0265] for method in candidates:

[0266] # Execute interpolation

[0267] dem_interp = self.geo_engine.interpolate(grid, method)

[0268] # Storage capacity verification

[0269] computed_curve = self.calculate_storage_curve(dem_interp)

[0270] rmse = self.compare_curves(storage_curve, computed_curve)

[0271] def calculate_storage_curve(dem):

[0272] volumes = []

[0273] for level in [10.0, 15.0]:

[0274] # Calculate the volume below the water level

[0275] volume = np.sum(level - dem[dem < level] * cell_area)

[0276] volumes.append(volume)

[0277] return volumes

[0278] # Record knowledge

[0279] self.knowledge.record_case(method, rmse)

[0280] if rmse < min_error:

[0281] best_method = method

[0282] min_error = rmse

[0283] return best_method

[0284] def build_model(self, grid, interp_method, config):

[0285] """Automatic model building"""

[0286] # Parse natural language instructions

[0287] cmd_parser = """

[0288] Extract key parameters from the user instruction:

[0289] - Boundary type (flow / water level)

[0290] - Time step

[0291] - Output format requirements

[0292] """

[0293] params = self.llm.parse_config(config["user_command"], cmd_parser)

[0294] # Generate configuration file

[0295] return ModelBuilder().compile(

[0296] grid=grid,

[0297] interp_method=interp_method,

[0298] params=params )

[0300] In summary, the present method effectively solves the technical bottlenecks of traditional modeling methods that rely on manual experience, take a long time to divide grids, and are cumbersome to adjust, and realizes an integrated intelligent modeling from data preprocessing to model deployment.

[0301] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit them. Although the present invention has been described in detail with reference to the preferred embodiments, those of ordinary skill in the art should understand that the technical solutions of the present invention can be modified or equivalently replaced without departing from the spirit and scope of the technical solutions of the present invention, and they should all be covered by 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; 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 according to the area block boundary vector files; 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 adaptive grid generation module comprises: 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 the predetermined 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; 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 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 region; 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 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.

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 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.

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 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; 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 first The feature vector of each historical case; 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.

5. 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 4, 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.

6. 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 5 are implemented.

7. 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 5 are implemented.

Citation Information

Patent Citations

  • Hydrodynamic water quality model self-adaptive grid generation method

    CN110188484A

  • Water conservancy sensing system based on edge calculation

    CN119737932A