Gas well working condition diagnostic analysis method based on real-time production data

By setting up collection points in the gas well, acquiring and preprocessing production data, and establishing a gradient boosting decision tree algorithm model, the problem of difficulty in real-time diagnosis of gas well working conditions in the existing technology is solved, and early detection and treatment of abnormal gas well working conditions are achieved. , increasing natural gas production.

CN119357839AActive Publication Date: 2025-01-24DAQING OILFIELD CO LTD +1

Patent Information

Application Number
CN202411886047.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-20
Publication Date
2025-01-24
Estimated Expiration
2044-12-20

AI Technical Summary

Technical Problem

The prior art lacks the problem of real-time production data parameters to realize working condition diagnosis by real-time production conditions.

Method used

Set the collection point in the target air well, obtain actual characteristics production data, perform pre -processing, feature screening, and data division, establish gradient improvement decision tree algorithm model, based on real -time production data to determine whether the working conditions in the air well are accumulated or aquarmers frozen block.

Benefits of technology

It achieves early detection and timely treatment of abnormal gas well conditions, laying the foundation for rational planning of on-site production resources and increasing natural gas production.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119357839A_ABST
    Figure CN119357839A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of working condition diagnosis and early warning. The gas well working condition diagnostic analysis method based on the real-time production data comprises the steps that actual characteristic production data of all collection point positions are obtained and integrated to obtain an actual gas well production data set, the actual gas well production data set is preprocessed, and a target gas well production data set is obtained; performing feature screening on each actual feature production data in the target gas well production data set to obtain a plurality of target feature production data, and integrating each target feature production data to obtain a target gas well production data string; and performing last-stage processing on the target gas well production data string, dividing the target gas well production data string according to a last-stage processing result, and performing gas well production data training, testing and verification on the target gas well production data string in sequence to establish a target algorithm model. The method can realize early discovery and timely treatment of the abnormal working condition of the gas well, and lays a foundation for reasonably planning field production resources and improving natural gas yield.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of working condition diagnosis and early warning, and in particular to a gas well working condition diagnosis and analysis method based on real-time production data. Background Art

[0002] Most gas wells will produce water in the later stages of production, thus affecting the normal production of the gas wells. Accurately judging the time and degree of liquid accumulation in gas wells is extremely important for gas well production, and directly affects the formulation of gas well drainage and gas production measures and subsequent management.

[0003] Chinese Patent Publication No.: CN111075428A discloses a method for quickly judging the timing and depth of liquid accumulation in a gas wellbore, including: calculating the monthly water-gas ratio of the gas well according to the daily water production and gas production at the wellhead of the gas well; obtaining a curve of the water-gas ratio changing with time according to the monthly water-gas ratio of the gas well; judging the liquid accumulation time of the gas well by monitoring the changing pattern of the curve; and calculating the liquid accumulation depth of the gas wellbore according to the change of water production before and after the liquid accumulation.

[0004] It can be seen that the existing technology lacks the problem of realizing working condition diagnosis by analyzing the changing trends of real-time production data parameters of production conditions. Summary of the invention

[0005] To this end, the present invention provides a gas well operating condition diagnosis and analysis method based on real-time production data, so as to overcome the problem of realizing operating condition diagnosis by analyzing the changing trend of production condition real-time production data parameters in the prior art.

[0006] To achieve the above object, the present invention provides a gas well operating condition diagnosis and analysis method based on real-time production data, comprising: A plurality of acquisition points are set in the target gas well, actual characteristic production data of each acquisition point is obtained, each actual characteristic production data is integrated to obtain an actual gas well production data set, and the actual gas well production data set is preprocessed to obtain a target gas well production data set; Performing feature screening on each actual characteristic production data in the target gas well production data set to obtain a number of target characteristic production data, and integrating each target characteristic production data to obtain a target gas well production data string; Performing final processing on the target gas well production data string, and dividing the target gas well production data string according to the final processing result to obtain a training set, a test set and a validation set; Performing gas well production data training, testing, and verification on the target gas well production data string in sequence to establish a target algorithm model; The collected real-time gas well production data string is input into the target algorithm model to determine the actual gas well operating conditions in the target gas well.

[0007] Furthermore, the process of preprocessing the actual gas well production data set to obtain the target gas well production data set includes: Identify the actual acquisition of the actual characteristic production data at each collection point; Determine the data missing level according to the actual acquisition situation; Based on the data missing level, it is determined whether to start a singular data filtering mode, or to calculate the actual redundancy, or to start a re-collection mode.

[0008] Furthermore, the process of preprocessing the actual gas well production data set to obtain the target gas well production data set also includes: When the singular data filtering mode is turned on, singular data determination is performed on each actual characteristic production data, and the actual singular situation of the actual gas well production data set is determined according to the singular data determination result; Determining a singular data level according to the actual singular situation; Whether to turn on the feature screening mode is determined based on the singularity level.

[0009] Furthermore, the process of determining the data missing level according to the actual acquisition situation includes: According to whether the actual feature production data is missing, the actual feature production data is marked with missing data, and the data missing level is determined according to the number of missing data marks. The primary data missing level is the number of missing data marks; The intermediate level of missing data is the number of two missing data marks; The advanced data missing level is three or more missing data marks.

[0010] Further, the process of determining to start the singular filtering mode based on the data missing level, or calculating the actual redundancy, or starting the re-collection mode includes: When the number of missing data is marked based on the intermediate data missing level, the actual redundancy is determined according to the actual impact value of the two missing data, and whether to turn on the singular filtering mode is determined based on the actual redundancy calculation result.

[0011] Furthermore, when the singular filtering mode is turned on, the process of performing singularity determination on each actual characteristic production data and determining the actual singularity of the actual gas well production data set according to the singularity determination result includes: The singular data is judged based on whether each actual characteristic production data is within a preset actual characteristic production data interval.

[0012] Furthermore, the process of performing singularity determination on each actual characteristic production data when the singularity filtering mode is turned on and determining the actual singularity of the actual gas well production data set according to the singularity determination result also includes: The singular data is judged based on whether each actual characteristic production data is the preset standard actual characteristic production data.

[0013] Further, the process of determining the level of the singular data according to the actual singular situation includes: The actual gas well production data set containing one singular data is marked as primary singular data level; The actual gas well production data set containing two singular data is marked as medium singular data level; Actual gas well production data sets containing three or more singular data are marked as high-level singular data level.

[0014] Furthermore, the process of determining whether to start the feature screening mode based on the singularity level includes: Enable feature screening mode for actual gas well production data sets marked as primary singular data level; The actual gas well production data set marked as high-level singular data is deleted.

[0015] Furthermore, the process of determining whether to start the feature screening mode based on the singularity level also includes: Based on the fact that the actual gas well production data set is marked as the intermediate singular data level, the actual singular data redundancy is determined by calculating the singular values ​​of two singular data, and whether to start the feature screening mode is determined according to the actual singular data redundancy.

[0016] Furthermore, the process of performing feature screening on each actual feature production data in the target gas well production data set to obtain a number of target feature production data includes: Calculate the actual correlation based on each actual characteristic production data and the actual gas production; Screening each actual characteristic production data based on the first screening criterion to obtain a number of target characteristic production data; Among them, the first screening criterion is to select the top four features with actual correlation as the screening results.

[0017] Furthermore, the target gas well production data string is subjected to final processing, and the target gas well production data string is divided into training set, test set and validation set according to the final processing result. Count the actual number of missing production data for each target feature within a preset fixed time; Count the number of missing items for each feature of the target gas well production data string. Assuming that the actual number of missing items for features A, B, C, and D are 10, 20, 30, and 40 respectively, feature A has the least actual number of missing items. Set feature A as the dependent variable Y, and the remaining features B, C, and D as independent variables X1, X2, and X3 respectively; The training set and test set are divided according to whether the data of feature A is missing. If feature A is not missing in the training set, it is used as the training set. If feature A is missing in the data set, it is used to construct the test set. The remaining data set is used to construct the validation set.

[0018] Furthermore, inputting the collected real-time gas well production data string into the target algorithm model to determine the actual gas well operating conditions in the target gas well includes: When training the target gas well production data string, the target algorithm model is updated by gradient descent to minimize the loss function; When testing the target gas well production data string, each target gas well production data string is added together to obtain the final test result.

[0019] Furthermore, when the target algorithm model is trained according to the training set, the gas well liquid accumulation or hydrate freezing blockage is predicted through each target feature data input by the trained target algorithm model.

[0020] Furthermore, based on the mechanism formula, liquid accumulation labels and freezing labels are added to the gas well liquid accumulation and hydrate freezing, and corresponding treatment measures are taken according to the corresponding labels.

[0021] Compared with the prior art, the beneficial effect of the present invention is that, by pre-processing, feature processing and final processing of gas well production data, the gas well production data is divided into training set, test set and validation set, and a gradient boosting decision tree algorithm model is established. Based on the gas well temperature, gas well oil pressure and gas well casing pressure of real-time gas well production data, it is judged whether the working condition in the gas well is liquid accumulation or hydrate freezing. This method realizes the early discovery and timely treatment of abnormal working conditions of gas wells, laying a foundation for the rational planning of on-site production resources and increasing natural gas production.

[0022] Furthermore, by preprocessing the gas well production data, the gas well production data can be filled, filtered, and duplicate gas well production data can be deleted. The preprocessed gas well production data can better restore the real production data in the gas well, avoiding errors in subsequent analysis of the gas well production data.

[0023] Furthermore, by setting the missing level of gas well production data to screen each gas well production data string, the gas well production data can be quickly pre-processed. When the number of missing data in the actual gas well production data string is less than or equal to 1, the missing level of the gas well production data is the primary missing level, and the actual gas well production data string is not cleared, because the lack of one data has a small impact on the actual gas well production data string and will not affect the subsequent processing of the gas well production data string; when the number of missing data in the actual gas well production data string is less than or equal to 2, the missing level of the gas well production data is the intermediate missing level, and the actual gas well production data string is not cleared, and whether to mark the actual gas well production data string as singular data is determined according to the degree of correlation between the missing data and the gas production of the gas well, so that the actual gas well production data string with a high degree of correlation between the missing data and the gas production of the gas well can be cleared, avoiding the subsequent calculation process of the actual gas well production data string with a high degree of correlation between the missing data and the gas production of the gas well, which affects the diagnosis result. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] Figure 1 is a process flow chart of a gas well operating condition diagnosis and analysis method based on real-time production data in an embodiment; Figure 2 It is a flow chart of the process of determining the data missing level of the gas well working condition diagnosis and analysis method based on real-time production data in the embodiment; Figure 3 It is a flow chart of the process of determining data singularity level of the gas well working condition diagnosis and analysis method based on real-time production data in the embodiment; Figure 4 It is a flow chart of the process of obtaining several target characteristic production data of the gas well working condition diagnosis and analysis method based on real-time production data in the embodiment. DETAILED DESCRIPTION

[0025] In order to make the objects and advantages of the present invention more clearly understood, the present invention is further described below in conjunction with embodiments; it should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.

[0026] The preferred embodiments of the present invention are described below with reference to the accompanying drawings. It should be understood by those skilled in the art that these embodiments are only used to explain the technical principles of the present invention and are not intended to limit the protection scope of the present invention.

[0027] It should be noted that, in the description of the present invention, terms such as "up", "down", "left", "right", "inside" and "outside" indicating directions or positional relationships are based on the directions or positional relationships shown in the drawings. This is merely for the convenience of description and does not indicate or imply that the device or element must have a specific orientation, be constructed and operated in a specific orientation. Therefore, it cannot be understood as a limitation on the present invention.

[0028] In addition, it should be noted that in the description of the present invention, unless otherwise clearly specified and limited, the terms "installed", "connected", and "connected" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be indirectly connected through an intermediate medium, or it can be the internal communication of two components. For those skilled in the art, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.

[0029] See also Figure 1 - Figure 4 As shown, Figure 1 is a process flow chart of a gas well operating condition diagnosis and analysis method based on real-time production data in an embodiment; Figure 2 It is a flow chart of the process of determining the data missing level of the gas well working condition diagnosis and analysis method based on real-time production data in the embodiment; Figure 3 It is a flow chart of the process of determining data singularity level of the gas well working condition diagnosis and analysis method based on real-time production data in the embodiment; Figure 4 It is a flow chart of the process of obtaining several target characteristic production data of the gas well working condition diagnosis and analysis method based on real-time production data in the embodiment.

[0030] This embodiment provides a gas well operating condition diagnosis and analysis method based on real-time production data, comprising the following steps: S1, setting a number of acquisition points in the target gas well, acquiring actual characteristic production data of each acquisition point, integrating each actual characteristic production data to obtain an actual gas well production data set, and preprocessing the actual gas well production data set to obtain a target gas well production data set; S2, performing feature screening on each actual characteristic production data in the target gas well production data set to obtain a number of target characteristic production data, and integrating each target characteristic production data to obtain a target gas well production data string; S3, performing final processing on the target gas well production data string, and dividing the target gas well production data string according to the final processing result to obtain a training set, a test set and a validation set; S4, performing gas well production data training, testing, and verification on the target gas well production data string in sequence to establish a target algorithm model; S5, inputting the collected real-time gas well production data string into the target algorithm model to determine the actual gas well operating condition in the target gas well.

[0031] Among them, the target algorithm model described in this embodiment is the GBDT algorithm model, which can achieve a function of high prediction accuracy, and no specific limitation is made to other algorithm models that can achieve this function.

[0032] Specifically, the process of preprocessing the actual gas well production data set to obtain the target gas well production data set includes: Identify the actual acquisition of the actual characteristic production data at each collection point; Determine the data missing level according to the actual acquisition situation; Based on the data missing level, it is determined whether to start a singular data filtering mode, or to calculate the actual redundancy, or to start a re-collection mode.

[0033] Specifically, the actual feature production data is marked as missing data according to whether the actual feature production data is missing data, and the data missing level is determined according to the number of missing data marks. The primary data missing level is the number of missing data marks; The intermediate level of missing data is the number of two missing data marks; The advanced data missing level is three or more missing data marks.

[0034] Multiple collection points are set up in the target gas well, and each collection point is equipped with various sensors that can collect gas well production data, including oil pressure sensors, casing pressure sensors, gas well temperature sensors, gas production sensors, water production sensors, flow pressure sensors and water flow velocity sensors, etc. Among them, the gas production of the gas well collected by the gas production sensor is the dependent variable.

[0035] The actual gas well production data strings collected at each collection point are numbered, the first actual gas well production data string Aa1, the second actual gas well production data string Aa2, the third actual gas well production data string Aa3, ..., the nth actual gas well production data string Aan, Select any actual gas well production data string Aai, i=1,2,3,...,n, and determine the number of missing data. When the number of missing data in the actual gas well production data string Aai is less than or equal to 1 data, the actual gas well production data missing level is the primary missing level, and the next group of actual gas well production data strings is continued to be judged; When the number of missing data in the actual gas well production data string Aai is equal to 2 data, the actual gas well production data missing level is the medium missing level. The actual missing redundancy is determined according to the actual impact value of the two missing data. Whether to open the singular filtering mode is determined by the actual missing redundancy calculation result. Set the first missing data weight to Ba and the second missing data weight to Bb, Calculate the actual missing impact value HBa of the first missing data Ba, HBa=Ba / (Aa1+Aa2+Aa3...+Aan)×q1, where q1 is the compensation parameter for the influence of the first missing data weight proportion in the actual gas well production data string on the actual missing impact value of the first missing data; Calculate the actual missing impact value HBb of the second missing data Bb, HBb=Bb / (Aa1+Aa2+Aa3...+Aan)×q2, where q2 is the compensation parameter for the influence of the proportion of the second missing data weight in the actual gas well production data string on the actual missing impact value of the first missing data; The actual redundancy of two missing data Rq=(HBa+HBb)×a1, where a1 is the compensation parameter for the impact of the sum of the first missing data and the second missing data on the actual missing redundancy of the two missing data; Set the standard missing redundancy Rqb, If Rq≤Rqb, the missing level of the actual gas well production data is determined to be the primary missing level; If Rq>Rqb, the missing level of the actual gas well production data is determined to be a high missing level.

[0036] Specifically, the process of performing singularity determination on each actual characteristic production data when the singularity filtering mode is turned on and determining the actual singularity of the actual gas well production data set according to the singularity determination result includes: The singular data is judged based on whether each actual characteristic production data is within a preset actual characteristic production data interval.

[0037] Specifically, the process of performing singularity determination on each actual characteristic production data when the singularity filtering mode is turned on and determining the actual singularity of the actual gas well production data set according to the singularity determination result also includes: The singular data is judged based on whether each actual characteristic production data is the preset standard actual characteristic production data.

[0038] The singular data comes from the abnormality of the acquisition device. Set the singular data filtering rules as follows: The casing pressure is less than the oil pressure, which is judged as abnormal data; If the casing pressure divided by the oil pressure is not less than five, it is considered as abnormal data; The oil pressure and casing pressure are greater than 0MPa and less than 40MPa; The temperature is greater than -50℃ and less than 50℃; Specifically, the process of determining the level of singular data according to the actual singular situation includes: The actual gas well production data set containing one singular data is marked as primary singular data level; The actual gas well production data set containing two singular data is marked as medium singular data level; Actual gas well production data sets containing three or more singular data are marked as high-level singular data level.

[0039] Specifically, the process of determining whether to start the feature screening mode based on the singularity level includes: Enable feature screening mode for actual gas well production data sets marked as primary singular data level; The actual gas well production data set marked as high-level singular data is deleted.

[0040] Specifically, the process of determining whether to start the feature screening mode based on the singularity level also includes: Based on the fact that the actual gas well production data set is marked as the intermediate singular data level, the actual singular data redundancy is determined by calculating the singular values ​​of two singular data, and whether to start the feature screening mode is determined according to the actual singular data redundancy.

[0041] Select any actual gas well production data string Aai, i=1,2,3,...,n, and determine the number of missing data. When the number of singular data in the actual gas well production data string Aai is less than or equal to 1 data, the actual gas well production data singularity level is the primary singularity level, and the next set of actual gas well production data strings is continued to be judged; When the number of singular data in the actual gas well production data string Aai is equal to 2 data, the singularity level of the actual gas well production data is the medium singularity level, and the actual singular redundancy is determined according to the actual influence value of the two singular data. Whether to open the feature screening mode is determined by the calculation result of the actual singular redundancy. Set the first singular data weight to Ca and the second singular data weight to Cb, Calculate the actual singular impact value GCa of the first singular data Ca, GCa=Ca / (Aa1+Aa2+Aa3...+Aan)×j1, where j1 is the compensation parameter for the influence of the proportion of the first singular data weight in the actual gas well production data string on the actual impact value of the first singular data; Calculate the actual singular impact value GCb of the second missing data Cb, GCb=Cb / (Aa1+Aa2+Aa3...+Aan)×j2, where j2 is a compensation parameter for the influence of the proportion of the second singular data weight in the actual gas well production data string on the actual impact value of the first singular data; The actual redundancy of the two singular data Cq=(GCa+GCb)×a2, where a2 is a compensation parameter for the influence of the sum of the first singular data and the second singular data on the actual singular redundancy of the two singular data; Set the standard singular redundancy Cqb, If Cq≤Cqb, the singularity level of the actual gas well production data is determined to be the primary singularity data level; If Cq>Cqb, the abnormal level of the actual gas well production data is determined to be a high-level abnormal data level.

[0042] Specifically, the process of performing feature screening on each actual feature production data in the target gas well production data set to obtain a number of target feature production data includes: Calculate the actual correlation based on each actual characteristic production data and the actual gas production; Screening each actual characteristic production data based on the first screening criterion to obtain a number of target characteristic production data; Among them, the first screening criterion is to select the top four features with actual correlation as the screening results.

[0043] In this embodiment, the actual characteristic production data of gas well oil pressure Aa, gas well casing pressure Ba, gas well temperature C, actual gas production D, water production E, flow pressure F and water flow velocity G are subjected to feature screening. The first actual correlation between the gas well oil pressure A and the actual gas production D is r1; r1= , where Aa i is the i-th obtained value of the gas well oil pressure; is the average oil pressure of the gas well =(Aa1+Aa2+...+Aan) / n;D i The ith value obtained for the actual gas production; The average value of actual gas production =(D1+D2+...+Dn) / n; The second actual correlation between the casing pressure of the gas well and the actual gas production is r2; r2= , among which, Ba i The i-th obtained value of the gas well casing pressure; is the average value of the casing pressure of the gas well = (Ba1+Ba2+...+Ban) / n; The ith value obtained for the actual gas production; The average value of actual gas production =(D1+D2+...+Dn) / n; The third actual correlation between gas well temperature and actual gas production is r3; r3= , where C i The i-th obtained value of the gas well casing pressure; is the average value of the casing pressure of the gas well =(C1+C2+...+Cn) / n;D i The ith value obtained for the actual gas production; The average value of actual gas production =(D1+D2+...+Dn) / n; The fourth actual correlation between water production and actual gas production is r4; r4= , where E i Get the value for the i-th water production; is the average value of water production = (E1+E2+...+En) / n; The ith value obtained for the actual gas production; The average value of actual gas production =(D1+D2+...+Dn) / n; ... The fifth practical correlation between flow pressure and actual gas production is r5; The sixth actual correlation between water velocity and actual gas production is r6; The actual correlations are sorted in descending order. Based on the sorting results, the top four features of the actual correlations are selected as screening results. The screening results include gas well oil pressure Aa, gas well casing pressure Ba, gas well temperature C, and actual gas production D.

[0044] Specifically, the target gas well production data string is subjected to final processing, and the target gas well production data string is divided according to the final processing result; Count the actual number of missing production data for each target feature within a preset fixed time; By setting the missing level of gas well production data to screen each gas well production data string, the gas well production data can be quickly pre-processed. When the number of missing data in the actual gas well production data string is less than or equal to 1, the missing level of the actual gas well production data is the primary missing level, and the actual gas well production data string is not cleared, because the lack of one data has a small impact on the actual gas well production data string and will not affect the subsequent processing of the actual gas well production data string; when the number of missing data in the actual gas well production data string is less than or equal to 2, the missing level of the actual gas well production data is the intermediate missing level, and the actual gas well production data string is not cleared. According to the correlation degree between the missing data and the gas production of the gas well, it is determined whether to mark the actual gas well production data string as singular data. The actual gas well production data string with a high correlation degree between the missing data and the gas production of the gas well can be cleared, so as to avoid the subsequent calculation process of the actual gas well production data string with a high correlation degree between the missing data and the gas production of the gas well, which affects the diagnosis result.

[0045] Abnormal acquisition equipment leads to the generation of abnormal gas well production data. The filtering rules for filtering the abnormal data according to the custom algorithm are as follows: Casing pressure is less than oil pressure; casing pressure divided by oil pressure is greater than or equal to five; oil pressure and casing pressure are greater than 0MPa and less than 40MPa; temperature is greater than -50℃ and less than 50℃. When any of the above conditions is met in the real-time gas well production data string, the data is judged as singular data, and the real-time gas well production data string is marked as singular data. The number of singular data in the real-time gas well production data string Aai marked as singular data is obtained. In this embodiment, the existing data set contains four features, namely, gas well oil pressure Aa, gas well casing pressure Ba, gas well temperature C and gas well gas production D. For a schematic diagram of the data set, please refer to Figure 3 , the random forest algorithm method for filling missing data includes: Step S11, counting the number of missing values ​​of each feature of the existing data set, assuming that the number of missing values ​​of the four features of characteristic gas well oil pressure Aa, characteristic gas well casing pressure Ba, characteristic gas well temperature C and characteristic gas well gas production D are 10, 20, 30 and 40 respectively, among which the number of missing values ​​of characteristic gas well oil pressure Aa is the least; Step S12, setting the characteristic gas well oil pressure Aa as the dependent variable Y, and setting the other characteristic gas well casing pressure Ba, characteristic gas well temperature C and characteristic gas well gas production D as independent variables X1, X2 and X3 in sequence; Step S13, dividing the training set and the test set according to whether the data of the characteristic gas well oil pressure Aa is missing, the feature Aa in the training set is not missing and is used as the training set, the data set feature Aa is missing and is used to construct the test set, and the remaining data set is used to construct the verification set; Step S14, using the random forest algorithm to build a model on data set 1, F(B, C, D) = Aa, and fill in the missing value of the characteristic gas well oil pressure Aa in the test set; Step S15, re-divide the input features and output features according to the actual number of missing features of the characteristic gas well oil pressure Aa, and loop through steps S13-S15 until all the data are filled.

[0046] Specifically, the determination method for filtering the production data of singular gas wells based on a custom algorithm includes: When the gas well casing pressure is less than the gas well oil pressure or the gas well casing pressure divided by the gas well oil pressure is greater than or equal to five, or the gas well oil pressure and gas well casing pressure are respectively greater than 0MPa and less than 40MPa, or the gas well temperature is greater than -50℃ and less than 50℃, When the above conditions are met, the gas well production data is the abnormal gas well production data, and the abnormal gas well production data comes from the abnormality of the acquisition equipment.

[0047] The maximum correlation feature generation method in this embodiment adopts the following steps: Step S21, based on actual on-site data and operating experience, three parameters, namely oil pressure, casing pressure and temperature, are selected as initial input features; Step S22, constructing an input parameter set of an analysis model based on the initial input features, for identifying and diagnosing abnormal operating conditions of the gas well.

[0048] The minimum redundant feature deletion determination method is that when the initial input features are only the gas well oil pressure, the gas well casing pressure and the gas well temperature, no feature is deleted based on the fact that there is no homogeneous relationship between the three features.

[0049] Judging whether liquid is generated in the gas well according to the gas well liquid accumulation mechanism formula judgment method, judging whether hydrate is generated in the gas well based on the gas well hydrate freezing mechanism formula judgment method, including: The unloading flow rate is greater than the actual daily gas production, which indicates that liquid is accumulated in the gas well. The formula for calculating the unloading flow is:

[0050]

[0051] Among them, q cr To offload traffic 10 4 m 3 / d;u cr is the unloading flow rate m / s; A is the cross-sectional area of ​​the oil pipe m 2 ; p is the pressure at a certain point in the oil pipe, MPa; T is the temperature at the same position in the oil pipe, K; Z is the gas deviation coefficient; P g is the gas phase density kg / m 3 ;p l is the liquid density kg / m 3 , The gas well hydrate freezing mechanism formula judgment method includes: When the actual pressure of the gas well oil pipe is greater than the critical pressure calculated by the hydrate freezing mechanism formula, it is determined that hydrate is generated in the gas well. The critical pressure calculation formula is:

[0052]

[0053] Where Ta is the oil pipe temperature K at the test point; p is the critical pressure of hydrate formation corresponding to the test point temperature Ta in MPa; B and B1 are parameters, according to the relative density of natural gas The value of is determined.

[0054] When training gas well production data, the decision tree algorithm model parameters are updated by gradient descent to minimize the loss function; When testing the gas well production data, the gradient boosting decision tree algorithm model adds the test results of each basic model to obtain the final test result.

[0055] During the operation of the gradient boosting decision tree algorithm model, the basic parameters of its initialization phase are determined, including: random seeds, the number of boosting levels to be performed, the learning rate, the loss function to be optimized, the sample fraction used to fit each base learner, the function for measuring the segmentation quality, the minimum number of samples required to split the internal nodes, the minimum number of samples required for each node, and the maximum depth of a single regression estimator.

[0056] The input variable feature latitude of the gradient boosting decision tree algorithm model is determined to be 3, including the gas well temperature A, gas well oil pressure B, and gas well casing pressure C of real-time gas well production data, and the output feature latitude is 1, that is, the output gas well operating condition is whether it is liquid accumulation or hydrate freezing.

[0057] The judgment process of the gradient boosting decision tree algorithm model first checks the input data, then outputs the initial judgment category based on the input features, learns the relationship between the input features and the categories, and then judges whether there is liquid accumulation or hydrate freezing in the gas well through the input data.

[0058] The algorithm judgment process of the gradient boosting decision tree algorithm model includes: Step S510, checking the input gas well production data; Step S511, outputting an initial judgment category according to the input features; Step S512, learning the relationship between the input features and the categories; Step S513, judging whether there is liquid accumulation or hydrate freezing in the gas well by inputting the gas well production data.

[0059] This embodiment provides a gradient boosting decision tree algorithm model method for a gas well operating condition diagnosis and analysis method based on real-time production data, including: Step S531: Given a training set {(x1, y1), (x2, y2), ..., (x n ,y n ),}, minimize the loss function L(y,f) corresponding to the model f(x) to solve the optimal model:

[0060] Step S532, in the boosted decision tree, assume Represented as the sum of a series of decision trees:

[0061] Among them, the function corresponding to the j-th decision tree is recorded as h j (x), the hth j The model obtained in step (x) is recorded as

[0062] Step S533, in the boosting tree algorithm, sequentially build the model h j (x), at the hth j (x) Steps to build model h j (x), negative gradient is used As x i The new target value is used to train the model; Step S534, in the gradient boosting decision tree algorithm, using negative derivatives As a new objective to build a model, calculate the derivative according to the data in the training dataset, and minimize the loss function on the training set.

[0063] The steps to build a gradient boosting decision tree algorithm model include: Step S521, constructing an initial model function f0(x), ; Step S522, calculate the negative gradient r ij , ; Step S523, As a new target, build a new model h on the training set j (x); Step S524, solving the step length s j , ; Step S525, update function to ; Step S526, repeat steps S522-S525; Step S527, obtain the final model as f(x)=f m (x).

[0064] The gradient boosting decision tree algorithm model goes through multiple rounds of iterations, in which a new decision tree model is fitted in each round to correct the residuals of all previous decision trees. In each round of iteration, the gradient boosting decision tree algorithm model first calculates the residual between the predicted value of the current model for the training data and the true value. Based on the residual, a new decision tree model is trained, which tries to minimize the residual, that is, fits the negative gradient of the current residual. In the next round, the gradient boosting decision tree algorithm model trains a new decision tree to fit the residual, and the new decision tree will be added to the existing model to reduce the residual generated in the previous round of training. The core part of the training code is the fit function.

[0065] If, within 6 hours, the average value of the first 10 minutes and the average value of the last 10 minutes simultaneously meet the conditions that the oil pressure of the gas well drops by 10% and the casing pressure of the gas well increases by 10%, it is determined that there is liquid accumulation in the gas well. If, within 2 hours, the average value of the first 10 minutes and the average value of the last 10 minutes simultaneously meet the conditions that the oil pressure of the gas well increases or decreases by more than 20% and the casing pressure of the gas well increases by more than 10%, it is determined that there is hydrate blockage in the gas well.

[0066] So far, the technical solutions of the present invention have been described in conjunction with the preferred embodiments shown in the accompanying drawings. However, it is easy for those skilled in the art to understand that the protection scope of the present invention is obviously not limited to these specific embodiments. Without departing from the principle of the present invention, those skilled in the art can make equivalent changes or substitutions to the relevant technical features, and the technical solutions after these changes or substitutions will fall within the protection scope of the present invention.

[0067] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A gas well operating condition diagnosis and analysis method based on real-time production data, characterized in that: include, A plurality of acquisition points are set in the target gas well, actual characteristic production data of each acquisition point is obtained, each actual characteristic production data is integrated to obtain an actual gas well production data set, and the actual gas well production data set is preprocessed to obtain a target gas well production data set; Performing feature screening on each actual characteristic production data in the target gas well production data set to obtain a number of target characteristic production data, and integrating each target characteristic production data to obtain a target gas well production data string; Performing final processing on the target gas well production data string, and dividing the target gas well production data string according to the final processing result to obtain a training set, a test set and a validation set; Performing gas well production data training, testing, and verification on the target gas well production data string in sequence to establish a target algorithm model; The collected real-time gas well production data string is input into the target algorithm model to determine the actual gas well operating conditions in the target gas well.

2. The gas well operating condition diagnosis and analysis method based on real-time production data according to claim 1 is characterized in that: The process of preprocessing the actual gas well production data set to obtain the target gas well production data set includes: Identify the actual acquisition of the actual characteristic production data at each collection point; Determine the data missing level according to the actual acquisition situation; Based on the data missing level, it is determined whether to start a singular data filtering mode, or to calculate the actual redundancy, or to start a re-collection mode.

3. The gas well operating condition diagnosis and analysis method based on real-time production data according to claim 2 is characterized in that: The process of preprocessing the actual gas well production data set to obtain the target gas well production data set also includes: When the singular data filtering mode is turned on, singular data determination is performed on each actual characteristic production data, and the actual singular situation of the actual gas well production data set is determined according to the singular data determination result; Determining a singular data level according to the actual singular situation; Whether to turn on the feature screening mode is determined based on the singularity level.

4. The gas well operating condition diagnosis and analysis method based on real-time production data according to claim 3 is characterized in that: The process of determining the data missing level according to the actual acquisition situation includes: According to whether the actual feature production data is missing, the actual feature production data is marked with missing data, and the data missing level is determined according to the number of missing data marks. The primary data missing level is the number of missing data marks; The intermediate level of missing data is the number of two missing data marks; The advanced data missing level is three or more missing data marks.

5. The gas well operating condition diagnosis and analysis method based on real-time production data according to claim 4 is characterized in that: The process of determining to start the singular filtering mode based on the data missing level, or calculating the actual redundancy, or starting the re-collection mode includes: When the number of missing data is marked based on the intermediate data missing level, the actual missing redundancy is determined according to the actual impact value of the two missing data, and whether to turn on the singular filtering mode is determined based on the calculation result of the actual missing redundancy.

6. The gas well operating condition diagnosis and analysis method based on real-time production data according to claim 5 is characterized in that: The process of performing singularity determination on each actual characteristic production data when the singularity filtering mode is turned on and determining the actual singularity of the actual gas well production data set according to the singularity determination result includes: The singular data is judged based on whether each actual characteristic production data is within a preset actual characteristic production data interval.

7. The gas well operating condition diagnosis and analysis method based on real-time production data according to claim 6 is characterized in that: The process of performing singularity determination on each actual characteristic production data when the singularity filtering mode is turned on and determining the actual singularity of the actual gas well production data set according to the singularity determination result also includes: The singular data is judged based on whether each actual characteristic production data is the preset standard actual characteristic production data.

8. The gas well operating condition diagnosis and analysis method based on real-time production data according to claim 7, characterized in that: The process of determining the level of singular data according to the actual singular situation includes: An actual gas well production data set containing one singular data is marked as a primary singular data level; The actual gas well production data set containing two singular data is marked as medium singular data level; Actual gas well production data sets containing three or more singular data are marked as high-level singular data level.

9. The gas well operating condition diagnosis and analysis method based on real-time production data according to claim 8, characterized in that: The process of determining whether to start the feature screening mode based on the singularity level includes: Enable feature screening mode for actual gas well production data sets marked as primary singular data level; The actual gas well production data set marked as high-level singular data is deleted.

10. The gas well operating condition diagnosis and analysis method based on real-time production data according to claim 9, characterized in that: The process of determining whether to start the feature screening mode based on the singularity level also includes: Based on the fact that the actual gas well production data set is marked as the intermediate singular data level, the actual singular data redundancy is determined by calculating the singular values ​​of two singular data, and whether to start the feature screening mode is determined according to the actual singular data redundancy.

11. The gas well operating condition diagnosis and analysis method based on real-time production data according to claim 10, characterized in that: The process of performing feature screening on each actual feature production data in the target gas well production data set to obtain a number of target feature production data includes: Calculate the actual correlation based on each actual characteristic production data and the actual gas production; Screening each actual characteristic production data based on the first screening criterion to obtain a number of target characteristic production data; Among them, the first screening criterion is to select the top four features with actual correlation as the screening results.

12. The gas well operating condition diagnosis and analysis method based on real-time production data according to claim 11, characterized in that: The target gas well production data string is subjected to final processing, and the target gas well production data string is divided into a training set, a test set and a validation set according to the final processing result. Count the actual number of missing production data for each target feature within a preset fixed time; Count the number of missing items for each feature of the target gas well production data string. Assuming that the actual number of missing items for the four features Aa, Ba, Ca, and Da are 10, 20, 30, and 40 respectively, the actual number of missing items for feature A is the least. Set feature Aa as the dependent variable Y, and the remaining features Ba, Ca, and Da as independent variables X1, X2, and X3 respectively; The training set and test set are divided according to whether the data of feature Aa is missing. The feature Aa in the training set is not missing and is used as the training set. The feature Aa of the data set is missing and is used to construct the test set. The remaining data set is used to construct the validation set.

13. The gas well operating condition diagnosis and analysis method based on real-time production data according to claim 12, characterized in that: Inputting the collected real-time gas well production data string into the target algorithm model to determine the actual gas well operating conditions in the target gas well includes: When training the target gas well production data string, the target algorithm model is updated by gradient descent to minimize the loss function; When testing the target gas well production data string, each target gas well production data string is added together to obtain the final test result.

14. The gas well operating condition diagnosis and analysis method based on real-time production data according to claim 13, characterized in that: When the target algorithm model is trained according to the training set, the gas well liquid accumulation or hydrate freezing blockage is predicted through each target feature data input by the trained target algorithm model.

15. The gas well operating condition diagnosis and analysis method based on real-time production data according to claim 14, characterized in that: Based on the mechanism formula, liquid accumulation labels and freezing labels are added to gas well liquid accumulation and hydrate freezing, and corresponding treatment measures are taken according to the corresponding labels.

Citation Information

Patent Citations

  • Gas well effusion prediction method based on ensemble learning

    CN110163442A

  • Method for quickly judging liquid accumulation time and depth of gas well shaft

    CN111075428A

  • Aluminum / copper plate strip production full-process big data cleaning and analysis method

    CN113177040A

  • Method and device for predicting liquid accumulation height of oil pipe of gas well, medium and equipment

    CN118133235A

  • Flow management system and method

    US20130041588A1

Cited By

  • Multi-layer gas injection working condition intelligent early warning method and system based on real-time data, medium and equipment

    CN121473772A