Natural gas well batch production yield prediction based on PatchTST model
By using the PatchTST model to construct a batch production output prediction model of natural gas wells, dynamically adjusting the input timing length, solving the problem of poor yield prediction caused by inaccurate timing characteristics in the prior art, and achieving higher prediction accuracy.
Patent Information
- Application Number
- CN202411801394.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-09
- Publication Date
- 2025-03-14
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
In the prior art, there is a problem of inaccurate timing characteristics for the output of natural gas shale gas wells, resulting in poor prediction results.
The PatchTST model is used to construct a prediction model for batch production of natural gas wells. By collecting and pre-processing oil pressure, sleeve pressure, oil sleeve pressure difference and gas production data, the input timing length is dynamically adjusted to improve prediction accuracy.
It significantly improves the accuracy of gas well batch production output prediction, reduces prediction error, and is suitable for gas well management that processes time series data.
Smart Images

Figure CN119623757A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of natural gas well production prediction, and in particular relates to a natural gas well intermittent production production prediction method, system and medium based on a PatchTST model. Background Art
[0002] Shale gas is a natural gas resource that can be mined in shale layers. With the rapid development of the shale gas industry, higher requirements have been placed on the refined management of shale gas wells, especially for intermittent production wells. The production changes of such wells show greater volatility and uncertainty, which poses a challenge to gas well management and production forecasting. In order to meet this challenge, the industry has developed a variety of production forecasting methods to improve the operational efficiency and economic benefits of shale gas fields.
[0003] At present, the technologies mainly used for shale gas well production prediction are divided into two categories: one is based on reservoir, geological and physical theories; the other is the use of data-driven technologies such as machine learning and deep learning, among which:
[0004] 1. Production prediction methods based on reservoir, geological and physical theories: This type of method usually combines classic oil and gas production models, such as the Weng model, the Hubbert model and the Weibull model. Through these theoretical models and the use of optimization algorithms to determine the parameter weights in the model, a relatively accurate prediction of oil and gas field production can be achieved. However, when faced with data instability caused by unexpected production stoppages, this type of method often finds it difficult to provide satisfactory prediction accuracy.
[0005] 2. Production prediction methods based on machine learning and deep learning: With the enhancement of big data processing capabilities, a large number of studies have emerged in recent years that use machine learning, especially deep learning, to solve production prediction problems. For example, artificial neural networks are used to simulate the nonlinear relationship between influencing factors and natural gas well production, or a variety of traditional statistical models such as gray system models (such as GM (1,1)), autoregressive integrated moving average models (ARIMA), and logistic regression models (LR) are combined in order to improve the prediction effect through model complementarity; in addition, some researchers have tried to integrate the production decline model with the long short-term memory network (LSTM) to better capture the production decline characteristics of shale gas wells at different flow stages. Nevertheless, how to effectively extract useful information from time series data remains a difficult problem; some attempts include applying convolutional neural networks (CNNs) to process time series data in the form of two-dimensional images after special transformations. Although this method can enhance feature extraction capabilities, its inherent limitations mean that it may not be the best choice for dealing with time series problems in the strict sense.
[0006] Therefore, in the prior art, a variety of methods have been proposed and applied in shale gas well production prediction, but some problems still remain unresolved. To this end, a shale gas well production prediction solution is needed that can effectively overcome the shortcomings of the prior art and fully utilize the advantages of the prior art. Summary of the invention
[0007] The technical problem solved by the present invention is to provide a method for predicting the intermittent production output of natural gas wells based on the PatchTST model, so as to solve the problem of poor prediction results caused by inaccurate timing characteristics in the prior art of natural gas shale gas well production prediction.
[0008] The basic solution provided by the present invention: a method for predicting the intermittent production output of a natural gas well based on the PatchTST model, comprising:
[0009] S1: Collect oil pressure data, casing pressure data and gas production data from the historical operation data of the shale gas well of the target natural gas, generate a sample data set after preprocessing, and divide the sample data set into a training set, a validation set and a test set according to a preset ratio;
[0010] S2: Construct a gas well intermittent production yield prediction model based on the PatchTST model, fix the time series output length of the prediction data in the gas well intermittent production yield prediction model; input the training sets of corresponding input lengths of multiple different time series input lengths into the gas well intermittent production yield prediction model, and output the prediction results of the fixed time series output length;
[0011] S3: Use the validation set and the test set to verify and test the gas well intermittent production yield prediction model, and compare the error values of the prediction results of different time series input lengths, and set the time series input length with the smallest error value as the time series input length of the gas well intermittent production yield prediction model;
[0012] S4: retain the model parameter setting with the smallest error value, and encapsulate the gas well intermittent production output prediction model.
[0013] Further, the S1 includes:
[0014] S1-1: Collect historical operation data of target natural gas shale wells;
[0015] S1-2: extracting gas production data from historical operation data, and obtaining oil pressure data and casing pressure data that affect the gas production data through correlation algorithm calculation;
[0016] S1-3: Calculating and generating oil-casing pressure difference data based on the acquired oil pressure data and casing pressure data;
[0017] S1-4: pre-process the oil pressure data, casing pressure data, oil-casing pressure difference data and gas production data, and aggregate them to generate a sample data set.
[0018] Furthermore, the S1 further includes:
[0019] S1-5: Divide the sample data set into training set, validation set and test set in a ratio of 8:1:1.
[0020] Further, the S2 includes:
[0021] S2-1: Construct a gas well intermittent production output prediction model based on the PatchTST model and set the model hyperparameters;
[0022] S2-2: Fixed time series output length of the intermittent production prediction model for fixed gas wells;
[0023] S2-3: Input the multivariate training sets x of different time series input lengths respectively. The gas well intermittent production output prediction model splits the input training sets of different time series input lengths into M independent sequences The i-th univariate sequence Where, L represents the time series input length, i=1,…,M;
[0024] S2-4: Each independent sequence x (i) Fragment and output multiple fragments. The expression is:
[0025]
[0026] Where P represents the fragment length and N represents the number of fragments;
[0027] S2-5: Position encoding is performed on multiple segments, and the encoded segments are input into the encoder in the gas well intermittent production output prediction model, and the prediction results are output.
[0028] Further, the S2-5 includes:
[0029] S2-5-1: Training a matrix Add it to the input fragment and output the position encoding result in:
[0030]
[0031] Where W p Represents the feature matrix for increasing the dimension of the input fragment;
[0032] S2-5-2: Input the position encoding result into the encoder, and the encoder generates a D-dimensional matrix
[0033] S2-5-3: The matrix z i All elements in the matrix are concatenated in order to generate a 1×(D×N) vector. Perform linear mapping and output the prediction results of the time series.
[0034] Further, the S3 includes:
[0035] S3-1: Use the validation set to verify the prediction results of the training of the gas well intermittent production output prediction model;
[0036] S3-2: retain the model parameters whose verification results meet the requirements, input the test sets with different time series lengths into the gas well intermittent production output prediction model, and output the prediction results with a fixed time series of 24;
[0037] S3-3: Compare the errors of the prediction results of inputs with different time series lengths, and retain the input corresponding to the time series length with the smallest error as the time series length of the input data of the gas well intermittent production output prediction model.
[0038] The intermittent production yield prediction system of a natural gas well based on the PatchTST model is applied to the intermittent production yield prediction method of a natural gas well based on the PatchTST model, and includes:
[0039] Data acquisition module: used to collect oil pressure data, casing pressure data and gas production data from the historical operation data of the shale gas well of the target natural gas;
[0040] Data preprocessing module: used to preprocess the collected oil pressure data, casing pressure data and gas production data, and then generate a sample data set;
[0041] Data partitioning module: used to divide the sample data set into training set, validation set and test set according to the preset ratio;
[0042] Model building module: used to build a gas well intermittent production output prediction model based on the PatchTST model;
[0043] Model training module: used to configure the hyperparameters of the gas well intermittent production yield prediction model, and after fixing the time series output length of the prediction data in the gas well intermittent production yield prediction model, input the training sets of the corresponding input lengths of multiple different time series input lengths into the gas well intermittent production yield prediction model, and output the prediction results of the fixed time series output length;
[0044] Model verification test module: the gas well intermittent production output prediction model that meets the requirements on the verification set is tested on the test set, the error values of the prediction results of different time series input lengths are compared, and the time series input length with the smallest error value is set as the time series input length of the gas well intermittent production output prediction model;
[0045] Model packaging module: used to retain the model parameter settings with the smallest error value and encapsulate the gas well intermittent production output prediction model.
[0046] A computer-readable storage medium stores a program or instruction, wherein the program or instruction enables a computer to execute the intermittent production output prediction method of a natural gas well based on the PatchTST model as described above.
[0047] The principles and advantages of the present invention are as follows: In the present invention, in view of the problem of inaccurate timing characteristics of existing prediction models, the present application adopts the PatchTST model to construct a gas well intermittent production output prediction model. In the consideration of timing characteristics, the timing length and characteristics of the input data of the prediction model are mainly focused on. The characteristics include oil pressure, casing pressure, oil-casing pressure difference and gas production data. The timing length is adjusted dynamically by fixing the output timing length, and the input timing length is obtained in the application scenarios of the prediction model for different gas well production predictions. In this way, the accuracy of the prediction model is greatly improved when performing production prediction. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] Figure 1 is a flowchart of an embodiment of the present invention;
[0049] Figure 2 is the Spearman correlation coefficient between different features in the embodiment of the present invention;
[0050] Figure 3 The curves of gas production, oil pressure and casing pressure in the embodiment of the present invention are as follows;
[0051] Figure 4 The curve of gas production and oil-casing pressure difference in the embodiment of the present invention;
[0052] Figure 5 Hyperparameter settings for the PatchTST model and the LSTM model in the embodiments of the present invention;
[0053] Figure 6 Schematic diagram of the structure of the Transformer module in the gas well intermittent production output prediction model in an embodiment of the present invention;
[0054] Figure 7 This is an error comparison diagram of the PatchTST model and the LSTM model under different time series input lengths in an embodiment of the present invention;
[0055] Figure 8 This is a comparison diagram of the true value and predicted value of the PatchTST model in the well A test set in an embodiment of the present invention;
[0056] Fig. 9 Schematic diagram of the structure of an electronic device in an embodiment of the present invention. DETAILED DESCRIPTION
[0057] The following is further described in detail through specific implementation methods:
[0058] The symbols in the drawings of the specification include: electronic device 400 , processor 401 , memory 402 , input device 403 , and output device 404 .
[0059] Shale gas is a natural gas resource that is available for exploitation and is stored in shale layers. Therefore, natural gas wells are also called shale gas wells. Currently, there are two main technologies for predicting the production of shale gas wells: methods based on reservoir, geological and physical theories and data-driven technologies such as machine learning and deep learning. Among these two types of technologies, the production prediction methods based on reservoir, geological and physical theories are difficult to provide satisfactory prediction accuracy when facing data instability caused by shutdowns; and the production prediction methods based on machine learning and deep learning have limitations in how to extract effective data from time series data. In this regard, in order to solve this technical problem, the technical solution of this application and the embodiments are basically as shown in the attached Figure 1 As shown: The intermittent production output prediction method of natural gas wells based on the PatchTST model includes:
[0060] S1: Collect the oil pressure data, casing pressure data and gas production data from the historical operation data of the shale gas well of the target natural gas, generate a sample data set after preprocessing, and divide the sample data set into a training set, a validation set and a test set according to a preset ratio; wherein S1 includes:
[0061] S1-1: Collect historical operation data of target natural gas shale wells;
[0062] S1-2: extracting gas production data from historical operation data, and obtaining oil pressure data and casing pressure data that affect the gas production data through correlation algorithm calculation;
[0063] S1-3: Calculating and generating oil-casing pressure difference data based on the acquired oil pressure data and casing pressure data;
[0064] S1-4: pre-processing the oil pressure data, casing pressure data, oil-casing pressure difference data and gas production data, and collecting them to generate a sample data set;
[0065] S1-5: Divide the sample data set into training set, validation set and test set in a ratio of 8:1:1.
[0066] In this embodiment, when collecting historical operation data of the target natural gas shale gas well, the historical operation data is collected every 1 hour according to the time granularity of hours, and the gas production data is extracted. Then, the correlation algorithm is used to calculate the correlation of each factor in the historical operation data to the gas production data. In this application, the correlation algorithm adopts Spearman, such as Figure 2 As shown in the figure, the correlation coefficients between different factors are calculated by the Spearman correlation algorithm, where the value range of the correlation coefficient is [-1, 1]. When the result is close to 1, it indicates that there is a strong positive correlation between the two factors. When the result is close to -1, it indicates that there is a strong negative correlation between the two factors. Figure 2 It can be seen that the correlation between oil pressure and casing pressure is very high, with a correlation coefficient of 0.79; the correlation between gas production and oil pressure and casing pressure is relatively high, which are 0.58 and 0.53 respectively; at the same time, based on the oil pressure and casing pressure data, the oil-casing pressure difference is calculated by subtracting the casing pressure from the oil pressure, and the correlation coefficient between the oil-casing pressure difference and gas production is 0.38, indicating that there is a certain correlation between them.
[0067] Based on this, this application verifies the selected oil pressure, casing pressure and oil-casing pressure difference with the gas production data, such as Figure 3 and Figure 4 As shown, Figure 3 The curves of gas production, oil pressure and casing pressure are shown in Figure 2. For natural gas wells, the intermittent conditions usually include the conversion of production methods, shutdown, and inter-well separation. Figure 3 In the initial stage of production, that is, before November 2022, casing production will be adopted, and then it will be switched to tubing production. The resulting changes are that the oil pressure and gas production will fluctuate almost at the same time; and for the oil-casing pressure difference, such as Figure 4 As shown in the figure, it is the curve of gas production and oil-casing pressure difference change. On October 30, 2022, the natural gas well entered the intermittent production stage. During the intermittent production stage, the change of oil-casing pressure difference can reflect the production situation of the gas well. Therefore, using the oil-casing pressure difference as the input data for the intermittent production prediction of the natural gas well can effectively improve the accuracy of the prediction model.
[0068] In summary, when predicting the intermittent production output of a natural gas well, the application inputs data including oil pressure, casing pressure, oil-casing pressure difference and gas production, so as to realize the prediction of the output.
[0069] Based on the selected oil pressure data, casing pressure data, calculated oil-casing pressure difference data and gas production data, corresponding preprocessing is performed, such as data missing processing, data cleaning and data conversion, and a sample data set is generated as a sample data set for subsequent prediction model training, verification and testing. At the same time, the sample data set is divided into training set, verification set and test set in a ratio of 8:1:1, so that the subsequent prediction model is trained on the training set, and the model parameters with the best effect on the verification set are saved, and finally tested on the test set.
[0070] S2: Construct a gas well intermittent production yield prediction model based on the PatchTST model, fix the time series output length of the prediction data in the gas well intermittent production yield prediction model; input the training sets of the corresponding input lengths of multiple different time series input lengths into the gas well intermittent production yield prediction model, and output the prediction results of the fixed time series output length; wherein, S2 includes:
[0071] S2-1: Construct a gas well intermittent production yield prediction model based on the PatchTST model, and set the model hyperparameters; In this embodiment, in order to better verify the advantages of the gas well intermittent production yield prediction model constructed based on the PatchTST model in this application, the LSTM model is used as the baseline model for comparison. The basic parameter settings of the PatchTST model and the LSTM model are as follows: Figure 5 As shown, the basic parameters of the PatchTST model are set to: learning rate 2e -5 , the optimizer uses AdamW, the inactivation probability is 0.3, the number of model layers is 12, the hidden layer dimension is 1024, and the number of iterations is 1000; the basic parameters of the LSTM model are set to: learning rate 1e -3 , the optimizer uses Adam, the inactivation probability is 0.3, the number of model layers is 4, the hidden layer dimension is 1024, and the number of iterations is 1000;
[0072] S2-2: Fixed time series output length of the gas well intermittent production output prediction model; in this embodiment, in addition to the basic model parameter settings in S2-1 above, the time series setting of the model is crucial to the technical problem solved by this application. To this end, this application compares the impact of input data of different time series lengths on the accuracy of the prediction model through the intermittent characteristics of historical operation data of different natural gas wells. In this embodiment, the output length of the gas well intermittent production output prediction model is fixed to 24, and the input length is set to 12-72.
[0073] S2-3: Input the multivariate training sets x of different time series input lengths respectively. The gas well intermittent production output prediction model splits the input training sets of different time series input lengths into M independent sequences The i-th univariate sequence Wherein, L represents the time series input length, i=1,…,M; in this embodiment, for the training set input into the gas well intermittent production output prediction model, the PatchTST model divides it into multiple segments according to the time series of the input length of the training set, and then calls the Transformer module to process these segments, as described in S2-4 to S2-5 below.
[0074] S2-4: Each independent sequence x i Fragment and output multiple fragments. The expression is:
[0075]
[0076] Where P represents the fragment length, N represents the number of fragments, S represents the length of the non-overlapping region between two consecutive segments.
[0077] S2-5: Position encoding of multiple segments is performed, and the encoding is input into the encoder in the gas well intermittent production output prediction model, and the prediction result is output; wherein S2-5 includes:
[0078] S2-5-1: Training a matrix Add it to the input fragment and output the position encoding result in:
[0079]
[0080] Where W p Represents the feature matrix for increasing the dimension of the input fragment;
[0081] S2-5-2: Input the position encoding result into the encoder, and the encoder generates a D-dimensional matrix In this embodiment, the encoder adopts a Transformer encoder, which is mainly used to train a linear transformation matrix By passing the input vector Linearly map to D-dimensional vector space to obtain more hidden information. Specifically, the Transformer encoder consists of two parts: a multi-head attention mechanism and a feedforward neural network, with accumulation and normalization processing interspersed in the middle, such as Figure 6 As shown, in this application, the accumulation and standardization processing is specifically residual connection and batch standardization processing, and the expression is:
[0082] BatchNorm(X+MultiHead-Attention(X))
[0083] LayerNorm(X+FeedForward(X))
[0084] Wherein, X represents the input of the multi-head attention module and the feedforward neural network. In this embodiment, the normalization process adopts batch normalization process, which is better for the time series prediction task than the layer normalization process.
[0085] S2-5-3: The matrix z i All elements in the matrix are concatenated in order to generate a 1×(D×N) vector. Perform linear mapping and output the prediction results of the time series.
[0086] S3: Use the validation set and the test set to verify and test the gas well intermittent production output prediction model, and compare the error values of the prediction results of different time series input lengths, and set the time series input length with the smallest error value as the time series input length of the gas well intermittent production output prediction model; wherein S3 includes:
[0087] S3-1: Use the validation set to verify the prediction results of the training of the gas well intermittent production output prediction model;
[0088] S3-2: retain the model parameters whose verification results meet the requirements, input the test sets with different time series lengths into the gas well intermittent production output prediction model, and output the prediction results with a fixed time series of 24;
[0089] S3-3: Compare the errors of the prediction results of inputs with different time series lengths, and retain the input corresponding to the time series length with the smallest error as the time series length of the input data of the gas well intermittent production output prediction model.
[0090] S4: retain the model parameter setting with the smallest error value, and encapsulate the gas well intermittent production output prediction model.
[0091] In this embodiment, in order to better illustrate the technical solution of this application, five typical wells A, B, C, D, and E in a shale gas field are collected, and the collection conditions are shown in the following Table 1:
[0092] Table 1 Dataset description
[0093]
[0094]
[0095] The collected data is divided into training set, validation set and test set according to the ratio of 8:1:1. Taking well A as an example, a total of 20,064 samples from 9:00 on June 17, 2021 to 8:00 on October 1, 2023 are used as the training set, a total of 2,508 samples from 9:00 on October 1, 2023 to 20:00 on January 13, 2024 are used as the validation set, and a total of 2,508 samples from 21:00 on January 13, 2024 to 8:00 on April 24, 2024 are used as the test set; at the same time, the baseline model LSTM is used as the prediction task accuracy comparison of the PrtchTST model of this application, and the relevant model parameters are set as follows Figure 5 As shown;
[0096] At the same time, set the fixed time series output length of the LSTM model and the PatchTST model, and set different time series input lengths, such as Figure 7 As shown in the figure, the test results of the LSTM model and the PatchTST model on Well A show that the introduction of the three characteristic data of oil pressure, casing pressure and oil-casing pressure difference has a better effect. Secondly, the effect of the PatchTST model is significantly better than that of the LSTM model. In addition, when the input data length is 24, the prediction error value of the PatchTST model is the smallest, with an average error of 2496.91m per hour. 3 ,In particular, when the time series input length is greater than 24 in the PatchTST model, the ,prediction error increases as the input length increases.
[0097] Furthermore, after setting the time series input length and time series output length of the PatchTST model to 24, the test set is used for testing, such as Figure 8 As shown in the figure, in the comparison results of the predicted value curve and the true value curve of the PatchTST model in the well A test set, the predicted value of the PatchTST model can basically match the true value, and there are some very few abnormal values, such as the maximum and minimum points that cannot be predicted;
[0098] Therefore, the intermittent production output prediction model of gas wells constructed by the PatchTST model in this application can be verified through experimental data, and can well capture the production output prediction of natural gas wells with long time spans and large numerical fluctuations, such as the intermediate opening of gas wells. Further, by introducing influencing factors with large correlation coefficients, the time series input length of the prediction model is adjusted, so that the error of the prediction model can be significantly reduced. Moreover, for the adjusted time series input length, it is shown that the larger the time series input length, the better. On the contrary, the larger the time series input length, the greater the error. Therefore, the solution of this application, based on the advantages of the existing model, supplemented by improvements, can greatly improve the accuracy of the prediction results.
[0099] In another embodiment of the present embodiment, a natural gas well intermittent production output prediction system based on the PatchTST model is also included, which is applied to the above-mentioned natural gas well intermittent production output prediction method based on the PatchTST model, including:
[0100] Data acquisition module: used to collect oil pressure data, casing pressure data and gas production data from the historical operation data of the shale gas well of the target natural gas;
[0101] Data preprocessing module: used to preprocess the collected oil pressure data, casing pressure data and gas production data, and then generate a sample data set;
[0102] Data partitioning module: used to divide the sample data set into training set, validation set and test set according to the preset ratio;
[0103] Model building module: used to build a gas well intermittent production output prediction model based on the PatchTST model;
[0104] Model training module: used to configure the hyperparameters of the gas well intermittent production yield prediction model, and after fixing the time series output length of the prediction data in the gas well intermittent production yield prediction model, input the training sets of the corresponding input lengths of multiple different time series input lengths into the gas well intermittent production yield prediction model, and output the prediction results of the fixed time series output length;
[0105] Model verification test module: the gas well intermittent production output prediction model that meets the requirements on the verification set is tested on the test set, the error values of the prediction results of different time series input lengths are compared, and the time series input length with the smallest error value is set as the time series input length of the gas well intermittent production output prediction model;
[0106] Model packaging module: used to retain the model parameter settings with the smallest error value and encapsulate the gas well intermittent production output prediction model.
[0107] Also included is an electronic device such as Fig. 9 As shown, the electronic device 400 includes one or more processors 401 and a memory 402 .
[0108] The processor 401 may be a central processing unit (CPU) or other forms of processing units having data processing capabilities and / or instruction execution capabilities, and may control other components in the electronic device 400 to perform desired functions.
[0109] The memory 402 may include one or more computer program products, and the computer program product may include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. The volatile memory may include, for example, random access memory (RAM) and / or cache memory (cache), etc. The non-volatile memory may include, for example, read-only memory (ROM), hard disk, flash memory, etc. One or more computer program instructions may be stored on the computer-readable storage medium, and the processor 401 may run the program instructions to implement the intermittent production output prediction method of natural gas wells based on the PatchTST model of any embodiment of the present invention described above and / or other desired functions. Various contents such as initial external parameters, thresholds, etc. may also be stored in the computer-readable storage medium.
[0110] In one example, the electronic device 400 may further include: an input device 403 and an output device 404, which are interconnected via a bus system and / or other forms of connection mechanisms (not shown). The input device 403 may include, for example, a keyboard, a mouse, etc. The output device 404 may output various information to the outside, including early warning information, braking force, etc. The output device 404 may include, for example, a display, a speaker, a printer, a communication network and a remote output device connected thereto, etc.
[0111] Of course, to simplify, Fig. 9 Only some of the components related to the present invention in the electronic device 400 are shown, and components such as a bus, an input / output interface, etc. are omitted. In addition, according to specific application conditions, the electronic device 400 may also include any other appropriate components.
[0112] In addition to the above-mentioned methods and devices, an embodiment of the present invention may also be a computer program product, which includes computer program instructions, which, when executed by a processor, enable the processor to execute the steps of the method for predicting intermittent production output of natural gas wells based on the PatchTST model provided in any embodiment of the present invention.
[0113] The computer program product may be written in any combination of one or more programming languages to write program code for performing the operations of the embodiments of the present invention, including object-oriented programming languages such as Java, C++, etc., and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server.
[0114] In addition, an embodiment of the present invention may also be a computer-readable storage medium on which computer program instructions are stored. When the computer program instructions are executed by a processor, the processor executes the steps of the method for predicting intermittent production output of natural gas wells based on the PatchTST model provided in any embodiment of the present invention.
[0115] The computer readable storage medium can adopt any combination of one or more readable media. The readable medium can be a readable signal medium or a readable storage medium. The readable storage medium can include, for example, but is not limited to, a system, device or device of electricity, magnetism, light, electromagnetic, infrared, or semiconductor, or any combination of the above. More specific examples (non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.
[0116] The above are only embodiments of the present invention. Common knowledge such as the known specific structures and characteristics in the scheme is not described in detail here. Ordinary technicians in the relevant field know all the common technical knowledge in the technical field to which the invention belongs before the application date or priority date, can obtain all the existing technologies in the field, and have the ability to apply conventional experimental means before that date. Ordinary technicians in the relevant field can improve and implement this scheme in combination with their own abilities under the enlightenment given by this application. Some typical known structures or known methods should not become obstacles for ordinary technicians in the relevant field to implement this application. It should be pointed out that for those skilled in the art, without departing from the structure of the present invention, several deformations and improvements can be made, which should also be regarded as the scope of protection of the present invention, and these will not affect the effect of the implementation of the present invention and the practicality of the patent. The scope of protection required by this application shall be based on the content of its claims, and the specific implementation methods and other records in the specification can be used to interpret the content of the claims.
Claims
1. A method for predicting intermittent production output of natural gas wells based on the PatchTST model, characterized by: include: S1: Collect oil pressure data, casing pressure data and gas production data from the historical operation data of the shale gas well of the target natural gas, generate a sample data set after preprocessing, and divide the sample data set into a training set, a validation set and a test set according to a preset ratio; S2: Construct a gas well intermittent production yield prediction model based on the PatchTST model, fix the time series output length of the prediction data in the gas well intermittent production yield prediction model; input the training sets of corresponding input lengths of multiple different time series input lengths into the gas well intermittent production yield prediction model, and output the prediction results of the fixed time series output length; S3: Use the validation set and the test set to verify and test the gas well intermittent production yield prediction model, and compare the error values of the prediction results of different time series input lengths, and set the time series input length with the smallest error value as the time series input length of the gas well intermittent production yield prediction model; S4: retain the model parameter setting with the smallest error value, and encapsulate the gas well intermittent production output prediction model.
2. The method for predicting the intermittent production output of a natural gas well based on the PatchTST model according to claim 1 is characterized in that: The S1 includes: S1-1: Collect historical operation data of target natural gas shale wells; S1-2: extracting gas production data from historical operation data, and obtaining oil pressure data and casing pressure data that affect the gas production data through correlation algorithm calculation; S1-3: Calculating and generating oil-casing pressure difference data based on the acquired oil pressure data and casing pressure data; S1-4: pre-process the oil pressure data, casing pressure data, oil-casing pressure difference data and gas production data, and aggregate them to generate a sample data set.
3. The method for predicting the intermittent production output of a natural gas well based on the PatchTST model according to claim 2 is characterized in that: The S1 further comprises: S1-5: Divide the sample data set into training set, validation set and test set in a ratio of 8:1:
1.
4. The method for predicting the intermittent production output of a natural gas well based on the PatchTST model according to claim 3 is characterized in that: The S2 includes: S2-1: Construct a gas well intermittent production output prediction model based on the PatchTST model and set the model hyperparameters; S2-2: Fixed time series output length of the intermittent production prediction model for fixed gas wells; S2-3: Input the multivariate training sets x of different time series input lengths respectively. The gas well intermittent production output prediction model splits the input training sets of different time series input lengths into M independent sequences The i-th univariate sequence Where, L represents the time series input length, i=1,…,M; S2-4: Each independent sequence x (i) Fragment and output multiple fragments. The expression is: Where P represents the fragment length and N represents the number of fragments; S2-5: Position encoding is performed on multiple segments, and the encoded segments are input into the encoder in the gas well intermittent production output prediction model, and the prediction results are output.
5. The method for predicting the intermittent production output of a natural gas well based on the PatchTST model according to claim 4 is characterized in that: The S2-5 includes: S2-5-1: Training a matrix Add it to the input fragment and output the position encoding result in: Where W p Represents the feature matrix for increasing the dimension of the input fragment; S2-5-2: Input the position encoding result into the encoder, and the encoder generates a D-dimensional matrix S2-5-3: Transform the matrix z i All elements in the matrix are concatenated in order to generate a 1×(D×N) vector. Perform linear mapping and output the prediction results of the time series.
6. The method for predicting the intermittent production output of a natural gas well based on the PatchTST model according to claim 5 is characterized in that: The S3 includes: S3-1: Use the validation set to verify the prediction results of the training of the gas well intermittent production output prediction model; S3-2: retain the model parameters whose verification results meet the requirements, input the test sets with different time series lengths into the gas well intermittent production output prediction model, and output the prediction results with a fixed time series of 24; S3-3: Compare the errors of the prediction results of inputs with different time series lengths, and retain the input corresponding to the time series length with the smallest error as the time series length of the input data of the gas well intermittent production output prediction model.
7. A gas well intermittent production yield prediction system based on the PatchTST model, applied to a gas well intermittent production yield prediction method based on the PatchTST model as described in any one of claims 1 to 6, characterized in that: include: Data acquisition module: used to collect oil pressure data, casing pressure data and gas production data from the historical operation data of the shale gas well of the target natural gas; Data preprocessing module: used to preprocess the collected oil pressure data, casing pressure data and gas production data, and then generate a sample data set; Data partitioning module: used to divide the sample data set into training set, validation set and test set according to the preset ratio; Model building module: used to build a gas well intermittent production output prediction model based on the PatchTST model; Model training module: used to configure the hyperparameters of the gas well intermittent production yield prediction model, and after fixing the time series output length of the prediction data in the gas well intermittent production yield prediction model, input the training sets of the corresponding input lengths of multiple different time series input lengths into the gas well intermittent production yield prediction model, and output the prediction results of the fixed time series output length; Model verification test module: the gas well intermittent production output prediction model that meets the requirements on the verification set is tested on the test set, the error values of the prediction results of different time series input lengths are compared, and the time series input length with the smallest error value is set as the time series input length of the gas well intermittent production output prediction model; Model packaging module: used to retain the model parameter settings with the smallest error value and encapsulate the gas well intermittent production output prediction model.
8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a program or instruction, and the program or instruction enables a computer to execute the method for predicting the intermittent production output of a natural gas well based on the PatchTST model as described in any one of claims 1 to 6.
Citation Information
Patent Citations
Gas well daily gas production rate prediction method and determination device, electronic equipment and storage medium
CN116502772A
Ship motion long-time forecasting method and system integrated with time-frequency analysis
CN117932273A