A real-time flood forecasting method for small and medium rivers

By preprocessing and model matching of historical flow and rainfall data of small and medium-sized rivers, and combining LSTM and Transformer models, real-time forecasting of floods in small and medium-sized rivers was achieved, solving the problems of data dependence and poor adaptability, and improving the timeliness and accuracy of forecasts.

CN122364783APending Publication Date: 2026-07-10WUHAN DASHUIYUN TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
WUHAN DASHUIYUN TECH CO LTD
Filing Date
2026-06-05
Publication Date
2026-07-10

AI Technical Summary

Technical Problem

Existing technologies for flood forecasting of small and medium-sized rivers suffer from problems such as strong data dependence, low computational efficiency, poor adaptability, and lack of evaluation and update mechanisms, resulting in insufficient forecast timeliness and accuracy.

Method used

A preprocessing method based on historical flow and rainfall data is adopted, combined with single-station or multi-station forecasting models, and LSTM and Transformer models are used for flood flow forecasting. A rolling update and online accuracy evaluation mechanism is introduced to realize dynamic updating and accuracy optimization of the model.

Benefits of technology

It improves the timeliness and accuracy of flood forecasts for small and medium-sized rivers, simplifies model deployment, enhances adaptability and the reliability of forecast results, and overcomes the problem of accuracy decay during long-term deployment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122364783A_ABST
    Figure CN122364783A_ABST
Patent Text Reader

Abstract

This invention provides a real-time flood forecasting method for small and medium-sized rivers. The method includes preprocessing actual flow data and actual watershed rainfall data from flow measurement stations over past periods to obtain historical flow and rainfall sequences; determining a forecasting model matching the flow measurement stations based on their upstream deployment; when rainfall is expected in the future, invoking the forecasting model to read the historical flow, historical rainfall, and future rainfall forecast sequences, with the output being the flood flow forecast sequence for the flow measurement stations in the future period; and updating the historical flow, historical rainfall, and future rainfall forecast sequences input to the forecasting model based on a preset rolling period to continuously update the flood flow forecast sequence. This method improves the timeliness and operational adaptability of flood forecasts.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of flood forecasting technology, specifically relating to a method for real-time flood forecasting of small and medium-sized rivers. Background Technology

[0002] Small and medium-sized rivers typically exhibit hydrological characteristics such as rapid confluence, sudden flooding, and short forecast periods, placing high demands on the timeliness of flood forecasts. However, the lack of adequate hydrological monitoring infrastructure in most small and medium-sized river basins, coupled with difficulties in obtaining basic data such as meteorological and hydrological data, topography, and land use, hinders the development and application of flood forecasting models.

[0003] Currently, although distributed hydrological models based on physical mechanisms have achieved flood forecasting functions in large watersheds, they have the following limitations when applied to small and medium-sized river watersheds: (1) Strong data dependence: the model requires complete watershed basic data as support, and the data preparation cost is high; (2) Low computational efficiency: the model structure is complex, there are many parameters, and complex parameter calibration is required, resulting in a long calculation cycle and difficulty in meeting the needs of rapid response; (3) Poor adaptability: the model cannot switch forecast modes autonomously according to the actual deployment of upstream hydrological monitoring stations (with / without stations), and lacks a flexible scheduling mechanism; (4) Lack of evaluation and update mechanisms: the model lacks online accuracy evaluation of forecast results and dynamic update mechanism for model parameters, making it difficult to adapt to complex working conditions such as changes in the underlying surface of the watershed and extreme weather events. After long-term operation, the model accuracy continues to decline, affecting the reliability of forecasts. Summary of the Invention

[0004] To address the problems of strong model data dependence, low computational efficiency, poor adaptability, and lack of evaluation and update mechanisms in existing technologies, this invention provides a real-time flood forecasting method for small and medium-sized rivers, which improves the timeliness and accuracy of flood forecasting and solves the application bottlenecks of existing technologies.

[0005] To achieve the above objectives, the present invention adopts the following technical solution:

[0006] A method for real-time flood forecasting of small and medium-sized rivers, the method comprising:

[0007] The actual flow data and actual watershed rainfall data from the flow measurement stations in previous periods are preprocessed to obtain historical flow sequences and historical rainfall sequences.

[0008] Based on the deployment of upstream monitoring stations of the flow measurement station, a forecasting model matching the flow measurement station is determined; wherein, when no monitoring stations are deployed upstream, the forecasting model adopts a single-station forecasting model; when monitoring stations are deployed upstream, the forecasting model is a multi-station forecasting model.

[0009] When rainfall is expected in the future, the forecast model is invoked to read the historical flow sequence, the historical rainfall sequence, and the future rainfall forecast sequence. The output is the flood flow forecast sequence for the flow measurement station in the future period. The future rainfall forecast sequence is the preprocessed rainfall forecast data from the flow measurement station for the future period, obtained based on numerical weather prediction results. The flood flow forecast sequence is the flow forecast result from the flow measurement station for the future period output by the forecast model.

[0010] Based on a preset rolling period, the historical flow sequence, the historical rainfall sequence, and the future rainfall forecast sequence input into the forecast model are updated to continuously update the flood flow forecast sequence; wherein, when the rolling update time is during a rainfall process, the actual watershed rainfall data since the rainfall process and the rainfall forecast data that has not yet occurred are spliced ​​together in chronological order and used as the future rainfall forecast sequence input into the forecast model.

[0011] Preferably, the method further includes:

[0012] The preprocessing includes outlier cleaning, missing value supplementation, rationality verification, and consistency check.

[0013] Preferably, the method further includes:

[0014] The single-station forecast model takes the historical flow sequence and historical rainfall sequence of the flow measurement station over the past m hours, as well as the future rainfall forecast sequence for the next n hours, as inputs, and outputs the flood flow forecast sequence of the flow measurement station for the next n hours.

[0015] The multi-station forecast model takes the historical flow sequence and historical rainfall sequence of the flow measurement station and its upstream monitoring stations over the past m hours, as well as the future rainfall forecast sequence for the next n hours, as inputs, and outputs the flood flow forecast sequence for the flow measurement station for the next n hours.

[0016] Preferably, the method further includes:

[0017] The value of m ranges from 6 to 12, and the value of n ranges from 1 to 12.

[0018] Preferably, the method further includes:

[0019] The single-station forecast model obtains a three-dimensional time-series input tensor by normalizing and reconstructing the input sequence. It then uses a two-layer LSTM hidden layer to forward propagate the three-dimensional time-series input tensor to extract time-series features. The time-series features are then subjected to fully connected layer mapping, ReLU activation function nonlinear transformation, and inverse normalization processing in sequence to output the flood flow forecast sequence.

[0020] The multi-station forecasting model obtains a four-dimensional input tensor by normalizing and reconstructing the input sequence. A spatiotemporal feature vector is calculated from the four-dimensional input tensor through a multi-head attention layer. The spatiotemporal feature vector is then dimensionality-reduced and fused using a two-layer feedforward neural network. The fused spatiotemporal feature vector is then sequentially subjected to the fully connected layer mapping, the ReLU activation function nonlinear transformation, and the inverse normalization process to output the flood flow forecast sequence.

[0021] Preferably, the method further includes:

[0022] The preset rolling period is 1 hour. After each preset rolling period, the forecast model will reread the latest historical flow sequence and historical rainfall sequence of the past m hours, as well as the future rainfall forecast sequence of the next n hours, and calculate and update the flood flow forecast sequence of the station for the next n hours.

[0023] Preferably, the method further includes:

[0024] An online accuracy evaluation mechanism is introduced to evaluate the accuracy of the forecast model;

[0025] The online accuracy evaluation mechanism includes at least two of the following indicators: mean absolute error (MAE), root mean square error (RMSE), Nash efficiency coefficient (NSE), and Kling-Gupta efficiency coefficient (KGE).

[0026] Preferably, the method further includes:

[0027] The online accuracy evaluation mechanism sets weights for the indicators according to different flood process stages, and outputs corresponding comprehensive scores and levels; wherein, the flood process stages include rising water stage, flood peak stage, receding water stage and low water stage.

[0028] Preferably, the method further includes:

[0029] An online model update and training mechanism is established. When the level indicates that the accuracy of the forecast model does not meet the requirements, the online model update and training mechanism is triggered. The historical flow sequence and the historical rainfall sequence of the latest time period are extracted, included in the sample dataset, and the forecast model is retrained and updated.

[0030] Preferably, the method further includes:

[0031] The determination of whether there will be rainfall in the future period is based on meteorological forecast results, rainfall warning information or rainfall trigger thresholds set by the operational side. Once the determination is successful, the forecast model is triggered to output the flood flow forecast sequence and update it on a rolling basis.

[0032] Compared with the prior art, the present invention has the following beneficial effects:

[0033] (1) This invention uses historical flow and rainfall sequences from past periods, as well as future rainfall forecast sequences from future periods, as the core inputs of the model. It abandons the excessive reliance of existing model methods on basic data of complex watersheds, solves the problem of difficulty in flood forecasting caused by the scarcity of data on small and medium-sized rivers and the imperfect basic data, and improves the ease of deployment of forecast models.

[0034] (2) The present invention can automatically match the corresponding forecast model according to the layout of the flow measurement station and the upstream monitoring station, effectively address the problem of uneven distribution of monitoring stations, significantly improve the adaptability of the forecast model to the actual business scenario, and achieve stable and reliable flood forecasting.

[0035] (3) By introducing a rolling update strategy for flood flow forecast sequences, this invention automatically retrieves the latest historical flow sequences and historical rainfall sequences from previous periods, thereby realizing the dynamic updating of forecast model parameters and continuous forecasting of flood flow forecast sequences, which solves the prominent problem of short flood forecast periods for small and medium-sized rivers.

[0036] (4) The present invention adopts a closed-loop design of online accuracy evaluation mechanism and online model update training mechanism to monitor the forecast performance and reliability of forecast results of the forecast model in real time. When the forecast accuracy does not meet the requirements, the dataset is automatically expanded and the model is retrained. This overcomes the problems of accuracy decay and instability of the model in long-term deployment and application, and significantly improves the continuous optimization capability of the model and the reliability of the monitoring results. Attached Figure Description

[0037] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the following description of the embodiments are briefly explained. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0038] Figure 1 This is a flowchart illustrating a method for real-time flood forecasting of small and medium-sized rivers in an embodiment of the present invention;

[0039] Figure 2 This is a schematic diagram of the structure of a single-station forecasting model in an embodiment of the present invention;

[0040] Figure 3 This is a schematic diagram of the structure of the multi-station forecasting model in an embodiment of the present invention;

[0041] Figure 4 This is a schematic diagram of the process for rolling updates of flood flow forecast sequences in an embodiment of the present invention;

[0042] Figure 5 This is a flowchart illustrating the online accuracy evaluation mechanism in an embodiment of the present invention;

[0043] Figure 6 This is a flowchart illustrating the online model update and training mechanism in an embodiment of the present invention. Detailed Implementation

[0044] To make the objectives, technical solutions, and advantages of this invention more apparent and understandable, the technical solutions of this invention will be clearly and completely described below in conjunction with the accompanying drawings and specific embodiments. It should be noted that the described embodiments are only a part of the embodiments of this invention, and not all of them. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.

[0045] Please see Figure 1 As shown, the present invention provides a real-time flood forecasting method for small and medium-sized rivers, comprising the following steps:

[0046] S1. Preprocess the actual flow data and actual watershed rainfall data of the flow measurement stations in the past time period to obtain historical flow sequences and historical rainfall sequences, and construct a sample dataset accordingly.

[0047] Step S1 in this embodiment of the invention specifically includes:

[0048] The actual flow data of the flow measurement station in the past period and the corresponding actual watershed rainfall data are obtained. The actual flow data and the actual watershed rainfall data are preprocessed to obtain historical flow sequences and historical rainfall sequences, respectively.

[0049] In some implementations, the actual watershed rainfall data includes the actual rainfall data of the watershed to which the flow measurement station belongs. The preprocessing includes outlier cleaning, missing value supplementation, rationality verification, and consistency testing. Outlier cleaning includes identifying, removing, or correcting outliers such as missing data, duplicate records, obviously erroneous timestamps, and outliers that significantly exceed historical reasonable ranges. Missing value supplementation preferably includes supplementing missing data using methods such as linear interpolation, adjacent time period patching, or backfilling of adjacent segments from the same event, depending on operational needs. Rationality verification includes screening the trend of the actual flow data at the flow measurement station against the process matching of the actual watershed rainfall data. Consistency testing preferably includes verifying the time alignment, sampling interval, and unit caliber of the actual flow data and the actual watershed rainfall data.

[0050] The data is divided into several samples according to a preset time step. Each sample includes the historical flow sequence of the flow measurement station and all monitoring stations deployed upstream, along with the historical rainfall data for the corresponding time period, thereby constructing a sample dataset. The preset time step is selected according to the actual business scenario requirements, and is typically set to 0.5 hours or 1 hour.

[0051] In some implementations, labels such as flood event number, start and end times, and watershed topology can be added to each sample to provide a basis for the selection of subsequent forecast models and to provide the latest input window for the rolling update of forecast results.

[0052] This step preprocesses the actual flow data from the flow measurement stations and the actual rainfall data from the watershed to construct a standardized, high-quality, and labeled sample dataset, providing a reliable data foundation and judgment basis for the subsequent accurate scheduling of forecast models and the rolling updates of forecast results.

[0053] S2. Based on the deployment of upstream monitoring stations of the flow measurement station, determine the forecast model that matches the flow measurement station.

[0054] Step S2 in this embodiment of the invention specifically includes:

[0055] Based on the watershed topology of the flow measurement station, it is determined whether the monitoring station is located upstream of the flow measurement station, thereby determining the forecast model that matches the flow measurement station.

[0056] Specifically, when no monitoring station is set up upstream of the flow measurement station, a single-station forecasting model is used for flood forecasting; when the monitoring station is set up upstream of the flow measurement station, a multi-station forecasting model is used for flood forecasting.

[0057] In some implementations, a corresponding model registration table can be established for the forecast model. The model registration table includes at least the model type name, applicable station conditions, required input sequence, data range read during rolling updates, and output result format. Based on the model registration table, model calling rules are pre-defined. When a future rainfall event is detected, there is no need to re-determine which forecast model to use; instead, the corresponding forecast model can be called from the model registration table based on the deployment of monitoring stations upstream of the flow measurement station and the sample label information.

[0058] In some implementations, if the monitoring station exists upstream but does not conduct traffic monitoring in the current rolling period, i.e., the actual traffic data of the monitoring station is empty, then the current multi-station forecasting model automatically reverts to the single-station forecasting model.

[0059] This step matches single-station or multi-station forecast models based on the watershed topology of the flow measurement stations. It establishes a stable mapping between stations and models through preset rules and a model registration table, supports dynamic scheduling of forecast models based on data availability, and improves the robustness of model calls and the reliability of flood forecasts.

[0060] S3. When there is a rainfall process in the future period, the forecast model is called to read the historical flow sequence, the historical rainfall sequence and the future rainfall forecast sequence, and its output is the flood flow forecast sequence of the flow measurement station in the future period.

[0061] Step S3 in this embodiment of the invention specifically includes:

[0062] Based on meteorological forecasts, rainfall warnings, or rainfall trigger thresholds set by the operational side, the system determines whether future rainfall is likely. Once determined, the forecast model reads the historical flow and rainfall sequences prior to the current time, and simultaneously reads the future rainfall forecast sequence for the future period, forming the first round of input to the forecast model. Using the forecast model matched to the monitoring station, the model outputs a flood flow forecast sequence for the future period. This flood flow forecast sequence is the flow forecast result for the flow monitoring station in the future period, output by the forecast model. The future rainfall forecast sequence is the preprocessed rainfall forecast data for the flow monitoring station in the future period, obtained based on numerical weather prediction results released by the meteorological department.

[0063] In some implementations, please refer to Figure 2 As shown, the single-station forecasting model adopts a flood forecasting model based on a two-layer LSTM. Its specific network architecture, number of neurons, loss function form or training strategy are not considered as core limitations of this invention.

[0064] Specifically, the single-station forecast model uses the historical flow sequence and historical rainfall sequence of the flow measurement station over the past m hours, as well as the future rainfall forecast sequence for the next n hours, as input data. The input sequence is normalized using the Min-Max normalization method to eliminate the dimensional differences between different data. The processed input sequence is then reconstructed into a three-dimensional time-series input tensor with a time step of 1 hour. The three-dimensional time-series input tensor includes the flow feature dimension, the rainfall feature dimension, and the time step dimension.

[0065] The three-dimensional time-series input tensor is forward-propagated using a two-layer LSTM hidden layer. By leveraging the temporal feature learning capability of the hidden layer, the hysteresis response relationship between rainfall and flow rate and the temporal variation trend of flow rate itself are explored at the flow measurement station. A high-dimensional time-series feature vector adapted to the forecast for the next n hours is then extracted.

[0066] The high-dimensional time-series feature vector is input into a fully connected layer, which maps the high-dimensional features to one-dimensional flow forecast values. The ReLU activation function is then used to perform a nonlinear transformation on the one-dimensional flow forecast values ​​to remove negative values. Combined with the historical hydrological scale parameters of the flow measurement station, the Min-Max inverse normalization method is used to inverse normalize the removed one-dimensional flow forecast values, and the flood flow forecast sequence for the flow measurement station in the next n hours is output.

[0067] The historical hydrological scale parameters include the maximum and minimum values ​​of the flow data in the historical flow sequence. The values ​​of m and n are determined according to the watershed confluence time and operational forecasting requirements of the flow measurement station. Generally, the value range of m is [6~12] and the value range of n is [1~12]. There are no restrictions on the size of the two values, and they can be selected according to actual operational needs.

[0068] In some implementations, please refer to Figure 3 As shown, the multi-station forecasting model adopts a flood forecasting model based on time series Transformer, but the specific network architecture, loss function form or training strategy is not considered as a core limitation of this invention.

[0069] Specifically, the multi-station forecasting model uses the historical flow and historical rainfall sequences of the flow measurement station and all upstream monitoring stations over the past m hours, as well as the future rainfall forecast sequence for the next n hours, as input sequences. The input sequences are then subjected to Min-Max normalization to eliminate dimensional differences between different monitoring stations and different input data. The normalized data is reconstructed according to a 1-hour time step, resulting in a four-dimensional input tensor containing station feature dimensions, flow feature dimensions, rainfall feature dimensions, and time step dimensions. By adding spatiotemporal location encoding to this four-dimensional input tensor, which is used to embed station spatial location and time step sequence information into the model, the temporal awareness capability of the Transformer model is enhanced, resulting in a four-dimensional input tensor with spatiotemporal location encoding.

[0070] By using a multi-head self-attention layer to calculate attention weights across stations and across time for the four-dimensional input tensor with spatiotemporal location encoding, the system automatically learns the flood impact weights of flow and rainfall data from different upstream monitoring stations on the flow measurement station, mines the spatial correlation and temporal linkage features of rainfall and flow data from upstream and downstream stations, and outputs a high-dimensional spatiotemporal feature vector fused from multiple stations.

[0071] The high-dimensional spatiotemporal feature vector is input into a two-layer feedforward neural network. Utilizing the feature extraction and dimension transformation capabilities of the feedforward neural network, a core feature vector adapted to the flow forecast for the next n hours is generated. The core feature vector is then input into a fully connected layer to complete the mapping from high-dimensional features to one-dimensional flow forecast values. After nonlinear transformation using the ReLU activation function, unreasonable negative forecast values ​​are eliminated. Min-Max inverse normalization is then performed using the historical hydrological scale parameters of the flow measurement station to output the flood flow forecast sequence for the next n hours of the flow measurement station.

[0072] This step utilizes rainfall forecast-triggered scheduling logic to achieve real-time flood forecasting driven by rainfall. It can accurately match single-station or multi-station forecast models based on the upstream monitoring deployment of flow measurement stations. Relying on the model's ability to mine hydrological characteristics, it efficiently outputs flood flow forecast sequences for future periods. This not only ensures the immediate responsiveness of flood forecasts but also improves the alignment between forecast results and actual hydrological processes, providing accurate and efficient technical support for flood control in small and medium-sized rivers.

[0073] S4. Based on a preset rolling period, update the historical flow sequence, the historical rainfall sequence, and the future rainfall forecast sequence input to the forecast model to continuously update the flood flow forecast sequence.

[0074] Step S4 in this embodiment of the invention specifically includes:

[0075] Please see Figure 4 As shown, the preset rolling period is set to 1 hour. After each preset rolling period, the forecast model rereads the latest historical flow sequence of the past m hours up to the current time, and simultaneously refreshes the corresponding historical rainfall sequence of the past m hours and the future rainfall forecast sequence of the next n hours.

[0076] In some implementations, once a future rainfall event is first identified, the first round of the flood flow forecast sequence for the next n hours is output, and the result is associated with the current trigger time and recorded.

[0077] In some implementations, when a rainfall event is not identified for the first time, the forecast model is invoked to reread the historical flow sequence, the historical rainfall sequence, and the future rainfall forecast sequence up to the current time, according to the next preset rolling cycle, so as to realize the rolling update of the flood flow forecast sequence for the next n hours.

[0078] In some implementations, if the start time of the next preset rolling cycle (i.e., the rolling update time) is already during a rainfall event, the future rainfall forecast sequence input into the forecast model in that rolling cycle consists of two parts: one part is the actual rainfall data since the rainfall event began, and the other part is the rainfall forecast data that has not occurred since the rolling update time. The actual rainfall data and the rainfall forecast data are concatenated in chronological order, and the concatenated rainfall data is used as the future rainfall forecast sequence. This, along with the historical flow sequence and the historical rainfall sequence, is input into the forecast model to achieve the rolling update of the flood flow forecast sequence.

[0079] This step utilizes a preset rolling cycle mechanism to refresh the input data of the forecast model, and adjusts the data input method in conjunction with the rainfall occurrence status to achieve dynamic rolling updates of the flood flow forecast sequence, accurately capture real-time changes in flood evolution, and ensure the timeliness and relevance of flood forecasts.

[0080] S5. An online accuracy evaluation mechanism is introduced to comprehensively score and grade the forecast accuracy of the forecast model. A synchronous online model update and training mechanism is established so that when the forecast accuracy does not meet the requirements, the latest time period data is extracted to train and update the forecast model.

[0081] Step S5 in this embodiment of the invention specifically includes:

[0082] In this step, please refer to Figure 5 As shown, the online accuracy evaluation mechanism is used to perform a posteriori quality assessment of the accuracy of the forecast results of the forecast model. It uses at least two of the following indicators for comprehensive evaluation: mean absolute error (MAE), root mean square error (RMSE), Nash efficiency coefficient (NSE), and Kling-Gupta efficiency coefficient (KGE).

[0083] The expression for the mean absolute error (MAE) is:

[0084]

[0085] In the formula, Indicates the time sequence number. This indicates that the flood flow forecast sequence is in the 1st... The predicted flow rate at each time point; Indicates the first The actual flow rate at each given time.

[0086] The expressions for the root mean square error (RMSE) and the Nash efficiency coefficient (NSE) are as follows:

[0087]

[0088]

[0089] In the formula, The average of the n actual flow values ​​can be expressed as:

[0090]

[0091] The expression for the Kling-Gupta efficiency coefficient KGE is as follows:

[0092]

[0093] In the formula, This represents the correlation coefficient, which ranges from [-1, 1], and is typically set to a value of [value missing]. >0.7, The mean deviation is used to measure the degree of deviation of the flood flow forecast sequence, and its ideal range is [0.9, 1.1]. =1 indicates that the flood flow forecast sequence is completely consistent with the actual flow value. A value greater than 1 indicates that the flood flow forecast sequence is too large. <1 indicates that the flood flow forecast sequence is too small. This represents the variability bias, used to measure the fluctuation range deviation of the flood forecast variation sequence, with an ideal range of [0.9, 1.1]. =1 indicates that the fluctuation range of the flood flow forecast sequence is completely consistent with that of the actual flow value. A value >1 indicates that the flood flow forecast sequence fluctuates more than the actual flow value, specifically with higher peak values ​​and lower trough values. <1 indicates that the flood flow forecast sequence fluctuates more gently than the actual flow value, specifically with lower flood peaks and higher troughs.

[0094] The above indicators are normalized. Specifically, for the Mean Absolute Error (MAE) and the Root Mean Square Error (RMSE), the smaller the value, the higher the forecast accuracy. They are normalized using the form 1 / (1 + indicator value), i.e.:

[0095]

[0096]

[0097] For the Nash efficiency coefficient NSE and the Kling-Gupta efficiency coefficient KGE, the larger the value, the higher the forecast accuracy. They are normalized using the form (1 + index value) / 2, i.e.:

[0098]

[0099]

[0100] In some implementations, based on the baseflow index corresponding to the flow measurement station, the flood peak process is divided into rising water stage, flood peak stage, receding water stage and low water stage. By assigning weights to the index, a comprehensive score and corresponding level of the forecast accuracy of the forecast model are output.

[0101] In some implementations, based on industry experience, the index weight of the flood rise section is generally as follows: : , : , : , : The index weight of the flood peak section is: : , : , : , : The index weight of the receding water section is: : , : , : , : The index weights for the dry season are: : , : , : , : .

[0102] In some implementations, the formula for calculating the comprehensive score P is:

[0103]

[0104] The grading criteria are as follows: P ≥ 0.85 indicates excellent, 0.75 ≤ P < 0.85 indicates good, 0.6 ≤ P < 0.75 indicates acceptable, and P < 0.6 indicates unacceptable.

[0105] In some implementations, please refer to Figure 6As shown, when the level is unqualified, it indicates that the forecast accuracy of the forecast model does not meet the requirements. The automatic online model update training mechanism is then activated, which involves extracting the latest historical flow sequence and the corresponding historical rainfall sequence, incorporating them into the sample dataset, retraining the forecast model, and updating the forecast model.

[0106] In some implementations, the classification criteria can be set independently according to actual business needs to achieve retraining and updating of the forecast model.

[0107] This step introduces an online accuracy evaluation mechanism and simultaneously establishes an online model update and training mechanism. By comprehensively scoring and rating the forecast accuracy of the forecast model, the model is automatically retrained and updated when the forecast accuracy is not up to standard. This overcomes the problems of accuracy decay and insufficient stability of forecast models in long-term deployment and application, and improves the model's self-optimization ability and the reliability of monitoring results.

[0108] In one specific embodiment, when no monitoring station is located upstream of the flow measurement station, and the weather forecast indicates significant rainfall within the next 6 hours, it can be determined that the station uses a single-station forecast model. This model reads the historical flow sequence of the past 8 hours, the historical rainfall sequence, and the future rainfall forecast sequence for the next 6 hours from the flow measurement station, and outputs the first round of flood flow forecast sequence for the next 6 hours. Subsequently, after each rolling cycle of 1 hour, as new historical flow and rainfall data are acquired, the latest historical flow sequence of the past 8 hours, the historical rainfall sequence, and the latest future rainfall forecast sequence for the next 6 hours are continuously input, continuously updating and refreshing the flood flow forecast sequence for the next 6 hours.

[0109] If, after a certain rolling cycle, rainfall has occurred for 1 hour at the current time, the historical rainfall sequence of the past 1 hour and the future rainfall forecast sequence of the next 5 hours are used as the future rainfall forecast sequence for the next 6 hours. This sequence, along with the historical flow sequence and the historical rainfall sequence of the past 8 hours, are input into the single-station forecast model to achieve the rolling update of the flood flow forecast sequence.

[0110] In summary, this invention discloses a real-time flood forecasting method for small and medium-sized rivers. It constructs a high-quality sample dataset through data preprocessing, adapts the forecasting model based on station topology and implements dynamic scheduling, triggers the model to output the first round of forecast results, relies on a rolling cycle mechanism to update input data to ensure forecast timeliness, introduces an online accuracy evaluation mechanism, and establishes an online model update and training mechanism. This effectively addresses the core pain points in small and medium-sized river flood forecasting, such as high data quality requirements, poor model adaptability, and long-term deployment accuracy decay, achieving accurate and efficient flood forecasting throughout the entire process and providing reliable technical support for flood control and prevention.

[0111] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of the present invention.

Claims

1. A method for real-time flood forecasting of small and medium-sized rivers, characterized in that, The method includes: The actual flow data and actual watershed rainfall data from the flow measurement stations in previous periods are preprocessed to obtain historical flow sequences and historical rainfall sequences. Based on the deployment of upstream monitoring stations of the flow measurement station, a forecasting model matching the flow measurement station is determined; wherein, when no monitoring stations are deployed upstream, the forecasting model adopts a single-station forecasting model; when monitoring stations are deployed upstream, the forecasting model is a multi-station forecasting model. When rainfall is expected in the future, the forecast model is invoked to read the historical flow sequence, the historical rainfall sequence, and the future rainfall forecast sequence. The output is the flood flow forecast sequence for the flow measurement station in the future period. The future rainfall forecast sequence is the preprocessed rainfall forecast data from the flow measurement station for the future period, obtained based on numerical weather prediction results. The flood flow forecast sequence is the flow forecast result from the flow measurement station for the future period output by the forecast model. Based on a preset rolling period, the historical flow sequence, the historical rainfall sequence, and the future rainfall forecast sequence input into the forecast model are updated to continuously update the flood flow forecast sequence; wherein, when the rolling update time is during a rainfall process, the actual watershed rainfall data since the rainfall process and the rainfall forecast data that has not yet occurred are spliced ​​together in chronological order and used as the future rainfall forecast sequence input into the forecast model.

2. The method for real-time flood forecasting of small and medium-sized rivers according to claim 1, characterized in that, The method further includes: The preprocessing includes outlier cleaning, missing value supplementation, rationality verification, and consistency testing.

3. The method for real-time flood forecasting of small and medium-sized rivers according to claim 1, characterized in that, The method further includes: The single-station forecast model takes the historical flow sequence and historical rainfall sequence of the flow measurement station over the past m hours, as well as the future rainfall forecast sequence for the next n hours, as inputs, and outputs the flood flow forecast sequence of the flow measurement station for the next n hours. The multi-station forecast model takes the historical flow sequence and historical rainfall sequence of the flow measurement station and its upstream monitoring stations over the past m hours, as well as the future rainfall forecast sequence for the next n hours, as inputs, and outputs the flood flow forecast sequence for the flow measurement station for the next n hours.

4. The method for real-time flood forecasting of small and medium-sized rivers according to claim 3, characterized in that, The method further includes: The value of m ranges from [6 to 12], and the value of n ranges from [1 to 12].

5. The method for real-time flood forecasting of small and medium-sized rivers according to claim 3, characterized in that, The method includes: The single-station forecast model obtains a three-dimensional time-series input tensor by normalizing and reconstructing the input sequence. It then uses a two-layer LSTM hidden layer to forward propagate the three-dimensional time-series input tensor to extract time-series features. The time-series features are then subjected to fully connected layer mapping, ReLU activation function nonlinear transformation, and inverse normalization processing in sequence to output the flood flow forecast sequence. The multi-station forecasting model obtains a four-dimensional input tensor by normalizing and reconstructing the input sequence. A multi-head attention layer is used to calculate the spatiotemporal feature vector of the four-dimensional input tensor. The spatiotemporal feature vector is then dimensionality-reduced and fused using a two-layer feedforward neural network. The fused spatiotemporal feature vector is then sequentially subjected to the fully connected layer mapping, the ReLU activation function nonlinear transformation, and the inverse normalization process to output the flood flow forecast sequence.

6. The method for real-time flood forecasting of small and medium-sized rivers according to claim 1, characterized in that, The method further includes: The preset rolling period is 1 hour. After each preset rolling period, the forecast model will reread the latest historical flow sequence and historical rainfall sequence of the past m hours, as well as the future rainfall forecast sequence of the next n hours, and calculate and update the flood flow forecast sequence of the station for the next n hours.

7. The method for real-time flood forecasting of small and medium-sized rivers according to claim 1, characterized in that, The method further includes: An online accuracy evaluation mechanism is introduced to evaluate the accuracy of the forecast model; The online accuracy evaluation mechanism includes at least two of the following indicators: mean absolute error (MAE), root mean square error (RMSE), Nash efficiency coefficient (NSE), and Kling-Gupta efficiency coefficient (KGE).

8. The method for real-time flood forecasting of small and medium-sized rivers according to claim 7, characterized in that, The method further includes: The online accuracy evaluation mechanism sets weights for the indicators according to different flood process stages, and outputs corresponding comprehensive scores and levels; wherein, the flood process stages include rising water stage, flood peak stage, receding water stage and low water stage.

9. The method for real-time flood forecasting of small and medium-sized rivers according to claim 8, characterized in that, The method further includes: An online model update and training mechanism is established. When the level indicates that the accuracy of the forecast model does not meet the requirements, the online model update and training mechanism is triggered. The historical flow sequence and the historical rainfall sequence of the latest time period are extracted, included in the sample dataset, and the forecast model is retrained and updated.

10. The method for real-time flood forecasting of small and medium-sized rivers according to claim 1, characterized in that, The method further includes: The determination of whether there will be rainfall in the future period is based on meteorological forecast results, rainfall warning information or rainfall trigger thresholds set by the operational side. Once the determination is successful, the forecast model is triggered to output the flood flow forecast sequence and update it on a rolling basis.