A flow rate prediction method based on a fluid flow rate prediction model
Patent Information
- Application Number
- CN202610759977.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-05-29
- Publication Date
- 2026-10-27
AI Technical Summary
[0002]传统的流体流速检测方式包括声学式流速检测技术、双轨式雷达波测流系统和海流信息预测流体流速预测模型三种模式,但这三种方式目前仍存在不足,如声学式流速检测技术存在以下缺陷:环境敏感度高:声波易受水体浑浊度、多路径效应干扰,导致深海场景下测量误差增大(误差率达15%・30%);静态压力干扰:压电传感器在深水高压环境下易产生信号偏移,需额外补偿算法,增加系统复杂度;实时性不足:依赖物理信号采集与转换,无法实现毫秒级动态预测,难以满足水下机器人实时避障需求,双轨式雷达波测流系统存在以下缺陷:数据建模局限:仅提供瞬时流速检测值,缺乏对历史时序数据的深度学习,无法预测流速变化趋势;多变量耦合缺失:未整合温度、压力等环境参数,在洋流突变场景(如海底火山活动)下预测失效风险高;硬件依赖性强:需部署雷达发射/接收设备,难以集成至小型水下探测装置
[0022](1)本发明采用先划分后归一化的独立数据处理流程,能够彻底避免数据泄露(DataLeakage)问题,提升模型在真实场景中的泛化能力;
Smart Images

Figure CN122986299A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of underwater flow velocity prediction technology, and in particular to a flow velocity prediction method based on a fluid flow velocity prediction model. Background Technology
[0002] Traditional methods for fluid velocity detection include acoustic velocity detection technology, dual-track radar wave flow measurement systems, and ocean current information-based fluid velocity prediction models. However, these three methods still have shortcomings. For example, acoustic velocity detection technology has the following drawbacks: high environmental sensitivity: sound waves are easily affected by water turbidity and multipath effects, leading to increased measurement errors in deep-sea scenarios (error rates of 15%–30%); static pressure interference: piezoelectric sensors are prone to signal drift in high-pressure deep-sea environments, requiring additional compensation algorithms and increasing system complexity; and lack of real-time performance. The dual-track radar wave flow measurement system suffers from the following shortcomings: First, it relies on physical signal acquisition and conversion, making it unable to achieve millisecond-level dynamic prediction and failing to meet the real-time obstacle avoidance requirements of underwater robots. Second, it lacks data modeling capabilities, providing only instantaneous velocity detection values and lacking deep learning of historical time-series data, thus failing to predict velocity change trends. Third, it lacks multivariate coupling, failing to integrate environmental parameters such as temperature and pressure, resulting in a high risk of prediction failure in scenarios with sudden ocean current changes (such as submarine volcanic activity). Fourth, it is highly dependent on hardware, requiring the deployment of radar transmitting / receiving equipment, making it difficult to integrate into small underwater detection devices. The current information prediction fluid velocity prediction model also suffers from the following shortcomings: First, it lacks sufficient temporal feature modeling, relying on static historical data interpolation and failing to incorporate time-series networks such as LSTM, thus failing to capture the combined effects of tidal cycles (12 hours) and turbulent fluctuations (seconds). Fifth, it carries the risk of data leakage, as the training and test sets are not isolated and normalized, leading to a 50%–80% increase in error when the fluid velocity prediction model is generalized to new sea areas. Sixth, it lacks physical consistency, as the predicted velocity is not dynamically coupled with real-time sensor data (such as pressure values transmitted from ROVs), resulting in physical and logical contradictions.
[0003] Therefore, how to provide a flow velocity prediction method based on a fluid flow velocity prediction model to solve the difficulties existing in the prior art is a problem that urgently needs to be solved by those skilled in the art. Summary of the Invention
[0004] The purpose of this invention is to provide a flow velocity prediction method based on a fluid velocity prediction model, which can realize spatiotemporal dual-dimensional diagnosis of model performance and adapt to the regression requirements of industrial sensor data.
[0005] The objective of this invention can be achieved through the following technical solution: a flow velocity prediction method based on a fluid velocity prediction model, comprising:
[0006] S1. Data Acquisition: Acquire multi-source time-series flow field data and divide it into training and test sets;
[0007] S2. Data preprocessing: Normalize the training set and test set respectively to obtain preprocessed training set and test set; and construct a metadata matrix, which stores the true values of auxiliary features of the multi-source time series data.
[0008] S3. Fluid velocity prediction model construction: Construct a cascaded architecture of a two-layer long short-term memory network combined with a fully connected layer, and introduce an activation function into the fully connected layer to obtain a fluid velocity prediction model;
[0009] S4. Training and Validation: The preprocessed training set is input into the fluid velocity prediction model for training to obtain the trained fluid velocity prediction model. The inverse transformation matrix is reconstructed using the true values of the auxiliary features in the metadata matrix to validate the trained fluid velocity prediction model. The inverse transformation matrix is then inversely normalized to obtain the validated fluid velocity prediction model.
[0010] S5. Flow velocity prediction: Input the data to be predicted into the verified fluid velocity prediction model to obtain the fluid velocity prediction value.
[0011] As a further aspect of the present invention: the multi-source time series data is divided using a time-order segmentation method: the first 80% of the multi-source time series data is divided into a training set and the last 20% is divided into a test set according to time order.
[0012] As a further aspect of the present invention, the multi-source time-series data includes flow rate, temperature, and pressure.
[0013] As a further aspect of the present invention: the data preprocessing further includes generating the input sequence of the two-layer long short-term memory network through a sliding window, fusing the multi-source time series data to obtain a three-dimensional tensor, wherein the three-dimensional tensor is represented as the number of samples × time step × number of features, wherein the number of samples represents the number of samples generated by the sliding window, the time step is set to 50, indicating that each sample contains 50 consecutive historical time points, and the number of features is 3, corresponding to flow rate, temperature and pressure respectively.
[0014] As a further embodiment of the present invention: the metadata matrix includes time coordinates, temperature and pressure, and the dimensions of the metadata matrix correspond one-to-one with the multi-source time-series data.
[0015] As a further embodiment of the present invention: the basic relationship of the inverse transformation is: the original value is equal to the normalized value multiplied by the difference between the maximum and minimum values of the corresponding variable in the training set, plus the minimum value of the corresponding variable in the training set.
[0016] As a further embodiment of the present invention: the first layer of the cascaded architecture includes 64 hidden units for capturing local temporal patterns, and the second layer includes 32 hidden units for extracting global dependencies.
[0017] As a further aspect of the present invention, the activation function is the ReLU activation function.
[0018] As a further aspect of the present invention: in S4, the early stopping method is used to dynamically control the training process, and the Adam optimizer is used to adaptively adjust the learning rate to prevent overfitting.
[0019] As a further aspect of the present invention: during the verification process of the fluid velocity prediction model, the mean square error and root mean square error are used to evaluate the performance of the fluid velocity prediction model, and the consistency of the trend is verified by combining the comparison graph of the predicted value and the actual value.
[0020] As a further aspect of the present invention, it also includes visualizing the training and verification loss curves.
[0021] The beneficial effects of this invention are:
[0022] (1) The present invention adopts an independent data processing flow of first partitioning and then normalizing, which can completely avoid the problem of data leakage and improve the generalization ability of the model in real scenarios;
[0023] (2) In the sliding window data generation stage, the present invention synchronously stores non-target features, which can solve the problem of missing dimensions in multivariate prediction anti-normalization, ensure that the predicted value and the true value are in the same dimension space, and avoid the cumulative error caused by feature discarding in the traditional anti-normalization method;
[0024] (3) The present invention adopts a cascaded architecture of dual-layer LSTM + fully connected layer and sets a dynamic early stopping training strategy. The linear design of the output layer adapts to the regression requirements of industrial sensor data, preventing model overfitting while retaining optimal performance.
[0025] (4) This invention solves the problem of dimensional mismatch in univariate prediction inverse normalization by constructing a virtual matrix and visualizing the curve. The restored data has complete physical meaning and can be directly used for industrial system feedback, realizing spatiotemporal dual-dimensional diagnosis of model performance and intuitively demonstrating waveform fitting ability and training stability. Attached Figure Description
[0026] Figure 1 This is a flowchart of a flow velocity prediction method based on a fluid velocity prediction model according to the present invention.
[0027] Figure 2 This is a comparison chart of the flow velocity curve trends of the present invention;
[0028] Figure 3 This is a diagram showing the training results of the present invention. Detailed Implementation
[0029] The specific embodiments of the present invention will now be described with reference to the accompanying drawings. It should be understood that the following embodiments are for illustrative purposes only and are not intended to limit the scope of protection of the present invention. Where there is no conflict, the technical features in this embodiment can be combined with each other.
[0030] like Figure 1 As shown in the figure, this embodiment provides a flow velocity prediction method based on a fluid flow velocity prediction model. This method acquires multi-source time-series data of the flow field, constructs a two-layer long short-term memory network fluid flow velocity prediction model, and combines normalization processing, sliding window modeling, early stopping training, and inverse transformation reconstruction to achieve the prediction of fluid flow velocity.
[0031] S1, Data Acquisition
[0032] In this embodiment, the multi-source time-series data of the flow field are acquired in real time by flow velocity sensors, temperature sensors, and pressure sensors. Each sampled data includes sampling time, flow velocity value, temperature value, and pressure value. Among them, flow velocity is the target prediction variable, while temperature and pressure are used as auxiliary features to participate in the training of the fluid flow velocity prediction model, so as to improve the ability of the fluid flow velocity prediction model to express changes in the flow field state.
[0033] After obtaining multi-source time-series data, all data are first sorted in ascending order according to sampling time. Then, a time-series partitioning method is used to divide the data into training and test sets. Specifically, the first 80% of the historical data in the time series is used as the training set, and the last 20% is used as the test set. This partitioning method does not randomly shuffle the time-series data, thus preventing the fluid velocity prediction model from being exposed to information from future moments during the training phase and preventing the leakage of future information.
[0034] S2, Data Preprocessing
[0035] After dividing the training and testing sets, a sliding window method is used to construct fluid velocity prediction model samples. Each input sample consists of data from 50 consecutive time steps, with each time step containing three features: velocity, temperature, and pressure. The corresponding prediction targets are the velocity, temperature, and pressure values at the next time step after that window. This forms a three-dimensional input tensor suitable for Long Short-Term Memory (LSTM) networks, with dimensions including the number of samples, time step size, and number of features. Specifically, the time step size is 50, and the number of features is 3, corresponding to velocity, temperature, and pressure, respectively.
[0036] During the sliding window sample generation process, metadata corresponding to each sample is simultaneously constructed. This metadata includes the time coordinates of the predicted target, as well as the actual temperature and pressure values at the target time required for validation and inverse transformation. The time coordinates provide temporal information for physical constraint loss or time-correlation analysis, while the actual temperature and pressure values ensure consistent data column structure when the prediction results are restored to their original physical dimensions.
[0037] Since flow velocity, temperature, and pressure have different physical dimensions and numerical ranges, directly inputting them into a fluid velocity prediction model can easily lead to instability in the model's training. Therefore, this invention employs the Min-Max normalization method to scale the three types of variables.
[0038] The normalizer fits the data solely to the training set, meaning it determines the normalization parameters using only the maximum and minimum values of flow velocity, temperature, and pressure from the training set. Subsequently, both the training and test sets are transformed using these normalization parameters. The test set is not refitted to the normalizer to avoid incorporating test set information into the fluid velocity prediction model training process and to ensure that the training and test data are on a uniform data scale.
[0039] Normalization can be represented as follows: subtract the minimum value of each variable from its original value in the training set, and then divide by the difference between the maximum and minimum values of that variable in the training set, thereby mapping the data to the interval [0,1]. After normalization, the LSTM input sequence and prediction target are generated based on the normalized data, resulting in the input tensor and target matrix of the fluid velocity prediction model.
[0040] In this embodiment, the input tensor of the fluid velocity prediction model is in the form of "number of samples × 50 × 3", where 50 indicates that each sample contains 50 consecutive historical time points, and 3 indicates that each time point contains three variables: velocity, temperature, and pressure. The target matrix is in the form of "number of samples × 3", with the three columns corresponding to the velocity, temperature, and pressure of the next time step, respectively.
[0041] In this embodiment, when constructing multi-source time-series data, a metadata matrix corresponding to each sample is also constructed. The metadata matrix includes time coordinates, temperature, and pressure, used to record the predicted time point corresponding to each sliding window sample and the true values of auxiliary features from the stored multi-source time-series data. The metadata matrix has a dimension of (number of samples, 1), corresponding one-to-one with the multi-source time-series data. By introducing temporal metadata, temporal information can be provided for calculating the physical constraint loss during training, thus enabling the model training process to not only rely on data fitting errors but also incorporate the physical constraint relationships in the time dimension.
[0042] S3, Construction of Fluid Flow Velocity Prediction Model
[0043] The fluid velocity prediction model constructed in this embodiment adopts a structure of a two-layer long short-term memory network and a fully connected cascaded layer.
[0044] Specifically, the fluid velocity prediction model includes an input layer, a first long short-term memory network layer, a second long short-term memory network layer, a fully connected layer, and an output layer connected in sequence.
[0045] The first Long Short-Term Memory (LSTM) network layer, with 64 neural units, returns a complete time-series output, used to extract local temporal variation features within the input window. The second LSM network layer, with 32 neural units, is used to further extract global dependencies over a longer time range. This two-layer structure simultaneously enhances the fluid velocity prediction model's ability to express both short-term fluctuations and long-term trends.
[0046] A fully connected layer containing 16 neurons is placed after the Long Short-Term Memory (LSTM) network, and a ReLU activation function is introduced to enhance the nonlinear mapping capability of the fluid velocity prediction model. The output layer adopts a linear output method to adapt to the regression prediction requirements of continuous variables such as velocity, temperature, and pressure. The output layer outputs the prediction results of three variables, corresponding to the velocity, temperature, and pressure at the next time step, respectively.
[0047] S4. Training and Validation of Fluid Velocity Prediction Model
[0048] The preprocessed training samples are input into the fluid velocity prediction model for training. During training, the Adam optimizer is used to adaptively update the parameters of the fluid velocity prediction model, with mean squared error as the main data loss function. To prevent overfitting of the fluid velocity prediction model, this embodiment employs an early stopping strategy to dynamically control the training process.
[0049] Specifically, during the training phase, a portion of the data is allocated from the training set as validation data to monitor the performance of the fluid velocity prediction model on data not involved in parameter updates. The validation loss is continuously monitored during training, and training is terminated early if the validation loss fails to improve within 10 consecutive training epochs. Simultaneously, the fluid velocity prediction model weights are restored to the state corresponding to the minimum validation loss, thus obtaining the optimal fluid velocity prediction model parameters during training. This approach avoids overfitting the training data in subsequent training sessions, reduces ineffective training epochs, and improves training efficiency.
[0050] After training, the fluid velocity prediction model is validated using a preprocessed test set. The output of the fluid velocity prediction model is the prediction result at a normalized scale. To restore the prediction results to the original physical dimensions, this embodiment employs the Min-Max inverse transform method consistent with the data preprocessing stage.
[0051] During the inverse transformation, to maintain the same data column structure as when fitting the normalizer, an inverse transformation matrix is constructed in the order of "flow velocity, temperature, and pressure". The first column of this matrix is filled with the normalized flow velocity value predicted by the fluid velocity prediction model, and the second and third columns are filled with the actual temperature and pressure values corresponding to the prediction time, with the temperature and pressure values at the same data scale as the normalizer. Subsequently, the matrix is subjected to inverse transformation using the normalization parameters obtained from fitting the training set to obtain the data matrix in the original physical dimensions, and the first column is extracted as the final flow velocity prediction result.
[0052] The basic relationship of the inverse transform is: the original value equals the normalized value multiplied by the difference between the maximum and minimum values of the corresponding variable in the training set, plus the minimum value of the corresponding variable in the training set. In this way, the output of the fluid velocity prediction model can be restored from the normalized scale to the predicted value in the actual velocity unit.
[0053] The performance of fluid velocity prediction models is quantitatively evaluated using mean square error (MSE) and root mean square error (RMSE). MSE reflects the average squared deviation between the predicted and actual velocities, while RMSE, by taking the square root of MSE, gives the evaluation index the same dimensions as the velocity, making it easier to intuitively understand the magnitude of the prediction error.
[0054] At the same time, such as Figure 2 As shown, the predicted velocity curve and the actual velocity curve are plotted on the same coordinate system to observe their consistency in overall trend, peak value variation, and local fluctuations. Figure 3 As shown, it can also output the error index of the fluid velocity prediction model on the test set, which can be used to evaluate the prediction accuracy of the fluid velocity prediction model.
[0055] In addition, training loss, validation loss, and physical constraint loss are recorded during training, and loss variation curves are plotted. These loss curves can be used to determine whether the fluid velocity prediction model has converged, whether overfitting exists, and whether the early stopping strategy is triggered at an appropriate training epoch. Finally, the fluid velocity prediction model weights corresponding to the minimum validation loss are used as the optimal fluid velocity prediction model parameters, resulting in the validated fluid velocity prediction model.
[0056] S5, Flow Rate Prediction
[0057] In the actual prediction phase, velocity, temperature, and pressure data for the flow field to be predicted for 50 consecutive time steps prior to the current moment are acquired and scaled using the same normalization parameters as in the training phase. The normalized 3D input sequence is then input into the validated fluid velocity prediction model to obtain the normalized prediction result for the next time step.
[0058] Finally, the prediction results are inversely transformed using the normalized parameters saved during the training phase to restore the flow velocity value under the original physical dimensions, and this flow velocity value is output as the final fluid flow velocity prediction result.
[0059] Through the above implementation methods, the present invention can make full use of multi-source time-series information such as flow velocity, temperature and pressure, and combine a two-layer LSTM network to model the dynamic changes of the flow field, while avoiding future information leakage. Furthermore, it can improve the training efficiency of the fluid velocity prediction model and the reliability of the prediction results through early stopping strategy and inverse transformation reconstruction.
[0060] The above description is only a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any equivalent substitutions or modifications made by those skilled in the art within the scope of the technology disclosed in the present invention, based on the technical solution and inventive concept of the present invention, should be covered within the scope of protection of the present invention.
[0061] It should be understood that the terms "center," "longitudinal," "lateral," "length," "width," "thickness," "upper," "lower," "front," "rear," "left," "right," "vertical," "horizontal," "top," "bottom," "inner," "outer," "clockwise," "counterclockwise," "axial," "radial," and "circumferential" indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are used only for the convenience of describing the present invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on the present invention.
[0062] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of that feature. In the description of this invention, "a plurality of" means at least two, such as two, three, etc., unless otherwise explicitly specified.
[0063] In this invention, unless otherwise explicitly specified and limited, the terms "installation," "connection," "linking," and "fixing," etc., should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral part; they can refer to a mechanical connection, an electrical connection, or a connection that allows communication between them; they can refer to a direct connection or an indirect connection through an intermediate medium; they can refer to the internal communication of two components or the interaction between two components, unless otherwise explicitly limited. Those skilled in the art can understand the specific meaning of the above terms in this invention according to the specific circumstances.
[0064] In this invention, unless otherwise explicitly specified and limited, "above" or "below" the second feature can mean that the first feature is in direct contact with the second feature, or that the first feature is in indirect contact with the second feature through an intermediate medium. Furthermore, "above," "over," and "on top" of the second feature can mean that the first feature is directly above or diagonally above the second feature, or simply that the first feature is at a higher horizontal level than the second feature. "Below," "below," and "under" the second feature can mean that the first feature is directly below or diagonally below the second feature, or simply that the first feature is at a lower horizontal level than the second feature.
Claims
1. A velocity prediction method based on a fluid velocity prediction model, characterized in that, include: S1. Data Acquisition: Acquire multi-source time-series flow field data and divide it into training and test sets; S2. Data preprocessing: Normalize the training set and test set respectively to obtain the preprocessed training set and test set; A metadata matrix is constructed, which stores the true values of auxiliary features of the multi-source time-series data; S3. Fluid velocity prediction model construction: Construct a cascaded architecture of a two-layer long short-term memory network combined with a fully connected layer, and introduce an activation function into the fully connected layer to obtain a fluid velocity prediction model; S4. Training and Validation: The preprocessed training set is input into the fluid velocity prediction model for training to obtain the trained fluid velocity prediction model. The inverse transformation matrix is reconstructed using the true values of the auxiliary features in the metadata matrix to validate the trained fluid velocity prediction model. The inverse transformation matrix is then inversely normalized to obtain the validated fluid velocity prediction model. S5. Flow velocity prediction: Input the data to be predicted into the verified fluid velocity prediction model to obtain the fluid velocity prediction value.
2. The flow velocity prediction method according to claim 1, characterized in that, The multi-source time series data is divided using a time-order partitioning method: the first 80% of the multi-source time series data is divided into a training set and the last 20% into a test set according to time order.
3. The flow velocity prediction method according to claim 1, characterized in that, The multi-source time-series data includes flow rate, temperature, and pressure.
4. The flow velocity prediction method according to claim 1, characterized in that, The data preprocessing also includes generating the input sequence of the two-layer long short-term memory network through a sliding window, fusing the multi-source time series data to obtain a three-dimensional tensor, wherein the three-dimensional tensor is represented as the number of samples × time step × number of features, wherein the number of samples represents the number of samples generated by the sliding window, the time step is set to 50, indicating that each sample contains 50 consecutive historical time points, and the number of features is 3, corresponding to flow rate, temperature and pressure respectively.
5. The flow velocity prediction method according to claim 1, characterized in that, The metadata matrix includes time coordinates, temperature, and pressure, and the dimensions of the metadata matrix correspond one-to-one with the multi-source time-series data.
6. The flow velocity prediction method according to claim 1, characterized in that, The basic relationship of the inverse transformation is: the original value is equal to the normalized value multiplied by the difference between the maximum and minimum values of the corresponding variable in the training set, plus the minimum value of the corresponding variable in the training set.
7. The flow velocity prediction method according to claim 1, characterized in that, The cascaded architecture consists of a first layer with 64 hidden units for capturing local temporal patterns and a second layer with 32 hidden units for extracting global dependencies.
8. The flow velocity prediction method according to claim 1, characterized in that, The activation function used is the ReLU activation function.
9. The flow velocity prediction method according to claim 1, characterized in that, In S4, the early stopping method is used to dynamically control the training process, and the Adam optimizer is used to adaptively adjust the learning rate to prevent overfitting.
10. The flow velocity prediction method according to claim 1, characterized in that, During the verification process of the fluid velocity prediction model, the mean square error and root mean square error are used to evaluate the performance of the fluid velocity prediction model, and the consistency of the trend is verified by comparing the predicted values with the actual values.