SWAT hydrological model parameter analysis method, medium, equipment and product
By combining a distributed parallel computing framework and an algorithm engine, the parameters of the SWAT hydrological model are automatically generated and optimized, solving the problems of complex parameter management and low computational efficiency, and realizing efficient and reliable model parameter analysis and diagnosis.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- HOHAI UNIV
- Filing Date
- 2026-03-10
- Publication Date
- 2026-04-10
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Existing SWAT hydrological model parameter analysis methods suffer from problems such as complex parameter management, error-prone manual modification, low computational efficiency, poor tool compatibility, and insufficient scalability, making it difficult to meet the timeliness requirements of scientific research and engineering.
Employing a distributed parallel computing framework and algorithm engine, an initial parameter sample set is automatically generated through parameter configuration files and evaluation configuration files. The distributed parallel computing framework drives the model to perform simulations, and an iterative optimization algorithm is used to obtain the optimal parameter combination. Parameter sensitivity analysis is then performed to achieve automated calibration and verification simulations.
It enables automated calibration and validation of SWAT hydrological model parameters, improves computational efficiency, ensures the objectivity and reproducibility of results, identifies key sensitive parameters, simplifies the operation process, reduces the risk of errors, and supports efficient model diagnosis and improvement.
Smart Images

Figure CN121836039A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to a SWAT hydrological model parameter analysis method, medium, equipment, and product, belonging to the field of hydrological and water resources simulation and computer application technology. Background Technology
[0002] The SWAT (Soil and Water Assessment Tool) model is one of the most widely used distributed hydrological models globally, playing a crucial role in watershed water resource management, non-point source pollution control, and climate change impact assessment. However, the simulation accuracy of SWAT models is highly dependent on parameter values. Due to the complex structure of SWAT models, the number of parameters is enormous and they are stored in hundreds or thousands of different types of files in text format. When dealing with spatially heterogeneous sub-watersheds or hydrological response units, traditional manual parameter modification methods are not only extremely labor-intensive but also prone to errors, making it difficult to guarantee parameter consistency and reproducibility.
[0003] Meanwhile, model calibration, sensitivity analysis, and optimization of best management practices typically require thousands or even tens of thousands of model simulations. In traditional single-machine serial computing, completing a single full analysis is extremely time-consuming, making it difficult to meet the timeliness requirements of scientific research and engineering.
[0004] Existing auxiliary tools have significant limitations in addressing the aforementioned issues. Mainstream software such as SWAT-CUP are mostly closed-source, with limited operating system compatibility and difficulty in extending to new optimization algorithms, failing to flexibly support complex user-defined optimization objectives. While some existing open-source script tools attempt to utilize parallel computing techniques, they often heavily rely on third-party libraries, suffer from poor version compatibility, and face long-term maintenance difficulties. Furthermore, these tools often exist as fragmented functional modules, lacking a unified platform that integrates low-level file interaction, distributed task scheduling, algorithm library expansion, and visualization analysis. Summary of the Invention
[0005] The purpose of this invention is to overcome the shortcomings of existing technologies and provide a method, medium, equipment, and product for analyzing SWAT hydrological model parameters, enabling automated calibration and verification simulation output of SWAT hydrological model parameters. To achieve the above objective, this invention employs the following technical solution:
[0006] In a first aspect, the present invention provides a method for analyzing parameters of a SWAT hydrological model, comprising:
[0007] Obtain the parameter configuration file, evaluation configuration file, and optimization objectives for the SWAT hydrological model;
[0008] Based on the parameter configuration file and optimization objectives, an initial parameter sample set for the SWAT hydrological model is generated.
[0009] Based on the initial parameter sample set, a distributed parallel computing framework is used to drive the SWAT hydrological model to perform simulations, and a set of simulation calculation results corresponding to different parameter samples is obtained.
[0010] Based on the evaluation configuration file, the set of simulation results is iteratively optimized using a pre-set algorithm engine to obtain the optimal parameter combination that meets the optimization objective.
[0011] Based on the optimal parameter combination, the SWAT hydrological model is driven to perform validation simulation, and the final parameters and analysis results of the SWAT hydrological model are output.
[0012] In conjunction with the first aspect, the method may optionally be performed through at least one of the following user interaction modes:
[0013] The graphical user interface mode is used to receive user configuration commands through visual interactive components and to display the simulation calculation process and results;
[0014] The script development mode is used to receive user configuration instructions through the application programming interface, allowing users to define and execute parameter analysis processes through script programs and output result data streams.
[0015] In conjunction with the first aspect, optionally, the parameter configuration file and the evaluation configuration file are standardized documents;
[0016] The parameter configuration file is used to define the model parameters to be calibrated or analyzed in the SWAT hydrological model;
[0017] The evaluation configuration file stores the observation data of the SWAT hydrological model and defines the evaluation rules for comparing and analyzing the observation data with the simulation results.
[0018] In conjunction with the first aspect, optionally, the step of generating an initial parameter sample set for the SWAT hydrological model based on the parameter configuration file and optimization objectives includes:
[0019] Based on the optimization objectives, determine the type of analysis task;
[0020] Based on the determined analysis task type, the corresponding algorithm module in the preset algorithm engine is invoked;
[0021] Input the parameter space information defined in the parameter configuration file into the called algorithm module;
[0022] The algorithm module generates and outputs a set of initial parameter samples for the SWAT hydrological model through a standardized interface.
[0023] The preset algorithm engine includes a sampling module for parameter sampling, an analysis module for sensitivity analysis, and an optimization module for parameter optimization.
[0024] In conjunction with the first aspect, optionally, the step of using a distributed parallel computing framework to drive the SWAT hydrological model to perform simulations based on an initial parameter sample set, and obtaining a set of simulation calculation results corresponding to different parameter samples, includes:
[0025] Each set of parameter samples in the initial parameter sample set is encapsulated as an independent simulation task;
[0026] Push the packaged simulated tasks to a shared task queue;
[0027] Multiple computing nodes dynamically acquire simulation tasks from a shared task queue;
[0028] Each computing node modifies the input file of the SWAT hydrological model based on the parameter samples obtained from the simulation task, drives the modified SWAT hydrological model to perform simulation calculations, and obtains the simulation calculation results.
[0029] The simulation results of different parameter samples are summarized to obtain a set of simulation results corresponding to different parameter samples.
[0030] In conjunction with the first aspect, optionally, the step of iteratively optimizing the set of simulation calculation results using a preset algorithm engine based on the evaluation configuration file to obtain the optimal parameter combination that meets the optimization objective includes:
[0031] Step a: Obtain the target site observation data stored in the evaluation configuration file;
[0032] Step b: For the current parameter sample set, drive the SWAT hydrological model to perform simulation and obtain the corresponding new simulation calculation results;
[0033] Step c: Based on the preset evaluation index function, calculate the degree of matching between the target station observation data and the corresponding new simulation calculation results;
[0034] Step d: Based on the calculated matching degree, update the current parameter sample set using the optimization module in the preset algorithm engine to generate a new parameter sample set;
[0035] Step e: Determine whether the preset convergence condition is met: If not, use the new parameter sample set as the current parameter sample set for the next iteration and return to step b; if met, determine the parameter sample with the highest matching degree as the optimal parameter combination.
[0036] In conjunction with the first aspect, the method may optionally further include parameter sensitivity analysis, including:
[0037] Based on the set of simulation results and the evaluation configuration file, the simulation results and observation data of the target site are obtained;
[0038] Using a pre-defined sensitivity analysis method, the contribution or correlation coefficient of each parameter sample of the SWAT hydrological model to the uncertainty of the simulation results is calculated, and sensitivity indices for each parameter sample are generated.
[0039] All parameter samples are sorted and filtered according to sensitivity indicators to obtain key sensitive parameters.
[0040] In a second aspect, the present invention provides a computer-readable storage medium having a computer program / instruction stored thereon, which, when executed by a processor, implements the steps of the SWAT hydrological model parameter analysis method described in the first aspect.
[0041] Thirdly, the present invention provides a computer device, comprising:
[0042] Memory, used to store computer programs / instructions;
[0043] A processor for executing the computer program / instructions to implement the steps of the SWAT hydrological model parameter analysis method described in the first aspect.
[0044] Fourthly, the present invention provides a computer program product, including a computer program / instructions, which, when executed by a processor, implement the steps of the SWAT hydrological model parameter analysis method described in the first aspect.
[0045] Compared with the prior art, the beneficial effects achieved by the SWAT hydrological model parameter analysis method, medium, equipment and product provided in this embodiment of the invention include:
[0046] This invention obtains parameter configuration files, evaluation configuration files, and optimization targets for SWAT hydrological models. This invention eliminates the need for manual searching and modification of model files one by one, solves the problem of fragmented parameter management in SWAT hydrological models, and realizes the mapping from physical model parameters to calculable optimization variables, reducing the operational threshold and error risk of parameter analysis.
[0047] This invention generates an initial parameter sample set for the SWAT hydrological model based on parameter configuration files and optimization objectives. Based on this initial parameter sample set, a distributed parallel computing framework drives the SWAT hydrological model to perform simulations, obtaining simulation result sets corresponding to different parameter samples. This invention encapsulates parameter samples into independent tasks and pushes them to a shared task queue through the distributed parallel computing framework. Multiple computing nodes dynamically acquire and execute tasks, achieving on-demand allocation and load balancing of computing resources. Compared to traditional serial or static allocation modes, this invention can shorten the overall time consumption of massive simulation tasks and improve the computational efficiency of model calibration and sensitivity analysis.
[0048] This invention, based on an evaluation configuration file, uses a pre-defined algorithm engine to iteratively optimize the set of simulation results to obtain the optimal parameter combination that meets the optimization objective. Based on the optimal parameter combination, it drives the SWAT hydrological model to perform verification simulations, outputting the final parameters and analysis results of the SWAT hydrological model. This invention can achieve automated calibration and verification simulation output of SWAT hydrological model parameters. This invention requires no manual intervention and can ensure the objectivity and reproducibility of the results. This invention directly responds to the model verification with the results, which can ensure the actual usability and reliability of the output parameters.
[0049] This invention also includes parameter sensitivity analysis. Based on the completion of parallel simulation and the acquisition of a set of simulation results, a sensitivity index for the parameters is generated, and key sensitive parameters that have a significant impact on the model output are selected according to the index ranking. This invention can not only help users identify redundant parameters to simplify subsequent calibration analysis, but also reveal the model's response mechanism in different regions, providing data support for model diagnosis and improvement. Attached Figure Description
[0050] Figure 1 This is a flowchart illustrating a SWAT hydrological model parameter analysis method according to Embodiment 1 of the present invention.
[0051] Figure 2 This is a schematic diagram of the parameter configuration file in a SWAT hydrological model parameter analysis method according to Embodiment 1 of the present invention;
[0052] Figure 3 This is a schematic diagram of the structure of the evaluation configuration file in a SWAT hydrological model parameter analysis method according to Embodiment 1 of the present invention;
[0053] Figure 4 This is a schematic diagram of the distributed parallel computing framework in a SWAT hydrological model parameter analysis method according to Embodiment 1 of the present invention;
[0054] Figure 5 This is a visual diagram of the results from a SWAT hydrological model parameter analysis method according to Embodiment 1 of the present invention;
[0055] Figure 6 This is a graph of the observation data in a SWAT hydrological model parameter analysis method according to Embodiment 2 of the present invention;
[0056] Figure 7 This is a visualization of the sensitivity analysis results in a SWAT hydrological model parameter analysis method according to Embodiment 2 of the present invention;
[0057] Figure 8 This is a schematic diagram of the comparison curves used to verify the simulation results in a SWAT hydrological model parameter analysis method according to Embodiment 2 of the present invention. Detailed Implementation
[0058] The present invention will be further described below with reference to the accompanying drawings. The following embodiments are only used to more clearly illustrate the technical solution of the present invention, and should not be used to limit the scope of protection of the present invention.
[0059] Example 1:
[0060] This embodiment selects a region in the middle and lower reaches of the Huaihe River in China as the research object to demonstrate how the SWAT hydrological model parameter analysis method described in this invention can solve specific problems in the analysis, optimization and management of complex watershed parameters involving mixed variables and multi-objective functions under the script development mode (DEV).
[0061] The Script Development Mode (DEV) is used to receive configuration instructions from users through the application programming interface, allowing users to define and execute parameter analysis processes through script programs and output result data streams.
[0062] like Figure 1 As shown, the specific steps are as follows.
[0063] Step 1: Obtain the parameter configuration file, evaluation configuration file, and optimization objectives for the SWAT hydrological model.
[0064] In this embodiment, a SWAT hydrological model for the Huai River Basin is constructed. The SWAT hydrological model uses data from 2011 to 2014 for parameter analysis and is validated using observation data from 2015.
[0065] The SWAT hydrological model was validated using runoff flow data and total nitrogen (TN) and total phosphorus (TP). Validation metrics included: the Nash efficiency coefficient (NSE), which measures the goodness of fit between simulated and observed values; and the coefficient of determination, which measures the degree of linear correlation between simulated and observed values. ), which measures the average tendency and degree of deviation of simulated values from observed values (PBIAS).
[0066] The calibration results are shown in Table 1, indicating that the accuracy of the SWAT hydrological model meets the requirements.
[0067] Table 1 Calibration Results
[0068]
[0069] In this embodiment, in response to the need for water quality improvement in the Huai River Basin, two optimal management practices (BMPs) are incorporated into the SWAT hydrological model: grassed waterways (BMP1) and vegetated filter strips (BMP2). The relevant parameters are described in Table 2.
[0070] Table 2 Description of relevant parameters
[0071]
[0072] Step 1.1: Obtain the parameter configuration file for the SWAT hydrological model.
[0073] The parameter configuration file is used to define the model parameters to be calibrated or analyzed in the SWAT hydrological model.
[0074] In this embodiment, the user writes a Python script to define a hybrid parameter system, including discrete location parameters (sub-basin numbers for implemented management measures (BMPs)) and continuous design parameters (such as the width of grassed waterways (GWATW) and the width of filter strips (FILTERW). Simultaneously, standardized parameter configuration files (.par) and evaluation configuration files (.evl) are defined, through methods such as... Figure 2 The file interaction interface shown enables precise mapping of parameters to the SWAT hydrological model.
[0075] like Figure 2 As shown, the parameter configuration file includes five key fields: parameter name (Name), modification mode (Mode), numeric type (Type), value range (Min_Max), and scope (Scope). The modification mode includes relative change (...). Figure 2 (r) absolute change ( Figure 2 (a) and numerical substitution ( Figure 2 (v is in the middle).
[0076] Step 1.2: Obtain the evaluation configuration file for the SWAT hydrological model.
[0077] The evaluation configuration file stores the observation data of the SWAT hydrological model and defines the evaluation rules for comparing and analyzing the observation data with the simulation results.
[0078] like Figure 3As shown, the evaluation configuration file consists of two parts: a file header definition and a data table. The file header definition includes five key fields: sequence data identifier (SER_1), objective function or constraint function identifier (OBJ_1), spatial unit identifier (RCH_23, corresponding to river segment, sub-basin, or hydrological response unit), variable to be extracted identifier (COL_2), and evaluation function type (FUNC_1). The data table stores the observation data in time series, with each row representing a time step, consisting of the sequence number, year, month, date, and corresponding observation value.
[0079] This embodiment, through standardized parameter configuration files and evaluation configuration files, can uniformly describe the parameters to be analyzed and their value ranges scattered across different levels and formats of the SWAT model, and structurally store the observation data and evaluation rules. This mechanism eliminates the need for manual searching and modification of model files one by one, achieving automated mapping from physical model parameters to computable optimization variables. It significantly reduces the operational threshold and error risk of parameter configuration, laying the foundation for subsequent automated analysis.
[0080] Step 1.3: Obtain the optimization objective for the SWAT hydrological model.
[0081] The objective functions are set as follows: maximizing the total nitrogen (TN) reduction rate, maximizing the total phosphorus (TP) reduction rate, and minimizing the total implementation cost. Its mathematical expression is:
[0082] ,
[0083] ,
[0084] ,
[0085] ,
[0086] ,
[0087] in, To implement the total cost, The reduction in total nitrogen (TN), This represents the reduction in total phosphorus (TP). Cost of all management practices (BMP); This represents the total nitrogen (TN) load under the baseline scenario (without any management measures implemented). This represents the total nitrogen (TN) load in the current scenario; This represents the total phosphorus (TP) load under the baseline scenario (without any management measures implemented). This represents the total phosphorus (TP) load in the current scenario; For sub-basins The cost of the grass-covered waterway (BMP1) For sub-basins The cost of medium vegetation filter strip (BMP2), The total number of sub-basins; The decision variable set consists of six dimensions for each decision. The minimum value of the decision variable in the parameter space. This represents the maximum value of the decision variable in the parameter space.
[0088] This embodiment eliminates the need for manual searching and modification of model files, solving the problem of fragmented parameter management in SWAT hydrological models. It achieves the mapping from physical model parameters to calculable optimization variables, reducing the operational threshold and error risk of parameter analysis.
[0089] Step 2: Generate the initial parameter sample set for the SWAT hydrological model based on the parameter configuration file and optimization objectives.
[0090] The SWAT-UQ class is instantiated in the script, and the multi-objective optimization algorithm in the UQPyL library is called as the solver. To demonstrate the integration capabilities of the algorithm engine, this embodiment selects three multi-objective optimization algorithms: NSGA-II, NSGA-III, and MOEA / D.
[0091] Step 2.1: Determine the analysis task type based on the optimization objective.
[0092] Based on the optimization objective, the analysis task type is determined to be multi-objective optimization.
[0093] Step 2.2: Based on the determined analysis task type, call the corresponding algorithm module in the preset algorithm engine.
[0094] Specifically, the preset algorithm engine includes a sampling module for parameter sampling, an analysis module for sensitivity analysis, and an optimization module for parameter optimization.
[0095] It should be noted that all algorithm modules adopt a unified interface standard: the sampling module uses the sample interface, the analysis module uses the analyze interface, the optimization module uses the evaluate interface, and the evolutionary algorithm is executed through run.
[0096] Step 2.3: Input the parameter space information defined in the parameter configuration file into the called algorithm module.
[0097] Step 2.4: Generate and output the initial parameter sample set of the SWAT hydrological model through the standardized interface of the algorithm module;
[0098] Specifically, through the standardized interface of the algorithm module, the population size is set to 50 and the maximum number of evaluations is set to 20,000, generating and outputting the initial parameter sample set of the SWAT hydrological model.
[0099] Step 3: Based on the initial parameter sample set, the SWAT hydrological model is driven by a distributed parallel computing framework to perform simulations, and the simulation calculation result set corresponding to different parameter samples is obtained.
[0100] like Figure 4 The diagram shows a computational schematic of a distributed parallel computing framework.
[0101] Step 3.1: Encapsulate each set of parameter samples in the initial parameter sample set into an independent simulation task.
[0102] Specifically, the generated BMPs configuration scheme is encapsulated as an independent simulation task.
[0103] Step 3.2: Push the packaged simulation tasks to the shared task queue.
[0104] Step 3.3: Multiple computing nodes dynamically acquire simulation tasks from a shared task queue.
[0105] Specifically, the 80 compute nodes deployed on the high-performance server use a dynamic preemption strategy to acquire tasks from the queue.
[0106] Step 3.4: Each computing node modifies the input file of the SWAT hydrological model based on the parameter samples obtained from the simulation task, drives the modified SWAT hydrological model to perform simulation calculations, and obtains the simulation calculation results.
[0107] Specifically, each computing node uses the C++ low-level interface to quickly modify the input files such as .ops and .mgt of the SWAT hydrological model based on the parameter samples obtained from the simulation task, drives the modified SWAT hydrological model to perform simulation calculations, and extracts the output values of total nitrogen (TN) and total phosphorus (TP).
[0108] Step 3.5: Summarize the simulation results of different parameter samples to obtain a set of simulation results corresponding to different parameter samples.
[0109] After the task is completed, the simulation results of each computing node are summarized.
[0110] This invention encapsulates parameter samples into independent tasks and pushes them to a shared task queue through a distributed parallel computing framework. Multiple computing nodes dynamically acquire and execute tasks, realizing on-demand allocation and load balancing of computing resources. This minimizes idle waiting caused by differences in model running time and significantly improves parallel efficiency when processing massive simulation tasks.
[0111] Compared to traditional serial or static allocation modes, this embodiment can shorten the overall time consumption of massive simulation tasks and improve the computational efficiency of model calibration and sensitivity analysis.
[0112] Step 4: Based on the evaluation configuration file, use the preset algorithm engine to iteratively optimize the set of simulation calculation results to obtain the optimal parameter combination that meets the optimization objective.
[0113] Specifically, it includes the following iterative steps:
[0114] Step a: Obtain the target site observation data stored in the evaluation configuration file of Step 1.
[0115] Step b: For the current parameter sample set, drive the SWAT hydrological model to perform simulation and obtain the corresponding new simulation calculation results.
[0116] Step c: Based on the preset evaluation index function, calculate the degree of matching between the target station observation data and the corresponding new simulation calculation results.
[0117] In this embodiment, the preset evaluation index functions include, but are not limited to, NSE (Nash-Sutcliffe efficiency coefficient) and RMSE (root mean square error).
[0118] Step d: Based on the calculated matching degree, update the current parameter sample set using the optimization module in the preset algorithm engine to generate a new parameter sample set.
[0119] Step e: Determine whether the preset convergence condition is met: If not, use the new parameter sample set as the current parameter sample set for the next iteration and return to step b; if met, determine the parameter sample with the highest matching degree as the optimal parameter combination.
[0120] In some embodiments, the preset convergence condition is reaching the maximum number of iterations or the change in matching degree is less than a threshold.
[0121] Specifically, this embodiment drives three multi-objective algorithms for population evolution. During the iteration process, the script records the optimal solution and computation time of each generation in real time, verifying the stability when dealing with complex constraints and multi-objective trade-offs.
[0122] Step 5: Based on the optimal parameter combination, drive the SWAT hydrological model to perform a verification simulation, and output the final parameters and analysis results of the SWAT hydrological model.
[0123] After optimization in step 4, this embodiment generates a result file in HDF5 format. A three-dimensional Pareto front plot is then drawn using a visualization interface. The visualization results are as follows: Figure 5As shown, the optimal Pareto solution sets obtained by the three algorithms are illustrated.
[0124] from Figure 5 It can be seen that PF degenerates into a nearly one-dimensional curve instead of forming a complete two-dimensional surface, indicating a strong correlation between the targets. As the reduction in total nitrogen (TN) and total phosphorus (TP) increases, the cost rises accordingly, forming a near-linear trade-off. The maximum achievable emission reduction rate for total phosphorus (TP) converges to around 45%, and the maximum emission reduction rate for total nitrogen (TN) converges to around 35%.
[0125] The SWAT hydrological model is validated and simulated based on the optimal parameter combination, and the validated model parameters and analysis results are output. By comparing different schemes implemented across the entire watershed and those implemented in key source areas, decision-makers can select the optimal scheme based on marginal benefits.
[0126] This embodiment enables automated calibration and verification simulation output of SWAT hydrological model parameters without manual intervention, ensuring the objectivity and reproducibility of the results. The invention directly applies the results to model verification, ensuring the practical usability and reliability of the output parameters.
[0127] This embodiment fully replicates the entire closed-loop process of the method of the present invention, demonstrating the powerful flexibility and robustness of the SWAT hydrological model parameter analysis method script development mode (DEV) provided by the present invention in dealing with complex watershed management problems involving mixed parameters and multi-objective trade-offs.
[0128] Example 2:
[0129] This embodiment selects the Fengshubazi watershed in the upper reaches of the Dongjiang Basin in China as the research object, and demonstrates how the SWAT hydrological model parameter analysis method described in this invention can complete the process of model calibration and uncertainty analysis through visual interaction in the graphical user interface (GUI) mode.
[0130] The graphical user interface (GUI) mode is used to receive configuration instructions from users through visual interactive components and to display the simulation calculation process and results.
[0131] like Figure 1 As shown, the specific steps are as follows.
[0132] Step 1: Obtain the parameter configuration file, evaluation configuration file, and optimization objectives for the SWAT hydrological model.
[0133] In this embodiment, a SWAT hydrological model is constructed for the Fengshubazi watershed in the upper reaches of the Dongjiang Basin in China. For example... Figure 6The graphs showing the observation data are presented. The SWAT hydrological model used data from 2008-2011 as a warm-up period, data from 2012-2016 as a calibration period, and data from 2017 as a validation period. This embodiment aims to evaluate and improve the simulation effect of daily runoff at the Fengshuba hydrological station using the Nash-Satcliffe efficiency coefficient (NSE) in a GUI mode.
[0134] In this embodiment, the user enters the main interface of the visual interactive component by activating the GUI mode of the method of the present invention. The user specifies the working directory and the SWAT hydrological model path (TxtInOut) through the "New Project" wizard. The background automatically calls the parsing engine to build a full index of the model files.
[0135] In this embodiment, the user enters the "Parameter Settings" module of the visual interactive component. Without writing code, they can directly select the required key parameters from the table and set the modification mode and numerical range. At the same time, the user imports observation data into the "Function Definition" interface, which automatically maps the physical model output (flow sequence) to a mathematical optimization objective (NSE maximization), completing the initial definition of the optimization problem.
[0136] Step 2: Generate the initial parameter sample set for the SWAT hydrological model based on the parameter configuration file and optimization objectives.
[0137] In this embodiment, the Fourier Amplitude Sensitivity Test (FAST) is selected as the analysis algorithm in the interface of the visual interactive component, and the Latin Hypercube Sampling (LHS) strategy is selected, with the sampling number set to 1000. Based on the user configuration, the corresponding algorithm module in the preset algorithm engine is automatically invoked to generate an initial parameter sample set.
[0138] This step involves configuring the algorithm's hyperparameters using a graphical control, eliminating the need for users to access the underlying algorithm code.
[0139] Step 3: Based on the initial parameter sample set, the SWAT hydrological model is driven by a distributed parallel computing framework to perform simulations, and the simulation calculation result set corresponding to different parameter samples is obtained.
[0140] In this embodiment, after configuration is complete, clicking the "Run" button will automatically trigger the following in the system background: Figure 4 The illustrated queue-based dynamic distributed parallel computing framework pushes 1000 sets of simulated tasks into the queue. The GUI interface provides real-time feedback on the computation progress via a progress bar and simultaneously displays detailed runtime logs. This process hides the complex details of parallel computing; users only need to monitor the progress bar.
[0141] Step 4: Parameter sensitivity analysis.
[0142] Step 4.1: Based on the simulation calculation result set and evaluation configuration file, obtain the simulation calculation results and observation data of the target site.
[0143] Step 4.2: Using the preset sensitivity analysis method, calculate the contribution or correlation coefficient of each parameter sample of the SWAT hydrological model to the uncertainty of the simulation results, and generate the sensitivity index of each parameter sample.
[0144] Specifically, when the progress bar reaches 100%, the result aggregation logic is executed. The response values returned by the distributed nodes are merged with the parameter samples to calculate the first-order and total effect sensitivity indices.
[0145] Step 4.3: Sort and filter all parameter samples according to the sensitivity index to obtain the key sensitive parameters.
[0146] All process data is encapsulated into a standard result file in HDF5 format for use by subsequent modules.
[0147] After loading the HDF5 file, the drawing result is as follows: Figure 7 The visualization of the sensitivity analysis results is shown in a bar chart ranking the parameters by sensitivity. Users can adjust the title, axes, and color scheme using the configuration panel on the right. The results show that the top ten parameters, including CN2 and ALPHA_BNK, have the most significant impact on runoff.
[0148] Step 5: Parameter optimization and verification simulation output.
[0149] Based on the sensitivity analysis results, users can further select an optimization algorithm in the "Optimization" module to calibrate the top ten key parameters. After optimization, the optimal parameters are backfilled into the model using the "Validation and Application" module, and a validation simulation is run.
[0150] The graphical user interface (GUI) automatically generates a comparison curve between simulated and observed flow rates, such as... Figure 8 As shown, the NSE during the validation period reached over 0.90. The system outputs the validated model parameters and corresponding analysis results, including a comparison chart of the simulation results during the validation period and a performance index table.
[0151] This embodiment demonstrates that the SWAT hydrological model parameter analysis method proposed in this invention can automate model parameter analysis in complex watershed management scenarios involving high-dimensional mixed parameters, multi-objective trade-offs, and massive simulation tasks. Whether handling customized scientific research problems through script mode or standardized engineering tasks through graphical interface mode, this invention exhibits significant advantages in computational efficiency and ease of operation.
[0152] Example 3:
[0153] This embodiment provides a computer-readable storage medium storing a computer program / instruction thereon. When the computer program / instruction is executed by a processor, it implements the steps of the SWAT hydrological model parameter analysis method described in either Embodiment 1 or Embodiment 2.
[0154] Example 4:
[0155] This embodiment provides a computer device, including:
[0156] Memory, used to store computer programs / instructions;
[0157] A processor is used to execute the computer program / instructions to implement the steps of the SWAT hydrological model parameter analysis method described in either Embodiment 1 or Embodiment 2.
[0158] Example 5:
[0159] This embodiment provides a computer program product, including a computer program / instruction, which, when executed by a processor, implements the steps of the SWAT hydrological model parameter analysis method described in either Embodiment 1 or Embodiment 2.
[0160] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0161] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0162] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0163] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0164] The embodiments of the present invention have been described above with reference to the accompanying drawings. However, the present invention is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of the present invention without departing from the spirit and scope of the claims. All of these forms are within the protection scope of the present invention.
Claims
1. A method for analyzing parameters of a SWAT hydrological model, characterized in that, include: Obtain the parameter configuration file, evaluation configuration file, and optimization objectives for the SWAT hydrological model; Based on the parameter configuration file and optimization objectives, an initial parameter sample set for the SWAT hydrological model is generated. Based on the initial parameter sample set, a distributed parallel computing framework is used to drive the SWAT hydrological model to perform simulations, and a set of simulation calculation results corresponding to different parameter samples is obtained. Based on the evaluation configuration file, the set of simulation results is iteratively optimized using a pre-set algorithm engine to obtain the optimal parameter combination that meets the optimization objective. Based on the optimal parameter combination, the SWAT hydrological model is driven to perform validation simulation, and the final parameters and analysis results of the SWAT hydrological model are output.
2. The SWAT hydrological model parameter analysis method according to claim 1, characterized in that, The method is executed through at least one of the following user interaction modes: The graphical user interface mode is used to receive user configuration commands through visual interactive components and to display the simulation calculation process and results; The script development mode is used to receive user configuration instructions through the application programming interface, allowing users to define and execute parameter analysis processes through script programs and output result data streams.
3. The SWAT hydrological model parameter analysis method according to claim 1, characterized in that, The parameter configuration file and evaluation configuration file are standardized documents; The parameter configuration file is used to define the model parameters to be calibrated or analyzed in the SWAT hydrological model; The evaluation configuration file stores the observation data of the SWAT hydrological model and defines the evaluation rules for comparing and analyzing the observation data with the simulation results.
4. The SWAT hydrological model parameter analysis method according to claim 1, characterized in that, The initial parameter sample set for the SWAT hydrological model is generated based on the parameter configuration file and optimization objectives, including: Based on the optimization objectives, determine the type of analysis task; Based on the determined analysis task type, the corresponding algorithm module in the preset algorithm engine is invoked; Input the parameter space information defined in the parameter configuration file into the called algorithm module; The algorithm module generates and outputs a set of initial parameter samples for the SWAT hydrological model through a standardized interface. The preset algorithm engine includes a sampling module for parameter sampling, an analysis module for sensitivity analysis, and an optimization module for parameter optimization.
5. The SWAT hydrological model parameter analysis method according to claim 1, characterized in that, The simulation, based on the initial parameter sample set, is driven by a distributed parallel computing framework to perform simulations using the SWAT hydrological model, resulting in a set of simulation calculation results corresponding to different parameter samples, including: Each set of parameter samples in the initial parameter sample set is encapsulated as an independent simulation task; Push the packaged simulated tasks to a shared task queue; Multiple computing nodes dynamically acquire simulation tasks from a shared task queue; Each computing node modifies the input file of the SWAT hydrological model based on the parameter samples obtained from the simulation task, drives the modified SWAT hydrological model to perform simulation calculations, and obtains the simulation calculation results. The simulation results of different parameter samples are summarized to obtain a set of simulation results corresponding to different parameter samples.
6. The SWAT hydrological model parameter analysis method according to claim 1, characterized in that, The process of using a pre-defined algorithm engine to iteratively optimize the set of simulation results based on the evaluation configuration file to obtain the optimal parameter combination that meets the optimization objective includes: Step a: Obtain the target site observation data stored in the evaluation configuration file; Step b: For the current parameter sample set, drive the SWAT hydrological model to perform simulation and obtain the corresponding new simulation calculation results; Step c: Based on the preset evaluation index function, calculate the degree of matching between the target station observation data and the corresponding new simulation calculation results; Step d: Based on the calculated matching degree, update the current parameter sample set using the optimization module in the preset algorithm engine to generate a new parameter sample set; Step e: Determine whether the preset convergence condition is met: If not, use the new parameter sample set as the current parameter sample set for the next iteration and return to step b; if met, determine the parameter sample with the highest matching degree as the optimal parameter combination.
7. The SWAT hydrological model parameter analysis method according to claim 1, characterized in that, The method also includes parameter sensitivity analysis, including: Based on the set of simulation results and the evaluation configuration file, the simulation results and observation data of the target site are obtained; Using a pre-defined sensitivity analysis method, the contribution or correlation coefficient of each parameter sample of the SWAT hydrological model to the uncertainty of the simulation results is calculated, and sensitivity indices for each parameter sample are generated. All parameter samples are sorted and filtered according to sensitivity indicators to obtain key sensitive parameters.
8. A computer-readable storage medium having a computer program / instructions stored thereon, characterized in that, When the computer program / instruction is executed by the processor, it implements the steps of the SWAT hydrological model parameter analysis method according to any one of claims 1-7.
9. A computer device, characterized in that, include: Memory, used to store computer programs / instructions; A processor for executing the computer program / instructions to implement the steps of the SWAT hydrological model parameter analysis method according to any one of claims 1-7.
10. A computer program product comprising a computer program / instructions, characterized in that, When executed by a processor, the computer program / instruction implements the steps of the SWAT hydrological model parameter analysis method according to any one of claims 1-7.