Method for predicting yield based on oil testing and well repairing
By processing the oil test well production data and hyperparameter optimization, the problem that the oil field production prediction model in the prior art cannot fully consider the oil test well characteristics, achieving higher prediction accuracy and reliability.
Patent Information
- Application Number
- CN202510040356.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-10
- Publication Date
- 2025-02-14
AI Technical Summary
The existing oil field output prediction model cannot fully consider the particularity and diversity of oil test well repair operations, resulting in limited reliability and accuracy of prediction results.
A yield prediction method based on oil test well repair is proposed. By collecting production data, the first data set is obtained, and the hyperparameters of the first model are iteratively optimized to obtain the optimal hyperparameters and applied to the prediction model to improve Prediction accuracy.
It effectively improves the training efficiency and convergence of the model, avoids local optimal problems, enhances the robustness of the model, and realizes the automation of hyperparameter tuning, thereby improving the accuracy and reliability of oil test well production prediction.
Smart Images

Figure CN119443157A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of oilfield production prediction methods, and in particular to a method for production prediction based on oil testing and well repair. Background Art
[0002] In oil testing and well repair operations, it is usually necessary to predict the production of oil wells. The accuracy of the prediction results is directly related to the development efficiency and economic benefits of the oil field. However, existing prediction models often fail to fully consider the particularity and diversity of oil testing and well repair operations, resulting in limited reliability and accuracy of prediction results. Summary of the invention
[0003] The present application aims to solve at least one of the technical problems existing in the prior art. To this end, the present application proposes a method for production prediction based on oil testing and well repair, collecting production data obtained from oil testing and well repair, processing the production data to obtain a first data set, inputting the first data set into a first model, iterating the hyperparameters of the first model to obtain the optimal hyperparameters, applying the optimal hyperparameters to the first model to obtain a prediction model, and inputting at least part of the first data set into the prediction model to output a prediction result.
[0004] According to the method for production prediction based on oil testing and well repairing in the embodiment of the present application, the first data set obtained after processing the production data is used as input, and the hyperparameters of the first model are iterated to obtain the optimal hyperparameters, and the optimal hyperparameters are applied to the first model to obtain the prediction model. Therefore, the training efficiency and convergence of the model can be effectively improved, the local optimal problem can be avoided, the robustness of the model can be enhanced, and the automation of hyperparameter tuning can be realized, thereby improving the accuracy and reliability of production prediction of oil testing and well repairing.
[0005] According to some embodiments of the present application, a method for production prediction based on oil testing and well repair includes the following steps: S100, collecting production data obtained from oil testing and well repair, processing the production data to obtain a first data set, and dividing the first data set into a training set and a test set; S200, inputting the training set into the first model, and iterating the hyperparameters of the first model to obtain the optimal hyperparameters, and applying the optimal hyperparameters to the first model to obtain a prediction model; S300, evaluating the prediction model; S400, inputting the test set into the prediction model to output a prediction result.
[0006] In some embodiments, step S100 may include: S110, collecting production data of the operation during oil testing and well repair, cleaning the production data to remove abnormal values, wrong values, and null values, and then storing the cleaned production data. S120, normalizing the cleaned production data to obtain a first data set, and dividing the first data set into a training set and a test set.
[0007] In some embodiments, step S200 specifically includes: S210, inputting the training set into the first model and performing feature extraction to obtain a first feature. S220, based on the first feature, using a hyperparameter optimization algorithm to explore the hyperparameter space of the first model to obtain the corresponding optimal hyperparameter, and applying the optimal hyperparameter to the first model to obtain a prediction model.
[0008] Further, one or more rounds of S210 - S220 are performed to complete the iterative hyperparameter optimization process to obtain a prediction model.
[0009] Furthermore, the first model adopts a model combining a self-attention mechanism and a bidirectional long short-term memory network; the first model includes: a batch normalization layer, a bidirectional long short-term memory layer, an attention mechanism layer, a flattening layer, and a fully connected layer.
[0010] Furthermore, the hyperparameters for iterative optimization include: the batch size of the first model, the number of nodes in the bidirectional long short-term memory layer, the number of nodes in the fully connected layer, the learning rate, the time step, and the regularization parameter; the dimensions and selection of the query vector, key vector, and value vector in the attention mechanism layer, the number of heads of the multi-head attention, the scaling factor, and the weight matrix.
[0011] According to some embodiments of the present application, production data include: oil pressure, casing pressure, differential pressure obtained from ground equipment; upper pressure and lower pressure of the chip collector; upper pressure and lower pressure of the separator; upper pressure and lower pressure of the nozzle manifold; instantaneous liquid volume, instantaneous flow rate, discharge volume, separator temperature, separator liquid level, combustible gas concentration, gas production.
[0012] In some embodiments, evaluating the prediction model includes: selecting mean square error, mean absolute error and relative standard error as evaluation indicators to comprehensively measure the prediction performance of the model.
[0013] Additional aspects and advantages of the present application will be given in part in the description below, and in part will become apparent from the description below, or will be learned through the practice of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0014] The above and / or additional aspects and advantages of the present application will become apparent and easily understood from the description of the embodiments in conjunction with the following drawings, in which: Figure 1 is a schematic diagram of the AM-BiLST model architecture according to an embodiment of the present application; Figure 2 is a flow chart of a method for production prediction based on oil testing and well repair according to an embodiment of the present application; Figure 3 It is a schematic diagram of the Tyrannosaurus Rex optimization algorithm flow according to an embodiment of the present application. DETAILED DESCRIPTION
[0015] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, unless they are contradictory.
[0016] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In the description of the present invention, the meaning of "plurality" is at least two, such as two, three, etc., unless otherwise clearly and specifically defined.
[0017] Embodiments of the present invention are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions.
[0018] Combination Figure 1-Figure 3 According to the method for production prediction based on oil testing and well repairing of an embodiment of the present application, production data obtained from oil testing and well repairing are collected, the production data is processed to obtain a first data set, the first data set is input into a first model, the hyperparameters of the first model are iterated to obtain optimal hyperparameters, the optimal hyperparameters are applied to the first model to obtain a prediction model, and at least a portion of the first data set is input into the prediction model to output a prediction result.
[0019] Specifically, after defining the hyperparameter space of the first model, a starting point for initial hyperparameter settings is selected, and the initial point can be determined based on experience, random selection, or using a heuristic method. The model is trained using the first data set, and then the hyperparameters are iterated, wherein a hyperparameter optimization algorithm can be used for the iteration of the hyperparameters.
[0020] More specifically, the iteration may be continued until a certain stopping criterion is met to complete the iteration and obtain the optimal hyperparameter. The aforementioned stopping criterion may be reaching a certain performance threshold, or completing a preset number of iterations, or the change of the hyperparameter no longer leads to significant performance improvement, etc. The optimal hyperparameter is obtained through a hyperparameter optimization algorithm, and then the optimal hyperparameter is applied to the first model to obtain a prediction model.
[0021] According to the method for production prediction based on oil testing and well repairing in the embodiment of the present application, the first data set obtained after processing the production data is used as input, and the hyperparameters of the first model are iterated to obtain the optimal hyperparameters, and the optimal hyperparameters are applied to the first model to obtain the prediction model. Therefore, the training efficiency and convergence of the model can be effectively improved, the local optimal problem can be avoided, the robustness of the model can be enhanced, and the automation of hyperparameter tuning can be realized, thereby improving the accuracy and reliability of production prediction of oil testing and well repairing.
[0022] Furthermore, the method for production prediction based on oil testing and workover may include the following steps: S100, collect production data obtained from oil testing and well repair, process the production data to obtain a first data set, and divide the first data set into a training set and a test set. S200, input the training set into the first model, iterate the hyperparameters of the first model to obtain the optimal hyperparameters, and apply the optimal hyperparameters to the first model to obtain a prediction model. S300, evaluate the prediction model. S400, input the test set into the prediction model to output a prediction result.
[0023] It can be understood that dividing the set into training set and test set can avoid overfitting, and finally the test set is used as input to predict the final prediction result. Since the test set provides data that is not involved in model training, it has better generalization ability and can improve the reliability and accuracy of the prediction results.
[0024] According to a further embodiment of the present application, step S100 may include: S110, collecting production data during oil testing and well repair operations, cleaning the production data to eliminate abnormal values, wrong values, and null values, and then storing the cleaned production data.
[0025] S120, normalize the cleaned production data. For ease of explanation, the present application defines the cleaned and normalized production data as a first data set, and uses the first data set as input to perform well testing and workover production prediction. Specifically, the first data set is divided into a training set and a test set.
[0026] In step S200, the first data set is input into the pre-trained first model to perform an iterative hyperparameter optimization process, which specifically includes: S210: Input the training set into the first model and perform feature extraction to obtain a first feature.
[0027] S220. Based on the first feature, the Tyrannosaurus Rex optimization algorithm is used to explore the hyperparameter space of the first model to obtain the corresponding optimal hyperparameters, and the optimal hyperparameters are applied to the first model to obtain a prediction model.
[0028] One or more rounds of S210 - S220 are performed to complete the iterative hyperparameter optimization process to obtain a prediction model.
[0029] In some cases, the first model may be a model that has been preliminarily trained.
[0030] For example, in the process of predicting the production of oil testing and workover, the first model adopts a model combining the self-attention mechanism (AttentionMechanism) and the bidirectional long short-term memory network (BiLSTM), which is referred to as the "AM-BiLST model" for the sake of convenience.
[0031] Among them, combined Figure 1 To understand, the AM-BiLST model is mainly composed of a batch normalization layer (BN layer), a bidirectional long short-term memory layer (BiLSTM layer), an attention mechanism layer (Attention layer), a flattening layer (Flattion layer), and two fully connected layers (Fully connected layers). In some examples, the normalization layer can be located after the input layer and the attention mechanism. The corresponding model can not only automatically extract the time series feature information of the production data, but also highlight the key feature information, thus having a strong feature extraction capability.
[0032] In this example, the training set is input into the constructed AM-BiLST initial model for training, and the trained AM-BiLST model is iteratively optimized for hyperparameters to finally obtain a prediction model. Furthermore, when making predictions, when the test set is input into the prediction model, since the architecture of the prediction model is the AM-BiLST model, the AM-BiLST model can be used to extract the first feature of the production data to facilitate subsequent steps.
[0033] Among them, the Bidirectional Long Short-Term Memory (BiLSTM) network is composed of a forward long short-term memory network and a backward long short-term memory network in parallel. The forward long short-term memory network mines historical and future time series information, and the backward long short-term memory network mines past information ignored by the forward long short-term memory network. And further combined with the attention concentration mechanism, the first feature can be accurately extracted based on the information at different time points at the same time.
[0034] It can be understood that the prediction model is obtained based on the structural training of the bidirectional long short-term memory network combined with the attention concentration mechanism. The use of the attention mechanism in the prediction model can fully capture the key features of complex time series data. Especially when dealing with nonlinear and highly complex data such as oil field production forecasting, the prediction model can effectively focus on the most important information, thereby improving the prediction accuracy.
[0035] For better explanation, refer to Figure 2 , a detailed description is given with a specific example.
[0036] First of all, the production data obtained from the oil testing and well repair operation process changes with time. Therefore, the essence of predicting the oil testing and well repair production is time series prediction. In this example, the first model is the aforementioned AM-BiLST model, which accurately extracts the first feature of the first data set while considering the time series. The specific combination of the AM-BiLST model will not be repeated here.
[0037] The production data of the oil test and workover operation in this example includes the oil pressure, casing pressure, differential pressure obtained from the ground equipment; the upper and lower pressures of the chip catcher; the upper and lower pressures of the separator; the upper and lower pressures of the nozzle manifold; the instantaneous liquid volume, instantaneous flow, liquid discharge volume, separator temperature, separator liquid level, combustible gas concentration, and gas production. The collected production data is cleaned and normalized.
[0038] Specifically, because the units of different attributes in the production data are different and the magnitudes of the attributes are large, the attributes with larger magnitudes tend to dominate, affecting the convergence speed of model training. To avoid such problems, all attributes in the oil well production data must be normalized. This example uses the maximum and minimum value normalization method. After cleaning and normalization, the first data set is obtained.
[0039] The first dataset is divided into a training set and a test set.
[0040] The first model in this example is the AM-BiLSTM model, and the training set is input into the AM-BiLSTM model for training.
[0041] For the Bidirectional Long Short-Term Memory (BiLSTM), the output at a certain moment consists of three parts, namely the input at the current moment, the output state of the forward long short-term memory network at the previous moment, and the output state of the backward long short-term memory network at the next moment.
[0042] The Attention Mechanism is often used when processing various time series data. The essence of the Attention Mechanism is the process of weighted summation of feature vectors. The steps include: calculating the dot product of the query and each key to obtain the weight, using the Softmax function to normalize the weight, performing weighted summation of the weight and the corresponding value to obtain attention, and connecting the query and each key to obtain the weight.
[0043] In this example, the hyperparameter optimization algorithm uses the Tyrannosaurus Rex optimization algorithm (TROA optimization algorithm). The algorithm simulates the hunting behavior of Tyrannosaurus Rex to update the position of the search agent to perform iterative optimization of the hyperparameters to find the global optimal solution and then obtain the optimal hyperparameters.
[0044] Specifically, the Tyrannosaurus Rex optimization algorithm (TROA optimization algorithm) gradually optimizes the position of the search agent by combining randomness with a gradual convergence strategy. Finally, the performance of the algorithm is evaluated by the convergence curve and the final search agent position. The hunting behavior of Tyrannosaurus Rex is centered on its efficient ambush strategy, which achieves accurate capture of the target by quickly approaching the prey and gradually reducing randomness during the hunting process. In the optimization algorithm, this behavior is abstracted as a strategy that can both widely search for global solutions and gradually optimize local solutions, and finally effectively find the global optimal solution to the problem.
[0045] Combination Figure 3 Understand that the steps of the Tyrannosaurus Rex optimization algorithm (TROA optimization algorithm) are as follows: Initialize the search agent position and algorithm parameters, including the hunting success rate , Tyrannosaurus Rex running rate and prey running rate , and store the positions of all search agents in the matrix Search for the location of the proxy The formula is: in is the index of the search agent, is the index of the dimension, and They are the lower and upper bounds of the dimension, is a random number generated in the range [0,1].
[0046] Start the main loop, and the number of iterations starts from 1 until the maximum number of iterations is reached. In each iteration, calculate the current hunting success probability , which decreases gradually with the increase of iteration number.
[0047] Where t is the current iteration number, "Max iteration" represents the maximum number of iterations. In each iteration, The update depends on the probability of hunting success If the hunt is successful , the update formula is as follows: in, It is Search Agents in The new position in dimension, It is Search Agents in The current position in dimension, The current optimal solution is If the hunt is unsuccessful : Ultimately, the location of each search agent will be updated to , and continue to optimize in the next iteration.
[0048] It is worth noting that the hyperparameters for iterative optimization in this example include: The batch size of the AM-BiLSTM model, the number of nodes in the bidirectional long short-term memory layer, the number of nodes in the fully connected layer, the learning rate, the time step, the regularization parameter, and the parameters related to the attention mechanism. The dimensions and selection of the query vector (Q), key vector (K), and value vector (V) in the attention mechanism, the number of heads, scaling factors, and weight matrices of the multi-head attention.
[0049] Therefore, after completing the iteration of hyperparameters based on the Tyrannosaurus Rex optimization algorithm (TROA optimization algorithm), the optimal hyperparameters are applied to the AM-BiLSTM model to obtain the prediction model, which can be expressed as: TROA-AM-BiLSTM production prediction model.
[0050] In this example, the normalized test set is input into the TROA-AM-BiLSTM yield prediction model to obtain the predicted yield result, which is then compared and evaluated with the results of other prediction models.
[0051] Specifically, the mean square error (MSE), mean absolute error (MAE) and relative standard error (RSE) are selected as evaluation indicators to comprehensively measure the prediction performance of the model. The smaller the values of the three indicators, the closer the distance between the predicted value and the true value is, and the better the prediction effect is. The specific calculation formula is as follows: in, is the actual oil production value; To predict the oil production value; is the total amount of oil production data in the test data set, is the standard deviation of the sample observations from the mean, is the mean of the sample observations.
[0052] It is worth mentioning that the data acquisition, cleaning, normalization and other methods in this example can also be used in the process of using the trained first model for prediction, and the details will not be repeated here.
[0053] It should be understood that each part of the present invention can be implemented by any software. In the above embodiments, multiple steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system.
[0054] A person skilled in the art may understand that all or part of the steps in the method for implementing the above-mentioned embodiment may be completed by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, which, when executed, includes one or a combination of the steps of the method embodiment.
[0055] In addition, each functional unit in each embodiment of the present invention may be integrated into a processing module, or each unit may exist physically separately, or two or more units may be integrated into one module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it may also be stored in a computer-readable storage medium.
[0056] The storage medium mentioned above may be a read-only memory, a magnetic disk or an optical disk, etc. Although the embodiments of the present invention have been shown and described above, it can be understood that the above embodiments are exemplary and cannot be understood as limiting the present invention. A person of ordinary skill in the art may change, modify, replace and modify the above embodiments within the scope of the present invention.
Claims
1. A method for production prediction based on oil testing and well repair, characterized in that: The production data obtained from oil testing and well repair are collected, the production data are processed to obtain a first data set, the first data set is input into a first model, the hyperparameters of the first model are iterated to obtain optimal hyperparameters, the optimal hyperparameters are applied to the first model to obtain a prediction model, and at least a portion of the first data set is input into the prediction model to output a prediction result.
2. The method for production prediction based on oil testing and well repair according to claim 1, characterized in that: The steps include: S100, collecting the production data obtained from oil testing and well repair, processing the production data to obtain the first data set, and dividing the first data set into a training set and a test set; S200, inputting the training set into the first model, iterating the hyperparameters of the first model to obtain the optimal hyperparameters, and applying the optimal hyperparameters to the first model to obtain the prediction model; S300, evaluating the prediction model; S400: Input the test set into the prediction model to output the prediction result.
3. The method for production prediction based on oil testing and well repair according to claim 2, characterized in that: Step S100 includes: S110, collecting the production data of the well testing and workover operation, cleaning the production data to remove abnormal values, wrong values, and null values, and then storing the cleaned production data; S120: normalize the cleaned production data to obtain the first data set, and divide the first data set into the training set and the test set.
4. The method for production prediction based on oil testing and well repair according to claim 2, characterized in that: Step S200 specifically includes: S210, inputting the training set into the first model and performing feature extraction to obtain a first feature; S220. Based on the first feature, a hyperparameter optimization algorithm is used to explore the hyperparameter space of the first model to obtain the corresponding optimal hyperparameters, and the optimal hyperparameters are applied to the first model to obtain the prediction model.
5. The method for production prediction based on oil testing and well repair according to claim 4, characterized in that: One or more rounds of S210 - S220 are performed to complete the iterative hyperparameter optimization process to obtain the prediction model.
6. The method for production prediction based on oil testing and well repair according to claim 3 or 4, characterized in that: The first model adopts a model combining a self-attention mechanism and a bidirectional long short-term memory network; The first model includes: Batch normalization layer, bidirectional long short-term memory layer, attention mechanism layer, flattening layer, fully connected layer.
7. The method for production prediction based on oil testing and well repair according to claim 6, characterized in that: The hyperparameters that are iteratively optimized include: The batch size of the first model, the number of nodes in the bidirectional long short-term memory layer, the number of nodes in the fully connected layer, the learning rate, the time step, and the regularization parameter; The dimensions and selection of query vector, key vector, value vector, number of heads, scaling factor and weight matrix of multi-head attention in the attention mechanism layer.
8. The method for production prediction based on oil testing and well repair according to claim 1, characterized in that: The production data includes: Oil pressure, casing pressure, and differential pressure obtained from ground equipment; The chip catcher is pressed up and down; Upward and downward pressure of the separator; The nozzle manifold is pressed up and down; Instantaneous liquid volume, instantaneous flow rate, discharge volume, separator temperature, separator liquid level, combustible gas concentration, gas production.
9. The method for production prediction based on oil testing and well repair according to claim 2, characterized in that: Evaluating the prediction model includes: The mean square error, mean absolute error and relative standard error were selected as evaluation indicators to comprehensively measure the prediction performance of the model.
Citation Information
Patent Citations
Chemical fertilizer price prediction method and equipment based on deep learning model, and storage medium
CN115619449A
Gas well daily gas production rate prediction method and determination device, electronic equipment and storage medium
CN116502772A
Method for optimizing oil well yield prediction model based on multi-strategy improved marine predator algorithm
CN118296963A