An oil bubble flow water cut prediction method based on ordinal complex network feature fusion
By constructing a GRU network model based on ordinal complex network feature fusion, the real-time and accuracy problems of water cut measurement in oil-water two-phase flow are solved, and accurate prediction of water cut in oil bubble flow is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- TIANJIN UNIV OF SCI & TECH
- Filing Date
- 2022-11-08
- Publication Date
- 2026-05-01
AI Technical Summary
Existing methods for measuring water content in oil-water two-phase flow suffer from poor real-time performance and low measurement accuracy, making it difficult to achieve accurate and rapid water content prediction.
A method based on ordinal complex network feature fusion is adopted. By acquiring dynamic images of two-phase flow, time series and ordinal complex networks are constructed, diversified network indices are calculated, and a water content prediction model based on GRU network is constructed, trained and optimized, and finally the water content is predicted.
It achieves accurate measurement of water content in oil bubble flow, eliminates uncertainties in laboratory tests and subjectivity of human operation, and has strong predictive performance and objectivity.
Smart Images

Figure CN115907523B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of oil-water two-phase flow water content measurement technology, and in particular, it is a method for predicting the water content of oil bubble flow based on the fusion of ordinal complex network features. Background Technology
[0002] With the continuous development of technology, many industries such as chemical and petroleum have increasingly higher requirements for the measurement accuracy of water cut in oil-water two-phase flow. Relying solely on the statistical characteristics of the signal to reflect the water cut of oil-water two-phase flow will lose the transient evolution information of the flow in the measurement signal, making it difficult to predict the water cut of oil-water two-phase flow.
[0003] Currently, most methods for measuring the water content of oil-water two-phase flows suffer from poor real-time performance and low measurement accuracy. Therefore, accurate and rapid measurement of the water content of oil-water two-phase flows remains a technical challenge. Existing two-phase flow measurement methods, such as ultrasonic, optical, and X-ray methods, are insufficient for achieving accurate real-time measurement of the water content of oil-water two-phase flows.
[0004] Soft measurement models have seen rapid development in the field of multiphase flow in recent years, especially with the application of deep learning methods and artificial intelligence technologies, which have broadened their application scope. Deep learning technology is a new theory that has emerged in recent years. It extracts features of the measured object layer by layer through unsupervised or supervised methods. These features are highly objective and can accurately and comprehensively reflect the essence of the measured object. Soft measurement methods can fuse multiphase data measured by sensors, and intelligent and deep learning methods can accurately and efficiently extract feature information of multiphase flow. Therefore, it is very important to find a way to effectively predict the water content of oil bubble flow using deep learning models. Summary of the Invention
[0005] The purpose of this invention is to overcome the shortcomings of the prior art and propose an oil bubble flow water cut prediction method based on ordinal complex network feature fusion, which can capture the basic characteristics and laws of water cut changes in oil-water two-phase flow.
[0006] The technical problem solved by this invention is achieved through the following technical solution:
[0007] A method for predicting the water content of oil bubble flow based on ordinal complex network feature fusion includes the following steps:
[0008] Step 1: Acquire dynamic images of the two-phase flow as sample data;
[0009] Step 2: Obtain the mean grayscale value of the images in the sample data, construct a time series, and obtain the final dataset;
[0010] Step 3: Construct an ordinal complex network based on the time series, and fuse the indicators of the ordinal complex network to obtain diversified network indicators;
[0011] Step 4: Using diverse network indicators as input, construct a water content prediction model based on GRU networks;
[0012] Step 5: Train the constructed moisture content prediction model, optimize its structure and adjust its parameters to obtain the final model, and use the final model to predict the moisture content.
[0013] Moreover, the specific implementation method of step 1 is as follows: fix a high-speed camera in front of the vertically rising test pipe, capture dynamic images under different working conditions, save the collected dynamic images as sample data, and record the calibrated moisture content as a prediction label.
[0014] Furthermore, step 2 includes the following steps:
[0015] Step 2.1: Segment the dynamic image into several images, calculate the mean gray value of each image, and combine them into a time series;
[0016] Step 2.2: Use the time series as the dataset and randomly divide the dataset into training set, validation set and test set.
[0017] Furthermore, the specific implementation method of step 2.1 is as follows: the dynamic image is segmented into several images, the average gray level g of each image is calculated, and a two-phase flow time series based on the gray level value is constructed:
[0018]
[0019] Where S represents all possible grayscale values of the image, z k Let p(z) be the number of gray levels. k () represents grayscale z k The probability of appearing in the image, k = 0, 1, 2, ..., S-1.
[0020] Moreover, the specific implementation method of step 2.2 is as follows: the obtained grayscale time series is used as the final dataset and randomly divided into training set, validation set and test set, wherein the ratio of training set, validation set and test set is 6:2:2.
[0021] Furthermore, step 3 includes the following steps:
[0022] Step 3.1: Construct an ordinal complex network based on the time series;
[0023] Step 3.2: Calculate the following indicators for ordinal complex networks: average degree, average shortest path length, network density, clustering coefficient, node entropy, prime ring, probability of missing ordinal patterns, and stretching exponent, and construct a diversified network indicator.
[0024] Furthermore, the specific implementation method of step 3.1 is as follows: set the embedding dimension D and the delay time τ, and process the obtained time series {x} of length N. t The phase space is reconstructed to obtain the phase space point vector y. t =[x t ,x t+τ ,x t+2τ ,...,x t+(N-1)τ Then, the elements in the phase space point vector are sorted according to their amplitude to obtain an ordinal pattern π. i For t = 1, ..., N-(D-1)τ, generate the set {π} of ordinal patterns. i Each ordinal pattern corresponds to a node in the network, and as time t progresses, the ordinal pattern π corresponds to... i Next time sequence pattern π j The transfer, establishing a π i to π j The directed edges, nodes, and directed edges constitute an ordinal complex network.
[0025] Furthermore, the method for calculating the average degree in step 3.2 is: the average degree of all nodes in the ordinal complex network. <k>:
[0026]
[0027] Where N is the number of nodes, A = (a i,j ) N×N It is an adjacency matrix;
[0028] Network density is calculated as the ratio ρ of the actual number of edges M to the maximum possible number of edges in the network.
[0029]
[0030] The average shortest path length is calculated as the average distance L between any two nodes.
[0031]
[0032] Where, d i,j Let be the number of edges on the shortest path connecting node i and node j;
[0033] The clustering coefficient is calculated as follows: C represents the degree of connectivity between the adjacent nodes of a node. i :
[0034]
[0035] Where, k i Let E be the degree of node i. i Let be the number of edges that actually exist between the neighboring nodes of node i;
[0036] Node entropy H GN The calculation method is as follows:
[0037]
[0038]
[0039]
[0040] Where, p′ i Let be the sum of the probabilities of reaching node i from its neighboring nodes. Let be the local entropy of the node;
[0041] The method for calculating the prime number ring is: a loop path in a network link where each node traverses the loop only once;
[0042] Missing ordinal pattern probability: The ratio P(MOP) of missing ordinal patterns to the total number of ordinal patterns in a time series.
[0043]
[0044] Where D is the embedding dimension and OP is the number of ordinal patterns that appear;
[0045] The stretching exponent is calculated as follows: For a given time series of length N, a non-overlapping window of length ω is used to truncate it, obtaining... The model is divided into several time series segments, and the number of MOPs for each segment is calculated. The average number of MOPs for different ω values is calculated. Finally, the stretching exponential model is fitted using the least squares method to obtain the characteristic decay rate and the stretching exponent. <mop>Each ω corresponds to one <mop>The decay curve formed by these points is fitted using the least squares method with a model of the stretching exponent ω, yielding the characteristic decay rate B and the stretching exponent γ:
[0046] <mop>=C·e -Bωγ
[0047] Where C is a constant, B is the characteristic decay rate, γ is the stretching exponent, and finally, a diversified network index is constructed based on the ordinal complex network index.
[0048] Furthermore, the specific implementation method of step 4 is as follows:
[0049]
[0050] in, For the current candidate set, H t-1 X is the output from the previous time step. t For the input at the current time, R t To make H t-1 and X t Z calculates forgotten or retained information by resetting the gate. t To make h t-1 and X t The update gate calculation requires information to be saved and updated, H t The model output is defined by W as the weight and b as the bias. The multivariate network metrics at time t1 are first input into the GRU network to obtain the output at time t1, which is then used as input for the computation at time t2. This computation is repeated until the result at the last time point is output and input into the fully connected network. Each node in the fully connected layer is interconnected with all nodes in the previous layer, integrating the features extracted by the previous layer and mapping these features to the sample label space. The fully connected layer performs a weighted summation of the features output from the previous layer and inputs the result into the activation function to predict the water content y. w,b (x):
[0051]
[0052] Among them, w i x represents the weight coefficients in the fully connected layer. i b is the value of the i-th neuron in the previous layer. i This represents the bias of the fully connected layer.
[0053] Furthermore, step 5 includes the following steps:
[0054] Step 5.1: Set the hyperparameters in the GRU network model based on multivariate parameter fusion, and optimize the training hyperparameters using a gridded search algorithm;
[0055] Step 5.2: Evaluate the model's predictive performance using root mean square error and mean relative error;
[0056] The root mean square error (RMSE) is:
[0057]
[0058] The mean relative error ARE is:
[0059]
[0060] Among them, y real,i Represents real data, y test,i This represents the test set data, where n is the number of measurements.
[0061] Step 5.3: Obtain the final model based on the evaluation results, and use the final model to predict the moisture content.
[0062] The advantages and positive effects of this invention are:
[0063] This invention uses acquired dynamic images as sample data; it obtains the grayscale mean of the sample data to construct a time series, resulting in the final dataset; then, it constructs a network topology graph of the time series using the ordinal complex network method, calculates the network's characteristic indicators, and fuses them to obtain diversified network indicators; finally, it constructs a moisture content prediction model based on a GRU network; the constructed network model is trained to obtain the optimal model, which is then used to predict moisture content. The deep neural network used in this invention is objective in predicting moisture content, eliminating the uncertainties and subjectivity inherent in laboratory testing. The GRU network and fully connected network, after training with a large amount of data and numerous iterations, exhibit strong predictive performance and objectivity for this type of data. Attached Figure Description
[0064] Figure 1 This is a schematic diagram illustrating the construction of a two-phase flow time series according to the present invention;
[0065] Figure 2 This is a schematic diagram illustrating the construction of diversified indicators for complex networks according to the present invention;
[0066] Figure 3 This is a structural diagram of the GRU network model based on multi-feature fusion in this invention. Detailed Implementation
[0067] The present invention will be further described in detail below with reference to the accompanying drawings.
[0068] A method for predicting the water content of oil bubble flow based on ordinal complex network feature fusion includes the following steps:
[0069] Step 1: Collect dynamic images of the two-phase flow as sample data.
[0070] The specific implementation method for this step is as follows:
[0071] In the two-phase flow dynamic experiment, a high-speed camera was fixed in front of a vertically rising test pipe to capture dynamic images under different operating conditions. The camera lens was parallel to the vertical pipe, and the camera parameters were set to a frame rate of 350 FPS, capturing color images with a resolution of 448x988 pixels. The acquired dynamic images were saved as sample data, and the calibrated moisture content was recorded as a prediction label.
[0072] Step 2: Obtain the mean grayscale value of the images in the sample data, construct a time series, and obtain the final dataset.
[0073] The specific implementation method for this step is as follows:
[0074] Step 2.1: Segment the dynamic image into several images, calculate the average gray level g of each image, and construct a two-phase flow time series based on the gray level values:
[0075]
[0076] Where S represents all possible grayscale values of the image, z k Let p(z) be the number of gray levels. k () represents grayscale z k The probability of appearing in the image, k = 0, 1, 2, ..., S-1.
[0077] Step 2.2: Use the obtained grayscale time series as the final dataset and randomly divide it into training set, validation set and test set, with the specific ratio of [training set: validation set: test set] = [6:2:2].
[0078] Step 3: Construct an ordinal complex network based on the time series, and fuse the indicators of the ordinal complex network to obtain diversified network indicators.
[0079] The specific implementation method for this step is as follows:
[0080] Step 3.1: Construct an ordinal complex network based on the time series.
[0081] like Figure 1 As shown, given the embedding dimension D and the delay time τ, the resulting time series {x} of length N is processed. t The phase space is reconstructed to obtain the phase space point vector y. t =[x t ,x t+τ ,x t+2τ ,...,x t+(N-1)τ Then, the elements in the phase space point vector are sorted according to their amplitude to obtain an ordinal pattern π. i For t = 1, ..., N-(D-1)τ, generate the set {π} of ordinal patterns. i Each ordinal pattern corresponds to a node in the network, and as time t progresses, the ordinal pattern π corresponds to... i Next time sequence pattern π j The transfer, establishing a π i to π j The directed edges, nodes, and directed edges constitute an ordinal complex network.
[0082] Step 3.2: Calculate the following indicators for ordinal complex networks: average degree, average shortest path length, network density, clustering coefficient, node entropy, prime ring, probability of missing ordinal patterns, and stretching exponent, and construct a diversified network indicator.
[0083] The average degree is calculated as the average degree of all nodes in an ordinal complex network. <k>:
[0084]
[0085] Where N is the number of nodes, A = (a i,j ) N×N It is an adjacency matrix;
[0086] Network density is calculated as the ratio ρ of the actual number of edges M to the maximum possible number of edges in the network.
[0087]
[0088] The average shortest path length is calculated as the average distance L between any two nodes.
[0089]
[0090] Where, d i,j Let be the number of edges on the shortest path connecting node i and node j;
[0091] The clustering coefficient is calculated as follows: C represents the degree of connectivity between the adjacent nodes of a node. i :
[0092]
[0093] Where, k i Let E be the degree of node i. i Let be the number of edges that actually exist between the neighboring nodes of node i;
[0094] Node entropy H GN The calculation method is as follows:
[0095]
[0096]
[0097]
[0098] Where, p′ i Let be the sum of the probabilities of reaching node i from its neighboring nodes. Let be the local entropy of the node;
[0099] The method for calculating the prime number ring is: a loop path in a network link where each node traverses the loop only once;
[0100] Missing ordinal pattern probability: The ratio P(MOP) of missing ordinal patterns to the total number of ordinal patterns in a time series.
[0101]
[0102] Where D is the embedding dimension and OP is the number of ordinal patterns that appear;
[0103] The stretching exponent is calculated as follows: For a given time series of length N, a non-overlapping window of length ω is used to truncate it, obtaining... The model is divided into several time series segments, and the number of MOPs for each segment is calculated. The average number of MOPs for different ω values is calculated. Finally, the stretching exponential model is fitted using the least squares method to obtain the characteristic decay rate and the stretching exponent. <mop>Each ω corresponds to one <mop>The decay curve formed by these points is fitted using the least squares method with a model of the stretching exponent ω, yielding the characteristic decay rate B and the stretching exponent γ:
[0104] <mop>=C·e -Bωγ
[0105] Where C is a constant, B is the characteristic attenuation rate, and γ is the stretching exponent, such as Figure 2 As shown, a diversified network index is constructed based on the ordinal complex network index.
[0106] Step 4: Using diverse network indicators as input, construct a water content prediction model based on GRU network.
[0107] like Figure 3 As shown, the GRU network in this step includes a GRU neural network module and a fully connected network module. The GRU network module consists of an update gate and a reset gate. The reset gate controls how much information from the previous state is written into the current candidate set. Above, a smaller reset gate indicates more information is ignored; the update gate controls the degree to which previous state information is incorporated into the current state, a larger update gate value indicates more previous state information is written. First, the output h from the previous time step is applied. t-1 and the input x at the current time t The forgotten (retained) information r is calculated by resetting the gate. t Then apply h t-1 and x t The update gate calculates the information z that needs to be saved and updated. t Finally, the model output h is obtained. t The output h at the current time is obtained. t With the input x at the next time step t+1 The input is fed into the next layer of the GRU network, and so on.
[0108] The resulting water content prediction model based on the GRU network is as follows:
[0109]
[0110] in, For the current candidate set, H t-1 X is the output from the previous time step. t For the input at the current time, R t To make H t-1 and X t Z calculates forgotten or retained information by resetting the gate. t To make h t-1 and X t The update gate calculation requires information to be saved and updated, H t The model output is defined by W as the weight and b as the bias. The multivariate network metrics at time t1 are first input into the GRU network to obtain the output at time t1, which is then used as input for the computation at time t2. This computation is repeated until the result at the last time point is output and input into the fully connected network. Each node in the fully connected layer is interconnected with all nodes in the previous layer, integrating the features extracted by the previous layer and mapping these features to the sample label space. The fully connected layer performs a weighted summation of the features output from the previous layer and inputs the result into the activation function to predict the water content y. w,b (x):
[0111]
[0112] Among them, w i x represents the weight coefficients in the fully connected layer. i b is the value of the i-th neuron in the previous layer. i This represents the bias of the fully connected layer.
[0113] Step 5: Train the constructed moisture content prediction model, optimize its structure and adjust its parameters to obtain the final model, and use the final model to predict the moisture content.
[0114] The specific implementation method for this step is as follows:
[0115] Step 5.1: Set the hyperparameters in the GRU network model based on multi-parameter fusion, and optimize the training hyperparameters using a gridded search algorithm; optimize the model using the learning rate, number of network layers, number of neurons in the network, and dropout. The model after using the gridded search algorithm is the optimal state.
[0116] Step 5.2: Evaluate the model's predictive performance using root mean square error and mean relative error;
[0117] The root mean square error (RMSE) is:
[0118]
[0119] The mean relative error ARE is:
[0120]
[0121] Among them, y real,i Represents real data, y test,i This represents the test set data, where n is the number of measurements.
[0122] Step 5.3: Obtain the final model based on the evaluation results, and use the final model to predict the moisture content.
[0123] This invention uses high-speed photography to acquire dynamic images of oil bubble flow and obtain the grayscale mean of the images to construct a two-phase flow time series. Based on the feature index of ordinal complex network, a diversified network index is constructed. Based on the feature fusion model of ordinal complex network, the water content feature in the measurement signal is extracted and predicted. A supervised learning method is adopted, and the water content test value is labeled to achieve accurate measurement of water content in oil bubble flow.
[0124] It should be emphasized that the embodiments described in this invention are illustrative rather than limiting. Therefore, this invention includes, but is not limited to, the embodiments described in the specific implementation. Any other implementations derived by those skilled in the art based on the technical solutions of this invention are also within the scope of protection of this invention.< / mop> < / mop> < / mop> < / k> < / mop> < / mop> < / mop> < / k>
Claims
1. A method for predicting water content in oil bubble flow based on ordinal complex network feature fusion, characterized in that: Includes the following steps: Step 1: Acquire dynamic images of the two-phase flow as sample data; Step 2: Obtain the mean grayscale value of the images in the sample data, construct a time series, and obtain the final dataset; Step 3: Construct an ordinal complex network based on the time series, and fuse the indicators of the ordinal complex network to obtain diversified network indicators; Step 3.1: Construct an ordinal complex network based on the time series; The specific implementation method of step 3.1 is as follows: Set the embedding dimension. and delay time The obtained length is time series Phase space reconstruction is performed to obtain phase space point vectors. Then, the elements in the phase space point vector are sorted according to their amplitude to obtain an ordinal pattern. ,for Generate a collection of ordinal patterns Each ordinal pattern corresponds to a node in the network, and simultaneously, over time... The shift corresponds to the ordinal pattern. Next time sequence pattern The transfer, establishing a arrive The directed edges, nodes and directed edges constitute an ordinal complex network; Step 3.2: Calculate the following indicators for ordinal complex networks: average degree, average shortest path length, network density, clustering coefficient, node entropy, prime ring, probability of missing ordinal patterns, and stretching exponent, and construct a diversified network indicator system. Step 4: Using diverse network indicators as input, construct a water content prediction model based on GRU networks; The specific implementation method of step 4 is as follows: in, For the current candidate set, This is the output from the previous moment. For the current input, To be and The information that has been forgotten or retained is calculated by resetting the gate. To be and The update gate calculates the information that needs to be saved and updated. For model output, As weight, For the bias value, the first moment The diverse network metrics are first input into the GRU network to obtain the first time point. The output is used as input for the second time point. The calculations are repeated, and the result of the calculation at the last time point is output and input into the fully connected network. Each node in the fully connected layer is interconnected with all nodes in the previous layer, integrating the features extracted by the previous network and mapping these features to the sample label space. The fully connected layer performs a weighted sum of the features output by the previous layer and inputs the result into the activation function to complete the prediction of water content. : in, These are the weight coefficients in the fully connected layer. For the next level The value of each neuron, This is the bias value for the fully connected layer; Step 5: Train the constructed moisture content prediction model, optimize its structure and adjust its parameters to obtain the final model, and use the final model to predict the moisture content.
2. The method for predicting water content in oil bubble flow based on ordinal complex network feature fusion according to claim 1, characterized in that: The specific implementation method of step 1 is as follows: fix a high-speed camera in front of the vertically rising test pipe, capture dynamic images under different working conditions, save the collected dynamic images as sample data, and record the calibrated moisture content as a prediction label.
3. The method for predicting water content in oil bubble flow based on ordinal complex network feature fusion according to claim 1, characterized in that: Step 2 includes the following steps: Step 2.1: Segment the dynamic image into several images, calculate the mean gray value of each image, and combine them into a time series; Step 2.2: Use the time series as the dataset and randomly divide the dataset into training set, validation set and test set.
4. The method for predicting water content in oil bubble flow based on ordinal complex network feature fusion according to claim 3, characterized in that: The specific implementation method of step 2.1 is as follows: the dynamic image is segmented into several images, and the average gray level of each image is calculated. g And construct a two-phase flow time series based on gray values: in, For all possible grayscale values of the image, For gray levels, grayscale The probability of appearing in an image. .
5. The method for predicting water content in oil bubble flow based on ordinal complex network feature fusion according to claim 3, characterized in that: The specific implementation method of step 2.2 is as follows: the obtained grayscale time series is used as the final dataset and randomly divided into training set, validation set and test set, wherein the ratio of training set, validation set and test set is 6:2:
2.
6. The method for predicting water content in oil bubble flow based on ordinal complex network feature fusion according to claim 1, characterized in that: The method for calculating the average degree in step 3.2 is as follows: the average degree of all nodes in the ordinal complex network. : in, The number of nodes It is an adjacency matrix; The method for calculating network density is: the actual number of edges existing in the network. Ratio to the maximum possible number of edges : ; The average shortest path length is calculated as the average distance between any two nodes. : in, For connecting nodes and nodes The number of edges on the shortest path; The clustering coefficient is calculated as the degree of connectivity between the neighboring nodes of a node. : in, For nodes The degree, For nodes The actual number of edges between neighboring nodes; Node entropy The calculation method is as follows: in, To reach a node from a neighboring node The sum of probabilities, Let be the local entropy of the node; The method for calculating the prime number ring is: a loop path in a network link where each node traverses the loop only once; Probability of missing ordinal patterns: The ratio of missing ordinal patterns to the total number of ordinal patterns in a time series. : in, For the embedding dimension, The number of ordinal patterns that appear; The tensile index is calculated as follows: for a given length of... Time series, using a length of Extract the non-overlapping window to obtain... There are several time series segments, and the value of each segment is calculated. Quantity; change Values, calculations differ Lower Time Series The average value of the quantity was calculated; finally, the stretching exponent model was fitted using the least squares method to obtain the characteristic decay rate and the stretching exponent. Each One The decay curve formed by these points, using the least squares method, is obtained by considering the relationship between the points and the curve. The characteristic decay rate was obtained by fitting the stretching exponent model. and elongation index : in, It is a constant. Characteristic attenuation rate, Finally, to stretch the index, a diversified network index is constructed based on the ordinal complex network index.
7. The method for predicting water content in oil bubble flow based on ordinal complex network feature fusion according to claim 1, characterized in that: Step 5 includes the following steps: Step 5.1: Set the hyperparameters in the GRU network model based on multivariate parameter fusion, and optimize the training hyperparameters using a gridded search algorithm; Step 5.2: Evaluate the model's predictive performance using root mean square error and mean relative error; Among them, root mean square error RMSE for: Mean relative error ARE for: in, Represents real data. This represents the test set data, where n is the number of measurements. Step 5.3: Obtain the final model based on the evaluation results, and use the final model to predict the moisture content.
Citation Information
Patent Citations
Two-phase flow multi-element information fusion method based on complex network and depth learning and application thereof
CN106485325A
Oil well oil content and total flow velocity measurement method based on dense neural network and application
CN111649779A