A method and system for detecting water content in crude oil

By collecting and analyzing crude oil water content and dynamometer card data, and using a neural network model to eliminate the influence of gas, a calibration model was constructed, which solved the problem of low detection accuracy of crude oil water content and achieved higher detection accuracy.

CN117607401BActive Publication Date: 2026-04-07CHINA PETROLEUM & CHEMICAL CORP +1
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-10-27
Publication Date
2026-04-07

AI Technical Summary

Technical Problem

Existing technologies have low accuracy in detecting the water content of crude oil, especially when gas is released during oil extraction in oil fields, which reduces the accuracy and affects the detection results.

Method used

By collecting crude oil water content data and indicator diagram data, and using time series analysis and neural network models to eliminate data affected by gas, a calibration model is constructed for calibration, thereby improving detection accuracy.

Benefits of technology

By effectively eliminating the influence of gas on the data, the accuracy of crude oil water content detection was improved by using a calibration model, thus eliminating the influence of gas and enhancing detection precision.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117607401B_ABST
    Figure CN117607401B_ABST
Patent Text Reader

Abstract

This invention relates to a method and system for detecting the water content of crude oil, belonging to the field of petroleum quality testing. The method for detecting the water content of crude oil includes the following steps: 1) Collecting crude oil water content data and dynamometer card data corresponding to the time periods when the crude oil contains gas according to a time series; 2) Using the dynamometer card data to determine whether the water content data of the gas-containing crude oil is affected by gas, removing the water content data corresponding to the time periods affected by gas from the water content data of the gas-containing crude oil, and extracting the water content data of the adjacent previous time period without gas; 3) Performing feature extraction and feature fusion on the water content data of the gas-containing crude oil unaffected by gas and the water content data of the adjacent previous time period without gas; 4) Using the fused data as input to a calibration model, predicting through the calibration model to obtain calibration data of the water content of the gas-containing crude oil unaffected by gas. The calibration model improves the accuracy of the water content data.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application belongs to the field of oil quality detection, and particularly relates to a crude oil water content detection method and system. BACKGROUND

[0002] In the process of crude oil mining, dehydration, metering, transportation and sales, the water content of crude oil is a very important index, which directly affects the amount of mined crude oil. The error of water content test will affect the oil well and oil layer dynamic analysis, damage the electric field in the electric dehydrator, reduce the dehydration effect, and cause great energy waste in crude oil gathering and transportation, so the detection of the water content of crude oil is very important. In the process of crude oil production, so far the real-time accurate measurement of water content is still one of the difficulties in detection technology, because different actual engineering environments bring many different influencing factors, and the detection of the water content of crude oil is more difficult.

[0003] The detection of the water content of crude oil is divided into static test and dynamic test. With the improvement of scientific and technological level, the method of dynamic detection of the water content of crude oil has been rapidly developed in oilfield production. Many online test instruments have been developed at home and abroad. In recent years, the commonly used crude oil water content test instrument tends to measure based on electromagnetic waves. This method is safe and reliable, and has high working stability and can be operated for a long time. The electromagnetic wave method is to obtain the mixed dielectric constant of crude oil according to the signal attenuation and phase change of electromagnetic wave in crude oil, and then measure the water content of crude oil. Because the dielectric constant of gas is very close to that of crude oil, it is easy to be mistaken for crude oil composition by the instrument, so in the actual oil extraction process, according to the different working conditions of oil field, part of the oil extraction time is intermittent with gas precipitation, which will reduce the accuracy of the instrument in measuring the water content of crude oil. SUMMARY

[0004] The present application aims to provide a crude oil water content detection method and system to solve the technical problem of low accuracy of the detected water content of crude oil in the prior art.

[0005] To achieve the above-mentioned purpose, the technical scheme of the crude oil water content detection method and system provided by the present application is as follows:

[0006] The method comprises the following steps: 1) collecting crude oil water content data and corresponding dynamometer diagram data of the gas-containing period of the crude oil in time sequence, wherein the collected crude oil water content data comprises gas-free crude oil water content data and gas-containing crude oil water content data; 2) determining whether the gas-containing crude oil water content data is affected by gas by using the dynamometer diagram data, removing the crude oil water content data corresponding to the period affected by gas from the gas-containing crude oil water content data to obtain gas-containing crude oil water content data not affected by gas, and extracting gas-free crude oil water content data of the adjacent previous period; 3) extracting features from the gas-containing crude oil water content data not affected by gas and the gas-free crude oil water content data of the adjacent previous period respectively to obtain corresponding feature data; and 4) performing feature fusion on the feature data, constructing a calibration model by using a time convolutional neural network, taking the fused features as the input of the calibration model, and performing prediction by using the calibration model to obtain calibration data of the gas-containing crude oil water content not affected by gas.

[0007] The beneficial effects are that the crude oil water content data and the dynamometer diagram data of the gas-containing crude oil are obtained, the period of the gas-containing crude oil water content data affected by gas is determined by using the dynamometer diagram data, the crude oil water content data corresponding to the period is removed, and the remaining gas-containing crude oil water content data is calibrated. The gas-containing crude oil water content data affected by gas is very inaccurate or invalid data, and thus it is not necessary to calibrate it. The gas-containing crude oil water content data not affected by gas is essentially data slightly affected by gas, and the water content data is also inaccurate, but it can be calibrated by using the calibration model to obtain accurate water content data. The calibration model is constructed by using a time convolutional neural network, the feature fusion data of the gas-containing crude oil water content data not affected by gas and the gas-free crude oil water content data of the adjacent previous period are taken as the input of the calibration model, and the calibration data of the gas-containing crude oil water content not affected by gas is obtained by using the calibration model. The calibration operation of the calibration model eliminates the influence of gas on the crude oil water content, and improves the accuracy of the water content data.

[0008] As a further improvement, in step 2), the method for determining whether the gas-containing crude oil water content data is affected by gas is to determine whether the gas-containing crude oil water content data is affected by gas by judging the features of the loading line and / or the unloading line of the dynamometer diagram.

[0009] The beneficial effects are that the loading line and the unloading line of the dynamometer diagram change in curvature when the dynamometer diagram is affected by gas, and thus the method for determining whether the dynamometer diagram is affected by gas by observing the loading line and / or the unloading line of the dynamometer diagram ensures the accuracy of the determination.

[0010] As a further improvement, in step 2), the optimal classification function is obtained by nonlinear support vector machine classification algorithm. The optimal classification function is used to judge the characteristics of the loading line and / or unloading line of the indicator diagram when gas is present, so as to determine whether the water content data of gas-containing crude oil is affected by gas.

[0011] The beneficial effects are: by using the optimal classification function to determine the characteristics of the loading line and / or unloading line on the indicator diagram, it is possible to further determine whether the water content of gas-bearing crude oil is affected by gas. Compared with the observation method, the classification function is more accurate and improves the accuracy of determining whether the water content is affected by gas.

[0012] As a further improvement, in step 3), feature extraction employs a recurrent neural network model.

[0013] As a further improvement, in step 4), feature fusion employs the blending method.

[0014] As a further improvement, in step 4), the calibration model is expressed by the formula:

[0015]

[0016] y T Here, T represents the calibrated moisture content data, f(i) represents the fused data, f(i) represents the filtering function to be added during temporal convolution, and L represents the loss function.

[0017] The beneficial effect is that the water content data of gas-bearing crude oil can be calibrated through the calibration model.

[0018] As a further improvement, in step 1), the method for determining the gas content of the extracted crude oil is as follows: a strain sensor is installed on the oil pumping unit to detect stress changes when the crude oil is being pumped. When the stress change exceeds a set threshold, it is considered that the extracted crude oil contains gas.

[0019] The beneficial effect is that the strain sensor is installed on the oil pumping unit to detect stress changes during oil pumping. Based on the stress changes, it can be determined whether the extracted crude oil contains gas, thus realizing the detection of whether the extracted crude oil contains gas.

[0020] A crude oil water content detection system includes a processor for processing any embodiment of the crude oil water content detection method. Attached Figure Description

[0021] Figure 1 This is a flowchart of the crude oil water content detection method in this invention;

[0022] Figure 2 This is a theoretical dynamometer diagram showing whether the crude oil water content detection method of the present invention is affected by gas.

[0023] Figure 3 This is a schematic diagram illustrating the determination of whether the crude oil water content detection method of the present invention is affected by gas.

[0024] Figure 4 This is a dynamometer diagram showing the effect of gas on the crude oil water content detection method of the present invention;

[0025] Figure 5 This is an indicator diagram of the crude oil water content detection method in this invention, which is unaffected by gas.

[0026] Figure 6 This is a structural diagram of the calibration model for the crude oil water content detection method in this invention;

[0027] Figure 7 This is a comparison chart of the water content of crude oil in the method for detecting water content of crude oil in this invention. Detailed Implementation

[0028] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only for explaining the invention and are not intended to limit the invention; that is, the described embodiments are merely some embodiments of the invention, not all embodiments. The components of the embodiments of the invention described and shown in the accompanying drawings can generally be arranged and designed in various different configurations.

[0029] Example of crude oil water content detection method:

[0030] like Figure 1 As shown, the method for detecting the water content of crude oil includes the following steps:

[0031] 1) Collect crude oil water content data and indicator diagram data corresponding to the time period of crude oil gas content according to the time series.

[0032] This invention collects crude oil water content data at set sampling intervals. The collected crude oil water content data includes water content data for non-gas-containing crude oil and water content data for gas-containing crude oil. The method for determining whether the extracted crude oil contains gas is as follows: a strain sensor is installed on the pumping unit. This strain sensor detects the magnitude of the strain force during oil extraction. When the strain sensor detects a small mechanical deformation or a stress change exceeding a threshold, it is considered that the crude oil contains gas. A prompt message is issued via a buzzer or display. Upon receiving the prompt message, the corresponding indicator diagram for that time period is recorded.

[0033] 2) Use indicator diagrams to filter the collected data.

[0034] To determine whether the water content data of gas-bearing crude oil is affected by gas, select the water content data of gas-bearing crude oil that is not affected by gas and extract the water content data of non-gas-bearing crude oil from the adjacent previous time period.

[0035] This invention utilizes dynamometer card data to determine whether the water content data of gas-bearing crude oil is affected by gas. The water content data corresponding to the time period affected by gas is removed from the gas-bearing crude oil water content data, resulting in gas-free crude oil water content data. Furthermore, the water content data of non-gas-bearing crude oil from the adjacent previous time period is extracted. "Unaffected by gas" essentially refers to data with minimal gas influence, while "affected by gas" refers to data with significant gas influence. Data with significant gas influence has errors that are too large to be corrected, and therefore, this data is removed.

[0036] like Figure 2 As shown, theoretically, when the water content data of gas-bearing crude oil is not affected by gas, the loading line AB and unloading line CD of the corresponding indicator diagram are approximately straight lines. When affected by gas, the loading line AB and unloading line CD of the indicator diagram change from straight lines to curved arcs AB` and CD`. Furthermore, when affected by gas, the change of the unloading line of the indicator diagram relative to the loading line is more obvious.

[0037] like Figures 3-5 As shown, based on the above principle, the method for determining whether the water content data of gas-bearing crude oil is affected by gas is as follows: observe the loading line and / or unloading line of the indicator diagram. When the loading line and / or unloading line of the indicator diagram are straight lines, it is considered that it is not affected by gas; when the loading line and / or unloading line of the indicator diagram are curved lines, it is considered that it is affected by gas. Preferably, the unloading line of the indicator diagram is used to determine whether it is affected by gas.

[0038] To achieve a more accurate assessment, an optimal classification function is obtained using a nonlinear support vector machine (SVM) classification algorithm. This optimal classification function is then used to assess the loading and / or unloading line features of the dynamometer card when the oil contains gas, thereby determining whether the water content data of the gas-bearing crude oil is affected by gas. Specifically, historical dynamometer card data, both those affected and those unaffected by gas, are used as the foundation data for the nonlinear SVM classification algorithm. The algorithm is trained to obtain the optimal classification function.

[0039] The formula for determining the optimal classification function of a nonlinear support vector machine is:

[0040]

[0041] Among them, a i Let K(x) be the Lagrange multiplier, n be the dimension of the vector, and K(x) be the vector dimension. i ,x j Let f(x) be the kernel function, x be the x-axis data of the indicator plot, b be the bias of the support vector machine, f(x) be the optimal classification surface, and y be the kernel function. kThe vertical axis value of the indicator diagram;

[0042] The kernel function is expressed by the formula:

[0043]

[0044] σ is the kernel function parameter, x i ,x j It is the effective data vector of the indicator diagram, i,j∈[1,n].

[0045] 3) Extract features from the filtered data.

[0046] This invention uses the water content data of gas-free crude oil as a reference. To ensure the effectiveness of subsequent calibration, feature extraction is performed on the water content data of gas-containing crude oil unaffected by gas and the water content data of gas-free crude oil from a previous time period, yielding corresponding feature data. Considering that the water content data of crude oil does not change significantly between adjacent time periods, this embodiment selects the water content data of gas-free crude oil from the previous adjacent time period from the historical water content data of gas-free crude oil for feature extraction. The two sets of data for feature extraction can be of the same length or different lengths.

[0047] Feature extraction employs a recurrent neural network model. Specifically, it extracts the water content data of gas-bearing crude oil, which is unaffected by gas. i Water content data of crude oil excluding gas from the previous time period x i The input is used as the input to the recurrent neural network for feature extraction, and the corresponding feature data is output. Two sets of feature data z1 and z2 are obtained, which provide data support for subsequent model calibration.

[0048] Feature extraction can be expressed by the following formula: Where Z represents the moisture content feature data, x represents the moisture content data over time, w represents the weight, b represents the bias, and f represents the tanh activation function.

[0049] This recurrent neural network can be replaced with any recurrent neural network as needed.

[0050] 4) Perform feature fusion on the feature data.

[0051] The feature fusion method used in this embodiment is Blending. The feature fusion method can also be Stacking or Bosting.

[0052] like Figure 6As shown, the main idea of ​​the Blending method is to divide the data into two parts and the model into two layers. The first layer extracts the relevant feature data of the two parts of the data respectively; the second layer links the relevant features of the extracted data to obtain a new data set, which is then used as the input of the calibration model for learning.

[0053] The feature fusion method involves linking feature data to obtain fused data; the linking method is expressed by the formula:

[0054]

[0055] Where T represents the merged data, Z1 represents the first set of moisture content characteristic data, and Z2 represents the second set of moisture content characteristic data.

[0056] 5) Construct a calibration model.

[0057] A calibration model is constructed using a temporal convolutional neural network. The fused features are used as input to the calibration model, and the model is used to make predictions to obtain calibration data on the water content of gas-bearing crude oil that is unaffected by gas.

[0058] Temporal convolutional neural networks (TCNNs) possess representation learning capabilities, enabling them to perform translation-invariant classification of input information according to their hierarchical structure. Using this TCNN to construct a calibration model, it is possible to calibrate gas-bearing crude oil water content data unaffected by gas through prediction. The specific calibration model is expressed by the formula:

[0059]

[0060] y T Let T be the calibrated moisture content data, f(i) be the fused data, L be the filtering function to be added for temporal convolution, L(z1,z2)=|z1-z2|.

[0061] 6) Verify the calibration model.

[0062] like Figure 7 The figure shows a comparison curve of the water content of crude oil without gas, the water content of crude oil with gas before model calibration and the water content of crude oil with gas after model calibration.

[0063] The specific data on the water content of crude oil without gas are shown in Table 1. The data on the water content of crude oil with gas before model calibration is shown in Table 2. The data on the water content of crude oil with gas after model calibration is shown in Table 3.

[0064] Table 1

[0065] 16.18% 16.52% 16.45% 15.68% 15.73% 14.83% 16.48%

[0066] Table 2

[0067] 13.40% 18.50% 14.80% 18.20% 16.20% 17.80% 14.60%

[0068] Table 3

[0069] 16.30% 16.35% 16.40% 15.45% 15.90% 14.90% 16.40%

[0070] Generally, the water content data of crude oil fluctuates very little over a certain period, meaning the water content of gas-bearing crude oil is not significantly different from that of adjacent non-gas-bearing crude oil. As can be clearly seen from the graphs and Table 1-3, the measured water content of gas-bearing crude oil without model calibration exhibits large fluctuations and deviations. After model calibration, the water content fluctuations of gas-bearing crude oil significantly approximate those of non-gas-bearing crude oil, and the error decreases accordingly. This demonstrates that the performance verification of the model calibration has achieved its intended goal.

[0071] This embodiment acquires crude oil water content data and dynamometer card data for gas-bearing crude oil. It uses the dynamometer card data to determine the time period during which the water content data of the gas-bearing crude oil is affected by gas content, discards the water content data corresponding to that time period, and calibrates the remaining water content data for the gas-bearing crude oil. Water content data of gas-bearing crude oil affected by gas content is highly inaccurate or invalid and does not require calibration, therefore it is discarded. Water content data of gas-bearing crude oil unaffected by gas content is essentially data with minimal influence from water content; this water content data is also inaccurate, but it can be calibrated using a calibration model to obtain accurate water content data. By obtaining calibrated water content data through the calibration model, the influence of gas content on the crude oil water content is eliminated, and the accuracy of the water content data is improved.

[0072] Example of a detection system:

[0073] The crude oil water content detection system includes a processor, which is used to process the above-described crude oil water content detection method. The specific implementation of this embodiment refers to the crude oil water content detection method embodiment, and will not be repeated here.

[0074] Finally, it should be noted that the above descriptions are merely preferred embodiments of the present invention and are not intended to limit the present invention. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art can still make modifications to the technical solutions described in the foregoing embodiments without creative effort, or make equivalent substitutions for some of the technical features. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.

Claims

1. A method for detecting the water content of crude oil, characterized in that, The method includes the following steps: 1) Collect crude oil water content data and indicator diagram data corresponding to the time period of crude oil containing gas according to the time series. The collected crude oil water content data includes crude oil water content data without gas and crude oil water content data containing gas. 2) Use the indicator diagram data to determine whether the water content data of gas-bearing crude oil is affected by gas. Remove the crude oil water content data corresponding to the time period affected by gas from the gas-bearing crude oil water content data to obtain the gas-bearing crude oil water content data that is not affected by gas, and extract the gas-free crude oil water content data of the adjacent previous time period. 3) Extract features from the water content data of gas-bearing crude oil that is not affected by gas and the water content data of crude oil that does not contain gas in the adjacent previous time period to obtain the corresponding feature data; 4) The feature data is fused, and a calibration model is constructed using a temporal convolutional neural network. The fused features are used as the input to the calibration model, and the calibration model is used to make predictions to obtain calibration data of the water content of gas-bearing crude oil that is not affected by gas.

2. The method for detecting the water content of crude oil according to claim 1, characterized in that, In step 2), the method for determining whether the water content data of gas-bearing crude oil is affected by gas is as follows: by judging the characteristics of the loading line and / or unloading line of the indicator diagram, it is determined whether the water content data of gas-bearing crude oil is affected by gas.

3. The crude oil water content detection method according to claim 2, characterized in that, In step 2), the optimal classification function is obtained through a nonlinear support vector machine classification algorithm. The optimal classification function is used to judge the characteristics of the loading line and / or unloading line of the indicator diagram when gas is present, and then to determine whether the water content data of gas-containing crude oil is affected by gas.

4. The method for detecting the water content of crude oil according to claim 1, characterized in that, The feature extraction in step 3) uses a recurrent neural network model.

5. The method for detecting the water content of crude oil according to claim 1, characterized in that, In step 4), feature fusion employs the blending method.

6. The method for detecting the water content of crude oil according to any one of claims 1-5, characterized in that, In step 4), the calibration model is expressed by the formula: , Here is the calibrated moisture content data, and T is the fused data. L is the filtering function required for temporal convolution, and L is the loss function.

7. The method for detecting the water content of crude oil according to any one of claims 1-5, characterized in that, In step 1), the method for determining the gas content of the extracted crude oil is as follows: a strain sensor is installed on the oil pumping unit to detect stress changes when the crude oil is being pumped. When the stress change exceeds a set threshold, it is considered that the extracted crude oil contains gas.

8. A crude oil water content detection system, characterized in that, The system includes a processor for processing the crude oil water content detection method according to any one of claims 1-7.

Citation Information

Patent Citations

  • Crude oil water content analysis method and device

    CN112394163A

  • Oil product water content analysis system and information fusion analysis method

    CN113252881A