River velocity prediction method and device based on embedded physical information
By embedding physical information of river dynamics calculations into the LSTM river velocity prediction model, the problem of inaccurate velocity prediction in existing technologies is solved, efficient and accurate prediction of river velocity data is achieved, and the adaptability and accuracy of the model are improved.
Patent Information
- Application Number
- CN202510796660.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-16
- Publication Date
- 2025-09-09
- Estimated Expiration
- 2045-06-16
AI Technical Summary
Existing velocity measurement and analysis methods based on fixed-point horizontal acoustic Doppler flow meters are difficult to capture the long-term dependence of river velocity data, resulting in inaccurate velocity predictions. Traditional prediction models suffer from gradient vanishing or explosion phenomena when dealing with long-term dependence problems and are unable to effectively utilize the complex temporal and spatial characteristics of velocity data.
By embedding physical information of river dynamics calculations into the LSTM river velocity prediction model, using the Navier-Stokes momentum equation, mass conservation continuity equation and riverbed surface friction loss equation for calculation, and combining the multi-layer attention mechanism to set weights for the LSTM unit, the model's utilization of historical data and prediction accuracy are improved.
It enhances the scientificity and rationality of river velocity prediction, improves the accuracy and reliability of prediction results, can better capture the long-term dependence of velocity data, and improves the accuracy of prediction.
Smart Images

Figure CN120337781B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of hydrological forecasting, and in particular to a method and device for predicting river flow velocity based on embedded physical information. Background Art
[0002] In the field of river flow monitoring and research, accurate prediction of river flow velocity is of vital importance to many aspects, such as water resources management, flood prevention and disaster reduction, ecological protection, and shipping safety. As a commonly used flow velocity measurement device, the fixed-point horizontal acoustic Doppler current meter plays an important role in practical applications. However, the current flow velocity measurement and analysis based on the fixed-point horizontal acoustic Doppler current meter has certain limitations.
[0003] Existing applications mainly focus on flow velocity measurement data within the current short time period. This method only captures the changes in flow velocity in the short term, but ignores the long-term dependence between flow velocity data. River flow velocity is not an isolated short-term change phenomenon. It is affected by a combination of complex factors, such as the topography of the upstream and downstream of the river, long-term changes in meteorological conditions, seasonal water supply differences, etc. These factors make the flow velocity data have long-term correlations and trends in the time series. Ignoring this long-term dependence will lead to the inability to fully and deeply understand the changing laws of river flow velocity, which in turn affects the accurate prediction of river flow velocity.
[0004] From the perspective of prediction models, traditional forecasting methods struggle to effectively process flow velocity data with complex spatiotemporal characteristics. Simple statistical models fail to fully exploit the underlying patterns and long-term dependencies in the data. Early neural network models, such as standard recurrent neural networks (RNNs), while capable of processing sequential data, are prone to vanishing or exploding gradients when faced with long-term dependencies. This prevents the model from learning long-range dependencies and results in low prediction accuracy.
[0005] As river research and related applications increasingly demand more accurate flow velocity predictions, existing velocity measurement and prediction methods based on fixed-point horizontal acoustic Doppler current meters are no longer able to meet these demands. Therefore, a new method is urgently needed that can fully capture the long-term dependencies between velocity data and more accurately represent the patterns of velocity variation. This approach can achieve efficient and accurate predictions of river flow velocity, providing strong support for decision-making and practical applications in related fields. Summary of the Invention
[0006] The embodiments of the present application provide a river velocity prediction method and device based on embedded physical information, which improves the prediction accuracy of river velocity data by embedding the physical information of river dynamics calculation into the prediction results of the LSTM river velocity prediction model for re-prediction.
[0007] In a first aspect, an embodiment of the present application provides a method for predicting river flow velocity based on embedded physical information, the method comprising:
[0008] Obtaining continuous flow velocity data, and inputting the continuous flow velocity data into a pre-trained LSTM river flow velocity prediction model to obtain a first prediction result, wherein a historical time window is set for each LSTM unit in the LSTM river flow velocity prediction model, and performing a weighted fusion of the cell states of each LSTM unit within the corresponding historical time window at a current moment as the cell state of the LSTM unit at the current moment;
[0009] Calculate physical information based on the Navier-Stokes momentum equation, mass conservation continuity equation, and riverbed surface friction loss equation;
[0010] The physical information is fused with the first prediction result to obtain a second prediction result, where the second prediction result is a river velocity prediction result.
[0011] In a second aspect, an embodiment of the present application provides a river flow velocity prediction device based on embedded physical information, comprising:
[0012] an acquisition module, configured to acquire continuous flow velocity data and input the continuous flow velocity data into a pre-trained LSTM river flow velocity prediction model to obtain a first prediction result, wherein a historical time window is set in the LSTM river flow velocity prediction model, and a cell state of each LSTM unit within the historical time window at a current moment is weightedly fused as the cell state of the LSTM unit at the current moment;
[0013] The physical information calculation module calculates physical information based on the Navier-Stokes momentum equation, mass conservation continuity equation, and riverbed surface friction loss equation;
[0014] The prediction module is used to fuse the physical information with the first prediction result to obtain a second prediction result, where the second prediction result is a river flow velocity prediction result.
[0015] In a third aspect, an embodiment of the present application 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 a river flow velocity prediction method based on embedded physical information.
[0016] The main contributions and innovations of the present invention are as follows:
[0017] In an embodiment of the present application, a historical time window is set for each LSTM unit in the LSTM river flow rate prediction model, and the cell state of each LSTM unit in the corresponding historical time window at the current moment is weighted and fused as the cell state at the current moment, thereby making full use of historical data information, so that the model can better combine past flow rate-related situations when predicting, thereby improving the accuracy and reliability of the prediction; in an embodiment of the present application, the physical information of river dynamics calculation is embedded into the prediction results of the LSTM river flow rate prediction model for re-prediction, thereby enhancing the scientificity and rationality of the prediction results, and making up for the possible shortcomings of relying solely on data-driven models; in an embodiment of the present application, a multi-layer attention mechanism is used in the LSTM flow rate prediction model to set weights for the input gate, forgetting gate and output gate of each LSTM unit respectively, which can enable the model to focus more on important input features, selectively forget unimportant information and reasonably output results, thereby helping to improve the adaptability of the model to different situations and the accuracy of prediction.
[0018] The details of one or more embodiments of the present application are set forth in the following drawings and description to make other features, objects, and advantages of the present application more readily apparent. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0020] Figure 1 is a flow chart of a river velocity prediction based on embedded physical information according to an embodiment of the present application;
[0021] Figure 2 is a structural block diagram of a river flow velocity prediction device based on embedded physical information according to an embodiment of the present application;
[0022] Figure 3 Schematic diagram of the hardware structure of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION
[0023] 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.
[0024] 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.
[0025] Example 1
[0026] The embodiment of the present application provides a river velocity prediction method based on embedded physical information, which improves the prediction accuracy of river velocity data by embedding the physical information of river dynamics calculation into the prediction results of LSTM river velocity prediction model. Figure 1 , the method comprising:
[0027] Obtaining continuous flow velocity data, and inputting the continuous flow velocity data into a pre-trained LSTM river flow velocity prediction model to obtain a first prediction result, wherein a historical time window is set for each LSTM unit in the LSTM river flow velocity prediction model, and performing a weighted fusion of the cell states of each LSTM unit within the corresponding historical time window at a current moment as the cell state of the LSTM unit at the current moment;
[0028] Calculate physical information based on the Navier-Stokes momentum equation, mass conservation continuity equation, and riverbed surface friction loss equation;
[0029] The physical information is fused with the first prediction result to obtain a second prediction result, where the second prediction result is a river velocity prediction result.
[0030] In some embodiments, a multi-layer attention mechanism is used in the LSTM flow rate prediction model to set weights for the input gate, forget gate, and output gate of each LSTM unit respectively.
[0031] Specifically, weights are set for the input gate, forget gate, and output gate based on the current input, the hidden state at the previous adjacent time, and the cell state at the previous adjacent time of each LSTM unit. The formula is as follows:
[0032]
[0033] in, is the forget gate weight, is the input gate weight, is the output gate weight, weight matrix, is the current input, is the hidden state at the previous adjacent moment, is the cell state at the previous adjacent moment, is the bias term, Represents the softmax activation function.
[0034] Specifically, multi-layer attention calculations are performed on the current input, the hidden state at the previous adjacent moment, and the cell state at the previous adjacent moment, and a column vector containing three elements is output through the softmax activation function. These three vectors are the weights of the input gate, forget gate, and output gate.
[0035] Specifically, the input gate is used to control the extent to which new information is written into the cell state, and the input gate weight It is used to indicate the importance of the input information at the current moment; the output gate is used to control the information content of the cell state output, and the output gate weight is used to indicate the importance of the cell state information output at the current moment; the forget gate is responsible for deciding whether to retain or discard the old information in the cell state, and the forget ... Used to represent the retained value of the cell state information at the previous moment.
[0036] In water flow rate prediction, the current input can directly reflect the current water flow state. The hidden state of the previous adjacent moment integrates the characteristics of the previous moments and retains key information in the historical process. The adjacent cell state of the previous moment stores long-term memory, which is of great significance for maintaining long-term dependencies between data. Therefore, determining the weights of the input gate, output gate, and forget gate based on the current input, the hidden state of the previous adjacent moment, and the cell state of the previous adjacent moment can ensure that the input, forgetting, and output of the current LSTM unit are in line with the current environment, thereby more accurately adjusting the cell state information.
[0037] In some embodiments, this solution sets the historical time window to [t- ,t-1], the intermediate quantity formula of the LSTM unit cell state at the current moment is expressed as follows:
[0038]
[0039] ,
[0040] Where t is the current time, is the intermediate quantity of the LSTM unit cell state at the current time t, is the cell state of the LSMT unit in the historical time window, is the weight corresponding to the cell state of the LSMT unit in the historical time window, is the parameter matrix to be trained, is the length of the time window.
[0041] Specifically, by setting a historical time window, the cell state of each LSTM unit is fused at multiple time scales, not only considering the cell state of the current time step, but also considering the cell state of multiple historical time scales.
[0042] In some specific embodiments, after setting weights for the input gate, output gate, and forget gate of each LSTM unit and performing multi-time-scale fusion on the cell state of each LSTM unit, the formula of the forget gate of each LSTM unit is expressed as follows:
[0043]
[0044]
[0045] in, represents the output of the forget gate, is the current input, is the preprocessing matrix parameter to be trained, is the hidden state of the previous adjacent moment, is the matrix parameter to be trained, is the cell state at the previous adjacent moment, is the intermediate quantity of the LSTM unit cell state at the current time t, is the matrix parameter to be trained is the bias parameter to be trained, represents the Sigmoid activation function, The output value is between 0 and 1, indicating the state forgetting probability. is the forget gate weight, Represents the final weighted forget gate output.
[0046] Specifically, the input gate formula of each LSTM unit is expressed as follows:
[0047]
[0048]
[0049] in, is the input gate output, is the current input, is the matrix parameter to be trained, is the hidden state of the previous adjacent moment, is the matrix parameter to be trained, is the cell state at the previous adjacent moment, is the intermediate quantity of the LSTM unit cell state at the current time t, are the parameters to be trained, is the bias parameter to be trained, represents the Sigmoid activation function, The output value is between 0 and 1, which is used to control the writing of new information. is the input gate weight, Represented as the final weighted input gate output.
[0050] Specifically, the output gate formula of each LSTM unit is expressed as follows:
[0051]
[0052]
[0053] in, is the output gate output, is the current input, is the matrix parameter to be trained, is the hidden state of the previous adjacent moment, is the matrix parameter to be trained, is the cell state at the previous adjacent moment, is the intermediate quantity of the LSTM unit cell state at the current time t, are the parameters to be trained, is the bias parameter to be trained, represents the Sigmoid activation function, is the output gate weight, Represents the final output gate output after weighting.
[0054] Furthermore, based on the weighted final input gate output and forget gate output, we can know that the cell state update process is:
[0055]
[0056] in, Represents the cell state at the current time t based on the weighted final input gate output and the forget gate output, for The cell state at each moment, Represents the Hadamard product between matrices.
[0057] In some embodiments, the LSTM river flow rate prediction model includes an LSTM encoding layer, an attention mechanism layer, an LSTM decoding layer and a fully connected layer connected in series. The LSTM encoding layer has the same structure as the LSTM decoding layer and is composed of multiple LSTM units. The attention mechanism layer updates the hidden state of the LSTM unit at the current moment in combination with the hidden state of the historical LSTM unit. The fully connected layer is used to output the decoding result of the LSTM decoder.
[0058] Specifically, the attention weight of the LSTM unit at the current moment to the hidden state of the LSTM unit at each historical moment is calculated in the attention mechanism layer, and the weighted sum of the corresponding LSTM unit hidden states is performed based on the attention weight of the LSTM unit hidden state at each historical moment to obtain the historical context information of the LSTM at the current moment, and the historical context information of the LSTM unit at the current moment is used as the hidden state of the LSTM unit at the current moment.
[0059] Specifically, in LSTM, the hidden state update formula of the LSTM hidden layer is expressed as:
[0060]
[0061] in, The hidden state at the current moment, is the final output gate output after weighting, represents the tanh activation function, is the cell state at the current moment.
[0062] Specifically, we first calculate the degree of attention of the current LSTM unit to the hidden state of the LSTM unit at each historical moment. The formula is as follows:
[0063]
[0064] in, Indicates the degree of attention of the LSTM unit at the current moment t to the hidden state of the LSTM unit at the historical moment j, is the hidden state of the LSTM unit at historical moment j, is the hidden state of the previous adjacent moment, are the parameters to be trained.
[0065] Specifically, the attention degree of the LSTM unit hidden state at each historical moment is normalized to obtain the attention weight of the LSTM unit at the current moment to the LSTM unit hidden state at each historical moment. The sum of the attention weights of the LSTM unit hidden state at each historical moment is 1. The formula is as follows:
[0066]
[0067] in, is the attention weight of the LSTM unit hidden state at the current moment t to the historical moment j, is the degree of attention of the LSTM unit at the current moment t to the hidden state of the LSTM unit at the historical moment j.
[0068] Specifically, the calculation formula for the historical context information of the LSTM unit at the current moment is:
[0069]
[0070] in, is the historical context information of the LSTM unit at the current time t, is the attention weight of the LSTM unit hidden state at the current moment t to the historical moment j, is the hidden state at historical moment j.
[0071] Therefore, the final LSTM unit cell state update process at the current moment is:
[0072]
[0073] in, is the cell state at time t, is the input gate output, is the activation function, 、 、 is the training parameter, is the bias parameter, is the cell state at the previous moment, is the output of the forget gate.
[0074] In some embodiments, the Navier-Stokes momentum equation is expressed as follows:
[0075]
[0076] in, is the velocity component of the fluid in the x direction, is the velocity component of the fluid in the y direction, is the velocity component of the fluid in the z direction, Indicates time, is the three-dimensional coordinate in the spatial Cartesian coordinate system, represents the density of the fluid, represents the pressure of the fluid, represents the gravitational acceleration of the fluid in the x direction, represents the kinematic viscosity of the fluid, are the second-order spatial derivatives in the x, y, and z directions, respectively, used to describe the viscous effect of the fluid.
[0077] Specifically, the Navier-Stokes momentum equations are used to describe momentum transfer and fluid behavior in rivers.
[0078] In some embodiments, the mass conservation continuity equation is formulated as follows:
[0079]
[0080] in, is the velocity component of the fluid in the x direction, is the velocity component of the fluid in the y direction, is the velocity component of the fluid in the z direction, Represent the velocity gradient of the fluid in each direction.
[0081] In some embodiments, the Manning formula is used to construct the riverbed surface friction loss equation, which is expressed as:
[0082]
[0083]
[0084] in, is the river flow velocity, is the Manning roughness coefficient, which is used to describe the roughness of the riverbed surface. is the hydraulic radius, which represents the ratio of the fluid cross-sectional area to the wetted perimeter. is the cross-sectional area of the fluid, The wetted perimeter is used to indicate the boundary line where the fluid contacts the solid wall on the flow section.
[0085] In some specific embodiments, corresponding physical instruments are used to measure the parameters required for calculating the Navier-Stokes momentum equation, the mass conservation continuity equation, and the riverbed surface friction loss equation, and the calculation results of the Navier-Stokes momentum equation, the mass conservation continuity equation, and the riverbed surface friction loss equation are used as physical information.
[0086] In some embodiments, the physical information and the first prediction result are input into a pre-trained fully connected layer for prediction to obtain a second prediction result.
[0087] Specifically, by combining the physical information obtained from the Navier-Stokes momentum equation, the mass conservation continuity equation, and the riverbed surface friction loss equation into the first prediction result, and then performing a second prediction by the fully connected layer, the prediction accuracy of the flow velocity data can be further improved.
[0088] In some specific embodiments, the continuous flow velocity data collected by this solution is collected by an acoustic Doppler flow meter. In order to prevent the data collection frequency of the acoustic Doppler flow meter from being too high, a sliding window Poisson random sampling method is used to process the data collected by the acoustic Doppler flow meter to obtain continuous flow velocity data.
[0089] Exemplarily, the continuous flow rate data is:
[0090]
[0091] in, is the Poisson random sampling moment The corresponding 1-28 layer velocity measurement data is expressed as follows:
[0092]
[0093] in, Indicates the Laminar flow rate.
[0094] Furthermore, when training the LSTM flow rate prediction model, corresponding label data is set for each flow rate measurement data, and the formula is expressed as:
[0095]
[0096] To ensure label consistency, k is a fixed value.
[0097] Example 2
[0098] Based on the same concept, refer to Figure 2 , this application also proposes a river velocity prediction device based on embedded physical information, including:
[0099] an acquisition module, configured to acquire continuous flow velocity data and input the continuous flow velocity data into a pre-trained LSTM river flow velocity prediction model to obtain a first prediction result, wherein a historical time window is set in the LSTM river flow velocity prediction model, and a cell state of each LSTM unit within the historical time window at a current moment is weightedly fused as the cell state of the LSTM unit at the current moment;
[0100] The physical information calculation module calculates physical information based on the Navier-Stokes momentum equation, mass conservation continuity equation, and riverbed surface friction loss equation;
[0101] The prediction module is used to fuse the physical information with the first prediction result to obtain a second prediction result, where the second prediction result is a river flow velocity prediction result.
[0102] Example 3
[0103] This embodiment also provides an electronic device, referring to Figure 3 , 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.
[0104] 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 of the embodiments of the present application.
[0105] 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.
[0106] 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 .
[0107] The processor 402 reads and executes computer program instructions stored in the memory 404 to implement any one of the river velocity prediction methods based on embedded physical information in the above embodiments.
[0108] 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 .
[0109] 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.
[0110] The input / output device 408 is used to input or output information. In this embodiment, the input information may be continuous river flow velocity data, and the output information may be river flow velocity prediction results.
[0111] Optionally, in this embodiment, the processor 402 may be configured to execute the following steps through a computer program:
[0112] Obtaining continuous flow velocity data, and inputting the continuous flow velocity data into a pre-trained LSTM river flow velocity prediction model to obtain a first prediction result, wherein a historical time window is set for each LSTM unit in the LSTM river flow velocity prediction model, and performing a weighted fusion of the cell states of each LSTM unit within the corresponding historical time window at a current moment as the cell state of the LSTM unit at the current moment;
[0113] Calculate physical information based on the Navier-Stokes momentum equation, mass conservation continuity equation, and riverbed surface friction loss equation;
[0114] The physical information is fused with the first prediction result to obtain a second prediction result, where the second prediction result is a river velocity prediction result.
[0115] 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.
[0116] 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.
[0117] 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 3 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.
[0118] 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.
[0119] The above embodiments merely illustrate several embodiments of the present application. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present application. It should be noted that a person of ordinary skill in the art may make various modifications and improvements without departing from the spirit of the present application, all of which fall within the scope of protection of the present application. Therefore, the scope of protection of the present application shall be determined by the appended claims.
Claims
1. A river velocity prediction method based on embedded physical information, characterized in that: The following steps are involved: Continuous flow velocity data is obtained and input into a pre-trained LSTM river velocity prediction model to obtain a first prediction result, wherein a historical time window is set for each LSTM unit in the LSTM river velocity prediction model as [t- ,t-1], the cell state of each LSTM unit in the corresponding historical time window at the current moment is weighted and fused as the cell state of the LSTM unit at the current moment. The formula is expressed as: , Where t is the current time, is the intermediate quantity of the LSTM unit cell state at the current time t, is the cell state of the LSMT unit in the historical time window, is the weight corresponding to the cell state of the LSMT unit in the historical time window, is the parameter matrix to be trained, is the length of the time window; Calculate physical information based on the Navier-Stokes momentum equation, mass conservation continuity equation, and riverbed surface friction loss equation; The physical information is fused with the first prediction result to obtain a second prediction result, where the second prediction result is a river velocity prediction result. The physical information and the first prediction result are input into a pre-trained fully connected layer for prediction to obtain the second prediction result.
2. A river velocity prediction method based on embedded physical information according to claim 1, characterized in that: In the LSTM flow rate prediction model, a multi-layer attention mechanism is used to set weights for the input gate, forget gate, and output gate of each LSTM unit.
3. The method for predicting river flow velocity based on embedded physical information according to claim 1, characterized in that: The formula of the forget gate of each LSTM unit is as follows: in, represents the output of the forget gate, is the current input, is the preprocessing matrix parameter to be trained, is the hidden state of the previous adjacent moment, is the matrix parameter to be trained, is the intermediate quantity of the LSTM unit cell state at the current time t, is the matrix parameter to be trained, is the bias parameter to be trained, represents the Sigmoid activation function, The output value is between 0 and 1, indicating the state forgetting probability. is the forget gate weight, Represents the final weighted forget gate output.
4. The method for predicting river flow velocity based on embedded physical information according to claim 1, characterized in that: The input gate formula of each LSTM unit is expressed as follows: in, is the input gate output, is the current input, is the matrix parameter to be trained, is the hidden state of the previous adjacent moment, is the matrix parameter to be trained, is the intermediate quantity of the LSTM unit cell state at the current time t, are the parameters to be trained, is the bias parameter to be trained, represents the Sigmoid activation function, The output value is between 0 and 1, which is used to control the writing of new information. is the input gate weight, Represented as the final weighted input gate output.
5. The method for predicting river flow velocity based on embedded physical information according to claim 1, characterized in that: The output gate formula of each LSTM unit is expressed as follows: in, is the output gate output, is the current input, is the matrix parameter to be trained, is the hidden state of the previous adjacent moment, is the matrix parameter to be trained, is the intermediate quantity of the LSTM unit cell state at the current time t, are the parameters to be trained, is the bias parameter to be trained, represents the Sigmoid activation function, is the output gate weight, Represents the final output gate output after weighting.
6. The method for predicting river flow velocity based on embedded physical information according to claim 1, characterized in that: The LSTM river flow rate prediction model includes an LSTM encoding layer, an attention mechanism layer, an LSTM decoding layer and a fully connected layer connected in series. The LSTM encoding layer has the same structure as the LSTM decoding layer and is composed of multiple LSTM units. The attention mechanism layer updates the hidden state of the LSTM unit at the current moment in combination with the hidden state of the historical LSTM unit. The fully connected layer is used to output the decoding result of the LSTM decoder.
7. A river velocity prediction method based on embedded physical information according to claim 6, characterized in that: In the attention mechanism layer, the attention weight of the LSTM unit at the current moment to the hidden state of the LSTM unit at each historical moment is calculated, and the corresponding LSTM unit hidden state is weightedly summed based on the attention weight of the LSTM unit hidden state at each historical moment to obtain the historical context information of the LSTM at the current moment, and the historical context information of the LSTM unit at the current moment is used as the hidden state of the LSTM unit at the current moment.
8. A river velocity prediction device based on embedded physical information, characterized in that: include: The acquisition module is used to obtain continuous flow velocity data and input the continuous flow velocity data into the pre-trained LSTM river flow velocity prediction model to obtain the first prediction result, wherein the historical time window is set as [t- ,t-1], the cell state of each LSTM unit in the historical time window at the current moment is weighted and fused as the cell state of the LSTM unit at the current moment. The formula is expressed as: , Where t is the current time, is the intermediate quantity of the LSTM unit cell state at the current time t, is the cell state of the LSMT unit in the historical time window, is the weight corresponding to the cell state of the LSMT unit in the historical time window, is the parameter matrix to be trained, is the length of the time window; The physical information calculation module calculates physical information based on the Navier-Stokes momentum equation, mass conservation continuity equation, and riverbed surface friction loss equation; A prediction module is used to fuse the physical information with the first prediction result to obtain a second prediction result, where the second prediction result is a river flow velocity prediction result, wherein the physical information and the first prediction result are input into a pre-trained fully connected layer for prediction to obtain the second prediction result.
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 river flow velocity prediction method based on embedded physical information according to any one of claims 1 to 7.
Citation Information
Patent Citations
Water quality prediction method based on attention neural network
CN110428082A
Flight track abnormity judgment method based on sliding window algorithm
CN117874678A