A graphical representation and editing method for HEC-HMS model input files and its terminal device

By using graph data structures and graph traversal algorithms, the problem of low editing efficiency of HEC-HMS model input files is solved, enabling efficient retrieval and editing, and supporting the integrated application of the model with other software.

CN115408339BActive Publication Date: 2026-04-03QUANZHOU NORMAL UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-09-05
Publication Date
2026-04-03

Smart Images

  • Figure CN115408339B_ABST
    Figure CN115408339B_ABST
Patent Text Reader

Abstract

This invention provides a method for graph representation and editing of HEC-HMS model input files and a terminal device thereof, suitable for execution on a computing device, comprising the following steps: Step S10, receiving HEC-HMS model parameter paths and parameter value information to be modified; Step S20, determining whether the HEC-HMS model graph network data has been loaded; if not loaded, proceeding to Step S30, otherwise proceeding to Step S40; Step S30, loading model parameter information from the HEC-HMS model input file, and converting the input file into a graph network data structure based on the relationships between parameters; Step S40, modifying the HEC-HMS model graph network data according to the HEC-HMS model parameter paths and parameter value information to be modified; Step S50, converting the HEC-HMS model graph network data into the HEC-HMS model input file format, storing it, and replacing the original model file. Applying this technical solution enables flexible and efficient modification of model parameters, and significantly improves the retrieval and matching speed of parameters to be modified.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of input information storage and retrieval technology for distributed hydrological models, and in particular to a graphical representation and editing method for HEC-HMS model input files and its terminal device. Background Technology

[0002] All information about the HEC-HMS model's operation is stored in its input files, including those with extensions such as ".basin", ".control", ".run", ".gage", and ".hms". When using the HEC-HMS model for model calibration (the process of finding suitable model parameters through trial and error) or hydrological simulation and forecasting, it is necessary to continuously update the model's input files, execute model simulations, and analyze the results. However, as free software, HEC-HMS does not provide a corresponding tool for editing its model input files or publicly available interface for its input file editing application. Therefore, if users need to integrate the HEC-HMS model with other software (such as using SWAT-CUP software for HEC-HMS model calibration), they need to implement their own HEC-HMS model input file editing tool. Currently, although there are some reports of HEC-HMS model integration with other software, there are no reports of a dedicated HEC-HMS model input file editing tool being implemented. While common text editing tools (such as Notepad and UltraEdit) can still be used to edit HEC-HMS model input files, these tools cannot be used when automated input file editing is required. Furthermore, these tools do not take into account the unique file structure of HEC-HMS model input files, making efficient file content retrieval and editing impossible.

[0003] The HEC-HMS model input file is organized hierarchically and in blocks. The first line of each block consists of "[level indentation] block type: [block name]", and the last line is "[level indentation] End block type: [block name]". The content between the first and last lines represents the set of blocks at the next lower level. To maintain the containment relationship between blocks, the lower-level blocks are indented by a certain number of characters. When a block is a unit block, i.e., a block contains only atomic information, its format is "[level indentation] block name: block value". Except for unit blocks, blank lines must exist between blocks of the same level to separate them. Existing HEC-HMS model input file editing tools use a line-by-line comparison method for searching and editing the content, with a time complexity of O(n).

[0004] On the other hand, when users provide file modification requests that include links between blocks, file editing cannot be achieved through simple line-by-line comparison. Manual intervention is required to determine or write complex regular expressions to represent these links. Due to the lack of relevant application programming interfaces (APIs), these tools cannot be used for automated batch editing, thus hindering integration with other software. Summary of the Invention

[0005] In view of this, the purpose of this invention is to provide a graphical representation and editing method for HEC-HMS model input files and a terminal device thereof, so as to realize flexible and efficient modification of model parameters and significantly improve the retrieval and matching speed of parameters to be modified.

[0006] To achieve the above objectives, the present invention adopts the following technical solution: a graphical representation and editing method for HEC-HMS model input files, suitable for execution on a computing device, comprising the following steps:

[0007] Step S10: Receive the HEC-HMS model parameter path and parameter value information to be modified;

[0008] Step S20: Determine whether the HEC-HMS model graph network data has been loaded. If not, proceed to step S30; otherwise, proceed to step S40.

[0009] Step S30: Load model parameter information from the HEC-HMS model input file, and convert the input file into a graph network data structure based on the relationship between the parameters;

[0010] Step S40: Modify the HEC-HMS model graph network data based on the HEC-HMS model parameter path and the parameter values ​​to be modified.

[0011] Step S50: Convert the HEC-HMS model graph network data into the HEC-HMS model input file format, store it, and replace the original model file.

[0012] In a preferred embodiment, the structure of the HEC-HMS model parameter path and the parameter value information to be modified in step S10 consists of several block information and one parameter information to be modified connected by a "." symbol; each block includes a block type and a block name, which are connected by a ":" symbol; the block information can also be composed of "#" and "*", where "#" and "*" represent one and any number of anonymous blocks, respectively; the parameter information to be modified consists of a parameter name and a parameter value connected by a ":" symbol.

[0013] In a preferred embodiment, step S30 includes:

[0014] Step S3-1: Create a root node for the model input file, read the file content into a string list line by line, and call the recursive functions defined in steps S3-2 to S3-11 with the root node and the string list as parameters.

[0015] Step S3-2: The recursive function receives a node and a list of strings, initially setting the row identifier to 0;

[0016] Step S3-3: Determine if the row identifier is less than the number of elements in the string list. If yes, proceed to step S3-4; otherwise, end the process.

[0017] Step S3-4: Determine whether the row pointed to by the current row identifier is empty. If it is, proceed to step S3-5; otherwise, proceed to step S3-6.

[0018] Step S3-5: Create an empty node, add it to the child node list of the receiving node of the recursive function, increment the row identifier by 1, and jump to step S3-3.

[0019] Step S3-6: Calculate the number of rows contained in the next parameter block;

[0020] Step S3-7: Determine whether the parameter block contains more than two lines. If so, execute steps S3-8 and S3-9 in sequence; otherwise, execute step S3-10.

[0021] Step S3-8: Create a multi-line block node and add it to the child node list of the receiving node of the recursive function;

[0022] Step S3-9: Construct a new string list, which contains the block content excluding the first and last lines. Then, call step S3-2 with the multi-line block node created in step S3-8 and the newly constructed string list as parameters. After completing the recursive call, execute step S3-11.

[0023] Step S3-10: Construct a single-row block node and add it to the child node list of the receiving node of the recursive function, then execute step S3-11;

[0024] Step S3-11: Update the row identifier to the sum of the current row identifier value and the number of block rows calculated in step S3-6, and then proceed to step S3-3.

[0025] In a preferred embodiment, step S40 includes:

[0026] Step S4-1: Using the path information of the parameters to be modified and the root node of the HEC-HMS model graph network as parameters, call steps S4-2 to S4-13 to define the recursive function.

[0027] Step S4-2: The recursive function receives the path information and graph network nodes for the modified parameters;

[0028] Step S4-3: Divide the path of the modified parameters into multiple units using "." as the separator;

[0029] Step S4-4: Determine the number of path division units for modifying parameters. If there is only one unit, proceed to step S4-5; otherwise, proceed to step S4-8.

[0030] Step S4-5: Using ":" as the separator, further decompose the first unit of the path where the parameters are modified;

[0031] Step S4-6: Determine whether the first part of the decomposition is equal to the P1 value of the receiving node. If they are not equal, the process ends; otherwise, proceed to step S4-7.

[0032] Step S4-7: Set the P2 value of the node to the content of the second part after decomposition, and end the process;

[0033] Step S4-8: Compare the value of the first cell. If the value of the first cell is the same as "*", proceed to step S4-9. If the value of the first cell is the same as "#", proceed to step S4-10. Otherwise, proceed to step S4-11.

[0034] Step S4-9: Find all direct and indirect child nodes of the current node and place them in the temporary child node set, then execute step S4-12;

[0035] Step S4-10: Find all direct child nodes of the current node and place them in the temporary child node set, then execute step S4-12;

[0036] Step S4-11: Find the child node that matches the first cell value among all the direct child nodes of the current node and place it in the temporary child node set, then execute step S4-12;

[0037] Step S4-12: Set the path information of the modified parameters to the path after removing the first part of the content;

[0038] Step S4-13: Traverse the elements in the temporary child node set, call the recursive function with the updated parameter path and the current element as parameters, and end the process after the call is completed.

[0039] In a preferred embodiment, step S50 includes:

[0040] Step S5-1: Create a list of strings, and use the list and the root node of the HEC-HMS model graph network as parameters to call the recursive functions defined in steps S5-2 to S5-10.

[0041] Step S5-2: The recursive function receives a list of strings and graph network nodes;

[0042] Step S5-3: Determine whether the P1 variable of the graph network node is empty. If it is empty, proceed to step S5-4; otherwise, proceed to step S5-5.

[0043] Step S5-4: Add an element to the string list, which is an empty string, and then proceed to step S5-6.

[0044] Step S5-5: Add an element to the string list. The content of this element is the value of P1 plus ":" plus the value of P2. Then execute step S5-6.

[0045] Step S5-6: Determine if the number of direct child nodes of a node in the graph network is greater than zero. If it is, proceed to step S5-7; otherwise, proceed to step S5-8.

[0046] Steps S5-7: Traverse all direct child nodes of the current node. During the first traversal, call the recursive function with the child node and the list of strings as parameters.

[0047] Step S5-8: Determine if the P3 value of the current node is empty. If it is not empty, proceed to step S5-9; otherwise, proceed to step S10.

[0048] Step S5-9: Add an element to the string list. The content of this element is the value of P3 plus ":" plus the value of P4. Then execute step S5-10.

[0049] Step S5-10: Write the string list elements into the input file of the HEC-HMS model in sequence.

[0050] The present invention also provides a terminal device for graphical representation and editing of HEC-HMS model input files, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the steps of the graphical representation and editing method for HEC-HMS model input files as described above.

[0051] The present invention also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the graphical representation and editing method for an HEC-HMS model input file as described above.

[0052] Compared with the prior art, the present invention has the following beneficial effects:

[0053] In this invention, we utilize a graph data structure to store the content of HEC-HMS model input files and the relationships between blocks. Furthermore, the paths within the graph data structure enable rapid retrieval and editing of the HEC-HMS model input file content. Regarding the efficiency of HEC-HMS model input file content retrieval and editing, the graph traversal algorithm offers advantages not found in commonly used text editing tools. For example, when the HEC-HMS model input file content is generalized to a binary tree, its time complexity is only O(logn). This graph representation and editing method for HEC-HMS model input files can be integrated with other software, such as using SWAT-CUP software to calibrate the HEC-HMS model, thereby leveraging the role of the HEC-HMS model in hydrological simulation and forecasting. Attached Figure Description

[0054] Figure 1 This is a schematic diagram of the graphical representation and editing process of the HEC-HMS model input file according to a preferred embodiment of the present invention;

[0055] Figure 2 This is a schematic diagram illustrating the structure and composition of the parameter modification path in a preferred embodiment of the present invention;

[0056] Figure 3 This is a flowchart illustrating the graph network representation of the HEC-HMS model file according to a preferred embodiment of the present invention.

[0057] Figure 4 This is an example diagram of the graph network node structure and the graph network representation of the HEC-HMS model sample file, which is a preferred embodiment of the present invention.

[0058] Figure 5 This is a flowchart illustrating the parameter modification process of the HEC-HMS model based on a graph network representation, according to a preferred embodiment of the present invention.

[0059] Figure 6 This is a schematic diagram illustrating the conversion of graph network data into an HEC-HMS model input file, which is a preferred embodiment of the present invention. Detailed Implementation

[0060] The present invention will be further described below with reference to the accompanying drawings and embodiments.

[0061] It should be noted that the following detailed descriptions are illustrative and intended to provide further explanation of this application. Unless otherwise specified, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains.

[0062] It should be noted that the terminology used herein is for the purpose of describing particular implementations only and is not intended to limit the exemplary implementations according to this application; as used herein, the singular form is intended to include the plural form as well, unless the context clearly indicates otherwise; furthermore, it should be understood that when the terms “comprising” and / or “including” are used in this specification, they indicate the presence of features, steps, operations, devices, components and / or combinations thereof.

[0063] like Figure 1 As shown, this embodiment provides a graphical representation and editing method for HEC-HMS model input files, as well as a terminal device.

[0064] A graphical representation and editing method for HEC-HMS model input files, suitable for execution on a computing device, the method comprising:

[0065] Step S10: Receive the HEC-HMS model parameter path and parameter value information to be modified;

[0066] Step S20: Determine whether the HEC-HMS model graph network data has been loaded. If not, proceed to step S30; otherwise, proceed to step S40.

[0067] Step S30: Load model parameter information from the HEC-HMS model input file, and convert the input file into a graph network data structure based on the relationship between the parameters;

[0068] Step S40: Modify the HEC-HMS model graph network data based on the HEC-HMS model parameter path and the parameter values ​​to be modified.

[0069] Step S50: Convert the HEC-HMS model graph network data into the HEC-HMS model input file format, store it, and replace the original model file.

[0070] like Figure 2 As shown, the structure of the HEC-HMS model parameter path and the parameter value information to be modified in step S10 consists of several block information and one parameter information to be modified connected by "."; each block includes a block type and a block name, which are connected by ":"; the block information can also be composed of "#" and "*", where "#" and "*" represent one and any number of anonymous blocks, respectively; the parameter information to be modified consists of the parameter name and parameter value connected by ":".

[0071] like Figure 3 As shown, step S30 includes the following steps:

[0072] Step S3-1: Create a root node for the model input file, read the file content into a string list line by line, and call the recursive functions defined in steps S3-2 to S3-11 with the root node and the string list as parameters.

[0073] Step S3-2: The recursive function receives a node and a list of strings, initially setting the row identifier to 0;

[0074] Step S3-3: Determine if the row identifier is less than the number of elements in the string list. If yes, proceed to step S3-4; otherwise, end the process.

[0075] Step S3-4: Determine whether the row pointed to by the current row identifier is empty. If it is, proceed to step S3-5; otherwise, proceed to step S3-6.

[0076] Step S3-5: Create an empty node, add it to the child node list of the receiving node of the recursive function, increment the row identifier by 1, and jump to step S3-3.

[0077] Step S3-6: Calculate the number of rows contained in the next parameter block;

[0078] Step S3-7: Determine whether the parameter block contains more than two lines. If so, execute steps S3-8 and S3-9 in sequence; otherwise, execute step S3-10.

[0079] Step S3-8: Create a multi-line block node and add it to the child node list of the receiving node of the recursive function;

[0080] Step S3-9: Construct a new string list, which contains the block content excluding the first and last lines. Then, call step S3-2 with the multi-line block node created in step S3-8 and the newly constructed string list as parameters. After completing the recursive call, execute step S3-11.

[0081] Step S3-10: Construct a single-row block node and add it to the child node list of the receiving node of the recursive function, then execute step S3-11;

[0082] Step S3-11: Update the row identifier to the sum of the current row identifier value and the number of block rows calculated in step S3-6, and then proceed to step S3-3.

[0083] like Figure 4As shown, the root node, empty node, multi-line block node, and single-line block node described in steps S3-1 to S3-11 have the same structure. They all contain four string variables (P1, P2, P3, and P4) storing parameter information and a list set (Children) storing child nodes. When it is a root node, the value of P1 is "root", the value of P2 is the HEC-HMS input file name, and the other variables are empty. When it is an empty node, all variables are empty. When it is a single-line node, the value of P1 is the parameter name, and the value of P2 is the parameter value. When it is a multi-line block node, the value of P1 is the block type, the value of P2 is the block name, P3 is the block end marker, and P4 is also the block name or is empty.

[0084] like Figure 5 As shown, step S40, the running steps include:

[0085] Step S4-1: Using the path information of the parameters to be modified and the root node of the HEC-HMS model graph network as parameters, call steps S4-2 to S4-13 to define the recursive function.

[0086] Step S4-2: The recursive function receives the path information and graph network nodes for the modified parameters;

[0087] Step S4-3: Divide the path of the modified parameters into multiple units using "." as the separator;

[0088] Step S4-4: Determine the number of path division units for modifying parameters. If there is only one unit, proceed to step S4-5; otherwise, proceed to step S4-8.

[0089] Step S4-5: Using ":" as the separator, further decompose the first unit of the path where the parameters are modified;

[0090] Step S4-6: Determine whether the first part of the decomposition is equal to the P1 value of the receiving node. If they are not equal, the process ends; otherwise, proceed to step S4-7.

[0091] Step S4-7: Set the P2 value of the node to the content of the second part after decomposition, and end the process;

[0092] Step S4-8: Compare the value of the first cell. If the value of the first cell is the same as "*", proceed to step S4-9. If the value of the first cell is the same as "#", proceed to step S4-10. Otherwise, proceed to step S4-11.

[0093] Step S4-9: Find all direct and indirect child nodes of the current node and place them in the temporary child node set, then execute step S4-12;

[0094] Step S4-10: Find all direct child nodes of the current node and place them in the temporary child node set, then execute step S4-12;

[0095] Step S4-11: Find the child node that matches the first cell value among all the direct child nodes of the current node and place it in the temporary child node set, then execute step S4-12;

[0096] Step S4-12: Set the path information of the modified parameters to the path after removing the first part of the content;

[0097] Step S4-13: Traverse the elements in the temporary child node set, call the recursive function with the updated parameter path and the current element as parameters, and end the process after the call is completed.

[0098] like Figure 6 As shown, step S50 includes the following steps:

[0099] Step S5-1: Create a list of strings, and use the list and the root node of the HEC-HMS model graph network as parameters to call the recursive functions defined in steps S5-2 to S5-10.

[0100] Step S5-2: The recursive function receives a list of strings and graph network nodes;

[0101] Step S5-3: Determine whether the P1 variable of the graph network node is empty. If it is empty, proceed to step S5-4; otherwise, proceed to step S5-5.

[0102] Step S5-4: Add an element to the string list, which is an empty string, and then proceed to step S5-6.

[0103] Step S5-5: Add an element to the string list. The content of this element is the value of P1 plus ":" plus the value of P2. Then execute step S5-6.

[0104] Step S5-6: Determine if the number of direct child nodes of a node in the graph network is greater than zero. If it is, proceed to step S5-7; otherwise, proceed to step S5-8.

[0105] Steps S5-7: Traverse all direct child nodes of the current node. During the first traversal, call the recursive function with the child node and the list of strings as parameters.

[0106] Step S5-8: Determine if the P3 value of the current node is empty. If it is not empty, proceed to step S5-9; otherwise, proceed to step S10.

[0107] Step S5-9: Add an element to the string list. The content of this element is the value of P3 plus ":" plus the value of P4. Then execute step S5-10.

[0108] Step S5-10: Write the string list elements into the input file of the HEC-HMS model in sequence.

[0109] Currently, apart from the built-in input file editing function of the HEC-HMS model, no publicly reported third-party proprietary editing methods and devices for HEC-HMS model input files have been found. Furthermore, some commonly used document editing tools such as Notepad and UltraEdit can also support HEC-HMS model file editing to some extent. However, the graphical representation and editing method, storage device, and terminal for HEC-HMS model input files proposed in this invention possess functional and performance advantages that HEC-HMS models and other traditional editing tools do not have, including:

[0110] Both the HEC-HMS model and traditional editing tools require manual operation through their graphical interfaces to edit HEC-HMS model files. These tools cannot be used to automate the editing of HEC-HMS model files, and therefore cannot be combined with automatic model calibration tools, nor can they be integrated with the HEC-HMS model to achieve automatic flood simulation and forecasting.

[0111] This invention represents the HEC-HMS model input file as graph network data, enabling flexible and efficient modification of model parameters using the "model parameter path". That is, not only can the "model parameter path" be used to accurately modify a specified parameter, but also the wildcards "*" and "#" can be used to flexibly modify multiple parameters simultaneously.

[0112] By using graph network data representation, the retrieval and matching speed of parameters to be modified can be significantly improved. For example, when the input file of the HEC-HMS model is represented as a binary tree, its time complexity is only O(logn), while the time complexity of traditional sequential search is O(n).

Claims

1. A method for graphical representation and editing of HEC-HMS model input files, suitable for execution on a computing device, characterized in that, Includes the following steps: Step S10: Receive the HEC-HMS model parameter path and parameter value information to be modified; Step S20: Determine whether the HEC-HMS model graph network data has been loaded. If not, proceed to step S30; otherwise, proceed to step S40. Step S30: Load model parameter information from the HEC-HMS model input file, and convert the input file into a graph network data structure based on the relationship between the parameters; Step S40: Modify the HEC-HMS model graph network data according to the HEC-HMS model parameter path and the parameter value information to be modified; Step S50: Convert the HEC-HMS model graph network data into the HEC-HMS model input file format, store it, and replace the original model file; Step S30 includes: Step S3-1: Create a root node for the model input file, read the file content into a string list line by line, and call the recursive functions defined in steps S3-2 to S3-11 with the root node and the string list as parameters. Step S3-2: The recursive function receives a node and a list of strings, initially setting the row identifier to 0; Step S3-3: Determine if the row identifier is less than the number of elements in the string list. If yes, proceed to step S3-4; otherwise, end the process. Step S3-4: Determine whether the row pointed to by the current row identifier is empty. If it is, proceed to step S3-5; otherwise, proceed to step S3-6. Step S3-5: Create an empty node, add it to the child node list of the receiving node of the recursive function, increment the row identifier by 1, and jump to step S3-3. Step S3-6: Calculate the number of rows contained in the next parameter block; Step S3-7: Determine whether the parameter block contains more than two lines. If so, execute steps S3-8 and S3-9 in sequence; otherwise, execute step S3-10. Step S3-8: Create a multi-line block node and add it to the child node list of the receiving node of the recursive function; Step S3-9: Construct a new string list, which contains the block content excluding the first and last lines. Then, call step S3-2 with the multi-line block node created in step S3-8 and the newly constructed string list as parameters. After completing the recursive call, execute step S3-11. Step S3-10: Construct a single-line block node and add it to the child node list of the receiving node of the recursive function, then execute step S3-11; Step S3-11: Update the row identifier to the sum of the current row identifier value and the number of block rows calculated in step S3-6, and then proceed to step S3-3. Step S40 includes: Step S4-1: Call the recursive functions defined in steps S4-2 to S4-13 with the path information of the parameters to be modified and the root node of the HEC-HMS model graph network as parameters. Step S4-2: The recursive function receives the path information and graph network nodes for the modified parameters; Step S4-3: Divide the path of the modified parameters into multiple units using "." as the separator; Step S4-4: Determine the number of path division units for modifying parameters. If there is only one unit, proceed to step S4-5; otherwise, proceed to step S4-8. Step S4-5: Using ":" as the separator, further decompose the first unit of the path where the parameters are modified; Step S4-6: Determine whether the first part of the decomposition is equal to the P1 value of the receiving node. If they are not equal, the process ends; otherwise, proceed to step S4-7. Step S4-7: Set the P2 value of the node to the content of the second part after decomposition, and end the process; Step S4-8: Compare the value of the first cell. If the value of the first cell is the same as "*", proceed to step S4-9. If the value of the first cell is the same as "#", proceed to step S4-10. Otherwise, proceed to step S4-11. Step S4-9: Find all direct and indirect child nodes of the current node and place them in the temporary child node set, then execute step S4-12; Step S4-10: Find all direct child nodes of the current node and place them in the temporary child node set, then execute step S4-12; Step S4-11: Find the child node that matches the first cell value among all the direct child nodes of the current node and place it in the temporary child node set, then execute step S4-12; Step S4-12: Set the path information of the modified parameters to the path after removing the first part of the content; Step S4-13: Traverse the elements in the temporary child node set, call the recursive function with the updated parameter path and the current element as parameters, and end the process after the call is completed.

2. The method for graphical representation and editing of HEC-HMS model input files according to claim 1, characterized in that, In step S10, the structure of the HEC-HMS model parameter path and the parameter value information to be modified consists of several block information and one parameter information to be modified connected by ".". Each block includes a block type and a block name, which are connected by ":". The block information can also be composed of "#" and "*", where "#" and "*" represent one and any number of anonymous blocks, respectively. The parameter information to be modified consists of a parameter name and a parameter value connected by ":".

3. The method for graphical representation and editing of HEC-HMS model input files according to claim 1, characterized in that, Step S50 includes: Step S5-1: Create a list of strings, and call the recursive functions defined in steps S5-2 to S5-10 with the list and the root node of the HEC-HMS model graph network as parameters. Step S5-2: The recursive function receives a list of strings and graph network nodes; Step S5-3: Determine whether the P1 variable of the graph network node is empty. If it is empty, proceed to step S5-4; otherwise, proceed to step S5-5. Step S5-4: Add an element to the string list, which is an empty string, and then proceed to step S5-6. Step S5-5: Add an element to the string list. The content of this element is the value of P1 plus ":" plus the value of P2. Then execute step S5-6. Step S5-6: Determine if the number of direct child nodes of a node in the graph network is greater than zero. If it is, proceed to step S5-7; otherwise, proceed to step S5-8. Steps S5-7: Traverse all direct child nodes of the current node. During the first traversal, call the recursive function with the child node and the list of strings as parameters. Step S5-8: Determine if the P3 value of the current node is empty. If it is not empty, proceed to step S5-9; otherwise, proceed to step S10. Step S5-9: Add an element to the string list. The content of this element is the value P3 plus ":" plus the value P4. Then execute step S5-10. Step S5-10: Write the string list elements into the input file of the HEC-HMS model in sequence.

4. A terminal device for graphical representation and editing of HEC-HMS model input files, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of a graphical representation and editing method for HEC-HMS model input files as described in any one of claims 1 to 3.

5. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the steps of a graphical representation and editing method for an HEC-HMS model input file as described in any one of claims 1 to 3.

Citation Information

Patent Citations

  • Real-time online flood forecasting method based on HEC-HMS model

    CN110555069A

  • Finite element parameterized model modeling method and system and storage medium

    CN113297764A