Multi-region self-adaptive numerical method and system based on fractal algorithm for simulated rainfall
Through a multi-region adaptive rainfall simulation numerical method based on fractal algorithm, the problem of rainfall simulation in complex boundary restricted areas is solved, the refined simulation of the rainfall process is achieved, the authenticity and accuracy of the simulation results are improved, and flood simulation and disaster prevention and warning in complex computing scenarios are supported.
Patent Information
- Application Number
- CN202411870196.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-18
- Publication Date
- 2025-10-17
- Estimated Expiration
- 2044-12-18
AI Technical Summary
Existing numerical generation methods for simulated rainfall cannot effectively handle complex boundary-restricted areas, cannot truly restore the complexity of spatial distribution during rainfall and the dynamic characteristics of rainfall periods, and thus affect the accuracy of flood simulation and disaster prevention warnings.
A multi-region adaptive rainfall simulation numerical method based on fractal algorithm is adopted. Through the steps of rainfall parameter initialization, geographic coordinate generation, rainfall period distribution feature generation, simulated rainfall value, rainfall data normalization, rainfall area simulation clipping and image encoding, adaptive processing of complex boundary restriction areas and refined simulation of rainfall process are achieved.
Adaptive processing of multiple regions is achieved, and the generated rainfall data is closer to real natural phenomena, which improves the authenticity and accuracy of simulation results and supports flood simulation and disaster prevention warning in complex computing scenarios.
Smart Images

Figure CN119862698B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of data processing, in particular to a multi-region adaptive simulated rainfall numerical method and system based on a fractal algorithm. BACKGROUND
[0002] A hydrological and hydrodynamic numerical model is an effective non-engineering measure for simulating urban waterlogging, flood regulation and flood deduction. The input data of the widely used numerical simulation model currently contains rainfall data. However, the existing simulated rainfall numerical generation method mostly simulates rainfall numerical values for a fixed shape region, and lacks consideration of the complex spatial distribution characteristics in the rainfall process and the rainfall period. Such a method cannot simulate complex boundaries or multi-region conditions, cannot truly restore complex real environments, and further affects complex calculations such as flood deduction and disaster prevention and warning, greatly affecting the accuracy of related work. How to efficiently generate simulated rainfall numerical values for various boundary restrictions is a prerequisite for solving the above problems.
[0003] With the rapid development of the Internet, more and more water conservancy wisdom platforms and geographic information systems have been put into use, and information input based on large model voice interaction is also becoming a research hotspot. Digital twin scenarios finely mark various geographic information such as cities, river networks and catchment areas. How to interface and utilize various boundary restriction data is also an urgent problem to be solved.
[0004] Based on the above analysis, how to meet the adaptive processing of complex boundary restriction regions, fully simulate the complexity of spatial distribution in the rainfall process and the dynamic characteristics of the rainfall period to realize simulated rainfall value generation under complex conditions is a technical problem to be solved. SUMMARY
[0005] The technical task of the present application is to solve the above problems, and provide a multi-region adaptive simulated rainfall numerical method and system based on a fractal algorithm to solve the technical problem of how to meet the adaptive processing of complex boundary restriction regions, fully simulate the complexity of spatial distribution in the rainfall process and the dynamic characteristics of the rainfall period to realize simulated rainfall value generation under complex conditions.
[0006] In a first aspect, the present application provides a multi-region adaptive simulated rainfall numerical method based on a fractal algorithm, comprising the following steps:
[0007] Rainfall parameter initialization: for the boundary restriction data input by the user, judging the rainfall region type based on the type of the boundary restriction data, and extracting the preset total rainfall amount, rainfall duration and intensity coefficient;
[0008] Geographic coordinate generation: correcting the coordinate data in the rainfall region in longitude and latitude, and generating a geographic coordinate matrix in the selected rainfall region according to the self-defined longitude and latitude step size;
[0009] Rainfall period distribution characteristics generation: evenly distribute rainfall according to rainfall duration, and when generating rainfall distribution for each time step, divide the rainfall in the entire rainfall area according to different rainfall intensities to ensure that each time step has corresponding rainfall information;
[0010] Simulated rainfall value: generate peak number and randomness coefficient according to geographic coordinate matrix, and create a rainfall simulation value based on fractal algorithm at each coordinate point, which represents the simulated rainfall at the corresponding coordinate position;
[0011] Rainfall data normalization: for each time step of rainfall simulation value, normalize the rainfall simulation value to ensure that the rainfall intensity in the specified rainfall area is distributed according to the preset rainfall distribution;
[0012] Rainfall area simulation clipping: clip the generated rainfall distribution and match it with the rainfall area, so that the rainfall simulation value only covers the specified rainfall area;
[0013] Picture encoding: encode the rainfall simulation value and store the encoded picture in string format to facilitate front-end display;
[0014] Handle exceptions and output results: if an exception occurs during rainfall generation, capture the exception and output related error information, and return the generated rainfall simulation value to the caller.
[0015] As a preferred, the rainfall parameter initialization includes the following steps:
[0016] Determine the data format of the boundary limit data input by the user. If it is a voice type, convert the voice type boundary limit data to the specified input format through natural language processing technology. The specified input format is the requestBody structure;
[0017] Check if the requestBody structure contains a geojson module. If the geojson module exists, it means that the coordinate data in the rainfall area in the boundary limit data is GIS data;
[0018] Determine the type of GIS data according to the type attribute in the geojson module. If type = MultiPolygon, it means that the coordinate data is multi-region type GIS data. If type = Polygon, it means that the coordinate data is single-region type GIS data. If neither MultiPolygon nor Polygon, it is considered that the coordinate data is a custom coordinate type data;
[0019] Obtain the preset total rainfall, rainfall duration and intensity coefficient from the requestBody structure body;
[0020] If the boundary limit data is missing in the requestBody structure body, return an error message.
[0021] As a preferred, when generating the rainfall period distribution feature, the split_into_n function is called to uniformly divide the input rainfall according to the duration to generate the rainfall_split data.
[0022] As a preferred, when simulating and cutting the rainfall area, according to the shape data of the rainfall area, the cv2.resize function is called to adjust the shape data to the same resolution as the rainfall data simulation value, and the rainfall distribution is matched with the shape data through bit operation, so that the rainfall data simulation value only covers the specified rainfall area.
[0023] As a preferred, the rainfall simulation value is encoded into a picture using the OpenCV library, and then the encoded picture is converted into a string format for storage using Base64 encoding.
[0024] In a second aspect, the present application is a multi-region adaptive simulation rainfall value system based on a fractal algorithm, which is used for rainfall value simulation through the multi-region adaptive simulation rainfall value method based on a fractal algorithm as described in any one of the first aspect, and the system comprises a rainfall parameter initialization module, a geographic coordinate generation module, a rainfall period distribution feature generation module, a simulated rainfall value module, a rainfall data normalization module, a rainfall area simulation cutting module, a picture encoding module and a rainfall execution module.
[0025] The rainfall parameter initialization module is used to perform the following: for the boundary limit data input by the user, the rainfall area type is determined based on the type of the boundary limit data, and the preset total rainfall, rainfall duration and intensity coefficient are extracted;
[0026] The geographic coordinate generation module is used to perform the following: the coordinate data in the rainfall area is corrected in longitude and latitude, and a geographic coordinate matrix is generated in the selected rainfall area according to the self-defined longitude and latitude step;
[0027] The rainfall period distribution feature generation module is used to perform the following: the rainfall is uniformly distributed according to the rainfall duration, and when generating the rainfall distribution of each time step, the rainfall in the entire rainfall area is divided according to the different rainfall intensities to ensure that each time step has corresponding rainfall information;
[0028] The simulated rainfall numerical module is configured to perform the following: generating a peak number and a randomness coefficient according to a geographic coordinate matrix, creating a rainfall simulation numerical value based on a fractal algorithm at each coordinate point, and the rainfall simulation numerical value representing a simulated rainfall amount at the corresponding coordinate position;
[0029] The rainfall data normalization module is configured to perform the following: for each time step of the rainfall simulation numerical value, normalizing the rainfall simulation numerical value to ensure that the rainfall intensity in the specified rainfall area is distributed according to the preset rainfall distribution;
[0030] The rainfall area simulation clipping module is configured to perform the following: clipping the generated rainfall distribution and matching it with the rainfall area, so that the rainfall simulation numerical value only covers the specified rainfall area;
[0031] The picture encoding module is configured to perform the following: picture encoding the rainfall simulation numerical value, and storing the encoded picture in a string format to facilitate front-end display;
[0032] The rainfall execution module is configured to perform the following: during the rainfall generation process, if an exception occurs, capturing the exception and outputting relevant error information, and returning the generated rainfall simulation numerical value to the calling party.
[0033] As a preferred, the rainfall parameter initialization module is configured to perform the following operations:
[0034] Determine the data format of the boundary limit data input by the user, if it is a voice type, convert the voice type boundary limit data into a set input format through natural language processing technology, and the set input format is a requestBody structure;
[0035] Check whether the requestBody structure contains a geojson module, if the geojson module exists, it means that the coordinate data in the rainfall area in the boundary limit data is GIS data;
[0036] Determine the type of GIS data according to the type attribute in the geojson module, if type = MultiPolygon, it means that the coordinate data is multi-region type GIS data, if type = Polygon, it means that the coordinate data is single-region type GIS data, if neither MultiPolygon nor Polygon, it is considered that the coordinate data is self-defined coordinate type data;
[0037] Obtain the preset total rainfall, rainfall duration and intensity coefficient from the requestBody structure;
[0038] If the boundary limit data is missing in the requestBody structure, return an error message.
[0039] As preferred, the rainfall period distribution feature generation module is used to call the split_into_n function to uniformly split the input rainfall according to the time length to generate the rainfall_split data.
[0040] As preferred, the rainfall area simulation clipping module is used to perform the following: according to the shape data of the rainfall area, the cv2.resize function is called to adjust the shape data to the same resolution as the rainfall data simulation value, and the rainfall distribution is matched with the shape data through bit operation, so that the rainfall data simulation value only covers the specified rainfall area.
[0041] As preferred, the rainfall execution module is used to use the OpenCV library to encode the rainfall simulation value into a picture, and then use Base64 encoding to convert the encoded picture into a string format for storage.
[0042] The fractal algorithm-based multi-region adaptive simulated rainfall value method and system has the following advantages:
[0043] 1. Multi-region adaptive processing capability: through the built-in boundary restriction condition processing module, the multi-region adaptive processing is realized, which solves the problem that the prior art cannot handle complex boundary restriction region processing, and greatly expands the application scenarios of simulated rainfall value generation.
[0044] 2. Fine generation of rainfall data: the fractal algorithm-based rainfall value simulation can simulate the complex spatial distribution characteristics that often appear in the rainfall process, making the generated rainfall data more close to the real natural phenomenon, and can finely divide the rainfall into rainfall distribution at each time step according to the user input rainfall (rainfall) and simulation duration (duration), and through the fine-grained processing method, the time resolution of the rainfall simulation is high, which can better reflect the dynamic changes of the rainfall process.
[0045] 3. Improve the robustness of the program: it contains automatic checking and correction function of latitude and longitude range, which ensures that the geographical coordinates of the generated rainfall data are accurate and effective, which is especially important when processing large-scale and multi-region rainfall simulation, and can avoid simulation deviation caused by coordinate error. BRIEF DESCRIPTION OF DRAWINGS
[0046] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following will briefly introduce the drawings needed to be used in the embodiments or prior art description. Obviously, the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other drawings can also be obtained without creative labor on the basis of these drawings.
[0047] The application will be further described below with reference to the drawings.
[0048] Figure 1 A flow chart of the fractal algorithm-based multi-region adaptive simulated rainfall numerical method of Example 1. DETAILED DESCRIPTION
[0049] The application will be further described below with reference to the drawings and specific examples, so that those skilled in the art can better understand the application and implement it. The examples are not intended to limit the application, and the technical features in the examples and the examples can be combined with each other without conflict.
[0050] The fractal algorithm-based multi-region adaptive simulated rainfall numerical method and system provided by the embodiments of the application are used to solve the technical problem of how to meet the adaptive processing of a complex boundary limited region, fully simulate the complexity of spatial distribution in a rainfall process and the dynamic characteristics of a rainfall period, so as to realize the generation of a simulated rainfall value in a complex situation.
[0051] Example 1
[0052] The fractal algorithm-based multi-region adaptive simulated rainfall numerical method includes eight steps of rainfall parameter initialization, geographic coordinate generation, rainfall period distribution characteristic generation, simulated rainfall numerical value, rainfall data normalization, rainfall region simulation clipping, picture encoding, and processing of exceptions and output of results.
[0053] Step S100: Rainfall parameter initialization: For the boundary limit data input by the user, the type of the boundary limit data is judged to determine the type of the rainfall region, and the preset total rainfall amount, rainfall duration, and intensity coefficient are extracted.
[0054] As a specific implementation of the rainfall parameter initialization, the following steps are included:
[0055] (1) The data format of the boundary limit data input by the user is judged. If the data format is a voice type, the voice type boundary limit data is converted into a set input format through a natural language processing technology. The set input format is a requestBody structure.
[0056] (2) Whether the requestBody structure includes a geojson module is checked. If the geojson module exists, it indicates that the coordinate data in the rainfall region in the boundary limit data is GIS data.
[0057] (3) Determine the type of GIS data according to the type attribute in the geojson module. If type = MultiPolygon, it indicates that the coordinate data is multi-region type GIS data. If type = Polygon, it indicates that the coordinate data is single-region type GIS data. If neither MultiPolygon nor Polygon, it is considered that the coordinate data is self-defined coordinate type data.
[0058] (4) Obtain the preset total rainfall, rainfall duration and intensity coefficient from the requestBody structure.
[0059] (5) If the boundary limit data is missing in the requestBody structure, return an error message.
[0060] Step S200 geographic coordinate generation: correct the coordinate data in the rainfall area, and generate a geographic coordinate matrix in the selected rainfall area according to the self-defined latitude and longitude step size.
[0061] As a specific implementation of geographic coordinate generation, this step includes the following two operations:
[0062] (1) Check and correct the latitude and longitude coordinates: first, keep two decimal places, then judge the latitude and longitude. If the longitude belongs to [-180, 180] and the latitude belongs to [-90, 90], it is in the valid range, otherwise an error message is prompted; judge up_lon≤down_lon, up_lat≥down_lat, if yes, it is valid latitude and longitude, otherwise, exchange the values;
[0063] (2) Generate geographic coordinate information: generate a geographic coordinate matrix in the selected area according to the self-defined latitude and longitude step size, and define the length and width of the matrix as height and width.
[0064] Step S300 rainfall period distribution feature generation: evenly distribute the rainfall according to the rainfall duration, and when generating the rainfall distribution of each time step, divide the rainfall in the entire rainfall area according to the different rainfall intensities to ensure that each time step has corresponding rainfall information.
[0065] As a specific implementation of rainfall period distribution feature generation, when generating rainfall period distribution features, the split_into_n function is called to evenly divide the input rainfall according to the duration to generate rainfall_split data.
[0066] Step S400 simulates rainfall values: according to the geographical coordinate matrix, generate peak number and randomness coefficient, create a rainfall simulation value based on fractal algorithm at each coordinate point, which represents the simulated rainfall at the corresponding coordinate position.
[0067] As a specific implementation of simulating rainfall values, according to the specified shape (height and width), generate peak number (num_peaks) and randomness coefficient (randomness), create a rainfall simulation value based on fractal algorithm at each coordinate point, which represents the simulated rainfall at the corresponding coordinate position.
[0068] Step S500 rainfall data normalization: for each time step of rainfall simulation value, normalize the rainfall simulation value to ensure that the rainfall intensity in the specified rainfall area is distributed according to the preset rainfall distribution.
[0069] Step S600 rainfall area simulation clipping: clip the generated rainfall distribution and match it with the rainfall area, so that the rainfall simulation value only covers the specified rainfall area.
[0070] As a specific implementation of rainfall area simulation clipping, according to the shape data of the rainfall area, call the cv2.resize function to adjust the shape data to the same resolution as the rainfall data simulation value, and match the rainfall distribution with the shape data through bitwise operation, so that the rainfall data simulation value only covers the specified rainfall area.
[0071] Step S700 picture encoding: encode the rainfall simulation value and store the encoded picture in string format to adapt to the front-end display.
[0072] In this embodiment, OpenCV library is used to encode the rainfall simulation value, and then Base64 encoding is used to store the encoded picture in string format.
[0073] Step S800 handles exceptions and outputs results: during the rainfall generation process, if an exception occurs, capture the exception and output the related error information, and return the generated rainfall simulation value to the caller.
[0074] During the rainfall generation process, if an exception occurs, capture the exception and output the related error information, and return the generated rainfall data to the caller. The program returns different types of result data (including pictures, data lists, etc.) according to different generation types and parameter processing procedures, and calculates and outputs the time consumption of the generation process.
[0075] Firstly, the input boundary restriction condition data is judged, single area, multiple areas and GIS data can be accepted, and adaptive processing of complex boundary restriction areas is met; then the simulated rainfall area is determined according to the input coordinates, the coordinates in the area are generated in detail through a preset step length, and the generated coordinates are corrected and checked; secondly, the rainfall is divided according to the total rainfall and rainfall duration preset by the user, and it is ensured that there is corresponding rainfall information in each time step; according to the rainfall information of different time periods, the rainfall distribution based on the fractal algorithm is created, the rainfall model is generated according to the specified shape, the number of peak values and the randomness coefficient, so as to increase the realism of the simulated rainfall; finally, the simulated rainfall values of different time periods are picture encoded to meet the front-end picture display requirements, and the corresponding coordinates and rainfall information are output to provide data support for subsequent hydrological calculation.
[0076] The application realizes adaptive processing of multiple areas through built-in boundary restriction condition processing, solves the problem that the prior art is difficult to deal with complex boundary restriction area processing, greatly expands the application scene of simulated rainfall value generation, and provides solid data support for complex calculations such as flood deduction and disaster prevention warning. In addition, by considering the fractal algorithm and the rainfall period, the complexity of spatial distribution in the rainfall process and the dynamic characteristics of the rainfall period are fully simulated, and the authenticity of the simulation result is significantly improved.
[0077] Embodiment 2
[0078] The application discloses a multi-area adaptive simulated rainfall value system based on a fractal algorithm, which comprises a parameter initialization module, a geographic coordinate generation module, a rainfall period distribution characteristic generation module, a simulated rainfall value module, a rainfall data normalization module, a rainfall area simulation clipping module, a picture encoding module and a rainfall execution module.
[0079] The rainfall parameter initialization module is used for executing the following: for the boundary restriction data input by the user, the rainfall area type is judged based on the type of the boundary restriction data, and the preset total rainfall, rainfall duration and intensity coefficient are extracted.
[0080] As a specific implementation of the rainfall parameter initialization module, the module is used for executing the following operations
[0081] (1) judging the data format of the boundary restriction data input by the user, if it is a voice type, the boundary restriction data of the voice type is converted into a set input format through a natural language processing technology, and the set input format is a requestBody structure body;
[0082] (2) checking whether the requestBody structure body contains a geojson module, if the geojson module exists, it indicates that the coordinate data in the rainfall area in the boundary restriction data is GIS data;
[0083] (3) Determine the type of GIS data according to the type attribute in the geojson module. If type = MultiPolygon, it indicates that the coordinate data is multi-region type GIS data. If type = Polygon, it indicates that the coordinate data is single-region type GIS data. If neither MultiPolygon nor Polygon, it is considered that the coordinate data is self-defined coordinate type data.
[0084] (4) Obtain the preset total rainfall, rainfall duration and intensity coefficient from the requestBody structure.
[0085] (5) If the boundary limit data is missing in the requestBody structure, return an error message.
[0086] The geographic coordinate generation module is used to perform the following: coordinate data in the rainfall area is corrected in latitude and longitude, and geographic coordinate matrix is generated in the selected rainfall area according to the self-defined latitude and longitude step.
[0087] As an implementation of the geographic coordinate generation module, the module is used to perform the following two operations:
[0088] (1) Check and correct latitude and longitude coordinates: first, keep two decimal places, then judge the latitude and longitude. If the longitude belongs to [-180, 180] and the latitude belongs to [-90, 90], it is in the valid range, otherwise an error message is prompted. If up_lon≤down_lon and up_lat≥down_lat, it is valid latitude and longitude, otherwise the values are exchanged.
[0089] (2) Generate geographic coordinate information: generate geographic coordinate matrix in the selected area according to the self-defined latitude and longitude step, and the length and width of the matrix are defined as height and width.
[0090] The rainfall period distribution feature generation module is used to perform the following: the rainfall is uniformly distributed according to the rainfall duration, and when generating the rainfall distribution of each time step, the rainfall in the entire rainfall area is divided according to the different rainfall intensity to ensure that each time step has corresponding rainfall information.
[0091] As an implementation of the rainfall period distribution feature generation module, when the rainfall period distribution feature is generated, the module is used to call the split_into_n function to uniformly divide the input rainfall according to the duration to generate the rainfall_split data.
[0092] The simulated rainfall numerical module is used to perform the following: generate the peak number and randomness coefficient according to the geographic coordinate matrix, and create a rainfall simulation value based on the fractal algorithm at each coordinate point. The rainfall simulation value represents the simulated rainfall amount at the corresponding coordinate position.
[0093] As a specific implementation of the simulated rainfall numerical module, this module is used to create a fractal-based rainfall simulation value at each coordinate point based on the specified shape (height and width), the number of generated peaks (num_peaks), and the randomness coefficient (randomness). This value represents the simulated rainfall amount at that coordinate location.
[0094] The rainfall data normalization module is used to perform the following: for each time step of rainfall simulation value, the rainfall simulation value is normalized to ensure that the rainfall intensity in the specified rainfall area is distributed according to the preset rainfall distribution.
[0095] The rainfall area simulation clipping module is used to perform the following: clip the generated rainfall distribution and match it with the rainfall area so that the rainfall simulation value only covers the specified rainfall area.
[0096] As a specific implementation of the rainfall area simulation clipping module, according to the shape data of the rainfall area, the cv2.resize function is called to adjust the shape data to the same resolution as the rainfall data simulation value. The rainfall distribution is matched with the shape data through bit operations, so that the rainfall data simulation value only covers the specified rainfall area.
[0097] The image encoding module is used to perform the following operations: image encoding of rainfall simulation values, and converting the encoded images into string format for storage to facilitate front-end display.
[0098] In this embodiment, the image encoding module is used to use the OpenCV library to perform image encoding on the rainfall simulation value, and then use Base64 encoding to convert the encoded image into a string format for storage.
[0099] The rainfall execution module is used to perform the following: if an exception occurs during the rainfall generation process, it captures the exception and outputs the relevant error information, and at the same time returns the generated rainfall simulation value to the caller.
[0100] If an exception occurs during the rainfall generation process, the rainfall execution module captures the exception and outputs relevant error information, returning the generated rainfall data to the caller. Depending on the generation type and parameter processing flow, the program returns different types of result data (including images, data lists, etc.) and calculates and outputs the time consumed by the generation process.
[0101] The system of the embodiment can execute the method disclosed in embodiment 1 to simulate rainfall values.
[0102] The multi-region adaptive rainfall value simulation method and system based on a fractal algorithm are described in detail above, and the principles and implementation manners of the present application are described by using specific examples. The above description of the embodiments is only used to help understand the method and the core idea of the present application. Meanwhile, for those skilled in the art, the specific implementation manners and application ranges will be changed according to the idea of the present application. In summary, the content of the specification should not be understood as a limitation of the present application.
Claims
1. A multi-region adaptive rainfall simulation numerical method based on fractal algorithm, characterized by: The steps include: Rainfall parameter initialization: For the boundary restriction data input by the user, the rainfall area type is determined based on the type of boundary restriction data, and the preset total rainfall amount, rainfall duration and intensity coefficient are extracted; Geographic coordinate generation: perform latitude and longitude correction on the coordinate data in the rainfall area, and generate a geographic coordinate matrix in the selected rainfall area according to the custom latitude and longitude step size; Generation of rainfall period distribution features: evenly distribute rainfall according to rainfall duration. When generating the rainfall distribution for each time step, the rainfall in the entire rainfall area is divided according to the different rainfall intensities to ensure that each time step has corresponding rainfall information. Simulated rainfall value: Generate peak number and random coefficient according to geographic coordinate matrix, and create a rainfall simulation value based on fractal algorithm at each coordinate point. The rainfall simulation value represents the simulated rainfall amount at the corresponding coordinate position. Normalization of rainfall data: For each time step, the rainfall simulation value is normalized to ensure that the rainfall intensity in the specified rainfall area is distributed according to the preset rainfall distribution; Rainfall area simulation clipping: clip the generated rainfall distribution and match it with the rainfall area so that the rainfall simulation value only covers the specified rainfall area; Image encoding: Encode the rainfall simulation values and convert the encoded images into string format for storage to facilitate front-end display; Handle exceptions and output results: During the rainfall generation process, if an exception occurs, capture the exception and output the relevant error information, and return the generated rainfall simulation value to the caller.
2. The multi-region adaptive rainfall simulation numerical method based on fractal algorithm according to claim 1 is characterized in that: Rainfall parameter initialization includes the following steps: Determine the data format of the boundary restriction data input by the user. If it is a voice type, convert the voice type boundary restriction data into the set input format through natural language processing technology. The set input format is the requestBody structure; Check whether the requestBody structure contains the geojson module. If the geojson module exists, it means that the coordinate data in the rainfall area in the boundary restriction data is GIS data; The type of GIS data is determined based on the type attribute in the geojson module. If type=MultiPolygon, it means that the coordinate data is multi-region type GIS data. If type=Polygon, it means that the coordinate data is single-region type GIS data. If it is neither MultiPolygon nor Polygon, the coordinate data is considered to be custom coordinate type data. Get the preset rainfall total amount, rainfall duration, and intensity coefficient from the requestBody structure; If the bounds limit data is missing from the requestBody structure, an error message is returned.
3. The multi-region adaptive rainfall simulation numerical method based on fractal algorithm according to claim 1 is characterized in that: When the rainfall period distribution characteristics are generated, the split_into_n function is called to evenly divide the input rainfall according to the duration to generate rainfall_split data.
4. The multi-region adaptive rainfall simulation numerical method based on fractal algorithm according to claim 1 is characterized in that: When simulating and clipping the rainfall area, the cv2.resize function is called according to the shape data of the rainfall area to adjust the shape data to the same resolution as the rainfall data simulation value. The rainfall distribution is matched with the shape data through bit operations so that the rainfall data simulation value only covers the specified rainfall area.
5. The multi-region adaptive rainfall simulation numerical method based on fractal algorithm according to claim 1 is characterized in that: The OpenCV library is used to encode the rainfall simulation values, and then the encoded image is converted into a string format for storage using Base64 encoding.
6. A multi-region adaptive rainfall simulation numerical system based on fractal algorithm, characterized by: The system includes a rainfall parameter initialization module, a geographic coordinate generation module, a rainfall period distribution feature generation module, a simulated rainfall value module, a rainfall data normalization module, a rainfall area simulation clipping module, an image encoding module and a rainfall execution module; The rainfall parameter initialization module is used to perform the following: for the boundary restriction data input by the user, determine the type of rainfall area based on the type of the boundary restriction data, and extract the preset total rainfall amount, rainfall duration and intensity coefficient; The geographic coordinate generation module is used to perform the following: perform latitude and longitude correction on the coordinate data in the rainfall area, and generate a geographic coordinate matrix in the selected rainfall area according to the custom latitude and longitude step size; The rainfall time distribution feature generation module is used to perform the following operations: evenly distribute the rainfall according to the rainfall duration. When generating the rainfall distribution for each time step, the rainfall in the entire rainfall area is divided according to the different rainfall intensities to ensure that each time step has corresponding rainfall information. The simulated rainfall numerical module is used to perform the following: generate the peak number and randomness coefficient according to the geographic coordinate matrix, and create a rainfall simulation value based on the fractal algorithm at each coordinate point. The rainfall simulation value represents the simulated rainfall amount at the corresponding coordinate position; The rainfall data normalization module is used to perform the following: for each time step of rainfall simulation value, the rainfall simulation value is normalized to ensure that the rainfall intensity in the specified rainfall area is distributed according to the preset rainfall distribution; The rainfall area simulation clipping module is used to perform the following: clip the generated rainfall distribution and match it with the rainfall area so that the rainfall simulation value only covers the specified rainfall area; The image encoding module is used to perform the following operations: image encoding of rainfall simulation values and converting the encoded images into string format for storage to facilitate front-end display; The rainfall execution module is used to perform the following: if an exception occurs during the rainfall generation process, it captures the exception and outputs the relevant error information, and at the same time returns the generated rainfall simulation value to the caller.
7. The multi-region adaptive rainfall simulation numerical system based on fractal algorithm according to claim 6 is characterized in that: The rainfall parameter initialization module is used to perform the following operations: Determine the data format of the boundary restriction data input by the user. If it is a voice type, convert the voice type boundary restriction data into the set input format through natural language processing technology. The set input format is the requestBody structure; Check whether the requestBody structure contains the geojson module. If the geojson module exists, it means that the coordinate data in the rainfall area in the boundary restriction data is GIS data; The type of GIS data is determined based on the type attribute in the geojson module. If type=MultiPolygon, it means that the coordinate data is multi-region type GIS data. If type=Polygon, it means that the coordinate data is single-region type GIS data. If it is neither MultiPolygon nor Polygon, the coordinate data is considered to be custom coordinate type data. Get the preset rainfall total amount, rainfall duration, and intensity coefficient from the requestBody structure; If the bounds limit data is missing from the requestBody structure, an error message is returned.
8. The multi-region adaptive rainfall simulation numerical system based on fractal algorithm according to claim 6 is characterized in that: The rainfall period distribution feature generation module is used to call the split_into_n function to evenly divide the input rainfall according to the duration and generate rainfall_split data.
9. The multi-region adaptive rainfall simulation numerical system based on fractal algorithm according to claim 6 is characterized in that: The rainfall area simulation clipping module is used to perform the following: based on the shape data of the rainfall area, call the cv2.resize function to adjust the shape data to the same resolution as the rainfall data simulation value, and match the rainfall distribution with the shape data through bit operations so that the rainfall data simulation value only covers the specified rainfall area.
10. The multi-region adaptive rainfall simulation numerical system based on fractal algorithm according to claim 6, characterized in that: The rainfall execution module is used to use the OpenCV library to encode the rainfall simulation values into images, and then use Base64 encoding to convert the encoded images into string format for storage.
Citation Information
Patent Citations
Mountain substation and surrounding river pipe network flood model construction method and system
CN117709718A
GIS-based land ecological restoration data visualization method and system
CN118069729A