Rainfall similarity matching method, device and equipment based on multi-dimensional feature extraction
By constructing a spatiotemporal distribution raster map of rainfall and extracting features at multiple scales, combined with a two-level progressive matching strategy, the problems of single dimension and limited computational efficiency in rainfall similarity matching are solved, achieving high-precision and fast rainfall event similarity judgment and risk warning.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- BEIJING WATER SCI & TECH INST
- Filing Date
- 2026-03-04
- Publication Date
- 2026-06-05
AI Technical Summary
Existing technologies for rainfall similarity matching based on multi-dimensional feature extraction suffer from limitations in terms of single dimension, insufficient mining of spatiotemporal structural features, and large-scale computational efficiency, making it difficult to meet the timeliness requirements of disaster prevention and early warning.
A historical rainfall database for the target area is constructed, and a spatiotemporal distribution raster map of rainfall is generated. Multi-scale feature vectors are extracted through multiple convolution operations. A two-level progressive matching strategy of Euclidean distance and cosine distance is combined to quickly calculate the similarity between new rainfall events and historical events, and a historical feature database of spatiotemporal distribution of rainfall is constructed.
It achieves high-precision and rapid matching of rainfall events, and can capture in-depth information such as rainband intensity, morphology, gradient, multicenter, and evolution. The matching results are closer to the disaster-causing mechanism, supporting the rapid identification of high-risk areas and the formulation of effective defense strategies.
Smart Images

Figure CN122153481A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of meteorological data analysis, hydrological disaster early warning and risk prevention technology, specifically to a rainfall similarity matching method, device and equipment based on multi-dimensional feature extraction. Background Technology
[0002] In areas such as urban flood control and early warning of flash floods and geological disasters, historical similar rainfall cases are the most direct basis for predicting the risk of current rainfall. The disaster risk of a rainfall event depends not only on its total rainfall, but also on the spatial distribution pattern of rainfall, the movement path of the intensity center, and its historical evolution.
[0003] Existing rainfall similarity matching methods based on multi-dimensional feature extraction mostly focus on single-dimensional comparisons. For example, some methods only compare the average rainfall of a watershed or region; or only compare rainfall sequences from representative single stations; some methods introduce spatial interpolation techniques to generate rainfall distribution maps, but in similarity judgment, they often use simple spatial correlation coefficients or statistical indicators based on grid values. These methods fail to fully explore the deep-seated, multi-scale spatial structural features of rainfall fields (such as rainband orientation, intensity gradient, and multi-center distribution) and their dynamic patterns of evolution over time, resulting in matching results that sometimes fail to accurately reflect the spatiotemporal similarity of disaster risk. In addition, facing the increasingly large historical rainfall databases, the computational efficiency of traditional methods faces challenges, and there is a lack of effective parallelization support, making it difficult to meet the high timeliness requirements in disaster prevention and early warning.
[0004] In summary, existing technologies suffer from limitations in rainfall similarity matching based on multi-dimensional feature extraction, including single-dimensionality limitations, insufficient mining of spatiotemporal structural features, and limited large-scale computational efficiency. Summary of the Invention
[0005] This invention provides a rainfall similarity matching method, apparatus, and device based on multi-dimensional feature extraction, to solve the problems of single dimension, insufficient mining of spatiotemporal structural features, and limited large-scale computational efficiency in the existing technology of rainfall similarity matching based on multi-dimensional feature extraction.
[0006] In a first aspect, the present invention provides a rainfall similarity matching method based on multi-dimensional feature extraction, the method comprising: Construct a historical rainfall database for the target area; Based on historical rainfall database, generate a raster map of the spatiotemporal distribution of rainfall; Based on the spatiotemporal distribution raster map of rainfall, a historical feature database of spatiotemporal distribution of rainfall was extracted; When a new rainfall event occurs, the similarity between the spatiotemporal distribution feature vector of the new rainfall event and the historical feature database of the spatiotemporal distribution of rainfall is calculated based on a two-level progressive matching, and the corresponding historical rainfall events are selected based on the similarity.
[0007] This invention provides a rainfall similarity matching method based on multi-dimensional feature extraction. By standardizing historical rainfall data into a spatiotemporal distribution raster map, and automatically extracting features from it to construct a historical feature library, when a new rainfall event occurs, it can quickly calculate its similarity to the feature library and match the most similar historical cases. By combining the dynamic spatiotemporal evolution features of rainfall spatiotemporal distribution and extracting multi-scale spatial structure features, it can capture deep information such as rainband intensity, morphology, gradient, multicenter, and evolution, making the similarity judgment closer to the disaster-causing mechanism, and the matching results more clearly defined in physical meaning. It is faster and more accurate than methods based on single statistical indicators or full-image pixel comparison. It solves the problems of single dimension, insufficient mining of spatiotemporal structure features, and limited large-scale computational efficiency in existing technologies for rainfall similarity matching.
[0008] In one alternative implementation, a historical rainfall database for the target area is constructed, including: Acquire rainfall process data, rain gauge coordinate data, and spatial boundary data of various types of historical rainfall events within the target area; By summarizing rainfall process data, rain gauge coordinate data, and spatial boundary data of the target area, a historical rainfall database for the target area is obtained.
[0009] This invention provides a rainfall similarity matching method based on multi-dimensional feature extraction. By systematically integrating multi-source heterogeneous rainfall data (process, coordinates, boundaries), it lays a unified and standardized data foundation for subsequent refined feature matching, thereby ensuring the feasibility of the overall method process and the consistency of results.
[0010] In one optional implementation, the spatiotemporal distribution raster map of rainfall includes: a spatial distribution raster map of total rainfall in a single event and a raster map of the sequence of rainfall events in a single event; Based on historical rainfall databases, a raster map of rainfall spatial distribution is generated, including: Based on the same rain gauge station, the rainfall intensity of all effective time steps within each historical rainfall event is calculated and accumulated to obtain the total rainfall of each event at each rain gauge station. Based on the total rainfall and coordinate data of each rain gauge, spatial interpolation is performed within the spatial boundary data of the target area using a preset interpolation method to obtain a raster map of the spatial distribution of total rainfall in a single event. Calculate the rainfall sequence for each rain gauge station at a preset time step, and use a preset interpolation method to perform spatial interpolation to generate a raster map of the single rainfall process sequence within the corresponding time step.
[0011] This invention provides a rainfall similarity matching method based on multi-dimensional feature extraction. By transforming discrete and irregularly distributed station rainfall observation data into continuous and regular spatial raster data, it not only solves the problem of the original data's spatial discontinuity and inability to directly perform spatial pattern analysis, but also comprehensively represents the key information of rainfall events in both the cumulative spatial pattern and spatiotemporal dynamic evolution by generating two types of raster maps: total rainfall distribution and rainfall process sequence. This standardized rasterization process provides an accurate and comparable data foundation for subsequent use of a unified feature extraction and similarity calculation framework.
[0012] In one optional implementation, the historical feature database of spatiotemporal distribution of rainfall includes: a historical feature database of spatial distribution of total rainfall and a historical feature database of rainfall processes; Based on the spatiotemporal distribution raster map of rainfall, a historical feature database of spatiotemporal distribution of rainfall was extracted, including: Based on the spatial distribution raster map of total rainfall for each single event, multiple convolution operations are used to extract the spatial distribution feature vector of total rainfall, and a historical feature database of total rainfall spatial distribution is generated based on the spatial distribution feature vector of total rainfall. For each single rainfall event sequence raster image, multiple convolution operations are used to extract the rainfall event feature vector, and a historical feature database of rainfall events is generated based on the rainfall event feature vector.
[0013] This invention provides a rainfall similarity matching method based on multi-dimensional feature extraction. By introducing multiple convolution operations to automatically learn features from two types of raster images, it can capture multi-scale spatial structures (such as rainband morphology and intensity gradients) from the spatial distribution of total rainfall and extract dynamic evolution patterns from rainfall process sequences, thereby achieving intelligent and refined characterization of deep spatiotemporal features of rainfall events. By constructing two independent historical feature databases for total rainfall and process, it provides quantifiable benchmark data that characterizes both static patterns and dynamic processes for subsequent similarity matching.
[0014] In one optional implementation, based on the spatial distribution raster map of total rainfall for each single event, multiple convolution operations are performed to extract the spatial distribution feature vector of total rainfall, and a historical feature database of total rainfall spatial distribution is generated based on the spatial distribution feature vector of total rainfall, including: Based on the spatial distribution raster map of the total rainfall in each single event, multiple convolution operations are performed using multiple convolution kernels of different sizes and types to form the first multi-scale feature sequence. The first multi-scale feature sequence is then concatenated sequentially to obtain the multi-scale spatial feature vector of each single event. The multi-scale spatial feature vectors are standardized, and the standardized multi-scale spatial feature vectors are associated with the corresponding historical rainfall events and stored to generate a historical feature database of the spatial distribution of total rainfall.
[0015] This invention provides a rainfall similarity matching method based on multi-dimensional feature extraction. It uses multi-size convolutional kernels for multi-scale feature extraction and splicing, which can automatically and comprehensively capture the spatial distribution features of rainfall from local details to the overall pattern, avoiding the limitations of traditional methods that rely on manual experience to design features. The subsequent standardization process effectively eliminates the differences in the units of measurement between features, ensuring the fairness and accuracy of subsequent similarity measurement. Finally, the standardized feature vectors are associated with historical events and stored to form a structured feature knowledge base.
[0016] In one optional implementation, the feature vector of each single rainfall event sequence raster image is extracted by multiple convolution operations, and a historical feature database of rainfall events is generated based on the rainfall event feature vector, including: Each single rainfall event sequence raster image is flattened within the corresponding time step and arranged in rows to generate a spatiotemporal representation matrix. Multiple convolutional kernels of different sizes and types are used to perform multiple convolution operations on the spatiotemporal representation matrix to form a second multi-scale feature sequence. The second multi-scale feature sequence is then concatenated sequentially to obtain the spatiotemporal feature vector of rainfall for each single event. The spatiotemporal feature vectors of rainfall are standardized, and the standardized spatiotemporal feature vectors of rainfall are associated with and stored with the corresponding historical rainfall events to generate a historical feature database of rainfall processes.
[0017] This invention provides a rainfall similarity matching method based on multi-dimensional feature extraction. By flattening and reconstructing the spatiotemporal sequence data of rainfall events into a two-dimensional matrix, it cleverly integrates temporal and spatial information into a unified structure, making it compatible with standard two-dimensional convolution processing. Then, it automatically extracts multi-scale spatiotemporal joint variation features during rainfall events using multiple convolution kernels of different sizes and types, comprehensively depicting the spatial distribution of rainfall intensity and its dynamic evolution over time. Subsequent standardization ensures the comparability of feature vectors. The resulting historical feature database of rainfall events provides a crucial basis for subsequent accurate matching of historical rainfall events with similar dynamic evolution patterns.
[0018] In one optional implementation, when a new rainfall event occurs, the similarity between the spatiotemporal distribution feature vector of the new rainfall event and the historical spatiotemporal distribution feature database of rainfall is calculated, and corresponding historical rainfall events are selected based on the similarity, including: When a new rainfall event occurs, extract the spatial distribution feature vector of the total rainfall of the new rainfall event and the spatiotemporal feature vector of the rainfall of the new rainfall event; Calculate the Euclidean distance between the spatial distribution feature vector of total rainfall of the new rainfall event and the spatial distribution feature vector of total rainfall of historical rainfall events in the historical feature database of rainfall spatiotemporal distribution. Select the historical rainfall events in the pre-set number field with the closest Euclidean distance to form a primary candidate set. Calculate the cosine distance between the spatiotemporal feature vector of the new rainfall event and the spatiotemporal feature vector of the historical rainfall events in the primary candidate set, and sort the historical rainfall events in the primary candidate set based on the cosine distance to select the historical rainfall events with the highest similarity.
[0019] This invention provides a rainfall similarity matching method based on multi-dimensional feature extraction. It employs a two-stage progressive screening strategy, first considering the spatial distribution of total rainfall, then the spatiotemporal process. Furthermore, it uses Euclidean distance and cosine distance as metrics to measure the feature differences between static and dynamic patterns, achieving an effective balance between computational efficiency and matching accuracy. This method can quickly and accurately identify historical rainfall cases with the most similar spatiotemporal characteristics from massive amounts of historical data.
[0020] In one alternative implementation, the method further includes: Based on the most similar historical rainfall events, the risks of new rainfall events are assessed, and corresponding defense strategies are formulated.
[0021] This invention provides a rainfall similarity matching method based on multi-dimensional feature extraction, which directly uses high-precision matched historical similar cases as a scientific basis for assessing the disaster risk of new rainfall events and formulating defense strategies. Based on the precise correlation between historical disaster data and response records, decision-makers can quickly identify high-risk areas, predict the development of disaster chains, and initiate effective defense measures that have been proven in practice.
[0022] Secondly, the present invention provides a rainfall similarity matching device based on multi-dimensional feature extraction, the device comprising: The historical rainfall database construction module is used to build a historical rainfall database for the target area; The rainfall spatiotemporal distribution raster map generation module is used to generate rainfall spatiotemporal distribution raster maps based on historical rainfall databases; The module for constructing a historical feature database of spatiotemporal rainfall distribution is used to extract historical features of spatiotemporal rainfall distribution based on the spatiotemporal rainfall distribution raster map. The similarity matching module is used to calculate the similarity between the spatiotemporal distribution feature vector of the new rainfall event and the historical feature database of the spatiotemporal distribution of rainfall based on two-level progressive matching when a new rainfall event occurs, and to filter out the corresponding historical rainfall events based on the similarity.
[0023] Thirdly, the present invention provides an electronic device, comprising: a memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the computer instructions to perform the rainfall similarity matching method based on multi-dimensional feature extraction described in the first aspect or any corresponding embodiment.
[0024] Fourthly, the present invention provides a computer-readable storage medium storing computer instructions for causing a computer to execute the rainfall similarity matching method based on multi-dimensional feature extraction described in the first aspect or any corresponding embodiment thereof.
[0025] Fifthly, the present invention provides a computer program product, including computer instructions for causing a computer to execute the rainfall similarity matching method based on multi-dimensional feature extraction described in the first aspect or any corresponding embodiment thereof. Attached Figure Description
[0026] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0027] Figure 1 This is a schematic diagram of the first process of a rainfall similarity matching method based on multi-dimensional feature extraction according to an embodiment of the present invention; Figure 2 This is a schematic diagram of the second process of the rainfall similarity matching method based on multi-dimensional feature extraction according to an embodiment of the present invention; Figure 3 This is a schematic diagram of the third process of the rainfall similarity matching method based on multi-dimensional feature extraction according to an embodiment of the present invention; Figure 4 This is a schematic diagram of the fourth process of the rainfall similarity matching method based on multi-dimensional feature extraction according to an embodiment of the present invention; Figure 5 This is a schematic diagram of the process for constructing a historical rainfall database in a rainfall similarity matching method based on multi-dimensional feature extraction according to an embodiment of the present invention; Figure 6 This is a schematic diagram of the data preprocessing and rasterization process in the rainfall similarity matching method based on multi-dimensional feature extraction according to an embodiment of the present invention; Figure 7This is a schematic diagram of the cumulative rainfall feature extraction process in the rainfall similarity matching method based on multi-dimensional feature extraction according to an embodiment of the present invention; Figure 8 This is a schematic diagram of the process of extracting rainfall features in the rainfall similarity matching method based on multi-dimensional feature extraction according to an embodiment of the present invention; Figure 9 This is a schematic diagram of the process for extracting features of new rainfall events in a rainfall similarity matching method based on multi-dimensional feature extraction according to an embodiment of the present invention; Figure 10 This is a flowchart illustrating the similarity matching process in the rainfall similarity matching method based on multi-dimensional feature extraction according to an embodiment of the present invention. Figure 11 This is a structural block diagram of a rainfall similarity matching device based on multi-dimensional feature extraction according to an embodiment of the present invention; Figure 12 This is a schematic diagram of the hardware structure of an electronic device according to an embodiment of the present invention. Detailed Implementation
[0028] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0029] It is understood that before using the technical solutions disclosed in the various embodiments of the present invention, users should be informed of the types, scope of use, and usage scenarios of the personal information involved in the present invention and their authorization should be obtained in accordance with relevant laws and regulations through appropriate means.
[0030] The terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of this invention, "a plurality of" means two or more, unless otherwise explicitly specified.
[0031] According to an embodiment of the present invention, a rainfall similarity matching method based on multi-dimensional feature extraction is provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.
[0032] This embodiment provides a rainfall similarity matching method based on multi-dimensional feature extraction, which can be used in the aforementioned electronic devices. Figure 1 This is a flowchart of a rainfall similarity matching method based on multi-dimensional feature extraction according to an embodiment of the present invention, such as... Figure 1 As shown, the process includes the following steps: Step S101: Construct a historical rainfall database for the target area.
[0033] Specifically, data on various types of historical rainfall events within the target study area will be collected, ensuring coverage of different seasons, intensity levels, and weather system types to form a statistically significant basic sample database. The required data include: Rainfall event data: Time series data of rainfall intensity recorded at each rain gauge station at a fixed time step, used to characterize the change process of rainfall events over time.
[0034] Rain gauge coordinate data: Records static data of the geographical location (such as longitude and latitude) of each rain gauge station, used to associate rainfall information with specific spatial locations.
[0035] Spatial boundary data of the study area: geographic vector polygon data that defines the scope of analysis and is used to limit the spatial area for data processing, interpolation, and feature analysis.
[0036] Step S102: Generate a spatiotemporal distribution raster map of rainfall based on the historical rainfall database.
[0037] Specifically, this step aims to transform the discrete station data in the historical rainfall database of step S101 into standardized spatial raster data, providing a unified input for feature extraction.
[0038] Rainfall spatiotemporal distribution raster maps are standardized grid image data generated by spatial interpolation based on discrete rain gauge observation data. They can continuously characterize the spatial distribution of rainfall in a specified geographical area and its temporal variation. Specifically, they include single-event rainfall total spatial distribution raster maps that reflect the cumulative spatial pattern of a rainfall event, and single-event rainfall process sequence raster maps that reflect the spatial variation of rainfall intensity over time periods during the event.
[0039] Step S103: Based on the spatiotemporal distribution raster map of rainfall, extract the historical feature database of spatiotemporal distribution of rainfall.
[0040] Specifically, based on the feature learning concept in computer vision, the spatiotemporal distribution raster map of rainfall is regarded as a special "image". Its multi-scale spatial features are extracted through convolution operation, and after standardization, it is associated with the corresponding historical rainfall events to form a historical feature library of spatiotemporal distribution of rainfall.
[0041] Step S104: When a new rainfall event occurs, the similarity between the spatiotemporal distribution feature vector of the new rainfall event and the historical feature database of the spatiotemporal distribution of rainfall is calculated based on two-level progressive matching, and the corresponding historical rainfall events are selected based on the similarity.
[0042] Specifically, when a new rainfall event occurs, historical events with the most similar spatiotemporal characteristics are selected through two-level matching.
[0043] Two-level matching and filtering refers to a progressive search strategy designed to balance computational efficiency and matching accuracy: the first level uses Euclidean distance to quickly and roughly screen out several historical events with similar spatial patterns from the total feature database (a primary candidate set); the second level uses cosine distance to finely compare spatiotemporal process features within the primary candidate set, ultimately outputting the historical rainfall event with the most similar dynamic evolution pattern. This strategy, through a two-step approach of global static coarse screening followed by local dynamic fine screening, achieves efficient and accurate identification of the optimal similar cases from massive historical data.
[0044] The rainfall similarity matching method based on multi-dimensional feature extraction provided in this embodiment standardizes historical rainfall data into a spatiotemporal distribution raster map and automatically extracts features from it to construct a historical feature library. When a new rainfall event occurs, it can quickly calculate its similarity with the feature library and match the most similar historical cases. By combining the dynamic spatiotemporal evolution features of rainfall spatiotemporal distribution and extracting multi-scale spatial structure features, it can capture deep information such as rainband intensity, morphology, gradient, multicenter, and evolution, making the similarity judgment closer to the disaster-causing mechanism.
[0045] This embodiment provides a rainfall similarity matching method based on multi-dimensional feature extraction, which can be used in the aforementioned electronic devices. Figure 2 This is a flowchart of a rainfall similarity matching method based on multi-dimensional feature extraction according to an embodiment of the present invention, such as... Figure 2 As shown, the process includes the following steps: Step S201: Construct a historical rainfall database for the target area.
[0046] Specifically, the flowchart for constructing a historical rainfall database is as follows: Figure 5 As shown, step S201 above includes: Step S2011: Obtain rainfall process data, rain gauge coordinate data, and spatial boundary data of various types of historical rainfall events within the target area.
[0047] Rainfall data should be stored in a structured data format (such as CSV or TXT), including a time column and a rainfall intensity column for each rain gauge at the corresponding time. A time resolution of 5-60 minutes is recommended, with an example recording format of "2000 / 05 / 04 8:00:00". Rainfall intensity data should be accurate to two decimal places.
[0048] Rain gauge coordinate data: includes station name, longitude, and latitude information. The coordinate system is either WGS-84 or the national geodetic coordinate system. Example: "Coordinate data of a reservoir, 115.6114, 40.2323".
[0049] Spatial boundary data of the study area: The geographic scope to which the method is applicable is defined by vector polygon files (such as Shapefile format), usually the administrative boundaries of cities or watersheds, which are used to constrain the scope of spatial interpolation and analysis.
[0050] Step S2012: Summarize rainfall process data, rain gauge coordinate data, and target area spatial boundary data to obtain the historical rainfall database for the target area.
[0051] Specifically, with spatial correlation as the core, rainfall process data, station coordinates and geographical boundaries with clear spatiotemporal attributes are matched, filtered and structured to generate a historical rainfall event database that can be used for subsequent unified analysis.
[0052] Step S202: Generate a spatiotemporal distribution raster map of rainfall based on the historical rainfall database.
[0053] Specifically, the spatiotemporal distribution raster map of rainfall includes: a raster map of the spatial distribution of total rainfall in a single event and a raster map of the sequence of a single rainfall event; such as Figure 6 As shown, step S202 above includes: Step S2021: Based on the same rain gauge station, calculate and sum the rainfall intensity of all effective time steps within each historical rainfall event to obtain the total rainfall for each rain gauge station.
[0054] Specifically, for each rainfall event, the rainfall intensity at each rain gauge station is summed across all valid time steps to obtain the total rainfall for that station. Missing data in the sequence is imputed using methods such as linear interpolation or averaging of preceding and following time steps.
[0055] Step S2022: Based on the total rainfall of each rain gauge and the coordinate data of the rain gauge, spatial interpolation is performed within the spatial boundary data of the target area using a preset interpolation method to obtain a raster map of the spatial distribution of the total rainfall of a single event.
[0056] Specifically, the preset interpolation method is the inverse distance weighting method.
[0057] Based on the cumulative rainfall and coordinates of each station, spatial interpolation is performed within the boundary of the study area using the inverse distance weighting method. The interpolation radius is recommended to be 1.2 to 1.5 times the radius of the equivalent circle of the study area. The resolution of the output raster is set according to the data density and application requirements, typically between 100 meters and 1000 meters. The interpolation results are saved in a common raster format (such as GeoTIFF) and metadata is recorded synchronously.
[0058] Step S2023: Calculate the rainfall sequence for each rain gauge station at a preset time step, and perform spatial interpolation using a preset interpolation method to generate a raster map of the single rainfall process sequence within the corresponding time step.
[0059] For processes requiring analysis of rainfall dynamics, rainfall sequences for each station are calculated at fixed time steps (e.g., 1 hour). Using the same IDW interpolation parameters as in step S2022 (to limit the search radius of participating stations and determine the distance weight power for the rate of decay of influence of neighboring stations), a raster map of the rainfall spatial distribution at that time step is generated. A raster map of all time steps of a rainfall event represents its spatiotemporal process sequence.
[0060] Step S203: Based on the spatiotemporal distribution raster map of rainfall, extract the historical feature database of rainfall spatiotemporal distribution. For details, please refer to [link to details]. Figure 1 Step S103 of the illustrated embodiment will not be described again here.
[0061] Step S204: When a new rainfall event occurs, the similarity between the spatiotemporal distribution feature vector of the new rainfall event and the historical spatiotemporal distribution feature database of rainfall is calculated based on a two-level progressive matching method. Corresponding historical rainfall events are then selected based on this similarity. For details, please refer to [link to details]. Figure 1 Step S104 of the illustrated embodiment will not be described again here.
[0062] The rainfall similarity matching method based on multi-dimensional feature extraction provided in this embodiment systematically integrates multi-source heterogeneous rainfall data (process, coordinates, boundaries). By transforming discrete and irregularly distributed station rainfall observation data into continuous and regular spatial raster data, it not only solves the problem that the original data is spatially discontinuous and cannot be directly analyzed for spatial patterns, but also fully characterizes the key information of rainfall events in two dimensions: cumulative spatial pattern and spatiotemporal dynamic evolution by generating two types of raster maps: total rainfall distribution and rainfall process sequence.
[0063] This embodiment provides a rainfall similarity matching method based on multi-dimensional feature extraction, which can be used in the aforementioned electronic devices. Figure 3 This is a flowchart of a rainfall similarity matching method based on multi-dimensional feature extraction according to an embodiment of the present invention, such as... Figure 3As shown, the process includes the following steps: Step S301: Construct a historical rainfall database for the target area. For details, please refer to [link to relevant documentation]. Figure 2 Step S201 of the illustrated embodiment will not be described again here.
[0064] Step S302: Generate a spatiotemporal distribution raster map of rainfall based on the historical rainfall database. For details, please refer to [link to details]. Figure 2 Step S202 of the illustrated embodiment will not be described again here.
[0065] Step S303: Based on the spatiotemporal distribution raster map of rainfall, extract the historical feature database of spatiotemporal distribution of rainfall.
[0066] Specifically, the historical feature database of spatiotemporal distribution of rainfall includes: a historical feature database of spatial distribution of total rainfall and a historical feature database of rainfall processes; the above step S303 includes: Step S3031: Based on the spatial distribution raster map of total rainfall for each single event, extract the spatial distribution feature vector of total rainfall using multiple convolution operations, and generate a historical feature database of total rainfall spatial distribution based on the spatial distribution feature vector of total rainfall.
[0067] In some alternative implementations, such as Figure 7 As shown, step S3031 above includes: Step a1: Based on the spatial distribution raster map of the total rainfall in each single event, perform multiple convolution operations using multiple convolution kernels of different sizes and types to form a first multi-scale feature sequence. Then, concatenate the first multi-scale feature sequence in sequence to obtain the multi-scale spatial feature vector of each single event.
[0068] The input for this step is a raster map of the spatial distribution of total rainfall in a single event.
[0069] Convolutional Feature Extraction: Multiple convolutional kernels of different sizes (e.g., 3×3 or 5×5) and different types (edge detection kernels, smoothing kernels, etc.) are used to perform two-dimensional convolution operations on the input raster image, retaining the output feature map after each convolution. This convolution operation is performed L times to form a multi-scale feature sequence. Finally, all feature maps of the original input and the outputs of each layer are flattened and sequentially concatenated to form a multi-scale spatial feature vector for the rainfall event.
[0070] The operation of flattening and sequentially concatenating all feature maps of the original input and the output of each layer transforms and connects the original rainfall raster map and its spatial feature maps at different scales extracted through multiple convolutions into a one-dimensional vector. This integrates complete multi-scale spatial information from local details to global patterns, forming a comprehensive feature vector for fully characterizing the spatial distribution pattern of the rainfall event.
[0071] Step a2 involves standardizing the multi-scale spatial feature vectors and then associating and storing the standardized multi-scale spatial feature vectors with the corresponding historical rainfall events to generate a historical feature database of the spatial distribution of total rainfall.
[0072] Feature standardization: Z-score standardization is performed on the feature vectors extracted from all historical rainfall events to eliminate differences in the units and numerical ranges between features.
[0073] Database construction: The standardized feature vectors are associated with and stored with the unique identifiers of their corresponding rainfall events to form a historical feature database of the spatial distribution of total rainfall.
[0074] Step S3032: Extract the feature vector of each single rainfall process sequence raster image by performing multiple convolution operations, and generate a historical feature database of rainfall processes based on the feature vector of the rainfall process.
[0075] In some alternative implementations, such as Figure 8 As shown, step S3032 above includes: Step b1 involves flattening the raster image of each single rainfall event sequence within the corresponding time step and arranging it in rows to generate a spatiotemporal representation matrix.
[0076] The input for this step is the generated raster map of a single rainfall event sequence.
[0077] Feature extraction: For a single rainfall event sequence raster map, the raster map corresponding to each time step is first flattened into a one-dimensional array, and the one-dimensional arrays of all time steps are arranged in rows to construct a two-dimensional matrix (i.e., the spatiotemporal representation matrix of the rainfall event).
[0078] Step b2 involves performing multiple convolution operations on the spatiotemporal representation matrix using multiple convolution kernels of different sizes and types to form a second multi-scale feature sequence. The second multi-scale feature sequence is then concatenated sequentially to obtain the spatiotemporal feature vector of rainfall for each single event.
[0079] Based on the two-dimensional matrix (i.e., the process spatiotemporal representation matrix) formed in step b1, perform the same multiple convolutional feature extraction and standardization process as in step S3031, and define the final generated feature vector as the spatiotemporal feature vector of the rainfall event.
[0080] Step b3: Standardize the spatiotemporal feature vector of rainfall, and associate and store the standardized spatiotemporal feature vector of rainfall with the corresponding historical rainfall events to generate a historical feature database of rainfall processes.
[0081] This step is the database construction step: the standardized process feature vector (i.e., the spatiotemporal feature vector of rainfall) is associated with and stored with the unique identifier of the corresponding rainfall event to form a historical feature database of rainfall process.
[0082] Step S304: When a new rainfall event occurs, the similarity between the spatiotemporal distribution feature vector of the new rainfall event and the historical feature database of spatiotemporal distribution of rainfall is calculated based on two-level progressive matching, and the corresponding historical rainfall events are selected based on the similarity.
[0083] Specifically, step S304 includes: Step S3041: When a new rainfall event occurs, extract the spatial distribution feature vector of the total rainfall of the new rainfall event and the spatiotemporal feature vector of the rainfall of the new rainfall event.
[0084] New event feature extraction: Obtain the raw data of the new rainfall event, and repeat steps S3031 and S3032 to generate the spatial distribution feature vector of the total rainfall of the new rainfall event and the spatiotemporal feature vector of the rainfall of the new rainfall event, respectively. The flowchart of new rainfall event feature extraction is as follows. Figure 9 As shown, the specific operation is as follows: 1. Obtain new event data: Input the raw observation data of the target new rainfall event.
[0085] 2. Calculate cumulative rainfall: Based on the above data, calculate the total rainfall for each rainfall station.
[0086] 3. Generate a cumulative rainfall raster map: Convert the calculated total rainfall into a spatial distribution raster map through spatial interpolation.
[0087] 4. Generate a raster map of the rainfall sequence: Divide the rainfall process into fixed time steps and interpolate each step to generate a series of spatial distribution raster maps arranged in chronological order.
[0088] 5. Extracting cumulative rainfall features: Feature extraction is performed on the cumulative rainfall raster map to obtain the feature vector representing its spatial pattern.
[0089] 6. Extracting process rainfall features: Feature extraction is performed on the raster image of the process rainfall sequence to obtain its feature vector representing spatiotemporal dynamics.
[0090] 7. Output: Cumulative and process rainfall features. Output the two feature vectors mentioned above as the feature representation of the new rainfall event. The process ends.
[0091] Step S3042: Calculate the Euclidean distance between the spatial distribution feature vector of total rainfall of the new rainfall event and the spatial distribution feature vector of total rainfall of historical rainfall events in the historical feature database of rainfall spatiotemporal distribution, and select the historical rainfall events of the pre-preset number field with the closest Euclidean distance to form a primary candidate set.
[0092] This step is the first level of matching, namely, spatial total distribution similarity screening. Specifically, it involves calculating the similarity between the feature vector of the new event's cumulative rainfall and all historical feature vectors in the historical feature database of total rainfall spatial distribution. The similarity metric is Euclidean distance. The specific calculation method and formula for Euclidean distance can be found in relevant technical documents and will not be elaborated here.
[0093] Step S3043: Calculate the cosine distance between the spatiotemporal feature vector of the new rainfall event and the spatiotemporal feature vector of the historical rainfall events in the primary candidate set, and sort the historical rainfall events in the primary candidate set based on the cosine distance to select the historical rainfall events with the highest similarity.
[0094] This step is the second level of matching, namely, fine screening of spatiotemporal process similarity. The specific operation is as follows: First, cosine distance is used to calculate the similarity between the spatiotemporal feature vector of the new rainfall event and the spatiotemporal feature vectors of the rainfall corresponding to M historical events in the primary candidate set. The specific calculation method and formula for cosine distance can be found in relevant technical documents and will not be elaborated here.
[0095] Next, the primary candidate set is sorted in descending order based on this similarity.
[0096] Finally, the top N historical rainfall events with the highest similarity are output as the final matching results. N can be preset according to needs (e.g., 3-10 events) or dynamically adjusted according to the intensity level of new rainfall (e.g., output more cases for comprehensive reference during torrential rain).
[0097] A flowchart illustrating the similarity matching process is shown below. Figure 10 As shown, the specific process is as follows: 1. Input: Spatial distribution feature vector of total rainfall (F_cum) and spatiotemporal feature vector of rainfall (F_proc) for the new event.
[0098] 2. First-level matching (coarse screening): Calculate the similarity (e.g., Euclidean distance) between F_cum and all vectors in the historical total rainfall spatial distribution feature database.
[0099] 3. Generate a primary candidate set: Sort the similarity results from the previous step in descending order and select the top M historical events with the highest similarity to form a primary candidate set.
[0100] 4. Second-level matching (fine screening): Calculate the cosine similarity between F_proc and the feature vectors of rainfall processes corresponding to all events in the primary candidate set.
[0101] 5. Generate final results: Sort the candidate set in descending order according to cosine similarity and select the top N historical events with the highest similarity.
[0102] 6. Output: Output the list of the top N most similar historical rainfall events and their corresponding similarity scores. The process ends here.
[0103] Step S305: Based on the historical rainfall events with the highest similarity, assess the risk of new rainfall events and formulate corresponding defense strategies.
[0104] This step is the results and application step, outputting the final list of matched historical rainfall events and their similarity scores. Users can quickly view records of the actual disaster situation, response measures, and effects when these historical events occurred, providing accurate and intuitive decision support for core risk prediction and emergency plan activation.
[0105] It should be noted that in the batch processing stages of feature extraction in steps S3031, S3032, and S304, Python's multiprocessing or concurrent.futures library is used for multi-process / multi-threaded parallel computing. This distributes data processing tasks for different rainfall events or different time slices to different computing units, significantly improving overall computational efficiency. When using progress bars in parallel tasks, independent identifiers or queue management mechanisms are used to avoid confusion in the output information.
[0106] The rainfall similarity matching method based on multi-dimensional feature extraction provided in this embodiment adopts a two-level progressive screening strategy, first considering the spatial distribution of total rainfall and then the spatiotemporal process. Furthermore, it uses Euclidean distance and cosine distance as metrics to measure the feature differences between static patterns and dynamic patterns, achieving an effective balance between computational efficiency and matching accuracy. This method can quickly and accurately identify historical rainfall cases with the most similar spatiotemporal characteristics from massive amounts of historical data.
[0107] As one or more specific application embodiments of the present invention, combined with Figure 4 The rainfall similarity matching method based on multi-dimensional feature extraction provided by this invention will be further described in detail, such as... Figure 4 As shown, the specific process is as follows: 1. Construct a historical rainfall database: Collect data on various types of historical rainfall events within the study area, ensuring coverage of different seasons, intensity levels, and weather system types, to form a statistically significant basic sample database. Specific required data include: Rainfall event data: Stored in a structured data format (such as CSV, TXT), including a time column and a rainfall intensity column for each rain gauge at the corresponding time. The recommended time resolution is 5-60 minutes, and the record format is "2000 / 05 / 04 8:00:00". The accuracy of rainfall intensity data should be retained to two decimal places.
[0108] Rain gauge coordinate data: includes station name, longitude, and latitude information. The coordinate system is either WGS-84 or the national geodetic coordinate system. Example: "A certain reservoir, 115.6114, 40.2323".
[0109] Spatial boundary data of the study area: The geographic scope to which the method is applicable is defined by vector polygon files (such as Shapefile format), usually the administrative boundaries of cities or watersheds, which are used to constrain the scope of spatial interpolation and analysis.
[0110] 2. Data Preprocessing and Rasterization: This step aims to transform discrete site data into standardized spatial raster data, providing a unified input for feature extraction.
[0111] Calculating total rainfall: For each rainfall event, group by rain gauge station and sum the rainfall intensity across all valid time steps to obtain the total rainfall for that station. Missing data in the sequence is imputed using methods such as linear interpolation or averaging of preceding and following time steps.
[0112] Generate a spatial distribution raster map of total rainfall: Based on the cumulative rainfall and coordinates of each station, spatial interpolation is performed within the boundary of the study area using the inverse distance weighting method. The interpolation radius is recommended to be 1.2 to 1.5 times the radius of the equivalent circle of the study area. The resolution of the output raster is set according to the data density and application requirements, typically between 100 meters and 1000 meters. Save the interpolation results in a common raster format (such as GeoTIFF) and record metadata synchronously.
[0113] Generating a raster map of rainfall sequences: For a process requiring analysis of rainfall dynamics, calculate the rainfall sequence for each station within a fixed time step (e.g., 1 hour), and generate a raster map of the spatial distribution of rainfall at that time step using the same IDW interpolation parameters as in the previous step. A raster map of all time steps of a rainfall event represents its spatiotemporal process sequence.
[0114] 3. Construct a historical feature database: Drawing on the concept of feature learning in computer vision, rainfall raster images are treated as a special type of "image," and their multi-scale spatial features are extracted through convolution operations.
[0115] 3.1 Extraction and database construction of spatial distribution characteristics of total rainfall: Input: A raster map showing the spatial distribution of total rainfall in a single event, generated in step 2.
[0116] Convolutional Feature Extraction: Multiple convolutional kernels of different sizes (e.g., 3×3 or 5×5) and different types (e.g., edge detection kernels, smoothing kernels, etc.) are used to perform two-dimensional convolution operations on the input raster image, retaining the output feature map after each convolution. This convolutional operation is iterated L times to form a multi-scale feature sequence. Finally, all feature maps of the original input and the outputs of each layer are flattened and sequentially concatenated to form the "multi-scale spatial feature vector" of this rainfall event.
[0117] Feature standardization: Z-score standardization is performed on the feature vectors extracted from all historical rainfall events to eliminate differences in the units and numerical ranges between features.
[0118] Database construction: The standardized feature vectors are associated with and stored with the unique identifiers of their corresponding rainfall events to form a "historical feature database of spatial distribution of total rainfall".
[0119] 3.2 Extraction and database construction of spatiotemporal features of rainfall: Input: A raster image of a single rainfall event sequence.
[0120] Feature extraction: For a single rainfall event sequence raster image, the raster image corresponding to each time step is first flattened into a one-dimensional array, and the one-dimensional arrays of all time steps are arranged in rows to construct a two-dimensional matrix (i.e., the spatiotemporal representation matrix of the rainfall event). Based on this two-dimensional matrix, the same multiple convolutional feature extraction and standardization process as in step 3.1 is performed, and the final generated feature vector is defined as the "spatiotemporal feature vector of rainfall event".
[0121] Database construction: The standardized process feature vectors are associated with and stored with the unique identifiers of their corresponding rainfall events to form a "historical feature database of rainfall processes".
[0122] 4. Similarity matching of new rainfall events: When a new rainfall event occurs, historical events with the most similar spatiotemporal characteristics are selected through two-level matching.
[0123] New event feature extraction: Obtain the raw data of the new rainfall event, repeat steps 3.1 and 3.2, and generate its "spatial distribution feature vector of total rainfall" and "spatiotemporal feature vector of rainfall" respectively.
[0124] Level 1 matching (spatial total distribution similarity filtering): The similarity between the feature vector of cumulative rainfall of the new event and all historical feature vectors in the historical feature database of spatial distribution of total rainfall is calculated, and the similarity measure is Euclidean distance.
[0125] Sort the historical events in descending order of similarity and select the top M events to form a "primary candidate set".
[0126] Second-level matching (refined screening of spatiotemporal process similarity): The similarity between the spatiotemporal feature vector of a new event's rainfall and the spatiotemporal feature vectors of rainfall corresponding to M historical events in the "primary candidate set" is calculated using cosine distance.
[0127] The primary candidate set is sorted in descending order based on this similarity.
[0128] The system outputs the top N historical rainfall events with the highest similarity as the final matching result. N can be preset according to needs (e.g., 3-10 events) or dynamically adjusted according to the intensity level of new rainfall (e.g., output more cases for comprehensive reference during torrential rain).
[0129] Results and Applications: Outputs a final list of matched historical rainfall events and their similarity scores. Users can quickly access records of the actual disaster situation, response measures, and effects of these historical events, providing accurate and intuitive decision support for core risk prediction and emergency response plan activation.
[0130] Furthermore, in the batch processing stages of steps 3.1, 3.2, and 4, Python's multiprocessing or concurrent.futures libraries are used for multi-process / multi-threaded parallel computing. Data processing tasks for different rainfall events or different time slices are allocated to different computing units to significantly improve overall computational efficiency. When using progress bars in parallel tasks, independent identifiers or queue management mechanisms are used to avoid confusion in the output information.
[0131] Taking a certain city as a case study area and using historical rainfall data from 2000 to 2023 as the research object, the specific application of the technical method of this invention will be further explained. The specific application strictly follows the four core steps described in the invention: "constructing a historical rainfall database, data preprocessing and rasterization, constructing a historical feature database, and matching the similarity of new rainfall events." The detailed process is as follows: Step S1: Construct a historical rainfall database: Historical rainfall data for the city and surrounding areas from 2000 to 2023 were collected, ensuring coverage of different seasons (spring, summer, autumn, and winter), different intensity levels (light rain, moderate rain, heavy rain, torrential rain, and extremely heavy rain), and different weather system types (frontal rain, convective rain, typhoon rain, etc.). This resulted in a basic sample database containing 2172 rainfall events, with specific data as follows: Rainfall data: stored in CSV format, containing a time column and a rainfall intensity column for the corresponding time at 95 rain gauge stations, with a time resolution of 5 minutes. The record format example is "2010 / 07 / 15 14:30:00". The rainfall intensity data is retained to two decimal places. Rain gauge coordinate data: includes station name, longitude, and latitude information. The coordinate system adopted is WGS-84 coordinate system. Example: "A certain reservoir, 115.6114, 40.2323". Spatial boundary data for the study area: The administrative boundary vector file of the city in Shapefile format is used to constrain the geographical scope of subsequent spatial interpolation and analysis.
[0132] Step S2: Data preprocessing and rasterization: This step transforms discrete station rainfall data into standardized spatial raster data, providing a unified input for subsequent feature extraction. The specific operations are as follows: Calculate total rainfall: For each rainfall event, group by rain gauge station and sum the rainfall intensity for all effective time steps to obtain the total rainfall for each station; for missing values in the data sequence, use linear interpolation to fill in the missing values; A raster map of the spatial distribution of total rainfall was generated: Based on the cumulative rainfall at each station and WGS-84 coordinates, spatial interpolation was performed within the administrative boundary of the city using the inverse distance weighting (IDW) method. The interpolation radius was set to 1.35 times the radius of the equivalent circle of the study area, and the output raster resolution was set to 500 meters according to the data density and application requirements. The interpolation results were saved in GeoTIFF format, and metadata (including interpolation parameters, data source, generation time, etc.) was recorded synchronously. Generate rainfall sequence raster maps: Calculate the hourly rainfall intensity of each station at a fixed time step of 1 hour, and use the same IDW interpolation parameters as in the previous step to generate hourly rainfall spatial distribution raster maps for each rainfall event, forming a sequence raster dataset that characterizes the spatiotemporal process of rainfall.
[0133] Step S3: Construct a historical feature database: Drawing inspiration from feature learning in computer vision, this paper treats rainfall raster images as special "images" and extracts multi-scale spatial features through convolution operations, constructing separate feature libraries for the spatial distribution of total rainfall and the spatiotemporal feature library for rainfall. 3.1 Construction of a spatial distribution feature database of total rainfall: Input: 2172 raster maps showing the spatial distribution of total rainfall in a single event, generated in step S2; Convolutional Feature Extraction: Feature extraction is performed using a combination of convolutional kernels of multiple sizes and types. Specifically, three sizes of convolutional kernels—3×3, 5×5, and 7×7—are selected. Each size of convolutional kernel includes three types: Gaussian, Sobel, and Laplacian. Different sizes and types of convolutional kernels are then paired (a total of 3 sizes × 3 types of effective combinations, ultimately determining 9 unique convolutional kernel combinations). These 9 sets of convolutional kernels are used to perform two-dimensional convolution operations on the input raster image, with a stride of 1 and zero padding. After each convolution, the output feature map is retained separately, resulting in 9 layers of feature maps. Finally, the original input raster image and the 9 layers of convolutional output feature maps are flattened into one-dimensional arrays and sequentially concatenated to form a "multi-scale spatial feature vector." Feature standardization: Z-score standardization was performed on all feature vectors extracted from 2172 rainfall events to eliminate differences in the units and numerical ranges of different features; Database construction: The standardized feature vectors are associated with the unique identifiers of the corresponding rainfall events (including information such as the time of occurrence and intensity level) and stored to form a "historical feature database of spatial distribution of total rainfall".
[0134] 3.2 Construction of a spatiotemporal feature database for rainfall: Input: Raster images of 500 typical rainstorm process sequences generated in step S2; Feature extraction: For the hourly raster images of each rainstorm, the raster image corresponding to each time step is first flattened into a one-dimensional array. Then, the one-dimensional arrays of all time steps are arranged in rows to construct a two-dimensional matrix representing the spatiotemporal process of the rainfall. Based on this two-dimensional matrix, the same multi-scale convolutional feature extraction process (3×3 convolution kernel, 3 iterations of convolution, zero padding, stride 1) and Z-score normalization process as in step 3.1 are performed. The generated feature vector is defined as the "spatiotemporal feature vector of rainfall" for the rainfall. For the hourly raster images of each rainstorm, the raster image corresponding to each time step is first flattened into a one-dimensional array. Then, all the one-dimensional arrays of time steps are arranged in rows to construct a two-dimensional matrix representing the spatiotemporal process of the rainfall. Based on this two-dimensional matrix, the same multi-scale convolutional feature extraction process as in 3.1 is performed (three sizes: 3×3 / 5×5 / 7×7, three types: Gaussian / Sobel / Laplacian, combined in pairs to form 9 sets of convolution kernels, which are convolved to obtain 9 layers of feature maps, with zero padding and a stride of 1) and Z-score normalization process. The generated feature vector is defined as the "spatiotemporal feature vector of rainfall" for the rainfall. Database construction: The standardized spatiotemporal feature vectors of rainfall are associated with the unique identifiers of the corresponding rainfall events and stored to form a "spatiotemporal historical feature database of rainfall".
[0135] Step S4: Matching new rainfall events: On a certain day in August 2024, the city experienced a localized torrential rainstorm (target new rainfall event). Two-level matching was used to select historical events with the most similar spatiotemporal characteristics. The specific process is as follows: New event feature extraction: Real-time acquisition of the raw data of the new rainstorm (including 5-minute resolution rainfall intensity data and rain gauge coordinate data), repeating the data preprocessing and rasterization in step S2, and the feature extraction process in steps S3.1 and S3.2, to generate its total rainfall spatial distribution feature vector (F_cum) and rainfall spatiotemporal feature vector (F_proc). First-level matching (spatial total distribution similarity screening): Calculate the similarity between the F_cum of the new event and all 2172 historical feature vectors in the historical feature database of the spatial distribution of total rainfall. The similarity measure is Euclidean distance. Sort by similarity in descending order and select the top 50 historical events to form the "primary candidate set". The second-level matching (spatiotemporal process similarity screening) uses cosine distance to calculate the similarity between the F_proc of the new event and the "spatiotemporal feature vectors of rainfall" corresponding to 50 historical events in the primary candidate set. Based on this similarity, the primary candidate set is sorted again in descending order, with a preset N=5. The top 5 historical rainfall events with the highest similarity are output as the final matching results. The results show that these 5 historical events are all short-duration extreme rainstorms occurring in summer with "train effect" characteristics, and they highly match the spatiotemporal characteristics of the new rainfall event. Results and Applications: The output includes a list of five historical rainfall events that ultimately matched, along with their corresponding two-level similarity scores. Flood control commanders can quickly access records of the actual disaster situation, response measures, and effects of these five historical events. The query revealed that four of these events caused severe flooding in the low-lying areas of the eastern part of the city and the northern foothills. Therefore, in responding to the new rainstorm warning, the command center focused on strengthening the scheduling of pumping stations, patrols, hazard mitigation, and traffic control in these two areas, effectively reducing flooding losses and achieving good disaster prevention and mitigation results.
[0136] Optimization and verification of computational efficiency: In order to improve the efficiency of large-scale data processing, this embodiment adopts multi-process parallel computing in the historical feature batch extraction stage in step S3 and the new rainfall event feature extraction stage in step S4, and allocates the feature extraction tasks of different rainfall events to different computing units.
[0137] Hardware environment: A Windows workstation with a 16-core CPU is used, with 8 parallel processes set up. Progress bar output is managed by an independent identifier in the parallel tasks to avoid information confusion.
[0138] Efficiency verification results: Despite the use of a complex feature extraction process with 9 combined convolutions, the feature extraction time for the entire historical database (2172 rainfall events) was still controlled within 4.2 hours; the real-time matching process for a single new rainfall event (including data preprocessing, rasterization, feature extraction and two-level matching) can be completed within 5 minutes, fully meeting the timeliness requirements of business early warning.
[0139] The rainfall similarity matching method based on multi-dimensional feature extraction in this embodiment has the following advantages: 1. Comprehensive matching dimensions and improved accuracy: This invention combines the static spatial pattern of cumulative rainfall with the dynamic spatiotemporal evolution of process rainfall. By extracting multi-scale spatial structure features through the idea of convolutional neural networks, it can capture deep information such as rainband intensity, morphology, gradient, multicenter, and evolution. This makes the similarity judgment closer to the disaster-causing mechanism, the physical meaning of the matching results clearer, and the accuracy higher than methods based on a single statistical indicator or full-image pixel comparison.
[0140] 2. Strong feature representation capability: Through multiple convolution operations, it automatically learns and extracts multi-scale rainfall spatial features from local to global and from details to contours, avoiding the one-sidedness of manually designed features and having a stronger ability to represent and distinguish complex and ever-changing rainfall spatial patterns.
[0141] 3. High computational efficiency and good scalability: The proposed method has a clear process, high modularity, and is easy to implement in parallel. Through parallel preprocessing and feature extraction of large-scale historical data, and a two-level matching strategy (coarse screening followed by fine screening), it can effectively handle the rapid matching needs of thousands of historical rainfall events and meet the timeliness requirements of business early warning.
[0142] 4. Highly practical and provides direct decision support: The method ultimately outputs specific historical similar cases, rather than abstract similarity values, which makes it easy for business personnel to directly access disaster information and response logs in historical archives. This makes risk assessment conclusions more intuitive, defense measures recommendations more targeted, and significantly improves the efficiency of on-site decision-making in disaster prevention and mitigation.
[0143] This embodiment also provides a rainfall similarity matching device based on multi-dimensional feature extraction. This device is used to implement the above embodiments and preferred embodiments, and details already described will not be repeated. As used below, the term "module" can be a combination of software and / or hardware that implements a predetermined function. Although the device described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.
[0144] This embodiment provides a rainfall similarity matching device based on multi-dimensional feature extraction, such as... Figure 11 As shown, it includes: The historical rainfall database construction module 1101 is used to construct a historical rainfall database for the target area.
[0145] The rainfall spatiotemporal distribution raster map generation module 1102 is used to generate a rainfall spatiotemporal distribution raster map based on a historical rainfall database.
[0146] The module 1103 for constructing the historical feature database of spatiotemporal distribution of rainfall is used to extract the historical feature database of spatiotemporal distribution of rainfall based on the spatiotemporal distribution raster map of rainfall.
[0147] The similarity matching module 1104 is used to calculate the similarity between the spatiotemporal distribution feature vector of the new rainfall event and the historical feature database of the spatiotemporal distribution of rainfall based on two-level progressive matching when a new rainfall event occurs, and to filter out the corresponding historical rainfall events based on the similarity.
[0148] In some optional implementations, the historical rainfall database construction module 1101 includes: The data acquisition unit is used to acquire rainfall process data, rain gauge coordinate data, and spatial boundary data of various types of historical rainfall events within the target area.
[0149] The historical rainfall database construction unit is used to summarize rainfall process data, rain gauge coordinate data, and target area spatial boundary data to obtain the historical rainfall database of the target area.
[0150] In some optional implementations, the spatiotemporal distribution raster map of rainfall includes: a spatial distribution raster map of total rainfall in a single event and a raster map of the sequence of rainfall events in a single event; the spatiotemporal distribution raster map generation module 1102 includes: The total rainfall calculation unit is used to calculate the total rainfall for each historical rainfall event by summing up the rainfall intensity of all effective time steps within the same rain gauge station.
[0151] The first spatial interpolation unit is used to perform spatial interpolation within the spatial boundary data of the target area based on the total rainfall of each rain gauge and the coordinate data of the rain gauge, using a preset interpolation method to obtain a raster map of the spatial distribution of the total rainfall of a single event.
[0152] The second spatial interpolation unit is used to calculate the rainfall sequence of each rain gauge station at a preset time step, and to perform spatial interpolation using a preset interpolation method to generate a raster map of the single rainfall process sequence within the corresponding time step.
[0153] In some optional implementations, the historical feature database of spatiotemporal distribution of rainfall includes: a historical feature database of spatial distribution of total rainfall and a historical feature database of rainfall processes; the historical feature database construction module 1103 of rainfall spatiotemporal distribution includes: The unit for generating a historical feature database of total rainfall spatial distribution is used to extract the feature vector of total rainfall spatial distribution based on the raster map of total rainfall spatial distribution of each single event by using multiple convolution operations, and to generate a historical feature database of total rainfall spatial distribution based on the feature vector of total rainfall spatial distribution.
[0154] The rainfall process historical feature database generation unit is used to extract rainfall process feature vectors from each single rainfall process sequence raster image through multiple convolution operations, and generate a rainfall process historical feature database based on the rainfall process feature vectors.
[0155] In some optional implementations, the unit for generating the historical feature database of the spatial distribution of total rainfall includes: The multi-scale spatial feature vector generation sub-unit is used to perform multiple convolution operations using multiple convolution kernels of different sizes and types based on the spatial distribution raster map of the total rainfall of each single event, to form the first multi-scale feature sequence. The first multi-scale feature sequence is then concatenated sequentially to obtain the multi-scale spatial feature vector of each single event.
[0156] The standardization and associated storage sub-unit is used to standardize the multi-scale spatial feature vectors and associate the standardized multi-scale spatial feature vectors with the corresponding historical rainfall events to generate a historical feature database of the spatial distribution of total rainfall.
[0157] In some optional implementations, the rainfall process historical feature database generation unit includes: The spatiotemporal representation matrix generation sub-unit is used to flatten the raster image of each single rainfall process sequence within the corresponding time step and arrange them in rows to generate a spatiotemporal representation matrix.
[0158] The rainfall spatiotemporal feature vector generation subunit is used to perform multiple convolution operations on the spatiotemporal representation matrix using multiple convolution kernels of different sizes and types to form a second multi-scale feature sequence. The second multi-scale feature sequence is then concatenated sequentially to obtain the rainfall spatiotemporal feature vector for each single event.
[0159] The historical feature database generation subunit is used to standardize the spatiotemporal feature vectors of rainfall, and associate and store the standardized spatiotemporal feature vectors of rainfall with the corresponding historical rainfall events to generate the historical feature database of rainfall processes.
[0160] In some alternative implementations, the similarity matching module 1104 includes: The new rainfall event feature extraction unit is used to extract the spatial distribution feature vector of the total rainfall of the new rainfall event and the spatiotemporal feature vector of the rainfall of the new rainfall event when a new rainfall event occurs.
[0161] The first similarity matching unit is used to calculate the Euclidean distance between the spatial distribution feature vector of total rainfall of the new rainfall event and the spatial distribution feature vector of total rainfall of historical rainfall events in the historical feature database of rainfall spatiotemporal distribution, and select the historical rainfall events of the pre-preset number field with the closest Euclidean distance to form a primary candidate set.
[0162] The second similarity matching unit is used to calculate the cosine distance between the spatiotemporal feature vector of the new rainfall event and the spatiotemporal feature vector of the historical rainfall events in the primary candidate set, and to sort the historical rainfall events in the primary candidate set based on the cosine distance, and select the historical rainfall event with the highest similarity.
[0163] In one alternative embodiment, the device further includes: The results application module is used to assess the risk of new rainfall events based on the most similar historical rainfall events and to formulate corresponding defense strategies.
[0164] The rainfall similarity matching device based on multi-dimensional feature extraction provided in this embodiment of the invention can execute the rainfall similarity matching method based on multi-dimensional feature extraction provided in any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the method. Further functional descriptions of the above modules and units are the same as in the corresponding embodiments described above, and will not be repeated here.
[0165] Figure 12 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention.
[0166] The following is a detailed reference. Figure 12 The diagram illustrates a structural schematic suitable for implementing an electronic device according to embodiments of the present invention. The electronic device may include a processor (e.g., a central processing unit, graphics processor, etc.) 1201, which can perform various appropriate actions and processes according to a program stored in read-only memory (ROM) 1202 or a program loaded from memory 1208 into random access memory (RAM) 1203. The RAM 1203 also stores various programs and data required for the operation of the electronic device. The processor 1201, ROM 1202, and RAM 1203 are interconnected via a bus 1204. An input / output (I / O) interface 1205 is also connected to the bus 1204.
[0167] Typically, the following devices can be connected to I / O interface 1205: input devices 1206 including, for example, touchscreens, touchpads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; output devices 1207 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; memory devices 1208 including, for example, magnetic tapes, hard disks, etc.; and communication devices 1209. Communication device 1209 allows electronic devices to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 12 Electronic devices with various devices are shown, but it should be understood that it is not required to implement or have all of the devices shown, and more or fewer devices may be implemented or have instead.
[0168] In particular, according to embodiments of the present invention, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of the present invention include a computer program product comprising a computer program carried on a non-transitory computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device 1209, or installed from a memory 1208, or installed from a ROM 1202. When the computer program is executed by the processor 1201, it performs the functions defined in the rainfall similarity matching method based on multi-dimensional feature extraction according to embodiments of the present invention.
[0169] Figure 12 The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of use of the embodiments of the present invention.
[0170] This invention also provides a computer-readable storage medium. The methods described above according to embodiments of the invention can be implemented in hardware or firmware, or implemented as recordable on a storage medium, or implemented as computer code downloaded via a network and originally stored on a remote storage medium or a non-transitory machine-readable storage medium and subsequently stored on a local storage medium. Thus, the methods described herein can be processed by software stored on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. The storage medium can be a magnetic disk, optical disk, read-only memory, random access memory, flash memory, hard disk, or solid-state drive, etc.; further, the storage medium can also include combinations of the above types of memory. It is understood that computers, processors, microprocessor controllers, or programmable hardware include storage components capable of storing or receiving software or computer code. When the software or computer code is accessed and executed by the computer, processor, or hardware, the rainfall similarity matching method based on multi-dimensional feature extraction shown in the above embodiments is implemented.
[0171] A portion of this invention can be applied as a computer program product, such as computer program instructions, which, when executed by a computer, can invoke or provide the methods and / or technical solutions according to the invention through the operation of the computer. Those skilled in the art will understand that the forms in which computer program instructions exist in a computer-readable medium include, but are not limited to, source files, executable files, installation package files, etc. Correspondingly, the ways in which computer program instructions are executed by a computer include, but are not limited to: the computer directly executing the instructions, or the computer compiling the instructions and then executing the corresponding compiled program, or the computer reading and executing the instructions, or the computer reading and installing the instructions and then executing the corresponding installed program. Here, the computer-readable medium can be any available computer-readable storage medium or communication medium accessible to a computer.
[0172] Although embodiments of the invention have been described in conjunction with the accompanying drawings, those skilled in the art can make various modifications and variations without departing from the spirit and scope of the invention, and such modifications and variations all fall within the scope defined by the appended claims.
Claims
1. A rainfall similarity matching method based on multi-dimensional feature extraction, characterized in that, The method includes: Construct a historical rainfall database for the target area; Based on the historical rainfall database, a spatiotemporal distribution raster map of rainfall is generated; Based on the spatiotemporal distribution raster map of rainfall, a historical feature database of spatiotemporal distribution of rainfall is extracted; When a new rainfall event occurs, the similarity between the spatiotemporal distribution feature vector of the new rainfall event and the historical feature database of spatiotemporal distribution of rainfall is calculated based on a two-level progressive matching, and the corresponding historical rainfall events are selected based on the similarity.
2. The rainfall similarity matching method based on multi-dimensional feature extraction according to claim 1, characterized in that, The construction of the historical rainfall database for the target area includes: Acquire rainfall process data, rain gauge coordinate data, and spatial boundary data of various types of historical rainfall events within the target area; By summarizing the rainfall process data, rain gauge coordinate data, and target area spatial boundary data, a historical rainfall database for the target area is obtained.
3. The rainfall similarity matching method based on multi-dimensional feature extraction according to claim 2, characterized in that, The spatiotemporal distribution raster map of rainfall includes: a raster map of the spatial distribution of total rainfall in a single event and a raster map of the sequence of rainfall events in a single event; Based on the historical rainfall database, a raster map of the spatial distribution of rainfall is generated, including: Based on the same rain gauge station, the rainfall intensity of all effective time steps within each historical rainfall event is calculated and accumulated to obtain the total rainfall of each event at each rain gauge station. Based on the total rainfall and coordinate data of each rain gauge, spatial interpolation is performed within the spatial boundary data of the target area using a preset interpolation method to obtain a raster map of the spatial distribution of total rainfall in a single event. Calculate the rainfall sequence for each rain gauge station at a preset time step, and use a preset interpolation method to perform spatial interpolation to generate a raster map of the single rainfall process sequence within the corresponding time step.
4. The rainfall similarity matching method based on multi-dimensional feature extraction according to claim 3, characterized in that, The historical feature database of spatiotemporal distribution of rainfall includes: a historical feature database of spatial distribution of total rainfall and a historical feature database of rainfall processes; Based on the aforementioned spatiotemporal distribution raster map of rainfall, a historical feature database of spatiotemporal distribution of rainfall is extracted, including: Based on the spatial distribution raster map of total rainfall for each single event, multiple convolution operations are used to extract the spatial distribution feature vector of total rainfall, and a historical feature database of total rainfall spatial distribution is generated based on the spatial distribution feature vector of total rainfall. For each single rainfall event sequence raster image, multiple convolution operations are performed to extract the rainfall event feature vector, and a historical feature database of rainfall events is generated based on the rainfall event feature vector.
5. The rainfall similarity matching method based on multi-dimensional feature extraction according to claim 4, characterized in that, Based on the spatial distribution raster map of total rainfall for each single event, multiple convolution operations are used to extract the spatial distribution feature vector of total rainfall. Then, a historical feature database of total rainfall spatial distribution is generated based on this feature vector, including: Based on the spatial distribution raster map of the total rainfall in each single event, multiple convolution operations are performed using multiple convolution kernels of different sizes and types to form a first multi-scale feature sequence. The first multi-scale feature sequence is then concatenated sequentially to obtain the multi-scale spatial feature vector of each single event. The multi-scale spatial feature vectors are standardized, and the standardized multi-scale spatial feature vectors are associated with the corresponding historical rainfall events for storage, generating a historical feature database of the spatial distribution of total rainfall.
6. The rainfall similarity matching method based on multi-dimensional feature extraction according to claim 5, characterized in that, For each single rainfall event sequence raster image, multiple convolution operations are performed to extract rainfall event feature vectors, and a historical feature database of rainfall events is generated based on these feature vectors, including: Each single rainfall event sequence raster image is flattened within the corresponding time step and arranged in rows to generate a spatiotemporal representation matrix. Multiple convolutional kernels of different sizes and types are used to perform multiple convolution operations on the spatiotemporal representation matrix to form a second multi-scale feature sequence. The second multi-scale feature sequence is then concatenated sequentially to obtain the spatiotemporal feature vector of rainfall for each single event. The spatiotemporal feature vectors of rainfall are standardized, and the standardized spatiotemporal feature vectors of rainfall are associated with and stored with the corresponding historical rainfall events to generate a historical feature database of rainfall processes.
7. The rainfall similarity matching method based on multi-dimensional feature extraction according to claim 6, characterized in that, When a new rainfall event occurs, the similarity between the spatiotemporal distribution feature vector of the new rainfall event and the historical spatiotemporal distribution feature database of rainfall is calculated, and corresponding historical rainfall events are selected based on the similarity, including: When a new rainfall event occurs, extract the spatial distribution feature vector of the total rainfall of the new rainfall event and the spatiotemporal feature vector of the rainfall of the new rainfall event; Calculate the Euclidean distance between the spatial distribution feature vector of total rainfall of the new rainfall event and the spatial distribution feature vector of total rainfall of historical rainfall events in the historical feature database of rainfall spatiotemporal distribution, and select the historical rainfall events of the first preset number of fields with the closest Euclidean distance to form a primary candidate set; Calculate the cosine distance between the spatiotemporal feature vector of the new rainfall event and the spatiotemporal feature vector of the historical rainfall events in the primary candidate set, and sort the historical rainfall events in the primary candidate set based on the cosine distance to select the historical rainfall events with the highest similarity.
8. The rainfall similarity matching method based on multi-dimensional feature extraction according to claim 7, characterized in that, The method further includes: Based on the most similar historical rainfall events, the risks of new rainfall events are assessed, and corresponding defense strategies are formulated.
9. A rainfall similarity matching device based on multi-dimensional feature extraction, characterized in that, The device includes: The historical rainfall database construction module is used to build a historical rainfall database for the target area; A rainfall spatiotemporal distribution raster map generation module is used to generate a rainfall spatiotemporal distribution raster map based on the historical rainfall database; The module for constructing a historical feature database of spatiotemporal rainfall distribution is used to extract a historical feature database of spatiotemporal rainfall distribution based on the spatiotemporal rainfall distribution raster map. The similarity matching module is used to calculate the similarity between the spatiotemporal distribution feature vector of the new rainfall event and the historical feature database of the spatiotemporal distribution of rainfall based on two-level progressive matching when a new rainfall event occurs, and to filter out the corresponding historical rainfall events based on the similarity.
10. An electronic device, characterized in that, include: A memory and a processor are interconnected, the memory storing computer instructions, and the processor executing the computer instructions to perform the rainfall similarity matching method based on multi-dimensional feature extraction as described in any one of claims 1 to 8.