River flow prediction method and system based on multi-scale feature extraction

By adopting a multi-scale feature extraction method in river flow prediction, using deep learning models such as CNN, TCN and BiGRU, the multi-scale features in river flow data are extracted and learned, and the problem of low accuracy of river flow prediction in the existing technology is solved, and higher prediction accuracy and adaptability are achieved.

CN119558677AActive Publication Date: 2025-03-04SHANDONG UNIV
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202411601924.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-11
Publication Date
2025-03-04
Estimated Expiration
2044-11-11

AI Technical Summary

Technical Problem

The prior art is difficult to fully explore multi-scale features in river flow data, resulting in low accuracy in river flow prediction.

Method used

The river flow prediction method based on multi-scale feature extraction is adopted, and the local and seasonal features in the river flow data are extracted through deep learning models such as convolutional neural network (CNN), time convolutional network (TCN) and bidirectional gated cyclic unit (BiGRU), and the local and seasonal features in the river flow data are learned, and the relationship between the features is predicted.

Benefits of technology

This method can more accurately capture multi-scale features in river flow data, improve the accuracy and robustness of river flow prediction, and is suitable for complex river basin environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119558677A_ABST
    Figure CN119558677A_ABST
Patent Text Reader

Abstract

The invention discloses a river flow prediction method and system based on multi-scale feature extraction, and relates to the technical field of river flow prediction and deep learning. The method comprises the steps of obtaining river flow data, and performing preliminary feature extraction and screening on river flow to obtain river flow preliminary features; the preliminary features of the river flow are preprocessed; a river flow model is used for predicting the preliminary features of the river flow after preprocessing, a river flow prediction result is obtained, the prediction process comprises the steps that local feature extraction and seasonal feature extraction are carried out on the preliminary features of the river flow, then mutual relation learning is carried out on the extracted features of different scales, and the prediction result of the river flow is obtained. And predicting the river flow according to a learning result. According to the method, the multi-scale features in the river flow and the complex relation between the features are fully considered, and the accuracy of river flow prediction is effectively improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of river flow prediction and deep learning technology, and in particular to a river flow prediction method and system based on multi-scale feature extraction. Background Art

[0002] The statements in this section merely provide background information related to the present invention and do not necessarily constitute prior art.

[0003] With the intensification of global climate change and the frequent occurrence of extreme weather events, accurate and reliable hydrological forecasts play a vital role in water resources management, flood prevention, and environmental sustainable development. However, the complexity and uncertainty of hydrological processes make traditional hydrological models, such as statistical models and physical models, face great challenges in processing large-scale data and long-term series prediction. In recent years, with the rapid development of deep learning technology, it has been widely used in the field of hydrological forecasting. Deep learning has shown great potential in processing large amounts of data and simulating complex hydrological processes. Existing studies have shown that the performance and effects of various deep learning models have surpassed traditional hydrological models and physical models.

[0004] Among the deep learning models currently used for river flow prediction, such as LSTM, GRU, and S2S models, these models only analyze data at a single time scale, which brings certain limitations. Actual river flow data will show different characteristics at different time scales. On the hourly scale, river flow usually changes slowly, but in the case of sudden rainfall, the flow will rise rapidly and fall rapidly after the rainfall ends; on the daily scale, river flow shows a series of peaks and troughs, which is caused by factors such as daily evaporation and temperature changes. On the monthly scale, river flow shows obvious seasonal fluctuations with seasonal changes, such as higher flow due to increased rainfall in summer, and lower flow due to reduced rainfall and increased evaporation in autumn and winter. These characteristics can be divided into local characteristics and seasonal characteristics. Local characteristics reflect short-term fluctuations on the hourly scale, and seasonal characteristics reflect long-term periodic changes on the monthly and annual scales.

[0005] Currently, existing analysis of river flow data at a single scale cannot capture the full picture of river dynamics. This approach may ignore important features at certain scales, resulting in incomplete analysis results. For example, models that focus mainly on hourly flow changes cannot capture seasonal characteristics in the data, resulting in low accuracy when making predictions. River flow has complex dynamic characteristics and has different characteristics at different time scales. Analysis at a single scale is usually not enough to fully capture all characteristics, making it difficult for the model to provide comprehensive and accurate predictions.

[0006] Therefore, how to comprehensively mine the multi-scale features in river flow data, make full use of the interactions between the features, and achieve more accurate river flow prediction has become a technical problem that needs to be urgently solved by existing technologies. Summary of the invention

[0007] In view of the shortcomings of the prior art, the purpose of the present invention is to provide a river flow prediction method and system based on multi-scale feature extraction, which can extract local features and seasonal features in river flow data and effectively capture multi-scale features in river flow data. The extracted multi-scale features are further analyzed and modeled, the interaction between different features is fully considered, and the dynamic changes of river flow are deeply studied and predicted.

[0008] In order to achieve the above object, the present invention is implemented through the following technical solutions:

[0009] A first aspect of the present invention provides a river flow prediction method based on multi-scale feature extraction, comprising the following steps:

[0010] Obtain river flow data, perform preliminary feature extraction and screening on river flow, and obtain preliminary features of river flow;

[0011] Preprocessing of preliminary characteristics of river flow;

[0012] The river flow model is used to predict the preprocessed preliminary characteristics of the river flow to obtain the river flow prediction results. The prediction process includes extracting local characteristics and seasonal characteristics of the preliminary characteristics of the river flow, and then learning the relationship between the extracted features of different scales, and predicting the river flow based on the learning results.

[0013] Furthermore, preprocessing steps of data filtering, normalization and transformation were performed for preliminary characteristics of river discharge.

[0014] Furthermore, the river flow prediction model construction process includes:

[0015] Divide the known data set into training set and test set;

[0016] Build the river flow prediction model structure and use the training set to train the river flow prediction model;

[0017] Use the test set to verify the prediction effect of the trained model.

[0018] Furthermore, the river flow prediction model structure consists of a convolutional neural network, a temporal convolutional network and a bidirectional gated recurrent unit. The convolutional neural network is used to extract local features from the preliminary characteristics of river flow, the temporal convolutional network is used to extract seasonal features from the preliminary characteristics of river flow, and the bidirectional gated recurrent unit is used to learn the relationship between the extracted features of different scales, and the river flow is predicted based on the learning results.

[0019] Furthermore, the river flow prediction model is evaluated using evaluation indicators, and the river flow prediction model parameters are adjusted according to the evaluation results.

[0020] Furthermore, the specific steps for training the river flow prediction model using the training set are:

[0021] Input the training set into the constructed river flow prediction model for training;

[0022] Set the number of training rounds, determine the optimizer used in the training process, and set the learning rate;

[0023] After each round of training, check whether the current model is the optimal model. If it is the optimal model, save it locally. If not, continue training.

[0024] Set an early stopping strategy to avoid overfitting.

[0025] Furthermore, the specific steps of using the river flow model to predict the preliminary characteristics of the preprocessed river flow are as follows:

[0026] Load the optimal model after training and enter the gradient-free calculation mode;

[0027] Traverse the data to be tested and predict the future river flow;

[0028] For the prediction results, the normalization method is used to denormalize the results.

[0029] A second aspect of the present invention provides a river flow prediction system based on multi-scale feature extraction, comprising:

[0030] The data acquisition module is configured to acquire river flow data, perform preliminary feature extraction and screening on the river flow, and obtain preliminary features of the river flow;

[0031] a data processing module configured to pre-process preliminary characteristics of river flow;

[0032] The flow prediction module is configured to use the river flow model to predict the preprocessed preliminary characteristics of the river flow to obtain the river flow prediction result, wherein the prediction process includes extracting local characteristics and seasonal characteristics of the preliminary characteristics of the river flow, and then learning the relationship between the extracted features of different scales, and predicting the river flow based on the learning results.

[0033] The third aspect of the present invention provides a medium having a program stored thereon, which, when executed by a processor, implements the steps in the river flow prediction method based on multi-scale feature extraction as described in the first aspect of the present invention.

[0034] The fourth aspect of the present invention provides a device, including a memory, a processor, and a program stored in the memory and executable on the processor, wherein when the processor executes the program, the steps in the river flow prediction method based on multi-scale feature extraction as described in the first aspect of the present invention are implemented.

[0035] One or more of the above technical solutions have the following beneficial effects:

[0036] The present invention discloses a river flow prediction method and system based on multi-scale feature extraction, which can effectively extract features and patterns observed at different time scales, i.e., multi-scale features, from river flow data. Through this method, the model can more accurately capture short-term and long-term trends, and improve the accuracy of river flow prediction.

[0037] The present invention can process multi-scale features extracted at different time scales and learn the complex relationships between features through hidden units. This enables the model to capture long-term dependencies and relationships between features, thereby more accurately predicting future river flows.

[0038] The system of the present invention can be conveniently deployed in a distributed manner, supports the storage and processing of large-scale river flow data sets, and is suitable for complex river basin environments.

[0039] The system described in the present invention includes an integrated deep learning model based on multi-scale feature extraction, and users can use this system to train and predict the model with only a small amount of adjustments.

[0040] Advantages of additional aspects of the present invention will be given in part in the following description, and in part will become obvious from the following description, or will be learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] The accompanying drawings in the specification, which constitute a part of the present invention, are used to provide a further understanding of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute improper limitations on the present invention.

[0042] Figure 1 This is a flow chart of a river flow prediction method based on multi-scale feature extraction in Embodiment 1 of the present invention;

[0043] Figure 2 This is a schematic diagram of the river flow model structure in Example 1 of the present invention. DETAILED DESCRIPTION

[0044] It should be noted that the following detailed descriptions are exemplary and are intended to provide further explanation of the present invention. Unless otherwise specified, all technical and scientific terms used herein have the same meanings as those commonly understood by those skilled in the art to which the present invention belongs.

[0045] It should be noted that the terms used herein are only for describing specific embodiments and are not intended to limit the exemplary embodiments according to the present invention. As used herein, unless the context clearly indicates otherwise, the singular form is also intended to include the plural form. In addition, it should be understood that when the terms "include" and / or "include" are used in this specification, it indicates the presence of features, steps, operations, devices, components and / or their combinations;

[0046] Embodiment 1:

[0047] The first embodiment of the present invention provides a river flow prediction method based on multi-scale feature extraction, such as Figure 1 As shown in the figure, firstly, the river flow data set is obtained, and the characteristic variables closely related to the river flow are screened out; the time series data of river flow is preprocessed, including data normalization, noise removal, etc., and the preprocessed data set is divided into a training set and a test set; next, a CNN-TCN-BiGRU integrated deep learning model is constructed; then the preprocessed training set data is input into the CNN-TCN-BiGRU model to train the model, and the optimal model in the training process is saved; the test set data is input into the optimal model to verify the prediction effect of the model; the actual river flow data after preprocessing is input into the optimal model to predict the future river flow; finally, the prediction results are evaluated using the relevant evaluation indicators NSE and KGE to evaluate the accuracy of the model prediction.

[0048] The specific steps include:

[0049] Step 1: Obtain river flow data, perform preliminary feature extraction and screening on river flow, and screen out features related to river flow as preliminary river flow features.

[0050] The characteristics related to river flow are area, slope, rainfall, soil type, evaporation, river flow, etc.

[0051] Step 2: Preprocessing steps such as data filtering, normalization, and transformation were performed on the preliminary characteristics of river flow.

[0052] Step 2.1: First, remove the noise in the data and filter out the outliers and null values ​​in the river flow dataset;

[0053] Step 2.2: Use the MinMaxScaler normalization method to scale the features in the river flow data to the range of 0 to 1. Normalization ensures that the scale of the data is consistent across different feature dimensions, which helps accelerate model training and improve prediction accuracy.

[0054] The specific normalization formula satisfies the following formula:

[0055]

[0056] Among them, X t,norm represents the normalized river flow data at time t, and the normalized value is between [0,1]; X t represents the actual observed value of river flow at time t; X min represents the minimum river flow observed during the entire time period; X max Represents the maximum river flow observed during the entire time period.

[0057] Step 2.3: Convert the data into PyTorch tensors to facilitate the subsequent training and prediction of the hybrid deep learning model.

[0058] It should be noted that, in this embodiment, when training the river flow model, the selected known data set is also subjected to the above-mentioned preprocessing steps, and after the preprocessing, it is divided into a training set and a test set.

[0059] Step 3: Use the river flow model to predict the preliminary characteristics of the preprocessed river flow and obtain the river flow prediction results.

[0060] Step 3.1: Divide the known data set into training set and test set.

[0061] The dataset used in this embodiment is "WaterBench-Iowa", which is a large hydrological dataset published by the University of Iowa's Hydroinformatics Laboratory UIHI Lab. The dataset contains data from 2011 to 2018 for 125 rivers in Iowa, USA, and includes 6 different features, such as area, slope, rainfall, soil type, evaporation, river flow, etc. Its specific features and explanations are shown in Table 1:

[0062] Table 1 Dataset description

[0063]

[0064] Step 3.2: Build the river flow prediction model structure.

[0065] The river flow prediction model in this embodiment is CNN-TCN-BiGRU, which is an integrated deep learning model. Figure 2 As shown in the figure, the river flow prediction model structure consists of a convolutional neural network, a temporal convolutional network and a bidirectional gated recurrent unit. The convolutional neural network is used to extract local features in the preliminary characteristics of river flow, and the temporal convolutional network is used to extract seasonal features in the preliminary characteristics of river flow. The bidirectional gated recurrent unit is used to learn the relationship between the extracted features of different scales, and the river flow is predicted based on the learning results.

[0066] In a specific implementation, local feature extraction, seasonal feature extraction and context awareness modules are defined separately.

[0067] Local feature extraction module: extract local features in river flow by stacking one-dimensional convolutional networks (1D-CNN) to obtain a local feature matrix. The convolution kernel slides on the input data and operates on local areas of river flow data (such as adjacent time steps) to identify local features. Among them, the local features of this embodiment refer to short-term rapid changes in river flow caused by some sudden natural factors. For example, sudden events such as heavy rainfall, continuous rainfall and floods can cause significant fluctuations in river flow.

[0068] Seasonal feature extraction module: This module is composed of a temporal convolutional network (TCN). Through its unique dilated convolution design, the temporal convolutional network can introduce intervals in the convolution process, allowing the convolution kernel to cover a longer time range. By stacking multiple layers of TCN, a deep network structure with strong "memory ability" is constructed, which can transfer the seasonal features in historical data to the current time step, thereby effectively capturing the seasonal characteristics in river flow data.

[0069] In this embodiment, seasonal characteristics refer to the periodic patterns of river flow as it changes with the seasons, which are usually closely related to environmental factors such as climate change and snowmelt. For example, spring snowmelt and summer rainfall can lead to a significant increase in river flow, while in autumn and winter, river flow tends to decrease due to reduced precipitation.

[0070] In the process of river flow prediction, local features help the model capture short-term changes in flow, while seasonal features help the model identify and utilize periodic patterns in historical data. Considering the complex relationships between features can help the model learn the interactions between different time scales, thereby improving the accuracy and robustness of the prediction.

[0071] Context-aware module: This module consists of a bidirectional gated recurrent unit (BiGRU). The bidirectional structure enables it to process features at different time scales and learn complex relationships between features through its hidden state. The core component of this module is the GRU, which can effectively learn dependencies in the data through gating mechanisms such as update gates and reset gates, thereby more accurately predicting future river flows.

[0072] In some existing studies on multi-scale feature extraction and analysis of flow, although multi-scale features such as time features and spatial features are also extracted, the essential difference between river flow and other flows lies in the generation mechanism of flow and its dependencies. River flow is affected by multiple factors such as climate, topography and human activities, and its changes have obvious periodic and sudden characteristics. Other flows, such as network traffic, are generally affected by user behavior and network protocols, and the change patterns are relatively different. The particularity of river flow prediction is that it needs to deal with complex natural phenomena and emergencies, which show different characteristics at different time scales, and there are complex interactions between features. The model of the present invention uses a context-aware module to not only focus on local and seasonal characteristics, but also comprehensively consider the complex relationships between features, thereby improving the accuracy and reliability of the prediction.

[0073] Specifically, in this embodiment, complex relationships between features are learned through its hidden state. In addition to learning the relationship between local features and seasonal features, the relationship between other features is also considered, such as the relationship between meteorological features (evaporation, etc.) and terrain features (slope, soil type, etc.). Comprehensive consideration of multi-scale features and their relationships enables the model to have a more comprehensive understanding of changes in river flow.

[0074] Take local characteristics and seasonal characteristics as an example:

[0075] There is a complex interaction between local characteristics and seasonal characteristics, which is manifested in the following aspects:

[0076] 1. Superposition effect: Seasonal characteristics provide the overall trend of river flow, and local characteristics superimpose short-term flow fluctuations on it. The superposition effect allows local events (such as heavy rain or snowmelt) to have a more significant impact on flow in a specific seasonal context.

[0077] 2. Interaction: Seasonal characteristics can affect the manifestation and intensity of local characteristics. For example, in the dry season, short-term heavy rainfall may quickly cause floods because the soil is dry and water has difficulty penetrating. In the wet season, the same amount of rainfall may only lead to a moderate increase in flow because the soil is already saturated and excess water is easily carried away by surface runoff.

[0078] 3. Time-dependent effects: The interaction between local and seasonal characteristics has significant time-dependent effects. For example, spring snowmelt may affect summer rainfall patterns, which in turn changes the response of local flow.

[0079] Therefore, the context-aware module of the present invention performs feature learning and analysis on river flow-related features, thereby achieving a more accurate prediction of river flow.

[0080] Connecting the above three modules obtains the network structure of the integrated deep learning model.

[0081] Construct a fully connected layer, which is used to accept the output of the integrated deep learning model to obtain the final prediction result.

[0082] The specific calculation steps for the fully connected layer to calculate the final prediction result are as follows:

[0083] 1. Input feature vector: The input of the fully connected layer is the comprehensive feature vector output by the context-aware module, which contains information about local features, seasonal features and the complex relationships between them.

[0084] 2. Linear transformation: Perform a linear transformation on the input comprehensive feature vector, expressed as Y=W*X+b, where X is the input feature vector, W is the weight matrix, b is the bias term, and Y is the result after linear transformation.

[0085] 3. Activation function: The result after linear transformation is transformed nonlinearly through the ReLU activation function to increase the expressive power of the model.

[0086] 4. Output results: After all activation functions are processed, the output vector represents the model’s prediction of future river flow.

[0087] 5. Denormalization: Finally, the prediction results are denormalized to restore them to the actual river flow value to ensure that the prediction results have actual physical meaning.

[0088] Step 3.3: Use the training set to train the constructed CNN-TCN-BiGRU (CTB) river flow prediction model.

[0089] Step 3.3.1: Input the training set into the constructed river flow prediction model for training.

[0090] Step 3.3.2: Set the number of training rounds, determine the optimizer during training, and set the learning rate.

[0091] Specifically, the training epoch is set to 50, and the optimizer in the training process is determined to be Adam. The learning rate is set to 0.001, and the ReduceLROnPlateau scheduler is used to adaptively adjust the learning rate according to the decrease in loss during the training process to avoid the model training falling into the local optimum.

[0092] Step 3.3.3: After each round of training, check whether the current model is the optimal model. If it is the optimal model, save it locally. If not, continue training.

[0093] Specifically, the loss function uses MSE to evaluate the error between the model prediction value and the true value. After each round of training, the optimal model is tested and saved locally.

[0094] Step 3.3.4: Set the early stopping strategy to avoid overfitting.

[0095] Step 3.4: Use the test set to verify the prediction effect of the trained model.

[0096] Step 3.5: Use the river flow model to predict the preliminary characteristics of the preprocessed river flow. The prediction process includes extracting local characteristics and seasonal characteristics of the preliminary characteristics of the river flow, learning the relationship between the extracted features of different scales, and predicting the river flow based on the learning results.

[0097] The specific steps are:

[0098] Step 3.5.1: Load the optimal model after training and enter the no-gradient calculation mode torch.no_grad() to avoid unnecessary gradient calculations and improve prediction efficiency.

[0099] Step 3.5.2: Traverse the data to be tested and predict the future river flow.

[0100] Step 3.5.3: For the prediction results, use the pre-saved MinMaxScaler normalization method to perform a denormalization operation on the results. Through denormalization, the predicted values ​​output by the model are restored to the actual flow values ​​to ensure that the prediction results have actual physical meaning.

[0101] Step 3.6: Use the evaluation indicators to evaluate the river flow prediction model and adjust the river flow prediction model parameters according to the evaluation results.

[0102] In this embodiment, the prediction results are evaluated using the evaluation indicators NSE and KGE. Specifically, two commonly used hydrological evaluation indicators are used in the evaluation stage to measure the error between the predicted value and the true value, namely the Nash efficiency coefficient (Nash-Sutcliffe Efficiency, NSE) and the Kling-Gupta efficiency coefficient (Kling-Gupta Efficiency, KGE). NSE mainly compares the closeness between the model prediction value and the observed value. The closer its value is to 1, the higher the model prediction accuracy. However, NSE is sensitive to large errors, especially in the case of drastic flow changes or extreme values. Periods with large errors may cause NSE to drop significantly, affecting the overall evaluation results. KGE evaluates the performance of the model from multiple angles, including the correlation between the predicted value and the observed value, the deviation of the mean flow, and the degree of discreteness, so as to more comprehensively reflect the performance of the model. The closer the value of KGE is to 1, the better the overall prediction effect of the model. These two indicators can fully reflect the prediction accuracy of the model under different basins and hydrological conditions.

[0103] This embodiment is also combined with several advanced methods in this field (such as LSTM, GRU, S2S, Informer)

[0104] The experimental results obtained under the same data set and experimental conditions are compared, and the experimental results are shown in Tables 2 and 3.

[0105] The evaluation indicators NSE and KGE satisfy the following formulas respectively:

[0106]

[0107]

[0108] Where N represents the predicted time range; Q obs,t represents the actual river flow value observed at time t; Q sim,t represents the river flow value predicted by the model at time t; It represents the average flow of actual observed data, that is, the mean of the observed flow in the entire time series; r represents the correlation coefficient between the observed flow and the predicted flow, which is used to measure the linear correlation between the two; β represents the deviation ratio, which is used to measure whether the overall level of the observed flow is consistent with the predicted flow; γ represents the coefficient of variation, which is used to measure the degree of dispersion between the data.

[0109] The calculation process of r, β, and γ is as follows:

[0110] r = correlation coefficient (Q obs,t ,Q sim,t ),

[0111]

[0112] Among them, correlation coefficient represents the calculation of Q obs,t and Q sim,t The correlation coefficient between sim Represents the standard deviation of the predicted flow data; σQ obs Represents the standard deviation of the observed flow data.

[0113] The Q obs,t , Q sim,t , σQ obs , σQ sim , which respectively represent:

[0114] The river flow observed at time t for a river, in units of / second / m 3 ;

[0115] The river flow predicted by the model at time t for a certain river, in units of / second / m 3 ;

[0116] The mean flow rate of a river in 0-N hours, in units of / second / m 3 ;

[0117] The predicted mean flow of a river in 0-N hours, in / second / m 3 ;

[0118] The standard deviation of the observed flow data of a river in 0-N hours;

[0119] The standard deviation of the predicted flow data for a river in hours 0-N.

[0120] Table 2 NSE comparison experimental results

[0121]

[0122]

[0123] Table 3 KGE comparison experimental results

[0124]

[0126] It can be seen from Tables 2 and 3 that compared with other models, the integrated deep learning model CTB basically achieves the best results in the NSE and KGE evaluation indicators in the task of predicting river flow in the next 120 hours. The CTB model comprehensively considers the multi-scale characteristics of river flow and the complex relationship between the characteristics to predict river flow, and has a high prediction accuracy.

[0127] Embodiment 2:

[0128] Embodiment 2 of the present invention provides a river flow prediction system based on multi-scale feature extraction, including:

[0129] The data acquisition module is configured to acquire river flow data, perform preliminary feature extraction and screening on the river flow, and obtain preliminary features of the river flow;

[0130] a data processing module configured to pre-process preliminary characteristics of river flow;

[0131] The flow prediction module is configured to use the river flow model to predict the preprocessed preliminary characteristics of the river flow to obtain the river flow prediction result, wherein the prediction process includes extracting local characteristics and seasonal characteristics of the preliminary characteristics of the river flow, and then learning the relationship between the extracted features of different scales, and predicting the river flow based on the learning results.

[0132] The data storage module is configured to use the time series database InfluxDB to store river flow data, supporting efficient time series data access. The system can not only store massive data, but also support fast query and aggregation analysis. At the same time, the module also has a backup function, which backs up data regularly to prevent data loss, system failure or hardware damage. The data storage module uses the time series database InfluxDB to store river flow data, supporting efficient time series data access. At the same time, data is backed up regularly to deal with data loss or system failure.

[0133] The data management module is configured to display and manage the metadata of river flow data, which is convenient for users to upload, view and download data sets and their basic information (such as data description, data type, number of features, collection frequency, etc.). In addition, users can preview, download or upload river flow data through this module. It also supports batch processing and cleaning of data to ensure the data quality of input models.

[0134] The data visualization module is configured to visualize the prediction results of the model. It supports the generation of visualization charts such as line charts and histograms to dynamically display the comparison between the predicted value and the actual value. In addition, analysis reports or charts can be exported to facilitate subsequent research and analysis.

[0135] The log and monitoring module is configured to record and monitor all user operations, such as data upload, model training, etc. By monitoring the system's operating status and data storage in real time, the system can automatically trigger an alarm when an anomaly is detected and notify the administrator in a timely manner.

[0136] The traffic prediction module includes a model training module and a model evaluation module:

[0137] The model training module is configured to support the training of the integrated deep learning model CNN-TCN-BiGRU using the river flow dataset and save the optimal model during the training process. Users can set the relevant parameters of the model according to actual conditions. The system will record the model's training results, parameter configuration and other information to facilitate model version management and performance monitoring, ensuring the transparency and traceability of the prediction model.

[0138] The model evaluation module is configured to evaluate the accuracy of model predictions and use the evaluation indicators NSE and KGE to calculate the error between the predicted value and the observed value. The model evaluation module is used to evaluate the prediction effect of the trained model and supports the use of hydrological related evaluation indicators NSE and KGE to evaluate the accuracy of model predictions.

[0139] Each module in the river flow prediction system based on multi-scale feature extraction is designed as an independent microservice, which can be containerized through Docker. In order to better manage these containerized microservices, container orchestration tools such as Kubernetes are used to support efficient distributed deployment. Through the service discovery mechanism of Kubernetes, microservices can automatically discover and connect to related services, reducing hard-coded dependencies between services and enhancing the flexibility and maintainability of the system.

[0140] The system integrates a distributed logging system and a monitoring system to monitor the running status of microservices in real time. These tools continuously collect and analyze the performance data of microservices. Once an anomaly or performance bottleneck is detected, the problem can be quickly located and measures can be taken to deal with it, ensuring the stable operation of the system.

[0141] When users access the system, the load balancing mechanism distributes user requests to different servers reasonably by using the Nginx load balancing server, ensuring the system's high concurrent processing capability and stable user experience.

[0142] Through the design of distributed architecture and microservices, the system can efficiently handle the complex task of river flow prediction and has good scalability, maintainability and fault tolerance.

[0143] Embodiment three:

[0144] Embodiment 3 of the present invention provides a medium on which a program is stored. When the program is executed by a processor, the steps in the river flow prediction method based on multi-scale feature extraction as described in Embodiment 1 of the present invention are implemented.

[0145] Embodiment 4:

[0146] Embodiment 4 of the present invention provides a device, including a memory, a processor, and a program stored in the memory and executable on the processor. When the processor executes the program, the steps in the river flow prediction method based on multi-scale feature extraction as described in Embodiment 1 of the present invention are implemented.

[0147] The steps involved in the above embodiments 2, 3 and 4 correspond to the method embodiment 1. For the specific implementation methods, please refer to the relevant description part of embodiment 1.

[0148] Those skilled in the art should understand that the modules or steps of the present invention described above can be implemented by a general-purpose computer device, or alternatively, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. The present invention is not limited to any specific combination of hardware and software.

[0149] Although the above describes the specific implementation mode of the present invention in conjunction with the accompanying drawings, it is not intended to limit the scope of protection of the present invention. Those skilled in the art should understand that various modifications or variations that can be made by those skilled in the art on the basis of the technical solution of the present invention without creative work are still within the scope of protection of the present invention.

Claims

1. A river flow prediction method based on multi-scale feature extraction, characterized in that: The following steps are involved: Obtain river flow data, perform preliminary feature extraction and screening on river flow, and obtain preliminary features of river flow; Preprocessing of preliminary characteristics of river flows; The river flow model is used to predict the preprocessed preliminary characteristics of the river flow to obtain the river flow prediction results. The prediction process includes extracting local characteristics and seasonal characteristics of the preliminary characteristics of the river flow, and then learning the relationship between the extracted features of different scales, and predicting the river flow based on the learning results.

2. The river flow prediction method based on multi-scale feature extraction according to claim 1 is characterized in that: Preprocessing steps of data filtering, normalization and transformation were performed for preliminary characterization of river discharge.

3. The river flow prediction method based on multi-scale feature extraction according to claim 1 is characterized in that: The process of building a river flow prediction model includes: Divide the known data set into training set and test set; Build the river flow prediction model structure and use the training set to train the river flow prediction model; Use the test set to verify the prediction effect of the trained model.

4. The river flow prediction method based on multi-scale feature extraction according to claim 3 is characterized in that: The river flow prediction model structure consists of a convolutional neural network, a temporal convolutional network and a bidirectional gated recurrent unit. The convolutional neural network is used to extract local features from the preliminary characteristics of river flow, and the temporal convolutional network is used to extract seasonal features from the preliminary characteristics of river flow. The bidirectional gated recurrent unit is used to learn the relationship between the extracted features of different scales, and the river flow is predicted based on the learning results.

5. The river flow prediction method based on multi-scale feature extraction according to claim 3 is characterized in that: The river flow prediction model is evaluated using evaluation indicators, and the river flow prediction model parameters are adjusted according to the evaluation results.

6. The river flow prediction method based on multi-scale feature extraction according to claim 1 is characterized in that: The specific steps for training the river flow prediction model using the training set are: Input the training set into the constructed river flow prediction model for training; Set the number of training rounds, determine the optimizer used in the training process, and set the learning rate; After each round of training, check whether the current model is the optimal model. If it is the optimal model, save it locally. If not, continue training. Set an early stopping strategy to avoid overfitting.

7. The river flow prediction method based on multi-scale feature extraction according to claim 1 is characterized in that: The specific steps of using the river flow model to predict the preliminary characteristics of the preprocessed river flow are: Load the optimal model after training and enter the gradient-free calculation mode; Traverse the data to be tested and predict the future river flow; For the prediction results, the normalization method is used to denormalize the results.

8. A river flow prediction system based on multi-scale feature extraction, characterized in that: include: The data acquisition module is configured to acquire river flow data, perform preliminary feature extraction and screening on the river flow, and obtain preliminary features of the river flow; a data processing module configured to pre-process preliminary characteristics of river flow; The flow prediction module is configured to use the river flow model to predict the preprocessed preliminary characteristics of the river flow to obtain the river flow prediction result, wherein the prediction process includes extracting local characteristics and seasonal characteristics of the preliminary characteristics of the river flow, and then learning the relationship between the extracted features of different scales, and predicting the river flow based on the learning results.

9. A computer-readable storage medium, characterized in that: A plurality of instructions are stored therein, and the instructions are suitable for being loaded by a processor of a terminal device and executing the river flow prediction method based on multi-scale feature extraction as described in any one of claims 1-7.

10. A terminal device, characterized in that: It includes a processor and a computer-readable storage medium, the processor is used to implement each instruction; the computer-readable storage medium is used to store multiple instructions, and the instructions are suitable for being loaded by the processor and executing the river flow prediction method based on multi-scale feature extraction as described in any one of claims 1-7.

Citation Information

Patent Citations

  • River flow prediction method based on three-dimensional convolutional neural network

    CN111159149A

  • River flow prediction method, device and equipment and storage medium

    CN113139700A

  • River flow calculation model construction method and river flow calculation method and device

    CN116822228A

  • River flow rate estimation system

    JP2023141574A