Wellhead water content measuring method based on double-frequency phase voltage signal

The multi-scale feature extracted from the dual-frequency phase voltage signal through the multi-scale cross-channel Transformer model solves the problem of low measurement accuracy of wellhead moisture content in the oil field, and achieves higher accuracy and stability measurements.

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

Patent Information

Application Number
CN202411972345.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-30
Publication Date
2025-04-04

AI Technical Summary

Technical Problem

The prior art has problems in the measurement of wellhead moisture content in oilfields with low measurement accuracy, high equipment complexity and poor environmental adaptability, especially in complex flow conditions, which are difficult to accurately measure.

Method used

Using a multi-scale cross-channel Transformer model (MCCT), multi-scale cross-channel multi-scale embedding module, multi-scale multi-head self-attention mechanism module and adaptive gating fusion layer, multi-scale features are extracted from the dual-frequency phase voltage signal and moisture content is predicted.

Benefits of technology

It realizes accurate feature extraction and prediction of oil-water two-phase flow signals, which can better cope with the moisture content measurement needs under complex operating conditions and improves the accuracy and stability of measurement.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119754754A_ABST
    Figure CN119754754A_ABST
Patent Text Reader

Abstract

The invention discloses a wellhead water content measurement method based on a double-frequency phase voltage signal, and the method comprises the steps: predicting the water content of an oil-water two-phase flow based on a normalized double-frequency phase voltage signal through employing a trained multi-scale cross-channel Transform model, and carrying out the measurement of the water content of the oil-water two-phase flow. The multi-scale cross-channel Transform model comprises a cross-channel multi-scale embedding module, an improved Transform encoder, a self-adaptive gating fusion layer and a parameter prediction module, the cross-channel multi-scale embedding module is used for obtaining patch embedding characteristics of three scales, the improved Transform encoder is used for obtaining third patch embedding characteristics of the three scales, and the self-adaptive gating fusion layer is used for predicting the patch embedding characteristics of the three scales. The adaptive gating fusion layer is used for obtaining fusion features, and the parameter prediction module is used for outputting a water content prediction value. According to the wellhead water content measuring method, high-precision prediction of the water content of the oil-water two-phase flow 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 oilfield exploitation and multiphase fluid measurement, and in particular relates to a wellhead water content measurement method based on a dual-frequency phase voltage signal. Background Art

[0002] Water content is an important parameter for evaluating the quality and operating status of oil well output fluid during oilfield production. Traditional methods for measuring water content in oil-water two-phase flow are mostly based on electrical, ultrasonic or nuclear magnetic resonance technologies, but these methods have limitations in terms of measurement accuracy, equipment complexity and environmental adaptability. Especially in complex flow conditions, the measurement results often have large errors and are difficult to meet the needs of oilfield sites.

[0003] Microwave sensors have been widely used in multiphase flow measurement in recent years due to their strong penetration ability and adaptability to complex environments. However, the current water content measurement technology based on microwave sensors usually only uses a single frequency signal, which cannot fully reflect the dynamic characteristics of oil-water two-phase flow. In addition, traditional data processing methods are difficult to fully extract the multi-scale features in the signal, thus affecting the accuracy and stability of the measurement.

[0004] Soft sensing technology has gradually become an important tool in multiphase flow measurement due to its ability to handle complex, dynamic and nonlinear problems. In recent years, researchers have developed a variety of oil-water two-phase flow parameter measurement models based on soft sensing using deep learning techniques such as convolutional neural networks and long short-term memory networks. However, traditional convolution and self-attention mechanisms still have limitations in multi-scale feature extraction. Summary of the invention

[0005] In view of the deficiencies of the prior art, the purpose of the present invention is to provide a multi-scale cross-channel Transformer model (MCCT), which is used to extract multi-scale features from dual-frequency phase voltage signals and predict water content. Through a cross-channel multi-scale embedding module, a multi-scale multi-head self-attention mechanism module and an adaptive gated fusion layer, accurate feature extraction and prediction of oil-water two-phase flow signals are achieved, which can better cope with the water content measurement requirements under complex working conditions.

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

[0007] A multi-scale cross-channel Transformer model, comprising: a cross-channel multi-scale embedding module, an improved Transformer encoder, an adaptive gated fusion layer and a parameter prediction module;

[0008] The input of the cross-channel multi-scale embedding module is the normalized dual-frequency phase voltage signal. The cross-channel multi-scale embedding module is used to perform the first linear transformation, multi-scale segmentation and the second linear transformation in sequence. The first linear transformation is to perform a linear transformation on the normalized dual-frequency phase voltage signal and project it into a high-dimensional embedding space to obtain feature X1. The normalized dual-frequency phase voltage signal is obtained by normalizing the dual-frequency phase voltage signal. The dual-frequency phase voltage signal is obtained by collecting the oil-water two-phase flow.

[0009] Multi-scale segmentation is used to segment feature X1 into three different scales, and multiple patches are obtained at each scale;

[0010] The second linear transformation performs linear transformation on the patches of the three scales and projects them into the same feature dimension space, and the patches of each scale obtain patch embedding features;

[0011] The improved Transformer encoder includes: a multi-scale multi-head self-attention mechanism module, a first batch normalization layer, a feedforward neural network and a second batch normalization layer connected in sequence, wherein the input of the multi-scale multi-head self-attention mechanism module is the patch embedding features of three scales, and the output is the patch embedding features updated at three scales, the first batch normalization layer is used to add and normalize the patch embedding features updated at three scales and the patch embedding features at three scales, and the output of the first batch normalization layer is the first patch embedding features of three scales;

[0012] The feedforward neural network is used to input the first patch embedding features of three scales and perform linear mapping on them, and the output of the feedforward neural network is the second patch embedding features of three scales;

[0013] The second batch normalization layer is used to add and normalize the second patch embedding features of three scales and the first patch embedding features of three scales, and the output of the second batch normalization layer is the third patch embedding features of three scales;

[0014] The adaptive gated fusion layer performs weighted summation of the third patch embedding features of the three scales to obtain the fused features;

[0015] The input of the parameter prediction module is the fusion feature, and the output of the parameter prediction module is the predicted value of the water content of the oil-water two-phase flow.

[0016] In the above technical solution, the dimension of the dual-frequency phase voltage signal is T×C, where T is the length of the dual-frequency phase voltage signal and C is the number of channels.

[0017] In the above technical solution, the length of feature X1 is T, the dimension of feature X1 is T×D1, and D1 is the dimension of the high-dimensional embedding space in the first linear transformation.

[0018] In the above technical solution, the two frequencies of the dual-frequency phase voltage signal are 0.8 GHz and 1.8 GHz.

[0019] In the above technical solution, L1=50, L2=100, L3=500, L1 is the patch length of the first scale, L2 is the patch length of the second scale, and L3 is the patch length of the third scale.

[0020] In the above technical solution, the multi-scale multi-head self-attention mechanism module is used to sequentially perform intra-patch multi-head self-attention, dynamic routing mechanism, inter-patch multi-head self-attention and update mechanism, wherein the intra-patch multi-head self-attention adopts the multi-head self-attention mechanism to calculate the attention scores between the same scale and different patch embedding features, and obtain the attention score corresponding to each patch embedding feature;

[0021] The dynamic routing mechanism is used to select the three patch embedding features with the highest attention scores at each scale based on the attention scores calculated by multi-head self-attention within the patch;

[0022] The multi-head self-attention between patches is used to calculate the attention scores between the patch embedding features of different scales selected by the dynamic routing mechanism using the multi-head self-attention mechanism, and obtain the attention score corresponding to each patch embedding feature;

[0023] The updating mechanism is used to update the attention scores between the patch embedding features of different scales obtained by multi-head self-attention between patches to the patch embedding features of the first scale, the patch embedding features of the second scale and the patch embedding features of the third scale, and obtain the updated patch embedding features of three scales.

[0024] In the above technical solution, the dimension of the fusion feature is

[0025] In the above technical solution, the parameter prediction module includes: a flattening operation and a multi-layer perceptron.

[0026] In the above technical solution, the flattening operation flattens the fused features into dimensions A one-dimensional vector of .

[0027] In the above technical solution, the multilayer perceptron includes an input layer, a drop layer, a first hidden layer, a drop layer, a second hidden layer, a drop layer and an output layer which are connected in sequence.

[0028] In the above technical solution, the activation function of the multi-layer perceptron adopts the GELU function.

[0029] The present invention has the following advantages due to the adoption of the above technical solution:

[0030] 1. The multi-scale cross-channel Transformer model of the present invention dynamically adjusts the weights of features at different time scales through a cross-channel multi-scale embedding module and an adaptive gated fusion layer to ensure the effective fusion of multi-scale information, thereby more accurately reflecting the dynamic change characteristics of oil-water two-phase flow.

[0031] 2. The multi-scale cross-channel Transformer model of the present invention introduces a dynamic routing mechanism before the multi-head self-attention between patches, selects the most representative features through the attention score, significantly reduces the amount of calculation, and enhances the model's attention to the most important features, further improving the accuracy and robustness of moisture content prediction.

[0032] 3. The multi-scale cross-channel Transformer model of the present invention captures the complex dependencies of oil-water two-phase flow in different physical channels, such as pressure and velocity, through a cross-channel multi-scale embedding module and a multi-scale multi-head self-attention mechanism module, effectively extracts key features of the oil-water two-phase flow, and achieves high-precision prediction of water content, which is suitable for complex oil-water mixed flow environments. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] Figure 1 This is the architecture diagram of the multi-scale cross-channel Transformer model. DETAILED DESCRIPTION

[0034] The following is a detailed description of a device and method for measuring water content at a wellhead based on a dual-frequency phase voltage signal according to the present invention in conjunction with the accompanying drawings.

[0035] Example 1

[0036] like Figure 1 As shown, a multi-scale cross-channel Transformer model (MCCT) includes: a cross-channel multi-scale embedding module, an improved Transformer encoder, an adaptive gated fusion layer and a parameter prediction module;

[0037] The input of the cross-channel multi-scale embedding module is the normalized dual-frequency phase voltage signal. The cross-channel multi-scale embedding module is used to perform the first linear transformation, multi-scale segmentation and the second linear transformation in sequence. The first linear transformation is to perform linear transformation on the normalized dual-frequency phase voltage signal and project it into a high-dimensional embedding space to capture the relationship between channels and obtain the feature X1 after high-dimensional mapping. The dimension of the dual-frequency phase voltage signal is T×C, where T is the length of the dual-frequency phase voltage signal, C is the number of channels, the length of the feature X1 is T, and the dimension of the feature X1 is T×D1, where D1 is the dimension of the high-dimensional embedding space in the first linear transformation, T=3,000, C=2, D1=512, and the normalized dual-frequency phase voltage signal is obtained after normalizing the dual-frequency phase voltage signal. In the dual-frequency phase voltage signal, the first phase voltage signal is collected at a frequency of 0.8 GHz, and the second phase voltage signal is collected at a frequency of 1.8 GHz. The dual-frequency phase voltage signal is obtained by collecting oil-water two-phase flow.

[0038] Multi-scale segmentation is used to segment feature X1 according to three different scales, and multiple patches are obtained for each scale. The number of patches at the first scale is The number of patches of the second scale is The number of patches of the third scale is L1 is the patch length of the first scale, L2 is the patch length of the second scale, L3 is the patch length of the third scale, the dimension of the patch of the first scale is P1×(C×L1), the dimension of the patch of the second scale is P2×(C×L2), and the dimension of the patch of the third scale is P3×(C×L3); among them, L1=50, L2=100, L3=500, P1=60, P2=30, P3=6.

[0039] The second linear transformation performs linear transformation on the patches of three scales and projects them into the same feature dimension space. Each scale of patch embedding features obtains patch embedding features. The dimension of the patch embedding features of the first scale is P1×D2, the dimension of the patch embedding features of the second scale is P2×D2, and the dimension of the patch embedding features of the third scale is P3×D2, where D2 is the dimension of the feature dimension space in the second linear transformation.

[0040] The improved Transformer encoder includes: a multi-scale multi-head self-attention mechanism module, a first batch normalization layer, a feedforward neural network and a second batch normalization layer connected in sequence, wherein the input of the multi-scale multi-head self-attention mechanism module is the patch embedding features of three scales, and the output is the updated patch embedding features of three scales. The first batch normalization layer, the second batch normalization layer and the feedforward neural network structure refer to the citation: Vaswani A.Attention is all you need[J].Advances in Neural Information Processing Systems,2017. The first batch normalization layer is used to add and normalize the updated patch embedding features of three scales and the patch embedding features of three scales. The output of the first batch normalization layer is the first patch embedding features of three scales. The feedforward neural network is used to input the first patch embedding features of three scales and perform linear mapping on them. The output of the feedforward neural network is the second patch embedding features of three scales. The second batch normalization layer is used to add and normalize the second patch embedding features of three scales and the first patch embedding features of three scales. The output of the second batch normalization layer is the third patch embedding features of three scales (the third patch embedding features of three scales are the outputs of the improved Transformer encoder).

[0041] The multi-scale multi-head self-attention mechanism module is used to perform intra-patch multi-head self-attention, dynamic routing mechanism, inter-patch multi-head self-attention and update mechanism in sequence. Among them, the intra-patch multi-head self-attention adopts the multi-head self-attention mechanism (Sun Q, Zhao G, Xia X, et al. Hyperspectral Image Classification based on Multi-Scale Convolutional Features and Multi-Attention Mechanisms [J]. Remote Sensing, 2024, 16 (12): 2185.) to calculate the attention scores between the same scale and different patch embedding features, and obtain the attention score corresponding to each patch embedding feature. The intra-patch multi-head self-attention can capture the dependencies within the same scale.

[0042] The dynamic routing mechanism is used to select the three patches with the highest attention scores at each scale for embedding features based on the attention scores calculated by multi-head self-attention within the patch. The dynamic routing mechanism efficiently integrates important information between different scales. The dynamic routing mechanism can concentrate the most important temporal features at each scale, ensuring that information integration across scales is both efficient and accurate.

[0043] Multi-head self-attention between patches is used to calculate the attention scores between patch embedding features of different scales selected by the dynamic routing mechanism (i.e., the three patch embedding features with the highest attention scores are selected at each scale). The multi-head self-attention mechanism (Sun Q, Zhao G, Xia X, et al. Hyperspectral Image Classification based on Multi-Scale Convolutional Features and Multi-Attention Mechanisms[J]. Remote Sensing, 2024, 16(12): 2185.) is used to obtain the attention scores corresponding to each patch embedding feature.

[0044] The updating mechanism is used to update the attention scores between the patch embedding features of different scales obtained by multi-head self-attention between patches to the patch embedding features of the first scale, the patch embedding features of the second scale and the patch embedding features of the third scale, and obtain the updated patch embedding features of three scales.

[0045] Specifically, the multi-scale multi-head self-attention mechanism module uses intra-patch multi-head self-attention to calculate the attention score corresponding to each patch embedding feature in the first scale patch embedding feature, the second scale patch embedding feature and the third scale patch embedding feature respectively; then the dynamic routing mechanism is used to obtain 3 patch embedding features in P1 first scale patch embedding features, 3 patch embedding features in P2 second scale patch embedding features and 3 patch embedding features in P3 third scale patch embedding features. The 9 patch embedding features constitute an index set with a dimension of 9×D2. Each patch embedding feature in the index set is called a "router". The dimension of each router is 1×D2, and the router is used for cross-scale information integration; for each router in the index set, the inter-patch multi-head self-attention is used to calculate the attention score corresponding to each router; the corresponding attention score of each router is updated to the first scale patch embedding feature, the second scale patch embedding feature and the third scale patch embedding feature to obtain the final first scale patch embedding feature, second scale patch embedding feature and third scale patch embedding feature, that is, the patch embedding features after updating at different scales. After being processed by the multi-scale multi-head self-attention mechanism module, the patch embedding features of each scale not only contain the information within the scale, but also integrate the features of other scales, which helps to more accurately capture the complex dynamic changes in oil-water two-phase flow.

[0046] The adaptive gating fusion layer (Zou S, Xiong J, Fan C, et al. A multi-stage adaptive feature fusion neural network for multimodal gait recognition [J]. IEEE Transactions on Biometrics, Behavior, and Identity Science, 2024.) uses learnable weights to weighted sum the third patch embedding features of three (different) scales to obtain the fused feature. The dimension of the fused feature is The gating mechanism of the adaptive gated fusion layer enables the adaptive gated fusion layer to focus on the most relevant scale, ensuring the accuracy of moisture content prediction.

[0047] The input of the parameter prediction module is the fusion feature, and the output of the parameter prediction module is the water content prediction value of the oil-water two-phase flow. The parameter prediction module includes: flattening operation and multi-layer perceptron (MLP). The flattening operation flattens the fusion feature into a dimension of The multilayer perceptron includes an input layer, a dropout layer, a first hidden layer, a dropout layer, a second hidden layer, a dropout layer, and an output layer connected in sequence. The number of neurons in the input layer is 4096, the number of neurons in the first hidden layer is 1024, the number of neurons in the second hidden layer is 128, and the number of neurons in the output layer is 1. The output layer maps the extracted deep features to the target space and outputs the moisture content prediction value. The dropout layer is used to improve the generalization ability and reduce the risk of overfitting. The dropout rate is set to 0.3. Among them, the activation function of the multilayer perceptron adopts the GELU function (Hendrycks D, Gimpel K. Gaussian error linear units (gelus) [J]. arXiv preprint arXiv: 1606.08415, 2016.), and the activation function is used to extract the high-dimensional nonlinear relationship of the input features.

[0048] Example 2

[0049] A method for obtaining a fluid data set comprises the following steps:

[0050] S1, install the array spiral microwave sensor on the outside of the oil-water pipeline at the wellhead, ensure good coupling between the antenna and the pipeline, avoid signal attenuation or distortion caused by medium stratification, and collect dual-frequency phase voltage signals of the oil-water two-phase fluid in different time periods. The sampling frequency of the array spiral microwave sensor is 2000Hz, and the total collection time is 12 hours. During the time period of collecting the dual-frequency phase voltage signal, the oil-water two-phase flow in the oil well is manually sampled multiple times, and manual tests are performed to obtain multiple water content test values ​​of the oil-water two-phase flow, and the water content test value is used as the water content label value. Among them, the array spiral microwave sensor refers to CN117470877A. Alternatively, other sensors that can collect dual-frequency phase voltage signals can also be used.

[0051] S2, the dual-frequency phase voltage signal is downsampled, normalized and segmented with a sliding window in turn to obtain 28,800 samples with a length of T = 3000. The water content label values ​​are matched one by one with the samples to form a fluid data set.

[0052] Among them, downsampling: downsampling retains the effective characteristics of the dual-frequency phase voltage signal and reduces the computational complexity. Standardization: each channel of the dual-frequency phase voltage signal after downsampling is normalized according to the mean and standard deviation to eliminate the dimension difference and drift effect.

[0053] S3, divide the fluid dataset into training set, validation set and test set in a ratio of 8:1:1. The training set is used for parameter learning of the multi-scale cross-channel Transformer model to maximize the fitting of the data distribution. The validation set is used to monitor the performance of the multi-scale cross-channel Transformer model on unseen data and adjust hyperparameters. The test set is used to evaluate the trained multi-scale cross-channel Transformer model and verify the prediction performance.

[0054] Example 3

[0055] Based on Example 1 and Example 2, a training method for a multi-scale cross-channel Transformer model (MCCT) includes the following steps:

[0056] The training set is input into the multi-scale cross-channel Transformer model for training. The loss function value is calculated according to the predicted value of the water content of the oil-water two-phase flow, and the AdamW optimizer (Zhou P, Xie X, Lin Z, et al. Towards understanding convergence and generalization of AdamW [J]. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2024.) is combined with the weight decay strategy (Zhang G, Wang C, Xu B, et al. Three mechanisms of weight decay regularization [J]. arXiv preprint arXiv:1810.12281,2018.) 200 rounds of training are performed on 32 samples of each batch of training sets. After each round of training, the validation set is input into the multi-scale cross-channel Transformer model for moisture content prediction and the MSE, MAE and MAPE indicators are calculated, and it is determined whether the loss function value decreases: if the loss function value of the validation set does not improve within 10 consecutive rounds, the 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 multi-scale cross-channel Transformer model.

[0057] Among them, the loss function uses the L1 loss function (Pesme S, Flammarion N. Online robust regression via sgd on the 11 loss [J]. Advances in Neural Information Processing Systems, 2020, 33: 2540-2552.), and the weight decay strategy is used to control the complexity of the multi-scale cross-channel Transformer model and prevent overfitting.

[0058] The key hyperparameter settings are as follows: initial learning rate: 0.0001, learning rate scheduling: use the cosine annealing scheduler (Shaji AP, Hemalatha S. Cosine Annealing Scheduler Added with Momentum Factor: Classification of Tomato Plant Diseases[J]. Available at SSRN 4505950.) to gradually reduce the learning rate according to the training rounds.

[0059] Example 4

[0060] Based on Example 3, a method for measuring the water cut of oil-water two-phase flow based on a dual-frequency phase voltage signal includes: inputting a test set into a trained multi-scale cross-channel Transformer model to obtain a water cut prediction value, and calculating the mean square error (MSE), the mean absolute error (MAE), and the mean absolute percentage error (MAPE) to comprehensively evaluate the performance of the trained multi-scale cross-channel Transformer model.

[0061] Example 5

[0062] A method for measuring the water content of oil-water two-phase flow based on dual-frequency phase voltage signals is basically the same as Example 4, with the only difference being that the multi-scale segmentation in the cross-channel multi-scale embedding module is replaced by a single-scale segmentation, i.e., L1=L2=L3=50.

[0063] Example 6

[0064] A method for measuring water content of oil-water two-phase flow based on dual-frequency phase voltage signals is basically the same as Example 4, with the only difference being that the multi-scale segmentation in the cross-channel multi-scale embedding module is replaced by a single-scale segmentation, i.e., L1=L2=L3=100.

[0065] Example 7

[0066] A method for measuring water content of oil-water two-phase flow based on dual-frequency phase voltage signals is basically the same as Example 4, with the only difference being that the multi-scale segmentation in the cross-channel multi-scale embedding module is replaced with a single-scale segmentation, i.e., L1=L2=L3=500.

[0067] Example 8

[0068] A method for measuring the water content of oil-water two-phase flow based on a dual-frequency phase voltage signal is basically the same as Example 4, with the only difference being that the multi-scale multi-head self-attention mechanism module is replaced with a conventional one-dimensional convolution model with a convolution kernel size of 1×3.

[0069] Example 9

[0070] A method for measuring water content of oil-water two-phase flow based on dual-frequency phase voltage signals is basically the same as that of Example 4, with the only difference being that the dynamic routing mechanism is replaced by the commonly used cross-scale splicing.

[0071] Example 10

[0072] A method for measuring water content of oil-water two-phase flow based on dual-frequency phase voltage signals is basically the same as that of Example 4, with the only difference being that the adaptive gated fusion layer is replaced by a linear weighting mechanism.

[0073] The model is evaluated using three indicators: mean square error (MSE), mean absolute error (MAE), and mean absolute percentage error (MAPE). The results are as follows:

[0074] Table 1

[0075] Example MSE MAE MAPE Example 5 0.0031 0.0465 5.8% Example 6 0.0028 0.0439 5.5% Example 7 0.0052 0.0620 7.7% Example 4 0.0015 0.0302 3.6%

[0076] As can be seen from Table 1, in the moisture content prediction task, the prediction accuracy of Example 4 is significantly better than that of Examples 5 to 7. Therefore, the multi-scale cross-channel Transformer model in Example 4 more effectively captures cross-scale feature information and improves the prediction accuracy of moisture content. The single-scale segmentation method in Examples 5 to 7 limits the multi-scale cross-channel Transformer model's ability to understand multi-scale relationships, resulting in performance degradation.

[0077] Table 2

[0078] Example MSE MAE MAPE Example 8 0.0048 0.0629 8.1% Example 9 0.0027 0.0331 4.1% Example 4 0.0015 0.0302 3.6%

[0079] As shown in Table 2, Example 4 combines multi-scale multi-head self-attention and dynamic routing selection to effectively capture complex oil-water two-phase flow characteristics and improve prediction accuracy. However, the prediction results of Example 8 are the worst. The one-dimensional convolution of Example 8 is not capable of capturing complex features and local relationships, which leads to a decrease in prediction accuracy. The performance of Example 9 is also reduced.

[0080] Table 3

[0081]

[0082]

[0083] It can be seen from Table 3 that the dynamic weighting mechanism of Example 4 can automatically adjust the weight according to the feature importance, so as to better fuse the features and improve the moisture content prediction accuracy. The performance of Example 10 is significantly reduced, indicating the irreplaceable role of dynamic weight adjustment in feature extraction and fusion.

[0084] 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 multi-scale cross-channel Transformer model, characterized in that: include: Cross-channel multi-scale embedding module, improved Transformer encoder, adaptive gated fusion layer and parameter prediction module; The input of the cross-channel multi-scale embedding module is the normalized dual-frequency phase voltage signal. The cross-channel multi-scale embedding module is used to perform the first linear transformation, multi-scale segmentation and the second linear transformation in sequence. The first linear transformation is to perform a linear transformation on the normalized dual-frequency phase voltage signal and project it into a high-dimensional embedding space to obtain feature X1. The normalized dual-frequency phase voltage signal is obtained by normalizing the dual-frequency phase voltage signal. The dual-frequency phase voltage signal is obtained by collecting the oil-water two-phase flow. Multi-scale segmentation is used to segment feature X1 into three different scales, and multiple patches are obtained at each scale; The second linear transformation performs linear transformation on the patches of the three scales and projects them into the same feature dimension space, and the patches of each scale obtain patch embedding features; The improved Transformer encoder includes: a multi-scale multi-head self-attention mechanism module, a first batch normalization layer, a feedforward neural network and a second batch normalization layer connected in sequence, wherein the input of the multi-scale multi-head self-attention mechanism module is the patch embedding features of three scales, and the output is the patch embedding features updated at three scales, the first batch normalization layer is used to add and normalize the patch embedding features updated at three scales and the patch embedding features at three scales, and the output of the first batch normalization layer is the first patch embedding features of three scales; The feedforward neural network is used to input the first patch embedding features of three scales and perform linear mapping on them, and the output of the feedforward neural network is the second patch embedding features of three scales; The second batch normalization layer is used to add and normalize the second patch embedding features of three scales and the first patch embedding features of three scales, and the output of the second batch normalization layer is the third patch embedding features of three scales; The adaptive gated fusion layer performs weighted summation of the third patch embedding features of the three scales to obtain the fused features; The input of the parameter prediction module is the fusion feature, and the output of the parameter prediction module is the predicted value of the water content of the oil-water two-phase flow.

2. The multi-scale cross-channel Transformer model according to claim 1, characterized in that The dimension of the dual-frequency phase voltage signal is T×C, where T is the length of the dual-frequency phase voltage signal and C is the number of channels.

3. The multi-scale cross-channel Transformer model according to claim 1, characterized in that The length of the feature X is T, the dimension of the feature X1 is T×D1, and D1 is the dimension of the high-dimensional embedding space in the first linear transformation.

4. The multi-scale cross-channel Transformer model according to claim 1, characterized in that The two frequencies of the dual-frequency phase voltage signal are 0.8 GHz and 1.8 GHz.

5. The multi-scale cross-channel Transformer model according to claim 1, characterized in that: L1=50, L2=100, L3=500, L1 is the patch length of the first scale, L2 is the patch length of the second scale, and L3 is the patch length of the third scale.

6. The multi-scale cross-channel Transformer model according to claim 1, characterized in that: The multi-scale multi-head self-attention mechanism module is used to sequentially perform intra-patch multi-head self-attention, dynamic routing mechanism, inter-patch multi-head self-attention and update mechanism, wherein the intra-patch multi-head self-attention adopts the multi-head self-attention mechanism to calculate the attention scores between the same scale and different patch embedding features, and obtain the attention score corresponding to each patch embedding feature; The dynamic routing mechanism is used to select the three patch embedding features with the highest attention scores at each scale based on the attention scores calculated by multi-head self-attention within the patch; The inter-patch multi-head self-attention is used to calculate the attention scores between the patch embedding features of different scales using the multi-head self-attention mechanism in the patch embedding features of different scales selected by the dynamic routing mechanism, and obtain the attention score corresponding to each patch embedding feature; The updating mechanism is used to update the attention scores between patch embedding features of different scales obtained by multi-head self-attention between patches to the first scale patch embedding features, the second scale patch embedding features and the third scale patch embedding features, so as to obtain three scales of updated patch embedding features.

7. The multi-scale cross-channel Transformer model according to claim 1, characterized in that: The dimension of the fusion feature is 8. The multi-scale cross-channel Transformer model according to claim 1, characterized in that: The parameter prediction module includes: a flattening operation and a multi-layer perceptron.

9. The multi-scale cross-channel Transformer model according to claim 7, characterized in that: The flattening operation flattens the fused features into dimensions A one-dimensional vector of .

10. The multi-scale cross-channel Transformer model according to claim 7, characterized in that: The multilayer perceptron includes an input layer, a drop layer, a first hidden layer, a drop layer, a second hidden layer, a drop layer and an output layer connected in sequence, and the activation function of the multilayer perceptron adopts a GELU function.

Citation Information

Patent Citations

  • Oil well oil-water two-phase flow parameter measuring method based on array spiral microwave sensor

    CN117470877A