Urban waterlogging-prone point water accumulation prediction method, system and device based on LSTM (Long Short Term Memory)

This paper proposes an LSTM-based method for predicting waterlogging in urban flood-prone areas. This method addresses the issue of low accuracy in existing waterlogging prediction models by using rainy day assessment, water depth data processing, and time series reconstruction to construct high-quality time-series features, thereby achieving high-precision waterlogging prediction and supporting urban flood control decision-making.

CN121860127APending Publication Date: 2026-04-14HEFEI ZEZHONG CITY INTELLIGENT TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-24
Publication Date
2026-04-14

AI Technical Summary

Technical Problem

In existing technologies, urban flood-prone areas waterlogging prediction models suffer from low accuracy due to one-sided feature factor design, small sample data quantity and poor quality, and severe noise interference.

Method used

An LSTM-based method for predicting urban flood-prone areas is adopted. By acquiring historical water depth and rainfall monitoring data, rainy day assessment, water depth data processing, and time series reconstruction are performed to construct time series features. The LSTM model is then used for water accumulation prediction, including rainy day assessment, water depth data processing, and time series reconstruction operations, to ensure data quality and time series consistency.

Benefits of technology

It significantly improves the accuracy and robustness of waterlogging prediction, accurately captures the nonlinear temporal dependencies of waterlogging formation, overcomes the mapping bias caused by missing features and low data quality, and provides reliable support for urban flood control decision-making.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121860127A_ABST
    Figure CN121860127A_ABST
Patent Text Reader

Abstract

The invention discloses an urban waterlogging-prone point waterlogging prediction method, system and device based on LSTM, relates to the technical field of artificial intelligence, and solves the problems that in the prior art, due to the fact that feature factor design is one-sided, waterlogging formation rules are difficult to comprehensively reflect, meanwhile, sample data are small in quantity, poor in quality and serious in noise interference, and the accuracy of waterlogging prediction is poor. And the accuracy of the ponding prediction model is low. Rainfall ponding time sequence data are determined through multiple data processing operations, and a ponding prediction model is constructed based on the rainfall ponding time sequence data; time sequence features are determined based on rainfall monitoring data and forecast rainfall data and input into a ponding prediction model to obtain predicted ponding depth, a prediction result is dynamically corrected by using a teacher forced strategy, inferior monitoring data is converted into a high-quality training sample, the problems of data noise interference and sample effectiveness are solved, and the prediction accuracy is improved. The model captures physical rules formed by ponding and can dynamically correct the physical rules, the defect that an existing model is low in accuracy due to one-sided features and poor data quality is overcome, and reliable support is provided for flood prevention decision making.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the field of artificial intelligence technology, specifically a method, system, and device for predicting waterlogging in urban flood-prone areas based on LSTM. Background Technology

[0002] Driven by both climate change and accelerated urbanization, urban flooding has become a critical risk threatening public safety and urban operations. Short-duration heavy rainfall can easily paralyze roads and flood underground spaces. It is noteworthy that urban flooding is not randomly distributed but exhibits significant spatial clustering: rainwater often follows the micro-topographical slopes of roads to converge in low-lying areas, forming fixed flood-prone spots that are prone to flooding during rain. These spots are typically concentrated in key areas such as areas covered by aging pipe networks, underpasses and tunnels, and low-lying road sections.

[0003] Targeted flood forecasting across an entire city requires processing massive amounts of data on the underlying surface, pipe networks, and topography. This not only results in high computational costs and slow response times, but also leads to a waste of resources, as most areas have an extremely low probability of flooding. In contrast, precise forecasting focusing on fixed flood-prone areas is more practically valuable: firstly, the locations of these areas are relatively stable, allowing for the establishment of a characteristic database through long-term monitoring; secondly, targeted forecasting eliminates the need for redundant data processing, significantly improving computational efficiency and providing rapid and efficient technical support for flood control decision-making, aligning with the practical needs of urban drainage emergency management to focus on key areas and control critical points.

[0004] Existing flood prediction models based on machine learning and deep learning suffer from low accuracy and lack dynamic correction due to the one-sided design of feature factors, which makes it difficult to fully reflect the formation pattern of floodwater. In addition, the sample data is small in quantity, poor in quality, and subject to serious noise interference. Therefore, further improvements are needed for flood prediction methods in urban flood-prone areas. Summary of the Invention

[0005] This application aims to address at least one of the technical problems existing in the prior art. To this end, this application proposes a method, system, and device for predicting urban flood-prone areas based on LSTM, which solves the technical problem that the existing technology has low accuracy in water accumulation prediction models due to the one-sided design of feature factors, which makes it difficult to fully reflect the water accumulation formation pattern. At the same time, the sample data is small in quantity, poor in quality, and subject to serious noise interference.

[0006] To achieve the above objectives, the first aspect of this application provides a method for predicting waterlogging in urban flood-prone areas based on LSTM, including: Obtain historical water depth monitoring data and historical rainfall monitoring data for flood-prone areas; Rainfall and water accumulation time series data are obtained by performing rain day judgment, water depth data extraction and processing, and time series reconstruction operations on historical water depth monitoring data and historical rainfall monitoring data. Constructing a water accumulation prediction model based on rainfall and water accumulation time series data; Real-time acquisition of rainfall monitoring data and forecast rainfall data; Extract the cumulative rainfall from the historical window corresponding to the rainfall monitoring data and the cumulative forecast rainfall from the future window corresponding to the forecast rainfall data; the historical window refers to the time range of the past m hours from the current time point; the future window refers to the time range of the next n hours from the current time point; where m and n are both integers, and both m and n are greater than 0; When the cumulative rainfall and the cumulative forecast rainfall meet the model prediction activation conditions; the model prediction activation conditions mean that when either the cumulative rainfall or the cumulative forecast rainfall exceeds its corresponding preset rainfall threshold, model prediction is performed; otherwise, model prediction is not performed. Temporal characteristics are determined based on rainfall monitoring data and forecast rainfall data; The time-series features are input into the water accumulation prediction model to obtain the predicted water accumulation depth.

[0007] This application improves the accuracy and robustness of the flooding prediction model through the above steps: First, by integrating current rainfall characteristics with the flooding depth of the previous moment, a time-series feature factor is constructed, encompassing four dimensions: real-time intensity, cumulative total, historical evolution trend, and prior state. This comprehensively characterizes the dynamic correlation mechanism between rainfall and flooding, enabling the LSTM model to accurately capture the nonlinear time-series dependencies in the flooding formation process and effectively avoid mapping biases caused by missing features or overfitting. Second, through a refined data preprocessing workflow, including effective rainfall event screening based on rain day identification, systematic extraction of flooding depth data, and noise reduction, the model is optimized. The precise reconstruction of time series data enables strict alignment of rainfall and water accumulation data in the time dimension. This transforms the low-quality data, which is often noisy, missing, and misaligned in the original monitoring, into high-quality training samples with clear structure, consistent time series, and complete information. This fundamentally solves the problems of data noise interference and insufficient sample validity. The model built on this basis can not only deeply learn the inherent physical laws of water accumulation evolution, but also has good anti-interference ability. It significantly overcomes the shortcomings of existing AI models, such as insufficient prediction accuracy due to one-sided feature expression and low data quality, and provides solid and reliable technical support for urban flood control decision-making.

[0008] Furthermore, the rainy day determination operation includes: Obtain historical rainfall monitoring data; Historical rainfall monitoring data is traversed in chronological order to obtain several rainfall data sessions; each rainfall data session includes time data and rainfall data; the time data refers to the sequence data of rainfall time points; the rainfall data refers to the rainfall amount at each rainfall time point, specifically the rainfall amount generated between the current time point and the previous time point. For a number of rainfall data points, the time interval between adjacent rainfall data points is calculated sequentially; the time interval is expressed as the time interval between the end time of the previous rainfall event and the start time of the next rainfall event. Determine whether the time interval is less than the interval threshold Δt; the interval threshold represents the duration of rainfall impact, that is, after the rainfall ends, rainwater still flows on the surface, causing water accumulation to continue. Yes, by merging rainfall data from adjacent fields, we obtain merged rainfall data. No, set the previous rainfall data in the adjacent rainfall data as the merged rainfall data; The initial rainy day sequence is obtained by sorting several merged rainfall data in chronological order. Calculate the maximum hourly rainfall and cumulative rainfall corresponding to the merged rainfall data in the initial rainy day sequence; When both the maximum hourly rainfall and the cumulative rainfall are greater than or equal to their corresponding rainfall thresholds; the rainfall thresholds include the maximum hourly rainfall threshold Ph and the cumulative rainfall threshold Pcum. The end time in the merged rainfall data is updated to the sum of the end time and the interval threshold Δt, and the weather label corresponding to the merged rainfall data is set to rainy day; Otherwise, the combined rainfall data from the initial rainy day sequence will be removed; The rainy day sequence is obtained by sorting several merged rainfall data points labeled as rainy days in chronological order.

[0009] Furthermore, the water depth data extraction and processing operations include: Obtain a rainy day sequence; the rainy day sequence includes several merged rainfall data. Extract the water depth monitoring value H corresponding to the combined rainfall data. i ; i represents the number corresponding to several monitoring time points in the merged rainfall data; Calculate the water depth monitoring value H i The corresponding forward rate of change Ru i and backward rate of change Rd i The forward rate of change refers to the ratio of the absolute value of the difference between the water depth monitoring values ​​at the current i-th monitoring time point and the (i-1)-th monitoring time point to the time difference; the backward rate of change refers to the ratio of the absolute value of the difference between the water depth monitoring values ​​at the current i-th monitoring time point and the (i+1)-th monitoring time point to the time difference. Several water depth monitoring values ​​H with both forward and backward variability rates greater than 0 were selected. j j represents the number corresponding to several monitoring time points where both the forward and backward rates of change are greater than 0. The upper boundary thresholds corresponding to the forward and backward rates of change are calculated using the formula. The formula satisfies: Where k represents the number corresponding to the rate of change; the rate of change includes the forward rate of change and the backward rate of change. The first quartile corresponding to the k-th rate of change. The third quartile corresponding to the kth rate of change; For threshold coefficient, >0; Iterate through the forward and backward rates of change corresponding to several monitoring time points in sequence; When both the forward and backward rates of change exceed their corresponding upper boundary thresholds, or when, in a series of monitoring time points, the forward rate of change at the first monitoring time point exceeds its corresponding upper boundary threshold, the backward rate of change at the last monitoring time point exceeds its corresponding upper boundary threshold, and the forward rate of change at several intermediate monitoring time points does not exceed its corresponding upper boundary threshold, the water depth monitoring value H at the monitoring time points is set to [value missing]. i Set as a preliminary outlier; Calculate the upper boundary threshold of the water accumulation corresponding to the water accumulation depth monitoring value; When the water depth monitoring value corresponding to the initial anomaly point is greater than the upper boundary threshold of the water accumulation, the water depth monitoring value corresponding to the initial anomaly point is removed to obtain the water depth monitoring value Hb after data processing; b represents the monitoring time point number corresponding to several water depth monitoring values ​​after data processing. A trend-based preprocessing operation is performed on the water depth monitoring values ​​after data processing to obtain trend-processed water depth monitoring values. The final water depth monitoring value corresponding to the merged rainfall data is obtained by smoothing the water depth monitoring value after trend processing.

[0010] Furthermore, the time series reconstruction operation includes: Extract several monitoring time points corresponding to the final water depth monitoring value from the merged rainfall data; The time interval between adjacent monitoring time points is calculated using a differential method; Several non-repeating time interval values ​​in the statistical time interval; Extract several non-repeating time interval values ​​that are integer multiples of the interval index as candidate time interval values; Determine if the candidate time interval value exists; Yes, the greatest common divisor of several candidate time interval values ​​is set as the time interval Td for water depth monitoring; No, calculate the greatest common divisor of several non-repeating time interval values; When the greatest common divisor is greater than 1, the greatest common divisor is set as the time interval Td for water depth monitoring; Otherwise, the interval index will be used as the time interval Td for monitoring water depth; Obtain the time interval Tr corresponding to the rainfall monitoring data in the merged rainfall data; the time interval Tr refers to the time interval between monitoring time points in the rainfall monitoring data; Calculate the greatest common divisor of the time interval Td for water depth monitoring and the time interval Tr for rainfall monitoring data; Determine whether the greatest common divisor is 1; Yes, obtain the special non-repeating time interval value TdJZ; take the greatest common divisor of the time interval Tr of rainfall monitoring data and the special non-repeating time interval value TdJZ as the unified time interval Tu; No, the greatest common divisor of the time interval Td for water depth monitoring and the time interval Tr for rainfall monitoring data is used as the uniform time interval Tu; A new time series is constructed from the merged rainfall data at a uniform time interval Tu; the new time series includes several new monitoring time points. Based on the new time series, the rainfall monitoring data and the final water depth monitoring value in the merged rainfall data are reconstructed to obtain the reconstructed rainfall monitoring data and the reconstructed water depth monitoring value. The reconstructed rainfall monitoring data and reconstructed water depth monitoring values ​​corresponding to several new monitoring time points in the new time series are combined to obtain the rainfall and water accumulation time series data.

[0011] This application employs a multi-stage data processing scheme to transform raw, chaotic, noisy, and asynchronous monitoring data into high-quality, well-organized, and time-aligned time-series samples, providing reliable input for the LSTM model and significantly improving the accuracy and robustness of waterlogging prediction. Firstly, in the rainy day identification stage, by traversing and analyzing rainfall data, short-term rainfall events that are temporally adjacent are merged, and a dual threshold of maximum hourly rainfall and cumulative rainfall is used for filtering, accurately identifying effective rainfall periods that may cause waterlogging and effectively eliminating meaningless or interfering rainfall records, ensuring the relevance and effectiveness of training samples from the source. Secondly, in terms of waterlogging depth data processing, forward / backward rate of change calculation is introduced, combined with a dynamic threshold set based on box plots, to automatically identify and eliminate abnormal observations. This is further supplemented by trend consistency judgment and smoothing filtering strategies. The process effectively suppresses sensor noise and transient disturbances, enabling the processed data to more accurately reflect the actual waterlogging evolution. Finally, in the time series reconstruction stage, a unified time granularity is determined by calculating the greatest common divisor of the timestamp intervals between rainfall and waterlogging data. Based on this, the two types of data are resampled and aligned, completely resolving the time sequence misalignment problem caused by inconsistent sampling frequencies of multi-source heterogeneous devices, and achieving precise synchronization of rainfall and waterlogging processes in the time dimension. The synergistic effect of the above three steps not only purifies the noise and invalid information in the original data but also constructs a high-quality training set with clear structure, explicit physical meaning, and consistent time sequence. This fundamentally overcomes the feature distortion and mapping bias problems caused by low data quality in existing AI models, laying a solid data foundation for high-precision and highly robust intelligent prediction of urban flooding.

[0012] Furthermore, the method for constructing a waterlogging prediction model based on rainfall and waterlogging time series data includes: Obtain time-series data of rainfall and water accumulation from rainy weather sequences; Temporal features are constructed from rainfall and water accumulation time series data; the temporal features include rainfall at the current new monitoring time point, cumulative rainfall, average rainfall, rainfall within historical time window P, rainfall within historical time window 2P, rainfall within historical time window 3P, and water accumulation depth time series at the previous new monitoring time point; the size of the time window P is set based on experience; An initial sample set is composed of several time-series features; The sample set is obtained by standardizing several time-series features in the initial sample set; The sample set is divided into a training set and a validation set using a K-fold cross-validation strategy; where the value of K is the same as the total number of training samples. The LSTM neural network model is trained and validated using training and validation sets, and the optimal hyperparameters are determined using the Bayesian hyperparameter optimization method to obtain the initial model. The sample set is input into the initial model in batches to train the model weights and thus determine the model weight parameters; the model weight training includes forward propagation, loss calculation and backpropagation. The model parameters are determined based on the optimal hyperparameters and model weight parameters, and the water accumulation prediction model is obtained.

[0013] Furthermore, the LSTM neural network model includes an input layer, an attention module, an LSTM temporal modeling layer, and a fully connected output layer; The input layer is used to receive temporal features; The attention module adopts a hybrid attention module that fuses time step attention and feature attention. The time step attention is used to assign attention weights to temporal features at different time points, and the feature attention is used to assign attention weights to different temporal features at different time points, thus fusing them to obtain a hybrid attention module with different time points and different temporal features. The LSTM timing modeling layer includes receiving data, timing updates, residual connections, and dropout regularization; The fully connected output layer refers to mapping the hidden state output by the LSTM temporal modeling layer to a 1-dimensional prediction space and outputting the predicted water depth.

[0014] Furthermore, the loss function of the water accumulation prediction model satisfy: ; Represented as NSE component weighting coefficients, ∈(0,1); and These represent the predicted water depth and the actual water depth, respectively. This represents the average actual water depth, and `max()` indicates the operation of taking the maximum value. This represents the predicted maximum water depth. This represents the maximum actual depth of the accumulated water. It is a very small constant to prevent division by zero errors.

[0015] Furthermore, the determination of time-series characteristics based on rainfall monitoring data and forecasted rainfall data includes: The time interval Tp and the uniform time interval Tu are used to extract the forecast rainfall data; the forecast rainfall data includes forecast time data and forecast rainfall amount data, the forecast time data includes the forecast start time point, the forecast end time point and the uniform time interval, and the forecast rainfall amount data includes the rainfall amount at each time point; An initial forecast precipitation sequence is defined based on the forecast start time, forecast end time, and a uniform time interval; the values ​​in the initial forecast precipitation sequence are null values. The forecasted rainfall data is time-series aligned and then inserted into the initial forecasted rainfall sequence to obtain the forecasted rainfall sequence; the time-series alignment refers to mapping the forecasted rainfall data to the initial forecasted rainfall sequence at a uniform time interval; Extract the water depth time series corresponding to the previous time point. The water depth time series is determined by the water prediction model of the previous time point using a teacher-forced strategy. The water depth time series consists of several actual water depths or predicted water depths. The actual water depths are obtained from the water depth monitoring data, and the predicted water depths are the results output by the water prediction model. The teacher-mandated strategy refers to controlling the water accumulation prediction model to use either the actual water accumulation depth or the predicted water accumulation depth in the water accumulation depth time series input at the next time point. The teacher-mandated strategy includes strategy one and strategy two. Strategy one refers to determining whether the input water accumulation depth is the actual water accumulation depth or the predicted water accumulation depth according to a ratio α when training the model parameters of the water accumulation prediction model, where α∈(0,1). Strategy two refers to the following when predicting water accumulation depth using the water accumulation prediction model: when the rainfall feature time series in the time series features consists of a rainfall sequence and a forecast rainfall sequence, the water accumulation depth time series is composed of the actual water accumulation depth and the forecast water accumulation depth corresponding to the rainfall sequence and the forecast rainfall sequence; when the rainfall feature time series in the time series features is a forecast rainfall sequence, the water accumulation depth time series is composed of the predicted water accumulation depth corresponding to the forecast rainfall sequence. Determine whether the cumulative rainfall in the historical window exceeds its corresponding preset rainfall threshold; Yes, the time interval Te corresponding to the extraction of rainfall monitoring data; The initial rainfall sequence is defined based on the start time point, current time point, and uniform time interval Tu of rainfall monitoring data; The rainfall data is time-series aligned and filled into the initial rainfall sequence to obtain the rainfall sequence; The rainfall sequence and the forecast rainfall sequence are spliced ​​together in chronological order to obtain the rainfall characteristic time series sequence; The time series features of rainfall characteristics and the time series features of water accumulation depth are concatenated to obtain time series features; No, set the rainfall feature time series as the forecast rainfall series; perform feature splicing between the rainfall feature time series and the water depth time series to obtain the time series features.

[0016] A second aspect of the present invention provides an LSTM-based system for predicting waterlogging in urban flood-prone areas, comprising: a data acquisition module and a data analysis module; the data acquisition module and the data analysis module are connected together. The data acquisition module acquires historical water depth monitoring data and historical rainfall monitoring data of flood-prone areas through data acquisition equipment, as well as real-time rainfall monitoring data and forecast rainfall data. The data analysis module includes a data processing unit, a model building unit, and a result generation unit; The data processing unit performs rainy day judgment, water depth data extraction and processing, and time series reconstruction operations on historical water depth monitoring data and historical rainfall monitoring data to obtain rainfall and water accumulation time series data. The model building unit: constructs a water accumulation prediction model based on rainfall and water accumulation time series data; The result generation unit extracts the cumulative rainfall from the historical window corresponding to the rainfall monitoring data and the cumulative forecast rainfall from the future window corresponding to the forecast rainfall data; when the cumulative rainfall and the cumulative forecast rainfall meet the model prediction activation conditions; determines the time series features based on the rainfall monitoring data and the forecast rainfall data; and inputs the time series features into the water accumulation prediction model to obtain the predicted water accumulation depth.

[0017] Another aspect of the present invention provides an LSTM-based urban flood-prone area waterlogging prediction device, comprising: a processor and a storage medium; the storage medium includes instructions, and the processor is configured to execute the instructions to implement the method described in the first aspect and any possible implementation thereof; the LSTM-based urban flood-prone area waterlogging prediction device may be an electronic device or a chip in an electronic device.

[0018] Compared with the prior art, the beneficial effects of this application are: 1. This application obtains rainfall-water accumulation time series data by performing rain day judgment operations, water accumulation depth data extraction and processing operations, and time series reconstruction operations on historical water accumulation depth monitoring data and historical rainfall monitoring data; constructs a water accumulation prediction model based on the rainfall-water accumulation time series data; when the cumulative rainfall and cumulative forecast rainfall meet the model prediction activation conditions; determines the time series characteristics based on rainfall monitoring data and forecast rainfall data; inputs the time series characteristics into the water accumulation prediction model to obtain the predicted water accumulation depth; and constructs time series feature factors by extracting current rainfall characteristics and the water accumulation depth at the previous moment, comprehensively covering the dynamic correlation law of rainfall-water accumulation from four dimensions: real-time intensity, total accumulation, historical changes, and previous state, so that LS The TM model can accurately learn the nonlinear temporal dependencies of water accumulation formation, avoiding mapping bias caused by missing features or overfitting. Through rain day judgment operations to accurately screen effective rainfall events, water accumulation depth data extraction and processing operations to systematically purify noisy data, and time series reconstruction operations to ensure the time alignment of rainfall and water accumulation data, the original poor-quality and chaotic monitoring data is transformed into high-quality and well-organized training samples. This solves the problems of data noise interference and sample validity from the source, enabling the model to not only deeply capture the physical laws of water accumulation formation, but also have the ability to resist noise interference. It effectively overcomes the low accuracy defects of existing AI models caused by feature bias and poor data quality, and provides reliable support for flood control decision-making.

[0019] 2. The rainy day judgment operation in this application traverses rainfall data, merges short-term adjacent rainfall events, and filters valid events that meet the criteria for maximum hourly rainfall and cumulative rainfall. This ensures that only rainfall periods that may cause water accumulation are retained, eliminating invalid data interference and guaranteeing sample validity from the source. Secondly, the water accumulation depth data processing operation calculates the forward / backward rate of change, sets thresholds based on box plots to identify and remove abnormal data, and combines trend judgment and smoothing processing to effectively filter equipment noise, making the data more consistent with the actual water accumulation change pattern. Finally, the time series reconstruction operation determines a unified time interval by calculating the greatest common divisor of the time intervals between rainfall and water accumulation data, and reconstructs the data based on this to achieve accurate alignment of rainfall and water accumulation depth in the time dimension, solving the problem of inconsistent time series data from multiple sources. The above solutions work together to transform the original chaotic, noisy, and asynchronous monitoring data into clean, regular, and synchronous high-quality time series samples, overcoming the feature mapping bias caused by poor data quality in existing AI models, providing reliable input for LSTM models, and thus significantly improving the accuracy and robustness of water accumulation prediction.

[0020] 3. This application extracts multi-dimensional temporal features from rainfall-water accumulation time series data and trains the model through standardization, K-fold cross-validation, and Bayesian hyperparameter optimization to ensure the model fully learns the nonlinear relationship between rainfall and water accumulation, avoiding overfitting. A feature attention module is introduced into the LSTM model structure to dynamically weight the weights of different time points and different temporal features, strengthening the contribution of key information. Residual connectivity and dropout regularization are combined to enhance temporal modeling capabilities and improve feature mapping accuracy. The model's loss function integrates NSE loss and peak error loss, optimizing model training through weighted combination to balance overall patterns and extreme value capture. A unified time interval is used to align the actual situation with the predicted situation. The system reports rainfall data and dynamically determines whether to integrate real-time data based on a cumulative rainfall threshold, enabling accurate construction of rainfall feature time series and ensuring that the model input closely matches the actual rainfall process. A teacher-mandated strategy is used to dynamically control whether the input water depth is the true value or a predicted value. This enhances the model's autonomous generalization ability during training and dynamically calibrates prediction results using water depth during prediction. Through the synergistic effect of these solutions, the model can deeply explore time-dependent patterns and dynamically adapt to real-time data changes. Ultimately, it overcomes the shortcomings of traditional AI models' one-sided features and static predictions, achieving high-precision and robust rolling prediction of water accumulation, providing reliable support for flood control decision-making. Attached Figure Description

[0021] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0022] Figure 1 This is a flowchart of the LSTM-based method for predicting waterlogging in urban flood-prone areas proposed in this application. Figure 2 This is a schematic diagram illustrating the principle of the LSTM-based urban flood-prone area waterlogging prediction system proposed in this application. Detailed Implementation

[0023] The technical solutions of this application will be clearly and completely described below with reference to the embodiments. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.

[0024] Please see Figure 1 The first aspect of this application provides a method for predicting waterlogging in urban flood-prone areas based on LSTM, including: Obtain historical water depth monitoring data and historical rainfall monitoring data for flood-prone areas; Rainfall and water accumulation time series data are obtained by performing rain day judgment, water depth data extraction and processing, and time series reconstruction operations on historical water depth monitoring data and historical rainfall monitoring data. Constructing a water accumulation prediction model based on rainfall and water accumulation time series data; Real-time acquisition of rainfall monitoring data and forecast rainfall data; Extract the cumulative rainfall from the historical window corresponding to the rainfall monitoring data and the cumulative forecast rainfall from the future window corresponding to the forecast rainfall data; the historical window refers to the time range of the past m hours from the current time point; the future window refers to the time range of the next n hours from the current time point; where m and n are both integers, and both m and n are greater than 0; the value of m is set according to experience, and in this embodiment it is 6 hours; the value of n is related to the duration corresponding to the forecast rainfall data, and in this embodiment it is 3 hours. When the cumulative rainfall and the cumulative forecast rainfall meet the model prediction activation conditions; in this embodiment, the model prediction activation condition means that when either the cumulative rainfall or the cumulative forecast rainfall exceeds its corresponding preset rainfall threshold, the model prediction is performed. The preset rainfall threshold can be set according to the rainfall that is prone to cause waterlogging in the local area and taking into account a certain safety factor. In this embodiment, both the cumulative rainfall and the cumulative forecast rainfall are set to 5 mm; otherwise, the model prediction is not performed. Temporal characteristics are determined based on rainfall monitoring data and forecast rainfall data; The time-series features are input into the water accumulation prediction model to obtain the predicted water accumulation depth.

[0025] The rainy day determination operation in this embodiment includes: Obtain historical rainfall monitoring data; Historical rainfall monitoring data is traversed in chronological order to obtain several rainfall data sessions. Each rainfall data session includes time data and rainfall data. Time data refers to the sequence data of rainfall time points. Rainfall data refers to the rainfall amount at each rainfall time point, specifically the rainfall amount generated between the current time point and the previous time point. For a number of rainfall data points, the time interval between adjacent rainfall data points is calculated sequentially; the time interval is expressed as the time between the end time of the previous rainfall event and the start time of the next rainfall event. Determine whether the time interval is less than the interval threshold Δt; the interval threshold represents the duration of the rainfall impact, that is, after the rainfall ends, rainwater still flows on the ground surface, causing water accumulation to continue; the specific value is set according to experience, and in this embodiment, Δt is set to 6 hours. Yes, by merging rainfall data from adjacent fields, we obtain merged rainfall data. No, set the previous rainfall data in the adjacent rainfall data as the merged rainfall data; The initial rainy day sequence is obtained by sorting several merged rainfall data in chronological order. Calculate the maximum hourly rainfall and cumulative rainfall corresponding to the combined rainfall data in the initial rainy day sequence. The maximum hourly rainfall is the maximum sum of rainfall within each one-hour window in the combined rainfall data, and the cumulative rainfall is the sum of rainfall in the combined rainfall data. When the maximum hourly rainfall and the cumulative rainfall are both greater than or equal to their corresponding rainfall thresholds; the rainfall thresholds include the maximum hourly rainfall threshold Ph and the cumulative rainfall threshold Pcum; the specific values ​​are set according to experience, and in this embodiment, the maximum hourly rainfall threshold Ph and the cumulative rainfall threshold Pcum are set to 15 mm and 20 mm, respectively; Update the end time in the merged rainfall data to the sum of the end time and the interval threshold Δt, and set the weather label corresponding to the merged rainfall data to rainy day; Otherwise, the merged rainfall data in the initial rainy day sequence will be removed; The rainy day sequence is obtained by sorting several merged rainfall data points labeled as rainy days in chronological order.

[0026] The water depth data extraction and processing operations in this embodiment include: Obtain the rainy day sequence; the rainy day sequence includes several merged rainfall data. Extract the water depth monitoring value H corresponding to the combined rainfall data. i ; i represents the number corresponding to several monitoring time points in the merged rainfall data; Calculate the water depth monitoring value H i The corresponding forward rate of change Ru i and backward rate of change Rd i The forward rate of change refers to the ratio of the absolute value of the difference between the water depth monitoring values ​​at the current i-th monitoring time point and the (i-1)-th monitoring time point to the time difference; the backward rate of change refers to the ratio of the absolute value of the difference between the water depth monitoring values ​​at the current i-th monitoring time point and the (i+1)-th monitoring time point to the time difference; in this embodiment, the water depth monitoring value at the first monitoring time point has no forward rate of change, and the water depth monitoring value at the last monitoring time point has no backward rate of change; the time difference in this embodiment refers to the time interval between two monitoring time points; Several water depth monitoring values ​​H with both forward and backward variability rates greater than 0 were selected. j j represents the number corresponding to several monitoring time points where both the forward and backward rates of change are greater than 0. The upper boundary thresholds corresponding to the forward and backward rates of change are calculated using the formula. The formula satisfies: Where k represents the number corresponding to the rate of change; the rate of change includes the forward rate of change and the backward rate of change. The first quartile corresponding to the k-th rate of change. The third quartile corresponding to the kth rate of change; For threshold coefficient, >0; the specific value is set based on experience, and in this embodiment it will be Set to 3; Iterate through the forward and backward rates of change corresponding to several monitoring time points in sequence; When both the forward and backward rates of change exceed their corresponding upper boundary thresholds, or when, in a series of monitoring time points, the forward rate of change at the first monitoring time point exceeds its corresponding upper boundary threshold, the backward rate of change at the last monitoring time point exceeds its corresponding upper boundary threshold, and the forward rate of change at several intermediate monitoring time points does not exceed its corresponding upper boundary threshold, the water depth monitoring value H at the monitoring time points is set to [value missing]. i Set as a preliminary outlier; Calculate the upper boundary threshold of the water accumulation corresponding to the water accumulation depth monitoring value; in this embodiment, the upper boundary threshold of the water accumulation is calculated by using the box plot method for a number of water accumulation depth monitoring values ​​that are greater than the water accumulation threshold h. ;satisfy: Q1 is the first quartile corresponding to several water depth monitoring values ​​that are greater than the water depth threshold h, and Q3 is the third quartile corresponding to several water depth monitoring values ​​that are greater than the water depth threshold h. For threshold coefficient, >0; the specific value is set based on experience, and in this embodiment it will be Set to 3; If the water depth monitoring value corresponding to the initial anomaly point is greater than the upper boundary threshold of the water accumulation, the water depth monitoring value corresponding to the initial anomaly point is removed, and the water depth monitoring value H after data processing is obtained. b b represents the monitoring time point number corresponding to several water depth monitoring values ​​after data processing; A trend-based preprocessing operation is performed on the processed water depth monitoring values ​​to obtain trend-processed water depth monitoring values. In this embodiment, the trend-based preprocessing operation satisfies the following steps: Set the water depth threshold parameter SY; Iterate through the water depth monitoring values ​​H in sequence b If H1≤SY, then SY1=-1, and the subsequent water depth H b When k ≤ k, SY1 = -1, until the first H appears. bWhen the value is greater than k, SY2 = 1; iterate forward in sequence until the next H appears. b When k ≤ k, SY3 = -1, and the next H appears. b When k > k, SY4 = 1...; After the above traversal operation, the SY values ​​are counted. f The number of f; When f < 2, and H b When all are greater than or equal to SY, search for H. b The second largest value Hmax2 and the second smallest value Hmin2 are used to calculate Hmax2 / Hmin2. If Hmax2 / Hmin2 < JSBY, where JSBY is the set threshold for the change in water depth, it can be set based on experience. In this embodiment, JSBY is set to 5, indicating that the water depth monitoring value is at a high value for a long time during rainy days and does not fluctuate much. Therefore, the water depth monitoring value may be abnormal and is removed to obtain the water depth monitoring value after trend processing. The final water depth monitoring value corresponding to the merged rainfall data is obtained by performing a data smoothing operation on the trend-processed water depth monitoring value; in this embodiment, the data smoothing operation uses a Savitzky-Golay filter to smooth the trend-processed water depth monitoring value.

[0027] The time series reconstruction operation in this embodiment includes: Extract several monitoring time points corresponding to the final water depth monitoring value from the merged rainfall data; The time interval between adjacent monitoring time points is calculated using a differential method; The statistical time interval includes several non-repeating time interval values; in this embodiment, a non-repeating time interval value means that the selected time interval value is unique. Several non-repeating time interval values ​​that are integer multiples of the interval index are extracted as candidate time interval values; the interval index JZ is set based on experience, and in this embodiment it is set to 5 minutes. Determine if the candidate time interval value exists; Yes, the greatest common divisor of several candidate time interval values ​​is set as the time interval Td for water depth monitoring; No, calculate the greatest common divisor of several non-repeating time interval values; When the greatest common divisor is greater than 1, the greatest common divisor is set as the time interval Td for water depth monitoring; Otherwise, the interval index will be used as the time interval Td for monitoring water depth; Obtain the time interval Tr corresponding to the rainfall monitoring data in the merged rainfall data; the time interval Tr refers to the time interval between monitoring time points in the rainfall monitoring data; Calculate the greatest common divisor of the time interval Td for water depth monitoring and the time interval Tr for rainfall monitoring data; Determine if the greatest common divisor is 1; Yes, obtain the special non-repeating time interval value TdJZ; in this embodiment, the special non-repeating time interval value refers to the non-repeating time interval value that is closest to the product of the interval index JZ and the time interval Td; for example, when there is an integer multiple of the interval index among the non-repeating time interval values, the special non-repeating time interval value is the non-repeating time interval value corresponding to the integer multiple of the interval index; when there is no integer multiple of the interval index among the non-repeating time interval values, the special non-repeating time interval value is the non-repeating time interval value that is closest to the product of the interval index JZ and the time interval Td; the greatest common divisor of the time interval Tr of the rainfall monitoring data and the special non-repeating time interval value TdJZ is taken as the unified time interval Tu; No, the greatest common divisor of the time interval Td for water depth monitoring and the time interval Tr for rainfall monitoring data is used as the uniform time interval Tu; A new time series was constructed from the merged rainfall data using a uniform time interval Tu; the new time series includes several new monitoring time points. Based on the new time series, the rainfall monitoring data and the final water depth monitoring value in the merged rainfall data are reconstructed to obtain the reconstructed rainfall monitoring data and the reconstructed water depth monitoring value. The reconstructed rainfall monitoring data and reconstructed water depth monitoring values ​​corresponding to several new monitoring time points in the new time series are combined to obtain the rainfall and water accumulation time series data.

[0028] In this embodiment, data reconstruction includes rainfall monitoring data reconstruction and water depth monitoring value reconstruction, including: Rainfall monitoring data reconstruction must meet the following steps: Obtain the uniform time interval Tu and the time interval Tr corresponding to the rainfall monitoring data; When Tr=Tu, the values ​​corresponding to the monitoring time points in the rainfall monitoring data are assigned to the time points in the new time series to form reconstructed rainfall monitoring data; When Tr > Tu, let A = Tr / Tu, and assign one-A of the rainfall amount at each time point in the rainfall monitoring data to the most recent time point and the A-1 time points before the most recent time point in the new time series, forming reconstructed rainfall monitoring data; in this embodiment, the value corresponding to the time point in the reconstructed rainfall monitoring data that is null is set to 0; the most recent time point refers to the time point in the rainfall monitoring data that corresponds to the minimum time interval between the time point in the rainfall monitoring data and the time point in the rainfall monitoring data in the new time series; The reconstruction of water depth monitoring values ​​meets the following steps: Obtain new time series; The final water depth monitoring value corresponding to the monitoring time point is assigned to the corresponding time point in the new time series to form the reconstructed water depth monitoring value. In this embodiment, after assigning the final water depth monitoring value to the corresponding time point in the new time series, several empty values ​​in the new time series are filled by linear interpolation to finally obtain the reconstructed water depth monitoring value.

[0029] The water accumulation prediction model constructed based on rainfall and water accumulation time series data in this embodiment includes: Obtain time-series data of rainfall and water accumulation from rainy weather sequences; Temporal features are constructed from rainfall and water accumulation time series data. The temporal features include rainfall at the current new monitoring time point, cumulative rainfall, average rainfall, rainfall within historical time window P, rainfall within historical time window 2P, rainfall within historical time window 3P, and water accumulation depth time series at the previous new monitoring time point. The size of time window P is set based on experience. In this embodiment, P is set to 60 minutes. An initial sample set is composed of several time-series features; The initial sample set is obtained by standardizing several time-series features. The time-series features include rainfall feature time-series sequences and water depth time-series sequences. The rainfall feature time-series sequences consist of several rainfall time-series features, including rainfall amount, cumulative rainfall, average rainfall, rainfall within historical time window P, rainfall within historical time window 2P, and rainfall within historical time window 3P. In this embodiment, the standardization operations include rainfall feature time-series sequence standardization and water depth time-series sequence standardization. The standardization operation of the rainfall characteristic time series sequence satisfies: Where d represents the index of several rainfall time-series features in the rainfall feature time-series sequence; Represented as the d-th rainfall time series feature Standardized rainfall time sequence characteristics; This is represented as the mean value corresponding to the d-th rainfall time series feature; This is expressed as the standard deviation corresponding to the d-th rainfall time series feature; It is a very small constant to prevent division by zero errors. The specific value is set based on experience. In this embodiment, it is set to 0.00000001. The normalization operation of the water depth time series satisfies: The QuantileTransformer module in the machine learning tool library is used to construct a water depth normalizer, and the output is a normalized result mapped to a normal distribution. In order to avoid the interference of zero values ​​on the accuracy of quantile estimation, only a number of non-zero samples of water depth in the water depth time series are selected. In the quantile transformation module, the number of quantiles n=min(a,D), where a is the upper limit threshold of the number of quantiles, which is set to 1000 in this embodiment, and D is the number of non-zero samples in the water depth time series. The sample set is divided into a training set and a validation set using a K-fold cross-validation strategy; where the value of K is the same as the total number of training samples. The LSTM neural network model is trained and validated using training and validation sets, and the optimal hyperparameters are determined using the Bayesian hyperparameter optimization method to obtain the initial model. The sample set is input into the initial model in batches to train the model weights and thus determine the model weight parameters; the model weight training includes forward propagation, loss calculation and backpropagation. The model parameters are determined based on the optimal hyperparameters and model weight parameters to obtain the water accumulation prediction model. In this embodiment, the AMP mixed precision training method is adopted to automatically determine the calculation precision strategy during the model training process. The calculation precision strategy includes half-precision strategy and single-precision strategy.

[0030] In another embodiment, when constructing the sample set, a sliding window is used to expand the sample set, including: Acquire time series data of rainfall and water accumulation, and extract the corresponding time length ST and several new monitoring time points; the new monitoring time points include the new start time point and the new end time point; With a fixed starting time point, v termination time points are generated by sliding v times according to a time length of v×ΔT; where v is an integer, v>0, and v= ST / △T ; It is represented by the floor symbol. The specific value of △T is set according to experience. In this embodiment, △T is set to 3 hours. The rainfall and water accumulation time series data between the new start time point and several end time points are used as several extended rainfall and water accumulation time series data; The expansion of the sample set is achieved by constructing time-series features from the expanded rainfall and water accumulation time-series data and performing standardization operations on the time-series features.

[0031] The LSTM neural network model in this embodiment includes an input layer, an attention module, an LSTM temporal modeling layer, and a fully connected output layer; The input layer is used to receive temporal features; The attention module adopts a hybrid attention module that fuses time step attention and feature attention. Time step attention is used to assign attention weights to temporal features at different time points, and feature attention is used to assign attention weights to different temporal features at different time points. The fusion results in a hybrid attention module with different time points and different temporal features. The LSTM temporal modeling layer includes receiving data, temporal updates, residual connections, and dropout regularization. In this embodiment, receiving data refers to the fused features of the received temporal features enhanced by the hybrid attention module. Temporal updates refer to updating the cell state and hidden state through the gating mechanism in the LSTM temporal modeling layer, which includes the input gate, forget gate, and output gate. Residual connections are introduced into the intermediate layers of the model to alleviate the gradient vanishing problem in multi-layer training and improve the transmission efficiency of deep features. Dropout regularization is introduced after the output of the intermediate layer to randomly deactivate some neurons and suppress the model's overfitting to noisy features in the training samples. In this embodiment, the intermediate layer refers to multiple LSTM sub-layers within the LSTM temporal modeling layer, used to enhance the model's learning ability. The fully connected output layer refers to mapping the hidden state output by the LSTM temporal modeling layer to a 1-dimensional prediction space to output the predicted water depth. In this embodiment, the accuracy of the predicted water depth is further optimized by using the ReLU nonlinear activation function and dropout regularization.

[0032] The loss function of the water accumulation prediction model in this embodiment satisfy: ; Represented as NSE component weighting coefficients, ∈(0,1), the specific value is set according to experience, and in this embodiment it is set to 0.6; and These represent the predicted water depth and the actual water depth, respectively. This represents the average actual water depth, and `max()` indicates the operation of taking the maximum value. This represents the predicted maximum water depth. This represents the maximum actual depth of the accumulated water. It is a very small constant to prevent division by zero errors. The specific value is set based on experience. In this embodiment, it is set to 0.00000001.

[0033] The determination of time-series characteristics based on rainfall monitoring data and forecasted rainfall data in this embodiment includes: The time interval Tp and uniform time interval Tu are extracted from the forecast rainfall data; the forecast rainfall data includes forecast time data and forecast rainfall data. The forecast time data includes the forecast start time, forecast end time and uniform time interval, and the forecast rainfall data includes the rainfall at each time point. The initial forecast precipitation sequence is defined based on the forecast start time, forecast end time, and a uniform time interval; the values ​​in the initial forecast precipitation sequence are null values. The forecasted rainfall data is time-series aligned and then inserted into the initial forecasted rainfall sequence to obtain the forecasted rainfall sequence; time-series alignment refers to mapping the forecasted rainfall data to the initial forecasted rainfall sequence at a uniform time interval; Extract the water depth time series corresponding to the previous time point. The water depth time series is determined by the water prediction model of the previous time point using the teacher-forced strategy. The water depth time series consists of several actual water depths or predicted water depths. The actual water depths are obtained from the water depth monitoring data, and the predicted water depths are the results output by the water prediction model. In this embodiment, the teacher-mandated strategy refers to controlling the water accumulation prediction model to use either the actual water accumulation depth or the predicted water accumulation depth in the water accumulation depth time series input at the next time point. The teacher-mandated strategy includes strategy one and strategy two. Strategy one refers to determining whether the input water accumulation depth is the actual water accumulation depth or the predicted water accumulation depth according to the ratio α when training the model parameters of the water accumulation prediction model, where α∈(0,1), and the specific value is set according to experience. In this embodiment, it is set to 0.5. Strategy two refers to the following when predicting water accumulation depth through the water accumulation prediction model: when the rainfall feature time series in the time series features is a rainfall sequence and a forecast rainfall sequence, the water accumulation depth time series is composed of the actual water accumulation depth and the forecast water accumulation depth corresponding to the rainfall sequence and the forecast rainfall sequence; when the rainfall feature time series in the time series features is a forecast rainfall sequence, the water accumulation depth time series is composed of the predicted water accumulation depth corresponding to the forecast rainfall sequence. Determine whether the cumulative rainfall in the historical window is greater than its corresponding preset rainfall threshold. The threshold can be set by comprehensively considering the local rainfall that is prone to causing water accumulation and the safety status of the impact of rainfall. In this embodiment, it is set to 5mm. Yes, extract the time interval Te corresponding to the rainfall monitoring data; in this embodiment, the start time of the real-time acquired rainfall monitoring data is the start time of the weather label of the current rainfall monitoring data being rainy, that is, the time distance between the start time of the rainfall monitoring data and the end time of the previous merged rainfall data exceeds △t; The initial rainfall sequence is defined based on the start time point, current time point, and uniform time interval Tu of rainfall monitoring data; Align the rainfall data in time series and fill it into the initial rainfall sequence to obtain the rainfall sequence; in this embodiment, the method of aligning the rainfall data in time series is the same as that of the predicted rainfall data. Concatenate the rainfall sequence and the predicted rainfall sequence in chronological order to obtain the rainfall feature time series; in this embodiment, the feature value corresponding to the current time point in the rainfall feature time series is the value in the rainfall sequence. Perform feature concatenation on the rainfall feature time series and the waterlogging depth time series to obtain the time series features. No. Set the rainfall feature time series as the predicted rainfall sequence; perform feature concatenation on the rainfall feature time series and the waterlogging depth time series to obtain the time series features.

[0034] In this embodiment, aligning the predicted rainfall data in time series and filling it into the initial predicted rainfall sequence to obtain the predicted rainfall sequence includes the following steps: When Tu = Te, directly input the predicted rainfall data into the initial predicted rainfall sequence. When Tu < Te, let U = Te / Tu, and assign one-Uth of the rainfall at each time point of the predicted rainfall data to the nearest time point and its first U-1 previous time points in the initial predicted rainfall sequence; the nearest time point refers to the time point in the predicted rainfall data with the minimum time interval from the time point in the new time series. When Tu > Te, calculate the greatest common divisor Tgcd of Tu and Te, let E = Te / Tgcd, and U = Tu / Tgcd. Define a time series series_gcd with a time interval of Tgcd according to the start time point and end time point of the predicted rainfall data. Assign one-Eth of the rainfall at each time point of the predicted rainfall data to the nearest time point and its first E-1 previous time points in series_gcd. Take the sum of the current rainfall and the first E-1 previous rainfalls for the rainfall at several time points in the obtained series_gcd; obtain the updated series_gcd. Merge the updated series_gcd into the initial predicted rainfall sequence according to the time point correspondence to obtain the predicted rainfall sequence; when there are time points in series_gcd that do not exist in the initial predicted rainfall sequence, delete the rainfall corresponding to the time points that exist in series_gcd and do not exist in the initial predicted rainfall sequence.

[0035] This embodiment proposes a method for predicting water accumulation rolling that integrates multi-dimensional feature engineering, advanced model architecture, and dynamic data fusion strategies, significantly improving the model's accuracy, generalization ability, and real-time adaptability. First, based on high-quality aligned rainfall-water accumulation time-series data, multi-dimensional time-series features covering intensity, accumulation, trend, and historical status are extracted, and dimensional differences are eliminated through standardization. During the model training phase, K-fold cross-validation is used to evaluate generalization performance, and a Bayesian optimization algorithm is combined to automatically search for the optimal hyperparameter combination, ensuring that the LSTM model fully learns the complex nonlinear dynamics between rainfall and water accumulation. The algorithm effectively suppresses overfitting risks by establishing a state relationship. Secondly, an attention module is introduced into the LSTM architecture to dynamically evaluate and weight the importance of different time steps and temporal features, highlighting the time periods that have a key impact on water accumulation formation. Simultaneously, residual connections are fused to alleviate gradient degradation in deep networks, and Dropout regularization is introduced to enhance model robustness, thereby comprehensively improving temporal modeling capabilities and feature mapping accuracy. A teacher-forced strategy is employed to dynamically control whether the input water accumulation temporal features are true or predicted values. This enhances the autonomous generalization ability during model training and allows for better model pre-training. The prediction results are dynamically calibrated using water depth during measurement. Furthermore, addressing the dual requirements of grasping overall hydrological trends and accurately capturing extreme peaks in water accumulation prediction, a composite loss function is designed, weighting and fusing the NSE loss and peak error loss. This optimization process balances overall goodness of fit with sensitivity to extreme events, ensuring high prediction reliability in both normal and heavy rainfall scenarios. Finally, to improve the model's fit to actual rainfall events, a dynamic data fusion mechanism is proposed: real-time and forecast rainfall data are aligned using a unified time interval, and the system intelligently determines whether to incorporate real-time data based on a cumulative rainfall threshold. By observing the situation, when the forecast uncertainty is high or the rainfall intensity reaches a critical value, the system automatically integrates real-time data to correct the input sequence, thereby constructing a more realistic and representative rainfall feature time series. The synergistic effect of the above technical solutions enables the model to not only deeply explore the long-term and short-term time series dependencies, but also dynamically respond to real-time rainfall and water accumulation changes. This effectively overcomes the prediction bias and insufficient adaptability caused by the single feature expression and static input of traditional AI models, achieving high-precision, robust, and continuously updated intelligent prediction of urban water accumulation, providing solid and reliable technical support for flood season emergency response and scientific decision-making.

[0036] Please see Figure 2 The second aspect of this application provides an LSTM-based urban flood-prone area waterlogging prediction system, comprising: a data acquisition module and a data analysis module; the data acquisition module and the data analysis module are electrically and / or communicatively connected. Data acquisition module: Acquires historical water depth monitoring data and historical rainfall monitoring data of flood-prone areas through data acquisition equipment, as well as real-time rainfall monitoring data and forecast rainfall data; the data acquisition equipment includes several sensors, etc. The data analysis module includes a data processing unit, a model building unit, and a result generation unit; Data processing unit: Performs rain day judgment, water depth data extraction and processing, and time series reconstruction operations on historical water depth monitoring data and historical rainfall monitoring data to obtain rainfall and water accumulation time series data; Model building unit: Constructing a water accumulation prediction model based on rainfall and water accumulation time series data; Result generation unit: Extracts the cumulative rainfall of the historical window corresponding to the rainfall monitoring data and the cumulative forecast rainfall of the future window corresponding to the forecast rainfall data; when the cumulative rainfall and the cumulative forecast rainfall meet the model prediction start conditions; determines the time series features based on the rainfall monitoring data and the forecast rainfall data; inputs the time series features into the water accumulation prediction model to obtain the predicted water accumulation depth.

[0037] Another embodiment of this application provides an LSTM-based urban flood-prone area waterlogging prediction device, comprising: a processor and a storage medium; the storage medium includes instructions, and the processor is configured to execute the instructions to implement the method described in the first aspect embodiment and any possible implementation thereof; the LSTM-based urban flood-prone area waterlogging prediction device may be an electronic device or a chip in an electronic device.

[0038] Some of the data in the above formula are calculated by removing dimensions and taking their numerical values. The formula is the closest to the real situation obtained by software simulation of a large amount of collected data. The preset parameters and preset thresholds in the formula are set by those skilled in the art according to the actual situation or obtained through simulation of a large amount of data.

[0039] The working principle of this application is as follows: This application obtains rainfall-water accumulation time series data by performing rain day judgment operations, water accumulation depth data extraction and processing operations, and time series reconstruction operations on historical water accumulation depth monitoring data and historical rainfall monitoring data; a water accumulation prediction model is constructed based on the rainfall-water accumulation time series data; when the cumulative rainfall and cumulative forecast rainfall meet the model prediction activation conditions; time series features are determined based on rainfall monitoring data and forecast rainfall data; the time series features are input into the water accumulation prediction model to obtain the predicted water accumulation depth. By extracting the current rainfall features and the water accumulation depth at the previous moment, time series feature factors are constructed, comprehensively covering the dynamic correlation between rainfall and water accumulation from four dimensions: real-time intensity, total accumulation, historical changes, and previous states. This enables the LSTM model to accurately learn the nonlinear time series dependency relationship of water accumulation formation, avoiding mapping bias caused by feature loss or overfitting. Furthermore, it can dynamically calibrate prediction results based on water depth, overcoming the error accumulation problem caused by the model itself. Through rain day judgment operations to accurately screen effective rainfall events, water depth data extraction and processing operations to systematically purify noisy data, and time series reconstruction operations to ensure the time alignment of rainfall and water accumulation data, it transforms the original poor-quality and chaotic monitoring data into high-quality and well-organized training samples. This solves the problems of data noise interference and sample validity from the source, enabling the model to not only deeply capture the physical laws of water accumulation formation but also have the ability to resist noise interference. It effectively overcomes the low accuracy defects of existing AI models caused by feature bias and poor data quality, providing reliable support for flood control decision-making. It avoids the problems of existing technologies having difficulty fully reflecting the laws of water accumulation formation due to biased feature factor design, and the low accuracy of water accumulation prediction models caused by poor sample data quality and severe noise interference.

[0040] The above embodiments are only used to illustrate the technical methods of this application and are not intended to limit it. Although this application has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical methods of this application without departing from the spirit and scope of the technical methods of this application.

Claims

1. A method for predicting waterlogging in urban flood-prone areas based on LSTM, characterized in that, include: Obtain historical water depth monitoring data and historical rainfall monitoring data for flood-prone areas; Rainfall and water accumulation time series data are obtained by performing rain day judgment, water depth data extraction and processing, and time series reconstruction operations on historical water depth monitoring data and historical rainfall monitoring data. Constructing a water accumulation prediction model based on rainfall and water accumulation time series data; Real-time acquisition of rainfall monitoring data and forecast rainfall data; Extract the cumulative rainfall for the historical window corresponding to the rainfall monitoring data and the cumulative forecast rainfall for the future window corresponding to the forecast rainfall data; When the cumulative rainfall and the cumulative forecast rainfall meet the model prediction activation conditions; Temporal characteristics are determined based on rainfall monitoring data and forecast rainfall data; The time-series features are input into the water accumulation prediction model to obtain the predicted water accumulation depth.

2. The method for predicting urban flood-prone areas based on LSTM according to claim 1, characterized in that, The rainy day determination operation includes: Obtain historical rainfall monitoring data; Historical rainfall monitoring data is traversed in chronological order to obtain several rainfall data sessions; each rainfall data session includes time data and rainfall data; the time data refers to the sequence data of rainfall time points; the rainfall data refers to the rainfall amount at each rainfall time point. Calculate the time interval between adjacent rainfall data points for a given set of rainfall data points; Determine whether the time interval is less than an interval threshold; the interval threshold represents the duration of the rainfall impact. Yes, by merging rainfall data from adjacent fields, we obtain merged rainfall data. No, set the previous rainfall data in the adjacent rainfall data as the merged rainfall data; The initial rainy day sequence is obtained by sorting several merged rainfall data in chronological order. Calculate the maximum hourly rainfall and cumulative rainfall corresponding to the merged rainfall data in the initial rainy day sequence; When both the maximum hourly rainfall and the cumulative rainfall are greater than or equal to their corresponding rainfall thresholds; the rainfall thresholds include the maximum hourly rainfall threshold and the cumulative rainfall threshold. The end time in the merged rainfall data is updated to the sum of the end time and the interval threshold, and the weather label corresponding to the merged rainfall data is set to rainy day; Otherwise, the combined rainfall data from the initial rainy day sequence will be removed; The rainy day sequence is obtained by sorting several merged rainfall data points labeled as rainy days in chronological order.

3. The method for predicting urban flood-prone areas based on LSTM according to claim 1, characterized in that, The water depth data extraction and processing operations include: Obtain a rainy day sequence; the rainy day sequence includes several merged rainfall data. Extract the water depth monitoring value H corresponding to the combined rainfall data. i ; i represents the number corresponding to several monitoring time points in the merged rainfall data; Calculate the water depth monitoring value H i The corresponding forward rate of change Ru i and backward rate of change Rd i The forward rate of change refers to the ratio of the absolute value of the difference between the water depth monitoring values ​​at the current i-th monitoring time point and the (i-1)-th monitoring time point to the time difference; the backward rate of change refers to the ratio of the absolute value of the difference between the water depth monitoring values ​​at the current i-th monitoring time point and the (i+1)-th monitoring time point to the time difference. Several water depth monitoring values ​​H with both forward and backward variability rates greater than 0 were selected. j j represents the number corresponding to several monitoring time points where both the forward and backward rates of change are greater than 0. The upper boundary thresholds corresponding to the forward and backward rates of change are calculated using the formula. The formula satisfies: Where k represents the number corresponding to the rate of change; the rate of change includes the forward rate of change and the backward rate of change. The first quartile corresponding to the k-th rate of change. The third quartile corresponding to the kth rate of change; For threshold coefficient, >0; Iterate through the forward and backward rates of change corresponding to several monitoring time points in sequence; If both the forward and backward rates of change exceed their corresponding upper boundary thresholds, or if, in a series of monitoring time points, the forward rate of change at the first monitoring time point exceeds its corresponding upper boundary threshold, the backward rate of change at the last monitoring time point exceeds its corresponding upper boundary threshold, and the forward rate of change at several intermediate monitoring time points does not exceed its corresponding upper boundary threshold, then the water depth monitoring value H at the monitoring time points is set to [value]. i Set as a preliminary outlier; Calculate the upper boundary threshold of the water accumulation corresponding to the water accumulation depth monitoring value; When the water depth monitoring value corresponding to the initial anomaly point is greater than the upper boundary threshold of the water accumulation, the water depth monitoring value corresponding to the initial anomaly point is removed, and the water depth monitoring value H after data processing is obtained. b b represents the monitoring time point number corresponding to several water depth monitoring values ​​after data processing; A trend-based preprocessing operation is performed on the water depth monitoring values ​​after data processing to obtain trend-processed water depth monitoring values. The final water depth monitoring value corresponding to the merged rainfall data is obtained by smoothing the water depth monitoring value after trend processing.

4. The method for predicting urban flood-prone areas based on LSTM according to claim 1, characterized in that, The time series reconstruction operation includes: Extract several monitoring time points corresponding to the final water depth monitoring value from the merged rainfall data; The time interval between adjacent monitoring time points is calculated using a differential method; Several non-repeating time interval values ​​in the statistical time interval; Extract several non-repeating time interval values ​​that are integer multiples of the interval index as candidate time interval values; Determine if the candidate time interval value exists; Yes, the greatest common divisor of several candidate time interval values ​​is set as the time interval Td for water depth monitoring; No, calculate the greatest common divisor of several non-repeating time interval values; When the greatest common divisor is greater than 1, the greatest common divisor is set as the time interval Td for water depth monitoring; Otherwise, the interval index will be used as the time interval Td for monitoring water depth; Obtain the time interval Tr corresponding to the rainfall monitoring data in the merged rainfall data; the time interval Tr refers to the time interval between monitoring time points in the rainfall monitoring data; Calculate the greatest common divisor of the time interval Td for water depth monitoring and the time interval Tr for rainfall monitoring data; Determine whether the greatest common divisor is 1; Yes, obtain the special non-repeating time interval value TdJZ; take the greatest common divisor of the time interval Tr of rainfall monitoring data and the special non-repeating time interval value TdJZ as the unified time interval Tu; No, the greatest common divisor of the time interval Td for water depth monitoring and the time interval Tr for rainfall monitoring data is used as the uniform time interval Tu; A new time series is constructed from the merged rainfall data at a uniform time interval Tu; the new time series includes several new monitoring time points. Based on the new time series, the rainfall monitoring data and the final water depth monitoring value in the merged rainfall data are reconstructed to obtain the reconstructed rainfall monitoring data and the reconstructed water depth monitoring value. The reconstructed rainfall monitoring data and reconstructed water depth monitoring values ​​corresponding to several new monitoring time points in the new time series are combined to obtain the rainfall and water accumulation time series data.

5. The method for predicting urban flood-prone areas based on LSTM according to claim 1, characterized in that, The water accumulation prediction model constructed based on rainfall and water accumulation time series data includes: Obtain time-series data of rainfall and water accumulation from rainy weather sequences; Temporal features are constructed from rainfall and water accumulation time series data; the temporal features include rainfall at the current new monitoring time point, cumulative rainfall, average rainfall, rainfall within historical time window P, rainfall within historical time window 2P, rainfall within historical time window 3P, and water accumulation depth time series at the previous new monitoring time point; the size of the time window P is set based on experience; An initial sample set is composed of several time-series features; The sample set is obtained by standardizing several time-series features in the initial sample set; The sample set is divided into a training set and a validation set using a K-fold cross-validation strategy. The LSTM neural network model is trained and validated using training and validation sets, and the optimal hyperparameters are determined using the Bayesian hyperparameter optimization method to obtain the initial model. The sample set is input into the initial model in batches to train the model weights and thus determine the model weight parameters; the model weight training includes forward propagation, loss calculation and backpropagation. The model parameters are determined based on the optimal hyperparameters and model weight parameters, and the water accumulation prediction model is obtained.

6. The LSTM-based method for predicting urban flood-prone areas according to claim 5, characterized in that, The LSTM neural network model includes an input layer, an attention module, an LSTM temporal modeling layer, and a fully connected output layer; The input layer is used to receive temporal features; The attention module adopts a hybrid attention module that fuses time step attention and feature attention. The time step attention is used to assign attention weights to temporal features at different time points, and the feature attention is used to assign attention weights to different temporal features at different time points, thus fusing them to obtain a hybrid attention module with different time points and different temporal features. The LSTM timing modeling layer includes receiving data, timing updates, residual connections, and dropout regularization; The fully connected output layer refers to mapping the hidden state output by the LSTM temporal modeling layer to a 1-dimensional prediction space and outputting the predicted water depth.

7. The LSTM-based method for predicting waterlogging in urban flood-prone areas according to claim 5, characterized in that, The loss function of the water accumulation prediction model satisfy: ; Represented as NSE component weighting coefficients, ∈(0,1); and These represent the predicted water depth and the actual water depth, respectively. This represents the average actual water depth, and `max()` indicates the operation of taking the maximum value. This represents the predicted maximum water depth. This represents the maximum actual depth of the accumulated water. It is a very small constant.

8. The method for predicting urban flood-prone areas based on LSTM according to claim 1, characterized in that, The determination of time-series characteristics based on rainfall monitoring data and forecasted rainfall data includes: The time interval Tp and the uniform time interval Tu are used to extract the forecast rainfall data; the forecast rainfall data includes forecast time data and forecast rainfall amount data, the forecast time data includes the forecast start time point, the forecast end time point and the uniform time interval, and the forecast rainfall amount data includes the rainfall amount at each time point; An initial forecast precipitation sequence is defined based on the forecast start time, forecast end time, and a uniform time interval; the values ​​in the initial forecast precipitation sequence are null values. The forecasted rainfall data is time-series aligned and then inserted into the initial forecasted rainfall sequence to obtain the forecasted rainfall sequence; the time-series alignment refers to mapping the forecasted rainfall data to the initial forecasted rainfall sequence at a uniform time interval; Extract the water depth time series corresponding to the previous time point. The water depth time series is determined by the water prediction model of the previous time point using a teacher-forced strategy. The water depth time series consists of several actual water depths or predicted water depths. The actual water depths are obtained from the water depth monitoring data, and the predicted water depths are the results output by the water prediction model. The teacher-mandated strategy refers to controlling the water accumulation prediction model to use either the actual water accumulation depth or the predicted water accumulation depth in the water accumulation depth time series input at the next time point. The teacher-mandated strategy includes strategy one and strategy two. Strategy one refers to determining whether the input water accumulation depth is the actual water accumulation depth or the predicted water accumulation depth according to a ratio α when training the model parameters of the water accumulation prediction model, where α∈(0,1). Strategy two refers to the following when predicting water accumulation depth using the water accumulation prediction model: when the rainfall feature time series in the time series features consists of a rainfall sequence and a forecast rainfall sequence, the water accumulation depth time series is composed of the actual water accumulation depth and the forecast water accumulation depth corresponding to the rainfall sequence and the forecast rainfall sequence; when the rainfall feature time series in the time series features is a forecast rainfall sequence, the water accumulation depth time series is composed of the predicted water accumulation depth corresponding to the forecast rainfall sequence. Determine whether the cumulative rainfall in the historical window exceeds its corresponding preset rainfall threshold; Yes, the time interval Te corresponding to the extraction of rainfall monitoring data; The initial rainfall sequence is defined based on the start time point, current time point, and uniform time interval Tu of rainfall monitoring data; The rainfall data is time-series aligned and filled into the initial rainfall sequence to obtain the rainfall sequence; The rainfall sequence and the forecast rainfall sequence are spliced ​​together in chronological order to obtain the rainfall characteristic time series sequence; The time series features of rainfall characteristics and the time series features of water accumulation depth are concatenated to obtain time series features; No, set the rainfall feature time series as the forecast rainfall series; perform feature splicing between the rainfall feature time series and the water depth time series to obtain the time series features.

9. An LSTM-based urban flood-prone area waterlogging prediction system, characterized in that, include: A data acquisition module and a data analysis module; the data acquisition module and the data analysis module are connected to each other; The data acquisition module acquires historical water depth monitoring data and historical rainfall monitoring data of flood-prone areas through data acquisition equipment, as well as real-time rainfall monitoring data and forecast rainfall data. The data analysis module includes a data processing unit, a model building unit, and a result generation unit; The data processing unit performs rainy day judgment, water depth data extraction and processing, and time series reconstruction operations on historical water depth monitoring data and historical rainfall monitoring data to obtain rainfall and water accumulation time series data. The model building unit: constructs a water accumulation prediction model based on rainfall and water accumulation time series data; The result generation unit: extracts the cumulative rainfall of the historical window corresponding to the rainfall monitoring data and the cumulative forecast rainfall of the future window corresponding to the forecast rainfall data; when the cumulative rainfall and the cumulative forecast rainfall meet the model prediction activation conditions; determines the time series characteristics based on the rainfall monitoring data and the forecast rainfall data; The time-series features are input into the water accumulation prediction model to obtain the predicted water accumulation depth.

10. An LSTM-based urban flood-prone area waterlogging prediction device, comprising: A processor and a storage medium; the storage medium includes instructions, and the processor is configured to execute the instructions to implement the LSTM-based method for predicting waterlogging in urban flood-prone areas as described in any one of claims 1-8.