An oil-water two-phase flow water cut soft measurement method
Patent Information
- Application Number
- CN202311628606.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-01
- Publication Date
- 2026-09-22
- Estimated Expiration
- 2043-12-01
AI Technical Summary
设计了双螺旋微波传感器与油井现场管道的连接结构,构建了基于尺度缩减策略的端到端多尺度时间序列Transformer网络模型,建立了油井油水两相流信号与含水率之间的端到端映射关系,所述方法能有效地解决难以通过用数学描述模型准确解析的两相流参数测量问题
[0047]本发明提出一种油井油水两相流含水率软测量方法。所涉及的双螺旋微波传感器测量系统,主要由数据采集模块和数据终端两部分组成。数据采集模块能够以1-2000Hz采样率实现两通道信号的同步采样。数据终端基于适用于分布式参数检测系统的Modbus-RTU通信协议解决远程数据传输问题,满足实际生产现场的应用需求。在此基础上,设计实现数据采集功能的下位机软件,并配合设计完成具有统计数据监控功能的上位机软件界面。双螺旋微波传感器测量系统具备足够优秀的性能和运行稳定性,能够提供足够的数据支持。
Smart Images

Figure SMS_44 
Figure SMS_62 
Figure SMS_66
Abstract
Description
Technical Field
[0001] This invention relates to a device and method for measuring the water cut of oil-water two-phase flow in the field of dynamic monitoring of oil wells during oilfield development. Background Technology
[0002] In recent years, deep learning technology has achieved remarkable success in numerous fields, providing new perspectives for handling traditionally complex problems. In the measurement of two-phase flow parameters, data-driven soft-measurement methods have emerged, utilizing deep learning technology to understand two-phase flow behavior from the perspective of information processing of detection signals. Data-driven soft-measurement methods combining deep learning technology not only provide a deeper understanding of two-phase flow phenomena but also improve the accuracy and reliability of flow parameter measurements, possessing potential scientific research value and engineering application prospects for two-phase flow research. Continuous innovation and development in this field contribute to improving the efficiency of oil and gas energy production, promoting digital transformation, accelerating the deep integration of the oil and gas industry with modern information technology, and playing a positive role in national energy strategy development and environmental sustainability.
[0003] Measuring oil-water two-phase flow parameters has always been a crucial aspect of oilfield exploration, development, and production. Accurate measurement of these parameters, especially water cut, is essential for improving oil recovery. While conductivity and capacitance sensors have made significant progress in measuring two-phase flow parameters, their application is limited. Compared to conductivity and capacitance sensors, microwave sensors offer a clear advantage in measuring the water cut of oil-water two-phase flows. Microwave signals exhibit significant phase and amplitude attenuation when passing through polar water molecules; this characteristic can be used to determine the water cut of the mixed fluid. Designing highly sensitive microwave sensors and developing high-precision microwave measurement systems are key. Based on this background, this invention designs a double-helix microwave measurement device structure and its connection structure with the field oil well pipeline, and completes the corresponding software and hardware development. Summary of the Invention
[0004] This invention relates to a soft measurement method for water cut in oil-water two-phase flow in oil wells. A double-helix microwave sensor measurement system was built based on a 50mm diameter field oil well pipeline. The system consists of a power module, frequency synthesizer, power divider, double-helix microwave sensor, microwave phase detector, AD converter, main control unit, display screen, and data transmission module. The connection structure between the double-helix microwave sensor and the field oil well pipeline was designed. An end-to-end multi-scale time series Transformer network model based on a scale reduction strategy was constructed, establishing an end-to-end mapping relationship between the oil-water two-phase flow signal and water cut. This method effectively solves the problem of accurately measuring two-phase flow parameters that are difficult to analyze using mathematical models. To achieve the above objectives, the technical solution adopted by the present invention is as follows:
[0005] The double-helix microwave sensor consists of an excitation electrode, a receiving electrode, a protective electrode, a shielding layer, and a measuring tube section. The spiral-walled protective electrode pair and the spiral-walled measuring electrode pair are both rotated 180° along the radial direction of the measuring tube section and fixed in the fixing groove of the measuring tube section made of vertical Peek material. The angle θ of the measuring electrode on the pipe cross section is equal to 130°; the angle of the protective electrode on the pipe cross section is equal to 30°; the inner diameter of the pipe is 50 mm, the outer diameter is 75 mm, and the outer diameter of the shielding layer is 120 mm.
[0006] The overall structure of the double-helix microwave sensor measurement system includes a power supply module, a frequency synthesizer, a power divider, a double-helix microwave sensor, a microwave phase detector, an AD converter, a main control unit, a display screen, and a data transmission module. The system is connected to a 12V power supply, which, after being stepped down by the voltage divider, provides the voltage required for the normal operation of each module. The frequency synthesizer generates a 1.2GHz sinusoidal excitation signal, which is split into two paths by the power divider and connected to the reference signal receiver of the microwave phase detector and the excitation electrode of the sensor, respectively. The microwave phase detector's measurement signal receiver is connected to the sensor's receiving electrode to acquire the microwave signal that has attenuated after passing through the mixed fluid in the measurement pipe section. This signal is mixed with the input signal from the reference signal receiver to obtain the attenuation difference, which is then converted into a corresponding voltage value for output. The main control unit receives the digital value processed by the AD converter via SPI communication, calculates the final water cut scalar value, displays it on the device screen, and transmits it to the oil well monitoring platform via Modbus-RTU for real-time monitoring.
[0007] To address the challenges of existing oil well monitoring platforms, such as the large number of wells covered, numerous monitoring parameters, and high project implementation costs, a Modbus-RTU communication protocol suitable for distributed parameter monitoring systems is introduced to solve the problem of remote data transmission. The RTU of the oil well monitoring platform is set as the Modbus master, and the measurement system devices distributed on each oil well are set as Modbus slaves. Therefore, data communication between the RTU and the devices installed on each oil well can be easily completed through this protocol. An RS485 bus is used in the dual-helix microwave sensor measurement system, and the MAX485 chip is selected to perform the function conversion from TTL level to RS485 level. The dual-helix microwave sensor measurement system acts as a slave device for real-time querying and operation of the oil well monitoring platform RTU. Its data type is the holding register type in the Modbus-RTU communication protocol, and the main operation function code involved is 03, which is the operation of the master reading the slave holding register.
[0008] The aforementioned sensor measurement system involves the implementation of lower-level software for data acquisition and the development of a host computer data acquisition interface. The lower-level software is implemented in the embedded platform of STM32F103C8T6, while the host computer interface runs on a PC. The lower-level program is based on the STM32 standard peripheral library platform and is written in C language. It mainly includes the main program of the STM32F103C8T6 main control unit, the ADS131A0X initialization program, and the Modbus protocol initialization program.
[0009] First, configure the GPIO pins of the STM32F103C8T6 main control unit to set the SPI communication interface, including SCK, MISO, MOSI, and CS. MISO is master-in, slave-out, used to read data from the ADS131A0X chip; MOSI is master-out, slave-in, used to send configuration and control commands to the ADS131A0X chip; and CS is the chip select pin, used to select the ADS131A0X chip. Then, send initialization commands and configuration parameters to the ADS131A0X analog-to-digital converter via the SPI serial interface to complete the corresponding baud rate, gain, sampling rate, and other parameter settings, enabling it to acquire two channels of analog signals from the microwave phase detector output according to performance requirements. The STM32F103C8T6 sends a start command to begin the data sampling process, receives data from the ADS131A0X, sends it to the host computer via the Modbus-RTU communication protocol, and outputs it to the display screen via the serial port. Its main program is responsible for system initialization and data stream acquisition control.
[0010] The serial port and clock tree are initialized using the standard peripheral library to ensure the normal operation of the STM32F103C8T6 chip. Next, the SPI interface connecting to the ADS131A0X chip is initialized, enabling the STM32F103C8T6 master control unit to initialize the internal register states of the ADS131A0X chip via the SPI interface and establish a stable data transmission path. Interrupt functions ensure that the master control unit can recognize the data converted by the ADS131A0X and send the correct data to the data terminal via the initialized Modbus protocol. After all initializations are complete, the master control chip automatically reads the ADS131A0X's control register instructions to ensure successful initialization. Then, it receives data from the ADS131A0X and enters the data transmission preparation state, awaiting query commands from the Modbus-RTU host. The host computer interface can provide real-time and clear feedback on the current operating status of the device to the user, enabling real-time monitoring of the installation status.
[0011] The sensor measuring pipe uses a 500mm long Peek pipe with excellent mechanical properties; both ends of the Peek pipe are tapped with external threads; two flange covers are welded to both ends of the shielding shell for connecting to the custom flanges. The pipes on both sides of the custom flanges are tapped with internal and external threads respectively. One end is used to connect to the shielding shell, and the other end is connected to the transition joint and then connected to the oil well pipeline; the upper part of the sensor measuring pipe section is connected to the horizontal pipe of the oil well, and the lower part is connected to the return oil pipe through a flexible hose to form an oil transportation loop.
[0012] The end-to-end multi-scale time series Transformer network model based on the scaling strategy includes a temporal filtering module (TFM), a scale-reduced temporal coding module (SRTM), and a parameter identification module (PIM).
[0013] First, define For the first in the fluid dataset time series samples, of which and These represent the signal dimension and sampling time length, respectively; the moisture content label is represented as... Therefore, the sample can be represented as ,in This represents the total number of samples in the fluid dataset; a fluid sequence sample is considered to have a height of 1 and a width equal to its time step. The number of channels is Image type data can be used express;
[0014] To achieve multi-scale segmentation of fluid sequences and extract short-term discriminative information, a sliding window based on convolutional layers is used for input embedding, realizing local temporal feature aggregation and establishing a connection between signal dimensions with two different physical meanings. TFM is used to preprocess the input sequence, satisfying the sequence downsampling requirements while extracting local temporal features from sequences with high sampling rates. The kernel size and stride in the TFM preprocessing of the fluid sequences are both [missing information]. The number of filters is After filtering, the feature map is subjected to a BatchNorm operation to fix its distribution.
[0015] Next, ReLU activation is performed on the time-filtered feature map, giving the model non-linear expressive power; therefore, the preprocessed feature map can be denoted as... ,in , It is the floor operator.
[0016] Similar to the preprocessing steps, each SRTM first uses a convolution kernel with a stride of 1. The number of filters is Temporal convolutional layers map features to a given input. After scaling, the features are reshaped and then LayerNorm is applied to obtain the input embedding for the multi-head self-attention mechanism. ,in Indicates the scale reduction stage. This indicates the stacking depth of the time coding modules at this stage.
[0017] To capture rich, fine-grained information of oil-water two-phase flow signals under different parameters, enabling the model to flexibly learn multi-scale and high-resolution features and achieve accurate identification of parameter changes, an SRTM was designed based on a scale reduction strategy to improve the Transformer encoder.
[0018] The nonlinear relationship between different time regions is modeled using a multi-head self-attention mechanism; the scale-reduced multi-head self-attention mechanism employs... Each independent self-attention layer is computed in parallel. Unlike the operation of directly segmenting K and V, this operation uses a window convolution operation, which is the same as the TFM idea, to obtain a reduced mapping of K and V.
[0019] Specifically, the transition process in the scale-reduction multi-head self-attention mechanism is as follows:
[0020]
[0021]
[0022]
[0023]
[0024]
[0025]
[0026]
[0027] in, , , and These represent the learnable mapping matrices for query (Q), key (K), and value (V) in a scaled-down multi-head self-attention layer, respectively. , and These represent the dimensions of Q, K, and V, respectively.
[0028] ,
[0029] In particular, Indicates to Using convolution kernels with a stride of 10 ... and The convolutional layers achieve reduction at two scales, and after activation by LayerNorm and Gaussian error linear units (GeLU), they are projected to K and V at two scales, enabling them to represent feature information at different fine-grained levels in self-attention layer computation.
[0030] then, Perform a convolution operation on V to extract the local temporal augmentation component, then concatenate it with the original value via a residual connection before participating in the scale-down multi-head attention computation to obtain the output. :
[0031]
[0032] Finally, the output of the scaled multi-head self-attention module is obtained after a linear transformation layer. ,in The FFN consists of two linear transform layers, with GeLU chosen as the activation function between them. Z is used as the input to the FFN to obtain the final output of this time-coding module.
[0033]
[0034] in, , , and These are learnable parameters.
[0035] To fully extract fine-grained features from fluid signals, each scale attenuation stage is stacked sequentially. Each time encoding module, and will and All are set to 3; specifically, LayerNorm is applied before each SRTM and FFN, and residual connections are added afterward, and Dropout operations with a probability of 0.5 are performed after all linear transformations;
[0036] PIM accepts features from the output of the last stage SRTM, denoted as... It performs multi-parameter label prediction, with two independent fully connected layers for prediction. The outputs are fed into a softmax function to obtain the probability vectors for the multi-parameter label prediction. The output of PIM is:
[0037]
[0038] Represents the obtained fluid sequence The prediction vector for moisture content, These are the trainable parameters of the network. This represents the number of water content labels in the fluid dataset.
[0039] During the model training phase, the proposed SRMTT is optimized through joint supervised learning between multi-parameter label classification tasks, using cross-entropy loss. Loss function for moisture content identification task:
[0040]
[0041] in, This indicates the number of training samples for the model. Representing fluid sequences respectively Moisture content label.
[0042] The specific training process for SRMTT is shown in the table below.
[0043] For the collected fluid signals, they are first standardized, and a sliding window is used to perform non-overlapping sample splitting. Appropriate labels are added to the samples. Then, 80% of the samples are used as the training set, and the remaining 20% as the test set. Similarly, before model training, the samples in the fluid dataset are randomly shuffled multiple times to obtain multiple training and test datasets with different sample distributions for repeated experiments. This helps the model expand its parameter search space to a wider range, enhancing its generalization performance. Simultaneously, accuracy is introduced... As the main evaluation indicator, its calculation formula is as follows:
[0044]
[0045] in, It is a category The number of samples that were predicted to be positive and were actually positive. This represents the total number of categories in the sample. This indicates the total number of test samples.
[0046] The present invention has the following advantages due to the adoption of the above technical solutions:
[0047] This invention proposes a soft measurement method for water cut in two-phase flow of oil and water in oil wells. The involved double-helix microwave sensor measurement system mainly consists of two parts: a data acquisition module and a data terminal. The data acquisition module can achieve synchronous sampling of two-channel signals at a sampling rate of 1-2000Hz. The data terminal solves the problem of remote data transmission based on the Modbus-RTU communication protocol suitable for distributed parameter detection systems, meeting the application needs of actual production sites. On this basis, lower-level software for implementing data acquisition functions is designed, and upper-level software interface with statistical data monitoring functions is designed and completed. The double-helix microwave sensor measurement system has sufficiently excellent performance and operational stability, and can provide sufficient data support.
[0048] The connection structure between the double-helix microwave sensor and the field oil well pipeline involved in this invention adopts the most common threaded connection and welding form, which is simple in structure, easy to implement, and detachable, creating great space for later installation and commissioning.
[0049] This invention relates to an end-to-end multi-scale time series Transformer network model (SRMTT), which incorporates image data processing concepts to effectively aggregate information from multiple physically meaningful channels. Based on this, a scale-reduced multi-head self-attention mechanism is designed to construct an SRTM that models nonlinear relationships between different time domains and under multi-resolution time domain partitioning from a global information perspective. This enables the model to flexibly learn multi-scale and high-resolution features to fully extract information from oil-water two-phase flow signals. Attached Figure Description
[0050] Figure 1 This is a structural diagram of a double-helix microwave sensor.
[0051] Figure 2 This is a diagram showing the connection structure between the double-helix microwave sensor measuring device and the field oil pipeline.
[0052] Figure 3 This is a schematic diagram of the overall structure of the double-helix microwave sensor measurement system.
[0053] Figure 4 This is the main program flowchart of the STM32F103C8T6 main control module.
[0054] Figure 5 This is a schematic diagram of the SRMTT model structure. Detailed Implementation
[0055] The overall structure of the double-helix microwave sensor measurement system includes a power supply module, a frequency synthesizer, a power divider, a double-helix microwave sensor, a microwave phase detector, an AD converter, a main control unit, a display screen, and a data transmission module. The specific workflow is as follows: The system is connected to a 12V power supply, which, after being stepped down by the voltage divider, provides the voltage required for the normal operation of each module. The frequency synthesizer generates a 1.2GHz sinusoidal excitation signal, which is split into two paths by the power divider and connected to the reference signal receiver of the microwave phase detector and the excitation electrode of the sensor, respectively. The measurement signal receiver of the microwave phase detector is connected to the receiving electrode of the sensor to obtain the microwave signal that has attenuated after passing through the mixed fluid in the measurement pipe section. This signal is mixed with the input signal of the reference signal receiver to obtain the attenuation difference, and then converted into a corresponding voltage value for output. The main control unit receives the digital value obtained after processing by the AD converter via SPI communication, calculates the final water cut scalar value, displays it on the device screen, and transmits it to the oil well monitoring platform for real-time monitoring via Modbus-RTU (485 bus).
[0056] The software design mainly includes two parts: the lower-level software implementation for data acquisition and the upper-level data acquisition interface. The lower-level software is implemented in the STM32F103C8T6 embedded platform, while the upper-level interface runs on a Windows PC. The lower-level program was written in C language on the Keil platform based on the STM32 standard peripheral library, and mainly includes the STM32F103C8T6 main control unit program, the ADS131A0X initialization program, and the Modbus protocol initialization program.
[0057] First, configure the GPIO pins of the STM32F103C8T6 main control unit to set the SPI communication interface, including SCK (clock), MISO (master input, slave output, used to read data from the ADS131A0X chip), MOSI (master output, slave input, used to send configuration and control commands to the ADS131A0X chip), and CS (chip select pin, to select the ADS131A0X chip). Send initialization commands and configuration parameters to the ADS131A0X analog-to-digital converter through the SPI serial interface to complete the corresponding baud rate, gain, sampling rate and other parameter settings, so that it can acquire two channels of analog signals from the microwave phase detector output according to performance requirements.
[0058] The STM32F103C8T6 sends a start command to initiate the data sampling process, receives data from the ADS131A0X, transmits it to the host computer via the Modbus-RTU communication protocol, and outputs it to the display screen via the serial port. Its main program is responsible for system initialization and data stream acquisition control. First, it initializes the serial port and clock tree based on the standard peripheral library to ensure the normal operation of the STM32F103C8T6 chip. Next, it initializes the SPI interface connecting to the ADS131A0X chip, enabling the STM32F103C8T6 master unit to initialize the internal register states of the ADS131A0X chip through the SPI interface and establish a stable data transmission path. Interrupt functions ensure that the master unit can recognize the data converted by the ADS131A0X and send the correct data to the data terminal via the initialized Modbus protocol. After all initialization is complete, the main control chip automatically reads the control register instructions of the ADS131A0X to ensure successful initialization. Then, it receives data from the ADS131A0X and enters the data transmission preparation state, waiting for the query command from the Modbus-RTU host.
[0059] The SRMTT model consists of TFM, SRTM, and PIM. First, define... For the first in the fluid dataset time series samples, of which and These represent the signal dimension and sampling time length, respectively; the moisture content label is represented as... Therefore, the sample can be represented as ,in This represents the total number of samples in the fluid dataset; a fluid sequence sample is considered to have a height of 1 and a width equal to its time step. The number of channels is Image type data can be used express;
[0060] To achieve multi-scale segmentation of fluid sequences and extract short-term discriminative information, a sliding window based on convolutional layers is used for input embedding, realizing local temporal feature aggregation and establishing a connection between signal dimensions with two different physical meanings. TFM is used to preprocess the input sequence, satisfying the sequence downsampling requirements while extracting local temporal features from sequences with high sampling rates. The kernel size and stride in the TFM preprocessing of the fluid sequences are both [missing information]. The number of filters is After filtering, the feature map is subjected to a BatchNorm operation to fix its distribution.
[0061] Next, ReLU activation is performed on the time-filtered feature map, giving the model non-linear expressive power; therefore, the preprocessed feature map can be denoted as... ,in , It is the floor operator.
[0062] Similar to the preprocessing steps, each SRTM first uses a convolution kernel with a stride of 1. The number of filters is Temporal convolutional layers map features to a given input. After scaling, the features are reshaped and then LayerNorm is applied to obtain the input embedding for the multi-head self-attention mechanism. ,in Indicates the scale reduction stage. This indicates the stacking depth of the time coding modules at this stage.
[0063] To capture rich, fine-grained information of oil-water two-phase flow signals under different parameters, enabling the model to flexibly learn multi-scale and high-resolution features and achieve accurate identification of parameter changes, an SRTM was designed based on a scale reduction strategy to improve the Transformer encoder.
[0064] The nonlinear relationship between different time regions is modeled using a multi-head self-attention mechanism; the scale-reduced multi-head self-attention mechanism employs... Each independent self-attention layer is computed in parallel. Unlike the operation of directly segmenting K and V, this operation uses a window convolution operation, which is the same as the TFM idea, to obtain a reduced mapping of K and V.
[0065] Specifically, the transition process in the scale-reduction multi-head self-attention mechanism is as follows:
[0066]
[0067]
[0068]
[0069]
[0070]
[0071]
[0072]
[0073] in, , , and These represent the learnable mapping matrices for query (Q), key (K), and value (V) in a scaled-down multi-head self-attention layer, respectively. , and These represent the dimensions of Q, K, and V, respectively.
[0074]
[0075] In particular, Indicates to Using convolution kernels with a stride of 10 ... and The convolutional layers achieve reduction at two scales, and after activation by LayerNorm and Gaussian error linear units (GeLU), they are projected to K and V at two scales, enabling them to represent feature information at different fine-grained levels in self-attention layer computation.
[0076] then, Perform a convolution operation on V to extract the local temporal augmentation component, then concatenate it with the original value via a residual connection before participating in the scale-down multi-head attention computation to obtain the output. :
[0077]
[0078] Finally, the output of the scaled multi-head self-attention module is obtained after a linear transformation layer. ,in The FFN consists of two linear transform layers, with GeLU chosen as the activation function between them. Z is used as the input to the FFN to obtain the final output of this time-coding module.
[0079]
[0080] in, , , and These are learnable parameters.
[0081] To fully extract fine-grained features from fluid signals, each scale attenuation stage is stacked sequentially. Each time encoding module, and will and All are set to 3; specifically, LayerNorm is applied before each SRTM and FFN, and residual connections are added afterward, and Dropout operations with a probability of 0.5 are performed after all linear transformations;
[0082] PIM accepts features from the output of the last stage SRTM, denoted as... It performs multi-parameter label prediction, with two independent fully connected layers for prediction. The outputs are fed into a softmax function to obtain the probability vectors for the multi-parameter label prediction. The output of PIM is:
[0083]
[0084] Represents the obtained fluid sequence The prediction vector for moisture content, These are the trainable parameters of the network. This represents the number of water content labels in the fluid dataset.
[0085] During the model training phase, the proposed SRMTT is optimized through joint supervised learning between multi-parameter label classification tasks, using cross-entropy loss. Loss function for moisture content identification task:
[0086]
[0087] in, This indicates the number of training samples for the model. Representing fluid sequences respectively Moisture content label.
[0088] For the collected fluid signals, they are first standardized, and a sliding window is used to perform non-overlapping sample splitting. Appropriate labels are added to the samples. Then, 80% of the samples are used as the training set, and the remaining 20% as the test set. Similarly, before model training, the samples in the fluid dataset are randomly shuffled multiple times to obtain multiple training and test datasets with different sample distributions for repeated experiments. This helps the model expand its parameter search space to a wider range, enhancing its generalization performance. Simultaneously, accuracy is introduced... As the main evaluation indicator, its calculation formula is as follows:
[0089]
[0090] in, It is a category The number of samples that were predicted to be positive and were actually positive. This represents the total number of categories in the sample. This indicates the total number of test samples.
Claims
1. A soft measurement method for water cut in two-phase flow of oil and water in oil wells, characterized in that... The following steps are required: (1) A double-helix microwave sensor measurement system is built based on a field oil well pipeline with a diameter of 50 mm. The double-helix microwave sensor measurement system includes a power module, a frequency synthesizer, a power divider, a double-helix microwave sensor, a microwave phase detector, an AD converter, a main control unit, a display screen, and a data transmission module. (2) Set up a connection structure between the double-helix microwave sensor and the oil well field pipeline. The upper part of the measuring pipe section where the sensor is located is connected to the horizontal pipe of the oil well, and the lower part is connected to the return oil pipe through a flexible hose. The microwave phase detector measuring signal receiving end is connected to the receiving electrode of the sensor to obtain the microwave signal that has been attenuated after passing through the mixed fluid in the measuring pipe section. It is mixed with the input signal of the reference signal receiving end to obtain the attenuation difference and converted into the corresponding voltage value output. The main control unit receives digital values processed by the AD converter via SPI communication. (3) Construct an end-to-end multi-scale time series Transformer network model based on a scaling strategy, abbreviated as SRMTT; the SRMTT includes a temporal filtering module TFM, a scaling-down temporal encoding module SRTM, and a parameter identification module PIM; first define For the first in the fluid dataset time series samples, of which and These represent the signal dimension and sampling time length, respectively; the moisture content label is represented as... Therefore, the sample can be represented as ,in This represents the total number of samples in the fluid dataset; a fluid sequence sample is considered to have a height of 1 and a width equal to its time step. The number of channels is Image type data, and represented as To achieve multi-scale partitioning of fluid sequences and extract short-term discriminative information, a sliding window based on convolutional layers is used to embed the input, realize the aggregation of local temporal features, and establish the connection between signal dimensions under two different physical meanings. TFM is used to preprocess the input sequence, which can extract local temporal features from sequences with high sampling rates while meeting the requirements of sequence downsampling. The kernel size and stride in the fluid sequence preprocessing TFM are both The number of filters is After filtering, a BatchNorm operation is performed on the feature map to fix its distribution; then, ReLU is executed to activate the time-filtered feature map, giving the model non-linear expressive power; therefore, the preprocessed feature map can be denoted as... ,in , It is the floor operator; Similar to the preprocessing steps, each SRTM first uses a convolution kernel with a stride of 1. The number of filters is Temporal convolutional layers map given input features After scaling, the features are reshaped and then LayerNorm is applied to obtain the input embedding for the multi-head self-attention mechanism. ,in Indicates the scaling-down phase. This indicates the stacking depth of the time coding modules at this stage; Simultaneously, an SRTM module was designed to capture rich, fine-grained information of oil-water two-phase flow signals under different parameters; the scale-reduced multi-head self-attention mechanism described herein employs... The transformation process in the scaled-down multi-head self-attention mechanism, which involves parallel computation of independent self-attention layers, is as follows: in, , , and These represent the learnable mapping matrices for query (Q), key (K), and value (V) in a scaled-down multi-head self-attention layer, respectively. , and These represent the dimensions of Q, K, and V, respectively. , Indicates to Using convolution kernels with a stride of 10 ... and The convolutional layers achieve reduction at two scales, and after applying LayerNorm and GeLU activation, they are projected to K and V at two scales, enabling them to represent feature information at different fine-grained levels in self-attention layer computation; then, Perform a convolution operation on V to extract the local temporal augmentation component, then concatenate it with the original value via a residual connection before participating in the scale-down multi-head attention computation to obtain the output. : Finally, the output of the scaled multi-head self-attention module is obtained after a linear transformation layer. ,in The FFN consists of two linear transform layers, with GeLU chosen as the activation function between them. Z is used as the input to the FFN to obtain the final output of this time-coding module. in, , , and These are learnable parameters; To fully extract fine-grained features from fluid signals, each scale attenuation stage is stacked sequentially. Each time encoding module, and will and All are set to 3; LayerNorm is applied before each SRTM and FFN, and residual connections are added after them; Dropout operation with a probability of 0.5 is performed after all linear transformations. PIM accepts features from the output of the last stage SRTM, denoted as... It performs multi-parameter label prediction, with two independent fully connected layers for prediction. The outputs are fed into a softmax function to obtain the probability vectors for the multi-parameter label prediction. The output of PIM is: Represents the obtained fluid sequence The prediction vector for moisture content, These are the trainable parameters of the network. This represents the number of water content labels in the fluid dataset. During the model training phase, the proposed SRMTT is optimized through joint supervised learning between multi-parameter label classification tasks, using cross-entropy loss. Loss function for moisture content identification task: in, This indicates the number of training samples for the model. Representing fluid sequences respectively Moisture content label.
2. The soft measurement method for water cut in oil-water two-phase flow of an oil well according to claim 1, characterized in that, Step (1) includes: The double-helix microwave sensor comprises an excitation electrode, a receiving electrode, a protective electrode, a shielding layer, and a measuring tube section. The protective electrode includes a pair of helical-wall-aligned protective electrodes, and the excitation electrode and receiving electrode constitute a pair of helical-wall-aligned measuring electrodes. Both the helical-wall-aligned protective electrode pair and the helical-wall-aligned measuring electrode pair are arranged circumferentially opposite each other along the measuring tube section and spaced 180° apart, and are fixed within a fixed groove in the PEEK material measuring tube section. The angle θ of the measuring electrode on the pipe cross-section is 130°, and the angle of the protective electrode on the pipe cross-section is 30°. The inner diameter of the measuring tube section is 50 mm, the outer diameter is 75 mm, and the outer diameter of the shielding layer is 120 mm.
3. The soft measurement method for water cut in oil-water two-phase flow of an oil well according to claim 1, characterized in that, Step (1) includes: The overall structure of the double-helix microwave sensor measurement system includes a power supply module, a frequency synthesizer, a power divider, a double-helix microwave sensor, a microwave phase detector, an AD converter, a main control unit, a display screen, and a data transmission module. The system is connected to a 12V power supply, which, after being stepped down by the voltage divider, provides the voltage required for the normal operation of each module. The frequency synthesizer generates a 1.2GHz sinusoidal excitation signal, which is split into two paths by the power divider and connected to the reference signal receiver of the microwave phase detector and the excitation electrode of the sensor, respectively. The microwave phase detector's measurement signal receiver is connected to the sensor's receiving electrode to acquire the microwave signal that has attenuated after passing through the mixed fluid in the measurement pipe section. This signal is mixed with the input signal from the reference signal receiver to obtain the attenuation difference, which is then converted into a corresponding voltage value for output. The main control unit receives the digital value processed by the AD converter via SPI communication, calculates the final water cut scalar value, displays it on the device screen, and transmits it to the oil well monitoring platform via Modbus-RTU for real-time monitoring.
4. The soft measurement method for water cut in oil-water two-phase flow of an oil well according to claim 1, characterized in that, Step (1) includes: The data transmission module uses the Modbus-RTU communication protocol for data transmission. The data receiving end is a data receiving device with Modbus master station functionality and is configured as a Modbus master station. The dual-helix microwave sensor measurement system distributed on each oil well is configured as a Modbus slave station. The Modbus master station communicates with the Modbus slave station via an RS485 bus. The dual-helix microwave sensor measurement system is equipped with a MAX485 chip, which is used to convert between TTL and RS485 levels. The dual-helix microwave sensor measurement system acts as a slave device for querying and operating the data receiving end. Its data type is the holding register type in the Modbus-RTU communication protocol, and its operation function code is 03, which is used to enable the Modbus master station to read the holding register data of the Modbus slave station.
5. The soft measurement method for water cut in two-phase flow of oil and water in an oil well according to claim 1, characterized in that, Step (1) includes: The aforementioned sensor measurement system involves the implementation of lower-level software for data acquisition and the development of a host computer data acquisition interface. The lower-level software is implemented in an STM32F103C8T6 embedded platform, while the host computer interface runs on a PC. The lower-level program is based on the STM32 standard peripheral library platform and is written in C language. It includes the main program for the STM32F103C8T6 main control unit, the ADS131A0X initialization program, and the Modbus protocol initialization program. First, the GPIO pins of the STM32F103C8T6 main control unit are configured to set the SPI communication interface. This includes SCK, MISO, MOSI, and CS. MISO is master-in, slave-out, used to read data from the ADS131A0X chip. MOSI is master-out, slave-in, used to send configuration and control commands to the ADS131A0X chip. CS is the chip select pin, used to select the ADS131A0X chip. Initialization commands and configuration parameters are sent to the ADS131A0X analog-to-digital converter via the SPI serial interface to complete the corresponding baud rate, gain, and sampling rate parameter settings, enabling it to acquire two channels of analog signals from the microwave phase detector output according to performance requirements. The STM32F103C8T6 sends the start command. The command initiates the data sampling process, receiving data from the ADS131A0X, sending it to the host computer via the Modbus-RTU communication protocol, and outputting it to the display screen via the serial port. Its main program is responsible for system initialization and data stream acquisition control. First, it initializes the serial port and clock tree based on the standard peripheral library to ensure the normal operation of the STM32F103C8T6 chip. Next, it initializes the SPI interface connecting to the ADS131A0X chip, enabling the STM32F103C8T6 master control unit to initialize the internal register states of the ADS131A0X chip through the SPI interface and establish... A stable data transmission path is provided; interrupt functions ensure that the main control unit can recognize the data converted by the ADS131A0X and send the correct data to the data terminal via the initialized Modbus protocol; after all initialization is completed, the main control chip automatically reads the control register instructions of the ADS131A0X to ensure successful initialization, then receives data from the ADS131A0X and enters the data transmission preparation state, waiting for the query command from the Modbus-RTU host; the host computer interface can provide real-time and clear feedback on the current operating status of the equipment to the user, enabling real-time monitoring of the installation well status.
6. The soft measurement method for water cut in oil-water two-phase flow of an oil well according to claim 1, characterized in that, Step (2) includes: The sensor measuring pipe section is made of PEEK pipe with a length of 500 mm. The PEEK pipe has external threads at both ends. Flange covers are welded to both ends of the shielding shell. The flange covers are used to connect to the flange plate. One end of the flange plate is used to connect to the shielding shell, and the other end is connected to the oil well pipeline through a transition joint. The upper part of the sensor measuring pipe section is connected to the horizontal pipe of the oil well, and the lower part is connected to the return oil pipe through a flexible hose, thereby forming an oil transportation circuit.
7. The soft measurement method for water cut in two-phase flow of oil and water in an oil well according to claim 1, characterized in that, Step (3) includes: First, the collected fluid signals were standardized, and a sliding window was used to perform non-overlapping sample splitting. Appropriate labels were added to the samples. Then, 80% of the samples were used as the training set, and the remaining 20% as the test set. Similarly, before model training, the samples in the fluid dataset were randomly shuffled multiple times to obtain multiple training and test datasets with different sample distributions for repeated experiments. This helped expand the model's parameter search space to a wider range, enhancing its generalization performance. Simultaneously, accuracy (ACC) was introduced as an evaluation metric, calculated using the following formula: in, It is a category The number of samples that were predicted to be positive and were actually positive. This represents the total number of categories in the sample. This indicates the total number of test samples.
Citation Information
Patent Citations
Data-driven radio over fiber transmission link modeling method
CN114679232A
The method of moisture content measurement and sampling in three-component mixtures from producing oil wells and the device for its implementation
WO2019199207A1