Runoff prediction method based on space-time heterogeneous graph neural network and terminal

Through the runoff prediction method based on spatiotemporal heterogeneous graph neural network, the problem of insufficient adaptability of traditional models in the face of diversified basin conditions and nonlinear hydrological processes is solved, and the effective capture of hydrological spatiotemporal correlation characteristics is achieved, and the accuracy and reliability of forecasts are improved.

CN119940609AInactive Publication Date: 2025-05-06STATE GRID FUJIAN ELECTRIC POWER CO LTD +1

Patent Information

Application Number
CN202411966692.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-30
Publication Date
2025-05-06
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

Traditional hydrological runoff prediction models lack adaptability when facing diversified basin conditions and nonlinear hydrological processes, and deep learning models are difficult to effectively utilize hydrological information in spatial dimensions.

Method used

The runoff prediction method based on the spatiotemporal heterogeneous graph neural network is adopted, and the hydrological timing data and spatial site information data of each site are obtained, and the hydrological timing data and spatial site information data are obtained, and the graph attention network is used to generate feature embedding vectors representing the spatiotemporal and spatial relationships, and a fully connected layer is input to construct a spatiotemporal heterogeneous graph flood forecast model.

Benefits of technology

Effectively capture and utilize the spatial and temporal correlation characteristics between hydrological variables, improve the accuracy and reliability of forecasts, and adapt to the basin characteristics and climate change in different regions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119940609A_ABST
    Figure CN119940609A_ABST
Patent Text Reader

Abstract

The invention discloses a runoff prediction method and terminal based on a space-time heterogeneous graph neural network, and the method comprises the steps: obtaining hydrological time series data and space station information data collected by each station, and carrying out the preprocessing of the hydrological time series data and the space station information data; performing weighted fusion according to the features of the preprocessed hydrological time series data and the space station information data, generating a feature embedding vector representing a global variable time-space relationship through a graph attention network, and inputting the feature embedding vector into a full connection layer to obtain an output multi-station runoff prediction sequence. Constructing a space-time heterogeneous graph flood forecasting model; performing model parameter optimization on the space-time heterogeneous graph flood forecasting model; and carrying out runoff prediction on the hydrological time sequence data and the space station information data which are received in real time according to the optimized space-time heterogeneous graph flood forecasting model. In this way, hydrological space-time correlation characteristics can be effectively captured in forecasting, so that the accuracy and reliability of forecasting are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of hydrological runoff prediction, and in particular to a runoff prediction method and terminal based on spatiotemporal heterogeneous graph neural network. Background Art

[0002] Traditional flood forecasting models, such as the Xin'anjiang model and the Muskingum model, simulate flood forecasting based on physical mechanisms and describe hydrological processes through preset parameters. However, traditional models rely on fixed parameter settings and assumptions about physical laws, and lack the ability to adapt to nonlinear and complex dynamic hydrological processes. When faced with diverse basin conditions and nonlinear hydrological processes, they often perform poorly due to their fixed parameters and limited spatial analysis capabilities.

[0003] Existing deep learning methods, such as LSTM models, are good at processing time series data and can capture nonlinear relationships in the time dimension. Although deep learning models such as LSTM have outstanding performance in time series modeling, they are usually unable to effectively utilize hydrological information in the spatial dimension. Ignoring the spatial correlation and topological structure of sites within the basin, the model cannot fully capture and utilize the spatiotemporal correlation characteristics between hydrological variables, and it is difficult to effectively integrate the spatial topology and dynamic hydrological process information within the basin. Summary of the invention

[0004] The technical problem to be solved by the present invention is to provide a runoff prediction method and terminal based on spatiotemporal heterogeneous graph neural network, which can effectively capture and utilize the spatiotemporal correlation characteristics between hydrological variables such as rainfall and runoff in the forecast, so as to improve the accuracy and reliability of the forecast.

[0005] In order to solve the above technical problems, the technical solution adopted by the present invention is:

[0006] A runoff prediction method based on spatiotemporal heterogeneous graph neural network includes the following steps:

[0007] S1. Acquire the hydrological time series data and spatial site information data collected by each site, and pre-process the hydrological time series data and the spatial site information data;

[0008] S2, performing weighted fusion based on the features of the preprocessed hydrological time series data and the spatial site information data, and generating a feature embedding vector representing the spatiotemporal relationship of the global variable through a graph attention network, inputting the feature embedding vector into a fully connected layer to obtain an output multi-site runoff prediction sequence, so as to construct a spatiotemporal heterogeneous graph flood forecasting model;

[0009] S3, optimizing model parameters of the spatiotemporal heterogeneous graph flood forecasting model;

[0010] S4. According to the optimized spatiotemporal heterogeneous graph flood forecasting model, runoff prediction is performed on the hydrological time series data and spatial site information data received in real time.

[0011] In order to solve the above technical problems, another technical solution adopted by the present invention is:

[0012] A runoff prediction terminal based on a spatiotemporal heterogeneous graph neural network comprises a memory, a processor and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, each step of the above-mentioned runoff prediction method based on a spatiotemporal heterogeneous graph neural network is implemented.

[0013] The beneficial effects of the present invention are: obtaining the hydrological time series data and spatial site information data collected by each site, preprocessing the hydrological time series data and spatial site information data; weighted fusion is performed according to the features of the preprocessed hydrological time series data and spatial site information data, and a feature embedding vector representing the spatiotemporal relationship of global variables is generated through a graph attention network, and the feature embedding vector is input into a fully connected layer to obtain an output multi-site runoff prediction sequence to construct a spatiotemporal heterogeneous graph flood forecasting model; model parameters of the spatiotemporal heterogeneous graph flood forecasting model are optimized; and runoff prediction is performed on the hydrological time series data and spatial site information data received in real time according to the optimized spatiotemporal heterogeneous graph flood forecasting model. In this way, the hydrological spatiotemporal correlation characteristics can be effectively captured in the forecast to improve the accuracy and reliability of the forecast. BRIEF DESCRIPTION OF THE DRAWINGS

[0014] Figure 1 A flow chart of a runoff prediction method based on a spatiotemporal heterogeneous graph neural network according to an embodiment of the present invention;

[0015] Figure 2 A schematic diagram of a runoff prediction terminal based on a spatiotemporal heterogeneous graph neural network according to an embodiment of the present invention;

[0016] Figure 3 A schematic diagram of the conversion of spatial site information data according to an embodiment of the present invention;

[0017] Figure 4 Schematic diagram of runoff prediction according to an embodiment of the present invention.

[0018] Description of labels:

[0019] 1. A runoff prediction terminal based on spatiotemporal heterogeneous graph neural network; 2. Memory; 3. Processor. DETAILED DESCRIPTION

[0020] In order to explain the technical content, achieved objectives and effects of the present invention in detail, the following is an explanation in combination with the implementation modes and the accompanying drawings.

[0021] Please refer to Figure 1 The embodiment of the present invention provides a runoff prediction method based on a spatiotemporal heterogeneous graph neural network, comprising the steps of:

[0022] S1. Acquire the hydrological time series data and spatial site information data collected by each site, and pre-process the hydrological time series data and the spatial site information data;

[0023] S2, performing weighted fusion based on the features of the preprocessed hydrological time series data and the spatial site information data, and generating a feature embedding vector representing the spatiotemporal relationship of the global variable through a graph attention network, inputting the feature embedding vector into a fully connected layer to obtain an output multi-site runoff prediction sequence, so as to construct a spatiotemporal heterogeneous graph flood forecasting model;

[0024] S3, optimizing model parameters of the spatiotemporal heterogeneous graph flood forecasting model;

[0025] S4. According to the optimized spatiotemporal heterogeneous graph flood forecasting model, runoff prediction is performed on the hydrological time series data and spatial site information data received in real time.

[0026] From the above description, it can be seen that the beneficial effects of the present invention are: obtaining the hydrological time series data and spatial site information data collected by each site, preprocessing the hydrological time series data and spatial site information data; weighted fusion based on the features of the preprocessed hydrological time series data and spatial site information data, and generating a feature embedding vector representing the spatiotemporal relationship of the global variable through the graph attention network, inputting the feature embedding vector into the fully connected layer to obtain the output multi-site runoff prediction sequence, so as to construct a spatiotemporal heterogeneous graph flood forecasting model; optimizing the model parameters of the spatiotemporal heterogeneous graph flood forecasting model; and performing runoff forecasting on the hydrological time series data and spatial site information data received in real time according to the optimized spatiotemporal heterogeneous graph flood forecasting model. In this way, the hydrological spatiotemporal correlation characteristics can be effectively captured in the forecast to improve the accuracy and reliability of the forecast.

[0027] Further, step S1 includes:

[0028] Acquire hydrological time series data and spatial site information data collected at each site, wherein the hydrological time series data includes flow data and rainfall data, and the spatial site information data includes site longitude and latitude information and corresponding runoff flow direction information;

[0029] Performing null value interpolation processing on the hydrological time series data, and performing linear interpolation correction on abnormal data points in the hydrological time series data, and normalizing the hydrological time series data;

[0030] The graph data in the spatial site information data is converted into an out-edge matrix and an in-edge matrix of the graph nodes.

[0031] From the above description, we can see that the spatial dependency between hydrological stations is represented by the adjacency matrix of the directed graph, and the incoming and outgoing relationships of the nodes are described by the incoming and outgoing adjacency matrices, respectively. This can accurately model the unidirectional flow between hydrological stations and improve the modeling accuracy of water flow paths and influencing factors.

[0032] Further, step S2 includes:

[0033] Converting the preprocessed hydrological time series data and the features of the spatial site information data into spatiotemporal graph data;

[0034] Aggregating features of neighbor nodes of each graph node in the spatiotemporal graph data according to adaptive attention weights to obtain a feature embedding vector of each graph node representing the spatiotemporal relationship of global variables;

[0035] The feature embedding vector is input into the fully connected layer to establish a nonlinear mapping relationship between the vector and the site, and a multi-site runoff prediction sequence is output to construct a spatiotemporal heterogeneous graph flood forecasting model.

[0036] From the above description, we can see that the model is based on the graph attention mechanism and achieves accurate modeling of complex spatiotemporal relationships by adaptively assigning weights to the spatial associations between different hydrological sites. The model can dynamically adjust the dependency weights between sites, thereby achieving accurate modeling of complex spatiotemporal relationships.

[0037] Further, aggregating the features of neighbor nodes of each graph node in the spatiotemporal graph data according to the adaptive attention weights also includes:

[0038] The site environment factors and site scheduling information data are converted into a spatiotemporal graph data format, and feature aggregation of neighbor nodes of each graph node in the spatiotemporal graph data is performed in combination with the conversion result.

[0039] From the above description, it can be seen that this fusion enhances the adaptability of the model to different types of hydrological data, enabling it to not only capture changes in environmental factors, but also flexibly respond to the impact of reservoir operation on downstream hydrological conditions.

[0040] Further, step S3 includes:

[0041] Initializing all trainable parameters of the spatiotemporal heterogeneous graph flood forecasting model;

[0042] The model parameters of the spatiotemporal heterogeneous graph flood forecasting model are optimized by using a stochastic gradient descent method;

[0043] A loss function is calculated based on the multi-site runoff prediction sequence output by the spatiotemporal heterogeneous graph flood forecasting model, and model parameters of the spatiotemporal heterogeneous graph flood forecasting model are adjusted based on the loss function.

[0044] From the above description, it can be seen that the use of loss function in the graph attention network can effectively improve the adaptability of the network in the hydrological system and make the model more robust in learning the spatiotemporal relationship between different hydrological sites and reservoir scheduling nodes.

[0045] Please refer to Figure 2 Another embodiment of the present invention provides a runoff prediction terminal based on a spatiotemporal heterogeneous graph neural network, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, each step of the above-mentioned runoff prediction method based on a spatiotemporal heterogeneous graph neural network is implemented.

[0046] The above-mentioned runoff prediction method and terminal based on spatiotemporal heterogeneous graph neural network of the present invention are suitable for effectively capturing and utilizing the spatiotemporal correlation characteristics between hydrological variables such as rainfall and runoff in forecasting, so as to improve the accuracy and reliability of multi-step forecasting, which is described below through specific implementation methods:

[0047] Please refer to Figure 1 and Figure 4 , Embodiment 1 of the present invention is:

[0048] A runoff prediction method based on spatiotemporal heterogeneous graph neural network includes the following steps:

[0049] S1. Acquire hydrological time series data and spatial site information data collected by each site, and pre-process the hydrological time series data and the spatial site information data.

[0050] Specifically, time series data and spatial site information data are collected from each hydrological site, where the time series data is the flow data collected from the upstream hydrological site and the hourly rainfall data collected from the rain gauge, and the spatial site information data is the longitude and latitude information of each hydrological site and the flow direction information of the corresponding runoff.

[0051] For time series data, null value processing is required:

[0052] When the rainfall data is null, it is directly filled with 0; when the flow data is null, the missing value is filled by linear interpolation. Assuming that the missing value data point is y, the interpolated value is:

[0053]

[0054] Where t represents the interpolation point time, which is between the known times t0 and t1, and y0 and y1 are the known flow data corresponding to the time points t0 and t1.

[0055] For abnormal data points with negative flow data, linear interpolation is used for correction.

[0056] Flood events that reach peak rainfall within a preset time are screened based on flow data and rainfall data. This method can ensure that model training includes strong flood processes, thereby enhancing the model's ability to respond to flood events. The specific screening method is: set a minimum duration threshold for flood events (such as 12 hours, 24 hours, etc.) to eliminate small flood events with too short a duration. By analyzing the rainfall before and after the flood event, flood events with outstanding rainfall can be screened.

[0057] In order to eliminate the dimensional differences between different features and thus improve the efficiency and stability of model training, the rainfall data and flow data are normalized to zero mean, and the data are scaled to a distribution form with a mean of 0 and a standard deviation of 1. The formula is as follows:

[0058]

[0059] In the formula, x is the original data value, μ is the mean of the data, σ is the standard deviation of the data, and x' is the standardized data value.

[0060] For spatial site information data, it is a typical graph data, with hydrological sites as nodes, factors affecting runoff (historical runoff, precipitation, temperature, etc.) as node attributes, and connections between hydrological sites as edges. However, water flows in one direction, so a directed graph can be introduced. A directed graph can better express the causal relationship between sites. Changes in upstream rainfall or runoff will affect the flow of downstream sites, and this causal relationship can be directly modeled through directed edges, which helps to improve the accuracy of model predictions.

[0061] like Figure 3 As shown, the adjacency matrix of a directed graph is directional, so the adjacency matrix A is split into two parts: the inbound edge adjacency matrix A in and the outgoing edge adjacency matrix A out . Input edge adjacency matrix A in It is used to describe the incoming edge connection of a node, where the rows of the matrix represent the target nodes (i.e. the nodes receiving the edge) and the columns represent the source nodes (i.e. the nodes sending the edge). in [i][j] indicates whether there is an edge from node j to node i. If so, the weight is 1, otherwise it is 0. Outgoing edge adjacency matrix A out Describes the outgoing edge connections of a node, where rows represent source nodes (i.e., nodes that send outgoing edges) and columns represent target nodes (i.e., nodes that receive edges). Matrix element Aout [i][j] indicates whether there is an edge from node i to node j. Similarly, if there is an edge, the weight is 1, otherwise it is 0. Therefore, A in and A out They respectively characterize the incoming and outgoing edge structures of nodes in a directed graph. The difference between them lies in the direction of description, one focusing on the node as a receiver and the other focusing on the node as an initiator.

[0062] S2. Constructing a spatiotemporal heterogeneous graph flood forecasting model based on the preprocessed hydrological time series data and the spatial site information data.

[0063] S21. Convert the pre-processed hydrological time series data and spatial site information data into spatiotemporal map data.

[0064] Specifically, the graph represents the entities and relationships between entities in the real world in the form of nodes and edges, which has great advantages in representing complex structured data. Spatiotemporal graph data is a data form composed of nodes and edges, which contains time dimension information (station observation sequence) and spatial dimension information (station spatial distribution, hydraulic connection relationship, etc.) between variables. In order to further extract and learn deeper spatial correlation characteristics and mapping relationships between variables, it is necessary to convert the station observation sequence in the watershed system into spatiotemporal graph data to meet the requirements of graph neural networks for modeling data. The nodes are the control stations in the watershed, and the edges are the spatial adjacency relationships between stations under the river network topology, which are specifically expressed as:

[0065] G t =(V t ,E)

[0066] V t = {v t,i (h t,i )|i∈[1,N]}

[0067]

[0068] Where, t represents the forecast initiation time; G t Represents the graph structure data input of the model at time t; V t Represents a set of site nodes; v t,i represents the i-th site node, i = 1, 2, ..., N, N is the total number of sites; h t,i Represents site node v t,i is the eigenvalue vector of the runoff observation sequence considering L-order lag; E represents the edge set, e i,j Represents the edge between the i-th and j-th nodes, reflecting the spatial adjacency relationship between the two sites.

[0069] S22. Construct a graph attention mechanism.

[0070] Among them, the attention mechanism is a machine learning technology similar to the information processing process of the human visual system, and is widely used in image description, natural language processing and other fields. The core idea is to dynamically assign weights to different input features to enhance the attention of the graph neural network model to important features. In this embodiment, not only the nodes in the graph are traversed, the neighbor nodes are retrieved with the edges as indexes, and their feature values ​​are transformed to the same feature space as the central node, but also the innovation of the model is improved by adding reservoir nodes and scheduling information embedding.

[0071] Specifically, each reservoir node is embedded with the basic information and dispatching data of the reservoir, such as inflow and outflow, dispatching plan, etc., and through the adaptive dispatching influence weight mechanism, the reservoir node can dynamically influence the downstream nodes according to different dispatching states. When the eigenvalues ​​are weighted and aggregated in the graph attention network, the dispatching information of the reservoir is used as an external input to dynamically adjust the attention weight to more accurately model the impact of reservoir dispatching on the basin hydrology. In addition, an environmental factor interaction layer is added to jointly model natural factors such as rainfall and temperature with reservoir dispatching, generate more accurate feature vectors that characterize the mutual influence relationship between the observed variables of each station, and finally generate feature embedding vectors that characterize the spatiotemporal relationship of global variables. At the same time, the model can feedback reservoir dispatching optimization suggestions based on runoff prediction, thereby further improving the intelligence and practicality of the system.

[0072] The specific implementation steps are as follows:

[0073] (1) Feature aggregation

[0074] For each node i in the input graph structure data, aggregate the features of neighboring nodes (including reservoir nodes), and consider the importance weights of neighboring nodes in the process. Assume that the set of neighboring nodes of node i is N(i):

[0075]

[0076] In the formula, h i ' represents the updated feature vector of node i, σ represents the activation function, W represents the learnable weight matrix for feature conversion, a ij represents the attention weight, which represents the influence of neighbor node j on node i, and h j Represents the feature vector of node j.

[0077] (2) Adaptive scheduling impact weight

[0078] For the edge containing the reservoir node k, an adaptive weight based on the dispatching state is introduced to dynamically adjust the impact of the reservoir on the downstream nodes. Assume that the dispatching state of the reservoir is s k , then a ikIt can be expressed as:

[0079] a ik =softmax(f(h i ,h k ,s k ))

[0080] In the formula, f(h i ,h k ,s k ) is a scoring function that combines the characteristics of node i and reservoir node k as well as the reservoir dispatching state s k , this function can be defined as a simple affine function, or a more complex nonlinear function. Softmax is a nonlinear activation function used to ensure the normalization of weights.

[0081] (3) Interaction modeling of environmental factors

[0082] When aggregating features, environmental factors (such as rainfall and temperature) can be jointly modeled with reservoir operation information. Assuming that the environmental factor vector is e, the feature aggregation formula of node i can be further expanded to:

[0083]

[0084] In the formula, g(h i ,e) represents the impact of environmental factors on node characteristics, which is a nonlinear transformation used to integrate environmental information into the node update process.

[0085] Finally, a feature embedding vector representing the spatiotemporal relationship of global variables is generated, which is specifically expressed as:

[0086] h ′t,i ,h′ t,j =f ψ (h t,i ,h t,j )

[0087] α t,ij =Att(h′ t,i ,h′ t,j )

[0088] x t,i =Softmax(∑ i∈N α t,ij ·h′ t,j )

[0089] X t =[x t,1 ,x t,2 ,…,x t,N ]

[0090] In the formula, h′ t,iand h′ t,j The nodes v i and its neighbor node v j The transformed feature vector; f ψ is the feature space mapping function; α t,ij Represents the neighbor node v j Relative center node v i The spatial association weight of x t,i Represents node v i The spatial feature embedding vector of X t is the global spatial feature embedding vector; Att(·) is the function operator of the attention mechanism; Softmax(·) is the nonlinear activation function.

[0091] S23. Build a fully connected layer.

[0092] The graph attention mechanism generates a feature embedding vector that represents the spatiotemporal relationship of global variables and inputs it into a fully connected layer of N×M dimensions to build an N-dimensional vector X t The nonlinear mapping relationship between the runoff prediction values ​​of M key sites is used to output the multi-site runoff prediction sequence as shown below:

[0093] [Q t+1,1 ,Q t+1,2 ,…,Q t+1,M ] = f FCL (W.X t +b)

[0094] In the formula, Q t+1,i is the runoff prediction value of the i-th station at time t+1, i=1,2,...,M; f FCL (·) is the function operator of the fully connected network; W is the weight matrix of the fully connected layer, and b is the bias term.

[0095] S24. The model output is the flow process of each forecast node in the next 24 hours.

[0096] S3. Optimize the model parameters of the spatiotemporal heterogeneous graph flood forecasting model using a stochastic gradient descent method.

[0097] S31. Model parameter initialization

[0098] The Xavier method is used to initialize all trainable parameters in the model. The variance of the input and output of each layer of the network is made as equal as possible to ensure the stability of forward propagation and back propagation. The specific formula for parameter initialization of the Xavier method is as follows:

[0099]

[0100] Where W represents the weight to be initialized.in and n out are the number of input and output neurons in the network layer, respectively.

[0101] S32. Model parameter optimization

[0102] The model parameters are optimized based on the stochastic gradient descent method. Specifically, the Adam optimization estimation algorithm (Adaptive Moment Estimation) is used. This method can adaptively adjust the learning rate according to the first-order moment estimation and second-order moment estimation of the gradient, thereby maintaining the stability and effectiveness of parameter updates during the training process. Set the number of iterations I max , adjustment coefficients beta1, beta2, epsilon and initial learning rate lr. The specific parameter description is shown in Table 1 below.

[0103] Table 1 Schematic diagram of model parameter description

[0104]

[0105] S33. Verification indicators

[0106] During training, the output result of the model obtained by forward propagation calculation is used to calculate the loss function, and the gradient of each trainable parameter to the loss function is calculated through back propagation, and then the model parameters are updated through the Adam optimization estimation algorithm. In order to overcome the influence of outliers and noise values ​​in the original data, the Huber Loss function, which is more robust than the mean square error and linear error loss functions, is used as the loss function. It combines the advantages of mean square error (MSE) and absolute error (MAE) and has good robustness. Specifically, Huber Loss is expressed as mean square error (punishing small errors) when the error is small, and as absolute error (lighter punishment for large errors) when the error is large, so it can effectively reduce the impact of outliers on the model. The formula is as follows:

[0107]

[0108] In the formula, Q obs is the actual value. pred is the predicted value of the model, and δ is a parameter. obs -Q pred |≤δ, square loss is used; when |Q obs -Q pred When |≤δ, absolute loss is used.

[0109] The Nash-Sutcliffe Efficiency (NSE) is used as a measurement indicator during the evaluation. NSE is used to evaluate the fit between the model prediction value and the actual observation value, and its value ranges from negative infinity to 1. An NSE value of 1 means that the model is completely consistent with the actual observation, 0 means that the model's prediction effect is equivalent to the prediction using the average value of the observed data, and less than 0 indicates that the model's prediction effect is even worse than simply using the average value of the observed data. The calculation formula is as follows:

[0110]

[0111] Where N is the number of samples. i is the ith actual value, is the ith predicted value, is the actual average.

[0112] S4. Perform runoff prediction on the hydrological time series data and spatial site information data received in real time according to the optimized spatiotemporal heterogeneous graph flood forecasting model. Specifically, the optimized model is applied to the newly input data set to perform hydrological runoff prediction.

[0113] Therefore, although the traditional prediction physical model is relatively fixed in parameters and structure, it is difficult to adapt to the complex and changeable basin dynamics; although the pure deep learning model performs well on time series data, it often lacks the capture of hydrological physical laws. The spatiotemporal heterogeneous model in this embodiment combines the advantages of both, making the model closer to the complex characteristics of the actual basin. While maintaining the constraints of physical laws, it has a strong adaptive learning ability and can automatically adapt to the basin characteristics and climate changes in different regions through learning. It is more universal and robust, and improves the accuracy of runoff prediction.

[0114] In addition, the spatiotemporal heterogeneous graph model of this embodiment introduces a graph structure, using the adjacency matrix of a directed graph to describe the spatial correlation relationship of hydrological sites, and using the in-edge and out-edge adjacency matrices to describe the spatial connection and flow relationship between nodes, respectively, which significantly improves the capture of spatial correlation features. The structural design based on the graph neural network can more effectively model the complex spatial topology between hydrological stations, especially the impact of flow paths and flow transfer. This directed graph feature helps to deeply model the spatiotemporal information between hydrological sites.

[0115] At the same time, in model training, loss functions with high robustness, such as HuberLoss, are used to reduce the negative impact of outliers on the model training process, making the model more stable when processing noisy data. Runoff data often contains outliers and noise values. Traditional mean square error (MSE) loss is prone to overfitting under outliers, affecting model stability. Using Huber Loss reduces the impact of outliers on training, making the model more stable and more robust.

[0116] Please refer to Figure 2 , Embodiment 2 of the present invention is:

[0117] A runoff prediction terminal 1 based on a spatiotemporal heterogeneous graph neural network comprises a memory 2, a processor 3, and a computer program stored in the memory 2 and executable on the processor 3. When the processor 3 executes the computer program, each step of a runoff prediction method based on a spatiotemporal heterogeneous graph neural network of embodiment 1 is implemented.

[0118] In summary, the present invention provides a runoff prediction method and terminal based on a spatiotemporal heterogeneous graph neural network, which obtains hydrological time series data and spatial site information data collected by each site, preprocesses the hydrological time series data and spatial site information data; performs weighted fusion based on the features of the preprocessed hydrological time series data and spatial site information data, and generates a feature embedding vector representing the spatiotemporal relationship of global variables through a graph attention network, inputs the feature embedding vector into a fully connected layer to obtain an output multi-site runoff prediction sequence, so as to construct a spatiotemporal heterogeneous graph flood forecasting model; optimizes the model parameters of the spatiotemporal heterogeneous graph flood forecasting model; and performs runoff prediction on the hydrological time series data and spatial site information data received in real time according to the optimized spatiotemporal heterogeneous graph flood forecasting model. In this way, the hydrological spatiotemporal correlation characteristics can be effectively captured in the forecast to improve the accuracy and reliability of the forecast.

[0119] The above descriptions are merely embodiments of the present invention and are not intended to limit the patent scope of the present invention. Any equivalent transformations made using the contents of the present invention's specification and drawings, or directly or indirectly applied in related technical fields, are also included in the patent protection scope of the present invention.

Claims

1. A runoff prediction method based on spatiotemporal heterogeneous graph neural network, characterized in that: Includes steps: S1. Acquire the hydrological time series data and spatial site information data collected by each site, and pre-process the hydrological time series data and the spatial site information data; S2, performing weighted fusion based on the features of the preprocessed hydrological time series data and the spatial site information data, and generating a feature embedding vector representing the spatiotemporal relationship of the global variable through a graph attention network, inputting the feature embedding vector into a fully connected layer to obtain an output multi-site runoff prediction sequence, so as to construct a spatiotemporal heterogeneous graph flood forecasting model; S3, optimizing model parameters of the spatiotemporal heterogeneous graph flood forecasting model; S4. According to the optimized spatiotemporal heterogeneous graph flood forecasting model, runoff prediction is performed on the hydrological time series data and spatial site information data received in real time.

2. A runoff prediction method based on spatiotemporal heterogeneous graph neural network according to claim 1, characterized in that: Step S1 includes: Acquire hydrological time series data and spatial site information data collected at each site, wherein the hydrological time series data includes flow data and rainfall data, and the spatial site information data includes site longitude and latitude information and corresponding runoff flow direction information; Performing null value interpolation processing on the hydrological time series data, and performing linear interpolation correction on abnormal data points in the hydrological time series data, and normalizing the hydrological time series data; The graph data in the spatial site information data is converted into an out-edge matrix and an in-edge matrix of the graph nodes.

3. The runoff prediction method based on spatiotemporal heterogeneous graph neural network according to claim 1 is characterized in that: Step S2 includes: Converting the preprocessed hydrological time series data and the features of the spatial site information data into spatiotemporal graph data; Aggregating features of neighbor nodes of each graph node in the spatiotemporal graph data according to adaptive attention weights to obtain a feature embedding vector of each graph node representing the spatiotemporal relationship of global variables; The feature embedding vector is input into the fully connected layer to establish a nonlinear mapping relationship between the vector and the site, and a multi-site runoff prediction sequence is output to construct a spatiotemporal heterogeneous graph flood forecasting model.

4. The runoff prediction method based on spatiotemporal heterogeneous graph neural network according to claim 3 is characterized in that: Aggregating the features of neighbor nodes of each graph node in the spatiotemporal graph data according to the adaptive attention weights, further comprising: The site environment factors and site scheduling information data are converted into a spatiotemporal graph data format, and feature aggregation of neighbor nodes of each graph node in the spatiotemporal graph data is performed in combination with the conversion result.

5. The runoff prediction method based on spatiotemporal heterogeneous graph neural network according to claim 3 is characterized in that: Step S3 includes: Initializing all trainable parameters of the spatiotemporal heterogeneous graph flood forecasting model; The model parameters of the spatiotemporal heterogeneous graph flood forecasting model are optimized by using a stochastic gradient descent method; A loss function is calculated based on the multi-site runoff prediction sequence output by the spatiotemporal heterogeneous graph flood forecasting model, and model parameters of the spatiotemporal heterogeneous graph flood forecasting model are adjusted based on the loss function.

6. A runoff prediction terminal based on a spatiotemporal heterogeneous graph neural network, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the following steps are implemented: S1. Acquire the hydrological time series data and spatial site information data collected by each site, and pre-process the hydrological time series data and the spatial site information data; S2, performing weighted fusion based on the features of the preprocessed hydrological time series data and the spatial site information data, and generating a feature embedding vector representing the spatiotemporal relationship of the global variable through a graph attention network, inputting the feature embedding vector into a fully connected layer to obtain an output multi-site runoff prediction sequence, so as to construct a spatiotemporal heterogeneous graph flood forecasting model; S3, optimizing model parameters of the spatiotemporal heterogeneous graph flood forecasting model; S4. According to the optimized spatiotemporal heterogeneous graph flood forecasting model, runoff prediction is performed on the hydrological time series data and spatial site information data received in real time.

7. The runoff prediction terminal based on spatiotemporal heterogeneous graph neural network according to claim 6 is characterized in that: Step S1 includes: Acquire hydrological time series data and spatial site information data collected at each site, wherein the hydrological time series data includes flow data and rainfall data, and the spatial site information data includes site longitude and latitude information and corresponding runoff flow direction information; Performing null value interpolation processing on the hydrological time series data, and performing linear interpolation correction on abnormal data points in the hydrological time series data, and normalizing the hydrological time series data; The graph data in the spatial site information data is converted into an out-edge matrix and an in-edge matrix of the graph nodes.

8. The runoff prediction terminal based on spatiotemporal heterogeneous graph neural network according to claim 6 is characterized in that: Step S2 includes: Converting the preprocessed hydrological time series data and the features of the spatial site information data into spatiotemporal graph data; Aggregating features of neighbor nodes of each graph node in the spatiotemporal graph data according to adaptive attention weights to obtain a feature embedding vector of each graph node representing the spatiotemporal relationship of global variables; The feature embedding vector is input into the fully connected layer to establish a nonlinear mapping relationship between the vector and the site, and a multi-site runoff prediction sequence is output to construct a spatiotemporal heterogeneous graph flood forecasting model.

9. The runoff prediction terminal based on spatiotemporal heterogeneous graph neural network according to claim 8 is characterized in that: Aggregating the features of neighbor nodes of each graph node in the spatiotemporal graph data according to the adaptive attention weights, further comprising: The site environment factors and site scheduling information data are converted into a spatiotemporal graph data format, and feature aggregation of neighbor nodes of each graph node in the spatiotemporal graph data is performed in combination with the conversion result.

10. The runoff prediction terminal based on spatiotemporal heterogeneous graph neural network according to claim 8, characterized in that: Step S3 includes: Initializing all trainable parameters of the spatiotemporal heterogeneous graph flood forecasting model; The model parameters of the spatiotemporal heterogeneous graph flood forecasting model are optimized by using a stochastic gradient descent method; A loss function is calculated based on the multi-site runoff prediction sequence output by the spatiotemporal heterogeneous graph flood forecasting model, and model parameters of the spatiotemporal heterogeneous graph flood forecasting model are adjusted based on the loss function.

Citation Information

Patent Citations

  • Runoff prediction method based on space-time diagram convolutional neural network

    CN115169724A

  • Flood forecasting method based on attention mechanism and time-space diagram neural network

    CN117408381A

  • Deep learning-based flood runoff forecasting method and system

    CN118917483A

Cited By

  • Flood forecasting method and system, storage medium and computing equipment

    CN120296529A

  • Flood forecasting method, system, storage medium and computing device

    CN120296529B

  • Hydrological trend prediction method based on big data analysis

    CN120450142A

  • A Hydrological Trend Prediction Method Based on Big Data Analysis

    CN120450142B

  • Water conservancy big data-based drainage basin collaborative forecast optimization system and method

    CN120596494A