An oil and gas well multiphase flow metering system based on edge computing

The multiphase flow metering system based on edge computing achieves accurate and efficient measurement of multiphase flow in oil and gas wells, solves the problems of insufficient adaptability to slug flow and poor real-time performance of traditional methods, and improves the accuracy and real-time performance of the metering results.

CN120593849BActive Publication Date: 2025-10-21SI CHUAN PU RUI HUA TAI ZHI NENG KE JI YOU XIAN GONG SI
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511089472.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-08-05
Publication Date
2025-10-21
Estimated Expiration
2045-08-05

AI Technical Summary

Technical Problem

In the existing technology of multiphase flow measurement in oil and gas wells, the traditional electrical tomography method is not adaptable enough to complex flow patterns such as slug flow, and the slug flow mass flow prediction model does not fully consider the coupling effects of parameters such as pressure and temperature, resulting in large deviations in the metering results and poor real-time performance, which cannot meet the needs of rapid on-site decision-making.

Method used

A multiphase flow metering system based on edge computing is adopted. The pressure, temperature, flow velocity and dielectric constant are collected synchronously in real time through the multi-parameter collaborative acquisition and dynamic adaptation module. The improved electrical tomography data reconstruction and feature extraction module is combined to perform iterative image reconstruction and feature extraction, identify the slug flow morphology and construct the mass flow dynamic modeling and parameter coupling module. Edge computing is used for parallel operation and data compression encoding. Finally, data storage and transmission are realized through the remote data interaction and storage module.

Benefits of technology

It improves the adaptability to complex flow patterns such as slug flow, enhances the matching degree between phase distribution characteristics and dynamic changes of actual flow patterns, realizes accurate and efficient measurement of multiphase flow, reduces data transmission delay, and meets the needs of real-time decision-making on site.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120593849B_ABST
    Figure CN120593849B_ABST
Patent Text Reader

Abstract

The application discloses an oil and gas well multiphase flow metering system based on edge computing, comprising a multi-parameter cooperative acquisition and dynamic adaptation module, an improved electrical tomography data reconstruction and feature extraction module, a slug flow pattern recognition and dynamic parameter analysis module, a multiphase flow quality dynamic modeling and parameter coupling module, an edge real-time calculation and data compression and encoding module, and a remote data interaction and storage module. Through the cooperation of multiple modules, the system acquires parameters such as pressure and temperature, reconstructs the dielectric distribution image through the improved model, extracts the characteristic quantity, recognizes the slug flow stage and calculates the parameters, constructs the mapping relationship and processes the coupling influence, completes the operation and encoding with the help of edge computing, and realizes data storage and transmission. The system solves the defects of imperfect model parameter adjustment and poor real-time performance caused by dependence on cloud computing in the prior art, and realizes accurate and efficient metering of multiphase flow.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of multiphase flow measurement in oil and gas wells, and in particular to a multiphase flow measurement system for oil and gas wells based on edge computing. Background Art

[0002] In the process of oil and gas resource development, the fluids produced by oil and gas wells mostly exist in the form of multiphase flow. Accurately measuring their flow plays a key role in reservoir evaluation, production optimization, and mining plan adjustment. As oil and gas field development enters the middle and late stages, the composition of the fluids in the wells becomes increasingly complex, and non-steady-state flow phenomena such as slug flow frequently occur. Traditional metering methods are difficult to adapt to highly dynamic, multi-parameter coupled measurement environments. At the same time, the development of edge computing technology has made it possible to process massive amounts of metering data in real time. Calculations and analysis can be completed close to the data acquisition end, reducing data transmission delays and meeting the timeliness of metering requirements at oil and gas well sites. Based on this, there is an urgent need to build a multiphase flow metering system that can integrate multi-parameter acquisition, dynamic modeling, and edge computing.

[0003] Existing technologies have two significant shortcomings in multiphase flow measurement. On the one hand, when reconstructing the dielectric distribution image of the fluid, the traditional electrical tomography method is not adaptable enough to complex flow patterns such as slug flow. The extracted phase distribution characteristics are poorly matched with the dynamic changes of the actual flow pattern, resulting in large deviations in the flow calculation results based on these characteristics. On the other hand, the slug flow mass flow prediction model does not fully consider the coupling effects of parameters such as pressure and temperature on fluid density and flow velocity. The dynamic adjustment mechanism of the parameters in the model is imperfect, making it difficult to accurately reflect the actual changes in mass flow under different flow stages. In addition, data processing mostly relies on cloud computing, which has problems such as large data transmission volume and poor real-time performance, and cannot meet the needs of rapid on-site decision-making. Summary of the Invention

[0004] In order to overcome the shortcomings and deficiencies of the existing technology, the present invention provides an oil and gas well multiphase flow metering system based on edge computing.

[0005] The technical solution adopted by the present invention is an oil and gas well multiphase flow metering system based on edge computing, comprising:

[0006] A multi-parameter collaborative acquisition and dynamic adaptation module, connected to the outer wall of the oil and gas well production fluid transmission pipeline, is used to synchronously acquire the pressure, temperature, flow rate and dielectric constant of the fluid in the pipeline in real time, and preliminarily integrate the acquired parameters according to preset time-series association rules;

[0007] An improved electrical tomography data reconstruction and feature extraction module, whose input is connected to the output of the multi-parameter collaborative acquisition and dynamic adaptation module via a high-speed data transmission link. This module receives the integrated parameters, iteratively reconstructs the dielectric distribution image inside the fluid based on the improved electrical tomography model, and extracts grayscale gradient, boundary curvature, and regional area ratio characteristics that reflect phase distribution characteristics from the reconstructed image;

[0008] A slug flow morphology identification and dynamic parameter analysis module, whose input is connected to the output of the improved electrical tomography data reconstruction and feature extraction module, receives the aforementioned feature quantities, identifies the slug flow's formation, development, and dissipation stages by analyzing the dynamic changes in the feature quantities, and calculates the slug length, movement velocity, and liquid holdup corresponding to each stage;

[0009] The multiphase flow mass flow dynamic modeling and parameter coupling module has its input connected to the output of the slug flow morphology identification and dynamic parameter analysis module and the output of the multi-parameter collaborative acquisition and dynamic adaptation module. It receives slug flow parameters and original acquisition parameters, constructs a nonlinear mapping relationship between mass flow and various parameters based on the slug flow mass flow prediction model, and simultaneously processes the coupled effects of pressure and temperature on fluid density and flow velocity.

[0010] The edge real-time computing and data compression encoding module, whose input is connected to the output of the multiphase flow mass flow dynamic modeling and parameter coupling module, receives the mapping relationship and coupled parameters, uses the edge computing architecture to perform parallel computing on the parameters, and encodes the calculation results according to the preset compression algorithm;

[0011] Remote data interaction and storage module, whose input is connected to the output of the edge real-time computing and data compression coding module via a wireless communication link. It receives the encoded results, classifies and stores them in timestamp order, and can respond to external data query instructions to decrypt and transmit the encoded data;

[0012] Furthermore, in the improved electrical tomography data reconstruction and feature extraction module, the improved electrical tomography model satisfies: ,

[0013] in, is the internal coordinate of the pipeline at time t The equivalent dielectric constant obtained by reconstruction at ; is the total number of phases; is the dielectric constant of the i-th phase fluid; is the coordinate of the i-th phase fluid The distribution function at , dimensionless; is the coordinate at time t The current density at is the coordinate at time t The conductivity at is the coordinate at time t The electric potential at

[0014] In the multiphase flow mass flow dynamic modeling and parameter coupling module, the slug flow mass flow prediction model satisfies: ,in, is the total mass flow rate of the slug flow at time t; are the mass flow rate correction coefficients of the gas phase and liquid phase, respectively, dimensionless; are the densities of the gas phase and liquid phase under pressure P and temperature T respectively; are the velocities of gas and liquid phases in the slug flow at time t, respectively; are the areas occupied by the gas phase and liquid phase in the slug flow at time t on the cross section of the pipe.

[0015] Furthermore, in the slug flow morphology identification and dynamic parameter analysis module, a slug flow morphology discrimination model is constructed based on the phase distribution characteristics obtained by the improved electrical tomography model: ,in, is the slug flow morphology index at time t, dimensionless; is the total number of feature quantities; is the weight coefficient of the kth feature, dimensionless; is the normalized value of the kth feature at time t, dimensionless; is the coordinate at time t Reconstruct the gradient of the dielectric constant at ;

[0016] At the same time, combined with the slug flow mass flow prediction model, a correlation model between slug flow liquid holdup and mass flow rate is established: ,in, is the liquid holdup of the slug flow at time t, dimensionless; is the mass flow rate of the liquid phase in the slug flow at time t; is the total cross-sectional area of ​​the pipe; is the dynamic correction coefficient; is the rate of change of the total mass flow rate of the slug flow at time t.

[0017] Furthermore, in the multi-parameter collaborative acquisition and dynamic adaptation module, a parameter acquisition frequency dynamic adjustment model is established according to the characteristics of different acquisition parameters: ,in, is the acquisition frequency of the i-th parameter at time t; is the reference acquisition frequency of the i-th parameter; is the frequency adjustment coefficient of the i-th parameter; is the rate of change of the i-th parameter at time t; is the absolute value symbol;

[0018] In the improved electrical tomography data reconstruction and feature extraction module, based on the slug flow mass flow prediction model, the feature extraction process is optimized and a mapping model between feature quantity and mass flow is constructed: ,in, is the extracted value of the j-th feature at time t, dimensionless; is the integration time window; is the extraction coefficient of the j-th feature quantity, dimensionless; is the integral variable; for The total mass flow rate of the slug flow at time t; for Time coordinates The equivalent dielectric constant obtained by reconstruction at .

[0019] Furthermore, in the edge real-time computing and data compression encoding module, a data compression efficiency optimization model is established based on the calculation results of the improved electrical tomography model and the slug flow mass flow prediction model: ,in, is the data compression efficiency at time t, dimensionless; is the compression base coefficient, dimensionless; is the total number of data points; is the nth original data value at time t; is the nth compressed data value at time t; is the flow influence coefficient; is the total mass flow rate of the slug flow at time t;

[0020] At the same time, a balance model between compressed data recovery accuracy and computational complexity is constructed: ,in, is the compressed data recovery accuracy at time t, dimensionless; is the accuracy reference coefficient, dimensionless; is the integral variable; for Time coordinates The equivalent dielectric constant obtained by reconstruction at ; for Time coordinates Reconstruct the gradient of the dielectric constant at ; is the influence coefficient of the calculated quantity, dimensionless; is the amount of compression calculation at time t.

[0021] Furthermore, in the remote data interaction and storage module, a data storage priority ranking model is established based on the results of the slug flow mass flow prediction model: ,in, is the storage priority of the nth group of data at time t, dimensionless; is the weight coefficient, dimensionless and ; is the total mass flow rate of the slug flow corresponding to the nth group of data at time t; is the maximum total mass flow rate of slug flow in all data groups at time t; is the absolute value of the reconstructed dielectric constant change corresponding to the nth group of data at time t; is the absolute value of the maximum reconstructed dielectric constant change among all data groups at time t;

[0022] At the same time, combined with the improved electrical tomography model, a data transmission rate adjustment model is constructed: ,in, is the data transmission rate at time t; is the transmission rate coefficient; are all the coordinates in the pipe cross section at time t The sum of the reconstructed dielectric constants at ; are all the coordinates in the pipe cross section at time t The sum of the Laplace values ​​of the reconstructed dielectric constant at ; is the total mass flow rate of the slug flow at time t.

[0023] Furthermore, the slug flow morphology recognition and dynamic parameter analysis module includes: a feature quantity time series correlation analysis unit, which receives the grayscale gradient, boundary curvature and regional area ratio feature quantities output by the improved electrical tomography data reconstruction and feature extraction module, and organizes the feature quantities of multiple consecutive moments into a feature sequence in chronological order. By calculating the difference, ratio and covariance of adjacent feature quantities in the sequence, the change trend and correlation degree of the feature quantities over time are analyzed; a slug flow stage division unit, which receives the change trend and correlation degree data output by the feature quantity time series correlation analysis unit, sets multiple feature quantity threshold ranges, and determines that the slug flow is in the formation, development or dissipation stage when the feature quantities in the feature sequence fall into different threshold ranges. And record the start and end time of each stage; the dynamic parameter calculation unit receives the stage information and characteristic sequence output by the slug flow stage division unit, calculates the slug length, movement speed and liquid holdup according to the change law of the characteristic quantities of different stages and the pipe cross-sectional size parameters, wherein the slug length is calculated by the displacement and time interval of the characteristic area in the phase distribution image at continuous moments, and the movement speed is calculated by the slug length change rate and the position difference between adjacent moments; the parameter verification unit receives the slug length, movement speed and liquid holdup output by the dynamic parameter calculation unit, and reversely correlates these parameters with the characteristic quantities for verification. When the correlation between the parameter and the characteristic quantity is lower than the set value, the dynamic parameter calculation unit is re-triggered to perform parameter calculation.

[0024] Furthermore, the multiphase flow mass flow dynamic modeling and parameter coupling module includes: a parameter screening and association unit, which receives the slug length, movement speed and liquid holdup output by the slug flow morphology recognition and dynamic parameter analysis module, and the pressure, temperature, flow rate and dielectric constant output by the multi-parameter collaborative acquisition and dynamic adaptation module, performs pairwise correlation analysis on these parameters, screens out parameter combinations with a high correlation with mass flow, and establishes a mapping relationship between the parameters; a model structure construction unit, which receives the parameter combination and mapping relationship output by the parameter screening and association unit, and based on the basic framework of the slug flow mass flow prediction model, uses the screened parameters as input variables and the mass flow as output Variables, construct a model structure containing multiple nonlinear terms, wherein the coefficients in the model structure are preliminarily determined by the mapping relationship between parameters; the parameter coupling processing unit, receives the model structure output by the model structure construction unit, analyzes the influence of pressure and temperature on fluid density and flow rate, and embeds these influence rules into the model structure in the form of functions, so that the density and flow rate parameters in the model are dynamically adjusted with the changes in pressure and temperature; the model optimization unit, receives the coupled model structure output by the parameter coupling processing unit, and adjusts the coefficients in the model structure by comparing the model calculation results with the actually measured mass flow data, so that the deviation between the model calculation results and the actually measured data is within the set range.

[0025] Furthermore, the edge real-time computing and data compression encoding module includes: a computing task allocation unit, which receives the model structure and parameters output by the multiphase flow mass flow dynamic modeling and parameter coupling module, and decomposes the model computing task into multiple subtasks according to the computing power, memory capacity and current load of the edge computing node, each subtask includes the calculation of some parameters and the solution of some model terms; a parallel computing unit, which receives the subtasks output by the computing task allocation unit, starts multiple computing cores in the edge computing node, and calculates different subtasks at the same time, and each computing core independently performs parameter calculations, intermediate result storage and temporary data exchange of the assigned subtasks; a data compression unit, which receives the calculation results output by the parallel computing unit, groups the result data according to a preset compression rule, and performs encoding conversion on each group of data, thereby reducing the storage capacity of the data by removing redundant information and repetitive patterns in the data; an encoding unit, which receives the compressed data output by the data compression unit, and converts the compressed data into a binary code stream suitable for transmission using a preset encoding method, and adds a data check code during the encoding process to verify the integrity of the data after data transmission or storage.

[0026] Beneficial effects: The present invention proposes a multiphase flow metering system for oil and gas wells based on edge computing, which realizes real-time synchronous acquisition and integration of pressure, temperature, flow velocity and dielectric constant through a multi-parameter collaborative acquisition and dynamic adaptation module. The improved electrical tomography data reconstruction and feature extraction module completes the iterative reconstruction of the dielectric distribution image and the extraction of feature quantities according to the improved model. The slug flow morphology recognition and dynamic parameter analysis module realizes the slug flow stage recognition and parameter calculation. With the help of the multiphase flow mass flow dynamic modeling and parameter coupling module, the mapping relationship is constructed and the parameter coupling influence is processed. The edge real-time calculation and data compression coding module completes the parallel operation and coding. Finally, the remote data interaction and storage module realizes data storage and transmission. It improves its adaptability to complex flow types such as slug flow through an improved electrical tomography model, thereby improving the matching degree between the extracted phase distribution characteristics and the dynamic changes of the actual flow type, overcoming the problem of large deviation in calculation results caused by low matching degree of characteristics in traditional methods; it uses the slug flow mass flow prediction model to fully consider the coupling effects of pressure and temperature on fluid density and flow velocity, improves the dynamic parameter adjustment mechanism, and combines edge computing to complete data processing close to the acquisition end, reducing transmission delays, and solving the defects of imperfect model parameter adjustment and reliance on cloud computing that lead to poor real-time performance in existing technologies, thus achieving accurate and efficient measurement of multiphase flow. BRIEF DESCRIPTION OF THE DRAWINGS

[0027] Figure 1 It is a diagram of the system unit composition of the present invention;

[0028] Figure 2 This is a flow chart of the system operation of the present invention. DETAILED DESCRIPTION

[0029] It should be noted that, unless there is a conflict, the embodiments in this application and the features described in the embodiments can be combined with each other. The application is further described in detail below with reference to the accompanying drawings and specific embodiments.

[0030] like Figure 1 As shown, an oil and gas well multiphase flow metering system based on edge computing includes:

[0031] A multi-parameter collaborative acquisition and dynamic adaptation module, connected to the outer wall of the oil and gas well production fluid transmission pipeline, is used to synchronously acquire the pressure, temperature, flow rate and dielectric constant of the fluid in the pipeline in real time, and preliminarily integrate the acquired parameters according to preset time-series association rules;

[0032] Specifically, this module is the basis for system data acquisition, and its technical parameters directly affect the accuracy of subsequent measurement. The pressure acquisition range covers 0-150MPa, with an accuracy of ±0.1%FS; the temperature acquisition range is -40℃-120℃, with an accuracy of ±0.2℃; the flow rate acquisition range is 0-10m / s, with a resolution of 0.01m / s; the dielectric constant acquisition frequency is 100Hz, and the measurement error does not exceed ±2%. These parameters are set to adapt to the complex environment of high pressure, large temperature fluctuations, and variable flow rates within oil and gas wells, ensuring that the collected raw data can truly reflect the physical state of the fluid, providing reliable data support for subsequent image reconstruction and flow calculations. At the same time, through the coordinated acquisition of multiple parameters, mutual verification between different physical quantities is achieved, reducing the deviation that may occur in the acquisition of a single parameter.

[0033] In practice, the module collects data through multiple sensor groups installed on the outer wall of the oil and gas well's fluid delivery pipeline. The pressure sensor uses a strain gauge structure and is evenly distributed around the pipeline's circumference, with 12 sensors installed every 30°. The sampling interval is set at 10ms. The temperature sensor is an armored thermocouple embedded in a pre-set hole in the pipeline's outer wall at a depth of one-third of the pipeline's thickness. The sampling interval is consistent with that of the pressure sensor. The flow velocity sensor uses the ultrasonic Doppler principle and is installed in pairs on both sides of the pipeline. The angle between the transmitting and receiving probe axes is 45°, and the sampling frequency is 10Hz. The dielectric constant sensor is a flat-plate capacitor, covering 80% of the pipeline's cross-section, and the sampling frequency is strictly controlled at 100Hz. The collected parameters are aligned according to the timestamps, and the time synchronization accuracy is controlled within 1ms. Then, the pressure, temperature, flow rate and dielectric constant are combined into data frames according to the collection order through the internal data integration unit. Each data frame contains the parameter values ​​of 20 consecutive sampling points. The interval between data frames is 200ms. The integrated data is transmitted to the next module via the RS485 bus, and the transmission rate is set to 115200bps.

[0034] An improved electrical tomography data reconstruction and feature extraction module, whose input is connected to the output of the multi-parameter collaborative acquisition and dynamic adaptation module via a high-speed data transmission link. This module receives the integrated parameters, iteratively reconstructs the dielectric distribution image inside the fluid based on the improved electrical tomography model, and extracts grayscale gradient, boundary curvature, and regional area ratio characteristics that reflect phase distribution characteristics from the reconstructed image;

[0035] Specifically, this module undertakes the important task of converting raw parameters into phase distribution characteristics that can be used for analysis. Its technical performance plays a decisive role in the subsequent slug flow identification and flow calculation. The spatial resolution of image reconstruction reaches 128×128 pixels, and the convergence residual of iterative reconstruction is less than 0.001, ensuring that the reconstructed dielectric distribution image can clearly reflect the phase distribution details inside the fluid; the grayscale gradient calculation accuracy of feature extraction is 0.1 gray level / pixel, the boundary curvature calculation error does not exceed 0.5°, and the calculation error of regional area ratio is controlled within ±1%. The setting of these technical parameters enables the extracted feature quantities to accurately characterize the distribution state of different phases in the pipeline, providing a quantitative basis for the morphological identification of slug flow. At the same time, through high-precision feature extraction, the input quality of the subsequent flow calculation model is improved, thereby improving the metering accuracy of the entire system.

[0036] In implementation, after receiving data frames from the multi-parameter collaborative acquisition and dynamic adaptation module, this module first preprocesses the dielectric constant data to remove outliers. The outlier criterion is that data points exceed three standard deviations. An improved electrical tomography model is then used for image reconstruction. The initial iteration step size is set to 0.05, and the step size is adjusted based on the residual after each iteration. Iterations are terminated when the residual is less than 0.001 for five consecutive times. The entire reconstruction process is completed within 50 milliseconds. The reconstructed dielectric distribution image is extracted using an edge detection algorithm, and the grayscale gradient is calculated using the Sobel operator in the horizontal and vertical directions, with the result rounded to one decimal place. The boundary curvature is calculated using the least squares method to fit the boundary curve and the curvature value is rounded to one decimal place. The area ratio is calculated by calculating the ratio of the number of pixels in different phase regions to the total number of pixels (128 × 128 = 16,384 pixels), with the result rounded to two decimal places. The extracted features are stored in a cache inside the module in chronological order. The cache capacity is 1,000 groups. When the cached data reaches 800 groups, the data cleaning mechanism is activated to delete the earliest 300 groups of data. At the same time, the current features are sent to the next module via a high-speed data transmission link, and the transmission delay is controlled within 10ms.

[0037] A slug flow morphology identification and dynamic parameter analysis module, whose input is connected to the output of the improved electrical tomography data reconstruction and feature extraction module, receives the aforementioned feature quantities, identifies the slug flow's formation, development, and dissipation stages by analyzing the dynamic changes in the feature quantities, and calculates the slug length, movement velocity, and liquid holdup corresponding to each stage;

[0038] Specifically, this module is responsible for analyzing the dynamic characteristics of slug flows in the system, and its technical parameters directly affect the accuracy of slug flow stage identification and the accuracy of parameter calculation. The response time of slug flow stage identification does not exceed 100ms, ensuring that the instantaneous changes of slug flows can be captured in a timely manner; the slug length calculation range is 0.5-10m, and the accuracy is controlled at ±0.05m; the movement speed calculation range is 0.1-5m / s, and the error does not exceed ±0.02m / s; the liquid holdup calculation range is 0-100%, and the error is less than ±1%. These parameters are set to meet the measurement needs of slug flows of different sizes in oil and gas wells. By accurately identifying the formation, development, and dissipation stages of slug flows, a stage division basis is provided for the dynamic calculation of mass flow. At the same time, accurate slug parameters provide key inputs for subsequent flow models, which helps to improve the accuracy of flow measurement.

[0039] In specific implementation, after receiving the feature values ​​from the improved electrical tomography data reconstruction and feature extraction module, the module first performs time series analysis on the feature values, forming an analysis window with five consecutive sets of feature values. The slug flow stage is determined by calculating the rate of change of the grayscale gradient, the fluctuation amplitude of the boundary curvature, and the changing trend of the regional area percentage within the window. A slug flow is identified as forming when the grayscale gradient change rate is greater than 0.5 grayscale levels / pixel / s, the boundary curvature fluctuation amplitude exceeds 5°, and the regional area percentage increases at a rate greater than 2% / s. A slug flow is identified as developing when these parameters stabilize, with a change rate less than 0.1 grayscale levels / pixel / s, a fluctuation amplitude less than 1°, and an increase rate less than 0.5% / s. A slug flow is identified as dissipating when the grayscale gradient change rate is negative, the boundary curvature fluctuation amplitude decreases, and the regional area percentage decreases at a rate greater than 1% / s. The slug length is calculated by the displacement difference and time interval of the characteristic points in the phase distribution images at two consecutive moments, with a time interval of 0.1 seconds. The displacement difference is obtained using an image matching algorithm, and the calculated result is rounded to two decimal places. The velocity is the change in slug length per unit time, expressed in m / s, and rounded to two decimal places. The liquid holdup is calculated by multiplying the liquid phase area by a correction factor of 0.98, which is set based on a pipe inner diameter of 200 mm. The calculated parameters are updated every 0.5 seconds and synchronously transmitted to the multiphase mass flow dynamic modeling and parameter coupling module. A checksum mechanism is used during the transmission process to ensure data integrity.

[0040] The multiphase flow mass flow dynamic modeling and parameter coupling module has its input connected to the output of the slug flow morphology identification and dynamic parameter analysis module and the output of the multi-parameter collaborative acquisition and dynamic adaptation module. It receives slug flow parameters and original acquisition parameters, constructs a nonlinear mapping relationship between mass flow and various parameters based on the slug flow mass flow prediction model, and simultaneously processes the coupled effects of pressure and temperature on fluid density and flow velocity.

[0041] Specifically, this module is the core for accurate mass flow calculation, and its technical parameters determine the model's adaptability and calculation accuracy. The sampling frequency of the model's input parameters is consistent with the multi-parameter collaborative acquisition module, at 100Hz, ensuring the timeliness of the input data. The model calculates mass flow output with a resolution of 0.01kg / s, capable of reflecting even small flow rate changes. The pressure-density coefficient is set at 0.002kg / (m³・MPa), and the temperature-density coefficient is set at -0.5kg / (m³・℃), quantifying the coupled effects of pressure and temperature on fluid density. The model calculation response time is controlled within 50ms to meet real-time metering requirements. These parameter settings enable the module to fully consider the impact of pressure and temperature fluctuations in oil and gas wells on flow measurement. Through dynamic modeling and parameter coupling, it eliminates metering deviations caused by environmental factors. Simultaneously, the high-resolution output and fast response time ensure that the metering results promptly reflect dynamic flow changes, providing an accurate basis for production regulation.

[0042] During implementation, the module simultaneously receives the slug length, velocity, and holdup from the slug flow morphology identification and dynamic parameter analysis module, as well as the pressure, temperature, flow rate, and dielectric constant from the multi-parameter collaborative acquisition and dynamic adaptation module. First, the input parameters are time-aligned. Using the timestamp as a reference, the parameters from different sources are matched to the same time point, with a time alignment error of ±1ms. Then, based on the pressure and temperature values, the gas and liquid phase densities are corrected using preset influence coefficients. The corrected density is ρ = ρ0 + 0.002 × (P - P0) - 0.5 × (T - T0), where ρ0 is the density under standard conditions, P0 = 0.1 MPa, and T0 = 25°C. The slug parameters and the corrected density, flow rate, and other parameters are then input into a nonlinear mapping relationship constructed based on the slug flow mass flow prediction model. The model includes cross-terms and higher-order terms for variables such as slug length, velocity, holdup, density, and flow rate. The calculation process uses an iterative solution, with the initial value set to the mass flow value at the previous moment and an iteration step of 0.001 kg / s. The calculation stops when the difference between the two iteration results is less than 0.005 kg / s. The entire calculation process is completed within 40 milliseconds. The calculated mass flow value is timestamped and stored in the module's database. The database has a capacity of 10,000 records and is backed up once an hour. The mass flow value is also sent to the edge-end real-time calculation and data compression encoding module at an interval of 100 milliseconds. Data transmission uses CRC checksum to ensure accuracy.

[0043] The edge real-time computing and data compression encoding module, whose input is connected to the output of the multiphase flow mass flow dynamic modeling and parameter coupling module, receives the mapping relationship and coupled parameters, uses the edge computing architecture to perform parallel computing on the parameters, and encodes the calculation results according to the preset compression algorithm;

[0044] Specifically, this module is responsible for real-time data processing and transmission optimization in the system, and its technical parameters directly affect the system's operating efficiency and data transmission performance. It has eight parallel computing cores, capable of processing multiple sets of data simultaneously and improving computing throughput. The data compression ratio can be adjusted between 2:1 and 10:1, dynamically selected based on the redundancy of the data, ensuring that the amount of data is reduced while ensuring data accuracy. The encoding efficiency is set to process 1MB of data per second to meet the encoding requirements of massive data. The computing delay is controlled within 20ms to ensure real-time performance. These parameter settings enable the module to quickly complete computing tasks close to the data acquisition end, avoiding delays caused by data transmission to the cloud. At the same time, through data compression and encoding, it reduces transmission bandwidth usage, reduces the risk of data loss, and provides efficient and reliable data input for remote data interaction and storage modules.

[0045] In implementation, the module receives the mass flow and related parameters output by the Multiphase Mass Flow Dynamic Modeling and Parameter Coupling module. It then divides the data into eight groups based on time series, each containing 100 consecutive parameter values. These groups are then assigned to eight computing cores for parallel processing. Each core is responsible for calculating the statistical characteristics of its data group, including the mean, variance, and extreme values. The mean is rounded to three decimal places, the variance is rounded to six decimal places, and the extreme values ​​retain their original precision. After calculation, the module selects a compression ratio based on the data variance: a 2:1 compression ratio for variances greater than 0.1, a 5:1 compression ratio for variances between 0.01 and 0.1, and a 10:1 compression ratio for variances less than 0.01. The compression process uses a combination of run-length encoding and Huffman coding, first performing differential processing on the data and then encoding the differential results. The encoded data stream is packaged according to a fixed format. Each data packet is 1024 bytes in size and consists of a header, a data body, and a checksum. The header contains information such as the compression ratio and timestamp, and the checksum uses a 32-bit CRC checksum. The encoded data is sent to the remote data interaction and storage module through the wireless communication module. The transmission power is set to 20dBm and the transmission rate is 2Mbps. The link quality is checked every 100 data packets. When the packet loss rate exceeds 5%, the compression ratio is automatically reduced and resent.

[0046] The remote data interaction and storage module has its input connected to the output of the edge real-time computing and data compression coding module through a wireless communication link. It receives the encoded results, classifies and stores them in timestamp order, and can respond to external data query instructions to decrypt and transmit the encoded data.

[0047] Specifically, this module serves as the ultimate storage and interaction center for system data, and its technical parameters determine data security and accessibility. Its storage capacity is 1TB, meeting long-term data storage needs; data query response time is less than 1 second, ensuring rapid access to required data; the communication protocol uses TCP / IP, ensuring reliable data transmission; and data backup is performed hourly to prevent data loss. These parameters enable the module to store system-generated metering data stably over the long term, providing data support for subsequent production analysis and historical tracing. Furthermore, through efficient query responses and a reliable communication protocol, it enables smooth data interaction with external systems, enhancing the overall practicality of the system.

[0048] In specific implementation, after receiving encoded data from the edge real-time computing and data compression module via a wireless communication link, the module first verifies the data packet. If the checksum is correct, the data is decompressed and the original data is restored using the corresponding decoding algorithm. The decompression process uses a database partitioned by day to store all data records for that day in timestamp order. Each record includes the parameter name, value, timestamp, and data status. RAID 5 redundancy is used for data storage to ensure data protection in the event of a single hard drive failure. When receiving an external data query command, the module analyzes the time range and parameter type in the command and retrieves the corresponding data from the database. The retrieval process is accelerated by indexing, keeping the response time within 0.5 seconds. The query results are packaged in JSON format and sent to the query end via TCP / IP. The data is encrypted before transmission using AES-256. The module also initiates a data backup process every hour, backing up the newly added data from the previous hour to an external removable hard drive. After the backup is complete, a backup log is generated, recording the backup time, data volume, and backup status. The log is retained for one year.

[0049] Preferably, in the improved electrical tomography data reconstruction and feature extraction module, the improved electrical tomography model satisfies: ,in, is the internal coordinate of the pipeline at time t The equivalent dielectric constant obtained by reconstruction at is in units of ; is the total number of phases; is the dielectric constant of the i-th phase fluid, in units; ; is the coordinate of the i-th phase fluid The distribution function at , dimensionless; is the coordinate at time t The current density at ; is the coordinate at time t The conductivity at ; is the coordinate at time t The electric potential at , in V;

[0050] In the multiphase flow mass flow dynamic modeling and parameter coupling module, the slug flow mass flow prediction model satisfies: ,in, is the total mass flow rate of the slug flow at time t, in units of are the mass flow rate correction coefficients of the gas phase and liquid phase, respectively, dimensionless; are the densities of the gas phase and liquid phase under pressure P and temperature T, respectively, in units of ; are the velocity of gas phase and liquid phase in the plug flow at time t, respectively, in units of ; are the areas occupied by the gas phase and liquid phase in the slug flow at time t on the cross section of the pipe, in units of .

[0051] Specifically, the improved model for the improved electrical tomography data reconstruction and feature extraction module and the prediction model for the multiphase flow dynamic modeling and parameter coupling module have technical parameter settings that closely align with the multiphase flow characteristics of oil and gas wells. The former reconstructs the dielectric constant with a spatial resolution of 128×128 pixels, with an iterative residual error within 0.001, accurately capturing the details of the fluid's dielectric distribution. This is significant in that the features extracted from the precisely reconstructed images provide a reliable basis for subsequent slug flow identification. The latter calculates mass flow with a resolution of 0.01 kg / s, a pressure-density influence coefficient of 0.002 kg / (m³・MPa), and a temperature influence coefficient of -0.5 kg / (m³・℃), quantifying the impact of environmental parameters on flow. During implementation, after the improved model receives the integrated parameters, it preprocesses to remove outliers outside 3 times the standard deviation, reconstructs the image according to the preset iteration step, extracts feature quantities such as grayscale gradient and transmits them; the prediction model receives the slug parameters and the original parameters, first aligns the timestamps, corrects the density and then constructs a mapping relationship, calculates the mass flow and stores it with a timestamp, and sends it to the edge computing module at the same time. During the whole process, the parameters work together to improve the flow measurement accuracy and adapt to complex flow environments.

[0052] Preferably, in the slug flow morphology identification and dynamic parameter analysis module, a slug flow morphology discrimination model is constructed based on the phase distribution characteristic quantity obtained by the improved electrical tomography model: ,in, is the slug flow morphology index at time t, dimensionless; is the total number of feature quantities; is the weight coefficient of the kth feature, dimensionless; is the normalized value of the kth feature at time t, dimensionless; is the coordinate at time t The gradient of the reconstructed dielectric constant at ;

[0053] At the same time, combined with the slug flow mass flow prediction model, a correlation model between slug flow liquid holdup and mass flow rate is established: ,in, is the liquid holdup of the slug flow at time t, dimensionless; is the mass flow rate of the liquid phase in the slug flow at time t, in units of ; is the total cross-sectional area of ​​the pipe, in units of is the dynamic correction coefficient, in units of ; is the rate of change of the total mass flow rate of the slug flow at time t, in units of .

[0054] Specifically, the morphology index model and liquid holdup correlation model in the slug flow morphology identification and dynamic parameter analysis module are designed with technical parameters tailored to the dynamic characteristics of slug flows. The characteristic weighting coefficients used in the morphology index calculation were determined through multiple experiments to ensure the reasonable contribution of each characteristic quantity. The response time does not exceed 100ms, allowing for rapid reflection of slug morphology changes. The liquid holdup calculation error is less than ±1%, and the correction factor β is calibrated based on a 150mm pipe inner diameter to ensure accuracy. Its significance lies in accurately identifying slug morphology through the morphology index, and establishing a relationship between liquid holdup and mass flow rate through the correlation model, providing key parameters for flow calculation. During implementation, after receiving the characteristic quantities, the module constructs an analysis window based on a time series, calculates the rate of change of each characteristic quantity, and then uses the morphology index model to determine slug morphology. Based on the correlation model, the liquid holdup is calculated using parameters such as liquid mass flow rate and pipe area. The parameters are verified during the process to ensure satisfactory correlation with the characteristic quantities. The calculated results are timestamped and transmitted to the modeling module, enabling a precise correlation between slug flow parameters and mass flow rate, improving metering reliability.

[0055] Preferably, in the multi-parameter collaborative acquisition and dynamic adaptation module, a parameter acquisition frequency dynamic adjustment model is established according to the characteristics of different acquisition parameters: ,in, is the acquisition frequency of the i-th parameter at time t, in units of ; is the reference acquisition frequency of the i-th parameter, in units of ; is the frequency adjustment coefficient of the i-th parameter, in s; is the rate of change of the i-th parameter at time t. Its unit depends on the parameter type. For pressure parameters, the unit is , the temperature parameter unit is ; is the absolute value symbol;

[0056] In the improved electrical tomography data reconstruction and feature extraction module, based on the slug flow mass flow prediction model, the feature extraction process is optimized and a mapping model between feature quantity and mass flow is constructed: ,in, is the extracted value of the j-th feature at time t, dimensionless; is the integration time window, in units of ; is the extraction coefficient of the j-th feature quantity, dimensionless; is the integral variable; for The total mass flow rate of the slug flow at time t, in units of ; for Time coordinates The equivalent dielectric constant obtained by reconstruction at is in units of .

[0057] Specifically, the model dynamically adjusts the parameter acquisition frequency and maps the characteristic quantities to mass flow rate, ensuring that technical parameters adapt to dynamic changes in multiphase flow parameters. The acquisition frequency baseline is set based on parameter type: 100 Hz for pressure and temperature, and 50 Hz for flow rate. The adjustment coefficient δi is determined based on parameter sensitivity: 0.02s for pressure and 0.03s for temperature, ensuring timely adjustment of the acquisition frequency when parameters change. The mapping model integration window is set to 1s, and the characteristic quantity extraction coefficient ξj is optimized through data training to achieve a correlation between the characteristic quantity and flow rate of 0.9 or higher. The significance of dynamic frequency adjustment lies in reducing redundant data and improving acquisition efficiency, while the mapping model strengthens the correlation between the characteristic quantity and flow rate, enhancing input quality. During implementation, the multi-parameter collaborative acquisition module acquires data at a baseline frequency, calculates the parameter change rate in real time, and adjusts the frequency based on the model, increasing the frequency when the change rate exceeds a threshold. The improved electrical tomography module receives the characteristic quantities, integrates them within the time window, and uses the results as input to the mapping model, correlating them with the mass flow rate. The correlation is regularly verified and recalculated when it falls below 0.8, ensuring that the characteristic quantities effectively reflect flow changes and providing high-quality data for subsequent modeling.

[0058] Preferably, in the edge-end real-time computing and data compression encoding module, a data compression efficiency optimization model is established based on the calculation results of the improved electrical tomography model and the slug flow mass flow prediction model: ,in, is the data compression efficiency at time t, dimensionless; is the compression base coefficient, dimensionless; is the total number of data points; is the nth original data value at time t; is the nth compressed data value at time t; is the flow influence coefficient, in units of ; is the total mass flow rate of the slug flow at time t, in units of ;

[0059] At the same time, a balance model between compressed data recovery accuracy and computational complexity is constructed: ,in, is the compressed data recovery accuracy at time t, dimensionless; is the accuracy reference coefficient, dimensionless; is the integral variable; for Time coordinates The equivalent dielectric constant obtained by reconstruction at is in units of ; for Time coordinates The gradient of the reconstructed dielectric constant at ; is the influence coefficient of the calculated quantity, dimensionless; is the amount of compression calculation at time t, in units of operations.

[0060] Specifically, the technical parameters of the data compression efficiency optimization model and the recovery accuracy balance model are tailored to data processing and transmission requirements. The compression benchmark coefficient κ was set to 0.8, and the flow rate impact coefficient λ was set to 0.05 s / kg, allowing compression efficiency to dynamically adjust with flow rate. The accuracy benchmark coefficient μ was set to 0.9, and the computational effort impact coefficient ν was set to 0.001, ensuring a balance between recovery accuracy and computational effort. The significance of the optimization model lies in its ability to reduce transmission volume while ensuring data accuracy, while the balance model balances recovery accuracy with computational resources, improving overall system efficiency. During implementation, the edge computing module receives parameters such as mass flow rate, calculates data variance, selects a compression ratio based on the model, and compresses data using a combination of run-length and Huffman coding. After encoding, the compression efficiency is calculated. Furthermore, the encoding strategy is adjusted using the balance model based on the integral of the reconstructed dielectric constant and its gradient, taking into account computational effort, to maintain recovery accuracy above 95%. The compressed data is then verified and transmitted to the remote module. Link quality is checked every 100 packets, and the compression ratio is adjusted if the packet loss rate exceeds 5%, ensuring efficient and reliable data transmission.

[0061] Preferably, in the remote data interaction and storage module, a data storage priority ranking model is established based on the results of the slug flow mass flow prediction model: ,in, is the storage priority of the nth group of data at time t, dimensionless; is the weight coefficient, dimensionless and ; is the total mass flow rate of the slug flow corresponding to the nth group of data at time t, in units of ; is the maximum total mass flow rate of the slug flow in all data groups at time t, in units of ; is the absolute value of the reconstructed dielectric constant change corresponding to the nth group of data at time t, in units of ; is the absolute value of the maximum reconstructed dielectric constant change among all data groups at time t, in units of ;

[0062] At the same time, combined with the improved electrical tomography model, a data transmission rate adjustment model is constructed: ,in, is the data transmission rate at time t, in units of ; is the transmission rate coefficient, in units of ; are all the coordinates in the pipe cross section at time t The sum of the reconstructed dielectric constants at ; are all the coordinates in the pipe cross section at time t The sum of the Laplace values ​​of the reconstructed dielectric constant at ; is the total mass flow rate of the slug flow at time t, in units of .

[0063] Specifically, the technical parameters of the storage priority sorting model and transmission rate adjustment model are set based on data importance and transmission requirements. The weight coefficients ω1 and ω2 are set to 0.6 and 0.4, highlighting the importance of mass flow and dielectric constant variation. The transmission rate coefficient χ was set to 50 bit·s^(1 / 2) / (kg^(1 / 2)·F) in testing to ensure that the rate is adapted to the data volume. The significance of this is that the sorting model can store data according to importance, prioritizing critical information, while the transmission model adjusts the rate based on data characteristics to ensure transmission efficiency and integrity. During implementation, the remote data exchange module receives encoded data and calculates the storage priority of each data group according to the model. The top 30% of the data is stored in the cache, while the remaining data is stored in general storage. Simultaneously, the transmission model calculates the transmission rate based on the sum of the reconstructed dielectric constants and their Laplace values, combined with mass flow, to adjust the wireless communication module's transmit power and bandwidth. During transmission, data is packaged in JSON format and encrypted using AES-256. High-priority data is prioritized during hourly data backups, improving data management efficiency and transmission security.

[0064] Preferably, the slug flow morphology recognition and dynamic parameter analysis module includes: a feature quantity time series correlation analysis unit, which receives the grayscale gradient, boundary curvature and regional area ratio feature quantities output by the improved electrical tomography data reconstruction and feature extraction module, and combines the feature quantities of multiple consecutive moments into a feature sequence in chronological order, and analyzes the change trend and correlation degree of the feature quantities over time by calculating the difference, ratio and covariance of adjacent feature quantities in the sequence; a slug flow stage division unit, which receives the change trend and correlation degree data output by the feature quantity time series correlation analysis unit, sets multiple feature quantity threshold ranges, and determines that the slug flow is in the formation, development or dissipation stage when the feature quantities in the feature sequence fall into different threshold ranges. And record the start and end time of each stage; the dynamic parameter calculation unit receives the stage information and characteristic sequence output by the slug flow stage division unit, calculates the slug length, movement speed and liquid holdup according to the change law of the characteristic quantities of different stages and the pipe cross-sectional size parameters, wherein the slug length is calculated by the displacement and time interval of the characteristic area in the phase distribution image at continuous moments, and the movement speed is calculated by the slug length change rate and the position difference between adjacent moments; the parameter verification unit receives the slug length, movement speed and liquid holdup output by the dynamic parameter calculation unit, and reversely correlates these parameters with the characteristic quantities for verification. When the correlation between the parameter and the characteristic quantity is lower than the set value, the dynamic parameter calculation unit is re-triggered to perform parameter calculation.

[0065] Preferably, the multiphase flow mass flow dynamic modeling and parameter coupling module includes: a parameter screening and association unit, which receives the slug length, movement speed and liquid holdup output by the slug flow morphology recognition and dynamic parameter analysis module, and the pressure, temperature, flow rate and dielectric constant output by the multi-parameter collaborative acquisition and dynamic adaptation module, performs pairwise correlation analysis on these parameters, screens out parameter combinations with a high correlation with mass flow, and establishes a mapping relationship between the parameters; a model structure construction unit, which receives the parameter combination and mapping relationship output by the parameter screening and association unit, and based on the basic framework of the slug flow mass flow prediction model, uses the screened parameters as input variables and the mass flow as output variable. The first step is to process the model structure of the fluid into two parts, and then analyze the influence of pressure and temperature on the fluid density and flow rate, and then embed these influence rules into the model structure in the form of functions, so that the density and flow rate parameters in the model can be dynamically adjusted with the changes in pressure and temperature; the second step is to process the model structure of the fluid into two parts, and then analyze the influence of pressure and temperature on the fluid density and flow rate, and then embed these influence rules into the model structure in the form of functions, so that the density and flow rate parameters in the model can be dynamically adjusted with the changes in pressure and temperature; the third step is to process the model structure of the fluid into two parts, and then analyze the influence of pressure and temperature on the fluid density and flow rate, and then embed these influence rules into the model structure in the form of functions, so that the density and flow rate parameters in the model can be dynamically adjusted with the changes in pressure and temperature; the fourth step is to process the model structure of the fluid into two parts, and then analyze the influence of pressure and temperature on the fluid density and flow rate, and then embed these influence rules into the model structure in the form of functions, so that the density and flow rate parameters in the model can be dynamically adjusted with the changes in pressure and temperature; the fifth ...

[0066] Preferably, the edge real-time computing and data compression coding module includes: a computing task allocation unit, which receives the model structure and parameters output by the multiphase flow mass flow dynamic modeling and parameter coupling module, and decomposes the model computing task into multiple subtasks according to the computing power, memory capacity and current load of the edge computing node, each subtask includes the calculation of some parameters and the solution of some model terms; a parallel computing unit, which receives the subtasks output by the computing task allocation unit, starts multiple computing cores in the edge computing node, and calculates different subtasks at the same time, and each computing core independently performs parameter calculations, intermediate result storage and temporary data exchange of the assigned subtasks; a data compression unit, which receives the calculation results output by the parallel computing unit, groups the result data according to a preset compression rule, and performs encoding conversion on each group of data, thereby reducing the storage capacity of the data by removing redundant information and repetitive patterns in the data; an encoding unit, which receives the compressed data output by the data compression unit, and uses a preset encoding method to convert the compressed data into a binary code stream suitable for transmission, and adds a data check code during the encoding process to verify the integrity of the data after data transmission or storage.

[0067] like Figure 2 As shown, a multiphase flow metering system for oil and gas wells based on edge computing includes the following steps:

[0068] Step S1: Using a multi-parameter collaborative acquisition and dynamic adaptation module, the pressure, temperature, flow rate, and dielectric constant of the fluid in the oil and gas well production fluid transmission pipeline are collected in real time and synchronously, and the collected parameters are preliminarily integrated according to a preset time series association rule. During the integration process, the corresponding relationship between the acquisition timestamps of each parameter is maintained and the original value range of the parameter is not changed;

[0069] Step S2: The preliminarily integrated parameters are transmitted to the improved electrical tomography data reconstruction and feature extraction module via a high-speed data transmission link. Based on the iterative initial value and convergence condition preset in the improved electrical tomography model, the dielectric distribution image inside the fluid is reconstructed in multiple rounds. The grayscale gradient, boundary curvature, and regional area ratio feature values ​​reflecting the phase distribution characteristics are extracted from the image obtained in each round of reconstruction, and the feature values ​​of all rounds are retained.

[0070] Step S3: The extracted feature values ​​of all rounds are transmitted to the slug flow morphology identification and dynamic parameter analysis module. The optimal feature value combination is determined by comparing the differences in the feature values ​​of different rounds. The dynamic change pattern of the feature values ​​is analyzed based on the combination to identify the formation, development and dissipation stages of the slug flow, and the slug length, movement speed and liquid holdup corresponding to each stage are calculated.

[0071] Step S4: transmitting the slug flow parameters and the original acquired parameters output by the multi-parameter collaborative acquisition and dynamic adaptation module to the multiphase flow mass flow dynamic modeling and parameter coupling module; based on the weight distribution rule of the parameters in the slug flow mass flow prediction model, constructing a nonlinear mapping relationship between the mass flow and each parameter; and synchronously processing the coupling effects of pressure and temperature on fluid density and flow velocity to correct the mapping relationship;

[0072] Step S5: Transmit the corrected mapping relationship and the coupled parameters to the edge real-time computing and data compression coding module, use the computing task scheduling mechanism preset in the edge computing architecture to perform parallel computing on the parameters, and encode the computing results according to the data grouping and encoding rules in the preset compression algorithm, maintaining the logical association of the data during the encoding process;

[0073] Step S6: Transmit the encoded results to the remote data interaction and storage module via a wireless communication link, classify and store the results in timestamp order, and when an external data query instruction is received, decrypt the encoded data according to a preset decryption algorithm and transmit it in the format required by the instruction.

[0074] A multiphase flow metering system for oil and gas wells based on edge computing. The primary advantage of this system is that the collaborative work of multiple modules improves metering accuracy. The multi-parameter collaborative acquisition and dynamic adaptation module realizes the real-time synchronous acquisition and integration of parameters such as pressure and temperature, providing a comprehensive data foundation for subsequent processing; the improved electrical tomography data reconstruction and feature extraction module iteratively reconstructs the dielectric distribution image through an improved model, and the extracted phase distribution characteristics are more in line with the actual flow pattern. This collaborative mechanism effectively solves the problems of traditional electrical tomography methods' lack of adaptability to complex flow patterns and low matching of characteristic quantities, making flow calculations based on characteristic quantities more accurate.

[0075] Secondly, the system excels in dynamic modeling and computational efficiency. The mapping relationships constructed by the dynamic modeling and parameter coupling modules for multiphase mass flow fully incorporate the coupled effects of pressure and temperature on fluid density and flow velocity, improving the dynamic parameter adjustment mechanism and making slug flow mass flow predictions more realistic. The edge-side real-time computing and data compression coding modules perform parallel operations and encoding close to the acquisition end, significantly reducing data transmission volume and latency. This overcomes the shortcomings of existing technologies, such as imperfect model parameter adjustment and reliance on cloud computing, which results in poor real-time performance.

[0076] Furthermore, the system boasts excellent adaptability and reliability. The slug flow morphology recognition and dynamic parameter analysis module accurately identifies each stage of slug flow and calculates parameters, while a parameter verification unit ensures parameter accuracy. The remote data exchange and storage module stores and transmits data according to established rules, ensuring data integrity and accessibility. These features enable the system to adapt to the complex and ever-changing production environments of oil and gas wells, continuously and stably output reliable measurement results, and provide strong support for optimizing oil and gas field production.

[0077] In the description of the present invention, it should be noted that, unless otherwise expressly specified or limited, the terms "disposed," "installed," "connected," "connected," and "fixed" should be understood in a broad sense. For example, they may refer to fixed connections, detachable connections, or integral connections; they may refer to mechanical connections or electrical connections; they may refer to direct connections or indirect connections through an intermediate medium; and they may refer to internal communication between two components. Those skilled in the art will understand the specific meanings of the above terms in the present invention based on specific circumstances.

[0078] While embodiments of the present invention have been shown and described, it will be understood by those skilled in the art that various equivalent changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the invention, and that the scope of the invention is defined by the appended claims and their equivalents.

Claims

1. An oil and gas well multiphase flow metering system based on edge computing, characterized in that: include: A multi-parameter collaborative acquisition and dynamic adaptation module, connected to the outer wall of the oil and gas well production fluid transmission pipeline, is used to synchronously acquire the pressure, temperature, flow rate and dielectric constant of the fluid in the pipeline in real time, and preliminarily integrate the acquired parameters according to preset time-series association rules; An improved electrical tomography data reconstruction and feature extraction module, whose input is connected to the output of the multi-parameter collaborative acquisition and dynamic adaptation module via a high-speed data transmission link. This module receives the integrated parameters, iteratively reconstructs the dielectric distribution image inside the fluid based on the improved electrical tomography model, and extracts grayscale gradient, boundary curvature, and regional area ratio characteristics that reflect phase distribution characteristics from the reconstructed image; A slug flow morphology identification and dynamic parameter analysis module, whose input is connected to the output of the improved electrical tomography data reconstruction and feature extraction module, receives the aforementioned feature quantities, identifies the slug flow's formation, development, and dissipation stages by analyzing the dynamic changes in the feature quantities, and calculates the slug length, movement velocity, and liquid holdup corresponding to each stage; The multiphase flow mass flow dynamic modeling and parameter coupling module has its input connected to the output of the slug flow morphology identification and dynamic parameter analysis module and the output of the multi-parameter collaborative acquisition and dynamic adaptation module. It receives slug flow parameters and original acquisition parameters, constructs a nonlinear mapping relationship between mass flow and various parameters based on the slug flow mass flow prediction model, and simultaneously processes the coupled effects of pressure and temperature on fluid density and flow velocity. The edge real-time computing and data compression encoding module, whose input is connected to the output of the multiphase flow mass flow dynamic modeling and parameter coupling module, receives the mapping relationship and coupled parameters, uses the edge computing architecture to perform parallel computing on the parameters, and encodes the calculation results according to the preset compression algorithm; Remote data interaction and storage module, whose input is connected to the output of the edge real-time computing and data compression coding module via a wireless communication link. It receives the encoded results, classifies and stores them in timestamp order, and can respond to external data query instructions to decrypt and transmit the encoded data; In the improved electrical tomography data reconstruction and feature extraction module, the improved electrical tomography model satisfies: Among them, ε recon (x, y, t) is the equivalent dielectric constant reconstructed at the coordinate (x, y) in the pipeline at time t; N is the total number of phases; ε i is the dielectric constant of the i-th phase fluid; φ i (x, y) is the dimensionless distribution function of the i-th phase fluid at the coordinate (x, y); J(x, y, t) is the current density at the coordinate (x, y) at time t; σ(x, y, t) is the conductivity at the coordinate (x, y) at time t; φ(x, u, y) is the potential at the coordinate (x, y) at time t; In the multiphase flow mass flow dynamic modeling and parameter coupling module, the slug flow mass flow prediction model satisfies: q m,slug (t) = α G ·ρ G (P, T)·v G,slug (t)·A G,slug (t)+α L ·ρ L (P, T)·v L,slug (t)·A L,slug (t), where q m,slug (t) is the total mass flow rate of the slug flow at time t; α G , α L are the mass flow rate correction coefficients of the gas phase and liquid phase, dimensionless; ρ G (P, T), ρ L (P, T) are the densities of the gas phase and liquid phase under pressure P and temperature T respectively; v G,slug (t), v L,slug (t) are the velocity of gas phase and liquid phase in the slug flow at time t; A G,slug (t), A L,slug (t) are the areas occupied by the gas phase and liquid phase in the slug flow at time t on the cross section of the pipe.

2. The system according to claim 1, wherein: In the slug flow morphology identification and dynamic parameter analysis module, a slug flow morphology discrimination model is constructed based on the phase distribution characteristics obtained by the improved electrical tomography model: Among them, M slug (t) is the slug flow morphology index at time t, dimensionless; M is the total number of characteristic quantities; γ k is the weight coefficient of the kth feature, dimensionless; S k (t) is the normalized value of the kth feature at time t, dimensionless; Reconstruct the gradient of the dielectric constant at the coordinate (x, y) at time t; At the same time, combined with the slug flow mass flow prediction model, a correlation model between slug flow liquid holdup and mass flow rate is established: Among them, H L,slug (t) is the liquid holdup of the slug flow at time t, dimensionless; q m,L,slug (t) is the mass flow rate of the liquid phase in the slug flow at time t; A total is the total cross-sectional area of ​​the pipeline; β is the dynamic correction coefficient; is the rate of change of the total mass flow rate of the slug flow at time t.

3. The system according to claim 1, wherein: In the multi-parameter collaborative acquisition and dynamic adaptation module, a parameter acquisition frequency dynamic adjustment model is established based on the characteristics of different acquisition parameters: Among them, f s,i (t) is the acquisition frequency of the i-th parameter at time t; f 0,i is the reference acquisition frequency of the i-th parameter; δ i is the frequency adjustment coefficient of the i-th parameter; is the rate of change of the i-th parameter at time t; |·| is the absolute value symbol; In the improved electrical tomography data reconstruction and feature extraction module, based on the slug flow mass flow prediction model, the feature extraction process is optimized and a mapping model between feature quantity and mass flow is constructed: Among them, F j (t) is the extracted value of the jth feature at time t, dimensionless; T is the integration time window; ξ j is the extraction coefficient of the jth feature, dimensionless; τ is the integral variable; q m,slug (τ) is the total mass flow rate of the slug flow at time τ; ε recon (x, y, τ) is the equivalent dielectric constant reconstructed at the coordinate (x, y) at time τ.

4. The system according to claim 1, wherein: In the edge real-time computing and data compression encoding module, a data compression efficiency optimization model is established based on the calculation results of the improved electrical tomography model and the slug flow mass flow prediction model: Among them, η comp (t) is the data compression efficiency at time t, dimensionless; k is the compression base coefficient, dimensionless; N data is the total number of data points; Q n (t) is the nth original data value at time t; is the nth compressed data value at time t; λ is the flow influence coefficient; q m,slug (t) is the total mass flow rate of the slug flow at time t; At the same time, a balance model between compressed data recovery accuracy and computational complexity is constructed: Among them, R rec (t) is the compressed data recovery accuracy at time t, dimensionless; μ is the accuracy reference coefficient, dimensionless; τ is the integral variable; ε recon (x, y, τ) is the equivalent dielectric constant reconstructed at the coordinate (x, y) at time τ; is the gradient of the reconstructed dielectric constant at the coordinate (x, y) at time τ; v is the influence coefficient of the calculated amount, dimensionless; C comp (t) is the amount of compression calculation at time t.

5. The system according to claim 1, wherein: In the remote data interaction and storage module, a data storage priority ranking model is established based on the results of the slug flow mass flow prediction model: Among them, P store,n (t) is the storage priority of the nth group of data at time t, dimensionless; ω1 and ω2 are weight coefficients, dimensionless and ω1+ω2=1; q m,slug,n (t) is the total mass flow rate of the slug flow corresponding to the nth group of data at time t; max(q m,slug,k (t)) is the maximum total mass flow rate of the slug flow in all data groups at time t; |Δε recon,n (t)| is the absolute value of the reconstructed dielectric constant change corresponding to the nth group of data at time t; max(|Δε recon,k (t)|) is the absolute value of the maximum reconstructed dielectric constant change among all data groups at time t; At the same time, combined with the improved electrical tomography model, a data transmission rate adjustment model is constructed: Among them, v trans (t) is the data transmission rate at time t; χ is the transmission rate coefficient; ∑ x,y ε recon (x, y, t) is the sum of the reconstructed dielectric constants at all coordinates (x, y) in the pipe cross section at time t; is the sum of the Laplace values ​​of the reconstructed dielectric constants at all coordinates (x, y) in the pipe cross section at time t; m,slug (t) is the total mass flow rate of the slug flow at time t.

6. The system according to claim 1, wherein: The slug flow morphology recognition and dynamic parameter analysis module includes: a feature quantity time series correlation analysis unit, which receives the grayscale gradient, boundary curvature and regional area ratio feature quantities output by the improved electrical tomography data reconstruction and feature extraction module, and combines the feature quantities of multiple consecutive moments into a feature sequence in chronological order, and analyzes the change trend and correlation degree of the feature quantities over time by calculating the difference, ratio and covariance of adjacent feature quantities in the sequence; a slug flow stage division unit, which receives the change trend and correlation degree data output by the feature quantity time series correlation analysis unit, sets multiple feature quantity threshold ranges, and determines that the slug flow is in the formation, development or dissipation stage when the feature quantities in the feature sequence fall into different threshold ranges, and records them. The start and end time of each stage; the dynamic parameter calculation unit receives the stage information and feature sequence output by the slug flow stage division unit, calculates the slug length, movement speed and liquid holdup according to the change law of the feature quantities in different stages and the pipe cross-sectional size parameters, wherein the slug length is calculated by the displacement and time interval of the feature area in the phase distribution image at continuous moments, and the movement speed is calculated by the slug length change rate and the position difference between adjacent moments; the parameter verification unit receives the slug length, movement speed and liquid holdup output by the dynamic parameter calculation unit, and reversely correlates these parameters with the feature quantities for verification. When the correlation between the parameter and the feature quantity is lower than the set value, the dynamic parameter calculation unit is re-triggered to perform parameter calculation.

7. The system according to claim 1, wherein: The multiphase flow mass flow dynamic modeling and parameter coupling module includes: a parameter screening and association unit, which receives the slug length, movement speed and liquid holdup output by the slug flow morphology recognition and dynamic parameter analysis module, and the pressure, temperature, flow rate and dielectric constant output by the multi-parameter collaborative acquisition and dynamic adaptation module, performs a pairwise correlation analysis on these parameters, screens out parameter combinations with a high correlation with mass flow, and establishes a mapping relationship between the parameters; a model structure construction unit, which receives the parameter combination and mapping relationship output by the parameter screening and association unit, and uses the screened parameters as input variables and the mass flow as output variables based on the basic framework of the slug flow mass flow prediction model. A model structure containing multiple nonlinear terms is constructed, in which the coefficients in the model structure are preliminarily determined through the mapping relationship between parameters; a parameter coupling processing unit receives the model structure output by the model structure construction unit, analyzes the influence of pressure and temperature on fluid density and flow rate, and embeds these influence laws into the model structure in the form of functions, so that the density and flow rate parameters in the model are dynamically adjusted with changes in pressure and temperature; a model optimization unit receives the coupled model structure output by the parameter coupling processing unit, and adjusts the coefficients in the model structure by comparing the model calculation results with the actually measured mass flow data, so that the deviation between the model calculation results and the actually measured data is within a set range.

8. The system according to claim 1, wherein: The edge real-time computing and data compression encoding module includes: a computing task allocation unit, which receives the model structure and parameters output by the multiphase flow mass flow dynamic modeling and parameter coupling module, and decomposes the model computing task into multiple subtasks based on the computing power, memory capacity and current load of the edge computing node, each subtask including the calculation of some parameters and the solution of some model terms; a parallel computing unit, which receives the subtasks output by the computing task allocation unit, starts multiple computing cores in the edge computing node, and calculates different subtasks at the same time, each computing core independently performs parameter calculations, intermediate result storage and temporary data exchange for the assigned subtasks; a data compression unit, which receives the calculation results output by the parallel computing unit, groups the result data according to a preset compression rule, and performs encoding conversion on each group of data, thereby reducing the storage capacity of the data by removing redundant information and repeated patterns in the data; an encoding unit, which receives the compressed data output by the data compression unit, converts the compressed data into a binary code stream suitable for transmission using a preset encoding method, and adds a data check code during the encoding process to verify the integrity of the data after data transmission or storage.

Citation Information

Patent Citations

  • Gas-water two phase flow multiparameter measuring method and device

    CN101556234A

  • Multiphase flow online real-time metering artificial intelligence model construction method

    CN111460625A