SWMM model parameter calibration method and device, equipment and medium
Through long and short-term memory networks, the optimization range in the SWMM model's parameter rate determination process is narrowed, and the problem of time-consuming and labor-intensive parameter rate determination in the existing technology is solved, and more efficient and accurate parameter rate determination is achieved.
Patent Information
- Application Number
- CN202510283615.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-11
- Publication Date
- 2025-06-17
AI Technical Summary
In the process of determining the parameter rate of the existing SWMM model, manual parameter adjustment is time-consuming and labor-intensive. Although optimization methods such as genetic algorithms can obtain accurate results, they consume a lot of time and computing power.
Through long and short-term memory networks, we learn the implicit relationship between the combination of uncertain parameters and the SWMM simulation results, build a proxy model, narrow the search range of the optimal value, and obtain the optimal value of the uncertain parameters through SWMM model simulation calculation within a small range.
The efficiency of the SWMM model parameter rate determination process is improved, the calculation time is shortened, and the accuracy of parameter rate determination is ensured.
Smart Images

Figure CN120163055A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of urban stormwater management, and particularly relates to a method, device, equipment and medium for calibrating SWMM model parameters. Background Art
[0002] In recent years, with the acceleration of the urbanization process, urban stormwater management has faced unprecedented challenges. Rainstorms occur frequently, and the problem of urban waterlogging has become increasingly serious. There is an urgent need for accurate and efficient urban stormwater models to assist in decision-making and management. The Storm Water Management Model (SWMM), as a widely used stormwater management model, its performance depends to a large extent on the accuracy of the model parameters. However, there are many uncertain parameters in the SWMM model, and the precise adjustment of these parameters is crucial for the model accuracy.
[0003] Currently, in the process of constructing the SWMM model, there is a problem that the manual parameter adjustment process is time-consuming and laborious. If directly using optimization methods such as genetic algorithms to calibrate the SWMM model parameters, although relatively accurate results can be obtained, it involves thousands of SWMM simulation iterations. When the scale of the SWMM model in the target area is large, it requires a large amount of time and computing power. Summary of the Invention
[0004] In view of this, embodiments of the present invention provide a method, device, equipment and medium for calibrating SWMM model parameters to more efficiently and accurately calibrate the SWMM model parameters.
[0005] In a first aspect, embodiments of the present invention provide a method for calibrating SWMM model parameters, including:
[0006] Obtain the first value range of each uncertain parameter to be calibrated, and generate the first preset number of uncertain parameter combinations according to the first value range;
[0007] Perform SWMM simulation calculations on each uncertain parameter combination to obtain the SWMM simulation results corresponding to each uncertain parameter combination;
[0008] Learn the mapping relationship between the uncertain parameter combination and the SWMM simulation result through a long short-term memory network to obtain a surrogate model;
[0009] According to the surrogate model, determine the second value range where the optimal value of each uncertain parameter is located from the first value range of each uncertain parameter; wherein, the second value range is smaller than the first value range;
[0010] According to the second value ranges corresponding to the respective uncertain parameters, the optimal values of the respective uncertain parameters are obtained by performing simulation calculations on the SWMM model.
[0011] As a possible implementation manner, determining, according to the surrogate model, the second value ranges where the optimal values of the respective uncertain parameters are located from the first value ranges of the respective uncertain parameters includes:
[0012] Determining a fitness function according to the difference between the prediction result of the surrogate model and the actual observation result, and iteratively optimizing the combination of the uncertain parameters of the SWMM model by using a particle swarm algorithm;
[0013] After satisfying the iteration termination condition, selecting a second preset number of particles according to the order of the fitness values from large to small to obtain a second number of combinations of uncertain parameters;
[0014] In the second preset number of combinations of uncertain parameters, finding the maximum value of each uncertain parameter as the upper limit value of the second value range, and finding the minimum value of each uncertain parameter as the lower limit value of the second value range to obtain the second value range corresponding to each uncertain parameter.
[0015] As a possible implementation manner, obtaining the optimal values of the respective uncertain parameters by performing simulation calculations on the SWMM model according to the second value ranges corresponding to the respective uncertain parameters includes:
[0016] Generating a third preset number of combinations of uncertain parameters according to the second value ranges corresponding to the respective uncertain parameters;
[0017] In the third preset number of combinations of uncertain parameters, determining the combination of uncertain parameters that minimizes the difference between the simulation calculation result of the SWMM model and the actual observation result, and obtaining the optimal values of the respective uncertain parameters according to this combination of uncertain parameters.
[0018] As a possible implementation manner, the fitness function is:
[0019]
[0020] Wherein, R 2 is the function value of the fitness function, y i represents the actual observation result, represents the prediction result of the surrogate model, represents the average value of the actual observation results, and n represents the number of times.
[0021] As a possible implementation manner, iteratively optimizing the combination of the uncertain parameters of the SWMM model by using a particle swarm algorithm includes:
[0022] Generate an initial particle swarm according to the first value range of each uncertain parameter; wherein, the position of each particle is a combination of uncertain parameters.
[0023] Calculate the fitness value of each particle, determine the optimal fitness value of each particle and the global optimal fitness value, and update the velocity and position of each particle.
[0024] When the iteration reaches the preset maximum number of iterations, stop the iteration.
[0025] As a possible implementation, the method of learning the mapping relationship between the combination of uncertain parameters and the SWMM simulation results through a long short-term memory network to obtain a surrogate model includes:
[0026] Use the combinations of various uncertain parameters and the rainfall time series as the input of the long short-term memory network, and use the corresponding SWMM simulation results as the output of the long short-term memory network to train the network parameters of the long short-term memory network to obtain the surrogate model.
[0027] As a possible implementation, before obtaining the first value range of each uncertain parameter to be calibrated, the method further includes:
[0028] Obtain urban influencing factors, where the urban influencing factors include land use type, precipitation event, and watershed characteristics.
[0029] According to the urban influencing factors, determine the degree of influence of each uncertain parameter of the SWMM model through the random forest regression method, and determine the importance of each uncertain parameter according to the degree of influence of each uncertain parameter.
[0030] Screen the uncertain parameters to be calibrated according to the importance of each uncertain parameter.
[0031] In a second aspect, an embodiment of the present invention provides a device for calibrating SWMM model parameters, including:
[0032] An acquisition module, configured to acquire the first value range of each uncertain parameter to be calibrated, and generate a first preset number of combinations of uncertain parameters according to the first value range.
[0033] A calculation module, configured to perform SWMM simulation calculations on each combination of uncertain parameters to obtain the SWMM simulation results corresponding to each combination of uncertain parameters.
[0034] A training module, configured to learn the mapping relationship between the combination of uncertain parameters and the SWMM simulation results through a long short-term memory network to obtain a surrogate model.
[0035] A determination module, configured to determine, according to the surrogate model, a second value range where the optimal value of each uncertain parameter is located from the first value ranges of the respective uncertain parameters; wherein, the second value range is smaller than the first value range; and according to the second value ranges corresponding to the respective uncertain parameters, perform simulation calculations on the SWMM model to obtain the optimal values of the respective uncertain parameters.
[0036] As a possible implementation, the determination module is configured to:
[0037] Determine a fitness function according to the difference between the prediction result and the actual observation result of the surrogate model, and use the particle swarm optimization algorithm to iteratively optimize the combination of uncertain parameters of the SWMM model;
[0038] After satisfying the iteration termination condition, select a second preset number of particles according to the order of the fitness values from large to small to obtain a second number of combinations of uncertain parameters;
[0039] Among the second preset number of combinations of uncertain parameters, find the maximum value of each uncertain parameter as the upper limit value of the second value range, and find the minimum value of each uncertain parameter as the lower limit value of the second value range, to obtain the second value range corresponding to each uncertain parameter.
[0040] As a possible implementation, the determination module is configured to:
[0041] Generate a third preset number of combinations of uncertain parameters according to the second value ranges corresponding to the respective uncertain parameters;
[0042] Among the third preset number of combinations of uncertain parameters, determine the combination of uncertain parameters that minimizes the difference between the simulation calculation result and the actual observation result of the SWMM model, and according to this combination of uncertain parameters, obtain the optimal values of the respective uncertain parameters.
[0043] As a possible implementation, the fitness function is:
[0044]
[0045] Wherein, R 2 is the function value of the fitness function, y i represents the actual observation result, represents the prediction result of the surrogate model, represents the average value of the actual observation results, and n represents the number of times.
[0046] As a possible implementation, the determination module is configured to:
[0047] Generate an initial particle swarm according to the first value range of each uncertain parameter; wherein, the position of each particle is a combination of uncertain parameters.
[0048] Calculate the fitness value of each particle, determine the optimal fitness value of each particle and the global optimal fitness value, and update the velocity and position of each particle.
[0049] When the iteration reaches the preset maximum number of iterations, stop the iteration.
[0050] As a possible implementation, the training module is used for:
[0051] Take each combination of uncertain parameters as the input of the long short-term memory network, take the corresponding SWMM simulation result as the output of the long short-term memory network, and train the network parameters of the long short-term memory network by dividing the training set and the test set to obtain the surrogate model.
[0052] As a possible implementation, before obtaining the first value range of each uncertain parameter to be calibrated, the obtaining module is further used for:
[0053] Obtain urban influencing factors, where the urban influencing factors include land use type, precipitation event, and watershed characteristics.
[0054] According to the urban influencing factors, determine the degree of influence of each uncertain parameter of the SWMM model by the random forest regression method, and determine the importance of each uncertain parameter according to the degree of influence of each uncertain parameter.
[0055] Screen the uncertain parameters to be calibrated according to the importance of each uncertain parameter.
[0056] In a third aspect, an embodiment of the present invention provides an electronic device, 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, the steps of the method in the above first aspect or any one of the implementation manners of the first aspect are implemented.
[0057] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium storing a computer program, and when the computer program is executed by a processor, the steps of the method in the above first aspect or any one of the implementation manners of the first aspect are implemented.
[0058] The beneficial effects of the embodiments of the present invention compared with the prior art are:
[0059] Since directly calibrating the parameters of the SWMM model using optimization methods such as genetic algorithms requires a large amount of time and computing power, the embodiments of the present invention learn the mapping relationship between uncertain parameter combinations and SWMM simulation results through a long short-term memory network, use the long short-term memory network as a surrogate model of the SWMM model, and find the value range where the optimal values of each uncertain parameter are located. On the one hand, compared with the SWMM model, the long short-term memory network is more efficient in iterative optimization and can accelerate the iterative process of the optimization algorithm; on the other hand, considering that there are still differences between the long short-term memory network and the SWMM model, only the surrogate model is used to narrow the search range of the optimal value, and then the SWMM model simulation calculation within a small range is performed to obtain the optimal values of the uncertain parameters, ensuring accuracy while improving efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0060] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following will briefly introduce the drawings required for use in the embodiments or the description of the prior art. Obviously, the following drawings are only some embodiments of the present invention, and those of ordinary skill in the art can obtain other drawings without creative efforts.
[0061] Figure 1 It is a flowchart of the method for calibrating the parameters of the SWMM model provided by the embodiments of the present invention;
[0062] Figure 2 It is a schematic structural diagram of the device for calibrating the parameters of the SWMM model provided by the embodiments of the present invention;
[0063] Figure 3 It is a schematic structural diagram of the electronic device provided by the embodiments of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0064] In the following description, specific details such as specific system structures and technologies are presented for the purpose of illustration rather than limitation, so as to thoroughly understand the embodiments of the present invention. However, those skilled in the art should clearly understand that the present invention can also be implemented in other embodiments without these specific details. In other cases, the detailed descriptions of well-known systems, devices, circuits, and methods are omitted to avoid unnecessary details from interfering with the description of the present invention.
[0065] In order to illustrate the technical solutions described in the present invention, the following will be described through specific embodiments.
[0066] SWMM is a widely used software for simulating urban drainage systems. There are many uncertain parameters in the SWMM model, including aspects such as hydrology, hydraulics, and water quality. The determination methods usually include data collection and analysis, experimental measurement, sensitivity analysis, parameter calibration and verification, etc. With the help of advanced optimization techniques such as genetic algorithms, it is possible to achieve the automatic calibration of multiple parameters in the SWMM model. In this process, the simulation error of the model is set as the core objective of optimization. By continuously adjusting the parameters, the accuracy of the simulation results is gradually improved, making the model simulation closer to the actual situation. However, this optimization process has certain limitations. Because in the operation, thousands of SWMM simulation iterations need to be carried out, and each iteration consumes a certain amount of computing resources and time. Especially when the SWMM model of the target area is large in scale and complex in structure, with numerous parameters and a more refined simulation process, this will undoubtedly further exacerbate the computational complexity. Therefore, in this case, calibrating the parameters often requires a large amount of time and powerful computing power support, which poses certain challenges to practical applications.
[0067] The present invention intends to construct an LSTM algorithm as a surrogate model to replace the SWMM model to execute the calculation process and accelerate the iteration process of the optimization algorithm. By using the Long Short-Term Memory (LSTM) algorithm to narrow the optimization range and further accurately find the optimal value through the SWMM model, a more efficient and accurate automatic calibration effect of SWMM parameters can be achieved.
[0068] Figure 1 It is a schematic diagram of the implementation process of the method for calibrating SWMM model parameters provided by an embodiment of the present invention. As Figure 1 shown, the method includes:
[0069] Step S101, obtain the first value range of each uncertain parameter to be calibrated, and generate the first preset number of combinations of uncertain parameters according to the first value range.
[0070] The uncertain parameters in the SWMM model and their first value ranges can be seen in Table 1. In some possible implementation manners, before obtaining the first value range of each uncertain parameter to be calibrated, it may further include: obtaining urban influencing factors, where the urban influencing factors include land use type, precipitation events, and watershed characteristics; according to the urban influencing factors, determining the degree of influence of each uncertain parameter in the SWMM model through the random forest regression method, and determining the importance of each uncertain parameter according to the degree of influence of each uncertain parameter; screening out the uncertain parameters to be calibrated from Table 1 according to the importance of each uncertain parameter.
[0071] Furthermore, 1000 combinations of uncertain parameters can be extracted by the Latin hypercube sampling method. By performing SWMM simulations, 1000 sets of simulation results can be obtained. Here, the simulation calculations for the 1000 sets of uncertain parameters are used for subsequent training of the surrogate model, and the quantity is much smaller than directly calibrating the SWMM model parameters using the genetic algorithm (tens of thousands of times).
[0072] Latin Hypercube Sampling (LHS) is a hierarchical Monte Carlo sampling method for experimental design. It can sample uniformly in a multi-dimensional parameter space, reducing the sampling scale while maintaining statistical significance, and can better explore the relationships between parameters.
[0073] Table 1 Uncertain Parameter Table
[0074] Serial number Parameter name Value range 1 Manning roughness coefficient of impervious area 0.01~0.05 2 Manning roughness coefficient of permeable area 0~1 3 Ponding depth of impervious area without depression / mm 0~10 4 Ponding depth of permeable area without depression / mm 0~10 5 Percentage of impervious area without ponding in depression / % 0~100 6 Maximum infiltration rate / (mm / h) 10~100 7 Minimum infiltration rate / (mm / h) 0~20 8 Decay rate constant / (1 / h) 0~10 9 Drainage time / d 0~14 10 Manning roughness coefficient of pipe network 0.01~0.03
[0075] Step S102: Perform SWMM simulation calculations for each combination of uncertain parameters to obtain the SWMM simulation results corresponding to each combination of uncertain parameters.
[0076] In this embodiment, the uncertain parameters of the SWMM model are set through each combination of uncertain parameters. After completing all the above settings, the SWMM model is run to perform simulation calculations on the rainfall time series to obtain the SWMM simulation results corresponding to each combination of uncertain parameters.
[0077] Step S103: Learn the mapping relationship between the combination of uncertain parameters and the SWMM simulation results through a long short-term memory network to obtain a surrogate model.
[0078] Here, the static characteristic parameters of the SWMM model (the combination of uncertain parameters generated by the Latin hypercube sampling method) and the dynamic characteristic parameters (rainfall time series) are used as inputs, and the dynamic result parameters (pipe flow change time series) obtained from the SWMM model simulation calculations are used as outputs to divide the training set and the test set and train the LSTM model. In the LSTM model architecture, the number of neurons in the first LSTM layer is 128, the number of neurons in the second LSTM layer is 64, the parameter of the Dropout layer is set to 0.3, and the parameter of the neurons in the Dense layer is 32 - 64. When training the model, the Adam optimizer can be selected for optimization, the learning rate is set to 0.001, and the gradient decay value is set to 0.0005; the loss function selects the MSE function. The trained LSTM model can better predict the flow simulation results.
[0079] In addition, in the static characteristic parameter system of the SWMM model, fixed parameters such as catchment area and characteristic width can also be incorporated. The introduction of these parameters can provide more detailed and accurate basic information for the model, and thus play a powerful auxiliary role in predicting the flow simulation results, making the prediction results more accurate and reliable.
[0080] Step S104: According to the surrogate model, determine the second value range where the optimal value of each uncertain parameter is located from the first value range of each uncertain parameter; wherein, the second value range is smaller than the first value range.
[0081] In this embodiment, the surrogate model is used to replace the SWMM model for calculation, narrowing the search range for the optimal value of the uncertain parameter.
[0082] The detailed steps include:
[0083] (1) Initialize the particle swarm: For the uncertain parameters in the SWMM model, use the Latin hypercube sampling method to extract 50 combinations of different parameters as the position vector of each particle. Randomly initialize the velocity of each particle in space. The maximum number of iterations is set to 100.
[0084] (2) Selection of fitness function: Compare the prediction results of the LSTM model with the actual observed data, and calculate the determination coefficient R 2 as the fitness function.
[0085]
[0086] where R 2 is the function value of the fitness function, y i represents the actual observed result, represents the prediction result of the surrogate model, represents the average value of the actual observed results, and n represents the number of times.
[0087] (3) Iteratively update the particles: For each particle, calculate the current fitness value and compare it with the fitness value at its previous position. If the fitness is higher, update the fitness value of the particle individual and its corresponding position; compare the individual fitness values of all particles, find the particle with the optimal fitness, and use its position as the global optimum; update the velocity and position of all particles according to the following formula:
[0088] v ij (t + 1) = ω * v ij (t) + c1 * r1 * (p ij (t) - x ij (t)) + c2 * r2 * (g j (t) - x ij(t))
[0089] x ij (t + 1)= x ij (t)+ v ij (t + 1)
[0090] where v ij (t + 1) and v ij (t) are the velocities of the i-th particle at time t + 1 and time t in the j-th dimension respectively, ω is the inertia weight, c1 and c2 are learning factors, r1 and r2 are random numbers between 0 and 1, p ij (t) is the individual extreme value position of the i-th particle at time t in the j-th dimension, g j (t) is the position of the global extreme value in the j-th dimension, x ij (t + 1) and x ij (t) are the positions of the i-th particle at time t + 1 and time t in the j-th dimension.
[0091] (4) Judge the termination condition: Stop the iteration when the iteration reaches the maximum number of iterations 100.
[0092] (5) Select the second preset number (such as 50) of particles according to the order of the fitness values from large to small, and obtain the second number of uncertain parameter combinations according to their positions.
[0093] (6) Among the second preset number of uncertain parameter combinations, find the maximum value of each uncertain parameter as the upper limit value of the second value range, and find the minimum value of each uncertain parameter as the lower limit value of the second value range, to obtain the second value range corresponding to each uncertain parameter.
[0094] Step S105, according to the second value ranges corresponding to the respective uncertain parameters, through simulation calculations on the SWMM model, obtain the optimal values of the respective uncertain parameters.
[0095] Here, steps S101 and S102 can be referred to. According to the second value ranges corresponding to the respective uncertain parameters, 100 combinations of uncertain parameters are extracted by the Latin hypercube sampling method. Then, the uncertain parameters of the SWMM model are set through each combination of uncertain parameters. After completing all the above settings, the SWMM model is run to perform simulation calculations on the rainfall time series, and the SWMM simulation results corresponding to each combination of uncertain parameters are obtained. By comparing the SWMM simulation results with the actual observed data, the combination of uncertain parameters with the minimum error is selected to obtain the optimal values of the respective uncertain parameters.
[0096] Since directly calibrating the parameters of the SWMM model using optimization methods such as genetic algorithms requires a large amount of time and computing power, the embodiments of the present invention learn the mapping relationship between uncertain parameter combinations and SWMM simulation results through a long short-term memory network, use the long short-term memory network as a surrogate model of the SWMM model, and find the value range where the optimal values of each uncertain parameter are located. On the one hand, compared with the SWMM model, the long short-term memory network is more efficient in iterative optimization and can accelerate the iterative process of the optimization algorithm; on the other hand, considering that there are still differences between the long short-term memory network and the SWMM model, only the surrogate model is used to narrow the search range of the optimal value, and then the optimal value of the uncertain parameter is obtained through the SWMM model simulation calculation within a small range, which ensures accuracy while improving efficiency.
[0097] In a test scenario of this method, it takes about 10 s to perform one SWMM simulation. If the traditional particle swarm algorithm is used for optimization alone, at least 5000 simulation processes need to be executed, which takes about 14 h. If LSTM is used as the surrogate model, 1000 SWMM simulation processes need to be executed in the training data construction stage, which takes about 3 h, the LSTM model training process takes about 0.5 h, the prediction speed is about 0.5 s, 5000 optimizations are performed in the particle swarm optimization stage, the prediction time is about 0.7 h, and 100 simulation processes are performed in the further SWMM simulation stage, which takes about 0.28 h. The total time is about 4.48 h. Therefore, the present invention improves the efficiency of the traditional optimization algorithm by at least more than 3 times. When the SWMM model structure of the research area is larger, the advantages of this method will be more significant. At the same time, indicators such as mean square error and Nash coefficient are used to evaluate the simulation results of the optimal SWMM parameters. The results show that the mean square error is 0.234 and the Nash coefficient is 0.863, indicating that the calibration effect of the SWMM model is good.
[0098] To further improve the operability and user experience of the parameter calibration process, this embodiment also designs an intuitive and simple user operation interface. This interface simplifies complex programming tasks through graphical buttons, text boxes, etc., enabling users to easily adjust parameters and optimize the model. Even non-professional users can quickly master the operation process. This design significantly improves the usability and user satisfaction of the software, reduces the user's learning curve, and effectively reduces the possibility of incorrect operations. The interface design not only focuses on functionality but also carefully polishes the aesthetics and user interaction experience to ensure a smooth experience for users during use. The software interface includes the following three sections:
[0099] (1) File selection area: used to select the SWMM model file, actual flow data file, and LSTM training data file.
[0100] (2) Operation buttons: Users can choose to run the SWMM model, predict the flow using the LSTM model, perform automatic parameter calibration, and compare the flows.
[0101] (3) Log window: Displays the operation steps and software status, including file selection, running status, error messages, etc.
[0102] The above three sections are concise and clear, and can provide a simple graphical interface operation for flow simulation and prediction in urban hydrological management, facilitating the calibration of model parameters. Users can quickly achieve machine learning flow prediction, automatic simulation of the SWMM model, and automatic parameter calibration through a simple interface.
[0103] It should be understood that the magnitudes of the sequence numbers of the steps in the above embodiments do not mean the order of execution. The order of execution of each process should be determined by its function and internal logic, and should not constitute any limitation to the implementation process of the embodiments of the present invention.
[0104] Figure 2 is a schematic structural diagram of the SWMM model parameter calibration device provided by the embodiments of the present invention. Refer to Figure 2 As shown, the SWMM model parameter calibration device 20 includes:
[0105] An acquisition module 21, configured to acquire the first value range of each uncertain parameter to be calibrated, and generate a first preset number of combinations of uncertain parameters according to the first value range;
[0106] A calculation module 22, configured to perform SWMM simulation calculations on each combination of uncertain parameters to obtain the SWMM simulation results corresponding to each combination of uncertain parameters;
[0107] A training module 23, configured to learn the mapping relationship between the combination of uncertain parameters and the SWMM simulation results through a long short-term memory network to obtain a surrogate model;
[0108] A determination module 24, configured to determine the second value range where the optimal value of each uncertain parameter is located from the first value range of each uncertain parameter according to the surrogate model; wherein, the second value range is smaller than the first value range; according to the second value range corresponding to each uncertain parameter, perform simulation calculations on the SWMM model to obtain the optimal value of each uncertain parameter.
[0109] As a possible implementation manner, the determination module 24 is configured to:
[0110] Determine a fitness function according to the difference between the prediction result of the surrogate model and the actual observation result, and use the particle swarm optimization algorithm to iteratively optimize the combination of uncertain parameters of the SWMM model;
[0111] After the iterative termination condition is satisfied, select the second preset number of particles according to the order of fitness values from large to small to obtain the second number of uncertain parameter combinations;
[0112] Among the second preset number of uncertain parameter combinations, find the maximum value of each uncertain parameter as the upper limit value of the second value range, and find the minimum value of each uncertain parameter as the lower limit value of the second value range to obtain the second value range corresponding to each uncertain parameter.
[0113] As a possible implementation, the determination module 24 is used for:
[0114] Generate the third preset number of uncertain parameter combinations according to the second value range corresponding to each uncertain parameter;
[0115] Among the third preset number of uncertain parameter combinations, determine the uncertain parameter combination that minimizes the difference between the simulation result of the SWMM model and the actual observation result, and obtain the optimal values of each uncertain parameter according to this uncertain parameter combination.
[0116] As a possible implementation, the fitness function is:
[0117]
[0118] Where, R 2 is the function value of the fitness function, y i represents the actual observation result, represents the prediction result of the surrogate model, represents the average value of the actual observation results, and n represents the number of times.
[0119] As a possible implementation, the determination module 24 is used for:
[0120] Generate an initial particle swarm according to the first value range of each uncertain parameter; where, the position of each particle is an uncertain parameter combination;
[0121] Calculate the fitness value of each particle, determine the optimal fitness value and the global optimal fitness value of each particle, and update the speed and position of each particle;
[0122] When the iteration reaches the preset maximum number of iterations, stop the iteration.
[0123] As a possible implementation, the training module 23 is used for:
[0124] Use each uncertain parameter combination as the input of the long short-term memory network, and use the corresponding SWMM simulation result as the output of the long short-term memory network. By dividing the training set and the test set, train the network parameters of the long short-term memory network to obtain a surrogate model.
[0125] As a possible implementation manner, before obtaining the first value ranges of the respective uncertain parameters to be calibrated, the obtaining module 21 is further configured to:
[0126] Obtain urban influencing factors, where the urban influencing factors include land use types, precipitation events, and watershed characteristics;
[0127] According to the urban influencing factors, determine the influence degrees of the respective uncertain parameters of the SWMM model by using the random forest regression method, and determine the importance of the respective uncertain parameters according to the influence degrees of the respective uncertain parameters;
[0128] Screen the uncertain parameters to be calibrated according to the importance of the respective uncertain parameters.
[0129] Since directly calibrating the SWMM model parameters by using optimization methods such as genetic algorithms requires a large amount of time and computing power, the embodiment of the present invention learns the mapping relationship between the uncertain parameter combinations and the SWMM simulation results through a long short-term memory network, uses the long short-term memory network as a surrogate model of the SWMM model, and searches for the value ranges where the optimal values of the respective uncertain parameters are located. On the one hand, compared with the SWMM model, the long short-term memory network is more efficient in iterative optimization and can accelerate the iterative process of the optimization algorithm; on the other hand, considering that there are still differences between the long short-term memory network and the SWMM model, only the surrogate model is used to narrow the search range of the optimal value, and then the SWMM model simulation calculation is performed within a small range to obtain the optimal values of the uncertain parameters, which ensures accuracy while improving efficiency.
[0130] Figure 3 is a schematic diagram of an electronic device 30 provided by an embodiment of the present invention. As Figure 3 shown, the electronic device 30 of this embodiment includes: a processor 31, a memory 32, and a computer program 33 stored in the memory 32 and executable on the processor 31, such as a SWMM model parameter calibration program. When the processor 31 executes the computer program 33, the steps in the above-mentioned respective embodiments of the SWMM model parameter calibration method are implemented, such as Figure 1 the steps S101 to S105 shown. Alternatively, when the processor 31 executes the computer program 33, the functions of the respective modules / units in the above-mentioned respective device embodiments are implemented, such as Figure 2 the functions of the modules 21 to 24 shown.
[0131] Exemplarily, the computer program 33 may be divided into one or more modules / units, which are stored in the memory 32 and executed by the processor 31 to implement the present invention. The one or more modules / units may be a series of computer program instruction segments capable of performing specific functions, and these instruction segments are used to describe the execution process of the computer program 33 in the electronic device 30.
[0132] The electronic device 30 may be a computing device such as a desktop computer, a notebook, a palm computer, and a cloud server. The electronic device 30 may include, but is not limited to, a processor 31 and a memory 32. Those skilled in the art can understand that Figure 3 merely examples of the electronic device 30, which do not constitute a limitation on the electronic device 30, may include more or fewer components than shown in the figure, or combine certain components, or different components. For example, the electronic device 30 may further include input / output devices, network access devices, a bus, etc.
[0133] The so-called processor 31 may be a central processing unit (CPU), or may also be other general-purpose processors, digital signal processors (DSPs), application specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.
[0134] The memory 32 may be an internal storage unit of the electronic device 30, such as the hard disk or memory of the electronic device 30. The memory 32 may also be an external storage device of the electronic device 30, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc., equipped on the electronic device 30. Further, the memory 32 may also include both the internal storage unit and the external storage device of the electronic device 30. The memory 32 is used to store the computer program and other programs and data required by the electronic device 30. The memory 32 may also be used to temporarily store data that has been output or is to be output.
[0135] Those skilled in the art can clearly understand that, for the convenience and conciseness of description, only the above division of each functional unit and module is used as an example. In actual applications, the above functions can be allocated to different functional units and modules according to needs, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. Each functional unit and module in the embodiments can be integrated into a processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit. The above integrated unit can be implemented in the form of hardware or in the form of a software functional unit. In addition, the specific names of each functional unit and module are only for the convenience of mutual distinction and do not limit the protection scope of this application. The specific working processes of the units and modules in the above system can refer to the corresponding processes in the foregoing method embodiments and will not be elaborated here.
[0136] In the above embodiments, the descriptions of each embodiment have their own emphases. For the parts not detailed or recorded in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0137] Those of ordinary skill in the art can realize that the units and algorithm steps of each example described in combination with the embodiments disclosed herein can be implemented by electronic hardware, or by a combination of computer software and electronic hardware. Whether these functions are executed in the form of hardware or software depends on the specific application and design constraints of the technical solution. Professionals can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the present invention.
[0138] In the embodiments provided by the present invention, it should be understood that the disclosed device / electronic device and method can be implemented in other ways. For example, the device / electronic device embodiments described above are only illustrative. For example, the division of the modules or units is only a logical function division, and there can be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed couplings or direct couplings or communication connections to each other can be through some interfaces, and the indirect couplings or communication connections of the devices or units can be in electrical, mechanical or other forms.
[0139] The units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they can be located in one place or distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0140] In addition, in each embodiment of the present invention, the functional units may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit. The above-mentioned integrated units may be implemented in the form of hardware or in the form of software functional units.
[0141] If the integrated module / unit is implemented in the form of a software functional unit and sold or used as an independent product, it may be stored in a computer-readable storage medium. Based on such an understanding, to implement all or part of the processes in the above-mentioned embodiment methods of the present invention, it may also be completed by a computer program instructing relevant hardware. The computer program may be stored in a computer-readable storage medium. When the computer program is executed by a processor, the steps of the above-mentioned various method embodiments may be implemented. Among them, the computer program includes computer program code, and the computer program code may be in the form of source code, object code, executable file or some intermediate form, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disc, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electrical carrier signal, telecommunication signal, and software distribution medium, etc.
[0142] The above-mentioned embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: they can still modify the technical solutions recorded in the foregoing embodiments, or perform equivalent replacements on some of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the various embodiments of the present invention, and should all be included in the protection scope of the present invention.
Claims
1. A SWMM model parameter calibration method, characterized in that: include: Acquire a first value range of each uncertain parameter to be calibrated, and generate a first preset number of uncertain parameter combinations according to the first value range; Perform SWMM simulation calculations on each uncertain parameter combination to obtain the SWMM simulation results corresponding to each uncertain parameter combination; The proxy model is obtained by learning the implicit relationship between the uncertain parameter combination and the SWMM simulation results through the long short-term memory network; According to the proxy model, determining a second value range where the optimal value of each uncertain parameter is located from the first value range of each uncertain parameter; wherein the second value range is smaller than the first value range; According to the second value range corresponding to each uncertain parameter, the optimal value of each uncertain parameter is obtained by simulating and calculating the SWMM model.
2. The SWMM model parameter calibration method according to claim 1, characterized in that: Determining, according to the proxy model, from the first value range of each uncertain parameter, a second value range where the optimal value of each uncertain parameter lies, comprises: Determine the fitness function according to the difference between the prediction result of the proxy model and the actual observation result, and use the particle swarm algorithm to iteratively optimize the uncertain parameter combination of the SWMM model; After the iteration termination condition is met, a second preset number of particles are selected according to the fitness values in descending order to obtain a second number of uncertain parameter combinations; In the second preset number of uncertain parameter combinations, find the maximum value of each uncertain parameter as the upper limit value of the second value range, find the minimum value of each uncertain parameter as the lower limit value of the second value range, and obtain the second value range corresponding to each uncertain parameter.
3. The SWMM model parameter calibration method according to claim 1, characterized in that: The method of obtaining the optimal value of each uncertain parameter by simulating and calculating the SWMM model according to the second value range corresponding to each uncertain parameter includes: Generating a third preset number of uncertain parameter combinations according to the second value range corresponding to each uncertain parameter; Among the third preset number of uncertain parameter combinations, determine the uncertain parameter combination that minimizes the difference between the simulation calculation results and the actual observation results of the SWMM model, and obtain the optimal value of each uncertain parameter based on the uncertain parameter combination.
4. The SWMM model parameter calibration method according to claim 2, characterized in that: The fitness function is: Among them, R 2 is the function value of the fitness function, y i represents the actual observation results, represents the prediction result of the surrogate model, represents the average value of the actual observation results, and n represents the number of observations.
5. The SWMM model parameter calibration method according to claim 2, characterized in that: The particle swarm algorithm is used to iteratively optimize the uncertain parameter combination of the SWMM model, including: Generate an initial particle swarm according to the first value range of each uncertain parameter, wherein the position of each particle is an uncertain parameter combination; Calculate the fitness value of each particle, determine the optimal fitness value of each particle and the global optimal fitness value, and update the speed and position of each particle; When the maximum number of iterations is reached, the iteration stops.
6. The SWMM model parameter calibration method according to any one of claims 1 to 5, characterized in that: The agent model is obtained by learning the implicit relationship between the uncertain parameter combination and the SWMM simulation results through the long short-term memory network, including: Each uncertain parameter combination and rainfall time series are used as the input of the long short-term memory network, the corresponding SWMM simulation results are used as the output of the long short-term memory network, the network parameters of the long short-term memory network are trained, and the proxy model is obtained.
7. The SWMM model parameter calibration method according to any one of claims 1 to 5, characterized in that: Before obtaining the first value range of each uncertain parameter to be calibrated, the method further includes: Obtaining urban influencing factors, the urban influencing factors including land use type, precipitation events, and watershed characteristics; According to the urban influencing factors, the influence degree of each uncertain parameter of the SWMM model is determined by a random forest regression method, and the importance of each uncertain parameter is determined according to the influence degree of each uncertain parameter; According to the importance of each uncertain parameter, select the uncertain parameters to be calibrated.
8. A SWMM model parameter calibration device, characterized in that: include: An acquisition module, used for acquiring a first value range of each uncertain parameter to be calibrated, and generating a first preset number of uncertain parameter combinations according to the first value range; A calculation module is used to perform SWMM simulation calculations on each uncertain parameter combination to obtain the SWMM simulation results corresponding to each uncertain parameter combination; The training module is used to learn the implicit relationship between the uncertain parameter combination and the SWMM simulation results through the long short-term memory network to obtain the proxy model; A determination module is used to determine, according to the proxy model, a second value range where the optimal value of each uncertain parameter is located from the first value range of each uncertain parameter; wherein the second value range is smaller than the first value range; and according to the second value range corresponding to each uncertain parameter, the optimal value of each uncertain parameter is obtained by simulating and calculating the SWMM model.
9. An electronic device 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, the steps of the method according to any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.