Runoff forecasting method
By dynamically calculating weights and the number of optimal similar historical samples using neural networks, and combining this with physical mechanisms to optimize the runoff forecasting model, the problems of difficult parameter calibration and poor adaptability in existing technologies have been solved, achieving high-precision and transparent runoff forecasting.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-18
- Publication Date
- 2026-03-10
AI Technical Summary
Existing runoff forecasting methods suffer from difficulties in parameter calibration, high subjectivity, and static invariance, resulting in poor model adaptability, unstable forecast accuracy, and opaque decision-making processes.
By employing a neural network to dynamically calculate weights and the optimal number of similar historical samples, and combining this with physical mechanisms, dynamic parameters are optimized through end-to-end gradient backpropagation to achieve similarity fusion between current and historical samples and runoff forecasting.
It improves the accuracy and adaptability of runoff forecasts, enhances the interpretability of the model and its generalization ability in extreme hydrological events, and meets the requirements for real-time rolling forecasts.
Smart Images

Figure CN121637384A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to a runoff forecasting method, belonging to the field of hydrological forecasting and water conservancy information technology. Background Technology
[0002] Runoff forecasting is a core technology and decision-making foundation for water resource management, flood control and disaster reduction, and optimal scheduling of hydropower stations. Its technical approaches can be mainly divided into two categories: hydrological models based on physical mechanisms and data-driven forecasting methods.
[0003] Hydrological models based on physical mechanisms simulate runoff generation and confluence processes by constructing complex sets of partial differential equations. Although they have a clear physical basis, they suffer from problems such as difficulty in parameter calibration, high requirements for data quality, and limited application in areas with scarce data.
[0004] In recent years, purely data-driven forecasting methods, especially machine learning models such as neural networks, have attracted widespread attention due to their powerful nonlinear mapping capabilities. These methods do not require pre-setting of hydrological processes; they learn the complex relationships between inputs and outputs solely from historical data, often achieving high forecast accuracy under specific conditions. However, their "black box" nature leads to an opaque model decision-making process, unclear physical mechanisms, and weak interpretability, making it difficult for hydrological experts to trust the forecast results and for them to be widely applied in high-risk operational decisions.
[0005] To combine the advantages of both physical mechanisms and data-driven approaches, similarity forecasting (or "analogy forecasting") has been proposed as an intuitive method with a certain physical basis. The core idea of this method is "history reenactment," which involves finding several historical samples from a historical sample database that are most similar to the current hydrological scenario (such as previous rainfall and runoff sequences), and using the set of subsequent runoff events from these similar samples as the basis for forecasting. The key to traditional similarity forecasting methods lies in how to scientifically define and calculate "similarity," which involves determining two core parameters: the fusion weight of rainfall and runoff in the similarity metric, and the optimal number of similar samples selected. However, in existing technologies, these parameters are usually preset based on researchers' experience or calibrated through static optimization methods such as grid search. This method has obvious limitations: First, the calibration process involves a large amount of computation and is prone to the "curse of dimensionality" problem; second, once the calibration is completed, these parameters are fixed values and cannot be dynamically adjusted according to different real-time hydrological scenarios (such as drought and wet seasons, heavy rain and slow rain), resulting in poor model adaptability and unstable forecast accuracy under complex and variable hydrological conditions. Summary of the Invention
[0006] The purpose of this invention is to provide a runoff forecasting method that integrates physical mechanisms and data-driven approaches, which can improve the accuracy and adaptive intensity of runoff forecasting, and the decision-making process is transparent and interpretable.
[0007] To achieve the above objectives, the present invention provides the following technical solution: In a first aspect, the present invention provides a runoff forecasting method, comprising: The historical and current spatial distribution sequences of rainfall and the forecast cross-sectional runoff sequences of the target watershed are obtained and preprocessed to obtain historical and current samples. Historical and current samples are input into the trained runoff forecasting model to obtain runoff forecasting results; Runoff forecasting models include: The calculation module is used to calculate the similarity between the current sample and historical samples in terms of rainfall and runoff based on dynamic weight parameters, and to merge the similarity between the current sample and historical samples in terms of rainfall and runoff into a comprehensive similarity score for historical samples. The neural network is used to output dynamic parameters, including dynamic weight parameters and the number of dynamic optimal similar historical samples, based on the similarity between the current sample and historical samples in rainfall and runoff, as well as the original hydrological characteristics of the current sample, through forward propagation. The forecast module is used to select the best similar historical samples from the historical samples based on the comprehensive similarity score of the historical samples and the number of dynamic best similar historical samples, and output the weighted average of the subsequent runoff processes of the best similar historical samples as the runoff forecast result. Training the runoff forecasting model includes: Based on the error between runoff forecast results and actual observed runoff, a combined loss function is constructed; Based on the combined loss function, dynamic parameters are optimized through an end-to-end gradient backpropagation algorithm.
[0008] In conjunction with the first aspect, the preprocessing further includes: removing consecutive preset negative values from the spatial distribution sequence of rainfall and the runoff sequence of the forecast section, and performing linear interpolation on other negative values; the preprocessing also includes: dividing the area above the forecast section into several polygonal regions according to the distribution location of the rain gauges using the Thiessen polygon method, and merging the polygonal regions according to the data correlation of the rain gauges to obtain a rainfall spatial sub-region used to calculate the similarity of the current sample and historical samples in rainfall.
[0009] In conjunction with the first aspect, the dynamic weight parameters further include dynamic attention weights for calculating the similarity between the current sample and historical samples in terms of rainfall, and dynamic rain-runoff fusion weights for fusing the similarity between the current sample and historical samples in terms of rainfall and runoff into a comprehensive similarity score for historical samples.
[0010] In conjunction with the first aspect, the formula for calculating the similarity between the current sample and historical samples in terms of rainfall is as follows: ; in, This indicates the similarity between the current sample and historical samples in terms of rainfall. Indicates the first Similarity of current samples and historical samples in terms of rainfall over a given time period express Dynamic attention weights, , They represent Shape similarity coefficient, numerical similarity coefficient, , They represent the first The current sample and historical samples in the current time period. Rainfall in each sub-region , They represent the first The average rainfall of the current sample and historical samples for each time period This indicates the total number of periods of rainfall. This indicates the total number of spatial sub-regions affected by rainfall. The formula for calculating the similarity of current samples and historical samples in runoff is: ; in, This indicates the similarity between the current sample and historical samples in terms of runoff. , They represent Shape similarity coefficient, numerical similarity coefficient, , They represent the first Runoff volume for current and historical samples within a given time period. , These represent the average runoff of the current sample and the historical samples, respectively. Indicates the total number of runoff periods; The formula for combining the similarity of the current sample with historical samples in terms of rainfall and runoff into a comprehensive similarity score for historical samples is as follows: ; in, This represents the overall similarity score of historical samples. This represents the dynamic rainpath fusion weight.
[0011] In conjunction with the first aspect, further, neural networks include: The input layer is used to input a feature vector consisting of the similarity between the current sample and historical samples in terms of rainfall and runoff, as well as the original hydrological features of the current sample. The first hidden layer is used to output the first hidden layer feature vector based on the input feature vector through the ReLU activation function; The second hidden layer is used to output the second hidden layer feature vector based on the feature vector of the first hidden layer through the ReLU activation function; The output layer is used to generate the original output vector based on the feature vector of the second hidden layer. The original output vector is then activated by the Softmax activation function. The components are normalized to output dynamic attention weights, which are then activated by the Sigmoid activation function to optimize the original output vector. The components are transformed to output dynamic rainpath fusion weights, which are then used to output the front part of the original output vector through a linear activation function. Each component is truncated into integers within a preset interval using a direct-pass estimator, which serves as the dynamically optimal number of similar historical samples; where; The input feature vector is: ; in, This represents the input feature vector. , These represent the spatial distribution sequence of rainfall and the predicted cross-sectional runoff sequence for the current sample, respectively. , These represent the similarity between the current sample and historical samples in terms of rainfall and runoff, respectively. , They respectively represent the following: , Flattening a multidimensional vector into a one-dimensional vector, Indicates to , , , To splice; The feature vector of the first hidden layer is: ; in, This represents the feature vector of the first hidden layer. , These represent the weight matrix and bias vector of the first hidden layer, respectively. Represents the ReLU activation function; The feature vector of the second hidden layer is: ; in, This represents the feature vector of the second hidden layer. , These represent the weight matrix and bias vector of the second hidden layer, respectively. The original output vector is: ; in, Represents the original output vector. , These represent the weight matrix and bias vector of the output layer, respectively. The formula for calculating dynamic attention weights is: ; in, Indicates the first Dynamic attention weights for the similarity of current samples and historical samples in terms of rainfall over a given time period. express The One portion, Indicates the total number of periods of rainfall; The formula for calculating the rainpath fusion weight is: ; in, Indicates the rain path fusion weight, express The One portion, This represents the Sigmoid activation function; The formula for calculating the number of dynamically optimal similar historical samples is: ; in, This represents the number of dynamically optimal similar historical samples. express The One portion, , These represent the lower and upper limits of the preset interval, respectively. Indicates will Cut off as to The number between Indicates to Round down.
[0012] In conjunction with the first aspect, the further calculation formula for runoff forecast results is as follows: ; in, This indicates the runoff forecast results. Indicates the first The subsequent runoff process of the best similar historical sample, express The weight, Indicates the first The comprehensive similarity score of the best similar historical samples. This represents the total number of optimally similar historical samples, i.e., the number of dynamically optimally similar historical samples, which indicates the selection of the top samples with the highest overall similarity scores from the historical samples. The first historical sample is selected as the optimal similar historical sample.
[0013] Combining the first aspect, the combined loss function is further as follows: ; in, Indicates portfolio loss. , , These represent the main loss term, the regularization loss term, and the auxiliary loss term, respectively. This represents the Nash efficiency loss coefficient. , They represent the first The runoff forecast results and actual observed runoff corresponding to each training sample This represents the average value of the actual observed runoff. Represents dynamic attention weights. Indicates the dynamic rainpath fusion weights. , They represent , The regularization coefficient, Describing the L2 norm, This represents the total number of training samples.
[0014] Secondly, the present invention provides a runoff forecasting system, comprising: The data acquisition module is used to acquire historical and current spatial distribution sequences of rainfall and forecast cross-sectional runoff sequences of the target watershed and perform preprocessing to obtain historical and current samples; The runoff forecasting module is used to input historical and current samples into a trained runoff forecasting model to obtain runoff forecasting results. Runoff forecasting models include: The calculation module is used to calculate the similarity between the current sample and historical samples in terms of rainfall and runoff based on dynamic weight parameters, and to merge the similarity between the current sample and historical samples in terms of rainfall and runoff into a comprehensive similarity score for historical samples. The neural network is used to output dynamic parameters, including dynamic weight parameters and the number of dynamic optimal similar historical samples, based on the similarity between the current sample and historical samples in rainfall and runoff, as well as the original hydrological characteristics of the current sample, through forward propagation. The forecast module is used to select the best similar historical samples from the historical samples based on the comprehensive similarity score of the historical samples and the number of dynamic best similar historical samples, and output the weighted average of the subsequent runoff processes of the best similar historical samples as the runoff forecast result. Training the runoff forecasting model includes: Based on the error between runoff forecast results and actual observed runoff, a combined loss function is constructed; Based on the combined loss function, dynamic parameters are optimized through an end-to-end gradient backpropagation algorithm.
[0015] Thirdly, the present invention provides a computer device, comprising: Storage medium: used to store computer programs; Processor: for executing the computer program to implement the runoff forecasting method described in the first aspect.
[0016] Fourthly, the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the runoff forecasting method described in the first aspect.
[0017] Fifthly, the present invention provides a computer program product, including a computer program that, when executed by a processor, implements the runoff forecasting method described in the first aspect.
[0018] Compared with the prior art, the beneficial effects of the present invention are: The runoff forecasting method provided by this invention solves the problems of difficult weight calibration, strong subjectivity, and static invariance in traditional methods by automatically and efficiently learning complex dynamic parameter combinations through neural networks. This improves the accuracy of runoff forecasting and the adaptability of the runoff forecasting model to different hydrological scenarios. The core similarity metric of the runoff forecasting model is based on a clear physical formula, and the weights can be analyzed and the physical basis of the model's decisions can be understood after training, which enhances the reliability of the forecast results. Because physical constraints (fixed similarity calculations) are embedded in the model architecture, compared with pure black-box data-driven models, it has better inference and generalization capabilities when facing extreme hydrological events not fully covered by training data, avoiding the "curse of dimensionality" problem of traditional grid search. The forward inference speed of the neural network is fast, which can meet the operational needs of real-time rolling forecasts. Attached Figure Description
[0019] Figure 1 This is a flowchart of the runoff forecasting method provided in an embodiment of the present invention. Detailed Implementation
[0020] The technical solution of the present invention will be further described in detail below with reference to specific embodiments.
[0021] Embodiments of the present invention are described in detail below. Examples of these embodiments are illustrated in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and should not be construed as limiting the present invention. Unless otherwise specified, embodiments of the present invention and the technical features thereof can be combined with each other.
[0022] This invention provides a runoff forecasting method, comprising: The historical and current spatial distribution sequences of rainfall and the forecast cross-sectional runoff sequences of the target watershed are obtained and preprocessed to obtain historical and current samples. Historical and current samples are input into the trained runoff forecasting model to obtain runoff forecasting results.
[0023] In this embodiment, the runoff forecasting model includes: The calculation module is used to calculate the similarity between the current sample and historical samples in terms of rainfall and runoff based on dynamic weight parameters, and to merge the similarity between the current sample and historical samples in terms of rainfall and runoff into a comprehensive similarity score for historical samples. The neural network is used to output dynamic parameters, including dynamic weight parameters and the number of dynamic optimal similar historical samples, based on the similarity between the current sample and historical samples in rainfall and runoff, as well as the original hydrological characteristics of the current sample, through forward propagation. The forecast module is used to select the best similar historical samples from the historical samples based on the comprehensive similarity score of the historical samples and the number of dynamic best similar historical samples, and output the weighted average of the subsequent runoff processes of the best similar historical samples as the runoff forecast result.
[0024] In this embodiment, the training of the runoff forecasting model includes: Based on the error between runoff forecast results and actual observed runoff, a combined loss function is constructed; Based on the combined loss function, dynamic parameters are optimized through an end-to-end gradient backpropagation algorithm.
[0025] The runoff forecasting method provided in this invention deeply integrates physical mechanisms with data-driven approaches, and uses neural networks to dynamically and adaptively generate dynamic parameters. This improves the accuracy and adaptability of runoff forecasting while maintaining the physical interpretability of the model. It has significant practical value for enhancing precise regulation of water resources in watersheds, supporting flood control and disaster reduction decisions, and optimizing the operation of hydropower stations.
[0026] Figure 1 This is a flowchart of the runoff forecasting method provided in this embodiment. This flowchart only shows the logical sequence of the method in this embodiment. Provided that there is no conflict, different methods can be used. Figure 1 Complete the steps shown or described in the order indicated.
[0027] The runoff forecasting method provided in this embodiment can be applied to a terminal and can be executed by a runoff forecasting system. This system can be implemented by software and / or hardware and can be integrated into the terminal, such as any tablet computer or computer device with communication capabilities.
[0028] This invention provides a runoff forecasting method, which specifically includes the following steps: Step 1: Obtain the historical and current spatial distribution sequences of rainfall and the forecast cross-sectional runoff sequences of the target watershed and perform preprocessing to obtain historical samples and current samples; In this embodiment, the preprocessing includes: removing consecutive preset negative values from the spatial distribution sequence of rainfall and the runoff sequence of the forecast section, and performing linear interpolation on other negative values; the preprocessing also includes: dividing the area above the forecast section into several polygonal regions according to the distribution location of the rain gauges using the Thiessen polygon method, and merging the polygonal regions according to the data correlation of the rain gauges to obtain a rainfall spatial sub-region used to calculate the similarity of the current sample and historical samples in rainfall.
[0029] Specifically, the spatial distribution sequence of rainfall is derived from multiple rain gauge stations or gridded products. Five consecutive negative values are removed from both the spatial distribution sequence of rainfall and the forecast transect runoff sequence, and other negative values are linearly interpolated. Based on the distribution location of the rain gauge stations, the area above the forecast transect is divided using the Thiessen polygon method. A polygonal region was defined, and based on the correlation of rain gauge data, [the following was done]: Merge the polygonal regions to obtain A spatial sub-region of rainfall.
[0030] Step 2: Input the historical samples and the current samples into the trained runoff forecasting model to obtain the runoff forecasting results.
[0031] In this embodiment, the runoff forecasting model integrates physical mechanisms and data-driven approaches. The runoff forecasting model includes: The calculation module is used to calculate the similarity between the current sample and historical samples in terms of rainfall and runoff based on dynamic weight parameters, and to merge the similarity between the current sample and historical samples in terms of rainfall and runoff into a comprehensive similarity score for historical samples. The neural network is used to output dynamic parameters, including dynamic weight parameters and the number of dynamic optimal similar historical samples, based on the similarity between the current sample and historical samples in rainfall and runoff, as well as the original hydrological characteristics of the current sample, through forward propagation. The forecast module is used to select the best similar historical samples from the historical samples based on the comprehensive similarity score of the historical samples and the number of dynamic best similar historical samples, and output the weighted average of the subsequent runoff processes of the best similar historical samples as the runoff forecast result.
[0032] In this embodiment, the dynamic weight parameters include dynamic attention weights for calculating the similarity between the current sample and historical samples in terms of rainfall, and dynamic rain-runoff fusion weights for fusing the similarity between the current sample and historical samples in terms of rainfall and runoff into a comprehensive similarity score for historical samples.
[0033] The formula for calculating the similarity of the current sample and historical samples in terms of rainfall is: ; in, This indicates the similarity between the current sample and historical samples in terms of rainfall. Indicates the first Similarity of current samples and historical samples in terms of rainfall over a given time period express Dynamic attention weights, and , , They represent Shape similarity coefficient, numerical similarity coefficient, , , They represent the first The current sample and historical samples in the current time period. Rainfall in each sub-region , They represent the first The average rainfall of the current sample and historical samples for each time period This indicates the total number of periods of rainfall. This represents the total number of spatial sub-regions of rainfall.
[0034] The formula for calculating the similarity of current samples and historical samples in runoff is: ; in, This indicates the similarity between the current sample and historical samples in terms of runoff. , They represent Shape similarity coefficient, numerical similarity coefficient, , , They represent the first Runoff volume for current and historical samples within a given time period. , These represent the average runoff of the current sample and the historical samples, respectively. This indicates the total number of runoff periods.
[0035] The formula for combining the similarity of the current sample with historical samples in terms of rainfall and runoff into a comprehensive similarity score for historical samples is as follows: ; in, This represents the overall similarity score of historical samples. Indicates the dynamic rainpath fusion weights. .
[0036] In this embodiment, the neural network includes: The input layer is used to input a feature vector consisting of the similarity between the current sample and historical samples in terms of rainfall and runoff, as well as the original hydrological features of the current sample. The first hidden layer is used to output the first hidden layer feature vector based on the input feature vector through the ReLU activation function; The second hidden layer is used to output the second hidden layer feature vector based on the feature vector of the first hidden layer through the ReLU activation function; The output layer is used to generate the original output vector based on the feature vector of the second hidden layer. The original output vector is then activated by the Softmax activation function. The components are normalized to output dynamic attention weights, which are then activated by the Sigmoid activation function to optimize the original output vector. The components are transformed to output dynamic rainpath fusion weights, which are then used to output the front part of the original output vector through a linear activation function. Each component is truncated into integers within a preset interval using a direct estimator, which serves as the dynamic optimal number of similar historical samples; where...
[0037] Specifically, the first hidden layer has 256 neurons, and its weight matrix is initialized using a He normal distribution; the second hidden layer has 128 neurons, and a random deactivation operation with a probability of 0.2 is performed during forward propagation to prevent overfitting; the output layer has... One neuron.
[0038] The input feature vector is: ; in, This represents the input feature vector. , These represent the spatial distribution sequence of rainfall and the predicted cross-sectional runoff sequence for the current sample, respectively. , These represent the similarity between the current sample and historical samples in terms of rainfall and runoff, respectively. , They respectively represent the following: , Flattening a multidimensional vector into a one-dimensional vector, Indicates to , , , Then, the parts are assembled.
[0039] The feature vector of the first hidden layer is: ; in, This represents the feature vector of the first hidden layer. , These represent the weight matrix and bias vector of the first hidden layer, respectively. This represents the ReLU activation function.
[0040] The feature vector of the second hidden layer is: ; in, This represents the feature vector of the second hidden layer. , These represent the weight matrix and bias vector of the second hidden layer, respectively.
[0041] The original output vector is: ; in, Represents the original output vector. , These represent the weight matrix and bias vector of the output layer, respectively.
[0042] The formula for calculating dynamic attention weights is: ; in, Indicates the first Dynamic attention weights for the similarity of current samples and historical samples in terms of rainfall over a given time period. express The One portion, This indicates the total number of periods of rainfall.
[0043] The formula for calculating the rainpath fusion weight is: ; in, Indicates the rain path fusion weight, express The One portion, This represents the Sigmoid activation function.
[0044] The formula for calculating the number of dynamically optimal similar historical samples is: ; in, This represents the number of dynamically optimal similar historical samples. express The One portion, , These represent the lower and upper limits of the preset interval, respectively. Indicates will Cut off as to The number between Indicates to Round down.
[0045] Specifically, settings , Through the pass-through estimator The integers within the preset interval [1, 50] are used as the dynamic optimal number of similar historical samples.
[0046] In this embodiment, historical samples are sorted in descending order based on their comprehensive similarity scores, and the optimal number of similar historical samples is determined dynamically. The top samples with the highest overall similarity scores were selected from historical samples. A number of historical samples are selected as the optimal similar historical samples. Based on the comprehensive similarity score of the optimal similar historical samples, the weighted average of the subsequent runoff processes of the optimal similar historical samples is output as the runoff forecast result.
[0047] The formula for calculating runoff forecast results is as follows: ; in, This indicates the runoff forecast results. Indicates the first The subsequent runoff process of the best similar historical sample, express The weight, Indicates the first The comprehensive similarity score of the best similar historical samples. This represents the total number of optimally similar historical samples, i.e., the number of dynamically optimally similar historical samples, which indicates the selection of the top samples with the highest overall similarity scores from the historical samples. The first historical sample is selected as the optimal similar historical sample.
[0048] In this embodiment, the training of the runoff forecasting model specifically includes the following steps: Step 1: Construct a combined loss function based on the error between the runoff forecast results and the actual observed runoff; The combined loss function is: ; in, Indicates portfolio loss. , , These represent the main loss term, the regularization loss term, and the auxiliary loss term, respectively. This represents the Nash efficiency loss coefficient. , They represent the first The runoff forecast results and actual observed runoff corresponding to each training sample This represents the average value of the actual observed runoff. Represents dynamic attention weights. Indicates the dynamic rainpath fusion weights. , They represent , The regularization coefficient, Describing the L2 norm, This represents the total number of training samples.
[0049] Specifically, settings , , .
[0050] Step 2: Based on the combined loss function, optimize the dynamic parameters using an end-to-end gradient backpropagation algorithm.
[0051] In this embodiment, the runoff forecasting model is trained using the Adam optimizer with an initial learning rate of 0.001, which decays to 0.5 every 20 epochs for a total of 100 epochs. An early stopping strategy is employed, meaning training stops if the validation set loss does not decrease for 10 consecutive epochs. An end-to-end gradient backpropagation algorithm is used to jointly optimize dynamic parameters by minimizing the difference between the forecasted runoff and the observed runoff. The entire training process is a supervised learning task, aiming to teach the model how to allocate attention weights, rain-runoff fusion weights, and determine the optimal number of similar historical samples using historical data.
[0052] This invention provides a runoff forecasting system, comprising: The data acquisition module is used to acquire historical and current spatial distribution sequences of rainfall and forecast cross-sectional runoff sequences of the target watershed and perform preprocessing to obtain historical and current samples; The runoff forecasting module is used to input historical and current samples into the trained runoff forecasting model to obtain runoff forecasting results.
[0053] In this embodiment, the runoff forecasting model includes: The calculation module is used to calculate the similarity between the current sample and historical samples in terms of rainfall and runoff based on dynamic weight parameters, and to merge the similarity between the current sample and historical samples in terms of rainfall and runoff into a comprehensive similarity score for historical samples. The neural network is used to output dynamic parameters, including dynamic weight parameters and the number of dynamic optimal similar historical samples, based on the similarity between the current sample and historical samples in rainfall and runoff, as well as the original hydrological characteristics of the current sample, through forward propagation. The forecast module is used to select the best similar historical samples from the historical samples based on the comprehensive similarity score of the historical samples and the number of dynamic best similar historical samples, and output the weighted average of the subsequent runoff processes of the best similar historical samples as the runoff forecast result.
[0054] In this embodiment, the training of the runoff forecasting model includes: Based on the error between runoff forecast results and actual observed runoff, a combined loss function is constructed; Based on the combined loss function, dynamic parameters are optimized through an end-to-end gradient backpropagation algorithm.
[0055] The runoff forecasting system provided in this embodiment of the invention can execute the runoff forecasting method provided in this embodiment of the invention, and has the corresponding functional modules and beneficial effects of the execution method.
[0056] This invention provides a computer device, comprising: Storage medium: used to store computer programs; Processor: Used to execute computer programs to implement the runoff forecasting method provided in the embodiments of the present invention.
[0057] This invention provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the runoff forecasting method provided in this invention.
[0058] This invention provides a computer program product, including a computer program that, when executed by a processor, implements the runoff forecasting method provided in this invention.
[0059] 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.
[0060] 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, as well as 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. Figure 1 One or more processes and / or boxes Figure 1 A system that specifies functions in one or more boxes.
[0061] 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 an instruction set implemented in a process. Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0062] 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.
[0063] The above are merely preferred embodiments of the present invention. It should be noted that those skilled in the art can make various improvements and modifications without departing from the technical principles of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.
Claims
1. A method of runoff prediction, characterized by, The method comprises the following steps: obtaining historical and current rainfall spatial distribution sequences and forecast section runoff sequences of a target basin, and preprocessing the sequences to obtain historical samples and current samples; inputting the historical samples and the current samples into a trained runoff prediction model to obtain a runoff prediction result; the runoff prediction model comprises: a calculation module, configured to calculate the similarity of the current sample and the historical samples in rainfall and runoff according to dynamic weight parameters, and fuse the similarity of the current sample and the historical samples in rainfall and runoff into a comprehensive similarity score of the historical samples; a neural network, configured to output dynamic parameters including dynamic weight parameters and a dynamic optimal similar historical sample number through forward propagation according to the similarity of the current sample and the historical samples in rainfall and runoff and original hydrological characteristics of the current sample; a prediction module, configured to select an optimal similar historical sample from the historical samples according to the comprehensive similarity score of the historical samples and the dynamic optimal similar historical sample number, and output a weighted average value of a subsequent runoff process of the optimal similar historical sample as the runoff prediction result; training of the runoff prediction model comprises: constructing a combined loss function based on errors between the runoff prediction result and a real observed runoff; optimizing the dynamic parameters through an end-to-end gradient back propagation algorithm based on the combined loss function.
2. The runoff forecasting method according to claim 1, characterized by, The preprocessing comprises: removing consecutive preset negative values in the rainfall spatial distribution sequences and the forecast section runoff sequences, and performing linear interpolation on other negative values; the preprocessing further comprises: dividing a region above the forecast section into a plurality of polygonal regions by using a Thiessen polygon method according to distribution positions of rain gauges, and merging the polygonal regions according to data correlation of the rain gauges to obtain rainfall spatial sub-regions used for calculating the similarity of the current sample and the historical samples in rainfall.
3. The runoff forecasting method according to claim 1, characterized by, The dynamic weight parameters comprise dynamic attention weights used for calculating the similarity of the current sample and the historical samples in rainfall, and a dynamic rain-runoff fusion weight used for fusing the similarity of the current sample and the historical samples in rainfall and runoff into the comprehensive similarity score of the historical samples.
4. The runoff forecasting method according to claim 1, characterized by, A calculation formula of the similarity of the current sample and the historical samples in rainfall is: ; wherein, represents the similarity of the current sample and the historical sample in rainfall, represents the similarity of the current sample and the historical sample in rainfall of the th time period, represents the dynamic attention weight of , respectively represent the shape similarity coefficient and the numerical similarity coefficient of , , respectively represent the rainfall of the th sub-region of the current sample and the historical sample of the th time period, , respectively represent the average rainfall of the current sample and the historical sample of the th time period, represents the total number of rainfall time periods, represents the total number of rainfall spatial sub-regions; A calculation formula of the similarity of the current sample and the historical samples in runoff is: ; wherein, represents the similarity of the current sample and the historical sample in the runoff, , respectively represent the shape similarity coefficient, the numerical similarity coefficient of , , respectively represent the runoff of the current sample and the historical sample in the first period, , respectively represent the average runoff of the current sample and the historical sample, represents the total number of runoff periods; A formula for fusing the similarity of the current sample and the historical samples in rainfall and runoff into the comprehensive similarity score of the historical samples is: ; wherein, represents a composite similarity score of the historical samples, represents a dynamic rain path fusion weight.
5. The runoff forecasting method of claim 1, wherein, The neural network comprises: an input layer, configured to input an input feature vector composed of the similarity of the current sample and the historical samples in rainfall and runoff and original hydrological characteristics of the current sample; a first hidden layer, configured to output a first hidden layer feature vector through a ReLU activation function according to the input feature vector; a second hidden layer, configured to output a second hidden layer feature vector through a ReLU activation function according to the first hidden layer feature vector; The output layer is used to generate the original output vector based on the feature vector of the second hidden layer. The original output vector is then activated by the Softmax activation function. The components are normalized to output dynamic attention weights, which are then activated by the Sigmoid activation function to optimize the original output vector. The components are transformed to output dynamic rainpath fusion weights, which are then used to output the front part of the original output vector through a linear activation function. Each component is truncated into integers within a preset interval using a direct-pass estimator, which serves as the dynamically optimal number of similar historical samples; where; the input feature vector is: ; wherein, represents an input feature vector, , respectively represent the rainfall spatial distribution sequence and the forecast section runoff sequence of the current sample, , respectively represent the similarity of the current sample and the historical sample in rainfall and runoff, , respectively represent the similarity of the current sample and the historical sample in rainfall and runoff, , flattened from a multi-dimensional vector to a one-dimensional vector, represents the similarity of the current sample and the historical sample in rainfall and runoff, , , , spliced; the first hidden layer feature vector is: ; wherein, denotes a first hidden layer feature vector, , denote a weight matrix, a bias vector of the first hidden layer, respectively, denotes a ReLU activation function; the second hidden layer feature vector is: ; wherein, denotes a second hidden layer feature vector, , denote a weight matrix, a bias vector of the second hidden layer, respectively. an original output vector is: ; wherein, denotes the original output vector, , denote the weight matrix and bias vector of the output layer, respectively; A calculation formula of the dynamic attention weights is: ; wherein, denotes the dynamic attention weight indicating the similarity of the current sample of the th time period with the historical samples on the rainfall, denotes the th component of denotes the total number of rainfall time periods; A calculation formula of the rain-runoff fusion weight is: ; wherein, denotes a rain path fusion weight, denotes the first component of denotes a Sigmoid activation function; A calculation formula of the dynamic optimal similar historical sample number is: ; wherein, represents a dynamic optimal number of similar historical samples, represents the first component of , respectively represent the lower limit and the upper limit of a preset interval, represents truncating to a number between and , represents rounding .
6. The runoff forecasting method of claim 1, wherein, A calculation formula of the runoff prediction result is: ; wherein, represents the runoff prediction result, represents the subsequent runoff process of the optimal similar historical sample, represents the weight of the optimal similar historical sample, represents the comprehensive similarity score of the optimal similar historical sample, represents the total number of optimal similar historical samples, i.e., the number of dynamic optimal similar historical samples, which represents that the first optimal similar historical samples with the highest comprehensive similarity scores are selected from the historical samples as the optimal similar historical samples.
7. The runoff forecasting method of claim 1, wherein, the combined loss function is: ; wherein, denotes the combined loss, , , denote the main loss term, the regularization loss term, the auxiliary loss term, respectively, denotes the Nash efficiency loss coefficient, , denote the predicted runoff result and the true observed runoff corresponding to the th training sample, respectively, denotes the mean of the true observed runoff, denotes the dynamic attention weight, denotes the dynamic rain-runoff fusion weight, , denote the regularization coefficients of , , respectively, denotes the L2 norm, denotes the total number of training samples.
8. A runoff forecasting system, characterized by, The data acquisition module is configured to acquire and preprocess historical and current rainfall spatial distribution sequences and forecast section runoff sequences of a target basin to obtain historical samples and current samples. The runoff forecast module is configured to input the historical samples and the current samples into a trained runoff forecast model to obtain a runoff forecast result. The runoff forecast model comprises: The calculation module is configured to calculate the similarity of the current sample and the historical samples in rainfall and runoff according to the dynamic weight parameter, and fuse the similarity of the current sample and the historical samples in rainfall and runoff into a comprehensive similarity score of the historical samples. The neural network is configured to output the dynamic parameters, including the dynamic weight parameter and the dynamic optimal similar historical sample number, by forward propagation according to the similarity of the current sample and the historical samples in rainfall and runoff and the original hydrological features of the current sample. The forecast module is configured to filter out the optimal similar historical sample from the historical samples according to the comprehensive similarity score of the historical samples and the dynamic optimal similar historical sample number, and output a weighted average value of a subsequent runoff process of the optimal similar historical sample as the runoff forecast result. The training of the runoff forecast model comprises: Based on the error between the runoff forecast result and the real observed runoff, a combined loss function is constructed. Based on the combined loss function, the dynamic parameters are optimized by an end-to-end gradient back propagation algorithm.
9. A computer device, comprising: The computer program is executed by the processor to implement the runoff forecast method of any one of claims 1 to 7. The computer program is executed by the processor to implement the runoff forecast method of any one of claims 1 to 7. 10. A computer-readable storage medium having stored thereon a computer program, characterized in that,