A method, device and storage medium for generating geological disaster rainfall data

By extracting rainfall data from disaster points from multiple sources of rainfall data sets, the problem of difficulty in obtaining rainfall data in traditional methods is solved, the accuracy and efficiency of the data are improved, and more accurate geological disaster warning is supported.

CN118916570BActive Publication Date: 2025-03-18GUANGZHOU INST OF GEOGRAPHY GUANGDONG ACAD OF SCI +1
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202410959915.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-17
Publication Date
2025-03-18
Estimated Expiration
2044-07-17

AI Technical Summary

Technical Problem

Traditional rainfall data acquisition methods rely on ground meteorological stations, resulting in uneven spatial distribution, difficulty in obtaining data, low accuracy and efficiency, and difficulty in supporting high-precision geological disaster warning models.

Method used

By obtaining the number, occurrence time and geographical coordinates of disaster points, rainfall data is quickly extracted from the multi-source rainfall data set, the target rainfall amount is calculated, and geological disaster rainfall data are generated to establish an early warning model.

Benefits of technology

It improves the accuracy and efficiency of rainfall data, can more accurately support the early warning model of geological disasters, and improves the reliability of disaster warnings.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118916570B_ABST
    Figure CN118916570B_ABST
Patent Text Reader

Abstract

The present invention discloses a method, device and storage medium for generating geological disaster rainfall data, the method comprising: obtaining first disaster point information, the first disaster point information comprising the disaster point number, the disaster occurrence time, and the longitude and latitude of the occurrence place; calculating the rainfall data starting time and the rainfall data ending time according to the disaster occurrence time; calculating the time series according to the rainfall data starting time and the rainfall data ending time, the time series comprising several time points; selecting a time point from the time series to obtain a target time point; calculating the target rainfall amount according to a multi-source rainfall data set, the target time point and the longitude and latitude of the occurrence place; generating the first geological disaster rainfall data according to the disaster point number and multiple target rainfall amounts, the first geological disaster rainfall data being used to establish an early warning model and conduct disaster early warning. The present invention realizes the generation of rainfall data, and improves the accuracy and efficiency. The present invention can be widely applied to the field of geological disaster prevention technology.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of geological disaster prevention, and in particular to a method, device and storage medium for generating geological disaster rainfall data. Background Art

[0002] Slope geological disasters such as landslides and debris flows are closely related to rainfall. The establishment of early warning models requires the support of high-precision rainfall data before disasters occur. At present, the traditional rainfall data acquisition method uses ground meteorological stations to obtain rainfall data at specific locations and specific time periods. However, the spatial distribution of ground meteorological stations is uneven, which makes data acquisition difficult, low in accuracy and low in efficiency.

[0003] In summary, the technical problems existing in the relevant technologies need to be improved. Summary of the invention

[0004] The embodiments of the present invention provide a method, device and storage medium for generating geological disaster rainfall data, which effectively improves accuracy and efficiency.

[0005] On the one hand, an embodiment of the present invention provides a method for generating geological disaster rainfall data, comprising the following steps:

[0006] Acquire first disaster point information, where the first disaster point information includes the disaster point number, disaster occurrence time, and longitude and latitude of the occurrence location;

[0007] According to the disaster occurrence time, calculate the rainfall data starting time and the rainfall data ending time;

[0008] Calculate a time series according to the starting time of the rainfall data and the ending time of the rainfall data, wherein the time series includes a plurality of time points;

[0009] Selecting a time point from the time series to obtain a target time point;

[0010] Calculate the target rainfall amount according to the multi-source rainfall data set, the target time point and the latitude and longitude of the occurrence location;

[0011] According to the disaster point number and the multiple target rainfall amounts, first geological disaster rainfall data is generated, and the first geological disaster rainfall data is used to establish an early warning model and conduct disaster early warning.

[0012] In some embodiments, the calculating the rainfall data starting time and the rainfall data ending time according to the disaster occurrence time includes:

[0013] Convert the disaster occurrence time into a first format to obtain a target occurrence time;

[0014] According to the preset remainder, the target occurrence time is modulo to obtain the time remainder;

[0015] Initialize format time;

[0016] If the time remainder is not greater than 1, subtract the target occurrence time from the time remainder to update the format time;

[0017] If the time remainder is greater than 1, the target occurrence time is added to the preset remaining number, and subtracted from the time remainder to update the format time;

[0018] If the updated format time is not less than 24, update the format time to 0;

[0019] Calculate the starting time of the rainfall data according to the preset advance days and the updated format time;

[0020] The rainfall data end time is calculated based on the preset delay days and the updated format time.

[0021] In some embodiments, the calculating of the time series according to the rainfall data starting time and the rainfall data ending time includes:

[0022] Converting the rainfall data starting time into a second format to obtain a target starting time;

[0023] Performing the second format conversion on the rainfall data end time to obtain a target end time;

[0024] The time series is calculated according to a preset time interval, the target starting time and the target ending time.

[0025] In some embodiments, the calculating the target rainfall amount according to the multi-source rainfall dataset, the target time point and the latitude and longitude of the occurrence location includes:

[0026] In the grid map, a set of adjacent points adjacent to the location of the longitude and latitude of the occurrence site is obtained, wherein the location of the longitude and latitude of the occurrence site is located within a range surrounded by the set of adjacent points, and the set of adjacent points includes a plurality of adjacent points;

[0027] According to the target time point, obtaining a first rainfall amount corresponding to each adjacent point in the adjacent point set from the multi-source rainfall data set through an exception handling strategy;

[0028] Calculate the location distance according to the latitude and longitude of the occurrence location and the latitude and longitude of the nearby point;

[0029] Calculate the total distance based on the multiple position distances;

[0030] The target rainfall is calculated according to the first rainfall, the location distance and the total distance.

[0031] In some embodiments, generating the first geological disaster rainfall data according to the disaster point number and the multiple target rainfall amounts includes:

[0032] Combining multiple target rainfall amounts to obtain a rainfall amount set;

[0033] The first geological disaster rainfall data is generated according to the rainfall set, the disaster point number, the disaster occurrence time and the longitude and latitude of the occurrence location.

[0034] In some embodiments, the method further comprises:

[0035] Obtaining the second disaster point information;

[0036] According to the preset number of central processors, a plurality of the second disaster point information are processed in parallel through a preset multi-process library to obtain corresponding second geological disaster rainfall data;

[0037] Combine multiple pieces of the second geological disaster rainfall data to obtain a geological disaster rainfall data set.

[0038] In some embodiments, the method further comprises:

[0039] Get checkpoint file information;

[0040] Extracting the disaster point processing progress from the checkpoint file information;

[0041] According to the progress of the disaster point processing, the third disaster point information is obtained, and the third disaster point information is used to generate the third geological disaster rainfall data.

[0042] In some embodiments, the calculating the target rainfall amount according to the first rainfall amount, the location distance and the total distance comprises:

[0043] The target rainfall is calculated according to the first rainfall, the location distance and the total distance using a target rainfall calculation formula, and the target rainfall calculation formula is:

[0044]

[0045] Where P is the target rainfall, L i is the position distance of the i-th adjacent point, L n is the total distance, N is the total number of adjacent points, Q i is the first rainfall at the i-th nearby point.

[0046] On the other hand, an embodiment of the present invention provides a device for generating geological disaster rainfall data, comprising:

[0047] The first module is used to obtain first disaster point information, where the first disaster point information includes the disaster point number, disaster occurrence time, and longitude and latitude of the occurrence location;

[0048] The second module is used to calculate the starting time of rainfall data and the ending time of rainfall data according to the time when the disaster occurs;

[0049] The third module is used to calculate a time series according to the starting time of the rainfall data and the ending time of the rainfall data, wherein the time series includes a plurality of time points;

[0050] The fourth module is used to select a time point from the time series to obtain a target time point;

[0051] The fifth module is used to calculate the target rainfall amount according to the multi-source rainfall data set, the target time point and the latitude and longitude of the occurrence location;

[0052] The sixth module is used to generate the first geological disaster rainfall data according to the disaster point number and multiple target rainfall amounts. The first geological disaster rainfall data is used to establish an early warning model and conduct disaster early warning.

[0053] On the other hand, an embodiment of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method described above is implemented.

[0054] The beneficial effects of the present invention are as follows:

[0055] The present invention first obtains the first disaster point information, and then calculates the starting time and the ending time of the rainfall data according to the disaster occurrence time, and calculates the time series according to the starting time and the ending time of the rainfall data, and then selects a time point from the time series to obtain the target time point, and calculates the target rainfall according to the multi-source rainfall data set, the target time point and the longitude and latitude of the occurrence place, and finally generates the first geological disaster rainfall data according to the disaster point number and multiple target rainfalls, thereby realizing the generation of rainfall data at the disaster point and improving accuracy and efficiency.

[0056] Other features and advantages of the present invention will be described in the following description, and partly become apparent from the description, or understood by practicing the present invention. The purpose and other advantages of the present invention can be realized and obtained by the structures particularly pointed out in the description and the drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0057] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0058] Figure 1 This is a flow chart of a method for generating geological disaster rainfall data according to an embodiment of the present invention;

[0059] Figure 2 A schematic diagram of an overall process of generating rainfall data according to an embodiment of the present invention;

[0060] Figure 3 The present invention is a schematic structural diagram of a device for generating geological disaster rainfall data according to an embodiment of the present invention. DETAILED DESCRIPTION

[0061] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application is further described in detail below in conjunction with the accompanying drawings and examples. It should be understood that the specific embodiments described herein are only used to explain the present application and are not intended to limit the present application. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the embodiments of the present application. They are only examples of devices and methods consistent with some aspects of the embodiments of the present application as detailed in the attached claims.

[0062] It is understood that the terms "first", "second", etc. used in this application can be used to describe various concepts in this article, but unless otherwise specified, these concepts are not limited by these terms. These terms are only used to distinguish one concept from another concept. For example, without departing from the scope of the embodiment of the present application, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the words "if" and "if" as used herein can be interpreted as "at the time of" or "when" or "in response to determination".

[0063] The terms "at least one", "multiple", "each", "any", etc. used in this application, at least one includes one, two or more, multiple includes two or more, each refers to each of the corresponding multiple, and any refers to any one of the multiple.

[0064] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.

[0065] Before describing the embodiments of the present application in detail, some nouns and terms involved in the embodiments of the present application are first described. The nouns and terms involved in the embodiments of the present application are subject to the following explanations.

[0066] Multi-Source Weighted-Ensemble Precipitaton (MSWEP): is a high-resolution, globally covered precipitation data product that integrates precipitation information from multiple sources, including satellite remote sensing data, radar observations, ground meteorological station observations, and the output of numerical weather prediction models. MSWEP aims to provide more accurate global precipitation estimates with higher temporal and spatial resolution, filling the gaps in coverage, accuracy, and timeliness of traditional single data sources. MSWEP datasets usually have a temporal resolution of hours or days, and a spatial resolution of up to 0.1 degrees (about 10 kilometers) at the grid scale, covering the world's land and oceans. This high resolution and global coverage make MSWEP an important data source in many fields such as climate research, hydrological modeling, and disaster risk assessment.

[0067] In related technologies, slope geological disasters such as landslides and mud-rock flows are closely related to rainfall. Accurately obtaining rainfall data before a disaster occurs is of great significance for studying the relationship between rainfall and geological disasters and establishing early warning models. At present, obtaining rainfall data at a specific location and a specific time period often depends on ground meteorological stations, which have problems such as uneven spatial distribution and difficulty in data acquisition. The global rainfall dataset (i.e., multi-source rainfall dataset) MSWEP provides rainfall data with high temporal and spatial resolution, but how to quickly and accurately extract rainfall data at specific disaster points from it remains a challenge.

[0068] To solve the above problems, the present invention provides a method, device and storage medium for generating rainfall data of geological disasters, which can quickly extract rainfall data corresponding to the disaster point from the MSWEP data set according to the number, occurrence time and geographical coordinates of the disaster point, thereby realizing the generation of rainfall data of the disaster point and improving accuracy and efficiency.

[0069] A method for generating geological disaster rainfall data provided by an embodiment of the present application relates to the field of geological disaster prevention technology. A method for generating geological disaster rainfall data provided by an embodiment of the present application can be applied to a terminal, can be applied to a server, or can be software running in a terminal or a server. In some embodiments, the terminal can be a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart speaker, a smart watch, and a car terminal, etc., but is not limited to this; the server side can be configured as an independent physical server, or a server cluster or distributed system composed of multiple physical servers, and can also be configured to provide cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms and other basic cloud computing services. The server can also be a node server in a blockchain network; the software can be an application that implements a method for generating geological disaster rainfall data, etc., but is not limited to the above forms.

[0070] The present application can be used in many general or special computer system environments or configurations. For example: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, etc. The present application can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. The present application can also be practiced in distributed computing environments, in which tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media including storage devices.

[0071] The following is a detailed explanation of the embodiments of the present application in conjunction with the accompanying drawings:

[0072] Figure 1 is an optional flow chart of a method for generating geological disaster rainfall data provided by an embodiment of the present application. Figure 1 The method may include but is not limited to steps S101 to S106.

[0073] Step S101, obtaining first disaster point information, the first disaster point information including the disaster point number, disaster occurrence time, and longitude and latitude of the occurrence location;

[0074] Step S102, calculating the rainfall data starting time and rainfall data ending time according to the disaster occurrence time;

[0075] Step S103, calculating a time series according to the starting time of the rainfall data and the ending time of the rainfall data, where the time series includes a number of time points;

[0076] Step S104, selecting a time point from the time series to obtain a target time point;

[0077] Step S105, calculating the target rainfall amount according to the multi-source rainfall data set, the target time point and the latitude and longitude of the occurrence location;

[0078] Step S106: Generate first geological disaster rainfall data according to the disaster point number and multiple target rainfall amounts. The first geological disaster rainfall data is used to establish an early warning model and perform disaster early warning.

[0079] Steps S101 to S106 shown in the embodiment of the present application realize the generation of rainfall data at the disaster point, thereby improving accuracy and efficiency.

[0080] In some embodiments, in step S101, the first disaster point information can be obtained by reading the disaster point information file. The first disaster point information can also be obtained by other means, not limited to this. Among them, the first disaster point information may include the disaster point number, the disaster occurrence time, and the longitude and latitude of the occurrence place. Exemplarily, the pandas library in the Python language can be used to read the CSV data file containing the disaster point information to obtain the disaster point number, the disaster occurrence time, and the longitude and latitude of the occurrence place. The code language can be expressed as: crd = pd.read_csv ('disaster point data file path.csv'); df = crd[['ID', 'OccTime', 'x', 'y']], where 'ID' is the disaster point number (integer), 'OccTime' is the disaster occurrence time (date and time format), 'x' is the longitude (floating point number), and 'y' is the latitude (floating point number).

[0081] In some embodiments, in step S102, according to the disaster occurrence time, calculating the rainfall data starting time and the rainfall data ending time may include but is not limited to the following steps:

[0082] Convert the disaster occurrence time into the first format to obtain the target occurrence time;

[0083] According to the preset remainder, the target occurrence time is modulo to obtain the time remainder;

[0084] Initialize format time;

[0085] If the time remainder is not greater than 1, subtract the target occurrence time from the time remainder to update the format time;

[0086] If the time remainder is greater than 1, add the target occurrence time to the preset remainder, and subtract it from the time remainder to update the format time;

[0087] If the updated format time is not less than 24, the updated format time is 0;

[0088] Calculate the starting time of rainfall data based on the preset advance days and the updated format time;

[0089] Calculate the end time of rainfall data based on the preset delay days and the updated format time.

[0090] In some embodiments, the disaster occurrence time can be first converted to a first format, and the disaster occurrence time can be converted to a standard date and time format to obtain the target occurrence time. Exemplarily, the disaster occurrence time in the 'OccTime' column can be converted to a datetime format to obtain the target occurrence time. The code language can be expressed as: df['OccTime'] = pd.to_datetime(df['OccTime'], format = 'mixed'). Then, according to the preset remainder, the target occurrence time is calculated to obtain the time remainder. Exemplarily, the preset remainder can be set to 3. The code language can be expressed as: remainder = hour%3. Reinitialize the format time, and determine whether the time remainder is greater than 1. If the time remainder is not greater than 1, that is, remainder<=1, then subtract the target occurrence time from the time remainder to update the format time. The code language can be expressed as: new_hour = hour-remainder. If the time remainder is greater than 1, that is, remainder>1, the target occurrence time is added to the preset remainder, and subtracted from the time remainder to update the format time. The code language can be expressed as: new_hour=hour+(3-remainder). Then the updated format time is judged. If the updated format time is not less than 24, that is, new_hour>=24, the updated format time is 0. The code language can be expressed as: new_hour=0. It can be understood that by updating the format time, the time can be adjusted to the 3-hour interval of the MSWEP dataset, so that the extracted time point accurately matches the time resolution of the MSWEP dataset, ensuring the accuracy and consistency of data extraction. Finally, according to the preset advance days and the updated format time, the starting time of the rainfall data is calculated, and the end time of the rainfall data is calculated according to the preset delay days and the updated format time. For example, the preset advance days can be set to 15, the preset delay days can be set to 3, and the updated format time can be subtracted from the preset advance days set to 15, that is, the time is advanced by 15 days to obtain the starting time of the rainfall data, and the updated format time can be subtracted from the preset delay days, that is, the time is delayed by 3 days to obtain the end time of the rainfall data. The code language can be expressed as: df['NEW_OccTime'] = df['OccTime'].apply(get_nearest_multiple_time) + timedelta(days = 3); df['StartTime'] = df['NEW_OccTime'] - timedelta(days = 15). It can be understood that the start and end time of rainfall data extraction is usually calculated from 15 days before the disaster to 3 days after the disaster.

[0091] In some embodiments, in step S103, the time series is calculated according to the rainfall data starting time and the rainfall data ending time, which may include but is not limited to the following steps:

[0092] Convert the rainfall data start time into the second format to obtain the target start time;

[0093] Convert the rainfall data endpoint time into a second format to obtain a target endpoint time;

[0094] Calculate the time series based on the preset time interval, target start time, and target end time.

[0095] In some embodiments, the rainfall data start time and the rainfall data end time can be converted into the format required by the MSWEP data set. The rainfall data start time can be first converted to the second format to obtain the target start time. The code language can be expressed as: df['StartTime_DOY'] = df['StartTime'].dt.strftime('%Y%j'); df['StartTime_HH'] = df['StartTime'].dt.strftime('%H'); df['STA_YYYYDOY_HH_NC'] = df['StartTime_DOY'].str[:8]+'.'+df['StartTime_HH'].str.pad(2,fillchar='0')+'.nc'. And the rainfall data end time is converted to the second format to obtain the target end time. The code language can be expressed as: df['NEW_OccTime_DOY'] = df['NEW_OccTime'].dt.strftime('%Y%j'); df['NEW_OccTime_HH'] = df['NEW_OccTime'].dt.strftime('%H'); df['OCC_YYYYDOY_HH_NC'] = df['NEW_OccTime_DOY'].str[:8]+'.'+df['NEW_OccTime_HH'].str.pad(2,fillchar='0')+'.nc'. Among them, the time format after ('%Y%j') transformation is the year plus the day of the year, such as: January 1, 2024 is transformed into 2024001, and June 27, 2024 is transformed into 2024178; the format after ('%H') transformation is the hour of the day, such as 00:00:00 is transformed into: 00, and 09:00:00 is transformed into: 09; According to these two time format transformations, the time format after (YYYYDOY_HH_NC) transformation is [2024178.09.nc], which refers to the nc file at 9 o'clock on the 178th day (June 27) of 2024. Finally, the time series is calculated according to the preset time interval, the target start time and the target end time. Among them, the time series includes several time points, and each time point corresponds to a file name in the MSWEP dataset. Among them, for each disaster point, a time series is generated based on its StartTime and NEW_OccTime. For example, the preset time interval may be set to 3 hours, which is consistent with the time resolution of the MSWEP dataset. Between the target start time and the target end time, a time point is generated every 3 hours, and the generated multiple time points are combined to obtain a time series.The code language can be expressed as: occ_time = pd.to_datetime (row ['NEW_OccTime']); sta_time = pd.to_datetime (row ['StartTime']); time_series = pd.date_range (start = sta_time, end = occ_time, freq = '3H'). Mathematically expressed as: time series T = {t | sta_time ≤ t ≤ occ_time, t = sta_time + 3nhours,. }. Each t is formatted as 'YYYYDDD.HH.nc', where YYYY is the year, DDD is the day of the year, and HH is the hour. It is understandable that the data extraction time range for each disaster point can be flexibly set (such as 15 days before to 3 days after the disaster occurs). This flexibility allows this embodiment to adapt to different research needs and analysis scenarios.

[0096] In some embodiments, in step S104, a time point may be selected from the time series to obtain a target time point. This embodiment uses a time point as an example for calculation, and the same calculation process may be used to calculate each time point in the time series to obtain the corresponding rainfall. According to the generated time series, time points may be selected one by one and the corresponding MSWEP data files may be opened, wherein each MSWEP data file contains the location information and rainfall of all detection points at the time point, wherein the location information includes longitude and latitude.

[0097] In some embodiments, in step S105, the target rainfall amount is calculated according to the multi-source rainfall data set, the target time point and the latitude and longitude of the occurrence location, which may include but is not limited to the following steps:

[0098] In the grid map, a set of adjacent points adjacent to the location where the longitude and latitude of the occurrence place are located is obtained, and the location where the longitude and latitude of the occurrence place are located is within the range surrounded by the set of adjacent points, and the set of adjacent points includes multiple adjacent points;

[0099] According to the target time point, the first rainfall amount corresponding to each adjacent point in the adjacent point set is obtained from the multi-source rainfall dataset through the exception handling strategy;

[0100] Calculate the location distance based on the latitude and longitude of the occurrence location and the latitude and longitude of the nearby points;

[0101] Calculate the total distance based on multiple position distances;

[0102] The target rainfall is calculated based on the first rainfall, the location distance and the total distance.

[0103] In some embodiments, the adjacent point set adjacent to the location of the longitude and latitude of the occurrence place can be obtained in the grid map first. Wherein, the location of the longitude and latitude of the occurrence place is located in the range surrounded by the adjacent point set, and the adjacent point set can include multiple adjacent points. Exemplarily, in the grid map, every four adjacent points form a grid, and the adjacent points are located at the four corners of the grid respectively. The location of the longitude and latitude of the occurrence place is located within the grid, and these four adjacent points can be combined into an adjacent point set. Then according to the target time point, the first rainfall corresponding to each adjacent point in the adjacent point set is obtained from the multi-source rainfall data set through the exception handling strategy. Exemplarily, the position information and the first rainfall corresponding to four adjacent points in the adjacent point set at the target time point can be extracted in the multi-source rainfall data set (i.e., MSWEP data file). It is understandable that the exception handling strategy can handle possible file reading or data processing errors by using try-except blocks. The error message will be printed out, but the entire processing process will not be interrupted. According to the longitude and latitude of the occurrence place and the longitude and latitude of the adjacent point, the position distance is calculated again. For example, the distance between points can be calculated by the Pythagorean theorem to obtain the corresponding position distance between the location of the latitude and longitude of the occurrence site and each adjacent point. Then, based on multiple position distances, the corresponding position distance between the location of the latitude and longitude of the occurrence site and each adjacent point is added to obtain the total distance. Finally, based on the first rainfall, the position distance and the total distance, the target rainfall calculation formula is used to calculate the target rainfall. The target rainfall calculation formula is: Where P is the target rainfall, L is i is the position distance of the i-th adjacent point, L n is the total distance, N is the total number of adjacent points, Q i is the first rainfall of the i-th nearby point. It can be understood that the use of the global rainfall dataset (i.e., multi-source rainfall dataset) MSWEP as the data source overcomes the limitation of uneven spatial distribution of traditional ground meteorological station data, so that this embodiment can provide rainfall data with high temporal and spatial resolution for disaster points in any geographical location. At the same time, the nearest neighbor weighted interpolation method is used to calculate the rainfall data of a specific geographical location from the raster data, which provides reasonable spatial accuracy while ensuring efficiency.

[0104] In some embodiments, in step S106, generating first geological disaster rainfall data according to the disaster point number and multiple target rainfall amounts may include but is not limited to the following steps:

[0105] Combine multiple target rainfall amounts to obtain a rainfall set;

[0106] The first geological disaster rainfall data is generated based on the rainfall set, disaster point number, disaster occurrence time and longitude and latitude of the occurrence location.

[0107] In some embodiments, multiple target rainfall amounts can be combined to obtain a rainfall set, and then the first geological disaster rainfall data can be generated according to the rainfall set, the disaster point number, the disaster occurrence time and the longitude and latitude of the occurrence place. Among them, the first geological disaster rainfall data can be used to establish an early warning model and perform disaster early warning. Exemplarily, for the same disaster point, the target rainfall amount corresponding to each time point in the time series can be combined to obtain a rainfall set, and then the disaster point number, the disaster occurrence time, the longitude and latitude of the occurrence place are associated with the rainfall set to obtain the first geological disaster rainfall data. Among them, the first geological disaster rainfall data can include the disaster point number disapoint (corresponding to the input ID), the disaster occurrence time OccTime (date time format), the time point time of the rainfall data (date time format), the longitude lon (floating point number), the latitude lat (floating point number), and the rainfall precipitation (floating point number, the unit is defined according to the MSWEP data set). More, the first geological disaster rainfall data can be output as a file record, the processing result can be converted into a pandas DataFrame, the to_csv method can be used to append the data to the output file, and it can be saved as a structured CSV file for subsequent analysis and use. If the output file does not exist, write the header; if it already exists, only append the data. The code language can be expressed as: pd.DataFrame(results).to_csv(output_file,mode='a',header=notos.path.exists(output_file),index=False). It can be understood that the calculated first geological disaster rainfall data is associated with the disaster point information (such as the disaster point number ID, the time of the disaster, and the longitude and latitude of the place of occurrence) to form a structured output, making subsequent data analysis and model building more convenient. At the same time, the extracted data is output in a standardized CSV format to facilitate further use by other systems or analysis tools, thereby improving data interoperability.

[0108] In some embodiments, the method further comprises:

[0109] Obtaining the second disaster point information;

[0110] According to the preset number of central processors, multiple pieces of second disaster point information are processed in parallel through a preset multi-process library to obtain corresponding second geological disaster rainfall data;

[0111] Multiple second geological disaster rainfall data are combined to obtain the geological disaster rainfall data set.

[0112] In some embodiments, the second disaster point information can be obtained first, and then according to the preset number of central processing units, the plurality of second disaster point information can be processed in parallel through the preset multi-process library to obtain the corresponding second geological disaster rainfall data. Exemplarily, a process pool can be created using Python's multiprocessing multi-process library, the number of processes can be set to the number of CPU central processing units to maximize the use of computing resources, and the imap method in the multi-process library can be used to implement parallel processing of tasks, each task corresponding to the extraction of rainfall data at a disaster point. Finally, the plurality of second geological disaster rainfall data can be combined to obtain a geological disaster rainfall data set. The code language can be expressed as: with mp.Pool(processes=mp.cpu_count())as pool:for i,row_results in enumerate(tqdm(pool.imap(process_row,[(row,dir)for row in data_dicts]),total=len(data_dicts))):results.extend(row_results). It can be understood that the use of parallel processing technology and the use of multiple processes to simultaneously process data extraction tasks for multiple disaster points significantly improves the efficiency of large-scale data processing, so that the method of this embodiment can be applied to scenarios containing a large number of disaster points.

[0113] In some embodiments, the method further comprises:

[0114] Get checkpoint file information;

[0115] Extract the disaster point processing progress from the checkpoint file information;

[0116] According to the progress of disaster point processing, the third disaster point information is obtained, and the third disaster point information is used to generate the third geological disaster rainfall data.

[0117] In some embodiments, before starting the processing, it is possible to first check whether there is a checkpoint file. If so, the checkpoint file information is obtained, and the progress of the disaster point processing is extracted from the checkpoint file information, that is, the position of the last processing is extracted, and the processing is continued from this position. The mathematical expression is: current processing position = max (0, the processing position of the last record). Then, according to the progress of the disaster point processing, the third disaster point information is obtained. Among them, the third disaster point information can be used to generate the third geological disaster rainfall data. The code language can be expressed as: if os.path.exists (checkpoint_file): with open (checkpoint_file, 'r') as f: last_processed = int (f.read().strip()); data = data.iloc [last_processed:]; else: last_processed = 0. In addition, during the disaster point processing process, the progress can be saved regularly, and the checkpoint file can be updated and the processed results can be saved every 100 disaster points. The mathematical expression of the checkpoint update condition is: (i + 1) mod 100 = 0. The code language can be expressed as: if (i+1)%100==0: pd.DataFrame(results).to_csv(output_file, mode='a', header=notos.path.exists(output_file), index=False); results=[]; with open(checkpoint_file,'w')as f: f.write(str(last_processed+i+1)). It can be understood that this embodiment implements a checkpoint mechanism that can periodically save the processing progress and support continuing execution from the last processing position after the task is interrupted, which greatly improves the reliability and robustness of long-running tasks and is suitable for processing large-scale data sets.

[0118] In some embodiments, since there are version differences in the multi-source rainfall dataset MSWEP before and after 2020, the data before and after the version difference can be distinguished. The data can be divided into two parts according to the time of disaster occurrence: after 2020 and before 2020. The code language can be expressed as: data_after_2020 = df[df['OccTime'].dt.year>2020]; data_before_2020 = df[df['OccTime'].dt.year<=2020]. Then the get_rain_data function is called to process these two parts of data respectively, and different data directories (adir and bdir) are used to match the MSWEP data file locations of different periods. The code language can be expressed as: get_rain_data(data_after_2020,adir,output_file,checkpoint_file); get_rain_data(data_before_2020,bdir,output_file,checkpoint_file). It can be understood that by distinguishing the data processing before and after 2020, possible version differences or storage location changes of the MSWEP dataset are adapted, enhancing the long-term applicability of the method.

[0119] In some embodiments, the overall process of generating rainfall data is as follows: Figure 2 As shown in the figure, the disaster point data can be read first, and the time format conversion and time range calculation can be performed. Then a 3-hour interval sequence can be generated, and the MSWEP file name format can be converted. Then the MSWEP data file can be opened, and the nearest interpolation method can be used to extract data and associate the disaster point information. Finally, it is determined whether there are more disaster points. If there are no more disaster points, the results are output to obtain the geological disaster rainfall data; otherwise, the next batch of disaster points are processed in parallel, thereby improving the disaster point processing efficiency through parallel processing. When the processing starts, the processing continues from the last processing position. When the preset number of disaster points is processed, the checkpoint is updated, so that the processing progress is saved through the breakpoint continuation mechanism, thereby improving the efficiency of rainfall data generation.

[0120] The beneficial effects of implementing the embodiment of the present invention include: the embodiment of the present invention first obtains the first disaster point information, then calculates the rainfall data starting time and the rainfall data ending time according to the disaster occurrence time, and calculates the time series according to the rainfall data starting time and the rainfall data ending time, and then selects a time point from the time series to obtain the target time point, and calculates the target rainfall amount according to the multi-source rainfall data set, the target time point and the latitude and longitude of the occurrence place, and finally generates the first geological disaster rainfall data according to the disaster point number and multiple target rainfall amounts, thereby realizing the generation of rainfall data at the disaster point, and improving the accuracy and efficiency. At the same time, this embodiment is not only applicable to slope-type geological disasters, but also can be applied to more geological studies that require historical rainfall data. This embodiment has significant advantages in processing large-scale, high-resolution rainfall data extraction tasks, especially in terms of efficiency, reliability and applicability. This has important practical application value for geological disaster research, early warning system development and other related fields. In addition, this embodiment not only overcomes the limitation of uneven spatial distribution of traditional ground meteorological station data, but also supports batch processing of large-scale disaster point data, and has good fault tolerance and recoverability, and is suitable for large-scale data processing tasks that run for a long time.

[0121] like Figure 3 As shown, the embodiment of the present invention also provides a geological disaster rainfall data generation device, including:

[0122] The first module 801 is used to obtain first disaster point information, where the disaster point information includes the disaster point number, disaster occurrence time, and the longitude and latitude of the occurrence location;

[0123] The second module 802 is used to calculate the starting time of rainfall data and the ending time of rainfall data according to the disaster occurrence time;

[0124] The third module 803 is used to calculate a time series according to the starting time of the rainfall data and the ending time of the rainfall data, and the time series includes a plurality of time points;

[0125] The fourth module 804 is used to select a time point from the time series to obtain a target time point;

[0126] The fifth module 805 is used to calculate the target rainfall amount according to the multi-source rainfall data set, the target time point and the latitude and longitude of the occurrence location;

[0127] The sixth module 806 is used to generate the first geological disaster rainfall data according to the disaster point number and multiple target rainfall amounts. The first geological disaster rainfall data is used to establish an early warning model and conduct disaster early warning.

[0128] The contents of the above method embodiments are all applicable to the present device embodiments. The functions specifically implemented by the present device embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.

[0129] The embodiment of the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, Figure 1 The method shown.

[0130] The contents of the above method embodiments are all applicable to the present storage medium embodiments. The functions specifically implemented by the present storage medium embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.

[0131] The preferred embodiments of the present invention are described above with reference to the accompanying drawings, but the scope of the rights of the present invention is not limited thereto. Any modification, equivalent substitution and improvement made by a person skilled in the art without departing from the scope and essence of the present invention should be within the scope of the rights of the present invention.

Claims

1. A method for generating geological disaster rainfall data, characterized in that: The following steps are involved: Acquire first disaster point information, where the first disaster point information includes the disaster point number, disaster occurrence time, and longitude and latitude of the occurrence location; According to the disaster occurrence time, calculate the rainfall data starting time and the rainfall data ending time; Calculate a time series according to the starting time of the rainfall data and the ending time of the rainfall data, wherein the time series includes a plurality of time points; Selecting a time point from the time series to obtain a target time point; Calculate the target rainfall amount according to the multi-source rainfall data set, the target time point and the latitude and longitude of the occurrence location; Generate first geological disaster rainfall data according to the disaster point number and the multiple target rainfall amounts, wherein the first geological disaster rainfall data is used to establish an early warning model and conduct disaster early warning; The step of calculating the starting time and the ending time of rainfall data according to the disaster occurrence time includes: Convert the disaster occurrence time into a first format to obtain a target occurrence time; According to the preset remainder, the target occurrence time is modulo to obtain the time remainder; Initialize format time; If the time remainder is not greater than 1, subtract the target occurrence time from the time remainder to update the format time; If the time remainder is greater than 1, the target occurrence time is added to the preset remaining number, and subtracted from the time remainder to update the format time; If the updated format time is not less than 24, update the format time to 0; Calculate the starting time of the rainfall data according to the preset advance days and the updated format time; Calculate the end time of the rainfall data according to the preset delay days and the updated format time; The step of calculating the target rainfall amount according to the multi-source rainfall data set, the target time point and the latitude and longitude of the occurrence location includes: In the grid map, a set of adjacent points adjacent to the location where the longitude and latitude of the occurrence place are located is obtained, the location where the longitude and latitude of the occurrence place are located is within the range surrounded by the set of adjacent points, and the set of adjacent points includes a plurality of adjacent points; According to the target time point, obtaining a first rainfall amount corresponding to each adjacent point in the adjacent point set from the multi-source rainfall data set through an exception handling strategy; Calculate the location distance according to the latitude and longitude of the occurrence location and the latitude and longitude of the nearby point; Calculate the total distance based on the multiple position distances; The target rainfall is calculated according to the first rainfall, the location distance and the total distance.

2. The method according to claim 1, characterized in that: The calculating of the time series according to the starting time of the rainfall data and the ending time of the rainfall data comprises: Converting the rainfall data starting time into a second format to obtain a target starting time; Performing the second format conversion on the rainfall data end time to obtain a target end time; The time series is calculated according to a preset time interval, the target starting time and the target ending time.

3. The method according to claim 1, characterized in that The step of generating first geological disaster rainfall data according to the disaster point number and the plurality of target rainfall amounts includes: Combining multiple target rainfall amounts to obtain a rainfall amount set; The first geological disaster rainfall data is generated according to the rainfall set, the disaster point number, the disaster occurrence time and the longitude and latitude of the occurrence location.

4. The method according to claim 1, characterized in that The method further comprises: Obtaining the second disaster point information; According to the preset number of central processors, multiple pieces of the second disaster point information are processed in parallel through a preset multi-process library to obtain corresponding second geological disaster rainfall data; Combine multiple pieces of the second geological disaster rainfall data to obtain a geological disaster rainfall data set.

5. The method according to claim 1, characterized in that The method further comprises: Get checkpoint file information; Extracting the disaster point processing progress from the checkpoint file information; According to the progress of the disaster point processing, the third disaster point information is obtained, and the third disaster point information is used to generate the third geological disaster rainfall data.

6. The method according to claim 1, characterized in that The step of calculating the target rainfall amount according to the first rainfall amount, the location distance and the total distance comprises: The target rainfall is calculated according to the first rainfall, the location distance and the total distance using a target rainfall calculation formula, and the target rainfall calculation formula is: In the formula, is the target rainfall, For the i The distance between the positions of adjacent points, is the total distance, is the total number of adjacent points, For the i The first rainfall amount at a nearby point.

7. A device for generating geological disaster rainfall data, characterized in that: include: The first module is used to obtain first disaster point information, where the first disaster point information includes the disaster point number, disaster occurrence time, and longitude and latitude of the occurrence location; The second module is used to calculate the starting time of rainfall data and the ending time of rainfall data according to the time when the disaster occurs; The third module is used to calculate a time series according to the starting time of the rainfall data and the ending time of the rainfall data, wherein the time series includes a plurality of time points; The fourth module is used to select a time point from the time series to obtain a target time point; The fifth module is used to calculate the target rainfall amount according to the multi-source rainfall data set, the target time point and the latitude and longitude of the occurrence location; The sixth module is used to generate first geological disaster rainfall data according to the disaster point number and the multiple target rainfall amounts, wherein the first geological disaster rainfall data is used to establish an early warning model and conduct disaster early warning; The step of calculating the starting time and the ending time of rainfall data according to the disaster occurrence time includes: Convert the disaster occurrence time into a first format to obtain a target occurrence time; According to the preset remainder, the target occurrence time is modulo to obtain the time remainder; Initialize format time; If the time remainder is not greater than 1, subtract the target occurrence time from the time remainder to update the format time; If the time remainder is greater than 1, the target occurrence time is added to the preset remaining number, and subtracted from the time remainder to update the format time; If the updated format time is not less than 24, update the format time to 0; Calculate the starting time of the rainfall data according to the preset advance days and the updated format time; Calculate the end time of the rainfall data according to the preset delay days and the updated format time; The step of calculating the target rainfall amount according to the multi-source rainfall data set, the target time point and the latitude and longitude of the occurrence location includes: In the grid map, a set of adjacent points adjacent to the location where the longitude and latitude of the occurrence place are located is obtained, the location where the longitude and latitude of the occurrence place are located is within the range surrounded by the set of adjacent points, and the set of adjacent points includes a plurality of adjacent points; According to the target time point, obtaining a first rainfall amount corresponding to each adjacent point in the adjacent point set from the multi-source rainfall data set through an exception handling strategy; Calculate the location distance according to the latitude and longitude of the occurrence location and the latitude and longitude of the nearby point; Calculate the total distance based on the multiple position distances; The target rainfall is calculated according to the first rainfall, the location distance and the total distance.

8. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.

Citation Information

Patent Citations

  • Disaster susceptibility prediction method based on rainfall

    CN111539904A