Efficient numerical simulation method for flood warning based on heterogeneous computing

By analyzing the friction and slope terms through multiple flood simulations, adjusting the Manning coefficient and computing resource allocation, the problem of inaccurate flood simulation results was solved, and more accurate and efficient flood simulation was achieved.

CN120524713BActive Publication Date: 2025-09-19JILIN UNIVERSITY
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511022237.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-07-24
Publication Date
2025-09-19
Estimated Expiration
2045-07-24

AI Technical Summary

Technical Problem

The flood simulation results output by existing flood simulation schemes are less accurate, mainly due to the discrepancy between the pre-configured model parameters and the actual flood movement.

Method used

By conducting multiple flood simulations based on the first shallow water equation, analyzing the friction term and slope term, obtaining the coefficient correction parameters, adjusting the Manning coefficient to form the second shallow water equation, and dynamically adjusting the computing resource configuration according to the coefficient correction parameters, multiple flood simulations are conducted.

Benefits of technology

The accuracy of flood simulation results is improved, and the calculation time is shortened while ensuring accuracy, and the calculation complexity changes caused by the adjustment of the Manning coefficient are dynamically adapted.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120524713B_ABST
    Figure CN120524713B_ABST
Patent Text Reader

Abstract

The present invention relates to the technical field of data processing, and more particularly to an efficient numerical simulation method for flood warning based on heterogeneous computing. The method comprises: performing multiple flood simulations based on a first shallow water equation to obtain multiple first simulation results output by a parallel computing system at target output period intervals under a set simulation duration; analyzing the friction term and slope term included in each first simulation result to obtain a coefficient correction parameter; adjusting the Manning coefficient included in the first shallow water equation based on the coefficient correction parameter to obtain a second shallow water equation; performing multiple flood simulations based on the second shallow water equation to obtain multiple second simulation results output by the parallel computing system at intervals under the set simulation duration, wherein the computing resource configuration corresponding to the (i+1)th second simulation result is determined based on the computing resource configuration corresponding to the calculation of the (i)th second simulation result. The present invention can obtain more accurate flood simulation results.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of data processing, and in particular to an efficient numerical simulation method for flood early warning based on heterogeneous computing. Background Art

[0002] Early flood prevention efforts were primarily achieved through engineering measures such as building reservoirs and raising levees. However, these early engineering measures only provided effective flood warnings during the critical phase of a flood, leaving little time for people to implement appropriate flood prevention measures and creating safety risks when these measures are taken. To reduce safety risks during flood prevention measures and increase the duration of flood warnings, computer technology is currently being used to simulate flood models based on relevant information stored in reservoirs. This allows for earlier detection of flooding and timely response, thereby reducing the harm caused by flooding.

[0003] When using computer technology to simulate flood models for relevant information in reservoirs, a large amount of memory-consuming tasks such as data reading and writing will be generated. If these tasks are handed over to the CPU for unified operation and processing, the CPU will assign all these tasks to the GPU for processing, which will put too much pressure on the GPU processing. To avoid excessive processing pressure on the GPU, existing technologies will adopt heterogeneous computing methods to break down the large amount of memory-consuming tasks into multiple computing grids, and then hand them over to the GPU for parallel computing, thereby realizing a heterogeneous framework and improving computing efficiency.

[0004] During the application, it was found that the model parameters used in flood simulation were pre-configured, but there were certain discrepancies between the pre-configured model parameters and the actual movement of the flood, which caused serious distortion in the final output flood simulation results.

[0005] In other words, the accuracy of flood simulation results output by existing flood simulation schemes is low. Summary of the Invention

[0006] In order to solve the technical problem of low accuracy of flood simulation results output by existing flood simulation solutions, the present invention aims to provide an efficient numerical simulation method for flood early warning based on heterogeneous computing. The technical solution adopted is as follows:

[0007] In a first aspect, an embodiment of the present invention provides an efficient numerical simulation method for flood warning based on heterogeneous computing, the method comprising:

[0008] Performing multiple flood simulations based on the first shallow water equation to obtain multiple first simulation results output by the parallel computing system at target output period intervals under a set simulation duration, wherein the first simulation results include a friction term and a slope term, the friction term being used to represent the flow resistance of the flood during the corresponding simulation process, and the slope term being used to represent the flow dynamics of the flood during the corresponding simulation process;

[0009] Analyzing the friction term and the slope term included in each first simulation result to obtain a coefficient correction parameter, wherein the coefficient correction parameter is used to represent the corresponding sediment obstruction during flood flow;

[0010] adjusting the Manning coefficient included in the first shallow water equation based on the coefficient correction parameter to obtain a second shallow water equation, wherein the Manning coefficient is used to calculate the friction term, and the Manning coefficient and the friction term are positively correlated;

[0011] Multiple flood simulations are performed based on the second shallow water equation to obtain multiple second simulation results output by the parallel computing system at intervals under the set simulation duration, wherein the computing resource configuration corresponding to the i+1th second simulation result is determined based on the computing resource configuration corresponding to the calculation of the i-th second simulation result, and i is a positive integer less than the total number of the multiple second simulation results.

[0012] In one embodiment, the friction term and the slope term included in each first simulation result are analyzed to obtain coefficient correction parameters, including:

[0013] Analyzing the difference between the friction term and the slope term included in each first simulation result to obtain a dynamic resistance difference parameter corresponding to each first simulation result;

[0014] Calculating the mean values ​​of a plurality of kinetic resistance difference parameters corresponding to the plurality of first simulation results to obtain a coefficient deviation value;

[0015] Based on the friction term and the slope term included in each first simulation result, identifying a target simulation result from the plurality of first simulation results, wherein the target simulation result is a first simulation result corresponding to a stagnant flood movement state;

[0016] Analyze the proportion of the target simulation result in the plurality of first simulation results to obtain a sediment impact factor;

[0017] The coefficient correction parameter is obtained according to the coefficient deviation value and the sediment influence factor.

[0018] In one embodiment, analyzing the difference between the friction term and the slope term included in each first simulation result to obtain the dynamic resistance difference parameter corresponding to each first simulation result includes:

[0019] Calculating a ratio of a component of a gradient term in a first direction included in each first simulation result to a component of a friction term in the first direction included therein, to obtain a first ratio corresponding to each first simulation result;

[0020] Calculating a ratio of a component of a slope term included in each first simulation result in the second direction to a component of a friction term included therein in the second direction, to obtain a second ratio corresponding to each first simulation result;

[0021] Calculating the sum of the first ratio corresponding to each first simulation result and the second ratio corresponding thereto to obtain the original dynamic resistance parameter corresponding to each first simulation result;

[0022] The original parameters of the dynamic resistance corresponding to each first simulation result are normalized to obtain the dynamic resistance difference parameters corresponding to each first simulation result, wherein the first direction is the flood movement direction corresponding to the first shallow water equation, and the straight line corresponding to the first direction in the horizontal plane and the straight line corresponding to the second direction in the horizontal plane are perpendicular to each other.

[0023] In one embodiment, identifying a target simulation result from a plurality of first simulation results based on a friction term and a slope term included in each first simulation result includes:

[0024] Based on a plurality of gradient items included in the plurality of first simulation results, a power time period is identified within the set simulation duration, wherein the gradient items of the plurality of first simulation results within the power time period are continuously increased;

[0025] Among the plurality of first simulation results, determining the first simulation result outside the power time period as a sediment simulation result;

[0026] Analyzing the quantitative differences between a plurality of sediment simulation results preceding each sediment simulation result and a plurality of first simulation results within the dynamic time period to obtain a sediment obstruction index for each sediment simulation result;

[0027] Among the multiple sediment simulation results, the sediment simulation result whose corresponding sediment obstruction index is greater than the index threshold is determined as the target simulation result.

[0028] In one embodiment, obtaining the coefficient correction parameter according to the coefficient deviation value and the sediment impact factor includes:

[0029] Obtaining a correction factor according to the sediment impact factor, wherein the sum of the sediment impact factor and the correction factor is 1;

[0030] The product of the correction factor and the coefficient deviation value is determined as the coefficient correction parameter.

[0031] In one embodiment, the step of determining the computing resource configuration corresponding to the (i+1)th second simulation result includes:

[0032] Analyze the attenuation degree of the parallel computing efficiency corresponding to the i-th second simulation result to obtain the efficiency reduction risk value;

[0033] Analyze the used registers corresponding to the i-th second simulation result to obtain a register extension risk value, and analyze the used shared memory corresponding to the i-th second simulation result to obtain a shared memory extension risk value;

[0034] Obtaining a register extension feasible value according to the efficiency degradation risk value, the register extension risk value, and the shared memory extension risk value;

[0035] Analyze the difference between the output time of the i-th second simulation result and the target output cycle to obtain a time difference value;

[0036] determining an interval extension feasible value according to the register extension feasible value, the time difference value, and the target output period;

[0037] According to the register extension feasible value and the interval extension feasible value, the computing resource configuration corresponding to the i-th second simulation result is adjusted to obtain the computing resource configuration corresponding to the i+1-th second simulation result, the computing resource configuration including: the number of register configurations and the result output interval, the number of register configurations being the number of registers used when the parallel computing system calculates the corresponding second simulation result, and the result output interval being the time interval between the output moment of the corresponding second simulation result and the output moment of the previous second simulation result.

[0038] In one embodiment, analyzing the attenuation degree of the parallel computing efficiency corresponding to the i-th second simulation result to obtain the efficiency reduction risk value includes:

[0039] Obtaining a first number corresponding to the i-th second simulation result, where the first number is the number of registers used by the parallel computing system to output the corresponding second simulation result;

[0040] Calculating a ratio of a first quantity corresponding to the i-th second simulation result to a second quantity corresponding to the i-th second simulation result to obtain a first efficiency value, where the second quantity is the number of thread groups included in the thread block used by the parallel computing system to output the corresponding second simulation result;

[0041] calculating a ratio of a first quantity corresponding to the i-th second simulation result to a third quantity corresponding to the i-th first simulation result to obtain a second efficiency value, where the third quantity is the number of thread groups included in the thread block used by the parallel computing system to output the corresponding first simulation result, and the second efficiency value is greater than the first efficiency value;

[0042] The difference between the first efficiency value and the second efficiency value is analyzed to obtain the efficiency degradation risk value.

[0043] In one embodiment, analyzing the used registers corresponding to the i-th second simulation result to obtain a register extension risk value, and analyzing the used shared memory corresponding to the i-th second simulation result to obtain a shared memory extension risk value, includes:

[0044] Calculating a ratio between a total number of registers corresponding to the parallel computing system and a fourth number corresponding to the i-th second simulation result to obtain a register expansion risk value, wherein the fourth number is the number of unused registers when the parallel computing system outputs the corresponding second simulation result;

[0045] Calculate the ratio of the total shared memory corresponding to the parallel computing system to the idle shared memory corresponding to the i-th second simulation result to obtain a shared memory expansion risk value, wherein the idle shared memory is the shared memory that is not used when the parallel computing system outputs the corresponding second simulation result.

[0046] In one embodiment, determining the interval extension feasible value according to the register extension feasible value, the time difference value, and the target output period includes:

[0047] Calculating a product of the register extension feasible value, the time difference value, and the target output cycle to obtain a product value;

[0048] Calculating the reciprocal of the product value to obtain a reciprocal product value;

[0049] The reciprocal value of the product is normalized to obtain the interval extension feasible value.

[0050] In one embodiment, adjusting the computing resource configuration corresponding to the i-th second simulation result according to the register extension feasible value and the interval extension feasible value to obtain the computing resource configuration corresponding to the i+1-th second simulation result includes:

[0051] When the register extension feasible value is greater than the first threshold, the number of register configurations corresponding to the i-th second simulation result is expanded to obtain the number of register configurations corresponding to the (i+1)-th second simulation result, and the result output interval corresponding to the i-th second simulation result is determined as the result output interval corresponding to the (i+1)-th second simulation result;

[0052] When the register extension feasible value is between the first threshold and the second threshold, and the interval extension feasible value is greater than the third threshold, the number of register configurations corresponding to the i-th second simulation result is expanded to obtain the number of register configurations corresponding to the (i+1)-th second simulation result, and the result output interval corresponding to the i-th second simulation result is expanded to obtain the result output interval corresponding to the (i+1)-th second simulation result, and the second threshold is less than the first threshold;

[0053] When the register extension feasible value is between the first threshold and the second threshold, and the interval extension feasible value is less than or equal to the third threshold, the number of register configurations corresponding to the i-th second simulation result is increased to obtain the number of register configurations corresponding to the (i+1)-th second simulation result, and the result output interval corresponding to the i-th second simulation result is determined as the result output interval corresponding to the (i+1)-th second simulation result;

[0054] When the register extension feasible value is less than or equal to the second threshold and the interval extension feasible value is greater than the third threshold, determining the register configuration number corresponding to the i-th second simulation result as the register configuration number corresponding to the (i+1)-th second simulation result, and expanding the result output interval corresponding to the i-th second simulation result to obtain the result output interval corresponding to the (i+1)-th second simulation result, and the second threshold is less than the first threshold;

[0055] When the register extension feasible value is less than or equal to the second threshold and the interval extension feasible value is less than or equal to the third threshold, the register configuration number corresponding to the i-th second simulation result is determined as the register configuration number corresponding to the i+1-th second simulation result, and the result output interval corresponding to the i-th second simulation result is determined as the result output interval corresponding to the i+1-th second simulation result.

[0056] In a second aspect, another embodiment of the present invention provides an efficient numerical simulation device for flood warning based on heterogeneous computing, the device comprising:

[0057] a first simulation module, configured to perform multiple flood simulations based on the first shallow water equation, and obtain multiple first simulation results output by the parallel computing system at target output period intervals under a set simulation duration, wherein the first simulation results include a friction term and a slope term, wherein the friction term is used to represent the flow resistance of the flood during the corresponding simulation process, and the slope term is used to represent the flow dynamics of the flood during the corresponding simulation process;

[0058] An analysis module is used to analyze the friction term and the slope term included in each first simulation result to obtain a coefficient correction parameter, wherein the coefficient correction parameter is used to represent the corresponding sediment obstruction during flood flow;

[0059] a model adjustment module, configured to adjust the Manning coefficient included in the first shallow water equation based on the coefficient correction parameter to obtain a second shallow water equation, wherein the Manning coefficient is used to calculate a friction term, and the Manning coefficient and the friction term are positively correlated;

[0060] The second simulation module is used to perform multiple flood simulations based on the second shallow water equation to obtain multiple second simulation results output by the parallel computing system at intervals under the set simulation time, wherein the computing resource configuration corresponding to the i+1th second simulation result is determined based on the computing resource configuration corresponding to the calculation of the i-th second simulation result, and i is a positive integer less than the total number of the multiple second simulation results.

[0061] In a third aspect, another embodiment of the present invention further provides an electronic device, comprising a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the computer program implements the steps of the method described in the first aspect when executed by the processor.

[0062] In a fourth aspect, another embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the method described in the first aspect are implemented.

[0063] The present invention has the following beneficial effects:

[0064] The present invention first performs multiple flood simulations based on the first shallow water equation to obtain multiple first simulation results output by the parallel computing system at target output cycle intervals under the set simulation time. Then, by analyzing the friction term and slope term included in each first simulation result, that is, analyzing the dynamic conditions and resistance conditions of the flood during the multiple flood simulations, it is possible to infer the degree of numerical deviation of the Manning coefficient used to calculate the friction term due to not considering the influence of sediment, and quantify the degree of numerical deviation as a coefficient correction parameter. The Manning coefficient included in the first shallow water equation is adjusted by the coefficient correction parameter to overcome the problem that the first shallow water equation does not consider sediment obstruction when calculating the friction term. Then, the second shallow water equation is formed based on the corrected Manning coefficient. Second shallow water equation, and multiple flood simulations are performed again to obtain more accurate flood simulation results. Among them, when the flood simulation is performed based on the revised Manning coefficient, the computational complexity of the simulation process will change. By setting the computing resource configuration corresponding to the i+1th second simulation result based on the computing resource configuration corresponding to the calculation of the i-th second simulation result, that is, setting the computing resource configuration corresponding to the next flood simulation based on the computing resource configuration corresponding to the previous flood simulation, it can dynamically adapt to the computational complexity changes caused by the adjustment of the Manning coefficient, and shorten the computation time of each second simulation result as much as possible while ensuring the accuracy of the second simulation result output by each simulation. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0066] Figure 1 A schematic flow chart of an efficient numerical simulation method for flood early warning based on heterogeneous computing provided by one embodiment of the present invention;

[0067] Figure 2 A schematic diagram of the structure of a parallel computing system provided by one embodiment of the present invention;

[0068] Figure 3 A schematic structural diagram of an efficient numerical simulation device for flood early warning based on heterogeneous computing provided by one embodiment of the present invention;

[0069] Figure 4 The present invention provides a schematic structural diagram of an electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0070] To further illustrate the technical means and effectiveness of the present invention in achieving its intended purpose, the following, in conjunction with the accompanying drawings and preferred embodiments, details the specific implementation, structure, features, and effectiveness of an efficient numerical simulation method for flood early warning based on heterogeneous computing proposed in accordance with the present invention. In the following description, references to different "one embodiment" or "another embodiment" do not necessarily refer to the same embodiment. Furthermore, specific features, structures, or characteristics of one or more embodiments may be combined in any suitable manner.

[0071] Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs.

[0072] The specific scheme of the high-efficiency numerical simulation method for flood early warning based on heterogeneous computing provided by the present invention is described in detail below with reference to the accompanying drawings.

[0073] This paper proposes an efficient numerical simulation method for flood warning based on heterogeneous computing. Figure 1 , which shows a flow chart of an efficient numerical simulation method for flood early warning based on heterogeneous computing provided by an embodiment of the present invention, the method comprising the following steps:

[0074] Step S1: Perform multiple flood simulations based on the first shallow water equation to obtain multiple first simulation results output by the parallel computing system at target output cycle intervals under a set simulation duration.

[0075] The first simulation result includes a friction term and a slope term. The friction term is used to represent the flow resistance of the flood during the corresponding simulation process, and the slope term is used to represent the flow dynamics of the flood during the corresponding simulation process.

[0076] The above-mentioned first shallow water equation is a two-dimensional shallow water equation. When multiple flood simulations are performed based on the first shallow water equation, the output results of the previous flood simulation will be used as input information for the subsequent flood simulation. When the first shallow water equation is used for flood simulation for the first time, the input information used may include: topographic data of the target area (such as a river basin, the downstream area of ​​a reservoir, etc.) retrieved from the flood control database, initial water depth data, initial single-width flow data of the flood in the x and y directions (referring to the volume flow of water passing through a unit river channel width), and the output results of the hydrological model (used to simulate the inflow runoff of the target area) (used as boundary conditions for the first shallow water equation). In addition, the Manning coefficient used in the first shallow water equation is a preset value (such as 0.33), where the x direction can be understood as the flood flow direction, the y direction can be understood as the riverbed width direction of the target basin, and the straight line corresponding to the x direction in the horizontal plane and the straight line corresponding to the y direction in the horizontal plane are perpendicular to each other.

[0077] The output results of a flood simulation using the two-dimensional shallow water equation include: water depth data (water depth at various locations in the target area), flow velocity data (flow velocity of the flood in the target area in the x and y directions), water level data (water level at various locations in the target area), single-width flow data, friction terms, and slope terms.

[0078] The above-mentioned parallel computing system can be understood as a processing system that supports parallel computing.

[0079] For example, Figure 2As shown, users can upload host code (used to perform multiple flood simulations based on the first shallow water equation using the aforementioned input information as initial input conditions) on a CUDA platform (a programming platform that supports parallel computing). After the host code is uploaded, it is first stored in the host CPU's CPU memory space and then transferred to the device GPU's global memory through a memory function. The complex computational task corresponding to the host code is divided into multiple computational subtasks, which are then assigned to multiple grids corresponding to the device GPU. The computational subtasks assigned to each grid are processed by multiple thread groups within each grid. During the computation process, the host CPU's parallel code is called through a kernel function, and different thread groups are selected to occupy shared memory and register memory space. Coalesced memory access is used to reduce GPU shared memory waste. After multiple grids have completed their corresponding computational subtasks, the subtask calculation results reported by each grid are aggregated to form a simulation result. The simulation result is then transferred from the GPU memory back to the CPU memory through a memory function and output externally.

[0080] In this example, the system composed of the CUDA platform, the host CPU, and the device GPU can be understood as the parallel computing system described in the present invention.

[0081] The target output period can be understood as the maximum time required for the parallel computing system to output a first simulation result when performing multiple flood simulations based on the first shallow water equation. When the parallel computing system performs multiple flood simulations based on the first shallow water equation, the actual output time required for each first simulation result is less than or equal to the maximum time.

[0082] In an example, the simulation duration may be set to 20,000 seconds, and the target output period may be 100 seconds, that is, the parallel computing system will output a first simulation result every 100 seconds. In this example, the total number of the first simulation results is 200.

[0083] Step S2: Analyze the friction term and slope term included in each first simulation result to obtain coefficient correction parameters.

[0084] The coefficient correction parameter is used to represent the corresponding sediment obstruction during flood flow.

[0085] During an actual flood, the floodwaters will strongly scour the ground they pass through, carrying some of the sediment along with them. Over time, the sediment content of the floodwaters will increase, and this increased sediment content will increase the friction coefficient between the floodwater and the surface of the target area. However, when simulating floods based on the first shallow water equation, the Manning coefficient (used to calculate the friction term) does not account for the increase in friction coefficient between the floodwater and the surface caused by sediment incorporation. However, by analyzing the friction and slope terms included in each first simulation result—that is, analyzing the changes in the dynamics and resistance of the floodwater over multiple simulations—we can estimate the calculation error in the friction term caused by not considering sediment obstruction during the simulation calculation. This in turn forms a coefficient correction parameter, which facilitates the subsequent correction of the Manning coefficient included in the first shallow water equation. The corrected Manning coefficient accurately reflects the friction coefficient between the floodwater and the surface, resulting in a more accurate friction term (bringing the calculated flood motion resistance closer to the actual resistance), thereby ensuring the accuracy of the flood simulation results.

[0086] Furthermore, the friction term and the slope term included in each first simulation result are analyzed to obtain coefficient correction parameters, including:

[0087] Analyzing the difference between the friction term and the slope term included in each first simulation result to obtain a dynamic resistance difference parameter corresponding to each first simulation result;

[0088] Calculating the mean values ​​of a plurality of kinetic resistance difference parameters corresponding to the plurality of first simulation results to obtain a coefficient deviation value;

[0089] Based on the friction term and the slope term included in each first simulation result, identifying a target simulation result from the plurality of first simulation results, wherein the target simulation result is a first simulation result corresponding to a stagnant flood movement state;

[0090] Analyze the proportion of the target simulation result in the plurality of first simulation results to obtain a sediment impact factor;

[0091] The coefficient correction parameter is obtained according to the coefficient deviation value and the sediment influence factor.

[0092] By analyzing the differences between the friction terms and slope terms included in each first simulation result, the energy difference between the driving force and resistance of flood flow in each flood simulation in the target area is determined. Then, by calculating the mean to reduce the influence of extreme values, the coefficient deviation value is obtained to accurately reflect the degree of deviation of the Manning coefficient used in the first shallow water equation (the coefficient deviation value and the Manning coefficient are negatively correlated). The smaller the Manning coefficient used, the smaller the friction term calculated during the flood simulation, and the larger the corresponding coefficient deviation value.

[0093] The flood movement stagnation state is used to indicate that the flood movement is blocked during the simulation of flood movement.

[0094] By identifying the target simulation results among multiple first simulation results and analyzing the proportion of the target simulation results in the multiple first simulation results, the extent to which the flood is affected by sediment resistance can be evaluated in combination with the terrain characteristics of the target area. That is, the larger the proportion of the target simulation results in the multiple first simulation results, the more likely the flood is to be affected by sediment and slow down its movement when flowing through the target area. Correspondingly, the greater the possibility that the sediment entrained in the flood will accumulate in the target area, then it is more necessary to consider the additional resistance generated by the sediment, and it is more necessary to increase the Manning coefficient.

[0095] Based on the above settings, by comprehensively considering the flooding degree of the flood movement process and the possibility of sediment deposition when the flood flows through the target area, the overall impact of sediment on flood movement can be analyzed from multiple angles, thereby determining more accurate coefficient correction parameters.

[0096] Furthermore, the analysis of the difference between the friction term and the slope term included in each first simulation result to obtain the dynamic resistance difference parameter corresponding to each first simulation result includes:

[0097] Calculating a ratio of a component of a gradient term in a first direction included in each first simulation result to a component of a friction term in the first direction included therein, to obtain a first ratio corresponding to each first simulation result;

[0098] Calculating a ratio of a component of a slope term included in each first simulation result in the second direction to a component of a friction term included therein in the second direction, to obtain a second ratio corresponding to each first simulation result;

[0099] Calculating the sum of the first ratio corresponding to each first simulation result and the second ratio corresponding thereto to obtain the original dynamic resistance parameter corresponding to each first simulation result;

[0100] The original parameters of the dynamic resistance corresponding to each first simulation result are normalized to obtain the dynamic resistance difference parameters corresponding to each first simulation result, wherein the first direction is the flood movement direction corresponding to the first shallow water equation, and the straight line corresponding to the first direction in the horizontal plane and the straight line corresponding to the second direction in the horizontal plane are perpendicular to each other.

[0101] The first direction may be understood as the aforementioned x-direction, and the second direction may be understood as the aforementioned y-direction.

[0102] For example, if the first ratio is set to , the second ratio is , then the two can be expressed as:

[0103]

[0104] in, 、 Respectively represent the components of the corresponding slope term in the x and y directions; 、 Represent the components of the corresponding friction terms in the x and y directions respectively.

[0105] If the dynamic resistance difference parameter is set to B, the dynamic resistance difference parameter can be expressed as:

[0106]

[0107] in, Used to represent normalization functions (such as Min-Max normalization function).

[0108] In the above setting, the energy difference between the corresponding slope term and friction term can be accurately and quickly quantified by ratio calculation. Calculating the energy difference between the slope term and the friction term in the first and second directions separately can achieve a detailed analysis of the energy difference and reduce calculation errors.

[0109] Furthermore, the identifying a target simulation result from the plurality of first simulation results based on the friction term and the slope term included in each first simulation result includes:

[0110] Based on a plurality of gradient items included in the plurality of first simulation results, a power time period is identified within the set simulation duration, wherein the gradient items of the plurality of first simulation results within the power time period are continuously increased;

[0111] Among the plurality of first simulation results, determining the first simulation result outside the power time period as a sediment simulation result;

[0112] Analyzing the quantitative differences between a plurality of sediment simulation results preceding each sediment simulation result and a plurality of first simulation results within the dynamic time period to obtain a sediment obstruction index for each sediment simulation result;

[0113] Among the multiple sediment simulation results, the sediment simulation result whose corresponding sediment obstruction index is greater than the index threshold is determined as the target simulation result.

[0114] The continuous increase in multiple slope terms in multiple first simulation results can be interpreted as a situation where the flood continues to spread and its power continues to increase during the simulation process. The corresponding situation in the sediment simulation results can be understood as a situation where the flood power is attenuated (due to factors such as excessive flood power absorbed by the target area's terrain and excessive sediment accumulation).

[0115] In the above setting, the sediment simulation results corresponding to the flood dynamic attenuation situation are first identified based on the changes in the slope term during multiple consecutive simulations. Then, the quantitative differences between the multiple sediment simulation results before each sediment simulation result and the multiple first simulation results within the dynamic time period are analyzed to obtain the sediment obstruction index of each sediment simulation result, that is, the flood dynamic attenuation degree corresponding to each sediment simulation result is obtained (the greater the quantitative difference, the longer the duration of the flood dynamic attenuation, and the higher the flood dynamic attenuation degree), and it is compared with the index threshold (such as 0.7, at this time, the sediment obstruction index is required to be normalized to the numerical range of 0-1 first, and then compared with the index threshold) to identify the target simulation result among the multiple sediment simulation results, that is, to identify the target simulation result corresponding to the severe flood dynamic attenuation situation.

[0116] In one example, the process of obtaining the sediment obstruction index of each sediment simulation result may be:

[0117] Determine the multiple sediment simulation results located before each sediment simulation result as the multiple associated simulation results corresponding to each sediment simulation result;

[0118] Calculating a quantity ratio between a plurality of sediment simulation results preceding each associated simulation result and a plurality of first simulation results within the dynamic time period to obtain a quantity ratio of a plurality of associated results corresponding to each sediment simulation result;

[0119] The mean of the number ratios of multiple correlation results corresponding to each sediment simulation result is calculated to obtain the sediment obstruction index corresponding to each sediment simulation result.

[0120] Specifically, if the number of associated simulation results corresponding to a sediment simulation result is set to be the ratio of the number of associated results of the kth associated simulation result to the number of associated results of the kth associated simulation result, ,but It can be expressed as:

[0121]

[0122] in, It is expressed as the number of sediment simulation results before the kth associated simulation result. represents the number of multiple first simulation results located in the dynamic time period, and k is a positive integer less than or equal to the total number of multiple associated simulation results corresponding to the sediment simulation result (assuming it is K1).

[0123] Correspondingly, the sediment barrier index (normalized) of the sediment simulation result is It can be expressed as:

[0124]

[0125] Furthermore, the coefficient correction parameter is obtained according to the coefficient deviation value and the sediment impact factor, including:

[0126] Obtaining a correction factor according to the sediment impact factor, wherein the sum of the sediment impact factor and the correction factor is 1;

[0127] The product of the correction factor and the coefficient deviation value is determined as the coefficient correction parameter.

[0128] For example, if the sediment impact factor is set to E and the correction factor is set to F, the correction factor can be expressed as:

[0129]

[0130] Correspondingly, the coefficient correction parameter can be expressed as ,in, is the aforementioned coefficient deviation value.

[0131] Through the above settings, the coefficient correction parameters are calculated to unify the influence of the coefficient deviation value and the sediment influence factor on the Manning coefficient, and then the accurate coefficient correction parameters are quickly obtained through product calculation.

[0132] Step S3: adjusting the Manning coefficient included in the first shallow water equation based on the coefficient correction parameter to obtain a second shallow water equation.

[0133] The Manning coefficient is used to calculate the friction term, and the Manning coefficient and the friction term are positively correlated.

[0134] In one example, if the Manning coefficient used in the first shallow water equation is set to , then the Manning coefficient after the coefficient correction parameter correction (also known as the Manning coefficient used in the second shallow water equation) can be expressed as:

[0135]

[0136] It should be understood that the only difference between the second shallow water equation and the first shallow water equation is the Manning coefficient used in the simulation, and the initial input conditions for flood simulation are exactly the same.

[0137] Step S4: Perform multiple flood simulations based on the second shallow water equation to obtain multiple second simulation results output by the parallel computing system at intervals within a set simulation time.

[0138] The computing resource configuration corresponding to the (i+1)th second simulation result is determined based on the computing resource configuration corresponding to the calculation of the (i)th second simulation result, and i is a positive integer less than the total number of the plurality of second simulation results.

[0139] Due to the change in the Manning coefficient, when the parallel computing system performs multiple consecutive flood simulations based on the second shallow water equation, the amount of data calculated during the simulation will also change. Based on the above settings, the computing resource configuration corresponding to the i+1 second simulation result is adaptively determined by the computing resource configuration corresponding to the calculation of the i-th second simulation result, which can adapt to the above-mentioned change in data volume, so that the overall output time of multiple second simulation results can be shortened as much as possible while ensuring the output accuracy.

[0140] Furthermore, the step of determining the computing resource configuration corresponding to the (i+1)th second simulation result includes:

[0141] Analyze the attenuation degree of the parallel computing efficiency corresponding to the i-th second simulation result to obtain the efficiency reduction risk value;

[0142] Analyze the used registers corresponding to the i-th second simulation result to obtain a register extension risk value, and analyze the used shared memory corresponding to the i-th second simulation result to obtain a shared memory extension risk value;

[0143] Obtaining a register extension feasible value according to the efficiency degradation risk value, the register extension risk value, and the shared memory extension risk value;

[0144] Analyze the difference between the output time of the i-th second simulation result and the target output cycle to obtain a time difference value;

[0145] determining an interval extension feasible value according to the register extension feasible value, the time difference value, and the target output period;

[0146] According to the register extension feasible value and the interval extension feasible value, the computing resource configuration corresponding to the i-th second simulation result is adjusted to obtain the computing resource configuration corresponding to the i+1-th second simulation result, the computing resource configuration including: the number of register configurations and the result output interval, the number of register configurations being the number of registers used when the parallel computing system calculates the corresponding second simulation result, and the result output interval being the time interval between the output moment of the corresponding second simulation result and the output moment of the previous second simulation result.

[0147] In the above settings, based on the previous flood simulation, the parallel computing efficiency, register expansion risk, and shared memory expansion risk of the parallel computing system during processing are analyzed to comprehensively evaluate the feasibility of register expansion for the next flood simulation from multiple aspects. This can timely expand the number of hardware used by the parallel computing system (referring to the number of expanded registers used) when the previous flood simulation shows that the number of hardware (i.e., the number of registers) is insufficient, thereby avoiding the computing efficiency limitation caused by hardware limitations in the next flood simulation, shortening the overall computing time of the next flood simulation, and thus shortening the total time of multiple second simulation results.

[0148] Among them, the difference between the output time of the second simulation result and the target output cycle is analyzed to determine the degree of conflict between the actual time required for outputting the second simulation result and the pre-set target output cycle. The larger the time difference value, the lower the degree of conflict between the two, and the more ample time the parallel computing system can have to calculate and output the corresponding second simulation result, and the accuracy of the corresponding output second simulation result can be maintained at a higher level. Conversely, the smaller the time difference value, the higher the degree of conflict between the two, and the more likely the parallel computing system will sacrifice the accuracy of the result in order to output the corresponding second simulation result on time (such as by sacrificing calculation accuracy in exchange for higher calculation efficiency).

[0149] By analyzing the above time difference values ​​and appropriately increasing the output interval of subsequent simulation results when the time difference values ​​are too small, the problem of inaccurate simulation results can be effectively avoided, so that multiple second simulation results can maintain high accuracy.

[0150] For example, the process of analyzing the difference between the output time of the i-th second simulation result and the target output period to obtain the time difference value may be:

[0151] Calculate the difference between the output time of the i-th second simulation result and the target output period to obtain the time difference;

[0152] The absolute value of the time difference is determined as the time difference value.

[0153] In an example, a process of obtaining a register extension feasible value according to the efficiency degradation risk value, the register extension risk value, and the shared memory extension risk value may be:

[0154] Calculating the product of the efficiency degradation risk value, the register extension risk value, and the shared memory extension risk value to obtain a risk product value;

[0155] The reciprocal of the risk product value is determined as a register extension feasible value.

[0156] Furthermore, the analyzing the attenuation degree of the parallel computing efficiency corresponding to the i-th second simulation result to obtain the efficiency reduction risk value includes:

[0157] Obtaining a first number corresponding to the i-th second simulation result, where the first number is the number of registers used by the parallel computing system to output the corresponding second simulation result;

[0158] Calculating a ratio of a first quantity corresponding to the i-th second simulation result to a second quantity corresponding to the i-th second simulation result to obtain a first efficiency value, where the second quantity is the number of thread groups included in the thread block used by the parallel computing system to output the corresponding second simulation result;

[0159] calculating a ratio of a first quantity corresponding to the i-th second simulation result to a third quantity corresponding to the i-th first simulation result to obtain a second efficiency value, where the third quantity is the number of thread groups included in the thread block used by the parallel computing system to output the corresponding first simulation result, and the second efficiency value is greater than the first efficiency value;

[0160] The difference between the first efficiency value and the second efficiency value is analyzed to obtain the efficiency degradation risk value.

[0161] In the above settings, the ratio of the number of thread groups included in the thread block used during the flood simulation to the number of registers used is used to quantify the parallel computing efficiency of the corresponding simulation process. The smaller the ratio, the more abundant the register resources are and the higher the corresponding parallel computing efficiency. Conversely, the more limited the register resources are, the lower the corresponding parallel computing efficiency. By comparing the differences in parallel computing efficiency between different simulation processes of the same order (using the Manning coefficient before and after correction), the risk of negative impact on parallel computing efficiency caused by register expansion (excessive increase in registers will lead to a decrease in the number of simultaneously active thread blocks in the GPU, which in turn will reduce parallel computing efficiency) can be determined accordingly. Specifically, the higher the efficiency degradation risk value, the greater the risk of negative impact on parallel computing efficiency caused by register expansion, and vice versa.

[0162] For example, the efficiency reduction risk value It can be expressed as:

[0163]

[0164] in, represents the first quantity corresponding to the second simulation result, represents the second quantity corresponding to the second simulation result, It represents the difference between the first quantity corresponding to the second simulation result and the third quantity corresponding to its corresponding first simulation result (both in the same order).

[0165] Furthermore, analyzing the used registers corresponding to the i-th second simulation result to obtain the register extension risk value, and analyzing the used shared memory corresponding to the i-th second simulation result to obtain the shared memory extension risk value, includes:

[0166] Calculating a ratio between a total number of registers corresponding to the parallel computing system and a fourth number corresponding to the i-th second simulation result to obtain a register expansion risk value, wherein the fourth number is the number of unused registers when the parallel computing system outputs the corresponding second simulation result;

[0167] Calculate the ratio of the total shared memory corresponding to the parallel computing system to the idle shared memory corresponding to the i-th second simulation result to obtain a shared memory expansion risk value, wherein the idle shared memory is the shared memory that is not used when the parallel computing system outputs the corresponding second simulation result.

[0168] In the above process, the remaining available registers and shared memory during the simulation calculation corresponding to the second simulation result are analyzed, and the register expansion risk value and the shared memory expansion risk value are determined accordingly. Among them, the more remaining available registers, the smaller the register expansion risk value, and the higher the feasibility of expanding the registers. Similarly, the more remaining available shared memory, the smaller the shared memory expansion risk value, and the higher the feasibility of increasing the use of shared memory by expanding registers, and vice versa.

[0169] For example, if the register extension risk value is set to ,but It can be expressed as:

[0170]

[0171] in, represents the first quantity corresponding to the second simulation result, Indicates the total number of registers corresponding to the parallel computing system.

[0172] If the shared memory expansion risk value is set to ,but It can be expressed as:

[0173]

[0174] in, represents the shared memory used by the parallel computing system to output the corresponding second simulation result. Indicates the total shared memory corresponding to the parallel computing system.

[0175] Furthermore, determining the interval extension feasible value according to the register extension feasible value, the time difference value, and the target output period includes:

[0176] Calculating a product of the register extension feasible value, the time difference value, and the target output cycle to obtain a product value;

[0177] Calculating the reciprocal of the product value to obtain a reciprocal product value;

[0178] The reciprocal value of the product is normalized to obtain the interval extension feasible value.

[0179] In the above setting, the interval extension feasible value is comprehensively calculated based on the register extension feasible value, the time difference value and the target output period to comprehensively and accurately quantify the feasibility of expanding the output interval of the simulation result. Among them, the higher the register extension feasible value, the greater the probability of register expansion, and appropriate register expansion can effectively improve the efficiency of parallel computing, and thus can correspondingly suppress the expansion of the output interval of the simulation result, so as to avoid unnecessary interval expansion and shorten the overall time consumption of multiple second simulation results.

[0180] Correspondingly, the larger the target cycle output is, the larger the basic value of the output interval of the simulation result is set, and thus the expansion of the output interval of the simulation result can be suppressed accordingly to avoid unnecessary interval expansion.

[0181] The above-mentioned cumulative multiplication method can conveniently complete the calculation of the interval extension feasible value and improve the calculation efficiency of the interval extension feasible value.

[0182] For example, if the interval extension feasible value is set to G, the interval extension feasible value G can be expressed as:

[0183]

[0184] in, represents the target output period, Indicates the aforementioned time difference value, Indicates the possible values ​​of the aforementioned register extension.

[0185] Furthermore, adjusting the computing resource configuration corresponding to the i-th second simulation result according to the register extension feasible value and the interval extension feasible value to obtain the computing resource configuration corresponding to the i+1-th second simulation result includes:

[0186] When the register extension feasible value is greater than the first threshold, the number of register configurations corresponding to the i-th second simulation result is expanded to obtain the number of register configurations corresponding to the (i+1)-th second simulation result, and the result output interval corresponding to the i-th second simulation result is determined as the result output interval corresponding to the (i+1)-th second simulation result;

[0187] When the register extension feasible value is between the first threshold and the second threshold, and the interval extension feasible value is greater than the third threshold, the number of register configurations corresponding to the i-th second simulation result is expanded to obtain the number of register configurations corresponding to the (i+1)-th second simulation result, and the result output interval corresponding to the i-th second simulation result is expanded to obtain the result output interval corresponding to the (i+1)-th second simulation result, and the second threshold is less than the first threshold;

[0188] When the register extension feasible value is between the first threshold and the second threshold, and the interval extension feasible value is less than or equal to the third threshold, the number of register configurations corresponding to the i-th second simulation result is increased to obtain the number of register configurations corresponding to the (i+1)-th second simulation result, and the result output interval corresponding to the i-th second simulation result is determined as the result output interval corresponding to the (i+1)-th second simulation result;

[0189] When the register extension feasible value is less than or equal to the second threshold and the interval extension feasible value is greater than the third threshold, determining the register configuration number corresponding to the i-th second simulation result as the register configuration number corresponding to the (i+1)-th second simulation result, and expanding the result output interval corresponding to the i-th second simulation result to obtain the result output interval corresponding to the (i+1)-th second simulation result, and the second threshold is less than the first threshold;

[0190] When the register extension feasible value is less than or equal to the second threshold and the interval extension feasible value is less than or equal to the third threshold, the register configuration number corresponding to the i-th second simulation result is determined as the register configuration number corresponding to the i+1-th second simulation result, and the result output interval corresponding to the i-th second simulation result is determined as the result output interval corresponding to the i+1-th second simulation result.

[0191] Among them, when the register expansion feasible value is greater than the first threshold, it can be regarded as that the parallel computing system has very few registers. At this time, by increasing the number of registers used, the hardware investment of the parallel computing system can be quickly improved. Since the hardware capabilities of the parallel computing system are not effectively utilized at this time, the result output interval is not considered for the time being. After the hardware capabilities of the parallel computing system are reasonably utilized, the result output interval will be adjusted to avoid unnecessary result output interval adjustment operations.

[0192] When the register expansion feasible value is between the first threshold and the second threshold, it can be regarded that the number of registers of the parallel computing system is relatively insufficient. By appropriately increasing the number of used registers, the overall computing efficiency of the parallel computing system can be adaptively improved.

[0193] When the register expansion feasible value is less than or equal to the second threshold, it can be considered that the number of registers in the parallel computing system is relatively sufficient, which means that the number of registers available for increase is insufficient, or further increasing the number of registers will lead to a decrease in parallel computing efficiency. Therefore, it is chosen not to adjust the number of registers used to avoid possible problems.

[0194] Compare the numerical values ​​between the interval extension feasible value and the third threshold to analyze the necessity of adjusting the result output interval. If the interval extension feasible value is greater than the third threshold, choose to increase the duration of the result output interval to gain more time resources for flood simulation and ensure the accuracy of the output flood simulation results; if the interval extension feasible value is less than or equal to the third threshold, maintain the current result output interval to avoid time loss caused by unnecessary duration increase.

[0195] Exemplarily, the operation of performing computing resource configuration based on the register extension feasible value and the interval extension feasible value may be as shown in Table 1:

[0196] Table 1

[0197]

[0198] In general, the present invention first performs multiple flood simulations based on the first shallow water equation, obtains multiple first simulation results output by the parallel computing system at target output cycle intervals under the set simulation time, and then analyzes the friction term and slope term included in each first simulation result, that is, analyzes the dynamic conditions and resistance conditions of the flood during the multiple flood simulations, to infer the degree of numerical deviation of the Manning coefficient used to calculate the friction term due to not considering the influence of sediment, and quantifies the degree of numerical deviation as a coefficient correction parameter, and adjusts the Manning coefficient included in the first shallow water equation through the coefficient correction parameter to overcome the problem that sediment obstruction is not considered when calculating the friction term of the first shallow water equation, and then based on the corrected Manning coefficient A second shallow water equation is formed, and multiple flood simulations are performed again to obtain more accurate flood simulation results. When flood simulation is performed based on the revised Manning coefficient, the computational complexity of the simulation process will change. By setting the computational resource configuration corresponding to the (i+1)th second simulation result based on the computational resource configuration corresponding to the calculation of the (i)th second simulation result, that is, setting the computational resource configuration corresponding to the subsequent flood simulation based on the computational resource configuration corresponding to the previous flood simulation, the computational complexity change caused by the adjustment of the Manning coefficient can be dynamically adapted. On the premise of ensuring the accuracy of the second simulation result output by each simulation, the computational time of each second simulation result can be shortened as much as possible.

[0199] This paper proposes an efficient numerical simulation device for flood warning based on heterogeneous computing. Figure 3 , which shows a schematic structural diagram of an efficient numerical simulation device 300 for flood early warning based on heterogeneous computing provided by one embodiment of the present invention, the device comprising:

[0200] A first simulation module 301 is configured to perform multiple flood simulations based on the first shallow water equation, and obtain multiple first simulation results output by the parallel computing system at target output period intervals under a set simulation duration, wherein the first simulation results include a friction term and a slope term, wherein the friction term is used to represent the flow resistance of the flood during the corresponding simulation process, and the slope term is used to represent the flow dynamics of the flood during the corresponding simulation process;

[0201] An analysis module 302 is configured to analyze the friction term and the slope term included in each first simulation result to obtain a coefficient correction parameter, wherein the coefficient correction parameter is used to represent the corresponding sediment obstruction during flood flow;

[0202] a model adjustment module 303, configured to adjust the Manning coefficient included in the first shallow water equation based on the coefficient correction parameter to obtain a second shallow water equation, wherein the Manning coefficient is used to calculate a friction term, and the Manning coefficient and the friction term are positively correlated;

[0203] The second simulation module 304 is used to perform multiple flood simulations based on the second shallow water equation to obtain multiple second simulation results output by the parallel computing system at intervals under the set simulation time, wherein the computing resource configuration corresponding to the i+1th second simulation result is determined based on the computing resource configuration corresponding to the calculation of the i-th second simulation result, and i is a positive integer less than the total number of the multiple second simulation results.

[0204] It should be noted that the apparatus provided in the above embodiments is merely exemplified by the division of the aforementioned functional modules. In actual applications, the aforementioned functions can be distributed among different functional modules as needed, i.e., the internal structure of the computer device can be divided into different functional modules to complete all or part of the functions described above. Furthermore, the apparatus for efficient numerical simulation of flood warnings based on heterogeneous computing and the embodiment of an efficient numerical simulation method for flood warnings based on heterogeneous computing provided in the above embodiments are based on the same concept. The specific implementation process is detailed in the method embodiments and will not be repeated here.

[0205] The embodiment of the present invention also provides an electronic device. Figure 4 , the electronic device may include a processor 401, a memory 402, and a program 4021 stored in the memory 402 and executable on the processor 401.

[0206] When the program 4021 is executed by the processor 401, it can achieve Figure 1 Any steps in the corresponding method embodiments and achieving the same beneficial effects will not be repeated here.

[0207] Those skilled in the art will appreciate that all or part of the steps of implementing the above-described embodiment method may be accomplished through hardware associated with program instructions, and the program may be stored in a readable medium.

[0208] The embodiment of the present invention further provides a readable storage medium, wherein the readable storage medium stores a computer program, and when the computer program is executed by a processor, the above Figure 1 Any steps in the corresponding method embodiments can achieve the same technical effects and will not be described again here to avoid repetition.

[0209] The computer-readable storage medium of the embodiments of the present invention may adopt any combination of one or more computer-readable media. The computer-readable medium may be a computer-readable signal medium or a computer-readable storage medium. The computer-readable storage medium may be, for example, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or component, or any combination thereof. More specific examples (a non-exhaustive list) of computer-readable storage media include: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In this document, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, device, or component.

[0210] A computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, which carries computer-readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transport a program for use by or in conjunction with an instruction execution system, apparatus, or device.

[0211] The program code contained on the storage medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.

[0212] Computer program code for performing the operations of the present invention may be written in one or more programming languages, or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, C++, and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a stand-alone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or terminal. In cases involving a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0213] An embodiment of the present invention also provides a computer program product. When the computer program product is run on a computer, it enables the computer to execute the above-mentioned related steps to implement an efficient numerical simulation method for flood warning based on heterogeneous computing provided by the above embodiment.

[0214] It should be noted that the order in which the embodiments of the present invention are described above is for illustrative purposes only and does not necessarily represent the superiority or inferiority of the embodiments. The processes depicted in the accompanying drawings do not necessarily require the specific order or sequential order shown to achieve the desired results. In certain embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0215] The various embodiments in this specification are described in a progressive manner, and the same or similar parts between the various embodiments can be referred to each other. Each embodiment focuses on the differences from other embodiments.

Claims

1. An efficient numerical simulation method for flood warning based on heterogeneous computing, characterized by: The method comprises: Performing multiple flood simulations based on the first shallow water equation to obtain multiple first simulation results output by the parallel computing system at target output period intervals under a set simulation duration, wherein the first simulation results include a friction term and a slope term, the friction term being used to represent the flow resistance of the flood during the corresponding simulation process, and the slope term being used to represent the flow dynamics of the flood during the corresponding simulation process; Analyzing the friction term and the slope term included in each first simulation result to obtain a coefficient correction parameter, wherein the coefficient correction parameter is used to represent the corresponding sediment obstruction during flood flow; adjusting the Manning coefficient included in the first shallow water equation based on the coefficient correction parameter to obtain a second shallow water equation, wherein the Manning coefficient is used to calculate the friction term, and the Manning coefficient and the friction term are positively correlated; Perform multiple flood simulations based on the second shallow water equation, obtaining multiple second simulation results output by the parallel computing system at intervals within a set simulation duration, wherein the computing resource configuration corresponding to the (i+1)th second simulation result is determined based on the computing resource configuration corresponding to the calculation of the (i)th second simulation result, where i is a positive integer less than the total number of the multiple second simulation results; The analysis of the friction term and the slope term included in each first simulation result to obtain the coefficient correction parameters includes: Analyzing the difference between the friction term and the slope term included in each first simulation result to obtain a dynamic resistance difference parameter corresponding to each first simulation result; Calculating the mean values ​​of a plurality of kinetic resistance difference parameters corresponding to the plurality of first simulation results to obtain a coefficient deviation value; Based on the friction term and the slope term included in each first simulation result, identifying a target simulation result from the plurality of first simulation results, wherein the target simulation result is a first simulation result corresponding to a stagnant flood movement state; Analyze the proportion of the target simulation result in the plurality of first simulation results to obtain a sediment impact factor; The coefficient correction parameter is obtained according to the coefficient deviation value and the sediment influence factor.

2. The efficient numerical simulation method for flood early warning based on heterogeneous computing according to claim 1 is characterized in that: The analyzing the difference between the friction term and the slope term included in each first simulation result to obtain the dynamic resistance difference parameter corresponding to each first simulation result includes: Calculating a ratio of a component of a gradient term in a first direction included in each first simulation result to a component of a friction term in the first direction included therein, to obtain a first ratio corresponding to each first simulation result; Calculating a ratio of a component of a slope term included in each first simulation result in the second direction to a component of a friction term included therein in the second direction, to obtain a second ratio corresponding to each first simulation result; Calculating the sum of the first ratio corresponding to each first simulation result and the second ratio corresponding thereto to obtain the original dynamic resistance parameter corresponding to each first simulation result; The original parameters of the dynamic resistance corresponding to each first simulation result are normalized to obtain the dynamic resistance difference parameters corresponding to each first simulation result, wherein the first direction is the flood movement direction corresponding to the first shallow water equation, and the straight line corresponding to the first direction in the horizontal plane and the straight line corresponding to the second direction in the horizontal plane are perpendicular to each other.

3. The efficient numerical simulation method for flood early warning based on heterogeneous computing according to claim 1 is characterized in that: The step of identifying a target simulation result from a plurality of first simulation results based on the friction term and the slope term included in each first simulation result includes: Based on a plurality of gradient items included in the plurality of first simulation results, a power time period is identified within the set simulation duration, wherein the gradient items of the plurality of first simulation results within the power time period are continuously increased; Among the plurality of first simulation results, determining the first simulation result outside the power time period as a sediment simulation result; Analyzing the quantitative differences between a plurality of sediment simulation results preceding each sediment simulation result and a plurality of first simulation results within the dynamic time period to obtain a sediment obstruction index for each sediment simulation result; Among the multiple sediment simulation results, the sediment simulation result whose corresponding sediment obstruction index is greater than the index threshold is determined as the target simulation result.

4. The efficient numerical simulation method for flood early warning based on heterogeneous computing according to claim 1 is characterized in that: The coefficient correction parameter is obtained according to the coefficient deviation value and the sediment impact factor, including: Obtaining a correction factor according to the sediment impact factor, wherein the sum of the sediment impact factor and the correction factor is 1; The product of the correction factor and the coefficient deviation value is determined as the coefficient correction parameter.

5. The efficient numerical simulation method for flood early warning based on heterogeneous computing according to claim 1 is characterized in that: The step of determining the computing resource configuration corresponding to the (i+1)th second simulation result includes: Analyze the attenuation degree of the parallel computing efficiency corresponding to the i-th second simulation result to obtain the efficiency reduction risk value; Analyze the used registers corresponding to the i-th second simulation result to obtain a register extension risk value, and analyze the used shared memory corresponding to the i-th second simulation result to obtain a shared memory extension risk value; Obtaining a register extension feasible value according to the efficiency degradation risk value, the register extension risk value, and the shared memory extension risk value; Analyze the difference between the output time of the i-th second simulation result and the target output cycle to obtain a time difference value; determining an interval extension feasible value according to the register extension feasible value, the time difference value, and the target output period; According to the register extension feasible value and the interval extension feasible value, the computing resource configuration corresponding to the i-th second simulation result is adjusted to obtain the computing resource configuration corresponding to the i+1-th second simulation result, the computing resource configuration including: the number of register configurations and the result output interval, the number of register configurations being the number of registers used when the parallel computing system calculates the corresponding second simulation result, and the result output interval being the time interval between the output moment of the corresponding second simulation result and the output moment of the previous second simulation result.

6. The efficient numerical simulation method for flood early warning based on heterogeneous computing according to claim 5 is characterized in that: The analyzing the attenuation degree of the parallel computing efficiency corresponding to the i-th second simulation result to obtain the efficiency reduction risk value includes: Obtaining a first number corresponding to the i-th second simulation result, where the first number is the number of registers used by the parallel computing system to output the corresponding second simulation result; Calculating a ratio of a first quantity corresponding to the i-th second simulation result to a second quantity corresponding to the i-th second simulation result to obtain a first efficiency value, where the second quantity is the number of thread groups included in the thread block used by the parallel computing system to output the corresponding second simulation result; calculating a ratio of a first quantity corresponding to the i-th second simulation result to a third quantity corresponding to the i-th first simulation result to obtain a second efficiency value, where the third quantity is the number of thread groups included in the thread block used by the parallel computing system to output the corresponding first simulation result, and the second efficiency value is greater than the first efficiency value; The difference between the first efficiency value and the second efficiency value is analyzed to obtain the efficiency degradation risk value.

7. The efficient numerical simulation method for flood early warning based on heterogeneous computing according to claim 5 is characterized in that: The analyzing the used registers corresponding to the i-th second simulation result to obtain the register extension risk value, and analyzing the used shared memory corresponding to the i-th second simulation result to obtain the shared memory extension risk value, includes: Calculating a ratio between a total number of registers corresponding to the parallel computing system and a fourth number corresponding to the i-th second simulation result to obtain a register expansion risk value, wherein the fourth number is the number of unused registers when the parallel computing system outputs the corresponding second simulation result; Calculate the ratio of the total shared memory corresponding to the parallel computing system to the idle shared memory corresponding to the i-th second simulation result to obtain a shared memory expansion risk value, wherein the idle shared memory is the shared memory that is not used when the parallel computing system outputs the corresponding second simulation result.

8. The efficient numerical simulation method for flood early warning based on heterogeneous computing according to claim 5 is characterized in that: The determining of the interval extension feasible value according to the register extension feasible value, the time difference value, and the target output period includes: Calculating a product of the register extension feasible value, the time difference value, and the target cycle to obtain a product value; Calculating the reciprocal of the product value to obtain a reciprocal product value; The reciprocal value of the product is normalized to obtain the interval extension feasible value.

9. The efficient numerical simulation method for flood early warning based on heterogeneous computing according to claim 5 is characterized in that: Adjusting the computing resource configuration corresponding to the i-th second simulation result according to the register extension feasible value and the interval extension feasible value to obtain the computing resource configuration corresponding to the i+1-th second simulation result, including: When the register extension feasible value is greater than the first threshold, the number of register configurations corresponding to the i-th second simulation result is expanded to obtain the number of register configurations corresponding to the (i+1)-th second simulation result, and the result output interval corresponding to the i-th second simulation result is determined as the result output interval corresponding to the (i+1)-th second simulation result; When the register extension feasible value is between the first threshold and the second threshold, and the interval extension feasible value is greater than the third threshold, the number of register configurations corresponding to the i-th second simulation result is expanded to obtain the number of register configurations corresponding to the (i+1)-th second simulation result, and the result output interval corresponding to the i-th second simulation result is expanded to obtain the result output interval corresponding to the (i+1)-th second simulation result, and the second threshold is less than the first threshold; When the register extension feasible value is between the first threshold and the second threshold, and the interval extension feasible value is less than or equal to the third threshold, the number of register configurations corresponding to the i-th second simulation result is increased to obtain the number of register configurations corresponding to the (i+1)-th second simulation result, and the result output interval corresponding to the i-th second simulation result is determined as the result output interval corresponding to the (i+1)-th second simulation result; When the register extension feasible value is less than or equal to the second threshold and the interval extension feasible value is greater than the third threshold, determining the register configuration number corresponding to the i-th second simulation result as the register configuration number corresponding to the (i+1)-th second simulation result, and expanding the result output interval corresponding to the i-th second simulation result to obtain the result output interval corresponding to the (i+1)-th second simulation result, and the second threshold is less than the first threshold; When the register extension feasible value is less than or equal to the second threshold and the interval extension feasible value is less than or equal to the third threshold, the register configuration number corresponding to the i-th second simulation result is determined as the register configuration number corresponding to the i+1-th second simulation result, and the result output interval corresponding to the i-th second simulation result is determined as the result output interval corresponding to the i+1-th second simulation result.

Citation Information

Patent Citations

  • Planar two-dimensional numerical simulation method and system for watercourse flow and sediment

    CN107480384A

  • Dam break flood simulation method considering building damage

    CN115935856A