Velocity field modeling method, device and readable storage medium thereof
By embedding a spatial gradient velocity decoupling dual-stream attention mechanism graph convolution gated recurrent neural network, the problem of insufficient fusion of hydrodynamic physical information in river velocity field modeling is solved, and velocity field prediction with higher accuracy and generalization ability is achieved.
Patent Information
- Application Number
- CN202510973108.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-15
- Publication Date
- 2025-09-19
- Estimated Expiration
- 2045-07-15
AI Technical Summary
Existing technologies fail to effectively integrate hydrodynamic physical information in river velocity field modeling, resulting in inaccurate extraction of spatial correlation features between measuring points, insufficient long-term time-series dependency modeling capabilities, and difficulty adapting to high-precision predictions in complex riverbed environments.
A graph convolution-gated recurrent neural network with an embedded spatial gradient velocity decoupling dual-stream attention mechanism is constructed. The adjacency matrix is dynamically constructed by integrating multi-source hydrodynamic physical parameters, decoupling spatial position and velocity vector features, and enhancing long-term temporal dependencies through a jump gating mechanism.
It improves the accuracy and generalization ability of river velocity field modeling, can more accurately reflect the impact of riverbed topography and water flow resistance on flow velocity, and enhances long-term prediction accuracy and the ability to adapt to complex environments.
Smart Images

Figure CN120493810B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the intersection of water conservancy engineering and computer technology, and specifically to a velocity field modeling method, device and readable storage medium thereof based on a graph convolutional gated recurrent neural network with embedded spatial gradient velocity decoupling and dual-stream attention mechanism. Background Art
[0002] Accurately modeling flow velocity fields is crucial for flood forecasting and water resource management in water conservancy projects, urban drainage system monitoring, and river dynamics research. Traditional methods, such as the Manning equation, rely on empirical parameters (such as the friction coefficient), are only applicable to specific riverbed types and struggle to capture dynamic changes. Computational fluid dynamics (CFD) methods based on numerical simulations are computationally expensive and cannot process large-scale measurement data in real time.
[0003] In recent years, deep learning techniques (such as convolutional neural networks (GCNs) and gated recurrent units (GRUs)) have been used to model velocity fields, improving prediction efficiency by exploiting spatial correlations and temporal dependencies between measurement points. However, existing methods have the following shortcomings:
[0004] 1. Extensive spatial correlation modeling: The adjacency matrix of traditional graph models is based solely on static distances or historical data correlations, without integrating hydrodynamic physical parameters (such as slope and friction coefficient). Consequently, it cannot accurately reflect the impact of riverbed topography and flow resistance on flow velocity.
[0005] 2. Feature coupling problem: Directly mixing spatial position and velocity vector modeling results in the mutual masking of geometric structure and dynamic features, reducing feature extraction accuracy;
[0006] 3. Insufficient long-term dependency modeling: When processing slowly changing signals such as river flow rate, the standard GRU has difficulty in effectively capturing historical information across time scales, resulting in a decrease in long-term prediction accuracy.
[0007] Therefore, there is an urgent need for a method that integrates hydrodynamic physics mechanisms and deep learning to improve the accuracy and generalization ability of velocity field modeling. Summary of the Invention
[0008] The embodiments of the present invention provide a velocity field modeling method, device and readable storage medium based on a graph convolutional gated recurrent neural network with an embedded spatial gradient velocity decoupling dual-stream attention mechanism. The method addresses the problems existing in current technologies in river velocity field modeling, such as inaccurate extraction of spatial correlation features between measuring points, insufficient long-term temporal dependency modeling capabilities, and difficulty in adapting to high-precision prediction requirements in complex riverbed environments due to the failure to effectively integrate hydrodynamic physical information (such as slope and friction coefficient) with deep learning models.
[0009] The core technology of this invention is mainly to construct a graph convolutional gated recurrent neural network with an embedded spatial gradient velocity decoupling dual-stream attention mechanism, integrate multi-source hydrodynamic physical parameters (spatial distance, slope, friction coefficient, transmission delay) to dynamically construct an adjacency matrix, decouple spatial position and velocity vector features for dual-stream attention modeling, and enhance long-term temporal dependence through a jump gating mechanism to achieve high-precision river velocity field modeling.
[0010] In a first aspect, the present invention provides a method for modeling a flow velocity field, the method comprising the following steps:
[0011] S1. Collect the three-dimensional coordinates, elevation, and historical flow velocity data of different measuring points on the river, and calculate the slope difference, friction coefficient, and transmission delay between the measuring points;
[0012] S2. Construct a dynamic adjacency matrix that integrates spatial distance, historical velocity correlation, slope difference, friction coefficient, and transmission delay; the spatial distance is obtained based on the three-dimensional coordinates and elevation of different measuring points on the river; the historical velocity correlation is obtained based on historical velocity data;
[0013] S3. Design a graph convolutional gated recurrent neural network with an embedded spatial gradient velocity decoupling dual-stream attention mechanism. The network includes:
[0014] 1) The spatial gradient velocity decoupling dual-stream attention module processes the spatial coordinates of the measurement point and the velocity vector into two independent branches to extract geometric structure features and dynamic dependency features respectively;
[0015] 2) A jump-gated recurrent neural network module selectively fuses historical hidden states through a jump-gating mechanism to establish flow velocity correlations at multiple time scales;
[0016] S4. Input the dynamic adjacency matrix and the velocity data of multiple measuring points into the neural network for training to obtain a velocity field prediction model.
[0017] Furthermore, the method for calculating the slope difference, friction coefficient and transmission delay in step S1 includes:
[0018] S11. Calculate the slope difference based on the elevation of the measuring point and the distance to the river centerline;
[0019] S12. Calculate the friction coefficient based on the Manning formula, combining the hydraulic radius, average slope, and average flow velocity;
[0020] S13. Calculate the transmission delay based on the cross-correlation analysis of the flow velocity time series of the upstream and downstream measuring points.
[0021] Furthermore, the method for constructing the dynamic adjacency matrix in step S2 includes:
[0022] S21. Calculate the spatial distance based on the three-dimensional coordinates of the measuring points and use the KNN algorithm to generate a spatial adjacency matrix with distance decay characteristics;
[0023] S22. Calculate the Pearson correlation coefficient between measuring points based on the velocity data within the historical time window to generate a velocity correlation adjacency matrix;
[0024] S23. Generate a dynamic adjacency matrix by fusing the spatial adjacency matrix, velocity correlation adjacency matrix, slope difference, friction coefficient and transmission delay through learnable weights.
[0025] Furthermore, the spatial gradient velocity decoupling dual-stream attention module includes:
[0026] N1 spatial position attention submodule performs convolution and Softmax processing on the three-dimensional coordinates of the measuring points to generate spatial gradient attention weights to represent the impact of position differences between measuring points on flow velocity;
[0027] The N2 velocity vector attention submodule uses a residual connection structure to perform convolution processing on the velocity vector and generates velocity correlation gating weights through the Sigmoid activation function;
[0028] The N3 feature fusion submodule multiplies the spatial gradient attention weight, flow velocity correlation gating weight and the original flow velocity feature element by element, and outputs the fused flow velocity feature.
[0029] Furthermore, the jump-gated recurrent neural network module introduces a jump gate in the GRU unit. The input of the jump gate includes the current input, the historical hidden state and the early hidden state k steps ago. The early hidden state is selectively fused through element-by-element multiplication to enhance long-term memory.
[0030] Furthermore, the neural network adopts a bidirectionally connected gated recurrent unit to simultaneously extract the forward and backward correlation features of the flow rate data in the time dimension.
[0031] Furthermore, the elements of the dynamic adjacency matrix control sparsity through activation functions, and the spatial gradient velocity decoupling two-stream attention module avoids gradient vanishing through residual connections.
[0032] In a second aspect, the present invention provides a flow velocity field modeling device, comprising:
[0033] The acquisition module collects the three-dimensional coordinates, elevation, and historical flow velocity data of different measuring points on the river, and calculates the slope difference, friction coefficient, and transmission delay between measuring points;
[0034] A construction module is used to construct a dynamic adjacency matrix that integrates spatial distance, historical velocity correlation, slope difference, friction coefficient, and transmission delay. The spatial distance is obtained based on the three-dimensional coordinates and elevation of different measuring points on the river. The historical velocity correlation is obtained based on historical velocity data.
[0035] In the training module, a graph convolutional gated recurrent neural network with an embedded spatial gradient velocity decoupling dual-stream attention mechanism is designed. The dynamic adjacency matrix and multi-point velocity data are input into the neural network for training to obtain a velocity field prediction model.
[0036] The network includes:
[0037] 1) The spatial gradient velocity decoupling dual-stream attention module processes the spatial coordinates of the measurement point and the velocity vector into two independent branches to extract geometric structure features and dynamic dependency features respectively;
[0038] 2) The jump-gated recurrent neural network module selectively fuses historical hidden states through the jump-gating mechanism to establish flow velocity correlations at multiple time scales.
[0039] In a third aspect, the present invention provides an electronic device comprising a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the above-mentioned velocity field modeling method.
[0040] In a fourth aspect, the present invention provides a readable storage medium having a computer program stored therein, the computer program including a program code for controlling a process to execute a process, the process including the velocity field modeling method described above.
[0041] The main contributions and innovations of the present invention are as follows:
[0042] 1. Dynamic adjacency matrix accurately models spatial correlations: This system integrates multiple hydrodynamic parameters, such as spatial distance, historical velocity correlation, slope difference, friction coefficient, and transmission delay, and adaptively constructs an adjacency matrix using learnable weights. This overcomes the limitations of traditional static adjacency matrices (which rely solely on distance or correlation) and more accurately reflects the impact of physical mechanisms such as riverbed topography and water flow resistance on the velocity field.
[0043] 2. Dual-stream decoupling improves feature extraction quality: Spatial coordinates (geometric structure) and flow velocity vectors (dynamic features) are separated into two independent attention models to avoid feature masking caused by mixed modeling. This allows for clearer feature clustering (for example, distinguishing between measurement points with similar locations but large differences in flow velocity or those with similar flow velocity but distant locations), significantly enhancing the decoupled expression of spatial and dynamic features.
[0044] 3. Jump gating enhances long-term temporal dependencies: Jump gates are introduced into the gated recurrent neural network to selectively fuse historical hidden states across multiple time scales. This effectively addresses the long-term memory problem in scenarios where river flow rates change slowly. Compared to the standard GRU, this method can more accurately capture the evolution of flow rates across time scales, improving long-term prediction accuracy.
[0045] 4. Embedding physical mechanisms enhances generalization capabilities: Parameters such as the friction coefficient and transmission delay are derived through hydraulic principles such as the Manning formula and cross-correlation analysis. Physical prior knowledge is integrated into the model structure, making the model adaptable to the friction characteristics of different riverbed types (such as smooth concrete, sandy, and pebble riverbeds). This avoids the overfitting of purely data-driven models and significantly improves generalization capabilities in complex environments.
[0046] 5. Deep module fusion optimizes modeling efficiency: The dual-stream attention graph convolution module is embedded in the gated recurrent network to achieve deep interaction between spatial features and temporal dynamics, forming a "space-time-physical mechanism" three-in-one modeling framework. Compared with a simple serial structure, it more efficiently extracts multi-dimensional feature associations, reducing computational complexity while improving modeling accuracy.
[0047] The details of one or more embodiments of the invention are set forth in the accompanying drawings and the description below so that other features, objects, and advantages of the invention are more readily apparent. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:
[0049] Figure 1 is a flow chart of a velocity field modeling method according to an embodiment of the present invention;
[0050] Figure 2 2. Schematic diagram of a submodule of an embedded spatial gradient velocity decoupling dual-stream attention mechanism according to an embodiment of the present invention;
[0051] Figure 3 is a schematic diagram before dual-flow decoupling according to an embodiment of the present invention;
[0052] Figure 4 is a schematic diagram of dual-flow decoupling according to an embodiment of the present invention;
[0053] Figure 5 is a schematic diagram of the structure of a convolutional neural network according to an embodiment of the present invention;
[0054] Figure 6 A relationship diagram of river flow rates between multiple historical moments and the current moment is established according to an embodiment of the present invention;
[0055] Figure 7 Schematic diagram of embedding a spatial gradient velocity decoupling dual-stream attention mechanism graph convolution module into a skip-gated recurrent neural network according to an embodiment of the present invention;
[0056] Figure 8 is an overall network structure diagram according to an embodiment of the present invention;
[0057] Figure 9 FIG. 4 is a schematic diagram of the hardware structure of an electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0058] Exemplary embodiments will be described in detail herein, with examples illustrated in the accompanying drawings. In the following description, when referring to the drawings, identical numerals in different figures represent identical or similar elements, unless otherwise indicated. The implementations described in the following exemplary embodiments are not intended to represent all implementations consistent with one or more embodiments of this specification. Rather, they are merely examples of apparatuses and methods consistent with certain aspects of one or more embodiments of this specification, as detailed in the appended claims.
[0059] It should be noted that in other embodiments, the steps of the corresponding method are not necessarily performed in the order shown and described in this specification. In some other embodiments, the method may include more or fewer steps than those described in this specification. In addition, a single step described in this specification may be broken down into multiple steps for description in other embodiments, and multiple steps described in this specification may be combined into a single step for description in other embodiments.
[0060] Example 1
[0061] The present invention aims to propose a velocity field modeling method based on a graph convolution gated recurrent neural network with embedded spatial gradient velocity decoupling dual-stream attention mechanism. Figure 1 , the method comprises the following steps:
[0062] S1. Use a Doppler flow meter to measure the flow velocity at different points and depths of the river, and store the relevant information in the database. The details are as follows:
[0063] S11. Using RTK GPS measuring instruments, obtain the precise latitude and longitude coordinates of the measuring points. Using measuring equipment such as total stations, obtain elevation data for different measuring points. Calculate the slope difference between different measuring points using the following method:
[0064]
[0065] in Indicates measuring point The difference in slope between Respectively represent measuring points elevation; Indicates measuring point The distance between them on the center line of the river.
[0066] S12. Based on the Manning formula, calculate the friction coefficient between different measuring points. The calculation formula is as follows:
[0067]
[0068] From the above formula, solve the friction coefficient:
[0069]
[0070] in is the hydraulic radius (m), which is the ratio of the cross-sectional area of the water flow to the wetted perimeter, and represents the effective flow capacity of the water flow; It is the average slope between two points, calculated by the elevation difference between the measuring points and the distance between the centerline of the river, reflecting the driving effect of the terrain on the flow velocity; is the average flow velocity between two points (m / s), which can be measured or calculated using a Doppler flowmeter. n is the dimensionless friction coefficient, which reflects the roughness of the riverbed surface (larger values indicate greater resistance) and is directly related to the riverbed material. The Manning equation and transmission delay are applicable to open channel flows, either stable laminar or turbulent, and are generally applicable to urban drainage and small river sections. The friction coefficient n has empirical values ranging from 0.012 to 0.015 for smooth concrete urban drainage channels; for small river sections (sandy riverbeds), the empirical range is 0.020 to 0.025; and for pebble and gravel riverbeds, the empirical range is 0.025 to 0.035.
[0071] In the present invention, Manning's Equation is used to calculate the friction coefficient (n) between river measuring points. It is a key link connecting the hydraulic physics mechanism and the deep learning model. The present invention calculates the friction coefficient between measuring points through this formula, reflecting the impact of riverbed roughness on water flow resistance, thereby integrating hydrodynamic physics information (such as riverbed characteristics) into the adjacency matrix modeling of the graph convolutional network, improving the accuracy of extracting spatial correlation features of the velocity field.
[0072] S13, using the cross-correlation analysis method to calculate the propagation delay between two points, and the velocity time series of the two measuring points upstream and downstream , assuming that the maximum correlation delay between two points is , then it satisfies:
[0073]
[0074] Where Corr(.) is the Pearson correlation coefficient, which measures the difference between two time series in terms of delay. The linear correlation under argmax is to find the delay that makes the correlation coefficient reach the maximum value. , which is the propagation delay.
[0075] In this invention, the cross-correlation analysis method is used to calculate the velocity propagation delay estimation between upstream and downstream measuring points. It is a key technology to capture the time characteristics of water flow dynamic propagation. By analyzing the correlation of the velocity time series of upstream and downstream measuring points, the time delay required for the water flow signal to propagate from the upstream measuring point i to the downstream measuring point j is determined. , which is the propagation delay. This delay reflects the actual propagation speed of water in the river channel and is an important parameter for modeling the dynamic time correlation between measurement points.
[0076] S2. Construct a dynamic adjacency matrix that integrates spatial distance, historical flow velocity correlation, slope difference, friction coefficient, and transmission delay; the details are as follows:
[0077] S21, based on the precise coordinates of each measuring point obtained in S11, first calculate the measuring point The distance between :
[0078]
[0079] in Indicates measuring point The three-dimensional Cartesian coordinates of For measuring points The three-dimensional Cartesian coordinates of .
[0080] In order to ensure that the topological graph composed of each measuring point is sparse and that the corresponding adjacency matrix elements have distance attenuation characteristics, the corresponding measuring points The corresponding spatial adjacency matrix element The calculation is as follows:
[0081]
[0082] in, is the Gaussian kernel width parameter, which controls the distance attenuation speed; KNN(i) is the set of K nearest neighbor nodes of measurement point i (K is a preset hyperparameter, such as K=6).
[0083] In this embodiment, the spatial adjacency matrix elements The design combines the KNN (K-nearest neighbor) algorithm with the Gaussian kernel function. Its core goal is to efficiently model the spatial relationships between measurement points while ensuring the sparsity and distance decay characteristics of the graph structure. Through the KNN sparsification and Gaussian kernel distance decay design, the "near strong, far weak" spatial influence relationship between measurement points is accurately modeled while ensuring computational efficiency, providing a physically meaningful sparse graph structure for the subsequent graph convolutional network. This design not only addresses the high complexity of traditional fully connected graphs, but also enables the model to adapt to different river environments through data-driven dynamic weights (rather than fixed empirical parameters), demonstrating the integration of physical priors with deep learning.
[0084] S22. Based on the velocity data in the historical time window, calculate the Pearson correlation coefficient of the historical data between different measuring points, and calculate the adjacency matrix elements based on the velocity data correlation between different measuring points. Calculation method:
[0085]
[0086] Where, Corr(.) is the Pearson correlation coefficient, which measures the linear correlation between two time series and has a value range of [-1, 1]; They are the flow velocity time series of the upstream and downstream measuring points respectively.
[0087] Adjacency matrix elements The calculation uses the Pearson correlation coefficient of historical data. The core purpose is to capture the dynamic correlation characteristics of flow velocity changes between measuring points and provide data-driven dynamic correlation weights for the graph convolutional network.
[0088] S23. Comprehensive consideration of spatial distance , historical velocity correlation , measuring point The adjacency matrix of the velocity graph of each measuring point at the same time is calculated based on various factors such as the slope difference between the two points and the friction coefficient between the two points. Chinese elements :
[0089]
[0090] in Indicates measuring point The slope between two points; For measuring points The coefficient of friction between two points; For measuring points The flow rate between two points is associated with the transmission delay; Represents the weight parameters to be learned; As the activation function, to control the sparsity of edge weights, the Sigmoid function (output range (0,1)) can be used.
[0091] In this example, a dynamic adjacency matrix with both physical interpretability and data adaptability is constructed through multi-source feature fusion, learnable weights, and dynamic sparsification. This is one of the core innovations of the present invention's "physical information-driven deep learning" approach. This design not only addresses the limitations of traditional graph models, characterized by single features and fixed parameters, but also, through the collaborative modeling of five types of features, enables the graph structure to accurately reflect the triple characteristics of the river velocity field: spatial distribution, dynamic changes, and hydrodynamic mechanisms. This provides high-quality input for the subsequent dual-stream attention mechanism and gated recurrent network, ultimately significantly improving the accuracy of velocity field modeling.
[0092] S3. Design a graph convolutional gated recurrent neural network with embedded spatial gradient velocity decoupling and dual-stream attention mechanism. The details are as follows:
[0093] S31. First, for the traditional graph convolutional neural network, in order to further extract the positional relationship between different spatial position measurement points, this method proposes a spatial gradient attention mechanism, the schematic diagram is as follows Figure 2 As shown, Figure 2 The input is the coordinates of the measuring point and the corresponding velocity measurement vector. Take the six associated nodes as an example, Indicates 6 associated spatial measurement points, Represents the spatial position coordinates of each point, Represents the velocity measurement vector of the corresponding points. The proposed embedded spatial gradient velocity decoupling dual-stream attention mechanism submodule is mainly composed of three modules: N1, N2, and N3. Specifically:
[0094] N1 spatial position attention submodule performs convolution and Softmax processing on the three-dimensional coordinates of the measuring points to generate spatial gradient attention weights to represent the impact of position differences between measuring points on flow velocity;
[0095] The N2 velocity vector attention submodule uses a residual connection structure to perform convolution processing on the velocity vector and generates velocity correlation gating weights through the Sigmoid activation function;
[0096] The N3 feature fusion submodule multiplies the spatial gradient attention weight, flow velocity correlation gating weight and the original flow velocity feature element by element, and outputs the fused flow velocity feature.
[0097] It's worth noting that spatial coordinates and velocity vectors differ in physical meaning and are therefore processed separately. Feature extraction for each is performed independently, forming a dual-stream attention mechanism. In reality, the correlation between flow velocities depends not only on spatial proximity (geographic location), but also on factors such as the hydrodynamic propagation path and terrain slope. Directly modeling position and velocity together can obscure their internal feature relationships. The split-stream attention mechanism allows for clearer modeling of "who influences whom." The spatial branch learns geometric structure perception, while the velocity branch learns dynamic dependency modeling. Each attention branch adaptively learns its own key areas of focus.
[0098] In this embodiment, in the spatial gradient velocity decoupling dual-stream attention mechanism of the present invention, the spatial position attention weight and flow rate-related gating weights It is the core computing unit, which is used to model the geometric structure influence and dynamic dependency between measurement points. Among them, the spatial position attention weight in the N1 module The calculation formula is:
[0099]
[0100]
[0101] Among them, the input [x1,x2,...,x N ] are the three-dimensional coordinates of N measuring points (Cartesian coordinates x i =(x i ,y i ,z i )), spliced into a multi-dimensional feature vector. The first convolution layer (Conv1) extracts the local geometric features of the coordinates (such as the relative position and distance difference of adjacent measurement points); the second convolution layer (Conv2) further abstracts the global spatial structural features (such as the overall influence of terrain slope and river direction), and nonlinearity is introduced in the middle through ReLU activation. Output is a probability distribution, each element A C,i It represents the spatial influence weight of measuring point i on the prediction point. The sum of the weights is 1, ensuring the focus on key spatial locations (for example, neighboring measuring points with steep slopes have a greater impact on flow velocity).
[0102] and , represents the spatial influence of each measurement point on the prediction point;
[0103] satisfy ;
[0104] Perform multi-layer convolution (including residual connection) on the input flow rate:
[0105]
[0106]
[0107] Among them, the input [h1,h2,...,h N ] represents the velocity vectors (including magnitude and direction) of N measuring points, which are concatenated into a temporal feature sequence. Two layers of convolution (including residual connections) extract local dynamic features of the velocity (such as sudden changes in velocity and periodic fluctuations). Residual connections prevent gradient vanishing in deep networks and preserve the original velocity information (an advantage of the N2 module). Pooling layers (such as average pooling or maximum pooling) compress feature dimensions and focus on global velocity trends. Output It is a weight between 0 and 1, indicating the importance of the dynamic correlation of the flow velocity of the measuring point i to the predicted point. The larger the value, the more relevant the flow velocity change of the measuring point is to the predicted point (for example, the flow velocity fluctuation of the upstream key measuring point needs to be paid special attention). , represents the gating weight of flow velocity correlation, Represents the Sigmoid activation function, limiting the weight to .
[0108] The element-by-element multiplication operation in the module enables each element in the calculation to be accurately expressed according to the weight information, thereby completing more accurate feature modeling.
[0109] like Figure 3 (before decoupling) and Figure 4 After decoupling, it can be seen that decoupling the two flows significantly enhances the feature extraction and clustering results. Decoupling the features allows for clearer clustering, helping to identify points with large differences in flow velocity despite being geographically close (inconsistent spatial features), and points with similar flow velocity but geographically distant locations (weak physical connection).
[0110] S311, for the N1 submodule, it is composed of a convolutional layer, a ReLu activation function layer, a fully connected layer, and a Softmax layer. First, the convolutional layer, the ReLu activation function layer, and the fully connected layer deeply extract the deep correlation between the coordinates, and then input the Softmax layer. The Softmax layer outputs the gradient normalization result of the position difference between each adjacent point and the calculation point. Represents the output parameters of the spatial gradient attention mechanism.
[0111] S312. For the N2 submodule, the overall structure uses a residual connection structure to calculate the attention mechanism feature calculation results between the flow rate data. First, the convolution layer and the ReLu activation function layer extract the features between the flow rate data. Then, a residual connection is used to connect and calculate the final flow rate data attention mechanism output feature parameters through the pooling layer, the fully connected layer, and the Sigmoid activation function layer.
[0112] In this embodiment, in the N2 module, the advantages of the residual connection design are:
[0113] 1) The main path retains the original flow velocity information, and the residual path is directly connected to the flow velocity to avoid gradient disappearance;
[0114] 2) In deep networks, layer-by-layer convolution gradually extracts abstract features, but this can easily lead to information attenuation or gradient disappearance. The residual connection path can effectively solve this problem.
[0115] 3) The branch path can enhance local feature extraction, and the convolution layer can extract the change pattern of flow velocity in time series or neighborhood;
[0116] 4) After the convolutional layer, a full connection + sigmoid is connected, which is essentially a gated attention mechanism. The learned weights can determine whether the current flow rate is important and dynamically adjust the degree of participation;
[0117] 5) The residual connection structure model can better identify local abnormal patterns while maintaining global features.
[0118] S313: For the N3 submodule, it is the data feature obtained by calculating the flow rate data after the residual connection.
[0119] S314, finally , multiply and calculate to get the final predicted flow rate .
[0120] S32, in conjunction with the spatial gradient velocity decoupling dual-stream attention mechanism proposed in S31, proposes a graph convolutional neural network structure such as Figure 5 As shown, the input node information in the input layer includes the measurement point location, water depth and flow rate, and adjacency matrix The function of the graph convolution layer is to update the feature parameters of each node based on the input node information and adjacency matrix. The spatial gradient attention layer here refers to the attention module layer proposed in step S31.
[0121] It should be noted that the final output here is the spatial feature vector corresponding to the velocity data of multiple measuring points at the input time;
[0122] S33. Since the river flow rate is a slowly changing process, it may be associated with multiple historical moments. Therefore, this method proposes a multi-hop gated recurrent convolution module to establish the relationship between the river flow rate between multiple historical moments and the current moment. The schematic diagram is shown in Figure 6 As shown in Figure 2, the information unit calculation formula in the corresponding gated recurrent convolutional neural network is:
[0123] Introduce gated skip connections in the GRU part (overall state update equation):
[0124]
[0125] in, Update the state of the traditional gated recurrent unit and output the hidden state at the current moment (including short-term temporal dependencies); Indicates a jump gate, controls whether to introduce , that is, introducing longer historical flow rate information; represents element-wise multiplication; represents the early hidden state and retains long-term memory. If , then it degenerates into standard GRU, Generated by current input and history state (jump gate Calculation of ():
[0126]
[0127] in, is the input feature at the current moment (such as the spatial feature vector output by the dual-stream attention module); is the hidden state (short-term memory) of the previous moment; through the learnable weight W g , U g , V g Dynamically adjust the contribution of the three to the jump gate so that the model can automatically determine whether to activate long-term memory (such as increasing when the flow rate suddenly changes) based on the current input and historical state. , introducing an earlier stable state as a reference); is the Sigmoid activation function, which maps the linear combination result to [0,1].
[0128] The update gate (controls the degree of historical information retention) formula is:
[0129]
[0130] The calculation formula for the reset gate (controlling the degree of forgetting historical information) is updated to:
[0131]
[0132] The calculation formula for candidate state (fusion of current features and historical information) is:
[0133]
[0134] Standard Updates:
[0135]
[0136] Final state output:
[0137]
[0138] in, Update Gate, with a value range of [0,1], is used to control the hidden state of the previous moment the degree of retention of the current state; Reset Gate, with a value range of [0,1], is used to control the hidden state of the previous moment The degree of impact on the current candidate status; Candidate State, the value range is [-1, 1], determined by the current input and the history status filtered by the reset gate Joint decision-making; ≈1 means retaining most of the historical information (the state of the previous moment are largely retained); ≈0 means forgetting most of the historical information (the current state is mainly determined by the current input Decide); For input Weight matrix to the update gate (dimension: output dimension × input dimension); Hidden state at the previous moment Weight matrix to the update gate (dimension: output dimension × hidden state dimension); ≈1 means retaining the hidden state of the previous moment (historical information is fully utilized); ≈0 means resetting (forgetting) the hidden state of the previous moment (historical information is ignored, and the candidate state is mainly determined by the current input); For input To the weight matrix of the reset gate (dimension: output dimension × input dimension); Hidden state at the previous moment The weight matrix to the reset gate (dimension: output dimension × hidden state dimension); It is a hyperbolic tangent activation function that maps the linear combination result to [-1,1] to introduce nonlinearity and normalize features; For input The weight matrix to the candidate state (dimension: hidden state dimension × input dimension); is the weight matrix from the historical state to the candidate state after the reset gate adjustment (dimension: hidden state dimension × hidden state dimension).
[0139] In the jump-gated recurrent neural network module of the present invention, the jump-gating mechanism is the core innovation that breaks through the limitations of traditional GRU long-term dependency modeling. By introducing jump connections on the basis of standard GRU, the selective fusion of historical information at multiple time scales is achieved. Compared with the standard GRU, its core innovation lies in the adaptive fusion of multi-time scale features - it not only retains the sensitivity of GRU to short-term dynamics, but also directly activates long-term historical states through jump connections to avoid gradient vanishing and information attenuation. This design forms a three-dimensional "space-time-physics" synergy with the dual-stream attention mechanism and the dynamic adjacency matrix, enabling the model to accurately capture the spatiotemporal evolution of the velocity field, and is particularly suitable for scenarios that require long-term stable predictions, such as urban drainage systems and small river sections.
[0140] S34. In order to organically combine the spatial gradient velocity decoupling dual-stream attention mechanism graph convolution module proposed in this method with the jump gate recurrent neural network, rather than a simple sequential connection relationship, this method embeds the spatial gradient velocity decoupling dual-stream attention mechanism graph convolution module into the jump gate recurrent neural network. The specific structure is as follows Figure 7As shown in the figure, the main difference is that the flow field information of multiple measurement points at one moment is first input through the proposed spatial gradient velocity decoupling dual-stream attention mechanism graph convolution module, and the spatial features are calculated before subsequent calculations are performed in the jump-gated recurrent neural network.
[0141] The final network structure is as follows Figure 8 As shown, the input is at the bottom layer, which contains the velocity data from multiple measurement points at each measurement time and the corresponding adjacency matrix A. The output is at the top layer, which contains the velocity data within the predicted time window. The ESFGCNGRU module in the figure is the graph convolutional gated recurrent neural network module proposed in this method, which embeds a spatial gradient velocity decoupling dual-stream attention mechanism. The bidirectional connection (bidirectional GRU) ensures accurate feature extraction in the time dimension of the intermediate correlation between velocity and the preceding and following time.
[0142] S4. After training the proposed network with the river velocity dataset, the trained network weights are obtained. The trained network weights and network structure together constitute the river velocity model.
[0143] Example 2
[0144] Based on the same concept, the present invention also proposes a velocity field modeling device based on a graph convolution gated recurrent neural network with embedded spatial gradient velocity decoupling and dual-stream attention mechanism, including:
[0145] The acquisition module collects the three-dimensional coordinates, elevation, and historical flow velocity data of different measuring points on the river, and calculates the slope difference, friction coefficient, and transmission delay between measuring points;
[0146] A construction module is used to construct a dynamic adjacency matrix that integrates spatial distance, historical velocity correlation, slope difference, friction coefficient, and transmission delay. The spatial distance is obtained based on the three-dimensional coordinates and elevation of different measuring points on the river. The historical velocity correlation is obtained based on historical velocity data.
[0147] In the training module, a graph convolutional gated recurrent neural network with an embedded spatial gradient velocity decoupling dual-stream attention mechanism is designed. The dynamic adjacency matrix and multi-point velocity data are input into the neural network for training to obtain a velocity field prediction model.
[0148] The network includes:
[0149] 1) The spatial gradient velocity decoupling dual-stream attention module processes the spatial coordinates of the measurement point and the velocity vector into two independent branches to extract geometric structure features and dynamic dependency features respectively;
[0150] 2) The jump-gated recurrent neural network module selectively fuses historical hidden states through the jump-gating mechanism to establish flow velocity correlations at multiple time scales.
[0151] Example 3
[0152] This embodiment also provides an electronic device, referring to Figure 9 , includes a memory 404 and a processor 402, wherein the memory 404 stores a computer program, and the processor 402 is configured to run the computer program to perform the steps in any of the above method embodiments.
[0153] Specifically, the processor 402 may include a central processing unit (CPU), or an application specific integrated circuit (ASIC), or may be configured to implement one or more integrated circuits for implementing the embodiments of the present invention.
[0154] Memory 404 may include a large-capacity memory 404 for data or instructions. By way of example, and not limitation, memory 404 may include a hard disk drive (HDD), a floppy disk drive, a solid-state drive (SSD), flash memory, an optical disk, a magneto-optical disk, a magnetic tape, or a Universal Serial Bus (USB) drive, or a combination of two or more of these. Where appropriate, memory 404 may include removable or non-removable (or fixed) media. Where appropriate, memory 404 may be internal or external to the data processing device. In certain embodiments, memory 404 is non-volatile memory. In certain embodiments, memory 404 includes read-only memory (ROM) and random access memory (RAM). Where appropriate, the ROM may be a mask-programmed ROM, a programmable ROM (PROM), an erasable PROM (EPROM), an electrically erasable PROM (EEPROM), an electrically alterable ROM (EAROM) or a flash memory (FLASH), or a combination of two or more of these. In appropriate circumstances, the RAM may be a static random access memory (SRAM) or a dynamic random access memory (DRAM), wherein the DRAM may be a fast page mode dynamic random access memory 404 (FPMDRAM), an extended data output dynamic random access memory (EDODRAM), a synchronous dynamic random access memory (SDRAM), etc.
[0155] The memory 404 may be used to store or cache various data files required for processing and / or communication, as well as possible computer program instructions executed by the processor 402 .
[0156] The processor 402 reads and executes computer program instructions stored in the memory 404 to implement any one of the velocity field modeling methods based on the embedded spatial gradient velocity decoupling dual-stream attention mechanism graph convolution gated recurrent neural network in the above embodiments.
[0157] Optionally, the electronic device may further include a transmission device 406 and an input / output device 408 , wherein the transmission device 406 is connected to the processor 402 , and the input / output device 408 is connected to the processor 402 .
[0158] Transmission device 406 can be used to receive or transmit data via a network. Specific examples of such networks may include wired or wireless networks provided by the electronic device's communications provider. In one embodiment, the transmission device includes a network interface controller (NIC), which can be connected to other network devices via a base station to enable communication with the Internet. In another embodiment, transmission device 406 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0159] The input / output device 408 is used to input or output information.
[0160] Example 4
[0161] This embodiment also provides a readable storage medium, which stores a computer program. The computer program includes program code for controlling a process to execute a process. The process includes a velocity field modeling method based on an embedded spatial gradient velocity decoupling dual-stream attention mechanism graph convolution gated recurrent neural network according to embodiment one.
[0162] It should be noted that the specific examples in this embodiment can refer to the examples described in the above embodiments and optional implementation modes, and this embodiment will not be repeated here.
[0163] In general, various embodiments may be implemented in hardware or dedicated circuitry, software, logic, or any combination thereof. Some aspects of the invention may be implemented in hardware, while other aspects may be implemented in firmware or software executed by a controller, microprocessor, or other computing device, but the invention is not limited thereto. Although various aspects of the invention may be shown and described as block diagrams, flow charts, or using some other graphical representation, it should be understood that, as non-limiting examples, the blocks, devices, systems, techniques, or methods described herein may be implemented in hardware, software, firmware, dedicated circuitry or logic, general-purpose hardware or a controller or other computing device, or some combination thereof.
[0164] The embodiments of the present invention may be implemented by computer software that is executable by a data processor of a mobile device, such as in a processor entity, or by hardware, or by a combination of software and hardware. Computer software or programs (also referred to as program products) including software routines, applets and / or macros may be stored in any device-readable data storage medium, and they include program instructions for performing specific tasks. A computer program product may include one or more computer executable components that are configured to perform an embodiment when the program is run. One or more computer executable components may be at least one software code or a portion thereof. In addition, it should be noted at this point that, for example, Figure 1 Any block of the logic flow in the program may represent program steps, or interconnected logic circuits, blocks and functions, or a combination of program steps and logic circuits, blocks and functions. The software may be stored on physical media such as memory chips or memory blocks implemented within the processor, magnetic media such as hard disks or floppy disks, and optical media such as, for example, DVDs and their data variants, CDs, etc. Physical media are non-transitory media.
[0165] Those skilled in the art should understand that the technical features of the above embodiments can be combined arbitrarily. In order to make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0166] The above embodiments merely illustrate several embodiments of the present invention, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present invention. It should be noted that a person skilled in the art would be able to make various modifications and improvements without departing from the spirit of the present invention, all of which fall within the scope of the present invention. Therefore, the scope of the present invention shall be determined by the appended claims.
Claims
1. Velocity field modeling method, characterized in that: The following steps are involved: S1. Collect the three-dimensional coordinates, elevation, and historical flow velocity data of different measuring points on the river, and calculate the slope difference, friction coefficient, and transmission delay between the measuring points; S2. Construct a dynamic adjacency matrix that integrates spatial distance, historical velocity correlation, slope difference, friction coefficient, and transmission delay; the spatial distance is obtained based on the three-dimensional coordinates and elevation of different measuring points on the river; the historical velocity correlation is obtained based on historical velocity data; S3. Design a graph convolutional gated recurrent neural network with an embedded spatial gradient velocity decoupling dual-stream attention mechanism, the network comprising: 1) The spatial gradient velocity decoupling dual-stream attention module processes the spatial coordinates of the measurement point and the velocity vector into two independent branches to extract geometric structure features and dynamic dependency features respectively; 2) A jump-gated recurrent neural network module selectively fuses historical hidden states through a jump-gating mechanism to establish flow velocity correlations at multiple time scales; S4. Inputting the dynamic adjacency matrix and the velocity data of multiple measuring points into the neural network for training to obtain a velocity field prediction model.
2. The velocity field modeling method according to claim 1, wherein: The method for calculating the slope difference, friction coefficient and transmission delay in step S1 includes: S11. Calculate the slope difference based on the elevation of the measuring point and the distance to the river centerline; S12. Calculate the friction coefficient based on the Manning formula, combining the hydraulic radius, average slope, and average flow velocity; S13. Calculate the transmission delay based on the cross-correlation analysis of the flow velocity time series of the upstream and downstream measuring points.
3. The velocity field modeling method according to claim 1, wherein: The method for constructing the dynamic adjacency matrix in step S2 includes: S21. Calculate the spatial distance based on the three-dimensional coordinates of the measuring points and use the KNN algorithm to generate a spatial adjacency matrix with distance decay characteristics; S22. Calculate the Pearson correlation coefficient between measuring points based on the velocity data within the historical time window to generate a velocity correlation adjacency matrix; S23. Generate a dynamic adjacency matrix by fusing the spatial adjacency matrix, velocity correlation adjacency matrix, slope difference, friction coefficient and transmission delay through learnable weights.
4. The velocity field modeling method according to claim 1, wherein: The spatial gradient velocity decoupling dual-stream attention module includes: N1 spatial position attention submodule performs convolution and Softmax processing on the three-dimensional coordinates of the measuring points to generate spatial gradient attention weights to represent the impact of position differences between measuring points on flow velocity; The N2 velocity vector attention submodule uses a residual connection structure to perform convolution processing on the velocity vector and generates velocity correlation gating weights through the Sigmoid activation function; The N3 feature fusion submodule multiplies the spatial gradient attention weight, flow velocity correlation gating weight and the original flow velocity feature element by element, and outputs the fused flow velocity feature.
5. The velocity field modeling method according to claim 1, wherein: The jump-gated recurrent neural network module introduces a jump gate in the GRU unit. The input of the jump gate includes the current input, the historical hidden state and the early hidden state k steps ago. The early hidden state is selectively fused through element-by-element multiplication to enhance long-term memory.
6. The velocity field modeling method according to claim 1, wherein: The neural network adopts a bidirectionally connected gated recurrent unit and simultaneously extracts forward and backward correlation features of the flow rate data in the time dimension.
7. The velocity field modeling method according to any one of claims 1 to 6, characterized in that: The elements of the dynamic adjacency matrix control sparsity through activation functions, and the spatial gradient flow rate decoupling dual-stream attention module avoids gradient disappearance through residual connections.
8. A velocity field modeling device, characterized in that: include: The acquisition module collects the three-dimensional coordinates, elevation, and historical flow velocity data of different measuring points on the river, and calculates the slope difference, friction coefficient, and transmission delay between measuring points; A construction module is used to construct a dynamic adjacency matrix that integrates spatial distance, historical velocity correlation, slope difference, friction coefficient, and transmission delay. The spatial distance is obtained based on the three-dimensional coordinates and elevation of different measuring points on the river. The historical velocity correlation is obtained based on historical velocity data. In the training module, a graph convolutional gated recurrent neural network with an embedded spatial gradient velocity decoupling dual-stream attention mechanism is designed. The dynamic adjacency matrix and multi-point velocity data are input into the neural network for training to obtain a velocity field prediction model. The network includes: 1) The spatial gradient velocity decoupling dual-stream attention module processes the spatial coordinates of the measurement point and the velocity vector into two independent branches to extract geometric structure features and dynamic dependency features respectively; 2) The jump-gated recurrent neural network module selectively fuses historical hidden states through the jump-gating mechanism to establish flow velocity correlations at multiple time scales.
9. An electronic device comprising a memory and a processor, characterized in that: The memory stores a computer program, and the processor is configured to run the computer program to execute the velocity field modeling method according to any one of claims 1 to 7.
10. A readable storage medium, characterized in that: The readable storage medium stores a computer program, wherein the computer program includes a program code for controlling a process to execute a process, wherein the process includes the velocity field modeling method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Method and device for constructing flow velocity prediction model based on improved gating circulation unit
CN119378407A
Method and system for simulating hydrodynamic force of ship lock in estuary area
CN119598912A