Improved lstm prediction method and system for flood process of steep rise and steep fall in mountainous area

By improving the LSTM forecasting method, combining the attention module and the fully connected layer, and optimizing the model parameters, the problems of underestimation of flood peak water level and time lag in mountainous flood scenarios with rapid rise and fall are solved, thereby improving the accuracy and reliability of mountain flood forecasting and enhancing the scientific nature of flood control scheduling of hydropower stations.

CN123032188APending Publication Date: 2026-11-03ENSHI QINGJIANG DALONGTAN HYDROPOWER DEV CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611189437.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-06
Publication Date
2026-11-03

AI Technical Summary

Technical Problem

Existing LSTM hydrological forecasting models suffer from problems such as underestimated flood peak levels, delayed flood peak occurrence, and large prediction bias under extreme rainfall conditions in mountainous flood scenarios.

Method used

An improved LSTM forecasting method is adopted. By acquiring real-time rainfall and water level sequences, and combining attention modules and fully connected layers, an LSTM hydrological forecasting model is trained. The model parameters are optimized using a composite loss function, and soil moisture content index and previous rainfall are added to sense the watershed's dry and wet status, thereby improving the model's ability to identify flood peaks.

Benefits of technology

It significantly improves the accuracy and reliability of flood forecasting in mountainous areas with rapid rises and falls, ensures the accuracy of flood peak water level prediction and time prediction, and provides scientific support for flood control scheduling of hydropower stations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123032188A_ABST
    Figure CN123032188A_ABST
Patent Text Reader

Abstract

The application belongs to the technical field of hydrological prediction, and relates to an improved LSTM prediction method and system for mountainous steep-rising and steep-falling flood processes. The method comprises the following steps: obtaining real-time rainfall sequences and real-time water level sequences of a target basin; inputting the real-time rainfall sequences and real-time water level sequences into a trained LSTM hydrological prediction model to output a predicted water level sequence; wherein the LSTM hydrological prediction model comprises an input layer, an LSTM hidden layer, an attention module and a fully connected layer connected in sequence. The application significantly improves the accuracy and reliability of mountainous steep-rising and steep-falling flood prediction.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of hydrological forecasting technology, and relates to an improved LSTM forecasting method and system for flood processes with rapid rises and falls in mountainous areas. Background Technology

[0002] Small and medium-sized river basins in mountainous areas are typical mountain streams due to their significant elevation differences, deep valleys, and large longitudinal gradients. During the flood season, this region experiences frequent torrential rains, characterized by short duration, high intensity, and strong localization. The combination of steep terrain and concentrated rainfall causes dramatic rises and falls in river levels; a single flood can reach its peak in just tens of minutes to several hours, placing high demands on the timeliness and accuracy of inflow forecasting.

[0003] Existing hydrological forecasting methods fall into two main categories: conceptual hydrological models (such as the Xin'anjiang model and API) and data-driven models. Conceptual hydrological models construct runoff generation and confluence parameterization schemes based on physical mechanisms; however, under steep terrain conditions, model parameter calibration is difficult, and the runoff generation mechanism is insufficiently characterized. LSTM neural networks in data-driven models are widely used in runoff forecasting due to their powerful ability to capture nonlinear features of time series data; however, in mountainous flood scenarios with rapid rises and falls, existing LSTM models suffer from the following three main problems: (1) Conventional LSTM models treat all times the same during learning. A flood may last for dozens of hours, but the flood peak only occurs in one or two hours. In order to minimize the overall error, the model will prioritize learning the normal water level and treat the flood peak as an "outlier" to smooth it out. As a result, the predicted flood peak water level is much lower than the actual level.

[0004] (2) Mountain floods come quickly, and the water level may rise from the normal level to the flood peak in a few hours. Conventional models are not sensitive enough to the rapid changes in water level. Often, the water level has already started to rise, but the model is still identifying and judging, which leads to the predicted flood peak time being half an hour or even one or two hours later than the actual time.

[0005] (3) The magnitude of a flood caused by a rainstorm depends not only on the amount and intensity of the rainfall, but also on whether the watershed was dry or wet before the rain. If it has rained for several days in a row and the soil is saturated, the same rainstorm will produce a larger flood; conversely, if the watershed is dry, some of the rainwater will be absorbed by the soil first, and the flood peak will be relatively lower. Conventional LSTM models only input historical rainfall and water level data and cannot know the dryness or wetness of the soil, so they are prone to bias during extreme rainstorms. Summary of the Invention

[0006] To address the technical problems of existing LSTM hydrological forecasting models in mountainous flood scenarios, such as underestimated flood peak levels, delayed flood peak occurrence time, and large prediction bias under extreme rainfall conditions, this invention provides an improved LSTM forecasting method and system for mountainous flood processes with rapid rises and falls, significantly improving the accuracy and reliability of mountainous flood forecasting.

[0007] To achieve the above objectives, the present invention employs the following technical solution: In a first aspect, the present invention provides an improved LSTM forecasting method for rapid rise and fall of flood processes in mountainous areas, comprising the following steps: Obtain real-time rainfall and water level sequences for the target watershed; The real-time rainfall sequence and real-time water level sequence are input into the trained LSTM hydrological forecasting model, and the predicted water level sequence is output. The LSTM hydrological forecasting model comprises an input layer, an LSTM hidden layer, an attention module, and a fully connected layer connected in sequence.

[0008] Preferably, the training method for the LSTM hydrological forecasting model includes: Obtain historical rainfall and water level sequences for the target watershed to form a training sample set; The training sample set is fed into the LSTM hidden layer through the input layer. The LSTM hidden layer extracts temporal features from the input data at each time step and outputs the hidden layer feature vector corresponding to each time step. The attention module receives the hidden layer feature vectors output by the LSTM hidden layer at each time step, calculates the water level change rate based on the water level information corresponding to the hidden layer feature vectors at each time step, compares the water level change rate with a preset steep rise threshold, and assigns attention weights to each time step; the attention module obtains a weighted feature sequence based on the attention weights at each time step and the hidden layer feature vectors at the corresponding time step. The weighted feature sequence is input into the fully connected layer to obtain the predicted water level sequence; Based on the difference between the predicted water level sequence and the actual water level value at the corresponding time in the historical water level sequence, a loss value is calculated using a preset composite loss function. The parameters of the LSTM hydrological forecasting model are then updated based on the loss value to obtain a trained LSTM hydrological forecasting model.

[0009] Preferably, the step of calculating the water level change rate based on the water level information corresponding to the hidden layer feature vectors at each time point, comparing the water level change rate with a preset steep rise threshold, and assigning attention weights to each time point includes: The attention module extracts water level information from the hidden layer feature vectors at each time step and calculates... Rate of change of water level at time :

[0010] In the formula, for The actual water level at any given time; for The actual water level at any given time; The rate of change of water level Compared with the preset steep rise threshold Comparison: when ≥ At that moment, assign a high attention weight. , The value range is 0.8 to 1.0; when < At that moment, assign a low attention weight. , The value range is 0.1 to 0.2; The attention module assigns attention weights at each time step. The hidden layer feature vector at the corresponding time point Multiply to obtain the weighted eigenvector. The weighted feature vectors at each time point are summed to form a weighted feature sequence.

[0011] Preferably, the composite loss function The calculation formula is:

[0012]

[0013] In the formula, This is the standard mean square error term; Weighted penalty for flood peak; This is a trend consistency term; , , These are the weighting coefficients for each item; The formula for calculating the conventional mean square error term is as follows:

[0014] In the formula, This represents the total length of the time series. for The predicted water level at any given time; The formula for calculating the flood peak weighted penalty term is as follows:

[0015] In the formula, It is the set of time windows consisting of the flood peak point and its adjacent time periods in the measured water level sequence; The number of moments in the time window set; for The penalty coefficient at time, the penalty coefficient Greater than 1; The formula for calculating the trend consistency term is:

[0016] In the formula, This is a sign function used to determine the direction of water level changes; This is an indicator function. It takes a value of 1 when the predicted water level change direction is inconsistent with the measured water level change direction, and a value of 0 when they are consistent.

[0017] Preferably, when the predicted water level value Less than the actual water level value At that time, the penalty coefficient will be... Adjusted to 110% of the current value.

[0018] Preferably, the step of obtaining historical rainfall sequences and historical water level sequences of the target watershed to form a training sample set further includes: Obtain the antecedent rainfall sequence and soil moisture index sequence for the target watershed; The preceding rainfall sequence and the soil moisture index sequence, together with the historical rainfall sequence and the historical water level sequence, are used as input features for each moment in the training sample set.

[0019] Preferably, the calculation formula for the preceding rainfall sequence is:

[0020] In the formula, For the first The early part of the day affects rainfall; No. The early part of the day affects rainfall; For the first The actual daily rainfall; This is the drainage coefficient; The formula for calculating the soil moisture content index sequence is as follows:

[0021] In the formula, For the first Daily soil moisture content index; For the first Daily soil moisture content index; This is the smoothing coefficient.

[0022] Secondly, the present invention provides an improved LSTM forecasting system for rapid rise and fall of flood processes in mountainous areas, comprising: Data acquisition module: used to acquire real-time rainfall and water level sequences for the target watershed; Prediction execution module: used to input the real-time rainfall sequence and real-time water level sequence into the trained LSTM hydrological forecasting model and output the predicted water level sequence; The LSTM hydrological forecasting model comprises an input layer, an LSTM hidden layer, an attention module, and a fully connected layer connected in sequence.

[0023] Thirdly, the present invention provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of an improved LSTM forecasting method for steep rise and fall of flood processes in mountainous areas.

[0024] Fourthly, the present invention provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of an improved LSTM forecasting method for rapid rise and fall of flood processes in mountainous areas.

[0025] Compared with the prior art, the present invention has the following beneficial effects: By acquiring real-time rainfall and water level sequences of the target watershed and inputting them into an LSTM hydrological forecasting model consisting of an input layer, an LSTM hidden layer, an attention module, and a fully connected layer, the model outputs a predicted water level sequence. The input layer enables access to multi-source time-series data. The LSTM hidden layer utilizes its gating mechanism to perform deep temporal feature extraction on the input sequence, fully capturing the long-term and short-term dependencies and nonlinear dynamic evolution patterns between rainfall and water level responses during rapid rises and falls in mountainous areas. The attention module performs differentiated weighting on the output feature vectors at each time point after the LSTM hidden layer, enabling the model to automatically focus limited computational resources on the characteristics of the flood peak period when water levels rise rapidly during training and prediction. This effectively suppresses the problem of smooth underestimation of the flood peak water level caused by the average learning of all time points in conventional LSTM models. Attached Figure Description

[0026] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of the present invention and should not be regarded as a limitation on the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.

[0027] Figure 1 This is a flowchart of the method of the present invention. Detailed Implementation

[0028] The present invention will now be described in detail with reference to the accompanying drawings and embodiments. It should be noted that, unless otherwise specified, the embodiments and features described in this application can be combined with each other.

[0029] The following detailed description is exemplary and intended to provide further detailed explanation of the invention. Unless otherwise specified, all technical terms used in this invention have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains. The terminology used in this invention is for the purpose of describing particular embodiments only and is not intended to limit the scope of exemplary embodiments according to the invention.

[0030] The first objective of this invention is to provide an improved LSTM forecasting method for rapid flooding processes in mountainous areas, such as... Figure 1 As shown, it includes the following steps: Obtain real-time rainfall and water level sequences for the target watershed.

[0031] Specifically, rainfall and water level data from meteorological rain gauges and hydrological water level stations deployed in the target watershed are extracted according to a preset time step (e.g., hours or minutes) for several hours prior to the current moment (e.g., 12-24 hours), forming real-time rainfall and water level sequences respectively. The rainfall sequence reflects the rainfall input process of the watershed, while the water level sequence reflects the water level response process at the watershed outlet section (e.g., the inlet section of a hydropower station). For small and medium-sized watersheds in mountainous areas, where floods are characterized by rapid rises and falls, an hourly time step is preferred to fully capture the rapid changes in water level.

[0032] The real-time rainfall sequence and real-time water level sequence are input into the trained LSTM hydrological forecasting model, which outputs a predicted water level sequence. The LSTM hydrological forecasting model includes an input layer, an LSTM hidden layer, an attention module, and a fully connected layer connected in sequence.

[0033] Specifically, the LSTM hydrological forecasting model is a pre-trained neural network model, whose structure from input to output is as follows: an input layer, used to receive real-time rainfall sequences and real-time water level sequences and organize them into model input tensors according to time steps; an LSTM hidden layer, used to extract temporal features from the input sequence and capture the long-term and short-term dependencies in the rainfall-water level response process; an attention module, used to apply attention weights to the feature vectors output by the LSTM hidden layer at each time step, so that the model focuses on the features of the rapid rise in water level; and a fully connected layer, used to map the weighted feature sequence to the predicted water level value and output the predicted water level sequence for several future time steps.

[0034] For example, the training method of the LSTM hydrological forecasting model includes: S1. Obtain historical rainfall and water level sequences for the target watershed to form a training sample set.

[0035] Specifically, hourly rainfall and water level data for the target watershed over historical periods (preferably at least 10 years) are collected to form historical rainfall and water level sequences. The historical data is then truncated within a preset time window (e.g., the past 24 hours) to construct a training sample set. Each sample's input consists of rainfall and water level data from multiple consecutive moments, and its output is water level data for multiple future moments. Simultaneously, the historical data is divided into a rate-adjustment period (e.g., the first 70%) and a validation period (e.g., the last 30%). The rate-adjustment period is used for model parameter training, while the validation period is used for model accuracy verification and hyperparameter selection.

[0036] There is a clear temporal causal mapping relationship between the historical rainfall sequence and the historical water level sequence: the hourly rainfall and water level values ​​of the past n hours (n ranges from 12 to 24) are used as input features, and the hourly water level values ​​of the future m hours (m ranges from 1 to 6) are used as the prediction target. The rainfall sequence provides the input excitation signal for the watershed, and the water level sequence provides the response state signal for the watershed. Together, they constitute a temporal causal pair reflecting the rainfall-runoff response relationship of the watershed. The LSTM hidden layer simulates the watershed's runoff generation and sinking forces by learning the nonlinear mapping relationship from historical rainfall and water level to future water level. The historical training data comes from the same target watershed and contains a sufficient number of flood events (preferably at least 20 independent flood events) to ensure that the model can fully learn the characteristics of steep rises and falls rather than general hydrological laws.

[0037] Furthermore, this step also includes obtaining the previous impact rainfall sequence and soil moisture content index sequence of the target watershed, and using the previous impact rainfall sequence and the soil moisture content index sequence together with the historical rainfall sequence and the historical water level sequence as input features for each moment in the training sample set.

[0038] The formula for calculating the preceding rainfall sequence is as follows:

[0039] In the formula, For the first The early part of the day affects rainfall; No. The early part of the day affects rainfall; For the first The actual daily rainfall; The recession coefficient, k, reflects the rate of water loss in the soil of a watershed. The value of k typically ranges from 0.85 to 0.95 and can be calibrated based on the hydrological characteristics of the watershed (e.g., by retrospectively estimating historical rainfall-runoff relationships to match the decline pattern of previous rainfall influences with the measured trend of soil moisture changes). This formula means that the effective rainfall on a given day equals the actual rainfall on that day plus a portion of the effective rainfall retained from the previous day (i.e., the effective rainfall from the previous day). (Times), during periods of consecutive sunny days, the initial rainfall will gradually decrease, while after periods of continuous rainfall, the initial rainfall will continue to increase.

[0040] The formula for calculating the soil moisture content index sequence is as follows:

[0041] In the formula, For the first Daily soil moisture content index; For the first Daily soil moisture content index; The smoothing coefficient has a value range of 0.05 to 0.15 and can be calibrated according to the soil moisture response characteristics of the watershed (such as fitting historical rainfall-runoff-soil moisture observation data to achieve the optimal correlation between the smoothed water content index and the measured soil moisture change trend). This formula transforms the rainfall sequence into a smoothed soil moisture index through exponential smoothing recursion, gradually decreasing during consecutive sunny days and gradually increasing during consecutive rainfall days.

[0042] Both the initial rainfall and soil moisture index are calculated recursively from rainfall data, requiring no additional measurement equipment. These two variables, along with historical rainfall and water level sequences, are used as model inputs, enabling the model to sense the anterior dryness and wetness of the watershed. During training and prediction, the model automatically adjusts its response to rainfall based on whether the watershed is currently dry or wet—resulting in less runoff during dry periods and more runoff during wet periods.

[0043] S2. The training sample set is fed into the LSTM hidden layer through the input layer. The LSTM hidden layer extracts temporal features from the input data at each time step and outputs the hidden layer feature vector corresponding to each time step.

[0044] Specifically, the LSTM hidden layer is composed of several LSTM units connected sequentially over time. Each LSTM unit receives the input data at the current time step (including rainfall, water level, and optional features such as antecedent rainfall and soil moisture index) as well as the hidden state and cell state at the previous time step, and performs forward computation according to the following formula: Forgotten Gate:

[0045] Input Gate:

[0046] Candidate cell status:

[0047] Cell status update:

[0048] Output gate:

[0049] Hidden output:

[0050] In the formula, It is the sigmoid activation function; It is the hyperbolic tangent activation function; This is element-wise multiplication; , , , This is the weight matrix for each gate; , , , The above are the bias terms for each gate, and all of them are trainable parameters. The hidden state dimension of the LSTM hidden layer is preferably 64~256 dimensions.

[0051] S3. The attention module receives the hidden layer feature vectors output by the LSTM hidden layer at each time step, calculates the water level change rate based on the water level information corresponding to the hidden layer feature vectors at each time step, compares the water level change rate with a preset steep rise threshold, and assigns attention weights to each time step. The attention module obtains a weighted feature sequence based on the attention weights at each time step and the hidden layer feature vectors at the corresponding time step.

[0052] Specifically, the calculation process of the attention module is as follows: First, the attention module extracts water level information components from the hidden layer feature vectors at each time step, and this water level information is contained in the input sequence.

[0053] calculate Rate of change of water level at time :

[0054] In the formula, for The actual water level at any given time; for The actual water level at any given time; The rate of change of water level Compared with the preset steep rise threshold The steep rise threshold is compared. The threshold for steep rise in water levels is determined based on historical flood data of the target basin. Specifically, it involves collecting all historical flood events in the target basin, calculating the rate of change of water level during each rising period, and selecting the 25% percentile of this rate of change as the steepest rise threshold. For example, if historical data for a certain basin shows that the 25th percentile of the rate of change during all rising periods is 0.3 meters per hour, then... Take 0.3 meters per hour.

[0055] The attention weighting rules are as follows: when ≥ This indicates that the water level is rising rapidly and is in the peak flood stage, thus requiring a high level of attention to be assigned to this moment. , The value range is 0.8 to 1.0; when < When the water level is at a certain point, it indicates that the rise is gradual or the water level is in a period of decline, and a low attention weight should be assigned to that point. , The value range is 0.1 to 0.2; The attention module assigns attention weights at each time step. The hidden layer feature vector at the corresponding time point Multiply to obtain the weighted eigenvector. The weighted feature vectors at each time point are summed to form a weighted feature sequence.

[0056] Through the aforementioned attention weighting mechanism, the model focuses on the characteristics of the rapid flood rise phase during both training and prediction, preventing the flood peak from being underestimated. This attention module is jointly trained with the LSTM hidden layer; the attention weights participate in the loss function calculation through forward propagation, and the gradients are obtained and the trainable parameters of the attention module are updated through backpropagation.

[0057] S4. Input the weighted feature sequence into the fully connected layer to obtain the predicted water level sequence.

[0058] Specifically, the fully connected layer is a single-layer linear mapping network, and its calculation process is as follows:

[0059] In the formula, Let be the weight matrix with dimensions (1,D), where D is the dimension of the hidden state of the LSTM hidden layer; This is the bias term. The fully connected layer maps the weighted D-dimensional feature vectors at each time step to single-dimensional water level values, and summarizes the predicted water level values ​​at each time step to form a predicted water level sequence.

[0060] S5. Based on the difference between the predicted water level sequence and the actual water level value at the corresponding time in the historical water level sequence, calculate the loss value using a preset composite loss function, update the parameters of the LSTM hydrological forecasting model based on the loss value, and obtain the trained LSTM hydrological forecasting model.

[0061] Specifically, the composite loss function The calculation formula is:

[0062]

[0063] In the formula, This is the standard mean square error term; Weighted penalty for flood peak; This is a trend consistency term; , , These are the weighting coefficients for each item, used to balance the contribution of the three losses to the total loss. , , The value can be set based on experience or actual situation.

[0064] The conventional mean square error term is used to ensure the overall accuracy of the water level process, and its calculation formula is as follows:

[0065] In the formula, This represents the total length of the time series. for The predicted water level at any given time; The flood peak weighted penalty term is used to force the model not to underestimate the flood peak. It penalizes the error near the flood peak by multiplying it by a large coefficient. The calculation formula is as follows:

[0066] In the formula, It is the set of time windows consisting of the flood peak point and its adjacent time periods in the measured water level sequence (e.g., all times within a 2-hour range before and after the flood peak point). The number of moments in the time window set; for The penalty coefficient at time, the penalty coefficient Greater than 1.

[0067] Specifically, when the predicted water level value Less than the actual water level value When (i.e., the flood peak was underestimated), the penalty coefficient will be... The value is adjusted to 110% of the current value. This dynamic adjustment mechanism takes effect in each training iteration, so that if the model continuously underestimates the flood peak during training, the penalty coefficient will increase cumulatively in each round, thereby forcing the model to fully consider the impact of the flood peak and not dare to underestimate the flood peak.

[0068] The trend consistency term is used to check whether the direction of water level change (rising or falling) is correct, reducing the drift of flood peak time. Its calculation formula is as follows:

[0069] In the formula, This is a sign function used to determine the direction of water level changes; This is an indicator function; it takes a value of 1 when the predicted water level change direction is inconsistent with the measured water level change direction, and a value of 0 when they are consistent. The formula checks the predicted water level rise and fall direction at each time step to see if it matches the measured direction, and counts the proportion of times when the directions are inconsistent. The lower this proportion, the better the model's prediction of the water level process matches the measured process, and the smaller the offset of the peak time.

[0070] Furthermore, during model training, the backpropagation algorithm and an adaptive moment estimation optimizer (such as the Adam optimizer) are used to calculate the gradient of the composite loss function with respect to each model parameter, and all trainable parameters of the LSTM hidden layer, attention module, and fully connected layer are updated along the gradient descent direction. The model training uses the Adam optimizer, with an initial learning rate of 0.001, which decays to 0.9 times the current rate every 50 training epochs. The training batch size is set to 32-128, adjusted according to the total number of training samples. The model is trained iteratively on a rate-period basis, with a maximum of 500 training epochs. The early stopping strategy has a waiting period of 30 epochs, meaning training terminates when the validation set loss does not decrease for 30 consecutive epochs, and the model checkpoint with the lowest validation set loss is saved. During training, a gradient pruning strategy is used, with a pruning threshold of 1.0 to prevent gradient explosion. All trainable parameters (including the weight matrix and bias terms of the LSTM hidden layer, the weight parameters and bias terms of the attention module, and the weight matrix and bias terms of the fully connected layer) are updated synchronously through the backpropagation algorithm. Training is iterated repeatedly during the rate period until the composite loss function value no longer decreases significantly during the validation period or reaches the preset maximum number of iterations, thus obtaining a trained LSTM hydrological forecasting model.

[0071] A second objective of this invention is to provide an improved LSTM forecasting system for rapid flooding processes in mountainous areas, comprising: Data acquisition module: used to acquire real-time rainfall and water level sequences for the target watershed; Prediction execution module: used to input the real-time rainfall sequence and real-time water level sequence into the trained LSTM hydrological forecasting model and output the predicted water level sequence; The LSTM hydrological forecasting model comprises an input layer, an LSTM hidden layer, an attention module, and a fully connected layer connected in sequence.

[0072] This system significantly improves the accuracy and reliability of flood forecasting for steep rises and falls in mountainous areas, providing scientific and efficient technical support for flood control scheduling of hydropower stations. Specifically, the data acquisition module automatically collects and serializes real-time rainfall and water level data, providing standardized input data for model prediction; the prediction execution module calls a pre-trained LSTM hydrological forecasting model to complete end-to-end prediction from input to output, achieving accurate forecasting of steep rises and falls in mountainous flood processes.

[0073] In one embodiment of the present invention, a computer device is provided, comprising a processor and a memory. The memory stores a computer program, which includes program instructions. The processor executes the program instructions stored in the computer storage medium. The processor may be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. It is the computing and control core of the terminal, suitable for implementing one or more instructions, specifically suitable for loading and executing one or more instructions from the computer storage medium to achieve a corresponding method flow or function. The processor described in this embodiment of the present invention can be used in the operation of an improved LSTM forecasting method for steep flooding processes in mountainous areas.

[0074] This invention also provides a storage medium, specifically a computer-readable storage medium (Memory), which is a memory device in a computer device used to store programs and data. It is understood that the computer-readable storage medium here can include both the built-in storage medium in the computer device and extended storage media supported by the computer device. The computer-readable storage medium provides storage space that stores the terminal's operating system. Furthermore, this storage space also stores one or more instructions suitable for loading and execution by a processor. These instructions can be one or more computer programs (including program code). It should be noted that the computer-readable storage medium here can be high-speed RAM or non-volatile memory, such as at least one disk storage device. The processor can load and execute one or more instructions stored in the computer-readable storage medium to implement the corresponding steps of the improved LSTM forecasting method for steep rise and fall flood processes in mountainous areas in the above embodiments.

[0075] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0076] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0077] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1The function specified in one or more boxes.

[0078] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0079] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit it. Although the present invention has been described in detail with reference to the above embodiments, those skilled in the art should understand that modifications or equivalent substitutions can still be made to the specific implementation of the present invention. Any modifications or equivalent substitutions that do not depart from the spirit and scope of the present invention should be covered within the scope of protection of the claims of the present invention.

Claims

1. An improved LSTM forecasting method for rapid rise and fall of flood processes in mountainous areas, characterized in that, Includes the following steps: Obtain real-time rainfall and water level sequences for the target watershed; The real-time rainfall sequence and real-time water level sequence are input into the trained LSTM hydrological forecasting model, and the predicted water level sequence is output. The LSTM hydrological forecasting model comprises an input layer, an LSTM hidden layer, an attention module, and a fully connected layer connected in sequence.

2. The improved LSTM forecasting method for steep rise and fall flood processes in mountainous areas according to claim 1, characterized in that, The training method for the LSTM hydrological forecasting model includes: Obtain historical rainfall and water level sequences for the target watershed to form a training sample set; The training sample set is fed into the LSTM hidden layer through the input layer. The LSTM hidden layer extracts temporal features from the input data at each time step and outputs the hidden layer feature vector corresponding to each time step. The attention module receives the hidden layer feature vectors output by the LSTM hidden layer at each time step, calculates the water level change rate based on the water level information corresponding to the hidden layer feature vectors at each time step, compares the water level change rate with a preset steep rise threshold, and assigns attention weights to each time step; the attention module obtains a weighted feature sequence based on the attention weights at each time step and the hidden layer feature vectors at the corresponding time step. The weighted feature sequence is input into the fully connected layer to obtain the predicted water level sequence; Based on the difference between the predicted water level sequence and the actual water level value at the corresponding time in the historical water level sequence, a loss value is calculated using a preset composite loss function. The parameters of the LSTM hydrological forecasting model are then updated based on the loss value to obtain a trained LSTM hydrological forecasting model.

3. The improved LSTM forecasting method for steep rise and fall flood processes in mountainous areas according to claim 2, characterized in that, The step of calculating the water level change rate based on the water level information corresponding to the hidden layer feature vectors at each time point, comparing the water level change rate with a preset steep rise threshold, and assigning attention weights to each time point includes: The attention module extracts water level information from the hidden layer feature vectors at each time step and calculates... Rate of change of water level at time : In the formula, for The actual water level at any given time; for The actual water level at any given time; The rate of change of water level Compared with the preset steep rise threshold Comparison: when ≥ At that moment, assign a high attention weight. , The value range is 0.8 to 1.0; when < At that moment, assign a low attention weight. , The value range is 0.1 to 0.2; The attention module assigns attention weights at each time step. The hidden layer feature vector at the corresponding time point Multiply to obtain the weighted eigenvector. The weighted feature vectors at each time point are summed to form a weighted feature sequence.

4. The improved LSTM forecasting method for steep rise and fall flood processes in mountainous areas according to claim 3, characterized in that, The composite loss function The calculation formula is: In the formula, This is the standard mean square error term; Weighted penalty for flood peak; This is a trend consistency term; , , These are the weighting coefficients for each item; The formula for calculating the conventional mean square error term is as follows: In the formula, This represents the total length of the time series. for The predicted water level at any given time; The formula for calculating the flood peak weighted penalty term is as follows: In the formula, It is the set of time windows consisting of the flood peak point and its adjacent time periods in the measured water level sequence; The number of moments in the time window set; for The penalty coefficient at time, the penalty coefficient Greater than 1; The formula for calculating the trend consistency term is: In the formula, This is a sign function used to determine the direction of water level changes; This is an indicator function. It takes a value of 1 when the predicted water level change direction is inconsistent with the measured water level change direction, and a value of 0 when they are consistent.

5. An improved LSTM forecasting method for steep rise and fall flood processes in mountainous areas according to claim 4, characterized in that, When the predicted water level value Less than the actual water level value At that time, the penalty coefficient will be... Adjusted to 110% of the current value.

6. An improved LSTM forecasting method for steep rise and fall flood processes in mountainous areas according to claim 2, characterized in that, The process of obtaining historical rainfall sequences and historical water level sequences of the target watershed to form a training sample set also includes: Obtain the antecedent rainfall sequence and soil moisture index sequence for the target watershed; The preceding rainfall sequence and the soil moisture index sequence, together with the historical rainfall sequence and the historical water level sequence, are used as input features for each moment in the training sample set.

7. An improved LSTM forecasting method for steep rise and fall flood processes in mountainous areas according to claim 6, characterized in that, The formula for calculating the preceding rainfall sequence is as follows: In the formula, For the first The early part of the day affects rainfall; No. The early part of the day affects rainfall; For the first The actual daily rainfall; This is the drainage coefficient; The formula for calculating the soil moisture content index sequence is as follows: In the formula, For the first Daily soil moisture content index; For the first Daily soil moisture content index; This is the smoothing coefficient.

8. An improved LSTM forecasting system for rapid rise and fall of flood processes in mountainous areas, characterized in that, include: Data acquisition module: used to acquire real-time rainfall and water level sequences for the target watershed; Prediction execution module: used to input the real-time rainfall sequence and real-time water level sequence into the trained LSTM hydrological forecasting model and output the predicted water level sequence; The LSTM hydrological forecasting model comprises an input layer, an LSTM hidden layer, an attention module, and a fully connected layer connected in sequence.

9. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the method as described in any one of claims 1-7.

10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method as described in any one of claims 1-7.