Method for measuring oil-water two-phase flow parameters of oil well based on multi-element time series prediction model of cross-dimension dependence
By constructing a multivariate time-series prediction model with cross-dimensional dependence, the problem of measuring water cut in low-flow-rate oil wells with two-phase oil-water flow was solved, achieving high-precision and low-complexity water cut prediction.
Patent Information
- Application Number
- CN202411993053.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-31
- Publication Date
- 2025-10-17
- Estimated Expiration
- 2044-12-31
AI Technical Summary
Existing technologies struggle to accurately measure the water cut of oil-water two-phase flows in oil wells with low flow rates and high water content, especially at low flow rates where the complex flow patterns of the oil-water medium lead to reduced measurement resolution.
A multivariate time series prediction model based on cross-dimensional dependence is adopted, including a dimension segmentation embedding module, a cross-time and cross-dimensional attention calculation module, a routing mechanism module, and a feedforward neural network. By processing the amplitude voltage signal and phase voltage signal of the microwave sensor, a multivariate time series prediction model is constructed, which reduces the amount of computation and improves the prediction accuracy.
It achieves high-precision prediction of water cut in two-phase flow of oil and water in oil wells, reduces computational complexity, and improves the accuracy and reliability of measurement.
Smart Images

Figure CN119886448B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the field of oil well production dynamic monitoring, and particularly relates to an oil well oil-water two-phase flow parameter measurement method based on a multi-element time series prediction model with cross-dimension dependence. BACKGROUND
[0002] Oil-water two-phase flow widely exists in the development and production process of oilfields and is closely related to economic development and technological progress. Accurate measurement of the parameters of oil-water two-phase flow, especially accurate measurement of water cut, is crucial for improving production efficiency and saving resources. In recent years, many methods for measuring water cut have been developed, and the currently widely used methods are the electric conductivity method and the electric capacity method. The electric conductivity sensor and the electric capacity sensor usually use low-frequency signals as excitation sources, resulting in a close relationship between the sensor electric field distribution and its structure, that is, the sensitivity is higher in the electrode vicinity, but as the total flow rate of the two phases increases, the measurement resolution decreases. The microwave method is widely studied and applied in the fields of oil-water two-phase flow phase content and flow parameter measurement due to its non-contact, sensitivity to water molecules, wide measurement range, and good reliability.
[0003] Due to long-term water injection development in China's oilfields, some oil wells exhibit low flow rate and high water cut production characteristics. The oil-water two-phase flow under low flow rate is affected by the slip effect, and the flow rate of the oil-water medium exhibits nonlinear and complex flow pattern characteristics, increasing the difficulty of water cut measurement. Further in-depth study of the water cut measurement of oil well oil-water two-phase flow can optimize the production process of oil wells, reduce operating costs, and efficiently manage oilfield resources, which is of great significance.
[0004] With the introduction of soft measurement methods, two-phase flow measurement technology has been greatly promoted, especially the continuous progress in the field of deep learning, which further expands the application of multiphase flow soft measurement models. For water cut measurement of low flow rate and high water cut oil-water two-phase flow, it is essentially a complex nonlinear solving process, so it is particularly necessary to introduce neural network-based algorithms to solve this problem. Through soft measurement technology, multi-dimensional data obtained by the sensor can be fused to more accurately and efficiently extract feature information of multiphase flow. SUMMARY
[0005] In view of the deficiencies of the prior art, the purpose of the present application is to provide a multi-element time series prediction model with cross-dimension dependence, and another purpose of the present application is to provide an oil well oil-water two-phase flow parameter measurement method based on a multi-element time series prediction model with cross-dimension dependence.
[0006] The purpose of the present application is achieved by the following technical solutions.
[0007] A multivariate time series prediction model based on cross-dimensional dependencies comprises: a sequentially connected dimensional segmentation embedding module, a cross-temporal attention calculation module, a routing mechanism module, a cross-dimensional attention calculation module, and a feedforward neural network. The dimensional segmentation embedding module inputs samples and outputs patch embedding features. The dimensional segmentation embedding module is used to sequentially perform patch segmentation, linear projection, and patch enhancement.
[0008] Among them, patch segmentation is to use the sliding window method to perform non-overlapping segmentation on the sample to obtain N = T / P patches of length P. N patches form a vector array X, where T is the sample length, P is the patch length, and N is the number of patches;
[0009] Linear projection is to linearly project each patch in the vector array X into a unified feature space, obtaining N transformed patches and forming a vector array Y;
[0010] Patch enhancement is used to add position encoding to each transformed patch in the vector array Y, obtaining N patch embedding features and forming the vector array Z;
[0011] The samples include normalized amplitude voltage signals and normalized phase voltage signals. The normalized amplitude voltage signals are obtained by normalizing the amplitude voltage signals, and the normalized phase voltage signals are obtained by normalizing the phase voltage signals. The amplitude voltage signals and the phase voltage signals are acquired from the oil-water two-phase fluid in the oil well during the same time period.
[0012] The input of the cross-temporal attention calculation module is the vector array Z, and the output is the vector array Z′. The cross-temporal attention calculation module uses the self-attention mechanism to perform attention calculation on the different patch embedding features in the vector array Z, obtains the cross-temporal patch embedding features and forms the vector array Z′;
[0013] The input of the routing mechanism module is the vector array Z′ and the output is three routers. The routing mechanism module selects the Sth cross-temporal patch embedding feature, the 2Sth cross-temporal patch embedding feature and the 3Sth cross-temporal patch embedding feature in the vector array Z′, and uses each of the three cross-temporal patch embedding features selected by the routing mechanism module as a router.
[0014] The input of the cross-dimensional attention calculation module is three routers and a vector array Z′, and the output is three router features that form a vector array Z″. The cross-dimensional attention calculation module uses a self-attention mechanism to perform attention calculation on the three routers and the vector array Z′.
[0015] The input of the feedforward neural network is the vector array Z″, and the output is the water cut prediction value of the oil-water two-phase flow in the oil well. The feedforward neural network includes: input layer, dropout layer, hidden layer, dropout layer, and output layer.
[0016] In the multivariate time series prediction model based on cross-dimensional dependency, N=30, and P=100.
[0017] In the multivariate time series prediction model based on cross-dimensional dependency, the dimension of the vector array Z' is 30*256.
[0018] In the multivariate time series prediction model based on cross-dimensional dependency, the dimension of each router is 1*256, and 1
[0019] In the multivariate time series prediction model based on cross-dimensional dependency, the dimension of the vector array Z'' is 3*256.
[0020] In the multivariate time series prediction model based on cross-dimensional dependency, the number of neurons in the input layer of the feedforward neural network is 768, the number of neurons in the hidden layer is 128, the number of neurons in the output layer is 1, the dropout rate of the Dropout layer is 0.2, and the activation function of the feedforward neural network is ReLU.
[0021] A multivariate time series prediction model based on cross-dimensional dependency is provided.
[0022] The test set is input into the trained multivariate time series prediction model based on cross-dimensional dependency to obtain a water cut prediction value corresponding to each sample in the test set.
[0023] In the method for measuring oil-water two-phase flow parameters of an oil well, the method for obtaining the trained multivariate time series prediction model based on cross-dimensional dependency comprises the following steps: inputting a training set into the multivariate time series prediction model based on cross-dimensional dependency for training, calculating a loss function value according to a water cut prediction value and a water cut true value, training samples of each batch of training sets, inputting a verification set into the multivariate time series prediction model based on cross-dimensional dependency for water cut prediction after each training round, and calculating whether the loss function value decreases; if the loss function value of the verification set does not improve for 10 consecutive rounds, an early stopping mechanism is triggered, the training is terminated, and the parameters with the best performance of the verification set are saved as the trained multivariate time series prediction model based on cross-dimensional dependency.
[0024] In the method for measuring oil-water two-phase flow parameters of an oil well, the maximum number of training rounds is 200, the loss function value is a mean square error function, the initial learning rate is 0.0001, and a cosine annealing scheduler is used for learning rate scheduling.
[0025] The present application has the following advantages due to the above technical solutions.
[0026] 1. The oil well oil-water two-phase flow parameter measurement method of the present application is aimed at the response law of the amplitude voltage signal and the phase voltage signal of the microwave sensor under different working conditions, a multivariate time series prediction model based on cross-dimensional dependence is constructed, and the water cut prediction of the oil well oil-water two-phase flow is realized.
[0027] 2. The routing mechanism module in the multivariate time series prediction model of the present application reduces the computational complexity and greatly reduces the complexity.
[0028] 3. The multivariate time series prediction model of the present application obtains aggregated information through the cross-time attention calculation module and the cross-dimensional attention calculation module, and improves the prediction accuracy of the multivariate time series prediction model. BRIEF DESCRIPTION OF DRAWINGS
[0029] Figure 1 The structure diagram of the multivariate time series prediction model based on cross-dimensional dependence of the present application. DETAILED DESCRIPTION
[0030] The oil well oil-water two-phase flow parameter measurement method of the cross-dimensional dependence multivariate time series prediction model of the present application will be described in detail below with reference to the accompanying drawings.
[0031] Example 1
[0032] As shown in Figure 1 A multivariate time series prediction model based on cross-dimensional dependence includes dimension segmentation embedding modules, cross-time attention calculation modules, routing mechanism modules, cross-dimensional attention calculation modules and feedforward neural networks connected in turn, wherein the input of the dimension segmentation embedding module is a sample and the output is a patch embedding feature, the dimension segmentation embedding module is used for patch segmentation, linear projection and patch enhancement in turn, wherein the sample includes a normalized amplitude voltage signal and a normalized phase voltage signal, the normalized amplitude voltage signal is obtained by normalizing the amplitude voltage signal, the normalized phase voltage signal is obtained by normalizing the phase voltage signal, and the amplitude voltage signal and the phase voltage signal are obtained by collecting the oil-water two-phase flow in the same time period.
[0033] Among them, the patch segmentation is to divide the sample without overlap by using the sliding window method to obtain N=T / P patches with length P, and N patches form a vector array X, T is the length of the sample;
[0034] Linear projection is to linearly project each patch in the vector array X into a unified feature space to obtain N transformed patches and form a vector array Y, wherein the dimension of the feature space is D, and in this embodiment D=256;
[0035] The patch augmentation is used to add position encoding to each transformed patch in the vector array Y, that is, to provide each transformed patch with information about its position in the sample, to obtain N patch embedding features and form a vector array Z, and each patch embedding feature retains the local dynamic change of the sample and the time sequence information of the patch embedding feature.
[0036] In the formula, the dimension of the sample is TxC, the sample length is T=3000, the feature dimension C=2, that is, the two dimensions of the normalized phase voltage signal and the normalized amplitude voltage signal, the dimension of the vector array X is Nx(CxP), N=30 is the number of patches, P is the patch length, P=100, the dimension of the vector array Y is 30x256, and the dimension of the vector array Z is 30x256.
[0037] The input of the cross-time attention calculation module is the vector array Z, and the output is a vector array Z'. The cross-time attention calculation module uses a self-attention mechanism (Vaswani A. Attention is all you need [J]. Advances in Neural Information Processing Systems, 2017.) to perform attention calculation on different patch embedding features in the vector array Z, to obtain cross-time patch embedding features and form a vector array Z', and the dimension of the vector array Z' is 30xD.
[0038] In the formula, the cross-time attention calculation module is used to measure the correlation and weight between different patches, to strengthen the transmission of time information, and to capture the long-term dependence relationship in the sample. The cross-time attention calculation module effectively aggregates the time information of different patch embedding features through the self-attention mechanism, strengthens the long-term time dependence features of different patch embedding features, and enables the multivariate time series prediction model to better learn the dynamic change and trend in the sample.
[0039] The input of the routing mechanism module is the vector array Z', and the output is three routers. The routing mechanism module is used to reduce the calculation complexity. The routing mechanism module selects the Sth cross-time patch embedding feature, the 2Sth cross-time patch embedding feature and the 3Sth cross-time patch embedding feature in the vector array Z', and makes the three cross-time patch embedding features selected by the routing mechanism module each serve as a router. The three routers are all learnable, and the dimension of each router is 1x256. The routing mechanism module reduces the calculation complexity of the following cross-dimension attention calculation module, wherein 1≤S<N, and in this embodiment, S=10.
[0040] The input of the cross-dimensional attention calculation module is the three routers and the vector array Z', and the output is the three router features and constitutes the vector array Z''. The cross-dimensional attention calculation module adopts a self-attention mechanism (Vaswani A. Attention is all you need [J]. Advances in Neural Information Processing Systems, 2017.) to perform attention calculation on the three routers and the vector array Z' to obtain the three router features, so that each router feature contains independent features of each dimension and cross-dimensional interaction features. The vector array Z'' contains dynamic information between different time steps and interaction characteristics between dimensions. Among them, the dimension of the vector array Z'' is 3x256, and the cross-dimensional attention calculation module aggregates the feature information of different routers through the self-attention mechanism, thereby capturing the potential association of different routers. The router acts as an "information filter", so that the cross-dimensional attention calculation module adaptively focuses on the most important features in different dimensions for the task and ignores irrelevant or redundant information.
[0041] The input of the feedforward neural network is the vector array Z'', and the output is the water cut prediction value of the oil-water two-phase flow of the oil well. The feedforward neural network includes an input layer, a Dropout layer, a hidden layer, a Dropout layer, and an output layer connected in sequence. The number of neurons in the input layer is 768, the number of neurons in the hidden layer is 128, and the number of neurons in the output layer is 1. The dropout rate of the Dropout layer is 0.2. The activation function of the feedforward neural network is ReLU (Agarap A F. Deep learning using rectified linear units (relu) [J]. arXiv preprint arXiv:1803.08375, 2018.). Among them, the feedforward neural network is used to enhance the nonlinear modeling capability, the output layer is used to output the water cut prediction value of the oil-water two-phase flow of the oil well, and the Dropout layer is used to prevent overfitting.
[0042] Embodiment 2
[0043] A method for obtaining a fluid data set, comprising:
[0044] The amplitude voltage signal and the phase voltage signal are obtained by a microwave sensor installed on the oil well pipe, and the working frequency of the microwave sensor is set to 1.2 GHz. Among them, the microwave sensor can be used by a corresponding microwave sensor, for example, the microwave sensor can use the double-helix microwave sensor in CN202311628606.5.
[0045] The sampling frequency of the microwave sensor is 1 kHz, and the amplitude voltage signal and the phase voltage signal within 1 hour are collected every 12 hours, and the amplitude voltage signal and the phase voltage signal within 12 hours are collected.
[0046] The amplitude voltage signal and the phase voltage signal within 12 hours are normalized to obtain normalized amplitude voltage signals and normalized phase voltage signals, and the normalized amplitude voltage signals and the normalized phase voltage signals are non-overlappingly segmented using a sliding window, the length of the sliding window is 3000, 14400 samples are obtained and form a fluid data set;
[0047] When the microwave sensor collects the amplitude voltage signal and the phase voltage signal, the oil-water two-phase flow of the oil well is artificially sampled and artificially tested, and the test value obtained is used as the true value of the water cut corresponding to the sample, wherein the length of each sample in the fluid data set is T=3000, the dimension of each sample is TxC, and the feature dimension C=2, that is, the normalized amplitude voltage signal and the normalized phase voltage signal have two dimensions.
[0048] The fluid data set is divided into a training set, a validation set and a test set according to a ratio of 7:2:1.
[0049] Example 3
[0050] A training method of a multivariate time series prediction model based on cross-dimensional dependence, comprising:
[0051] The training set in Example 2 is input into the multivariate time series prediction model based on cross-dimensional dependence in Example 1 for training, the loss function value is calculated according to the prediction result, 32 samples of each batch of training set are trained for 200 rounds, and after each training round, the validation set in Example 2 is input into the multivariate time series prediction model for water cut prediction, and whether the loss function value decreases is calculated: if the loss function value of the validation set does not improve for 10 consecutive rounds, an early stopping mechanism is triggered, the training is terminated, and the parameters with the best performance of the validation set are saved as the trained multivariate time series prediction model.
[0052] The loss function value is calculated using the mean square error function MSE.
[0053] The hyperparameters are set as follows: the initial learning rate is 0.0001, the learning rate scheduling is using a cosine annealing scheduler (Liu G, Chen S, Li Y, et al. High-voltage power equipment target detection method based on SGD and cosine annealing algorithm improved YOLOv3 [J]. Journal of Donghua University (Natural Science Edition), 2024, 47(03): 294-300.), and the learning rate is gradually reduced according to the training rounds.
[0054] Example 4
[0055] A method for measuring parameters of oil-water two-phase flow in an oil well based on a multi-element time series prediction model with cross-dimensional dependency, comprising:
[0056] The test set in Example 2 is input into the multi-element time series prediction model with cross-dimensional dependency trained in Example 3 to obtain the water cut prediction value corresponding to each sample in the test set, and the mean square error MSE, the mean absolute error MAE, the mean absolute percentage error MAPE and the determination coefficient R 2 to comprehensively evaluate the performance of the multi-element time series prediction model with cross-dimensional dependency trained.
[0057] Example 5
[0058] A method for measuring water cut of oil-water two-phase flow in an oil well, which is basically the same as Example 4, the only difference is that the patch length is set to 50.
[0059] Example 6
[0060] A method for measuring water cut of oil-water two-phase flow in an oil well, which is basically the same as Example 4, the only difference is that the patch length is set to 300.
[0061] Example 7
[0062] A method for measuring water cut of oil-water two-phase flow in an oil well, which is basically the same as Example 4, the only difference is that the routing mechanism module is deleted, the vector array Z' output by the cross-time attention calculation module is used as the input of the feedforward neural network, and the number of neurons in the input layer of the feedforward neural network is replaced by 7680.
[0063] The mean square error MSE, the mean absolute error MAE, the mean absolute percentage error MAPE and the determination coefficient R 2 The four statistical indicators are used to evaluate the performance of the multi-element time series prediction model with cross-dimensional dependency trained.
[0064] Table 1
[0065] Model MSE MAE MAPE R Example 7 0.00312 0.0655 3.09% 92.9% Example 6 0.00409 0.0583 2.65% 94.3% Example 5 0.00368 0.0687 5.29% 90.5% Example 4 0.00257 0.0416 1.63% 96.6%
[0066] As shown in Table 1, the method for measuring water cut of oil-water two-phase flow in an oil well based on the multi-element time series prediction model with cross-dimensional dependency improves the reliability and accuracy of water cut prediction by using the multi-element time series prediction model with cross-dimensional dependency. The multi-element time series prediction model with cross-dimensional dependency uses the cross-time attention calculation module and the cross-dimensional attention calculation module to efficiently obtain the cross-time and cross-dimensional dependencies, and introduces the routing mechanism module to enhance the modeling ability of the model for complex time series data, avoid high complexity, and reduce the computational amount.
[0067] The above has made the exemplary description to the present application, should indicate that, in not departing from the core of the present application, any simple change, modification or other field technicians can not spend the equivalent replacement of creative labor falls into the protection scope of the present application.
Claims
1. A multivariate time series prediction model based on cross-dimensional dependencies, characterized by: include: The dimensional segmentation embedding module, the cross-temporal attention calculation module, the routing mechanism module, the cross-dimensional attention calculation module and the feedforward neural network are connected in sequence. The input of the dimensional segmentation embedding module is the sample and the output is the patch embedding feature. The dimensional segmentation embedding module is used to perform patch segmentation, linear projection and patch enhancement in sequence. Among them, patch segmentation is to use the sliding window method to perform non-overlapping segmentation on the sample to obtain N = T / P patches of length P. N patches form a vector array X, where T is the sample length, P is the patch length, and N is the number of patches; Linear projection is to linearly project each patch in the vector array X into a unified feature space, obtaining N transformed patches and forming a vector array Y; Patch enhancement is used to add position encoding to each transformed patch in the vector array Y, obtaining N patch embedding features and forming the vector array Z; The samples include normalized amplitude voltage signals and normalized phase voltage signals. The normalized amplitude voltage signals are obtained by normalizing the amplitude voltage signals, and the normalized phase voltage signals are obtained by normalizing the phase voltage signals. The amplitude voltage signals and the phase voltage signals are acquired from the oil-water two-phase fluid in the oil well during the same time period. The input of the cross-temporal attention calculation module is the vector array Z, and the output is the vector array Z′. The cross-temporal attention calculation module uses the self-attention mechanism to perform attention calculation on the different patch embedding features in the vector array Z, obtains the cross-temporal patch embedding features and forms the vector array Z′; The input of the routing mechanism module is the vector array Z′ and the output is three routers. The routing mechanism module selects the Sth cross-temporal patch embedding feature, the 2Sth cross-temporal patch embedding feature and the 3Sth cross-temporal patch embedding feature in the vector array Z′, and uses each of the three cross-temporal patch embedding features selected by the routing mechanism module as a router. The input of the cross-dimensional attention calculation module is three routers and a vector array Z′, and the output is three router features that form a vector array Z″. The cross-dimensional attention calculation module uses a self-attention mechanism to perform attention calculation on the three routers and the vector array Z′. The input of the feedforward neural network is the vector array Z″, and the output is the water cut prediction value of the oil-water two-phase flow in the oil well. The feedforward neural network includes: input layer, dropout layer, hidden layer, dropout layer, and output layer.
2. The multivariate time series prediction model according to claim 1, characterized in that N=30, P=100.
3. The multivariate time series prediction model according to claim 1, characterized in that The dimension of the vector array Z′ is 30×256.
4. The multivariate time series prediction model according to claim 1, characterized in that The dimension of each router is 1×256, 1≤S <N。 5. The multivariate time series prediction model according to claim 1, characterized in that The dimension of the vector array Z″ is 3×256.
6. The multivariate time series prediction model according to claim 1, characterized in that: The number of neurons in the input layer of the feedforward neural network is 768, the number of neurons in the hidden layer is 128, the number of neurons in the output layer is 1, the dropout rate of the Dropout layer is 0.2, and the activation function of the feedforward neural network is ReLU.
7. A method for measuring oil-water two-phase flow parameters in oil wells based on a multivariate time series prediction model with cross-dimensional dependencies, characterized in that: include: The test set is input into the trained multivariate time series prediction model based on cross-dimensional dependency described in any one of claims 1 to 6 to obtain the moisture content prediction value corresponding to each sample in the test set.
8. The method for measuring oil-water two-phase flow parameters in an oil well according to claim 7, characterized in that: A method for obtaining a trained multivariate time series prediction model based on cross-dimensional dependency includes: inputting a training set into the multivariate time series prediction model based on cross-dimensional dependency for training, calculating a loss function value based on a moisture content prediction value and a true moisture content value, training samples of each batch of training sets, and after each training round, inputting a validation set into the multivariate time series prediction model based on cross-dimensional dependency for moisture content prediction, and calculating whether the loss function value decreases: if the loss function value of the validation set does not improve within 10 consecutive rounds, triggering an early stopping mechanism, terminating the training, and saving the best-performing parameters of the validation set as the trained multivariate time series prediction model based on cross-dimensional dependency.
9. The method for measuring parameters of oil-water two-phase flow in an oil well according to claim 8, characterized in that: The maximum number of training rounds is 200, and the loss function value is the mean square error function.
10. The method for measuring oil-water two-phase flow parameters in an oil well according to claim 8, characterized in that: The initial learning rate is 0.0001, and the learning rate scheduler uses the cosine annealing scheduler.
Citation Information
Patent Citations
Device for measuring water content of oil-water two-phase flow of oil well and soft measurement method
CN117630051A
Cross-dimension multivariate time sequence prediction method and system
CN116933207A
Multivariable time sequence prediction method based on spatio-temporal embedding independence
CN118446356A