Training method, determining method and device for natural gas well and control system
Through training well group prediction model and integrated learning algorithm, the wellhead valve closing time of natural gas wells is determined, which solves the problems of low efficiency, high cost and difficult to manage between natural gas wells in the existing technology, and realizes the optimization and efficiency of natural gas well production promote.
Patent Information
- Application Number
- CN202411062381.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-05
- Publication Date
- 2024-12-13
AI Technical Summary
In the prior art, natural gas wells have low efficiency, high cost and difficult to manage. Existing methods such as wellbore models and manual empirical methods are difficult to obtain accurate data, resulting in poor natural gas production and acquisition efficiency.
The well group prediction model method for natural gas wells is adopted to obtain wellhead historical data, normalize processing and fragment division, and apply timing sequence prediction algorithms and integrated learning algorithms to generate well group prediction models to determine the wellhead of natural gas wells. The valve is closed at the moment and the control system realizes precise control of the wellhead valve.
It improves the production and collection efficiency of natural gas wells, reduces operating costs, and achieves precise management and optimization of natural gas well production.
Smart Images

Figure CN119129782A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the technical field of natural gas collection, and in particular, to a training method, a determination method and device, and a control system for a natural gas well. Background Art
[0002] When natural gas is collected from a natural gas well, it usually carries accumulated liquid. As the accumulated liquid increases, the gas production volume decreases, and the gas well gradually enters an intermittent production mode. The intermittent production mode in which production operators actively and regularly operate the opening and closing of the gas well is called artificial intermittent production. During the well closing stage, the downhole pressure rises, and during the well opening stage, the accumulated liquid in the well flows out of the wellhead with the natural gas. However, untimely closing of the well, or opening the well too early or too late will affect the production or drainage effect of a single well. Therefore, taking effective artificial intermittent production measures is crucial to ensure the production and efficiency of natural gas.
[0003] Existing artificial spacing methods usually use wellbore models and artificial experience methods to determine the spacing measures of the wellhead (i.e., timed opening of gas wells and constant pressure opening of gas wells). In actual production, wellbore models often use some approximate estimates or simplified models, and the conditions of gas reservoirs will also change with continuous production. This method is difficult to obtain accurate data for each well, resulting in theoretical calculation results that are difficult to match the actual situation. In actual production, the artificial experience method uses simple conditions such as wellhead oil pressure, casing pressure, and production to set unified spacing measures for wellheads under different conditions (for example, opening the wellhead valve according to a fixed period (for example, 4 hours)). However, this "one-size-fits-all" approach cannot achieve precise adjustment, and also has a certain impact on the production capacity of the spacing gas wells. Summary of the invention
[0004] Therefore, this application aims to propose a new control method to solve the problems of low efficiency, high cost and difficult management of natural gas in the existing technology. The application of this method will bring major technological breakthroughs and economic benefits to natural gas production.
[0005] The embodiments of the present disclosure provide a method for training a well group prediction model for natural gas wells, a method for determining the time when the wellhead valve of a natural gas well is to be closed, a device for determining the time when the wellhead valve of a natural gas well is to be closed, and a system for controlling the closure of the wellhead valve of a natural gas well, so as to at least solve the technical problems in the prior art of low efficiency, high cost and difficult management of natural gas wells.
[0006] According to one aspect of the present invention, there is provided a method for training a well group prediction model for natural gas wells, the method comprising: acquiring wellhead historical data of a single well in a well group formed by a plurality of wells, wherein the wellhead historical data is acquired by a sensor arranged at the wellhead, and the wellhead historical data comprises historical oil pressure data indicating a pressure reading of natural gas in a pipe string of the natural gas well, and historical switch state data indicating a switch state of a wellhead valve corresponding to the historical oil pressure data; normalizing the acquired wellhead historical data; segmenting the normalized wellhead historical data, and establishing a time series sequence of the normalized wellhead historical data segmented by segments; applying a time series sequence prediction algorithm to train a single well prediction model for predicting the moment when the wellhead valve of a single well is to be closed according to the time series sequence of the normalized wellhead historical data segmented by segments, so as to output a trained single well prediction model; integrating a plurality of trained single well prediction models by using an integrated learning algorithm to obtain an integrated result, and using the integrated result as the well group prediction model.
[0007] In this way, the present disclosure is able to take into account the different acquisition conditions of different natural gas wells, adjust the control strategy using a time series prediction algorithm without increasing data acquisition conditions, and generalize using an integrated learning algorithm, so that the generated well group prediction model has improved accuracy, low cost, and is easy to control multiple natural gas wells.
[0008] According to an exemplary embodiment of the present invention, the normalized wellhead historical data are divided into segments, and a time series sequence of the normalized wellhead historical data divided into segments is established, including: for the period between two openings of the wellhead valve, the normalized wellhead historical data are divided into different segments using the switching state of the wellhead valve, and in each segment, the normalized wellhead historical data are sampled at a predetermined sampling interval to obtain a time series sequence of the normalized wellhead historical data.
[0009] In this way, the present disclosure divides the normalized wellhead history data into segments for a single well prediction model, and in each segment, samples the normalized wellhead history data at a predetermined sampling interval to obtain a time series sequence of the normalized wellhead history data divided into segments, so that the time series sequence of the sampled wellhead history data can be used in the single well prediction model.
[0010] According to an exemplary embodiment of the present invention, a time series sequence includes: a subsequence of historical oil pressure data of the wellhead and a subsequence of historical switch status data of the wellhead valve, and wherein a time series sequence prediction algorithm is applied to train a single well prediction model according to the time series sequence of normalized wellhead historical data divided into segments to output the trained single well prediction model, which includes: for the time series prediction algorithm, using a subsequence of historical oil pressure data of the wellhead in a segment and a subsequence of historical switch status data of the wellhead valve in the next segment of the segment as input of the time series prediction algorithm, and a subsequence of historical oil pressure data of the wellhead in the next segment as output of the time series prediction algorithm, training the single well prediction model to output the trained single well prediction model.
[0011] In this way, the present invention is able to determine the input and output of the time series prediction algorithm, and train the single well prediction model through the time series prediction algorithm to output an updated single well prediction model, thereby better combining the time series of the wellhead oil pressure data and the time series of the switching state of the wellhead valve with the single well prediction model to predict the production change trend of the natural gas well within a period of time, provide a basis for production decisions, and thus improve the production and collection efficiency of natural gas.
[0012] According to an exemplary embodiment of the present invention, the time series prediction algorithm includes a long short-term memory network algorithm.
[0013] In this way, the time series prediction algorithm includes the long short-term memory network algorithm (i.e., LSTM algorithm), which plays an important role in the field of natural gas collection. Natural gas collection is a complex process involving a large amount of data collection, processing, and analysis. The LSTM algorithm can help professionals in the field of natural gas collection process and analyze large amounts of data, thereby improving collection efficiency and accuracy.
[0014] According to an exemplary embodiment of the present invention, the single well prediction model is a time series prediction model.
[0015] In this way, the time series prediction model plays an important role in training the single well prediction model. The time series prediction model is a recurrent neural network model that can process time series data and can capture the time dependency in the input data, which is very important for the dynamic changes of natural gas in the tubing of the natural gas well. Through the time series prediction model, the production trend of natural gas in the downhole tubing can be better understood, thereby improving the prediction ability and generalization ability of the model, so as to better realize the control and optimization of natural gas wells.
[0016] According to another aspect of the present invention, a method for determining the time when a wellhead valve of a natural gas well is to be closed is provided, the method comprising: setting the well opening oil pressure value of a single well in a well group formed by a plurality of wells at the current time, and increasing the well opening oil pressure value by a constant oil pressure difference value based on the lowest oil pressure value for valve opening to obtain a discretized well opening oil pressure value sequence; acquiring wellhead historical data of the single well, wherein the wellhead historical data is acquired by a sensor arranged at the wellhead, and the wellhead historical data includes historical oil pressure data indicating the pressure reading of natural gas in the pipe string of the natural gas well, and historical switch state data indicating the switch state of the wellhead valve corresponding to the historical oil pressure data; The acquired wellhead historical data are normalized, the normalized wellhead historical data are segmented, and a time series of the normalized wellhead historical data segmented into segments is established, the oil pressure change value of the historical oil pressure data in the normalized wellhead historical data is calculated for each segment, and a plurality of oil pressure change values of a plurality of segments in a period between two openings of the wellhead valve are obtained to calculate the first unit time oil pressure change value of the plurality of oil pressure change values in the period; the sequence of the wellhead historical oil pressure data in a segment and the sequence of the historical switch state data of the wellhead valve in the next segment of the segment are input into the well group prediction system obtained by training using the above method. In the prediction model; based on the well group prediction model, a sequence of predicted oil pressure data in the next segment of the wellhead is output, wherein each oil pressure data in the sequence of oil pressure data indicates the oil pressure of the wellhead at each moment in the next segment; according to the oil pressure data of the sequence of oil pressure data at each moment and the curve of the sequence of oil pressure data at each moment, the gradient of the curve of the sequence of oil pressure data at each moment is constructed; a gradient threshold is obtained; if the gradient of the first moment after the current moment is less than the gradient threshold, the first time interval from the current moment to the first moment is calculated; if the oil pressure value of the sequence of oil pressure data at the second moment after the first moment is not less than the oil pressure value of the sequence of well opening oil pressure values at the second moment, then Calculate a second time interval from the current moment to the second moment; within the first time interval, calculate the oil pressure change value of the sequence of oil pressure data for each segment, and obtain multiple oil pressure change values of multiple segments within the first time interval to calculate the second unit time oil pressure change value of the multiple oil pressure change values within the second time interval; and if the second unit time oil pressure change value is greater than the first unit time oil pressure change value, select the first moment as the moment when the wellhead valve is to be closed, and if the oil pressure value of the sequence of oil pressure data at the third moment is greater than the maximum oil pressure value of the valve opening, select the third moment as the moment when the wellhead valve is to be closed, wherein the third moment is any moment in the time period.
[0017] In this way, the present disclosure provides a well group prediction model obtained by applying the above training, outputs a sequence of predicted oil pressure data in the next segment of the wellhead according to the set well opening oil pressure of the natural gas well and the wellhead historical data, and determines the time when the wellhead valve is to be closed according to the gradient threshold and the maximum oil pressure value of the valve opening. The threshold can be preset according to actual needs, for example, set to 0.01. The determination method can easily determine the time when the wellhead valve is to be closed with improved accuracy and at a lower cost.
[0018] According to another aspect of the present invention, there is provided a device for determining the time when the wellhead valve of a natural gas well is to be closed, the device comprising: a data setting module, which sets the well opening oil pressure value of a single well in a well group formed by a plurality of wells at the current time, and increases the well opening oil pressure value by a constant oil pressure difference on the basis of the lowest oil pressure value of the valve opening to obtain a discrete well opening oil pressure value sequence; a data receiving module, which is communicatively connected to a sensor arranged at the wellhead to obtain the wellhead historical data of the single well in the well group formed by the plurality of wells from the sensor, wherein the wellhead historical data comprises historical oil pressure data indicating the pressure reading of the natural gas in the pipe string of the natural gas well, and an indication corresponding to the historical oil pressure data. The processor is configured to communicate with the data setting module and the data receiving module to obtain a sequence of well opening oil pressure values and wellhead historical data of a single well, normalize the acquired wellhead historical data, divide the normalized wellhead historical data into segments, and establish a time series sequence of the normalized wellhead historical data divided into segments, calculate the oil pressure change value of the historical oil pressure data in the normalized wellhead historical data for each segment, and obtain multiple oil pressure change values of multiple segments in a period between two openings of the wellhead valve, so as to calculate the oil pressure change value of the multiple oil pressure change values in the first unit time of the period. The pressure change value is obtained by inputting the sequence of historical oil pressure data of the wellhead in a segment and the sequence of historical switch state data of the wellhead valve in the next segment of the segment into the well group control prediction model obtained by training according to the above method, and outputting the sequence of predicted oil pressure data in the next segment of the wellhead based on the well group prediction model, wherein each oil pressure data in the sequence of oil pressure data indicates the oil pressure of the wellhead at each moment in the next segment, and constructing a curve of the sequence of oil pressure data according to the oil pressure data at each moment and the gradient of the curve of the sequence of oil pressure data at each moment is calculated; wherein the data receiving module also obtains a gradient threshold from an external source and transmits the gradient threshold to the well group control prediction model. The processor performs the following processing after receiving the gradient threshold: if the gradient at the first moment after the current moment is less than the gradient threshold, then calculate the first time interval from the current moment to the first moment; if the oil pressure value at the second moment after the first moment of the sequence of oil pressure data is not less than the oil pressure value at the second moment of the sequence of well opening oil pressure values, then calculate the second time interval from the current moment to the second moment; within the first time interval, calculate the oil pressure change value of the sequence of oil pressure data for each segment, and obtain multiple oil pressure change values of multiple segments within the first time interval, so as to calculate the second unit time oil pressure change value of the multiple oil pressure change values within the second time interval;If the oil pressure change value per unit time is greater than the oil pressure change value per unit time, the first moment is selected as the moment when the wellhead valve is to be closed; if the oil pressure value of the oil pressure data sequence at the third moment is greater than the maximum oil pressure value of the valve opening, the third moment is selected as the moment when the wellhead valve is to be closed, wherein the third moment is any moment in the period. ;
[0019] In this way, the device obtains the sequence of oil pressure values for opening the well via the data setting module, receives the wellhead history data of a single well from the sensor via the data receiving module, and communicates with the data setting module and the data receiving module via the processor to obtain the sequence of oil pressure values for opening the well and the wellhead history data of the single well for further processing, thereby easily determining the time when the wellhead valve is to be closed with improved accuracy and at a lower cost.
[0020] According to another aspect of the present invention, a system for controlling the closing of a wellhead valve of a natural gas well is provided, the system comprising: a device for determining the time when the wellhead valve of the natural gas well is to be closed; a sensor, arranged at the wellhead of the natural gas well to obtain wellhead data about the wellhead of a single well, wherein the wellhead data includes wellhead historical data and wellhead setting data; and a controller, configured to be communicatively connected with the device to receive from the device the time when the wellhead valve is to be closed determined by the device; wherein the controller transmits an instruction indicating the time when the wellhead valve is to be closed to the wellhead valve to control the closing of the wellhead valve.
[0021] In this way, the system acquires wellhead data via sensors, determines the time when the wellhead valve of the natural gas well is to be closed via a device, and communicates with the device via a controller to control the closing of the wellhead valve, thereby easily controlling the closing of the wellhead valve with improved accuracy and at a lower cost.
[0022] In an embodiment of the present invention, a technical solution is provided for combining a time series prediction algorithm and an integrated learning algorithm to obtain a well group prediction model, determining the time when the wellhead valve is to be closed based on the setting status of a single well, the wellhead historical data and the well group prediction model, and controlling the wellhead valve to be closed at the time to be closed, so as to at least solve the technical problems of low efficiency, high cost and difficult management of natural gas well opening in the prior art, and achieve the technical effect of optimizing the production operation system of natural gas wells to improve the production and collection efficiency of natural gas, reduce costs and facilitate management. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] The drawings described herein are used to provide a further understanding of the present disclosure and constitute a part of the present disclosure. The illustrative embodiments of the present disclosure and their descriptions are used to explain the present disclosure and do not constitute an improper limitation on the present disclosure. In the drawings:
[0024] Figure 1is a flow chart of a method for training a well cluster prediction model for natural gas wells;
[0025] Figure 2 yes Figure 1 Flowchart of the specific steps of segmentation in the training method;
[0026] Figure 3 yes Figure 1 A flowchart of the specific steps of training a single well prediction model in the training method;
[0027] Figure 4 is a flow chart of a method for determining a time at which a wellhead valve of a natural gas well is to be closed;
[0028] Figure 5 is a block diagram of an apparatus for determining a time at which a wellhead valve of a natural gas well is to be closed; and
[0029] Figure 6 is a block diagram of a system for controlling the closure of a wellhead valve of a natural gas well.
[0030] List of reference numerals:
[0031] S101, S103, S105, S107, S109: steps of the training method;
[0032] S201, S203, S205, S207, S209: steps of segmentation;
[0033] S301, S303, S305: steps for training a single well prediction model;
[0034] S401, S403, S405, S407, S409, S411, S413, S415, S417, S419, S421: steps of determining method;
[0035] 1: system;
[0036] 10: Device;
[0037] 12: Sensor;
[0038] 14: Controller;
[0039] 101: data setting module;
[0040] 103: data receiving module;
[0041] 105: Processor. DETAILED DESCRIPTION
[0042] Hereinafter, embodiments of the present invention will be described in detail with reference to the accompanying drawings so that those skilled in the art can easily implement embodiments of the present invention. However, the present invention can be implemented in many different forms and should not be construed as being limited to the embodiments described herein. In the accompanying drawings, for the sake of clarity, parts that are not related to the description of the present invention will be omitted. Similar reference numerals refer to similar elements throughout the description. In addition, when providing a description with reference to the accompanying drawings, although the elements are represented by the same numerals, the reference numerals related to the elements may be changed, and the reference numerals are described only for the convenience of description, and it should not be understood that the concepts, features, functions or effects of the elements are limited by the reference numerals.
[0043] In the field of natural gas collection, wellbore models and artificial experience methods are usually used to determine the spacing measures of the wellhead. In the process of collection, taking effective artificial spacing measures is crucial to ensure the production and efficiency of natural gas.
[0044] The existing wellhead tapping measures using approximate estimation or simplified models and artificial experience methods have the problems of low efficiency, high cost and difficult management of natural gas tapping.
[0045] In view of various defects in the prior art, the present disclosure proposes an improved method, which at least solves the technical problems of low efficiency, high cost and difficult management of natural gas wells in the prior art.
[0046] Figure 1 is a flow chart of a method for training a well population prediction model for natural gas wells.
[0047] like Figure 1 As shown, the method for training a well group prediction model for natural gas wells includes:
[0048] Step S101, obtaining wellhead historical data of a single well in a well group formed by multiple wells, wherein the wellhead historical data is obtained by a sensor set at the wellhead, and the wellhead historical data includes historical oil pressure data indicating the pressure reading of natural gas in the pipe string of the natural gas well, and historical switch status data indicating the switch status of the wellhead valve corresponding to the historical oil pressure data.
[0049] Step S103, normalizing the acquired wellhead historical data.
[0050] Step S105, segmenting the normalized wellhead historical data, and establishing a time series of the normalized wellhead historical data segmented into segments.
[0051] Step S107, applying a time series prediction algorithm, training a single well prediction model for predicting the moment when the wellhead valve of a single well is to be closed according to the time series of the normalized wellhead historical data divided into segments, to output the trained single well prediction model.
[0052] Step S109, using an integrated learning algorithm to integrate multiple trained single-well prediction models to obtain an integrated result, and using the integrated result as a well group prediction model.
[0053] In this way, the control strategy is adjusted using a time series prediction algorithm and generalized using an ensemble learning algorithm, so that the generated well group prediction model can control multiple natural gas wells with improved accuracy, low cost and ease.
[0054] In actual natural gas collection operations, multiple natural gas wells are dispersed in a large geographical area. Step S101 includes acquiring wellhead historical data of a single well from a sensor disposed at the wellhead, wherein the wellhead historical data includes historical oil pressure data of the wellhead and historical switch state data indicating the switch state of the wellhead valve corresponding to the historical oil pressure data. The historical oil pressure data indicates the pressure reading of the natural gas in the pipe string of the natural gas well.
[0055] In addition, the change of oil pressure data can indirectly reflect the change of natural gas in the pipe string of the natural gas well, and then reflect the output and production capacity of the natural gas well, providing an important reference for natural gas mining and production. By monitoring the change of oil pressure data, abnormal conditions in the well can be discovered in time, such as changes in bottom hole fluids, failures of wellhead equipment, etc., so that timely measures can be taken to deal with them and ensure the stability and continuity of natural gas production. At the same time, oil pressure data can also be used to analyze and predict the production dynamics of natural gas wells, optimize production parameters, and improve production efficiency and economic benefits. Through the analysis of oil pressure data, we can better understand the production characteristics and laws of natural gas wells, so as to formulate more scientific production management and control strategies and achieve safe, stable and efficient production of natural gas wells.
[0056] Step S105 involves segmenting the normalized wellhead historical data and establishing a time series sequence of the normalized wellhead historical data segmented into segments. Specifically, the time series sequence includes a subsequence of the wellhead's historical oil pressure data and a subsequence of the wellhead's historical switch state data. The time series sequence is a series of data points of the wellhead historical data arranged in chronological order. When using the time series prediction algorithm to train a single well prediction model, the characteristics of the time series sequence are fully utilized so that the single well prediction model can learn the time dependency between data points, thereby more accurately predicting future values. Therefore, how to segment the wellhead historical data to obtain a time series sequence of the wellhead historical data is crucial to obtaining a high-accuracy single well prediction model.
[0057] Figure 2 yes Figure 1 Flowchart of the specific steps of segmentation in the training method.
[0058] like Figure 2 As shown, the specific steps of segmentation include step S201 to step S209.
[0059] Step S201, determining the time period between two openings of the wellhead valve.
[0060] Step S203, dividing the normalized wellhead historical data into different segments using the on / off status of the wellhead valve.
[0061] Step S205, determining a predetermined sampling interval.
[0062] Step S207: In each segment, the normalized wellhead historical data is sampled at a predetermined sampling interval.
[0063] Step S209, obtaining a time series of normalized wellhead historical data.
[0064] Specifically, for the period between two openings of the wellhead valve, the normalized wellhead historical data is divided into different segments using the switch state of the wellhead valve, and the segments are temporally continuous sequences.
[0065] Subsequently, the wellhead historical data of each segment is sampled, and the predetermined sampling interval may be 1 second, 2 seconds, ..., 5 seconds, ..., n seconds, where n is a positive integer.
[0066] Note that the entire sampling process is carried out within the safe operating range of the natural gas well. That is, the value of the oil pressure data is within the range of the minimum oil pressure value of the valve opening and the maximum oil pressure value of the valve opening. The minimum oil pressure value of the valve opening is the lowest value that the valve can open, which is the lower limit of the oil pressure in this range, and the maximum oil pressure value of the valve opening is the upper limit of the oil pressure at the wellhead in a safe state. The minimum oil pressure value of the valve opening and the maximum oil pressure value of the valve opening are usually determined according to the specific conditions of the wellhead and the operating requirements.
[0067] In this way, oil pressure data is a very important parameter in natural gas collection operations, providing an important reference for natural gas extraction and production. The stability and reasonable range of oil pressure data can ensure the safe operation of equipment. When the oil pressure data is within the appropriate range, it can effectively reduce equipment damage and accidents and help improve the efficiency of gas well opening.
[0068] Back to Figure 1 Step S107, step S107 involves applying a time series prediction algorithm to train a single well prediction model for predicting the moment when the wellhead valve of a single well is to be closed according to the time series of the normalized wellhead historical data divided into segments, so as to output the trained single well prediction model.
[0069] The single well prediction model plays an important role in the field of natural gas acquisition. Specifically, the single well prediction model can be used in the following aspects:
[0070] 1. Production forecast: By analyzing historical oil pressure data, the production trend of natural gas wells within a period of time can be predicted, providing a basis for production decisions.
[0071] 2. Pressure prediction: By monitoring parameters such as bottom hole pressure and wellhead pressure, the pressure changes of natural gas wells can be predicted, and production parameters can be adjusted in time (adjusting the wellhead valve opening and closing time) to avoid adverse effects caused by excessively high or low bottom hole pressure.
[0072] 3. Fault prediction: By analyzing the changing patterns of parameters such as wellhead pressure and bottom hole pressure, the failure of wellbore equipment can be predicted, and repairs and maintenance can be carried out in a timely manner to reduce the incidence of production accidents.
[0073] Therefore, how to train a single well prediction model is crucial to improving production efficiency, reducing production costs, and ensuring the safe and stable operation of natural gas wells.
[0074] Figure 3 yes Figure 1 Flowchart of the specific steps for training a single well prediction model in the training method.
[0075] like Figure 3 As shown, the specific steps of training the single well prediction model include steps S301 to S305.
[0076] Step 301 : Use a subsequence of historical oil pressure data of a wellhead in a segment and a subsequence of historical switch state data of a wellhead valve in a segment next to the segment as inputs of a time series prediction algorithm.
[0077] Step 303: Use the subsequence of the historical oil pressure data of the wellhead in the next segment as the output of the time series prediction algorithm.
[0078] Step 305: train the single well prediction model to output the trained single well prediction model.
[0079] In this way, the time series prediction algorithm uses a subsequence of the historical oil pressure data of the wellhead in a segment and a subsequence of the historical switching state data of the wellhead valve in the next segment of the segment as input, and a subsequence of the historical oil pressure data of the wellhead in the next segment as output, and trains the single well prediction model through the time series prediction algorithm to output an updated single well prediction model, so as to better combine the time series sequence of the wellhead oil pressure data and the time series sequence of the switching state of the wellhead valve with the single well prediction model to predict the production change trend of the natural gas well within a period of time, provide a basis for production decisions, and thus improve the production and collection efficiency of natural gas.
[0080] Back to Figure 1 Step S109 includes integrating multiple trained single well prediction models using an integrated learning algorithm to obtain an integrated result, and using the integrated result as the well group prediction model. Specifically, the integrated learning algorithm is trained based on the single well prediction models of multiple single wells and the wellhead historical data of all single wells, and the training result (i.e., the integrated result) is used as the well group prediction model.
[0081] In addition, in an exemplary embodiment, the ensemble learning algorithm is a voting classifier algorithm, which can reduce the variance of the model, improve prediction accuracy, improve generalization ability and the ability to handle complex problems. In addition, in another exemplary embodiment, the ensemble learning algorithm is a random forest algorithm, which is suitable for large-scale data sets, has good accuracy and robustness, and can handle missing values and unbalanced data, and reduce the risk of overfitting. Note that the examples of ensemble learning algorithms are not limited to this, and different ensemble learning algorithms can be selected according to the characteristics and requirements of the problem.
[0082] In this way, it is possible to more accurately predict gas production and pressure changes in the well, improving the accuracy and robustness of the single well prediction model.
[0083] In addition, the time series prediction algorithm includes a long short-term memory network algorithm (i.e., LSTM algorithm), which plays an important role in the field of natural gas collection. Natural gas collection is a complex process that involves a large amount of data collection, processing, and analysis. The LSTM algorithm can help professionals in the field of natural gas collection process and analyze large amounts of data, thereby improving collection efficiency and accuracy. In addition to the LSTM algorithm, the time series prediction algorithm can also include a large model and a Transformer, and the examples of the time series prediction algorithm are not limited to this.
[0084] In addition, the single well prediction model is a time series prediction model. The time series prediction model plays an important role in training the single well prediction model. The time series prediction model is a recurrent neural network model that can process time series data and can capture the time dependency in the input data, which is very important for the dynamic changes of natural gas in the tubing of the natural gas well. Through the time series prediction model, the production trend of natural gas in the downhole tubing can be better understood, thereby improving the prediction ability and generalization ability of the model, so as to better realize the control and optimization of natural gas wells.
[0085] Figure 4 It is a flow chart of a method for determining a time at which a wellhead valve of a natural gas well is to be closed.
[0086] like Figure 4As shown, the method for determining the time when the wellhead valve of a natural gas well is to be closed includes:
[0087] Step S401: setting the well opening oil pressure value of a single well in a well group formed by multiple wells at the current moment, and increasing the well opening oil pressure value by a constant oil pressure difference based on the minimum oil pressure value when the valve is opened to obtain a discrete well opening oil pressure value sequence.
[0088] Step S403: Acquire the wellhead historical data of a single well, wherein the wellhead historical data is acquired by a sensor disposed at the wellhead, and the wellhead historical data includes historical oil pressure data indicating the pressure reading of the natural gas in the tubing string of the natural gas well, and historical switch status data indicating the switch status of the wellhead valve corresponding to the historical oil pressure data.
[0089] Step S405: normalize the acquired wellhead historical data, divide the normalized wellhead historical data into segments, and establish a time series sequence of the normalized wellhead historical data divided into segments, calculate the oil pressure change value of the historical oil pressure data in the normalized wellhead historical data for each segment, and obtain multiple oil pressure change values of multiple segments within the period between two openings of the wellhead valve, so as to calculate the first unit time oil pressure change value of the multiple oil pressure change values within the period.
[0090] Step S407: inputting a sequence of historical oil pressure data of the wellhead in a segment and a sequence of historical switch state data of the wellhead valve in the next segment of the segment into the well group prediction model trained by the above method.
[0091] Step S409: Based on the well group prediction model, output a sequence of predicted oil pressure data in the next segment of the wellhead, wherein each oil pressure data in the sequence of oil pressure data indicates the oil pressure of the wellhead at each moment in the next segment.
[0092] Step S411: constructing a curve of the oil pressure data sequence at each moment according to the oil pressure data of the oil pressure data sequence at each moment, and calculating the gradient of the curve of the oil pressure data sequence at each moment.
[0093] Step S413: Obtain a gradient threshold.
[0094] Step S415: If the gradient at a first moment after the current moment is less than the gradient threshold, a first time interval from the current moment to the first moment is calculated.
[0095] Step S417: If the oil pressure value of the oil pressure data sequence at the second moment after the first moment is not less than the oil pressure value of the well opening oil pressure value sequence at the second moment, then calculate the second time interval from the current moment to the second moment.
[0096] Step S419: within the first time interval, calculate the oil pressure change value of the sequence of oil pressure data for each segment, and obtain multiple oil pressure change values of multiple segments within the first time interval to calculate the second unit time oil pressure change value of the multiple oil pressure change values within the second time interval.
[0097] Step S421: If the oil pressure change value per unit time is greater than the oil pressure change value per unit time, the first moment is selected as the moment when the wellhead valve is to be closed. If the oil pressure value of the oil pressure data sequence at the third moment is greater than the maximum oil pressure value when the valve is opened, the third moment is selected as the moment when the wellhead valve is to be closed, wherein the third moment is any moment in the time period.
[0098] In this way, the device obtains the sequence of oil pressure values for opening the well via the data setting module, receives the wellhead history data of a single well from the sensor via the data receiving module, and communicates with the data setting module and the data receiving module via the processor to obtain the sequence of oil pressure values for opening the well and the wellhead history data of the single well for further processing, thereby easily determining the time when the wellhead valve is to be closed with improved accuracy and at a lower cost.
[0099] Figure 5 It is a block diagram of an apparatus for determining the time at which a wellhead valve of a natural gas well is to be closed.
[0100] Figure 5 The device 10 shown performs Figure 4 A method for determining the time at which a wellhead valve of a natural gas well is to be closed is shown.
[0101] like Figure 5 As shown, the device 10 includes a data setting module 101 , a data receiving module 103 and a processor 105 .
[0102] Specifically, the data setting module 101 sets the well-opening oil pressure value of a single well in a well group formed by a plurality of wells at the current moment, and increases the well-opening oil pressure value by a constant oil pressure difference value based on the lowest oil pressure value of the valve opening to obtain a discretized well-opening oil pressure value sequence. The data receiving module 103 is connected to a sensor arranged at the wellhead in communication, and the communication connection includes an indirect connection, a direct connection, or both an indirect connection and a direct connection, so as to obtain the wellhead historical data of a single well in a well group formed by a plurality of wells from the sensor. The wellhead historical data includes historical oil pressure data indicating the pressure reading of natural gas in the pipe string of the natural gas well, and historical switch state data indicating the switch state of the wellhead valve corresponding to the historical oil pressure data.
[0103] The processor 105 is configured to communicate with the data setting module 101 and the data receiving module 103 to obtain a sequence of well opening oil pressure values and wellhead historical data of a single well, normalize the acquired wellhead historical data, segment the normalized wellhead historical data, and establish a time series sequence of the normalized wellhead historical data divided into segments, calculate the oil pressure change value of the historical oil pressure data in the normalized wellhead historical data for each segment, and obtain multiple oil pressure change values of multiple segments in a period between two openings of the wellhead valve to calculate the first unit time oil pressure change value of the multiple oil pressure change values in the period, and input the sequence of the wellhead historical oil pressure data in a segment and the sequence of the historical switch state data of the wellhead valve in the next segment of the segment into the user. Figure 1 In the well group control prediction type obtained by training the method shown, based on the well group prediction model, a sequence of predicted oil pressure data in the next segment of the wellhead is output, wherein each oil pressure data in the sequence of oil pressure data indicates the oil pressure of the wellhead at each moment in the next segment, and a curve of the sequence of oil pressure data is constructed according to the oil pressure data of the sequence of oil pressure data at each moment and the gradient of the curve of the sequence of oil pressure data at each moment is calculated.
[0104] In addition, the data receiving module 103 also obtains a gradient threshold from an external source and transmits the gradient threshold to the processor 105. The gradient threshold can be preset by an engineer according to actual needs in actual applications, for example, set to 0.01, but this example is not limited thereto.
[0105] After receiving the gradient threshold, the processor 105 performs the following processing:
[0106] If the gradient at the first moment after the current moment is less than the gradient threshold, calculating the first time interval from the current moment to the first moment;
[0107] If the oil pressure value of the oil pressure data sequence at a second moment after the first moment is not less than the oil pressure value of the well opening oil pressure value sequence at the second moment, then calculating a second time interval from the current moment to the second moment;
[0108] In a first time interval, calculating an oil pressure variation value of a sequence of oil pressure data for each segment, and obtaining a plurality of oil pressure variation values of a plurality of segments in the first time interval to calculate a second unit time oil pressure variation value of the plurality of oil pressure variation values in a second time interval; and
[0109] If the oil pressure change value per unit time is greater than the oil pressure change value per unit time, the first moment is selected as the moment when the wellhead valve is to be closed. If the oil pressure value in the sequence of oil pressure data at the third moment is greater than the maximum oil pressure value when the valve is opened, the third moment is selected as the moment when the wellhead valve is to be closed, wherein the third moment is any moment in the time period.
[0110] In this way, the device obtains the sequence of oil pressure values for opening the well via the data setting module, receives the wellhead history data of a single well from the sensor via the data receiving module, and communicates with the data setting module and the data receiving module via the processor to obtain the sequence of oil pressure values for opening the well and the wellhead history data of the single well for further processing, thereby easily determining the time when the wellhead valve is to be closed with improved accuracy and at a lower cost.
[0111] Figure 6 is a block diagram of a system for controlling the closure of a wellhead valve of a natural gas well.
[0112] like Figure 6 As shown, the system 1 includes Figure 5 The device 10, sensor 12 and controller 14 are shown. Specifically, the sensor 12 is arranged at the wellhead of a single well of a natural gas well to obtain wellhead data about the wellhead of the single well, wherein the wellhead data includes wellhead history data and wellhead setting data. The controller 14 is configured to be connected in communication with the device 10 to receive from the device 10 the time when the wellhead valve is to be closed determined by the device 10.
[0113] The wellhead data collected by the sensor 12 can be transmitted to the device 10 via the controller 14, so that the data receiving module 103 in the device 10 can obtain the wellhead data. As another implementation, it can also be directly transmitted to the device 10 via other transmission paths, and the present disclosure is not limited thereto.
[0114] In addition, the controller 14 transmits an instruction of the time when the wellhead valve is to be closed to the wellhead valve to control the wellhead valve to be closed.
[0115] The system for controlling the closing of the wellhead valve of the natural gas well can not only control the wellhead valve online through the above-mentioned communication connection, but also use the time series prediction algorithm to train the single well prediction model online, thereby training the well group prediction model online.
[0116] In this way, the system acquires wellhead data via sensors, determines the time when the wellhead valve of the natural gas well is to be closed via a device, and communicates with the device via a controller to control the closing of the wellhead valve, thereby easily controlling the closing of the wellhead valve with improved accuracy and at a lower cost.
[0117] For natural gas fields, there are a large number of wells. The application of time series prediction algorithms and integrated learning algorithms to adjust control strategies reduces operation and maintenance costs. Considering the different conditions of natural gas well production, such as development period, geographical conditions, wellhead location, current production system, etc., the precise adjustment of gas well production system can be achieved intelligently without increasing data collection conditions. In addition, using historical data from different wellheads, the prediction accuracy of the single well prediction model of a single well can be calibrated or improved.
[0118] In an embodiment of the present invention, a technical solution is provided for combining a time series prediction algorithm and an integrated learning algorithm to obtain a well group prediction model, determining the time when the wellhead valve is to be closed based on the setting status of a single well, the wellhead historical data and the well group prediction model, and controlling the wellhead valve to be closed at the time to be closed, so as to at least solve the technical problems of low efficiency, high cost and difficult management of natural gas well opening in the prior art, and achieve the technical effect of optimizing the production operation system of natural gas wells to improve the production and collection efficiency of natural gas, reduce costs and facilitate management.
[0119] In the above embodiments of the present disclosure, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0120] In the several embodiments provided in the present disclosure, it should be understood that the disclosed technical contents can be implemented in other ways.
[0121] The above is only a preferred embodiment of the present disclosure. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principle of the present disclosure. These improvements and modifications should also be regarded as the scope of protection of the present disclosure.
Claims
1. A method for training a well cluster prediction model for natural gas wells, the method comprising: Acquire wellhead historical data of a single well in a well group formed by a plurality of wells, wherein the wellhead historical data is acquired by a sensor disposed at the wellhead, and the wellhead historical data includes historical oil pressure data indicating a pressure reading of natural gas in a pipe string of the natural gas well, and historical switch state data indicating a switch state of a wellhead valve corresponding to the historical oil pressure data; Normalizing the acquired wellhead historical data; Dividing the normalized wellhead historical data into segments, and establishing a time series of the normalized wellhead historical data divided into segments; Applying a time series prediction algorithm, training a single well prediction model for predicting the time when the wellhead valve of a single well is to be closed according to the time series of the normalized wellhead historical data divided into segments, so as to output a trained single well prediction model; An integrated learning algorithm is used to integrate the multiple trained single-well prediction models to obtain an integrated result, and the integrated result is used as a well group prediction model.
2. The method according to claim 1, wherein: The normalized wellhead historical data is segmented and a time series of the normalized wellhead historical data segmented into segments is established, including: For the period between two openings of the wellhead valve, the normalized wellhead historical data are divided into different segments using the switching state of the wellhead valve. In each of the segments, the normalized wellhead historical data are sampled at a predetermined sampling interval to obtain a time series of the normalized wellhead historical data.
3. The method according to claim 2, wherein: The time series includes: a subsequence of the historical oil pressure data of the wellhead and a subsequence of the historical switch state data of the wellhead valve, And wherein, applying the time series prediction algorithm, training the single well prediction model according to the time series sequence of the normalized wellhead historical data divided into segments to output the trained single well prediction model includes: for the time series prediction algorithm, using a subsequence of the historical oil pressure data of the wellhead in a segment and a subsequence of the historical switching state data of the wellhead valve in the next segment of the segment as the input of the time series prediction algorithm, and a subsequence of the historical oil pressure data of the wellhead in the next segment as the output of the time series prediction algorithm, training the single well prediction model, and outputting the trained single well prediction model.
4. According to the method of claim 1, the time series prediction algorithm includes a long short-term memory network algorithm.
5. According to the method of claim 1, the single well prediction model is a time series prediction model.
6. A method for determining the time at which a wellhead valve of a natural gas well is to be closed, the method comprising: Setting the well opening oil pressure value of a single well in a well group formed by a plurality of wells at the current moment, and increasing the well opening oil pressure value by a constant oil pressure difference value based on the lowest oil pressure value when the valve is opened to obtain a discretized well opening oil pressure value sequence; Acquire wellhead historical data of the single well, wherein the wellhead historical data is acquired by a sensor disposed at the wellhead, and the wellhead historical data includes historical oil pressure data indicating a pressure reading of natural gas in a pipe string of the natural gas well, and historical switch state data indicating a switch state of a wellhead valve corresponding to the historical oil pressure data; Normalizing the acquired wellhead historical data, dividing the normalized wellhead historical data into segments, and establishing a time series of the normalized wellhead historical data divided into segments, calculating the oil pressure change value of the historical oil pressure data in the normalized wellhead historical data for each segment, and obtaining a plurality of oil pressure change values of a plurality of segments within a period between two openings of the wellhead valve, so as to calculate a first unit time oil pressure change value of the plurality of oil pressure change values within the period; Inputting a sequence of historical oil pressure data of the wellhead in a segment and a sequence of historical switch state data of the wellhead valve in a segment next to the segment into a well group prediction model trained by the method according to any one of claims 1 to 5; Based on the well group prediction model, output a sequence of predicted oil pressure data in the next segment of the wellhead, wherein each oil pressure data in the sequence of oil pressure data indicates the oil pressure of the wellhead at each moment in the next segment; constructing a curve of the oil pressure data sequence at each time according to the oil pressure data of the oil pressure data sequence at each time and calculating the gradient of the curve of the oil pressure data sequence at each time; Get the gradient threshold; If the gradient at a first moment after the current moment is less than the gradient threshold, calculating a first time interval from the current moment to the first moment; If the oil pressure value of the oil pressure data sequence at a second moment after the first moment is not less than the oil pressure value of the well opening oil pressure value sequence at the second moment, then calculating a second time interval from the current moment to the second moment; In the first time interval, calculating the oil pressure change value of the sequence of the oil pressure data for each segment, and obtaining a plurality of oil pressure change values of a plurality of segments in the first time interval to calculate a second unit time oil pressure change value of the plurality of oil pressure change values in the second time interval; and If the second unit time oil pressure change value is greater than the first unit time oil pressure change value, the first moment is selected as the moment when the wellhead valve is to be closed; if the oil pressure value of the oil pressure data sequence at the third moment is greater than the maximum oil pressure value when the valve is opened, the third moment is selected as the moment when the wellhead valve is to be closed, wherein the third moment is any moment in the time period.
7. A device (10) for determining the time at which a wellhead valve of a natural gas well is to be closed, the device comprising: A data setting module (101) is used to set the well opening oil pressure value of a single well in a well group formed by a plurality of wells at a current moment, and to increase the well opening oil pressure value by a constant oil pressure difference based on the lowest oil pressure value when the valve is opened to obtain a discretized well opening oil pressure value sequence; A data receiving module (103) is communicatively connected to a sensor disposed at a wellhead to obtain wellhead historical data of a single well in a well group formed by a plurality of wells from the sensor, wherein the wellhead historical data includes historical oil pressure data indicating a pressure reading of natural gas in a pipe string of the natural gas well, and historical switch state data indicating a switch state of a wellhead valve corresponding to the historical oil pressure data; The processor (105) is configured to communicate with the data setting module (101) and the data receiving module (103) to obtain the well opening oil pressure value sequence and the wellhead historical data of the single well, normalize the acquired wellhead historical data, divide the normalized wellhead historical data into segments, and establish a time series sequence of the normalized wellhead historical data divided into segments, calculate the oil pressure change value of the historical oil pressure data in the normalized wellhead historical data for each segment, and obtain multiple oil pressure change values of multiple segments in a period between two openings of the wellhead valve, so as to calculate the first unit of the multiple oil pressure change values in the period. The oil pressure change value over time is inputted into a sequence of historical oil pressure data of the wellhead in a segment and a sequence of historical switch state data of the wellhead valve in a segment next to the segment into a well group control prediction model obtained by training using the method according to any one of claims 1 to 5, and based on the well group prediction model, a sequence of predicted oil pressure data in the next segment of the wellhead is outputted, wherein each oil pressure data in the sequence of oil pressure data indicates the oil pressure of the wellhead at each moment in the next segment, and a curve of the sequence of oil pressure data is constructed according to the oil pressure data of the sequence of oil pressure data at each moment and the curve of the sequence of oil pressure data at each moment, and the gradient of the curve of the sequence of oil pressure data at each moment is calculated; Wherein, the data receiving module (103) further obtains a gradient threshold from an external source and transmits the gradient threshold to the processor (105); After receiving the gradient threshold, the processor (105) performs the following processing: If the gradient at a first moment after the current moment is less than the gradient threshold, calculating a first time interval from the current moment to the first moment; If the oil pressure value of the oil pressure data sequence at a second moment after the first moment is not less than the oil pressure value of the well opening oil pressure value sequence at the second moment, then calculating a second time interval from the current moment to the second moment; In the first time interval, calculating the oil pressure change value of the sequence of the oil pressure data for each segment, and obtaining a plurality of oil pressure change values of a plurality of segments in the first time interval to calculate a second unit time oil pressure change value of the plurality of oil pressure change values in the second time interval; and If the second unit time oil pressure change value is greater than the first unit time oil pressure change value, the first moment is selected as the moment when the wellhead valve is to be closed; if the oil pressure value of the oil pressure data sequence at the third moment is greater than the maximum oil pressure value when the valve is opened, the third moment is selected as the moment when the wellhead valve is to be closed, wherein the third moment is any moment in the time period.
8. A system (1) for controlling the closing of a wellhead valve of a natural gas well, the system comprising: The device (10) for determining the time when the wellhead valve of a natural gas well is to be closed according to claim 7; A sensor (12) is arranged at the wellhead of a natural gas well to obtain wellhead data about the wellhead of a single well, wherein the wellhead data includes wellhead history data and wellhead setting data; and a controller (14) configured to be in communication with the device to receive from the device a time at which the wellhead valve is to be closed as determined by the device; The controller (14) transmits an instruction indicating the time when the wellhead valve is to be closed to the wellhead valve, so as to control the wellhead valve to be closed.
