Multi-region adaptive rainfall numerical simulation method and system based on fractal algorithm
Through the multi-region adaptive simulation of rainfall numerical method based on fractal algorithm, the problem of difficulty in dealing with complex boundary restricted areas and multi-regional conditions in the existing technology is solved, and more realistic and accurate numerical simulation of rainfall is achieved, and more complex flood deduction and disaster prevention early warning calculation are supported.
Patent Information
- Application Number
- CN202411870196.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-18
- Publication Date
- 2025-04-22
- Estimated Expiration
- 2044-12-18
AI Technical Summary
The existing numerical generation methods for simulated rainfall are difficult to deal with complex boundary restricted areas and multi-regional conditions, and cannot truly restore complex rainfall processes, affecting the accuracy of flood deduction and disaster prevention warning.
A multi-region adaptive simulated rainfall numerical method based on fractal algorithm is used to generate rainfall numerical values that meet complex boundaries and multi-regional characteristics through steps such as initialization of rainfall parameters, geographical coordinate generation, rainfall period distribution feature generation, simulated rainfall numerical values, normalization of rainfall data, simulation and tailoring of rainfall areas, and picture coding.
Adaptive processing of complex boundary restricted areas is realized, the complexity of spatial distribution during rainfall and the dynamic characteristics of rainfall periods are fully simulated, the authenticity and accuracy of simulated rainfall values are improved, and more complex flood deduction and disaster prevention early warning calculations are supported.
Smart Images

Figure CN119862698A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of data processing, in particular to a multi-region self-adaptive rainfall simulation numerical method and system based on a fractal algorithm. Background Art
[0002] Hydrological and hydrodynamic numerical models are effective non-engineering measures for urban waterlogging simulation, flood scheduling, and flood simulation. The input data of the currently widely used numerical simulation models all include rainfall data. However, most of the existing numerical generation methods for simulated rainfall simulate rainfall in a certain fixed shape area, and lack consideration of the complex spatial distribution characteristics and rainfall period during the rainfall process. Such methods cannot simulate complex boundaries or multi-region conditions, and cannot truly restore the complex real environment, which will further affect complex calculations such as flood simulation, disaster prevention and warning, and greatly affect the accuracy of related work. How to efficiently generate simulated rainfall numerically 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 smart platforms and geographic information systems have begun to be put into use. Information input based on large-model voice interaction is also becoming a research hotspot. Digital twin scenarios will finely mark various types of geographic information such as cities, river networks, and watersheds. The problem of how to connect and utilize various boundary restriction data is also urgently needed to be solved.
[0004] Based on the above analysis, how to meet the requirements of adaptive processing of complex boundary restriction areas, fully simulate the complexity of spatial distribution during rainfall and the dynamic characteristics of rainfall periods, so as to realize the generation of simulated rainfall values under complex conditions, is a technical problem that needs to be solved. Summary of the invention
[0005] The technical task of the present invention is to address the above deficiencies and provide a multi-region adaptive rainfall simulation numerical method and system based on fractal algorithm to solve the technical problem of how to meet the requirements of adaptive processing of complex boundary restriction areas, fully simulate the complexity of spatial distribution during rainfall and the dynamic characteristics of rainfall periods, so as to realize the generation of simulated rainfall values under complex conditions.
[0006] In a first aspect, the present invention provides a multi-region adaptive rainfall simulation numerical method based on a fractal algorithm, comprising the following steps:
[0007] Initialization of rainfall parameters: 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;
[0008] 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;
[0009] Generation of rainfall period distribution characteristics: The rainfall is evenly distributed according to the rainfall duration. 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;
[0010] Simulated rainfall value: Generate peak value and randomness 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 at the corresponding coordinate position.
[0011] 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;
[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] Image encoding: Encode the rainfall simulation values and convert the encoded images into string format for storage to facilitate front-end display;
[0014] 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.
[0015] Preferably, the rainfall parameter initialization comprises the following steps:
[0016] Determine the data format of the boundary restriction data input by the user. If it is of voice type, convert the boundary restriction data of the voice type into a set input format through natural language processing technology. The set input format is a requestBody structure.
[0017] 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;
[0018] The type of GIS data is determined 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 it is neither MultiPolygon nor Polygon, the coordinate data is considered to be custom coordinate type data.
[0019] Get the preset total rainfall, rainfall duration and intensity coefficient from the requestBody structure;
[0020] If the bounds limit data is missing in the requestBody structure, an error message is returned.
[0021] Preferably, 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.
[0022] Preferably, 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, and 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.
[0023] Preferably, the rainfall simulation value is encoded using the OpenCV library, and then the encoded image is converted into a string format for storage using Base64 encoding.
[0024] In a second aspect, the present invention provides a multi-region adaptive rainfall simulation numerical system based on a fractal algorithm, which is used to perform rainfall numerical simulation by using a multi-region adaptive rainfall simulation numerical method based on a fractal algorithm as described in any one of the first aspects, wherein the system includes a rainfall parameter initialization module, a geographic coordinate generation module, a rainfall time period distribution feature generation module, a rainfall simulation numerical module, a rainfall data normalization module, a rainfall area simulation clipping 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 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;
[0026] 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;
[0027] The rainfall time distribution feature generation module is used to perform the following: 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;
[0028] 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, and the rainfall simulation value represents the simulated rainfall at the corresponding coordinate position;
[0029] The rainfall data normalization module is used to perform the following: 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;
[0030] 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;
[0031] The image encoding module is used to perform the following: image encoding of rainfall simulation values, and converting the encoded images into string format for storage, so as to adapt to the front-end display;
[0032] The rainfall execution module is used to perform the following: During the rainfall generation process, if an exception occurs, the exception is captured and the relevant error information is output, and the generated rainfall simulation value is returned to the caller.
[0033] Preferably, the rainfall parameter initialization module is used to perform the following operations:
[0034] Determine the data format of the boundary restriction data input by the user. If it is of voice type, convert the boundary restriction data of the voice type into a set input format through natural language processing technology. The set input format is a requestBody structure.
[0035] 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;
[0036] The type of GIS data is determined 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 it is neither MultiPolygon nor Polygon, the coordinate data is considered to be custom coordinate type data.
[0037] Get the preset total rainfall, rainfall duration and intensity coefficient from the requestBody structure;
[0038] If the bounds limit data is missing in the requestBody structure, an error message is returned.
[0039] Preferably, 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 to generate rainfall_split data.
[0040] Preferably, 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.
[0041] Preferably, the rainfall execution 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.
[0042] The multi-region adaptive rainfall simulation numerical method and system based on fractal algorithm of the present invention have the following advantages:
[0043] 1. Multi-region adaptive processing capability: Adaptive processing of multiple regions is achieved through the built-in boundary restriction processing module, which solves the problem that existing technologies are difficult to handle in complex boundary restriction regions, and greatly expands the application scenarios of simulated rainfall numerical generation;
[0044] 2. Refined generation of rainfall data: The numerical generation of rainfall simulation based on fractal algorithm can simulate the complex spatial distribution characteristics that often appear in the rainfall process, making the generated rainfall data closer to the real natural phenomenon. It can also finely divide the rainfall into rainfall distribution at each time step according to the rainfall (rainfall) and simulation duration (duration) input by the user. The fine-grained processing method ensures that the time resolution of rainfall simulation is high, which can better reflect the dynamic changes of the rainfall process.
[0045] 3. Improve program robustness: It includes automatic checking and correction functions for longitude and latitude ranges to ensure that the geographic coordinates of the generated rainfall data are accurate and valid. This is especially important when dealing with large-scale, multi-region rainfall simulations, and can avoid simulation deviations caused by coordinate errors. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. 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 creative work.
[0047] The present invention is further described below in conjunction with the accompanying drawings.
[0048] Figure 1 This is a flowchart of a multi-region adaptive rainfall simulation numerical method based on a fractal algorithm in Example 1. DETAILED DESCRIPTION
[0049] The present invention is further described below in conjunction with the accompanying drawings and specific embodiments so that those skilled in the art can better understand the present invention and implement it. However, the embodiments are not intended to limit the present invention. In the absence of conflict, the embodiments of the present invention and the technical features in the embodiments may be combined with each other.
[0050] The embodiments of the present invention provide a multi-region adaptive rainfall simulation numerical method and system based on a fractal algorithm, which are used to solve the technical problem of how to perform adaptive processing on complex boundary restriction areas, fully simulate the complexity of spatial distribution during the rainfall process and the dynamic characteristics of the rainfall period, so as to realize the generation of simulated rainfall values under complex conditions.
[0051] Embodiment 1:
[0052] The invention discloses a multi-region adaptive rainfall simulation numerical method based on fractal algorithm, which comprises eight steps: rainfall parameter initialization, geographic coordinate generation, rainfall time distribution feature generation, rainfall simulation numerical value, rainfall data normalization, rainfall region simulation clipping, picture coding, and abnormality processing and result output.
[0053] Step S100: Initialization of rainfall parameters: for the boundary restriction data input by the user, the type of rainfall area is determined based on the type of the boundary restriction data, and the preset total rainfall amount, rainfall duration and intensity coefficient are extracted.
[0054] As a specific implementation of rainfall parameter initialization, it includes the following steps:
[0055] (1) Determine the data format of the boundary restriction data input by the user. If the boundary restriction data is of voice type, convert the boundary restriction data of voice type into a set input format through natural language processing technology. The set input format is a requestBody structure.
[0056] (2) 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;
[0057] (3) The type of GIS data is determined 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 it is neither MultiPolygon nor Polygon, the coordinate data is considered to be custom coordinate type data.
[0058] (4) Obtain the preset total rainfall, rainfall duration, and intensity coefficient from the requestBody structure;
[0059] (5) If the boundary restriction data is missing in the requestBody structure, an error message is returned.
[0060] Step S200: 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 longitude and latitude step.
[0061] As a specific implementation of geographic coordinate generation, this step includes the following two operations:
[0062] (1) Check and correct the longitude and latitude coordinates: first, keep two decimal places uniformly, then judge the longitude and latitude. If the longitude is in [-180,180] and the latitude is in [-90,90], it is in the valid range, otherwise an error message is prompted; judge up_lon≤down_lon, up_lat≥down_lat, if so, it is a valid longitude and latitude, otherwise, exchange the values;
[0063] (2) Generate geographic coordinate information: Generate a geographic coordinate matrix in the selected area based on the custom longitude and latitude step. The length and width of the matrix are defined as height and width.
[0064] Step S300 generates rainfall time distribution characteristics: evenly distributes rainfall according to rainfall duration. When generating rainfall distribution for each time step, the rainfall in the entire rainfall area is divided according to different rainfall intensities to ensure that each time step has corresponding rainfall information.
[0065] As a specific implementation of the generation of rainfall period distribution characteristics, 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.
[0066] Step S400 simulates rainfall values: generates peak values and random coefficients according to the geographic coordinate matrix, creates a rainfall simulation value based on a fractal algorithm at each coordinate point, and the rainfall simulation value represents the simulated rainfall at the corresponding coordinate position.
[0067] As a specific implementation of the simulated rainfall value, according to the specified shape (height and width), the number of generated peaks (num_peaks) and the randomness coefficient (randomness), a fractal algorithm-based rainfall simulation value is created at each coordinate point, which represents the simulated rainfall at the coordinate position.
[0068] Step S500: Normalization of rainfall data: For each rainfall simulation value of 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.
[0069] Step S600: Rainfall area simulation clipping: clipping the generated rainfall distribution and matching 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, 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 operation, so that the rainfall data simulation value only covers the specified rainfall area.
[0071] Step S700: Picture encoding: the rainfall simulation value is encoded, and the encoded picture is converted into a string format for storage to facilitate front-end display.
[0072] In this embodiment, the OpenCV library is used to encode the rainfall simulation value, and then the encoded image is converted into a string format for storage using Base64 encoding.
[0073] Step S800 handles exceptions and outputs results: During the rainfall generation process, if an exception occurs, the exception is captured and the relevant error information is output, and the generated rainfall simulation value is returned to the caller.
[0074] During the rainfall generation process, if an abnormal situation occurs, the exception is captured and the relevant error information is output, and the generated rainfall data is returned to the caller. The program returns different types of result data (including pictures, data lists, etc.) according to different generation types and parameter processing flows, and calculates the time consumption of the generation process and outputs it.
[0075] First, the input boundary restriction condition data is judged, and single area, multiple areas, and GIS data can be accepted to meet the adaptive processing of complex boundary restriction areas; then the simulated rainfall area is determined according to the input coordinates, and the coordinates in the area are refined through the preset step size, 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 to ensure that there is corresponding rainfall information in each time step; then, according to the rainfall information of different time periods, a rainfall distribution based on the fractal algorithm is created, and a rainfall model is generated according to the specified shape, the number of generated peaks and the randomness coefficient to increase the realism of the simulated rainfall; finally, the simulated rainfall values of different time periods are encoded into images to meet the front-end image display requirements, and the corresponding coordinates and rainfall information are output to provide data support for subsequent hydrological calculations.
[0076] This application achieves adaptive processing of multiple regions through built-in boundary restriction processing, which solves the problem that existing technologies are difficult to deal with in complex boundary restriction area processing, greatly expands the application scenarios of simulated rainfall numerical generation, and provides solid data support for complex calculations such as flood simulation and disaster prevention and early warning. In addition, by considering fractal algorithms and rainfall periods, the complexity of spatial distribution during rainfall and the dynamic characteristics of rainfall periods are fully simulated, significantly improving the authenticity of simulation results.
[0077] Embodiment 2:
[0078] The invention discloses a multi-region self-adaptive rainfall simulation numerical system based on fractal algorithm, comprising a parameter initialization module, a geographic coordinate generation module, a rainfall period distribution feature generation module, a rainfall simulation numerical module, a rainfall data normalization module, a rainfall region simulation clipping module, a picture encoding module and a rainfall execution module.
[0079] The rainfall parameter initialization module is used to perform the following: for the boundary restriction data input by the user, the rainfall area type is determined based on the type of the boundary restriction data, and the preset total rainfall amount, rainfall duration and intensity coefficient are extracted.
[0080] As a specific implementation of the rainfall parameter initialization module, this module is used to perform the following operations
[0081] (1) Determine the data format of the boundary restriction data input by the user. If the boundary restriction data is of voice type, convert the boundary restriction data of voice type into a set input format through natural language processing technology. The set input format is a requestBody structure.
[0082] (2) 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;
[0083] (3) The type of GIS data is determined 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 it is neither MultiPolygon nor Polygon, the coordinate data is considered to be custom coordinate type data.
[0084] (4) Obtain the preset total rainfall, rainfall duration, and intensity coefficient from the requestBody structure;
[0085] (5) If the boundary restriction data is missing in the requestBody structure, an error message is returned.
[0086] The geographic coordinate generation module is used to perform the following: perform longitude and latitude correction on the coordinate data in the rainfall area, and generate a geographic coordinate matrix in the selected rainfall area according to the custom longitude and latitude step.
[0087] Implemented as a geographic coordinate generation module, this module is used to perform the following two operations:
[0088] (1) Check and correct the longitude and latitude coordinates: first, keep two decimal places uniformly, then judge the longitude and latitude. If the longitude is in [-180,180] and the latitude is in [-90,90], it is in the valid range, otherwise an error message is prompted; judge up_lon≤down_lon, up_lat≥down_lat, if so, it is a valid longitude and latitude, otherwise, exchange the values;
[0089] (2) Generate geographic coordinate information: Generate a geographic coordinate matrix in the selected area based on the custom longitude and latitude step. 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: evenly distribute the rainfall according to the rainfall duration, and when generating the rainfall distribution for 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.
[0091] As a specific 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 evenly divide the input rainfall according to the duration to generate 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, create a rainfall simulation value based on the fractal algorithm at each coordinate point, and the rainfall simulation value represents the simulated rainfall 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 according to the specified shape (height and width), the number of generated peaks (num_peaks) and the randomness coefficient (randomness). This value represents the simulated rainfall at the coordinate position.
[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 operation, so that the rainfall data simulation value only covers the specified rainfall area.
[0097] The image encoding module is used to perform the following: 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 encode 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: During the rainfall generation process, if an exception occurs, the exception is captured and the relevant error information is output, and the generated rainfall simulation value is returned to the caller.
[0100] During the rainfall generation process, if an abnormal situation occurs, the rainfall execution module is used to capture the abnormality and output the relevant 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 flows, and calculates the time consumption of the generation process and outputs it.
[0101] The system of this embodiment can execute the method disclosed in Example 1 to simulate rainfall values.
[0102] The multi-region adaptive rainfall simulation numerical method and system based on fractal algorithm provided by the present invention are introduced in detail above. Specific examples are used in this article to illustrate the principle and implementation mode of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. At the same time, for those skilled in the art, according to the idea of the present invention, there will be changes in the specific implementation mode and application scope. In summary, the content of this specification should not be understood as limiting the present invention.
Claims
1. A multi-region adaptive rainfall simulation numerical method based on fractal algorithm, characterized in that: The steps include: Initialization of rainfall parameters: 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; Generation of rainfall period distribution characteristics: The rainfall is evenly distributed according to the rainfall duration. 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; Simulated rainfall value: Generate peak value and randomness 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 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: The initialization of rainfall parameters includes the following steps: Determine the data format of the boundary restriction data input by the user. If it is of voice type, convert the boundary restriction data of the voice type into a set input format through natural language processing technology. The set input format is a 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 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 it is neither MultiPolygon nor Polygon, the coordinate data is considered to be custom coordinate type data. Get the preset total rainfall, rainfall duration and intensity coefficient from the requestBody structure; If the bounds limit data is missing in 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 in that: Used to perform rainfall numerical simulation by a multi-region adaptive rainfall numerical simulation method based on a fractal algorithm as described in any one of claims 1 to 5, the system comprises a rainfall parameter initialization module, a geographic coordinate generation module, a rainfall period distribution feature generation module, a rainfall simulation numerical module, a rainfall data normalization module, a rainfall area simulation clipping module, a picture 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; The rainfall time distribution feature generation module is used to perform the following: 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; 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, and the rainfall simulation value represents the simulated rainfall at the corresponding coordinate position; The rainfall data normalization module is used to perform the following: 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; 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: image encoding of rainfall simulation values, and converting the encoded images into string format for storage, so as to adapt to the front-end display; The rainfall execution module is used to perform the following: During the rainfall generation process, if an exception occurs, the exception is captured and the relevant error information is output, and the generated rainfall simulation value is returned 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 of voice type, convert the boundary restriction data of the voice type into a set input format through natural language processing technology. The set input format is a 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 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 it is neither MultiPolygon nor Polygon, the coordinate data is considered to be custom coordinate type data. Get the preset total rainfall, rainfall duration and intensity coefficient from the requestBody structure; If the bounds limit data is missing in 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: 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 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, and then use Base64 encoding to convert the encoded image into a 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
Numerical rainfall forecast analysis method, equipment and medium
CN118760729A