A runoff prediction method considering double time delay effects of reservoir regulation and water use
By employing a spatiotemporal dual-layer attention-based runoff prediction method, which utilizes feature and temporal attention weights for spatiotemporal fusion, the accuracy problem of runoff prediction in the absence of monitoring data in traditional methods is solved, achieving more accurate river runoff prediction and flood peak warning.
Patent Information
- Application Number
- CN202511405023.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-29
- Publication Date
- 2026-01-27
- Estimated Expiration
- 2045-09-29
AI Technical Summary
Traditional methods, lacking data on water engineering and river runoff monitoring, struggle to accurately characterize the response of reservoir regulation and water intake to downstream runoff, thus limiting the accuracy of river runoff simulation and prediction.
A runoff prediction method based on spatiotemporal dual-layer attention is adopted. By acquiring multi-source feature sets and time segment features, spatiotemporal fusion is performed using feature attention weights and time attention weights to construct a weighted lag matrix, which is then input into the learner for runoff prediction.
It improves the accuracy and interpretability of runoff forecasting, effectively characterizes the combined effects of water intake and engineering regulation on downstream runoff in the absence of monitoring data, enhances the accuracy of river runoff forecasting, and supports river flood peak early warning and water use scheduling optimization.
Smart Images

Figure CN120875629B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of water conservancy engineering and artificial intelligence (AI), and in particular to a runoff prediction method that considers the dual time lag effect of reservoir regulation and water intake. Background Technology
[0002] River runoff simulation typically uses water balance to treat upstream inflow, water intake and discharge, reservoir storage and evaporation as equal amounts of inflow and outflow. This process is then propagated downstream along the river network using reservoir scheduling rules or river channel calculations to obtain the target cross-sectional flow. By integrating limited observations, statistical models or machine learning methods are used to invert the reservoir capacity changes or outflow processes of water conservancy projects. Finally, the water balance and river channel calculations are substituted back to complete the correlation and simulation.
[0003] During the formation and evolution of river runoff, the runoff generation and confluence processes are significantly altered by reservoir regulation, human water consumption, and the lag in water discharge. Traditional methods rely on parameters such as reservoir scheduling curves, reservoir capacity, and outflow processes. When upstream water conservancy data is scarce, traditional methods struggle to accurately characterize the response relationship between engineering regulation and downstream runoff, thus limiting the accuracy of river runoff simulation and prediction. Summary of the Invention
[0004] This invention provides a runoff prediction method that considers the dual time lag effect of reservoir regulation and water intake, effectively mapping the implicit effects of human water intake and engineering regulation to downstream river runoff changes, thereby improving the accuracy and interpretability of runoff prediction.
[0005] According to one aspect of the present invention, a runoff prediction method based on spatiotemporal dual-layer attention is provided, the method comprising:
[0006] Obtain feature sets of each runoff section in multiple historical time periods;
[0007] The feature set for each historical time period includes the natural net runoff, rainfall, evaporation, and industry water consumption for that historical time period, as well as the measured runoff and target equivalent impact for at least one lag time period of that historical time period.
[0008] The simulated natural net flow, predicted rainfall, predicted evaporation, predicted industry water consumption, and measured runoff value and target equivalent impact quantity of each runoff section under the prediction time period are obtained, forming a feature set of each runoff section under the prediction time period.
[0009] After the feature sets of each runoff section under the prediction time period and multiple adjacent historical time periods are combined into a time length T feature set, and after multi-source alignment and robust processing, a normalized time series feature matrix corresponding to each runoff section is constructed.
[0010] Obtain the pre-trained feature attention weights corresponding to each feature and the time attention weights corresponding to each lag scale for each runoff section, and use the feature attention weights and time attention weights as weighting factors to perform spatiotemporal fusion on the normalized time series feature matrix of each runoff section to obtain the weighted lag matrix of each runoff section.
[0011] The weighted lag matrix of each runoff section is input into the pre-trained learner to obtain the equivalent impact prediction value of each runoff section under the prediction time period. Based on the natural runoff simulation value and the equivalent impact prediction value of each runoff section, the actual runoff prediction value of each runoff section under the prediction time period is calculated.
[0012] After taking the predicted time interval as the new most recent historical time interval and obtaining a new predicted time interval, the feature set under the new predicted time interval is redefined, and the operation of forming a feature set of time length T for each runoff section under the predicted time interval and multiple adjacent historical time intervals is performed for multi-source alignment and robust processing until the actual runoff prediction value of each runoff section under the preset number of predicted time intervals is generated.
[0013] According to another aspect of the present invention, a runoff prediction device based on spatiotemporal dual-layer attention is also provided, the device comprising:
[0014] The first feature set acquisition module is used to acquire the feature sets of each runoff section in multiple historical time periods.
[0015] The feature set for each historical time period includes the natural net runoff, rainfall, evaporation, and industry water consumption for that historical time period, as well as the measured runoff and target equivalent impact for at least one lag time period of that historical time period.
[0016] The second feature set generation module is used to obtain the simulated natural net flow, predicted rainfall, predicted evaporation, predicted industry water consumption, and measured runoff value and target equivalent impact quantity of each runoff section under the prediction time period, and form the feature set of each runoff section under the prediction time period.
[0017] The time series feature matrix construction module is used to combine the feature sets of each runoff section under the prediction time interval and multiple adjacent historical time intervals into a time length T feature set. After multi-source alignment and robust processing, a normalized time series feature matrix corresponding to each runoff section is constructed.
[0018] The weighted lag matrix generation module is used to obtain the feature attention weights corresponding to each feature and the time attention weights corresponding to each lag scale that are pre-trained for each runoff section. The module uses the feature attention weights and time attention weights as weighting factors to perform spatiotemporal fusion on the normalized time series feature matrix of each runoff section to obtain the weighted lag matrix of each runoff section.
[0019] The actual runoff prediction module is used to input the weighted lag matrix of each runoff section into a pre-trained learner to obtain the equivalent impact prediction value of each runoff section under the prediction time period, and calculate the actual runoff prediction value of each runoff section under the prediction time period based on the natural runoff simulation value and the equivalent impact prediction value of each runoff section.
[0020] The iterative module is used to take the predicted time interval as the new most recent historical time interval and obtain a new predicted time interval. Then, it redetermines the feature set under the new predicted time interval and returns to perform the operation of forming a feature set of time length T for each runoff section under the predicted time interval and multiple adjacent historical time intervals. This process is repeated until the actual runoff prediction values of each runoff section under the preset number of predicted time intervals are generated.
[0021] According to another aspect of the present invention, an electronic device is also provided, the electronic device comprising:
[0022] At least one processor; and
[0023] A memory communicatively connected to the at least one processor; wherein,
[0024] The memory stores a computer program that can be executed by the at least one processor, which enables the at least one processor to perform the runoff prediction method based on spatiotemporal dual-layer attention as described in any embodiment of the present invention.
[0025] According to another aspect of the present invention, a computer-readable storage medium is provided, the computer-readable storage medium storing computer instructions, the computer instructions being configured to cause a processor to execute and implement the runoff prediction method based on spatiotemporal dual-layer attention as described in any embodiment of the present invention.
[0026] According to another aspect of the present invention, a computer program product is also provided, including a computer program that, when executed by a processor, implements the steps of the runoff prediction method based on spatiotemporal dual-layer attention as described in any embodiment of the present invention.
[0027] The technical solution of this invention creatively proposes a mutual information-driven runoff prediction method oriented towards the time-lag effect of water engineering. Mutual information drives the feature layer and time layer attention respectively. The former scores the mutual information between multi-source features and the impact of human activities to identify hydrological and water use characteristics; the latter captures the short-term variation characteristics and time-lag effects of flow through time-series lag terms to characterize the lag time and intensity of reservoir regulation and discharge. After fusing the above spatiotemporal features, runoff prediction can be effectively achieved. The technical solution of this invention can clearly characterize the combined effect of water intake and water use and engineering regulation on downstream runoff in the absence of water engineering and river discharge monitoring data, and improve the accuracy and interpretability of runoff prediction. This effectively improves the accuracy of river runoff prediction in scenarios where water engineering and water intake monitoring data are lacking, providing operable quantitative support for early warning of river flood peaks, zoned water use management, and ecological water replenishment and scheduling optimization, and has significant management practical significance.
[0028] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of the present invention, nor is it intended to limit the scope of the invention. Other features of the invention will become readily apparent from the following description. Attached Figure Description
[0029] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0030] Figure 1 This is a flowchart of a runoff prediction method based on spatiotemporal dual-layer attention according to an embodiment of the present invention;
[0031] Figure 2 This is a schematic diagram of a complete technical route to which the technical solution of the embodiment of the present invention applies;
[0032] Figure 3 This is a flowchart illustrating a mutual information attention algorithm applicable to the technical solution of this embodiment of the invention.
[0033] Figure 4 This is a schematic diagram comparing the predicted runoff of a runoff section with the actual runoff after applying the technical solution of the present invention.
[0034] Figure 5 This is a schematic diagram of a runoff prediction device based on spatiotemporal dual-layer attention according to an embodiment of the present invention;
[0035] Figure 6 This is a schematic diagram of the structure of an electronic device that implements the runoff prediction method based on spatiotemporal dual-layer attention according to the embodiments of the present invention. Detailed Implementation
[0036] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.
[0037] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0038] Figure 1 The flowchart provided in this embodiment of the invention illustrates a runoff prediction method based on spatiotemporal dual-layer attention. This embodiment is applicable to situations where the actual runoff value of each runoff section is accurately predicted based on the feature set of each runoff section in multiple historical time periods, taking into full account the time lag effect of water intake and reservoir regulation. This method can be executed by a runoff prediction device based on spatiotemporal dual-layer attention. This device can be implemented in hardware and / or software and is generally configured in electronic devices with data processing capabilities, such as various smart terminal devices or servers.
[0039] Correspondingly, such as Figure 1 As shown, the method may include:
[0040] S110. Obtain the feature set of each runoff section under multiple historical time periods.
[0041] Among them, the runoff section refers to the cross-section of a river or channel perpendicular to the direction of water flow, and the runoff value of the runoff section can be understood as the total amount of water passing through the section within a certain period of time. This is a core indicator for measuring the hydrological characteristics of a watershed. By accurately predicting the runoff value of water bodies with intensive human activities, it is possible to provide actionable quantitative support for early warning of river flood peaks, zoned water use management, and ecological water replenishment and scheduling optimization (such as staggered water intake and adjustment of reservoir release strategies).
[0042] In the various embodiments of the present invention, the main objective is to predict the actual runoff value of one or more runoff sections under multiple prediction time intervals (also referred to as future time intervals). It should be noted that the prediction of actual runoff values in the various embodiments of the present invention is generally performed over a relatively long time span, typically one month. Correspondingly, the aforementioned historical time intervals can be understood as multiple consecutive historical months preceding the month to be predicted.
[0043] For example, if you want to predict the actual runoff value of each runoff section in the prediction time period of October 2025, you can trace back 1, 2 or 3 years of historical months before October 2025 as historical time periods, and obtain the feature set of each historical time period as the input data source for the prediction process.
[0044] Each historical time period includes a set of features, which includes the natural net runoff, rainfall, evaporation, and industry water consumption for that historical time period, as well as the measured runoff and target equivalent impact for at least one lag time period of that historical time period.
[0045] In a specific example, if there are 12 consecutive historical time periods, then a corresponding feature set needs to be constructed for each historical time period, that is, a total of 12 feature sets need to be constructed.
[0046] Correspondingly, the feature set corresponding to a specific historical time period (e.g., September 2025) specifically includes: the natural net runoff value of each runoff section in September 2025, the rainfall, evaporation, and industry water consumption within the geographical watershed to which each runoff section belongs. At the same time, it is also necessary to trace back one or more consecutive lag time periods from September 2025 as the starting point, such as August 2025 and July 2025, and obtain the measured runoff value and target equivalent impact amount under the above-mentioned lag time periods as features in the feature set.
[0047] The industry water consumption can include the sum of domestic water consumption, industrial water consumption, agricultural water consumption, and ecological water consumption. Natural runoff refers to the river runoff during the natural water cycle without human intervention (such as water conservancy projects, water intake, and water diversion), reflecting the interaction of natural elements such as precipitation, evaporation, and infiltration in the watershed. Measured runoff refers to the runoff actually observed under the influence of human activities (such as reservoir regulation, agricultural irrigation, and industrial water intake). It is important to note that the target equivalent impact is the design objective of each embodiment of this invention, used to describe the impact of human activities on runoff. The target equivalent impact for a specific historical time period can be calculated by subtracting the measured runoff for that historical time period from the natural runoff for that historical time period. For example, the target equivalent impact can be calculated using... express.
[0048] In summary, the feature set for the historical time period of September 2025 includes the measured runoff values and target equivalent impact of each runoff section in August 2025, and may also include the measured runoff values and target equivalent impact of each runoff section in July 2025, as well as the measured runoff values and target equivalent impact of each runoff section in June 2025. Of course, the number of lag time segments included in this feature set can be preset according to actual conditions, for example, 1, 2, 3, or 5, etc., and this embodiment does not impose any limitations on this.
[0049] It is understandable that historical time periods and their lag periods are time periods that have been fully experienced. Therefore, rainfall, evaporation, industrial water consumption, and measured runoff can be accurately measured. Furthermore, the natural runoff value can be calculated using the formula: measured net flow value + human water withdrawal, or it can be simulated using a pre-trained hydrological model or hydrological analogy methods.
[0050] S120. Obtain the simulated natural net flow, predicted rainfall, predicted evaporation, predicted industry water consumption, and measured runoff value and target equivalent impact quantity of each runoff section under the prediction time period, and form the characteristic set of each runoff section under the prediction time period.
[0051] The predicted time period can be understood as a time segment that includes future time. For example, if the current system time is September 3, 2025, then the predicted time period could be September 2025, a month that has not yet been fully experienced. Of course, because this predicted time period includes future time, the natural net flow, rainfall, evaporation, and industry water consumption within this predicted time period cannot be measured in real time. However, considering the uniformity of meteorological conditions in the same region in different years and the regularity of human activities, specific inference models can be used to estimate the simulated natural net flow, predicted rainfall, predicted evaporation, and predicted industry water consumption within the predicted time period relatively accurately.
[0052] If the predicted time interval includes the current system time, then each delayed time interval traced back from the predicted time interval is a time interval that has already passed. Therefore, the measured runoff values and target equivalent impact quantities under these delayed time intervals can be measured or obtained relatively accurately.
[0053] S130. After performing multi-source alignment and robust processing on the feature sets of each runoff section under the prediction time interval and multiple adjacent historical time intervals, construct a normalized time series feature matrix corresponding to each runoff section.
[0054] In this embodiment, a feature matrix needs to be constructed based on the feature sets of each runoff section in the prediction time period and multiple adjacent historical time periods. The actual runoff value of each runoff section in the prediction time period is then effectively predicted by combining the feature matrix.
[0055] When collecting feature sets from historical time periods, we can collect them over a large time span, such as 5 or 10 years. However, to ensure computational complexity and timeliness, we consider selecting only T feature sets (e.g., within 12 months) to construct the feature matrix used for actual inference.
[0056] In this embodiment, assuming T=12, if we need to predict the actual runoff value for the predicted time interval of September 2025, we can start from August 2025 and trace back 11 historical months, that is, October 2024 to August 2024. Then, we obtain the feature sets for these 11 historical months and the feature set for September 2025, forming 12 feature sets. After various data preprocessing operations such as multi-source alignment and robust processing, these 12 feature sets are used to construct a normalized time-series feature matrix corresponding to each runoff section.
[0057] In an optional implementation of this embodiment, the feature sets of each runoff section under the prediction time interval and multiple adjacent historical time intervals are combined into a feature set of time length T. After multi-source alignment and robust processing, a normalized time series feature matrix corresponding to each runoff section is constructed, which may include:
[0058] S1301. Based on the feature sets of each runoff section obtained after processing, the same feature under each historical time period is organized into feature column vectors according to the time extension order, and each feature column vector is expanded along the row to obtain the original time series feature matrix of each runoff section.
[0059] Understandably, if the number of runoff sections is 1, a single original time series feature matrix can be constructed. If the number of runoff sections is multiple, original time series feature matrices corresponding to each runoff section can be constructed separately. These multiple original time series feature matrices can be organized together to obtain a diagonal block matrix. Using this diagonal block matrix as a whole, the predicted actual runoff values of all runoff sections can be determined at once.
[0060] Assuming each feature set contains K features in total, and the time length (total number of feature sets) is T, a set of features can be constructed as follows: , , X is an original time-series feature matrix.
[0061] in, This represents a feature column vector, arranged chronologically, consisting of the k-th feature of each feature set across all time intervals. This feature column vector contains a total of T feature values.
[0062] S1302. Calculate the minimum value of each column in the original time series feature matrix column by column to form the first column vector, and calculate the maximum value of each column in the original time series feature matrix column by column to form the second column vector.
[0063] Specifically, it can be done through the formula: The first column vector m is calculated and obtained using the formula: The second column vector M is calculated. Both m and M contain K vector elements.
[0064] S1303. Generate the range column vector based on the first column vector and the second column vector, and construct the normalized diagonal matrix of each runoff section based on the range column vector.
[0065] Specifically, it can be done through the formula: The normalized diagonal matrix of each runoff section was calculated. .
[0066] Where Mm is the range column vector, It is a column vector of all 1s. , It involves placing the "(.)" vector into a K×K diagonal matrix. It is a small constant greater than 0, used to avoid the denominator being 0.
[0067] S1304. Based on the normalized diagonal matrix and the first column vector of each runoff section, the original time series feature matrix of each runoff section is normalized to obtain the normalized time series feature matrix of each runoff section.
[0068] Alternatively, it can be based on the formula: The normalized time-series characteristic matrix of the set runoff section was calculated. .
[0069] in, It is a column vector of all 1s. , Let m be the transpose of the first column vector m. .
[0070] S140. Obtain the pre-trained feature attention weights corresponding to each feature and the time attention weights corresponding to each lag scale for each runoff section, and use the feature attention weights and time attention weights as weighting factors to perform spatiotemporal fusion on the normalized time series feature matrix of each runoff section to obtain the weighted lag matrix of each runoff section.
[0071] In this context, feature attention weights can be understood as the importance weights of different features in the feature set when predicting actual runoff values. Lag scales can be understood as the historical time span referenced when predicting actual runoff values for the current prediction time period. In this embodiment, a maximum lag order L can be predefined, which can be understood as the furthest time step of historical observations included in a single prediction phase. For example, when the maximum lag order is 3, it means that a single prediction phase will use data from the current value and three time points prior to the current value as features.
[0072] In a specific example, if the maximum lag order is L, then the lag scale can be 1, 2, ..., L. The time attention weight can be understood as the importance weight of each lag scale determined by the maximum lag order in predicting actual runoff values.
[0073] Among them, the feature attention weights corresponding to each feature and the time attention weights corresponding to each lag scale that are pre-trained for each runoff section can be obtained by combining the feature sets under each historical time period with the accurate measured runoff values of each historical time period.
[0074] In an optional implementation of this embodiment, before performing spatiotemporal fusion of the normalized time-series feature matrices of each runoff section using each feature attention weight and each time attention weight as weighting factors to obtain the weighted lag matrix of each runoff section, the following may be included:
[0075] S1401. Based on the preset hysteresis shift operator, normalize the time series characteristic matrix of each runoff section. Hysteresis expansion is performed at each hysteresis scale to obtain the hysteresis integral matrix corresponding to each hysteresis scale of each runoff section.
[0076] Among them, a structure of the form: can be pre-constructed. hysteresis shift operator ,in, , L is the preset maximum lag order, and T is the aforementioned time length.
[0077] Then, according to the formula: Calculate the normalized time series feature matrix In lag scale The following are the hysteresis integral matrices obtained by performing hysteresis expansion respectively. ,in, .
[0078] Correspondingly, the lag matrix blocks at all lag scales can be combined to obtain the complete matrix Z, where, , .
[0079] S1402. Based on the hysteresis shift operator, normalize the time series characteristic matrix of each runoff section. The feature column vectors of each feature are expanded under full hysteresis scale to obtain feature block grouping matrices corresponding to each feature of each runoff section.
[0080] Furthermore, after obtaining the complete matrix Z, we can use the formula: The feature column vector of each feature k Performing hysteresis expansion at the full hysteresis scale yields the feature block grouping matrix corresponding to each feature k. .
[0081] in, , K represents the total number of features contained in each matrix set.
[0082] The calculations for S1401 and S1402, using a single runoff cross-section as an example, describe the calculation process for the hysteresis block matrix corresponding to each hysteresis scale of the runoff cross-section, and the feature block grouping matrix corresponding to each feature of the runoff cross-section. When there are multiple runoff cross-sections, the above calculation process can be performed multiple times.
[0083] In this embodiment, after calculating the aforementioned lag block matrix and feature block grouping matrix, in an optional implementation of this embodiment, the normalized time-series feature matrices of each runoff section are spatiotemporally fused using each feature attention weight and each time attention weight as weighting factors to obtain the weighted lag matrix of each runoff section, which may include:
[0084] According to the formula: The time-aggregated feature matrix R of each runoff section is calculated.
[0085] in, In order to be with the first The temporal attention weights corresponding to each lag scale can be obtained directly from the training results; The result is obtained from the previous calculation, and is related to the first... The lag block matrix corresponding to each lag scale By expanding, we can obtain:
[0086] ,in, In the time-aggregated feature matrix R, the t-th row can be understood as all the features under the t-th historical time segment, and the k-th column represents the time series corresponding to feature k.
[0087] According to the formula: Calculate the weighted hysteresis matrix for each runoff section. ,in, To assign feature attention weights to each feature k The new matrices are obtained by placing them into the diagonal matrix of K*K respectively.
[0088] Among them, the weighted lag matrix This can be understood as the result of channel scaling of the temporal aggregated feature matrix R based on the attention weights of each feature, resulting in a weighted lag matrix. The element expansion can be expressed by the following formula: .
[0089] That is, The result matrix is obtained after two-step weighting in both time and space (first time, then features). It can be understood as a tool used to weight each column of R.
[0090] In another optional implementation of this embodiment, the normalized time-series feature matrices of each runoff section are spatiotemporally fused using the attention weights of each feature and the attention weights of each time as weighting factors to obtain the weighted lag matrix of each runoff section. This may further include:
[0091] According to the formula: Construct column scaling vectors for each runoff section. ,in, Let L be the first vector consisting of L time attention weights. Let K be the second vector consisting of K feature attention weights. For Kronecker product, .
[0092] According to the formula The weighted hysteresis matrix of each runoff section was calculated. ,in, To be Each vector element in the data is placed into... The new matrix obtained from the diagonal matrix is Z, which is the complete matrix obtained by combining the lag blocks of matrices at all lag scales, i.e., , .
[0093] In In the middle, with feature k lag scale The corresponding column is multiplied by .
[0094] It is understandable that the two different weighted lag matrices obtained by the above two methods are adapted to different learners, among which, for The trained learner is more memory-efficient and better suited to tree models, while also being more targeted towards... The trained learner is more suitable for linear or generalized linear modeling and explicit feature selection.
[0095] S150. Input the weighted lag matrix of each runoff section into the pre-trained learner to obtain the equivalent impact prediction value of each runoff section under the prediction time period. Based on the natural runoff simulation value and the equivalent impact prediction value of each runoff section, calculate the actual runoff prediction value of each runoff section under the prediction time period.
[0096] In an optional implementation of this embodiment, the learner can be a pre-constructed regression function based on a multiple linear regression algorithm, which is obtained by weighting the hysteresis matrices of each runoff section (as described above). or Substituting these values into the regression function yields the predicted equivalent impact values for each runoff section within the predicted time period, i.e., the values corresponding to the predicted time period. .
[0097] In a specific example, the regression function can take the form of: ,Should The weight parameter vector obtained by pre-training the learner. The intercept value is obtained by pre-training the learner. A column vector consisting entirely of 1s. Used to convert scalars Translate to each time step. G is the input. or After obtaining the learner's output Then, the predicted equivalent impact value corresponding to a runoff cross section for the predicted time period can be extracted from this column vector. .
[0098] In another optional implementation of this embodiment, the learner can be a tree model or an ensemble model, such as RF (Random Forest) model, GB (Gradient Boosting) model, DT (Decision Tree) model, or XGB (eXtreme Gradient Boosting) model.
[0099] Specifically, when training the aforementioned tree model or ensemble model, the following can be used: or For input, accurate The learner is trained with the goal of minimizing the squared error or MAE (Mean Absolute Error) loss.
[0100] In this embodiment, after inputting the equivalent influence prediction value of each runoff section under the prediction time period through the learner, the actual runoff prediction value of each runoff section under the prediction time period can be obtained by combining it with the simulated natural net flow obtained under the prediction time period.
[0101] S160. After taking the predicted time interval as the new most recent historical time interval and obtaining a new predicted time interval, redetermine the feature set under the new predicted time interval, and return to execute the operation of forming a feature set of time length T for each runoff section under the predicted time interval and multiple adjacent historical time intervals, and perform multi-source alignment and robust processing until the actual runoff prediction value of each runoff section under the preset number of predicted time intervals is generated.
[0102] As mentioned earlier, by executing steps S110-S150, the actual runoff prediction value for a prediction time interval matching the current system time can be obtained. However, in practical applications, it is often necessary to predict multiple actual runoff values for multiple consecutive prediction time intervals under the current system time.
[0103] In a specific example, given that the current date is September 3, 2025, we aim to continuously predict the actual runoff values for four consecutive months from September to December 2025. Based on the aforementioned implementation method, the actual runoff forecast for September 2025 can already be predicted.
[0104] At this point, September 2025 can be used as a new most recent historical time period, and October 2025 as a new prediction time period. When generating the feature set corresponding to September 2025, it is necessary to obtain the natural net runoff value, rainfall, evaporation, and industry water consumption for September 2025, as well as the measured runoff value and target equivalent impact quantity for at least one lag time period in September 2025. The aforementioned natural net runoff value, rainfall, evaporation, and industry water consumption can be obtained using the simulated natural net runoff, predicted rainfall, predicted evaporation, and predicted industry water consumption corresponding to September 2025.
[0105] Next, a feature set corresponding to October 2025 needs to be constructed. At this point, it is necessary to obtain the measured runoff value and target equivalent impact for at least one lag time period (e.g., September 2025 and August 2025) corresponding to October 2025, including the simulated net natural flow, predicted rainfall, predicted evaporation, predicted industry water consumption, and the predicted time period. However, because September 2025 includes future time, the measured runoff value and target equivalent impact for September 2025 cannot be directly obtained. Therefore, the actual runoff forecast value for September 2025 obtained in the first round of prediction can be used as the measured runoff value for September 2025, and the target equivalent impact value for September 2025 can be obtained accordingly. Based on the reconstructed feature sets described above, the actual runoff forecast for October 2025 can be predicted again by executing the operation steps S110-S150. Similarly, by updating the feature sets multiple times and executing the operation steps S110-S150, the actual runoff forecast for November 2025 and December 2025 can be predicted sequentially.
[0106] The technical solution of this invention creatively proposes a mutual information-driven runoff prediction method oriented towards the time-lag effect of water engineering. Mutual information drives the feature layer and time layer attention respectively. The former scores the mutual information between multi-source features and the impact of human activities to identify hydrological and water use characteristics; the latter captures the short-term variation characteristics and time-lag effects of flow through time-series lag terms to characterize the lag time and intensity of reservoir regulation and discharge. After fusing the above spatiotemporal features, runoff prediction can be effectively achieved. The technical solution of this invention can clearly characterize the combined effect of water intake and water use and engineering regulation on downstream runoff in the absence of water engineering and river discharge monitoring data, and improve the accuracy and interpretability of runoff prediction. This effectively improves the accuracy of river runoff prediction in scenarios where water engineering and water intake monitoring data are lacking, providing operable quantitative support for early warning of river flood peaks, zoned water use management, and ecological water replenishment and scheduling optimization, and has significant management practical significance.
[0107] Based on the above embodiments, before obtaining the pre-trained feature attention weights corresponding to each feature for each runoff section and the time attention weights corresponding to each lag scale, the method may further include:
[0108] S1601. From the feature sets of each runoff section under multiple historical time periods, continuously select feature sets of time length T to form the normalized standard time series feature matrix of each runoff section.
[0109] In this embodiment, in order to accurately train and obtain the feature attention weights corresponding to each feature and the time attention weights corresponding to each lag scale, the training data used are all data from historical time periods, that is, there is no inference-derived prediction data in the training data.
[0110] In a specific example, to predict the actual runoff value in September 2025, feature attention weights and time attention weights can be trained using feature sets from historical time periods prior to September 2025. When predicting September 2025, assuming the selected time length T is 12, the selected time length for training the aforementioned weights is also T=12. To ensure the timeliness of the data, 12 historical months from September 2024 to August 2025 can be selected as the historical time period, and 12 feature sets can be obtained for each of these periods.
[0111] For each of the aforementioned feature sets, a normalized standard time series feature matrix matching the feature sets under the aforementioned multiple historical time periods can be obtained by executing the aforementioned operation steps S1301-S1304. The normalized standard time series feature matrix has the same data structure and calculation method as the aforementioned normalized time series feature matrix; the only difference is the input data source used.
[0112] S1602. Based on the hysteresis shift operator, the normalized standard time series characteristic matrix of each runoff section is hysterically expanded at each hysteresis scale to obtain the hysteresis integral matrix corresponding to each hysteresis scale of each runoff section.
[0113] S1603. Based on the hysteresis shift operator, perform hysteresis expansion on the feature column vector of each feature in the normalized standard time series feature matrix of each runoff section under the full hysteresis scale to obtain the feature block grouping matrix corresponding to each feature of each runoff section.
[0114] After obtaining the normalized standard time series feature matrix, the aforementioned operation steps S1401-S1402 can be used to calculate the lag matrix corresponding to each lag scale of each runoff section and the lag matrix corresponding to each lag scale of each runoff section.
[0115] S1604. Based on the feature block grouping matrix of each runoff section calculated from the normalized standard time series feature matrix of each runoff section and the target equivalent influence of each runoff section in the most recent historical time period, calculate the feature attention weight corresponding to each feature of each runoff section.
[0116] In a specific example, when calculating the normalized standard time series feature matrix, selecting September 2024 to August 2025 as the historical time period allows us to obtain the target equivalent impact in August 2025. Calculate the attention weights for each feature and the attention weights for each time period.
[0117] In an optional implementation of this embodiment, the feature attention weights corresponding to each feature of each runoff section are calculated based on the feature block grouping matrix of each runoff section calculated from the normalized standard time series feature matrix of each runoff section and the target equivalent influence of each runoff section in the most recent historical time period. This may include:
[0118] Based on the grouping matrix of each feature block of each runoff section and the target equivalent influence of each runoff section in the most recent historical time period. Based on the formula:
[0119] , The feature score corresponding to each feature k of each runoff section is calculated. ;
[0120] Where L represents the total number of lag scales. For mutual information estimation operators, The feature block grouping matrix corresponding to feature k In the middle, with the first The feature data corresponding to each lag scale; K is the total number of features contained in the feature set;
[0121] Based on the feature score for each feature k, using the formula:
[0122] , , The feature attention weights corresponding to each feature k of each runoff section are calculated. ;
[0123] in, The preset first temperature coefficient, , It is the maximum value among the K feature scores.
[0124] In this optional implementation, by The calculation formula is equivalent to aggregating the mutual information between all lag columns and the target equivalent influence for each feature k, resulting in the final feature score. The mutual information estimation operator can be one of the K-nearest neighbors, kernel density estimation, or histogram estimation. The core algorithm used calculates the aforementioned mutual information. The specific algorithm employed can be freely chosen based on the data scale or the specific data distribution.
[0125] Furthermore, the feature attention weights corresponding to each feature k are calculated. This is unrelated to actual lag and is used solely for channel scaling, without assigning weights to any lag. This is the preset first temperature coefficient, which can be understood as the sharpening factor. The larger the value, the better. The trend is increasingly towards a "winner-takes-all" mentality (with more pronounced weighting). The smaller the value, the better. The smoother the value, the closer it is to a uniform distribution. Therefore, those skilled in the art can freely set the first temperature coefficient in practical applications, and this embodiment does not impose any restrictions on this.
[0126] S1605. Based on the normalized standard time series feature matrix of each runoff section, the lagging integral matrix of each runoff section is calculated, and the target equivalent influence of each runoff section in the most recent historical time period, calculate the time attention weight corresponding to each lag scale of each runoff section.
[0127] In an optional implementation of this embodiment, the time attention weights corresponding to each lag scale of each runoff section are calculated based on the lag block matrices of each runoff section calculated from the normalized standard time series feature matrices of each runoff section and the target equivalent influence of each runoff section in the most recent historical time period. This may include:
[0128] Based on the target equivalent impact of each lag integral matrix and each runoff section in the most recent historical time period. Based on the formula:
[0129] , Each lag scale was calculated and Correlation strength between ;in, In order to be with the first Each lag scale corresponds to a lag block matrix;
[0130] According to each lag scale and The correlation strength between them is based on the formula:
[0131] , , The calculation yields the result for each lag scale. The corresponding time attention weights ;
[0132] in, The preset second temperature coefficient, , It represents the maximum value among the correlation strengths of the L lag scales.
[0133] In this embodiment, This can be understood as each lag scale The mutual information score between the target and the equivalent impact quantity. The time attention weight vector represents the relative contribution of different lag scales to the current prediction, which can be interpreted as "effective time memory". The concept and significance of the second temperature coefficient are basically the same as those of the first temperature coefficient, and will not be repeated here.
[0134] Based on the above embodiments, before inputting the weighted hysteresis matrix of each runoff section into the pre-trained learner, the following may also be included:
[0135] The operation of repeatedly selecting feature sets of time length T from the feature sets of each runoff section under multiple historical time intervals is performed to construct the weighted lag matrix of each runoff section, resulting in multiple weighted lag matrices of each runoff section.
[0136] The learner is trained based on multiple weighted lag matrices of each runoff section and the target equivalent influence of each runoff section in the most recent historical time interval associated with each weighted lag matrix.
[0137] In this embodiment, to train the learner, the aforementioned method can be used to generate a corresponding weighted lag matrix for each runoff section's feature set across multiple consecutive historical time intervals (i.e., the aforementioned...). or By selecting feature sets from multiple consecutive historical time periods, multiple weighted lag matrices can be calculated accordingly. Furthermore, each weighted lag matrix has a corresponding equivalent impact value for the most recent historical time period.
[0138] Based on the aforementioned weighted lag matrices and the matched target equivalent influence, the learner can be trained accordingly.
[0139] In a specific example, based on multiple linear regression (with... When constructing a learner using regular expressions, you can create a structure like this: The linear regression function.
[0140] in, for or ; A set of time indices for the training set; This represents the number of training samples; The target equivalent influence on the training set; according to Take the row submatrix, dimension ,in or ; is the parameter vector (weights) of the linear model; b is the intercept (bias) term; , used to restrict The amplitude of the curve is reduced, thus reducing overfitting. Used to calculate the parameter vector (.). The square of the norm; It is a vector consisting entirely of 1s.
[0141] To further clarify the implementation schemes of the various embodiments of the present invention, through Figures 2-4The scheme is described with illustrations.
[0142] in, Figure 2 This is a schematic diagram of a complete technical route to which the technical solution of the embodiment of the present invention applies; Figure 3 This is a flowchart illustrating a mutual information attention algorithm applicable to the technical solution of this embodiment of the invention. Figure 4 This is a schematic diagram comparing the predicted runoff of a runoff section with the actual runoff after applying the technical solution of the embodiments of the present invention.
[0143] First, the technical concepts of the various embodiments of the present invention will be further described. Specifically, the introduction of time-series features (i.e., measured runoff values and target equivalent impact quantities under at least one lag time interval in each historical time period) into the feature set in the various embodiments of the present invention is based on current water resource management experience. On the one hand, past flow data contains the current hydrological state of the basin, capturing the characteristics of short-term flow changes. On the other hand, the target variable (i.e., the target equivalent impact quantity) in the embodiments of the present invention reflects the intensity and pattern of regional water project scheduling. Since human activities such as reservoir scheduling, water intake and use are often periodic, and water resource management policies usually have stability and "management memory"—that is, past management decisions influence subsequent decisions—time-series features further enhance the model's ability to capture hydrological changes and water resource management decisions.
[0144] Specifically, such as Figure 2 First, it is necessary to collect sample data for training the learner. This sample data includes hydrological and meteorological data (i.e., precipitation and evaporation data), user water usage information, and past measured runoff values. Following this, multi-source data alignment can be performed based on this data, and robust handling of missing and outlier data can be achieved simultaneously. Further, a physical hydrological model needs to be run to obtain natural runoff values. And define the target equivalent impact quantity. To train the learner and reconstruct it accordingly. .
[0145] After obtaining the above-mentioned data, a corresponding model can be constructed, including natural factors (rainfall, evaporation, naturalized runoff, etc.), human activity proxy factors (such as proxy quantities obtained from statistical water use), and time-series memory factors. , Candidate features (input X & Y) such as k=1…L).
[0146] Afterwards, combined Figure 3 For example, by applying the mutual information attention algorithm, the candidate features are first calculated and... The mutual information is used to obtain feature attention weights, which are applied only to channels for channel-level scaling and do not assign weights to any lags. Further, the mutual information of each lag term (or multi-scale time slice) is calculated. The mutual information is used to obtain temporal attention weights. The lags are weighted and combined according to the temporal weights to form a temporal aggregation result, and then channel scaling is performed according to the feature weights to obtain a weighted representation, which is then output to the sample trainer.
[0147] Based on the weighted representation, at least one model can be trained, such as: multiple linear regression, random forest, gradient boosting, AdaBoost, or XGBoost, to output... and Correspondingly, evaluation algorithms such as NSE (Normalized Mean Squared Error), RMSE (Root Mean Squared Error), or MAE (Mean Absolute Error) can be used to evaluate the predictive performance of the model.
[0148] In this embodiment, the experiment selected sections S1-S4 in the densely populated human activity area of the Yellow River Basin. A validated WAS (Water Allocation and Simulation) model was used to simulate the natural runoff process, and calibration and validation were performed based on historical natural runoff data. Compared with the simulation results of the hydrological model, the NSE index improved as follows after adopting the runoff impact prediction method based on mutual information, two-layer attention, and physical benchmarks: section S1 improved from 0.03 to 0.63, section S2 from -1.55 to 0.58, section S3 from -0.93 to 0.82, and section S4 from -2.64 to 0.75.
[0149] Specifically, in Figure 4 The paper specifically shows the comparison results of the optimal model simulation and measured runoff for the S1-S4 sections. The DLWD-ML model specifically refers to machine learning prediction that considers the dual-Lag effect of water storage and diversion. This DLWD-ML model highlights important information by assigning weights.
[0150] It is important to reiterate that the embodiments of this invention disclose a mutual information-driven runoff prediction method for the time-delay effects of water engineering projects. Mutual information drives the feature layer and time layer attention respectively. The former scores the mutual information between multi-source features and the target, identifying hydrological and water use characteristics (channel gating); the latter captures the short-term variation characteristics and time-delay effects of flow through time-series lag terms to characterize the lag time and intensity of reservoir regulation and discharge (causal convolution); then, the spatiotemporal joint features are unified through the Kronecker product to fuse and analyze the "multi-source features × lag terms". In the absence of monitoring data on water engineering projects and river discharge, this method can clearly characterize the joint effects of water intake and water use and engineering regulation on downstream runoff, and improve the accuracy and interpretability of runoff prediction.
[0151] Figure 5 This is a schematic diagram of a runoff prediction device based on spatiotemporal dual-layer attention, provided as an embodiment of the present invention. Figure 5 As shown, the device includes: a first feature set acquisition module 510, a second feature set acquisition module 520, a time-series feature matrix construction module 530, a weighted lag matrix generation module 540, an actual runoff prediction module 550, and a repetitive iteration module 560, wherein:
[0152] The first feature set acquisition module 510 is used to acquire the feature sets of each runoff section in multiple historical time periods.
[0153] The feature set for each historical time period includes the natural net runoff, rainfall, evaporation, and industry water consumption for that historical time period, as well as the measured runoff and target equivalent impact for at least one lag time period of that historical time period.
[0154] The second feature set acquisition module 520 is used to acquire the simulated natural net flow, predicted rainfall, predicted evaporation, predicted industry water consumption, and measured runoff value and target equivalent impact quantity of each runoff section under the prediction time period, forming the feature set of each runoff section under the prediction time period.
[0155] The time series feature matrix construction module 530 is used to construct a normalized time series feature matrix corresponding to each runoff section after performing multi-source alignment and robust processing on the feature sets of each runoff section under the prediction time interval and multiple adjacent historical time intervals.
[0156] The weighted lag matrix generation module 540 is used to obtain the feature attention weights corresponding to each feature and the time attention weights corresponding to each lag scale that are pre-trained for each runoff section, and to perform spatiotemporal fusion on the normalized time series feature matrix of each runoff section using the feature attention weights and the time attention weights as weighting factors to obtain the weighted lag matrix of each runoff section.
[0157] The actual runoff prediction module 550 is used to input the weighted lag matrix of each runoff section into a pre-trained learner to obtain the equivalent impact prediction value of each runoff section under the prediction time period, and calculate the actual runoff prediction value of each runoff section under the prediction time period based on the natural runoff simulation value and the equivalent impact prediction value of each runoff section.
[0158] The iterative module 560 is used to take the predicted time interval as the new most recent historical time interval and obtain a new predicted time interval, redetermine the feature set under the new predicted time interval, and return to perform the operation of forming a feature set of time length T for each runoff section under the predicted time interval and multiple adjacent historical time intervals, and perform multi-source alignment and robust processing until the actual runoff prediction value of each runoff section under the predicted time interval is generated.
[0159] The technical solution of this invention creatively proposes a mutual information-driven runoff prediction method oriented towards the time-lag effect of water engineering. Mutual information drives the feature layer and time layer attention respectively. The former scores the mutual information between multi-source features and the impact of human activities to identify hydrological and water use characteristics; the latter captures the short-term variation characteristics and time-lag effects of flow through time-series lag terms to characterize the lag time and intensity of reservoir regulation and discharge. After fusing the above spatiotemporal features, runoff prediction can be effectively achieved. The technical solution of this invention can clearly characterize the combined effect of water intake and water use and engineering regulation on downstream runoff in the absence of water engineering and river discharge monitoring data, and improve the accuracy and interpretability of runoff prediction. This effectively improves the accuracy of river runoff prediction in scenarios where water engineering and water intake monitoring data are lacking, providing operable quantitative support for early warning of river flood peaks, zoned water use management, and ecological water replenishment and scheduling optimization, and has significant management practical significance.
[0160] Based on the above embodiments, the time-series feature matrix construction module 530 can be specifically used for:
[0161] Based on the feature sets of each runoff section obtained after processing, the same feature under each historical time period is organized into feature column vectors according to the time extension order, and each feature column vector is expanded along the row to obtain the original time series feature matrix of each runoff section.
[0162] The minimum value of each column in the original time series feature matrix is calculated column by column to form the first column vector, and the maximum value of each column in the original time series feature matrix is calculated column by column to form the second column vector;
[0163] Based on the first column vector and the second column vector, a range column vector is generated, and a normalized diagonal matrix for each runoff section is constructed based on the range column vector.
[0164] Based on the normalized diagonal matrix and the first column vector of each runoff section, the original time series feature matrix of each runoff section is normalized to obtain the normalized time series feature matrix of each runoff section.
[0165] Based on the above embodiments, an attention weight training module may also be included, comprising:
[0166] The standard time series feature matrix forming unit is used to continuously select T feature sets of time length from the feature sets of each runoff section under multiple historical time intervals before obtaining the feature attention weights corresponding to each feature and the time attention weights corresponding to each lag scale that are pre-trained for each runoff section. This forms the normalized standard time series feature matrix of each runoff section.
[0167] The hysteresis integral matrix generation unit is used to perform hysteresis expansion of the normalized standard time series feature matrix of each runoff section at each hysteresis scale according to the hysteresis shift operator, so as to obtain the hysteresis integral matrix corresponding to each hysteresis scale of each runoff section.
[0168] The feature block grouping matrix generation unit is used to perform hysteresis expansion of the feature column vector of each feature in the normalized standard time series feature matrix of each runoff section under the full hysteresis scale according to the hysteresis shift operator, so as to obtain the feature block grouping matrix corresponding to each feature of each runoff section.
[0169] The feature attention weight calculation unit is used to calculate the feature attention weights corresponding to each feature of each runoff section based on the feature block grouping matrix of each runoff section calculated from the normalized standard time series feature matrix of each runoff section and the target equivalent influence of each runoff section in the most recent historical time period.
[0170] The time attention weight calculation unit is used to calculate the time attention weight corresponding to each lag scale of each runoff section based on the lag block matrix of each runoff section calculated from the normalized standard time series feature matrix of each runoff section and the target equivalent influence of each runoff section in the most recent historical time period.
[0171] Based on the above embodiments, the feature attention weight calculation unit can be further used for:
[0172] Based on the grouping matrix of each feature block of each runoff section and the target equivalent influence of each runoff section in the most recent historical time period. Based on the formula:
[0173] , The feature score corresponding to each feature k of each runoff section is calculated. ;
[0174] Where L represents the total number of lag scales. For mutual information estimation operators, The feature block grouping matrix corresponding to feature k In the middle, with the first The feature data corresponding to each lag scale; K is the total number of features contained in the feature set;
[0175] Based on the feature score for each feature k, using the formula:
[0176] , , The feature attention weights corresponding to each feature k of each runoff section are calculated. ;
[0177] in, The preset first temperature coefficient, , It is the maximum value among the K feature scores.
[0178] Based on the above embodiments, the time attention weight calculation unit can be specifically used for:
[0179] Based on the target equivalent impact of each lag integral matrix and each runoff section in the most recent historical time period. Based on the formula:
[0180] , Each lag scale was calculated and Correlation strength between ;in, In order to be with the first Each lag scale corresponds to a lag block matrix;
[0181] According to each lag scale and The correlation strength between them is based on the formula:
[0182] , , The calculation yields the result for each lag scale. The corresponding time attention weights ;
[0183] in, The preset second temperature coefficient, , It represents the maximum value among the correlation strengths of the L lag scales.
[0184] Based on the above embodiments, the weighted hysteresis matrix generation module 540 can be specifically used for:
[0185] According to the formula: The time-aggregated feature matrix R of each runoff section is calculated.
[0186] According to the formula: Calculate the weighted hysteresis matrix for each runoff section. ,in, To assign feature attention weights to each feature k The new matrices are obtained by placing them into the diagonal matrix of K*K respectively;
[0187] or
[0188] According to the formula: Construct column scaling vectors for each runoff section. ,in, Let L be the first vector consisting of L time attention weights. Let K be the second vector consisting of K feature attention weights. For Kronecker product;
[0189] According to the formula The weighted hysteresis matrix of each runoff section was calculated. ,in, To be Each vector element in the data is placed into... The new matrix obtained from the diagonal matrix is Z, which is the complete matrix obtained by combining the lag blocks of all lag scales.
[0190] Based on the above embodiments, a learner training module may also be included, used for:
[0191] Before inputting the weighted lag matrix of each runoff section into the pre-trained learner, the operation of continuously selecting feature sets of time length T from the feature sets of each runoff section under multiple historical time intervals is performed multiple times to construct the weighted lag matrix of each runoff section, thus obtaining multiple weighted lag matrices of each runoff section.
[0192] The learner is trained based on multiple weighted lag matrices of each runoff section and the target equivalent influence of each runoff section in the most recent historical time interval associated with each weighted lag matrix.
[0193] The runoff prediction device based on spatiotemporal dual-layer attention provided in the embodiments of the present invention can execute the runoff prediction method based on spatiotemporal dual-layer attention provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.
[0194] The collection, storage, use, processing, transmission, provision, and disclosure of user personal information involved in the technical solution disclosed herein comply with the provisions of relevant laws and regulations and do not violate public order and good morals.
[0195] Figure 6 A schematic diagram of an electronic device 10, which can be used to implement embodiments of the present invention, is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the invention described and / or claimed herein.
[0196] like Figure 6 As shown, the electronic device 10 includes at least one processor 11 and a memory, such as a read-only memory (ROM) 12 or a random access memory (RAM) 13, communicatively connected to the at least one processor 11. The memory stores computer programs executable by the at least one processor. The processor 11 can perform various appropriate actions and processes based on the computer program stored in the ROM 12 or loaded from storage unit 18 into the RAM 13. The RAM 13 can also store various programs and data required for the operation of the electronic device 10. The processor 11, ROM 12, and RAM 13 are interconnected via a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0197] Multiple components in electronic device 10 are connected to I / O interface 15, including: input unit 16, such as keyboard, mouse, etc.; output unit 17, such as various types of displays, speakers, etc.; storage unit 18, such as disk, optical disk, etc.; and communication unit 19, such as network card, modem, wireless transceiver, etc. Communication unit 19 allows electronic device 10 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.
[0198] Processor 11 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. Processor 11 performs the various methods and processes described above, such as performing the runoff prediction method based on spatiotemporal two-layer attention as described in any embodiment of the present invention.
[0199] Obtain feature sets of each runoff section in multiple historical time periods;
[0200] The feature set for each historical time period includes the natural net runoff, rainfall, evaporation, and industry water consumption for that historical time period, as well as the measured runoff and target equivalent impact for at least one lag time period of that historical time period.
[0201] The simulated natural net flow, predicted rainfall, predicted evaporation, predicted industry water consumption, and measured runoff value and target equivalent impact quantity of each runoff section under the prediction time period are obtained, forming a feature set of each runoff section under the prediction time period.
[0202] After the feature sets of each runoff section under the prediction time period and multiple adjacent historical time periods are combined into a time length T feature set, and after multi-source alignment and robust processing, a normalized time series feature matrix corresponding to each runoff section is constructed.
[0203] Obtain the pre-trained feature attention weights corresponding to each feature and the time attention weights corresponding to each lag scale for each runoff section, and use the feature attention weights and time attention weights as weighting factors to perform spatiotemporal fusion on the normalized time series feature matrix of each runoff section to obtain the weighted lag matrix of each runoff section.
[0204] The weighted lag matrix of each runoff section is input into the pre-trained learner to obtain the equivalent impact prediction value of each runoff section under the prediction time period. Based on the natural runoff simulation value and the equivalent impact prediction value of each runoff section, the actual runoff prediction value of each runoff section under the prediction time period is calculated.
[0205] After taking the predicted time interval as the new most recent historical time interval and obtaining a new predicted time interval, the feature set under the new predicted time interval is redefined, and the operation of forming a feature set of time length T for each runoff section under the predicted time interval and multiple adjacent historical time intervals is performed for multi-source alignment and robust processing until the actual runoff prediction value of each runoff section under the preset number of predicted time intervals is generated.
[0206] In some embodiments, the runoff prediction method based on spatiotemporal dual attention as described in any embodiment of the present invention can be implemented as a computer program tangibly contained in a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program can be loaded and / or installed on electronic device 10 via ROM 12 and / or communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of the runoff prediction method based on spatiotemporal dual attention as described above in any embodiment of the present invention can be performed. Alternatively, in other embodiments, processor 11 can be configured by any other suitable means (e.g., by means of firmware) to perform the runoff prediction method based on spatiotemporal dual attention as described in any embodiment of the present invention.
[0207] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.
[0208] Computer programs used to implement the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when executed by the processor, the computer programs cause the functions / operations specified in the flowcharts and / or block diagrams to be performed. The computer programs may be executed entirely on a machine, partially on a machine, or as a standalone software package, partially on a machine and partially on a remote machine, or entirely on a remote machine or server.
[0209] In the context of this invention, a computer-readable storage medium can be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, apparatus, or device. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination thereof. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.
[0210] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).
[0211] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or middleware components (e.g., application servers), or frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), blockchain networks, and the Internet.
[0212] A computing system can include clients and servers. Clients and servers are generally located far apart and typically interact through communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a hosting product within the cloud computing service system to address the shortcomings of traditional physical hosts and VPS services, such as high management difficulty and weak business scalability.
[0213] It should be understood that the various forms of processes shown above can be used, with steps reordered, added, or deleted. For example, the steps described in this invention can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this invention can be achieved, and this is not limited herein.
[0214] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.
Claims
1. A runoff prediction method based on spatiotemporal dual-layer attention, characterized in that, include: Obtain feature sets of each runoff section in multiple historical time periods; The feature set for each historical time period includes the natural runoff value, rainfall, evaporation, and industry water consumption for that historical time period, as well as the measured runoff value and target equivalent impact value for at least one lag time period of that historical time period. Industry water consumption includes the sum of domestic water consumption, industrial water consumption, agricultural water consumption, and ecological water consumption. The target equivalent impact value for a specific historical time period can be calculated by subtracting the measured runoff value for that historical time period from the natural runoff value for that historical time period. The simulated natural runoff, predicted rainfall, predicted evaporation, predicted industry water consumption, and measured runoff value and target equivalent impact quantity of each runoff section under the prediction time period are obtained, forming a feature set of each runoff section under the prediction time period. After the feature sets of each runoff section under the prediction time period and multiple adjacent historical time periods are combined into a time length T feature set, and after multi-source alignment and robust processing, a normalized time series feature matrix corresponding to each runoff section is constructed. Obtain the pre-trained feature attention weights corresponding to each feature and the time attention weights corresponding to each lag scale for each runoff section, and use the feature attention weights and time attention weights as weighting factors to perform spatiotemporal fusion on the normalized time series feature matrix of each runoff section to obtain the weighted lag matrix of each runoff section. The weighted lag matrix of each runoff section is input into the pre-trained learner to obtain the equivalent impact prediction value of each runoff section under the prediction time period. Based on the natural runoff simulation value and the equivalent impact prediction value of each runoff section, the actual runoff prediction value of each runoff section under the prediction time period is calculated. After taking the predicted time interval as the new most recent historical time interval and obtaining a new predicted time interval, the feature set under the new predicted time interval is redefined, and the operation of forming a feature set of time length T for each runoff section under the predicted time interval and multiple adjacent historical time intervals is performed for multi-source alignment and robust processing until the actual runoff prediction value of each runoff section under the preset number of predicted time intervals is generated.
2. The method according to claim 1, characterized in that, After combining the feature sets of each runoff section under the predicted time period with multiple adjacent historical time periods into a time-length T feature set, and performing multi-source alignment and robust processing, a normalized time-series feature matrix corresponding to each runoff section is constructed, including: Based on the feature sets of each runoff section obtained after processing, the same feature under each historical time period is organized into feature column vectors according to the time extension order, and each feature column vector is expanded along the row to obtain the original time series feature matrix of each runoff section. The minimum value of each column in the original time series feature matrix is calculated column by column to form the first column vector, and the maximum value of each column in the original time series feature matrix is calculated column by column to form the second column vector; Based on the first column vector and the second column vector, a range column vector is generated, and a normalized diagonal matrix for each runoff section is constructed based on the range column vector. Based on the normalized diagonal matrix and the first column vector of each runoff section, the original time series feature matrix of each runoff section is normalized to obtain the normalized time series feature matrix of each runoff section.
3. The method according to claim 1, characterized in that, Before obtaining the pre-trained feature attention weights corresponding to each feature for each runoff section, and the time attention weights corresponding to each lag scale, the following steps are also included: From the feature sets of each runoff section under multiple historical time periods, T feature sets of time length are continuously selected to form the normalized standard time series feature matrix of each runoff section. Based on the hysteresis shift operator, the normalized standard time series feature matrix of each runoff section is hysterically expanded at each hysteresis scale to obtain the hysteresis integral matrix corresponding to each hysteresis scale of each runoff section. Based on the hysteresis shift operator, the feature column vectors of each feature in the normalized standard time series feature matrix of each runoff section are expanded under the full hysteresis scale to obtain the feature block grouping matrix corresponding to each feature of each runoff section. Based on the feature block grouping matrix of each runoff section calculated from the normalized standard time series feature matrix of each runoff section and the target equivalent influence of each runoff section in the most recent historical time period, the feature attention weights corresponding to each feature of each runoff section are calculated. Based on the lag matrix of each runoff section calculated from the normalized standard time series feature matrix of each runoff section and the target equivalent influence of each runoff section in the most recent historical time period, the time attention weight corresponding to each lag scale of each runoff section is calculated.
4. The method according to claim 3, characterized in that, Based on the feature block grouping matrix of each runoff section calculated from the normalized standard time-series feature matrix of each runoff section and the target equivalent influence of each runoff section in the most recent historical time period, the feature attention weights corresponding to each feature of each runoff section are calculated, including: Based on the grouping matrix of each feature block of each runoff section and the target equivalent influence of each runoff section in the most recent historical time period. Based on the formula: , The feature score corresponding to each feature k of each runoff section is calculated. ; Where L is the total number of lag scales. For mutual information estimation operators, The feature block grouping matrix corresponding to feature k In the middle, with the first The feature data corresponding to each lag scale; K is the total number of features contained in the feature set; Based on the feature score for each feature k, using the formula: , , The feature attention weights corresponding to each feature k of each runoff section are calculated. ; in, The preset first temperature coefficient, , It is the maximum value among the K feature scores.
5. The method according to claim 3, characterized in that, Based on the lag matrix of each runoff section calculated from the normalized standard time-series feature matrix of each runoff section and the target equivalent influence of each runoff section in the most recent historical time period, the time attention weights corresponding to each lag scale of each runoff section are calculated, including: Based on the target equivalent impact of each lag integral matrix and each runoff section in the most recent historical time period. Based on the formula: , Each lag scale was calculated and Correlation strength between ;in, In order to be with the first Each lag scale corresponds to a lag block matrix; According to each lag scale and The correlation strength between them is based on the formula: , , The calculation yields the result for each lag scale. The corresponding time attention weights ; in, The preset second temperature coefficient, , It represents the maximum value among the correlation strengths of the L lag scales.
6. The method according to claim 5, characterized in that, Using the attention weights of each feature and the attention weights of each time as weighting factors, the normalized time-series feature matrices of each runoff section are spatiotemporally fused to obtain the weighted lag matrix of each runoff section, including: According to the formula: The time-aggregated feature matrix R of each runoff section is calculated. According to the formula: Calculate the weighted hysteresis matrix for each runoff section. ,in, To assign feature attention weights to each feature k The new matrices are obtained by placing them into the diagonal matrix of K*K respectively; or According to the formula: Construct column scaling vectors for each runoff section. ,in, Let L be the first vector consisting of L time attention weights. Let K be the second vector consisting of K feature attention weights. For Kronecker product; According to the formula The weighted hysteresis matrix of each runoff section was calculated. ,in, To be Each vector element in the data is placed into... The new matrix obtained from the diagonal matrix is Z, which is the complete matrix obtained by combining the lag blocks of all lag scales.
7. The method according to any one of claims 1-6, characterized in that, Before inputting the weighted hysteresis matrices of each runoff section into the pre-trained learner, the following steps are also included: The operation of repeatedly selecting feature sets of time length T from the feature sets of each runoff section under multiple historical time intervals is performed to construct the weighted lag matrix of each runoff section, resulting in multiple weighted lag matrices of each runoff section. The learner is trained based on multiple weighted lag matrices of each runoff section and the target equivalent influence of each runoff section in the most recent historical time interval associated with each weighted lag matrix.
8. An electronic device, characterized in that, The electronic device includes: At least one processor; and A memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform the runoff prediction method based on spatiotemporal dual attention as described in any one of claims 1-7.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions that cause a processor to execute the runoff prediction method based on spatiotemporal dual-layer attention as described in any one of claims 1-7.
10. A computer program product, characterized in that, The computer program product includes a computer program that, when executed by a processor, implements the runoff prediction method based on spatiotemporal dual-layer attention according to any one of claims 1-7.
Citation Information
Patent Citations
Multi-task runoff prediction method based on space-time attention graph convolutional network
CN117217949A
Staged design flood estimation method under influence of climate change and reservoir regulation and storage
CN120671487A