Method for measuring oil-water two-phase flow parameters of oil well

By applying a multi-scale patch embedded in the Transformer model in the oil-water two-phase flow measurement of oil-water wells, the error and stability problems of moisture content measurement under low flow velocity and high water content are solved, and high-precision moisture content prediction is achieved.

CN119889513AActive Publication Date: 2025-04-25TIANJIN UNIV +1
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
CN202411993057.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-31
Publication Date
2025-04-25
Estimated Expiration
2044-12-31

AI Technical Summary

Technical Problem

In the prior art, when measuring the moisture content of oil and water in the two-phase flow of oil and water in the oil well, especially under low flow velocity and high water content, there are measurement errors and stability problems, which are difficult to accurately reflect resource utilization and production optimization during oil well mining.

Method used

A multivariate timing prediction model based on multi-scale patch embedded in Transformer is adopted. Multi-scale feature extraction module is used to extract the amplitude voltage signal and phase voltage signal through the feature extraction module, and combined with the improved Transformer encoder and time reduction attention mechanism to predict moisture content.

Benefits of technology

Effectively capture short-term changes and long-term trends in the time series, improve the accuracy and reliability of moisture content prediction, and is suitable for complex oil-water two-phase flow conditions in oil wells.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119889513A_ABST
    Figure CN119889513A_ABST
Patent Text Reader

Abstract

The invention discloses an oil well oil-water two-phase flow parameter measurement method, which comprises the following steps: obtaining a plurality of samples to form a test set, each sample comprising an amplitude voltage signal and a phase voltage signal, inputting the test set into a trained multi-scale patch embedding transformer-based multivariate time sequence prediction model, and obtaining a water content prediction value corresponding to each sample. The multivariate time sequence prediction model based on the multi-scale patch embedding transformer comprises a first feature extraction module, a second feature extraction module, a third feature extraction module and a pooling layer which are connected in sequence. According to the oil well oil-water two-phase flow parameter measurement method, high-precision prediction of the water content of the oil well oil-water two-phase fluid is achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the technical field of dynamic monitoring of oil well exploitation, and in particular relates to a method for measuring parameters of oil-water two-phase flow in an oil well. Background Art

[0002] Oil-water two-phase flow is widely present in the development and production process of oil fields. Oil-water two-phase flow is closely related to economic development and scientific and technological progress. Accurately measuring its water content is crucial to improving recovery efficiency, resource utilization and production optimization. However, traditional measurement methods, such as conductivity and capacitance methods, face challenges in accuracy and stability under complex working conditions. Conductivity and capacitance methods usually use low-frequency signals, and their sensitivity is affected by flow velocity and electrode position, resulting in measurement errors under high flow velocity and high water content conditions. The microwave method is widely used in fields such as oil-water two-phase flow phase content and flow parameter measurement due to its non-contact, wide measurement range, sensitivity to water molecules, and good reliability.

[0003] Due to the long-term water injection development of my country's oil fields, some oil wells show the production characteristics of low flow rate and high water content. The oil-water two-phase flow at low flow rate is affected by the slip effect, and the flow rate of the oil-water medium shows nonlinear characteristics and complex flow morphology, which increases the difficulty of measuring water content. Further in-depth research on the measurement of water content of oil-water two-phase flow in oil wells 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 has further expanded the application of multiphase flow soft measurement models. Measuring the water content of oil-water two-phase flow with low flow rate and high water content is essentially a complex nonlinear solution process, so it is particularly necessary to introduce a neural network-based algorithm to solve this problem. The dynamic characteristics of oil-water two-phase flow are complex. The microwave signal is not only affected by local dynamic characteristics such as oil-water interface disturbance and turbulence, but also reflects the global trend, such as the change of water content with time, flow rate and pressure. Through soft measurement technology, the multi-dimensional data obtained by the sensor can be represented in multiple scales, so as to extract the characteristic information of multiphase flow more accurately and efficiently.

[0005] Therefore, there is an urgent need for a method for measuring oil-water two-phase flow parameters in oil wells that combines microwave signals, soft measurement technology and neural networks. Summary of the invention

[0006] In view of the deficiencies of the prior art, the object of the present invention is to provide a multivariate time series prediction model based on multi-scale patch embedding transformer.

[0007] Another object of the present invention is to provide a method for measuring oil-water two-phase flow parameters in an oil well.

[0008] The purpose of the present invention is achieved through the following technical solutions.

[0009] A multivariate time series prediction model based on a multi-scale patch embedding transformer comprises: a first feature extraction module, a second feature extraction module, a third feature extraction module and a pooling layer connected in sequence, wherein the first feature extraction module, the second feature extraction module and the third feature extraction module are feature extraction modules respectively;

[0010] Each feature extraction module includes: a patch embedding module and an improved Transformer encoder; the patch embedding module input is an input signal and outputs a plurality of patch embedding features, and the improved Transformer encoder input is a patch embedding feature and outputs a fusion feature;

[0011] The input signal of the patch embedding module in the first feature extraction module is the amplitude voltage signal and the phase voltage signal, and the patch embedding feature output by the patch embedding module in the first feature extraction module is the first scale patch embedding feature; the fusion feature output by the improved Transformer encoder in the first feature extraction module is X1;

[0012] The input signal of the patch embedding module in the second feature extraction module is X1, the patch embedding feature output by the patch embedding module in the second feature extraction module is the second-scale patch embedding feature, and the fusion feature output by the improved Transformer encoder in the second feature extraction module is X2;

[0013] The input signal of the patch embedding module in the third feature extraction module is X2, the patch embedding feature output by the patch embedding module in the second feature extraction module is the third-scale patch embedding feature, and the fusion feature output by the improved Transformer encoder in the second feature extraction module is X3;

[0014] The pooling layer uses the average pooling operation to average pool the fused feature X3 and output the moisture content prediction value;

[0015] The amplitude voltage signal and the phase voltage signal are acquired by collecting the oil-water two-phase fluid in the oil well in the same time period.

[0016] In the above multivariate time series prediction model, the patch embedding module in the feature extraction module performs normalization, sliding window segmentation, linear projection and position encoding on the input signal in sequence to obtain multiple patch embedding features; the sliding window segmentation in the patch embedding module uses the sliding window method to perform non-overlapping segmentation on the input signal to obtain The method uses linear projection to project all patches obtained by segmenting the sliding window into a high-dimensional space. Position encoding is used to add corresponding position encoding to each patch to obtain multiple patch embedding features.

[0017] In the above multivariate time series prediction model, the dimension of the high-dimensional space is D=512.

[0018] In the above multivariate time series prediction model, the input of the improved Transformer encoder is all the patch embedding features output by the patch embedding module. The calculation process of the improved Transformer encoder includes steps 1 to 3:

[0019] Step 1: Use a multi-head self-attention mechanism to calculate each patch embedding feature to obtain a query Q, key K and value V, where each patch embedding feature corresponds to a set of query Q, key K and value V;

[0020] Step 2, using the time-reduced attention mechanism to sequentially downsample the keys K and values ​​V of all patch embedding features, and according to the query Q of all patch embedding features obtained in step 1, the downsampled keys K and the downsampled values ​​V, calculate the inner product corresponding to each patch embedding feature, and update the calculated inner product to the corresponding patch embedding feature to obtain multiple first patch embedding features;

[0021] Step 3: input all first patch embedding features into a feedforward neural network and output weighted features through the feedforward neural network, and weight the weighted features and multiple first patch embedding features to obtain fused features.

[0022] In the above multivariate time series prediction model, the patch length P in the first feature extraction module is P1, P1=500, the dimension of the first-scale patch embedding feature is N1×D, N1 is the number of patches obtained by the patch embedding module in the first feature extraction module, and the structure of the feedforward neural network in the improved Transformer encoder in the first feature extraction module is a single-layer fully connected layer.

[0023] In the above-mentioned multivariate time series prediction model, the patch length P in the second feature extraction module is P2, P2=200, the dimension of the second-scale patch embedding feature is N2×D, N2 is the number of patches obtained by the patch embedding module in the second feature extraction module, and the structure of the feedforward neural network in the improved Transformer encoder in the second feature extraction module is a single-layer fully connected layer.

[0024] In the above multivariate time series prediction model, the patch length P in the third feature extraction module is P3, P3=50, the dimension of the third scale patch embedding feature is N3×D, N3 is the number of patches obtained by the patch embedding module in the third feature extraction module, the dimension of X3 is T, and the structure of the feedforward neural network in the improved Transformer encoder includes an input layer, a first hidden layer, a second hidden layer and an output layer connected in sequence, and the number of neurons in the input layer, the first hidden layer, the second hidden layer and the output layer are N3×D, 10240, 6400 and T respectively.

[0025] A method for measuring parameters of oil-water two-phase flow in an oil well, comprising:

[0026] The test set is input into the trained multivariate time series prediction model based on multi-scale patch embedding transformer to obtain the moisture content prediction value corresponding to each sample in the test set.

[0027] In the above-mentioned oil-water two-phase flow parameter measurement method of an oil well, a method for obtaining a trained multivariate time series prediction model based on a multiscale patch embedded transformer includes: inputting the training set into the multivariate time series prediction model based on a multiscale patch embedded transformer for training, calculating the loss function value according to the water cut prediction value and the water cut true value, training each batch of samples of the training set, and after each training round, inputting the verification set into the multivariate time series prediction model based on a multiscale patch embedded transformer for water cut prediction, and calculating whether the loss function value decreases: if the loss function value of the verification set does not improve within 10 consecutive rounds, the early stopping mechanism is triggered to terminate the training, and the best performing parameters of the verification set are saved as the trained multivariate time series prediction model based on a multiscale patch embedded transformer.

[0028] In the above-mentioned oil-water two-phase flow parameter measurement method of oil wells, the maximum training round is 200, the loss function value is the mean square error function, the initial learning rate is 0.0001, and the learning rate scheduling uses the cosine annealing scheduler.

[0029] Compared with the prior art, the present invention has the following beneficial effects:

[0030] 1. The multivariate time series prediction model based on multi-scale patch embedding transformer of the present invention adopts the first feature extraction module, the second feature extraction module, and the third feature extraction module to extract features of the multivariate time series at three different time scales in turn, and gradually aggregates the features at different time scales. The features are global and local features with multi-scale characteristics. The features are processed by average pooling to obtain the moisture content prediction value. The multivariate time series prediction model based on multi-scale patch embedding transformer effectively captures the short-term changes and long-term trends in the time series, and finally obtains the moisture content prediction result with high prediction accuracy.

[0031] 2. The multivariate time series prediction model based on multi-scale patch embedding transformer of the present invention adopts an improved Transformer encoder and introduces a time reduction attention mechanism in the Transformer encoder, which reduces the amount of calculation while maintaining the ability to capture the global situation, so that the multivariate time series prediction model based on multi-scale patch embedding transformer of the present invention can process longer time series more efficiently and enhance its modeling ability for complex time series data. BRIEF DESCRIPTION OF THE DRAWINGS

[0032] Figure 1 Schematic diagram of a multivariate time series prediction model based on multi-scale patch embedding transformer. DETAILED DESCRIPTION

[0033] The method for measuring parameters of oil-water two-phase flow in an oil well of the present invention is described in detail below with reference to the accompanying drawings.

[0034] Example 1

[0035] A feature extraction module includes: a patch embedding module and an improved Transformer encoder. The patch embedding module performs normalization (Liu Z, Cheng M, Li Z, et al. Adaptive normalization for non-stationary time series forecasting: A temporal slice perspective [J]. Advances in Neural Information Processing Systems, 2024, 36.), sliding window segmentation, linear projection (Yang Xing, Wang Shitong, Hu Wenjun. Research on linear projection method with local structure adaptation [J]. Computer Science, 2024, 51 (S2): 637-643.) and position encoding on the input signal in sequence to obtain multiple patch embedding features.

[0036] The sliding window segmentation in the patch embedding module uses the sliding window method to perform non-overlapping segmentation on the normalized input signal to obtain A patch of length P is obtained, where the length of the sliding window is set to P and T is the length of the input signal.

[0037] Linear projection is used to project all patches obtained by sliding window segmentation into a high-dimensional space, and the dimension of each patch in the high-dimensional space is D=512.

[0038] Position coding is used to add the corresponding position coding to each patch, complete patch enhancement, and obtain multiple patch embedding features. Position coding can enhance the sequential perception of time series by the feature extraction module.

[0039] The input of the improved Transformer encoder is all the patch embedding features output by the patch embedding module, and the output of the improved Transformer encoder is the fusion feature;

[0040] The calculation process of improving the Transformer encoder includes steps 1 to 3:

[0041] Step 1: Use a multi-head self-attention mechanism (Vaswani A. Attention is all you need [J]. Advances in Neural Information Processing Systems, 2017.) to calculate each patch embedding feature to obtain the query Q, key K and value V, where each patch embedding feature corresponds to a set of query Q, key K and value V;

[0042] Step 2: Use the time-reduced attention mechanism (Cheng M, Liu Q, Liu Z, et al.Formertime: Hierarchical multi-scale representations for multivariate time series classification[C] / / Proceedings of the ACM Web Conference 2023.2023:1437-1445.) to downsample the keys K and values ​​V of all patch embedding features in turn, and calculate the inner product corresponding to each patch embedding feature according to the query Q, the downsampled key K and the downsampled value V of all patch embedding features obtained in step 1, and update the calculated inner product to the corresponding patch embedding feature to obtain multiple first patch embedding features, and the number of the first patch embedding features is the same as the number of patch embedding features output by the patch embedding module;

[0043] In step 3, all the first patch embedding features are input into the feedforward neural network (Islam S, Elmekki H, Elsebai A, et al. A comprehensive survey on applications of transformers for deep learning tasks [J]. Expert Systems with Applications, 2024, 241: 122666.) and the weighted features are output through the feedforward neural network, and the weighted features and multiple first patch embedding features are weighted to obtain fused features.

[0044] Among them, the improved Transformer encoder can capture global dependencies, and the feedforward neural network introduces nonlinear transformation through the nonlinear activation function ReLU (He J, Li L, Xu J, et al. ReLU deep neural networks and linear finiteelements[J]. arXiv preprint arXiv:1807.03973, 2018.) to enhance the feature expression ability and provide richer feature representation; the temporal reduced attention mechanism (TRA) reduces the computational complexity of the multi-head self-attention mechanism and reduces the model operation complexity.

[0045] Example 2

[0046] On the basis of Example 1, Figure 1 As shown, a multivariate time series prediction model based on a multi-scale patch embedding transformer includes: a first feature extraction module, a second feature extraction module, a third feature extraction module and a pooling layer connected in sequence, and the first feature extraction module, the second feature extraction module and the third feature extraction module are respectively the feature extraction modules in Example 1.

[0047] The input signals of the patch embedding module in the first feature extraction module are the amplitude voltage signal and the phase voltage signal. The patch embedding features output by the patch embedding module in the first feature extraction module are the first-scale patch embedding features. The dimension of the first-scale patch embedding features is N1×D, where N1 is the number of patches obtained by the patch embedding module in the first feature extraction module. The fused features output by the improved Transformer encoder in the first feature extraction module are X1, where the dimension of X1 is T. The structure of the feedforward neural network in the improved Transformer encoder in the first feature extraction module is a single-layer fully connected layer.

[0048] The input signal of the patch embedding module in the second feature extraction module is X1, the patch embedding feature output by the patch embedding module in the second feature extraction module is the second-scale patch embedding feature, the dimension of the second-scale patch embedding feature is N×D, and N2 is the number of patches obtained by the patch embedding module in the second feature extraction module; the fusion feature output by the improved Transformer encoder in the second feature extraction module is X2, the dimension of X2 is T, and the structure of the feedforward neural network in the improved Transformer encoder in the second feature extraction module is a single-layer fully connected layer.

[0049] The input signal of the patch embedding module in the third feature extraction module is X2, the patch embedding feature output by the patch embedding module in the third feature extraction module is the third-scale patch embedding feature, the dimension of the third-scale patch embedding feature is N×D, and N3 is the number of patches obtained by the patch embedding module in the third feature extraction module; the fusion feature output by the improved Transformer encoder in the third feature extraction module is X3, the dimension of X3 is T, and the structure of the feedforward neural network in the improved Transformer encoder in the third feature extraction module includes an input layer, a first hidden layer, a second hidden layer and an output layer connected in sequence, and the number of neurons in the input layer, the first hidden layer, the second hidden layer and the output layer are N3×D, 10240, 6400 and T respectively.

[0050] The pooling layer uses the average pooling operation to average pool the fused feature X3 and output the moisture content prediction value.

[0051] The amplitude voltage signal and the phase voltage signal are acquired by collecting the oil-water two-phase fluid in the oil well in the same time period.

[0052] The patch length P in the first feature extraction module is P1, P1=500; the patch length P in the second feature extraction module is P2, P2=200; the patch length P in the third feature extraction module is P3, P3=50.

[0053] Example 3

[0054] The amplitude voltage signal and the phase voltage signal are obtained by a microwave sensor installed in the oil well pipeline. The operating frequency of the microwave sensor is set to 1.2 GHz. The microwave sensor can use a sensor with corresponding functions. For example, the microwave sensor can use the double-helix microwave sensor in CN202311628606.5.

[0055] The sampling frequency of the microwave sensor is 1 kHz. The amplitude voltage signal and phase voltage signal within 1 hour are collected every 12 hours, for a total of 24 times.

[0056] The collected signals are segmented into time-aligned amplitude voltage signals and phase voltage signals using a sliding window without overlap. The sliding window length is 3000 and is segmented into 28800 parts, each of which is a sample. All samples constitute a fluid data set.

[0057] When the microwave sensor collects the amplitude voltage signal and the phase voltage signal, the oil-water two-phase fluid of the oil well is manually sampled and manually tested to obtain the test value. The test value corresponding to each sample is used as the true value of the water content of the sample.

[0058] The fluid dataset is divided into training set, validation set and test set in a ratio of 8:1:1.

[0059] Example 4

[0060] A training method for a multivariate time series prediction model based on a multi-scale patch embedding transformer comprises the following steps:

[0061] The training set in Example 3 is input into the multivariate time series prediction model based on multi-scale patch embedding transformer in Example 2 for training, and the loss function value is calculated according to the moisture content prediction value and the true moisture content. 200 rounds of training are performed on the 32 samples of each batch of training sets. After each training round, the verification set in Example 3 is input into the multivariate time series prediction model for moisture content prediction, and the loss function value is calculated to see whether it decreases: if the loss function value of the verification set does not improve within 10 consecutive rounds, the early stopping mechanism is triggered to terminate the training, and the best performing parameters of the verification set are saved as the trained multivariate time series prediction model.

[0062] The loss function value is calculated using the mean square error (MSE).

[0063] The hyperparameters are set as follows: initial learning rate: 0.0001, learning rate scheduling: use the cosine annealing scheduler (Tang Zhenchao, Wei Wei, Luo Weiran, et al. Remote sensing image semantic segmentation integrating cosine annealing and dilated convolution [J]. Journal of Remote Sensing, 2023, 27(11): 2579-2592.) to gradually reduce the learning rate according to the training rounds.

[0064] Example 5

[0065] A method for measuring parameters of oil-water two-phase flow in an oil well, comprising:

[0066] The test set in Example 3 is input into the multivariate time series prediction model based on multi-scale patch embedding transformer obtained in Example 4, and the moisture content prediction value corresponding to each sample in the test set is obtained. The mean square error (MSE), mean absolute error (MAE), mean absolute percentage error (MAPE) and determination coefficient (R) are calculated. 2, to comprehensively evaluate the performance of the trained multi-scale patch embedding transformer-based multivariate time series prediction model.

[0067] Example 6

[0068] A method for measuring the water content of oil-water two-phase flow in an oil well is basically the same as Example 5, with the only difference being that the improved Transformer encoder in all feature extraction modules is replaced with a transformer encoder (Islam S, Elmekki H, Elsebai A, et al. A comprehensive survey on applications of transformers for deep learning tasks [J]. Expert Systems with Applications, 2024, 241: 122666.).

[0069] Example 7

[0070] A method for measuring the water content of oil-water two-phase flow in an oil well is basically the same as Example 5, with the only difference being that the improved Transformer encoder in all feature extraction modules is replaced with a CNN-LSTM module (Zha W, Liu Y, Wan Y, et al. Forecasting monthly gas field production based on the CNN-LSTM model[J]. Energy, 2022, 260: 124889.).

[0071] The mean square error (MSE), mean absolute error (MAE), mean absolute percentage error (MAPE) and coefficient of determination (R) are used to calculate the 2 Four statistical indicators are used to evaluate the performance of the trained multivariate time series prediction model based on multi-scale patch embedding transformer. The results are as follows:

[0072] Table 1

[0073] Model MSE MAE MAPE R Example 7 0.00495 0.0775 9.86% 92.3% Example 6 0.00378 0.0534 8.93% 89.5% Example 5 0.00257 0.0416 6.29% 94.6%

[0074] As can be seen from Table 1, in the task of predicting the water cut of oil-water two-phase flow in oil wells, the trained multivariate time series prediction model based on multi-scale patch embedding transformer aggregates features at different time scales, effectively captures short-term changes and long-term trends in time series, processes longer time series more efficiently, enhances the modeling ability of complex time series, and improves the accuracy and reliability of water cut prediction.

[0075] The present invention is described above by way of example. It should be noted that, without departing from the core of the present invention, any simple deformation, modification or other equivalent replacement that can be made by those skilled in the art without inventive effort falls within the protection scope of the present invention.

Claims

1. A multivariate time series prediction model based on multi-scale patch embedding transformer, characterized in that: include: A first feature extraction module, a second feature extraction module, a third feature extraction module and a pooling layer connected in sequence, wherein the first feature extraction module, the second feature extraction module and the third feature extraction module are feature extraction modules respectively; Each feature extraction module includes: a patch embedding module and an improved Transformer encoder; the patch embedding module input is an input signal and outputs a plurality of patch embedding features, and the improved Transformer encoder input is a patch embedding feature and outputs a fusion feature; The input signal of the patch embedding module in the first feature extraction module is the amplitude voltage signal and the phase voltage signal, and the patch embedding feature output by the patch embedding module in the first feature extraction module is the first scale patch embedding feature; the fusion feature output by the improved Transformer encoder in the first feature extraction module is X1; The input signal of the patch embedding module in the second feature extraction module is X1, the patch embedding feature output by the patch embedding module in the second feature extraction module is the second-scale patch embedding feature, and the fusion feature output by the improved Transformer encoder in the second feature extraction module is X2; The input signal of the patch embedding module in the third feature extraction module is X2, the patch embedding feature output by the patch embedding module in the second feature extraction module is the third-scale patch embedding feature, and the fusion feature output by the improved Transformer encoder in the second feature extraction module is X3; The pooling layer uses the average pooling operation to average pool the fused feature X3 and output the moisture content prediction value; The amplitude voltage signal and the phase voltage signal are acquired by collecting the oil-water two-phase fluid in the oil well in the same time period.

2. The multivariate time series prediction model according to claim 1, characterized in that: The patch embedding module in the feature extraction module performs normalization, sliding window segmentation, linear projection and position encoding on the input signal in sequence to obtain multiple patch embedding features; The sliding window segmentation in the patch embedding module uses the sliding window method to perform non-overlapping segmentation on the input signal to obtain Patches of length P, where the length of the sliding window is set to P and T is the length of the input signal; linear projection is used to project all patches obtained by segmenting the sliding window into a high-dimensional space; The position encoding is used to add the corresponding position encoding in each patch to obtain multiple patch embedding features.

3. The multivariate time series prediction model according to claim 1, characterized in that: The dimension of the high-dimensional space is D=512.

4. The multivariate time series prediction model according to claim 1, characterized in that: The input of the improved Transformer encoder is all the patch embedding features output by the patch embedding module. The calculation process of the improved Transformer encoder includes steps 1 to 3: Step 1: Use a multi-head self-attention mechanism to calculate each patch embedding feature to obtain a query Q, key K and value V, where each patch embedding feature corresponds to a set of query Q, key K and value V; Step 2, using the time-reduced attention mechanism to sequentially downsample the keys K and values ​​V of all patch embedding features, and according to the query Q of all patch embedding features obtained in step 1, the downsampled keys K and the downsampled values ​​V, calculate the inner product corresponding to each patch embedding feature, and update the calculated inner product to the corresponding patch embedding feature to obtain multiple first patch embedding features; Step 3: input all first patch embedding features into a feedforward neural network and output weighted features through the feedforward neural network, and weight the weighted features and multiple first patch embedding features to obtain fused features.

5. The multivariate time series prediction model according to claim 1, characterized in that: The patch length P in the first feature extraction module is P1, P1=500, the dimension of the first-scale patch embedding feature is N1×D, N1 is the number of patches obtained by the patch embedding module in the first feature extraction module, and the structure of the feedforward neural network in the improved Transformer encoder in the first feature extraction module is a single-layer fully connected layer.

6. The multivariate time series prediction model according to claim 1, characterized in that: The patch length P in the second feature extraction module is P2, P2=200, the dimension of the second-scale patch embedding feature is N2×D, N2 is the number of patches obtained by the patch embedding module in the second feature extraction module, and the structure of the feedforward neural network in the improved Transformer encoder in the second feature extraction module is a single-layer fully connected layer.

7. The multivariate time series prediction model according to claim 1, characterized in that: The patch length P in the third feature extraction module is P3, P3=50, the dimension of the third scale patch embedding feature is N3×D, N3 is the number of patches obtained by the patch embedding module in the third feature extraction module, the dimension of X3 is T, and the structure of the feedforward neural network in the improved Transformer encoder includes an input layer, a first hidden layer, a second hidden layer and an output layer connected in sequence. The number of neurons in the input layer, the first hidden layer, the second hidden layer and the output layer are N3×D, 10240, 6400 and T respectively.

8. A method for measuring parameters of oil-water two-phase flow in an oil well, characterized in that: include: The test set is input into the trained multivariate time series prediction model based on multi-scale patch embedding transformer of any one of claims 1 to 7 to obtain the moisture content prediction value corresponding to each sample in the test set.

9. The method according to claim 8, characterized in that The method for obtaining a trained multivariate time series prediction model based on multi-scale patch embedding transformer includes: inputting a training set into the multivariate time series prediction model based on multi-scale patch embedding transformer for training, calculating a loss function value according to a moisture content prediction value and a moisture content true 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 multi-scale patch embedding transformer 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, an early stopping mechanism is triggered to terminate the training, and the best performing parameters of the validation set are saved as the trained multivariate time series prediction model based on multi-scale patch embedding transformer.

10. The method according to claim 9, characterized in that The maximum number of training rounds is 200, the loss function value is the mean square error function, the initial learning rate is 0.0001, and the learning rate scheduling 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

  • Underwater target intelligent identification method and system based on logarithm ratio adjustment

    CN117198331A

  • Method for measuring water content of oil well based on phased-array antenna microwave sensor

    CN117571748A

  • Heart image segmentation method based on hierarchical space-time Transform

    CN117893546A

  • Multi-scale patch long-term time sequence prediction method based on linear model

    CN118349792A