Training method and device of drilling speed prediction model, equipment and storage medium

Through parameter optimization algorithms, particle swarms and genetic algorithms, the random forest model is optimized, and the problems of low prediction accuracy of mechanical drilling speed and slow training speed are solved, and efficient drilling speed prediction in deep and ultra-deep oil and gas reservoirs are achieved.

CN119227485APending Publication Date: 2024-12-31CHINA PETROLEUM & CHEMICAL CORP +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310800930.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-06-30
Publication Date
2024-12-31

AI Technical Summary

Technical Problem

The existing mechanical drilling speed prediction methods have low prediction accuracy and slow model training speed under complex drilling conditions, which cannot meet the needs of deep and ultra-deep oil and gas reservoir drilling.

Method used

Parameter optimization algorithm is used to assist in training the drilling speed prediction model, update the model parameters iteratively, and optimize the decision tree and depth of the random forest model using particle swarm algorithm and genetic algorithm to improve the model training efficiency and prediction accuracy.

Benefits of technology

It significantly improves the accuracy of drilling speed prediction and model training efficiency, and is suitable for deep and ultra-deep oil and gas reservoir drilling under complex drilling conditions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119227485A_ABST
    Figure CN119227485A_ABST
Patent Text Reader

Abstract

The invention provides a drilling speed prediction model training method and device, equipment and a storage medium, and belongs to the technical field of well drilling. The method comprises the following steps: updating a drilling speed prediction model based on drilling speed prediction model parameters generated by a parameter optimization algorithm; inputting the sample feature vector into the updated drilling speed prediction model to obtain a sample prediction drilling speed; determining a fitness value corresponding to a parameter optimization algorithm based on an error between the sample predicted drilling speed and the sample label drilling speed; iteratively updating algorithm parameters of the parameter optimization algorithm and the drilling speed prediction model based on the fitness value; and in response to the condition that the model training meets a preset condition, stopping iterative updating to obtain a drilling speed prediction model after training is completed. Based on the error between the sample predicted drilling speed obtained after model updating and the sample label drilling speed, the algorithm parameter updating direction of the parameter optimization algorithm is guided, and the model parameters of the drilling speed prediction model are continuously optimized, so that the model training efficiency and the drilling speed prediction accuracy are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of drilling technology, and in particular to a training method, device, equipment and storage medium for a drilling rate prediction model. Background Art

[0002] The focus of oil and gas resource development in my country has shifted from shallow oil and gas reservoirs to deep and ultra-deep oil and gas reservoirs. The reservoirs in the development blocks are characterized by the development of fractures and pores, complex distribution patterns, deep burial and high temperature. The average burial depth is more than 7000m, the temperature is as high as 200℃, and the pressure is as high as 180MPa. The complex and harsh formation conditions lead to long drilling cycles and high costs for deep and ultra-deep oil and gas reservoirs. In order to improve drilling efficiency, it is necessary to conduct a systematic analysis of the mechanical drilling speed and its main influencing factors in these blocks, and to find out the influence of parameters such as drill bit diameter, drilling pressure, rotation speed, drilling fluid density, displacement and rheology on the mechanical drilling speed, so as to provide assistance for the subsequent establishment of a mechanical drilling speed prediction model and guidance of on-site construction.

[0003] In terms of mechanical drilling rate prediction, domestic and foreign scholars have done some research. From the perspective of the development of mechanical drilling rate prediction methods, the traditional mechanical drilling rate prediction model based on experiments such as the control variable method or the establishment of mechanical drilling rate prediction models based on methods such as charts and empirical formulas can no longer meet the needs of current drilling projects under more complex drilling conditions. The methods used by domestic and foreign scholars to predict mechanical drilling rate have also gradually shifted from traditional mathematical statistics to machine learning and deep learning based on massive data processing.

[0004] However, the current mechanical drilling rate prediction method has low prediction accuracy and slow model training speed. Therefore, it is necessary to explore and establish a mechanical drilling rate prediction model using machine learning methods and massive logging data to improve the mechanical drilling rate prediction accuracy and application scope. Summary of the invention

[0005] The present application provides a method, device, equipment and storage medium for training a drilling speed prediction model, which can improve the model training efficiency and drilling speed prediction accuracy. The technical solution is as follows:

[0006] On the one hand, an embodiment of the present application provides a method for training a drilling speed prediction model, the method comprising:

[0007] Updating the drilling speed prediction model based on the drilling speed prediction model parameters generated by the parameter optimization algorithm;

[0008] Inputting the sample feature vector into the updated drilling speed prediction model to obtain the sample predicted drilling speed;

[0009] Determining a fitness value corresponding to the parameter optimization algorithm based on an error between the sample predicted drilling speed and the sample labeled drilling speed;

[0010] Iteratively updating the algorithm parameters of the parameter optimization algorithm and the drilling speed prediction model based on the fitness value;

[0011] In response to the model training satisfying a preset condition, the iterative update is stopped to obtain the drilling speed prediction model after the training is completed.

[0012] On the other hand, an embodiment of the present application provides a training device for a drilling speed prediction model, the device comprising:

[0013] A model updating module, used for updating the drilling speed prediction model based on the drilling speed prediction model parameters generated by the parameter optimization algorithm;

[0014] A prediction module, used for inputting the sample feature vector into the drilling speed prediction model to obtain the sample predicted drilling speed;

[0015] A determination module, configured to determine a fitness value corresponding to the parameter optimization algorithm based on an error between the sample predicted drilling speed and the sample labeled drilling speed;

[0016] The model updating module is further used to iteratively update the algorithm parameters of the parameter optimization algorithm and the drilling speed prediction model parameters based on the change trend of the fitness value;

[0017] The control module is used to stop iterative updating in response to the model training meeting the preset conditions, so as to obtain the drilling speed prediction model after the training is completed.

[0018] On the other hand, an embodiment of the present application provides a computer device, which includes a processor and a memory, wherein the memory stores at least one instruction, at least one program, a code set, or an instruction set, and the at least one instruction, the at least one program, the code set, or the instruction set is loaded and executed by the processor to implement the method described in the above aspects.

[0019] On the other hand, an embodiment of the present application provides a computer-readable storage medium, which stores at least one instruction, at least one program, code set or instruction set, and the at least one instruction, at least one program, code set or instruction set is loaded and executed by a processor to implement the method described in the above aspects.

[0020] The technical solution provided by this application includes at least the following beneficial effects:

[0021] The present application provides a method, device, equipment and storage medium for training a drilling speed prediction model, which utilizes a parameter optimization algorithm to assist in the training of the drilling speed prediction model. Based on the error between the sample predicted drilling speed and the sample label drilling speed obtained after each round of model update, the algorithm parameter update direction of the parameter optimization algorithm is guided, and the model parameters of the drilling speed prediction model are continuously optimized, thereby accelerating the model training efficiency and the drilling speed prediction accuracy. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for describing the embodiments.

[0023] Figure 1 is a flow chart of a method for training a drilling speed prediction model provided by an exemplary embodiment of the present application;

[0024] Figure 2 is a flow chart of a method for training a drilling speed prediction model provided by another exemplary embodiment of the present application;

[0025] Figure 3 It is a schematic diagram of the operation process of a particle swarm algorithm provided by an exemplary embodiment of the present application;

[0026] Figure 4 is a flow chart of a method for training a drilling speed prediction model provided by another exemplary embodiment of the present application;

[0027] Figure 5 is a schematic diagram of the operation process of a genetic algorithm provided by an exemplary embodiment of the present application;

[0028] Figure 6 is a flow chart of a method for training a drilling speed prediction model provided by another exemplary embodiment of the present application;

[0029] Figure 7 is a flow chart of a method for training a drilling speed prediction model provided by another exemplary embodiment of the present application;

[0030] Figure 8 is an architectural diagram of a training system for a drilling speed prediction model provided by an exemplary embodiment of the present application;

[0031] Fig. 9 is a structural block diagram of a drilling speed prediction model training device provided by an exemplary embodiment of the present application;

[0032] Fig.10 It is a structural block diagram of a computer device provided by an exemplary embodiment of the present application. DETAILED DESCRIPTION

[0033] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below with reference to the accompanying drawings.

[0034] Please refer to Figure 1 , which shows a flow chart of a method for training a drilling speed prediction model provided by an exemplary embodiment of the present application. The method is applied to the parts maintenance scheduling system shown in the above embodiment, and the method includes the following steps:

[0035] Step 101: updating a drilling speed prediction model based on drilling speed prediction model parameters generated by a parameter optimization algorithm.

[0036] In a possible implementation, at the beginning of model training, the computer device initializes the parameter optimization algorithm, calculates and obtains initial drilling speed prediction model parameters, and substitutes the initial parameters into the drilling speed prediction model to obtain an initial model.

[0037] As the drilling rate prediction model is continuously trained and updated, the parameter optimization algorithm adjusts the algorithm parameters based on the results of the previous round of iterative operations, generates new drilling rate prediction model parameters, and continues the next round of iterative updates.

[0038] Step 102: Input the sample feature vector into the updated drilling speed prediction model to obtain the sample predicted drilling speed.

[0039] The sample feature vector is composed of at least two sample input data in a certain order. The computer device inputs a sample feature vector into the drilling speed prediction model to obtain a corresponding sample predicted drilling speed.

[0040] In a possible implementation, the parameter optimization algorithm usually generates at least two sets of drilling speed prediction model parameters during the iteration process. Therefore, this step requires inputting the sample feature vectors into the drilling speed prediction model updated based on each set of drilling speed prediction model parameters, respectively, to obtain the sample predicted drilling speed under different model parameters. For example, the parameter optimization algorithm generates two sets of drilling speed prediction model parameters, a and b, then the computer device inputs a sample feature vector into the drilling speed prediction model updated based on parameter a to obtain the sample predicted drilling speed A, and inputs a sample feature vector into the drilling speed prediction model updated based on parameter b to obtain the sample predicted drilling speed B.

[0041] In addition, the model training set also corresponds to a large amount of training data, that is, there are multiple sets of feature vectors and corresponding sample label drilling speeds. For each set of drilling speed prediction models after the model parameters are updated, the computer device inputs all or part of the sample feature vectors of the training set to obtain the corresponding multiple sample predicted drilling speeds.

[0042] Step 103: Determine the fitness value corresponding to the parameter optimization algorithm based on the error between the sample predicted drilling speed and the sample labeled drilling speed.

[0043] In a possible implementation, different algorithm parameters in the parameter optimization algorithm correspond to different drilling speed prediction model parameters, and the computer device needs to calculate the fitness value of each algorithm parameter.

[0044] The fitness value is related to the error between the sample predicted drilling speed and the sample labeled drilling speed, and the computer device can perform calculations based on the fitness value function. Specifically, the smaller the error, the higher the fitness value of the algorithm parameter.

[0045] Schematically, the error between the sample predicted drilling speed and the sample labeled drilling speed is the average relative error between the sample predicted drilling speed and the sample labeled drilling speed predicted based on multiple groups of sample feature vectors.

[0046] Step 104, iteratively updating the algorithm parameters of the parameter optimization algorithm and the drilling speed prediction model based on the fitness value.

[0047] If the fitness values ​​of the algorithm parameters in the algorithm do not meet the preset conditions, the parameter optimization algorithm adjusts the algorithm parameters based on the fitness values, generates new drilling speed prediction model parameters, and substitutes them into the model for the next round of iteration, and the model training is repeated in this way.

[0048] Illustratively, the preset condition is that the number of iterations reaches a preset number, and / or the fitness value reaches a preset value.

[0049] Step 105, in response to the model training satisfying the preset conditions, the iterative update is stopped to obtain the drilling speed prediction model after the training is completed.

[0050] In response to the model training satisfying the preset conditions, the computer device determines the optimal parameter combination, substitutes it into the drilling speed prediction model, and completes the model training.

[0051] In summary, the present application provides a method for training a drilling speed prediction model, which utilizes a parameter optimization algorithm to assist in the training of the drilling speed prediction model. Based on the error between the sample predicted drilling speed and the sample label drilling speed obtained after each round of model update, the parameter optimization algorithm is guided to update the algorithm parameters. The model parameters of the drilling speed prediction model are continuously optimized, thereby accelerating the model training efficiency and the drilling speed prediction accuracy.

[0052] In a possible implementation, the parameter optimization algorithm includes a particle swarm algorithm and / or a genetic algorithm, the drilling rate prediction model is a random forest model, and the drilling rate prediction model parameters include the number of decision trees and the depth of the decision trees of the random forest model.

[0053] Random Forest (RF) is an algorithm composed of a series of tree classifiers, which belongs to one of the ensemble learning methods. The random forest algorithm will generate multiple decision trees during the learning process, and the final number of decision trees and the depth of the decision trees will be determined by the particle swarm algorithm and genetic algorithm of the present invention. These decision trees themselves, as a regression function, can predict the mechanical drilling speed in drilling construction, and the final output of the random forest model is the average value of all decision tree outputs. The training stage of the random forest is to construct multiple unrelated decision trees through the bagging algorithm and obtain the predicted value.

[0054] The random forest consists of input variables X = {x1, x2, ..., x p}, where p is the number of features in the data set; when building each decision tree, n features are randomly selected from p features to build a single decision tree, where n≤p; the actual output prediction value of each decision tree is {Y1(X)=t1(X), Y2(X)=t2(X),…, Y m (X) = t m (X)}, where m is the total number of decision trees. The prediction results of all decision trees are averaged to obtain the final prediction result:

[0055]

[0056] Where Y i (X) is the prediction of a single decision tree for input X; m is the total number of decision trees.

[0057] When the parameter optimization algorithm is the particle swarm algorithm, please refer to Figure 2 , which shows a flow chart of a method for training a drilling speed prediction model provided by another exemplary embodiment of the present application. The method is applied to the parts maintenance scheduling system shown in the above embodiment, and the method includes the following steps:

[0058] Step 201, based on the spatial position of each particle in the particle swarm algorithm, determine the number of decision trees and the depth of the decision trees corresponding to each particle.

[0059] Step 202: Substitute the number of decision trees and the depth of each decision tree group into the drilling speed prediction model to update the model.

[0060] The particle swarm optimization algorithm (PSO) was originally proposed by Eberhart and Kennedy in 1995 as a swarm intelligence heuristic global algorithm. The algorithm simulates the social behavior of a flock of birds foraging in flight and optimizes the problem by improving the target solution through group collaboration. In the present invention, it corresponds to the optimal parameters of the random forest model. Compared with other optimization methods, the particle swarm algorithm has the obvious characteristics of fewer parameters to be adjusted, fast convergence speed and wide search range. The algorithm principle is as follows:

[0061] Assume that a population of n particles searches in an M-dimensional space. Each particle can store the best position it has found, expressed as Pbest, and the best position searched by the population is expressed as Gbest. Each particle adjusts its own speed vd and xd position according to the searched Pbest and Gbest to search the entire area space. Usually, the position change range is limited to [Xmin, d, Xmax, d] and the speed change range is limited to [-v max ,d,v max , d]. The speed and position update formula of the ith particle in m dimension is:

[0062]

[0063] In the formula, is the position of particle i in M ​​dimensions at the kth iteration; m represents a dimension in M ​​dimensions; is the velocity of particle i in M ​​dimension at the kth iteration; r1 and r2 are random numbers in [0, 1]; c1 and c2 are acceleration factors, usually both take the value of 1.49; w is called the inertia weight, usually takes the value of 0.8.

[0064]

[0065] Figure 3 The calculation process of a particle swarm algorithm is shown.

[0066] In a possible implementation, when the model training starts, the computer device sets the initial parameters of the particle swarm algorithm, including the number of individual particles, the speed of each particle, and the particle position. The model parameters to be optimized in the embodiment of the present application are the number of trees in the random forest and the depth of each tree, that is, the parameter space is two-dimensional, and the position information corresponding to the particle is the corresponding model parameter combination. In the subsequent iteration process, the computer device determines the parameter combination corresponding to each particle based on the new particle position after the particle swarm algorithm is run, that is, the number of trees in the random forest and the depth of each tree, and substitutes the new parameter combination into the random forest model for the next round of training.

[0067] Step 203: input the sample feature vector into the updated drilling speed prediction model to obtain the sample predicted drilling speed.

[0068] The specific implementation of step 203 can refer to the above step 102, and the embodiment of the present application will not be repeated here.

[0069] Step 204 , determining the fitness value of each particle based on the error between the sample predicted drilling speed corresponding to each particle and the sample label drilling speed.

[0070] The fitness value is related to the error between the sample predicted drilling speed and the sample labeled drilling speed, and the computer device can calculate based on the fitness value function. Specifically, the smaller the error, the higher the fitness value of the particle.

[0071] Schematically, the error between the sample predicted drilling speed and the sample labeled drilling speed is the average relative error between the sample predicted drilling speed and the sample labeled drilling speed predicted based on multiple groups of sample feature vectors.

[0072] Step 205 , in response to the fitness values ​​not satisfying the preset conditions, based on the change trend of the fitness values ​​compared with the fitness values ​​in the previous iteration, the moving speed and spatial position of the particle are updated.

[0073] Each particle has an initial velocity, velocity direction and spatial position. If the fitness values ​​of the particles in the particle group do not meet the preset conditions (for example, they are all less than the fitness threshold), the computer device adjusts the particle velocity and velocity direction based on the fitness value of the particle, and obtains a new spatial position after the particle moves per unit time, that is, obtains new drilling speed prediction model parameters.

[0074] Specifically, the computer device updates the speed and direction of a particle based on the change in the fitness value of a particle relative to its fitness value in the previous round. For example, if the fitness value of a particle in the current iteration is higher than that in the previous round, and it is much higher, it means that the speed and direction of the particle are better at present, and the parameters of the particles in the next iteration will be closer to this set of particle parameters.

[0075] Step 206, based on the updated spatial position, determine the number of decision trees and the depth of the decision tree corresponding to the particle in the next iteration process, and update the parameters of the drilling speed prediction.

[0076] Step 207, in response to the model training satisfying the preset conditions, the iterative update is stopped to obtain the drilling speed prediction model after the training is completed.

[0077] The specific implementation of step 207 can refer to the above step 105, and will not be described in detail in this embodiment of the present application.

[0078] When the parameter optimization algorithm is a genetic algorithm, please refer to Figure 4, which shows a flow chart of a method for training a drilling speed prediction model provided by another exemplary embodiment of the present application. The method is applied to the parts maintenance scheduling system shown in the above embodiment, and the method includes the following steps:

[0079] Step 401, based on the chromosome codes of individuals in the population, determine the number of decision trees and the depth of the decision tree corresponding to each individual.

[0080] Step 402: Substitute the number of decision trees and the depth of each decision tree group into the drilling speed prediction model to update the model.

[0081] Genetic Algorithm (GA) is a highly efficient random search and optimization algorithm based on biological evolution proposed by John Holland of the United States. The algorithm is inspired by scientific theories such as natural selection theory and evolution theory. Genetic algorithm has strong robustness, and its steps are encoding initialization, fitness value calculation, chromosome selection, crossover, mutation, etc. Figure 5 The detailed process is as follows:

[0082] ① Coding initialization: There are generally two common coding methods, namely binary coding and real number coding. The chromosome coding of the present invention adopts real number coding. After determining the solution parameters, the specific optimal parameter problem can be encoded, and the parameters can be converted into real numbers of a specific length to represent the gene sequence. The chromosome of each individual in the population is a solution to the problem; ② Calculate fitness: The chromosome evolves in the offspring to generate new individuals. The present application uses a fitness function to evaluate the degree of excellence of the chromosomes of the new individuals and calculates the fitness values ​​of all individuals in the population; ③ Selection: Selection is a process of survival of the fittest in the population. The selection operator is applied to the population, and a number of individuals are selected from the population based on probability. The probability of elimination of chromosomes with lower fitness is higher, and chromosomes with stronger fitness are not easily eliminated. By directly inheriting excellent individuals or passing them on to the next generation through crossover, different selection methods will affect the convergence speed of the algorithm; ④ Crossover: The crossover operation applies the crossover operator to the population, and the two parent chromosomes selected in step ③ are crossed at one or more points to generate new chromosomes. Crossover may make the fitness value of the offspring lower than that of the parents, and such offspring can be eliminated by selection. The crossover operator has the ability to search globally and is a very important algorithm in genetic algorithms; ⑤ Mutation: This step simulates the gene mutation process in the biological world, applies the mutation operator to the population, selects several individuals from the population, and randomly mutates the code of a real number position on their chromosome with a very small probability. The existence of the mutation operator enables the search to be carried out in an unexpected range of the initial genome, broadening the search range when only selection and crossover exist. The mutation operation ensures the diversity of genes and the increase in the search space, so that when using genetic algorithms to optimize the random forest model, it will not fall into a local solution too early; ⑥ Termination: Repeat steps ② to ⑤ until the fitness reaches the set value or reaches the maximum evolutionary generation, so as to ensure that the adaptability of the population continues to increase, the fittest survive, and then after decoding, the optimal parameter combination is finally obtained.

[0083] In a possible implementation, when the model training starts, the computer device sets the chromosome encoding of the individuals in the population. Each individual has two chromosomes, representing the number of trees and the depth of the tree. For example, if the number of trees is 100, the value obtained by binary encoding is 1100100. Assuming that the length of a single chromosome is 10, then this chromosome is 0001100100, representing the model parameters.

[0084] Step 403: input the sample feature vector into the updated drilling speed prediction model to obtain the sample predicted drilling speed.

[0085] The specific implementation of step 403 can refer to the above step 102, and the embodiment of the present application will not be repeated here.

[0086] Step 404 , determining the fitness value of each individual based on the error between the sample predicted drilling speed corresponding to each individual and the sample labeled drilling speed.

[0087] The fitness value is related to the error between the sample predicted drilling speed and the sample labeled drilling speed, and the computer device can calculate based on the fitness value function. Specifically, the smaller the error, the higher the fitness value of the individual.

[0088] Schematically, the error between the sample predicted drilling speed and the sample labeled drilling speed is the average relative error between the sample predicted drilling speed and the sample labeled drilling speed predicted based on multiple groups of sample feature vectors.

[0089] Step 405, in response to the fitness values ​​not satisfying the preset conditions, individuals are eliminated from the population by selecting an operator, wherein the elimination probability corresponding to individuals with high fitness values ​​is lower than the elimination probability of individuals with low fitness values.

[0090] Each individual has an initial chromosome code. If the fitness values ​​of individuals in the group do not meet the preset conditions (for example, they are all less than the fitness threshold), the computer device acts on the population through the selection operator and selects several individuals from the population based on probability. The chromosomes with lower fitness have a higher probability of elimination, and chromosomes with stronger fitness are less likely to be eliminated.

[0091] Step 406, obtain new individuals by crossover, mutation or direct inheritance of the remaining individuals in the population, and determine the number of decision trees and the depth of the decision tree corresponding to each individual in the next round of iteration based on the chromosome encoding of the new individuals, and update the parameters of the drilling speed prediction.

[0092] During the algorithm calculation process, an individual's chromosomes will exchange part of their chromosomes with another individual, such as crossing over, or a change in a certain point on the chromosome (0 to 1), which will change the parameter combination. The fitness value is then calculated to evaluate whether this crossing over and mutation is evolving in a better direction, thereby optimizing the local optimal parameter combination.

[0093] Step 407, in response to the model training satisfying the preset conditions, the iterative update is stopped to obtain the drilling speed prediction model after the training is completed.

[0094] The specific implementation of step 407 can refer to the above step 105, and the embodiment of the present application will not be repeated here.

[0095] In an embodiment of the present application, a particle swarm algorithm and a genetic algorithm are used to optimize the model parameters of the random forest model, and training is performed based on the optimized model to obtain a sample predicted drilling speed. Then, based on the error between the sample predicted drilling speed and the sample label drilling speed, the algorithm parameters of the particle swarm algorithm and the genetic algorithm are reversely updated to perform the next round of iterations. This can quickly find the direction of model parameter update, speed up the model update progress and parameter effectiveness, and thereby improve the accuracy of mechanical drilling speed prediction.

[0096] Please refer to Figure 6 , which shows a flow chart of a method for training a drilling speed prediction model provided by another exemplary embodiment of the present application. The method is applied to the parts maintenance scheduling system shown in the above embodiment, and the method includes the following steps:

[0097] Step 601: collect logging data as raw data for model training, and pre-process the raw data.

[0098] In a possible implementation, a computer device acquires a large amount of logging data reported by various sensors at the drilling construction site, and organizes the logging data to obtain raw data for establishing a drilling speed prediction model.

[0099] The computer device preprocesses the raw data to construct an initial sample data set. Optionally, the preprocessing of the raw data mainly includes the following steps:

[0100] Remove the noise data from the original data.

[0101] The missing values ​​in the original data were supplemented by the mean value interpolation method.

[0102] The original data is normalized based on the normalization algorithm.

[0103] Specifically, the computer equipment analyzes the original data, finds out the noise data with obvious theoretical problems, and removes the noise data. Find out the missing data caused by sensors, manual problems, etc., and use the average value interpolation method to process the missing values ​​of the original data. Select the maximum and minimum normalization algorithm to perform data normalization on all feature data.

[0104] Step 602: Divide the preprocessed raw data into a training set and a test set.

[0105] The computer device can randomly divide the normalized data into a training set and a test set according to the size of the data and a preset standard. Schematically, the computer device divides the original data into a training set and a test set according to a ratio of 4:1.

[0106] Step 603: determine the data corresponding to the drilling speed influencing factors in the training set as sample data, determine the actual drilling speed corresponding to the sample data as the sample label drilling speed, and generate a feature vector based on the sample data.

[0107] The factors that affect the mechanical drilling speed of oil and gas wells in the logging data are taken as the input feature vector, and the relevant data contained in each feature attribute is taken as the input variable X; the label to be predicted is the mechanical drilling speed, which is taken as the output variable Y.

[0108] Step 604: updating the drilling speed prediction model based on the drilling speed prediction model parameters generated by the parameter optimization algorithm.

[0109] Step 605: input the sample feature vector into the updated drilling speed prediction model to obtain the sample predicted drilling speed.

[0110] Step 606: Determine the fitness value corresponding to the parameter optimization algorithm based on the error between the sample predicted drilling speed and the sample labeled drilling speed.

[0111] Step 607, iteratively updating the algorithm parameters of the parameter optimization algorithm and the drilling speed prediction model based on the fitness value.

[0112] The specific implementation of steps 604 to 607 can refer to the above steps 102 to 105, and the embodiments of the present application will not be repeated here.

[0113] Step 608, in response to the fitness values ​​corresponding to a set of drilling rate prediction model parameters satisfying a preset condition, stopping the iterative update, and determining the drilling rate prediction model parameters whose fitness values ​​satisfy the preset condition as the model parameters of the drilling rate prediction model.

[0114] In a possible implementation, when there is a fitness value corresponding to an algorithm parameter that meets a preset condition, the computer device can stop the model iterative training, and determine the drilling speed prediction model parameters represented by the algorithm parameter that meets the preset condition as the optimal parameters, and substitute them into the random forest model to obtain the final drilling speed prediction model.

[0115] Step 609, in response to the existence of fitness values ​​corresponding to at least two groups of drilling rate prediction model parameters that meet the preset conditions, stop iterative updating, and determine the drilling rate prediction model parameters whose fitness values ​​meet the preset conditions and have the largest fitness value as the model parameters of the drilling rate prediction model.

[0116] In another possible implementation, if there are multiple algorithm parameters whose fitness values ​​satisfy the preset conditions at the same time, the computer device queries the algorithm parameters that satisfy the preset conditions for the parameter with the highest fitness value as the optimal model parameter.

[0117] In a possible implementation, the computer device uses both a particle swarm algorithm and a genetic algorithm to optimize the model. Figure 7 The process of parameter optimization and model iterative update using the above two algorithms is shown. The process mainly includes the following steps:

[0118] Step 1:

[0119] Collect data. Obtain a large amount of logging data from various sensors at the drilling site, organize it using Excel or txt text, and use it as the raw data for establishing a mechanical drilling speed prediction model.

[0120] Step 2:

[0121] Data preprocessing. The raw data is preprocessed in combination with field experience and relevant algorithms to construct an initial sample data set, which mainly includes the following steps: ① Analyze the raw data, find out the noise data with obvious theoretical problems, and remove the noise data; ② Find out the missing data caused by sensors, manual problems, etc., and use the mean interpolation method to process the missing values ​​of the raw data; ③ Select the maximum and minimum normalization algorithm to perform data normalization on all feature data; ④ According to the scale of the data and the preset standards, the normalized data is randomly divided into training sets and test sets; ⑤ The factors affecting the mechanical drilling speed of oil and gas wells in the logging data are used as the input feature vector, and the relevant data contained in each feature attribute is used as the input variable X; the label to be predicted is the mechanical drilling speed, which is used as the output variable Y.

[0122]

[0123] In the formula, x′ i is the normalized data; xi is the original sample data before normalization; xmin is the minimum eigenvalue of the original data; xmax is the maximum eigenvalue of the original data.

[0124] Step 3:

[0125] Use the random forest algorithm to build a model. In the Python language environment, the random forest algorithm is implemented through the Sklearn library to build a model.

[0126] Step 4:

[0127] Optimize the number of decision trees and the depth of a single decision tree in the initial random forest model. In the Python language environment, the mechanical drilling speed prediction model is established by optimizing the important parameters of the random forest algorithm through a self-written particle swarm algorithm and using the Geatpy library to implement a genetic algorithm. The following steps are included:

[0128] ① Set the initial parameters of the particle swarm algorithm and genetic algorithm, including but not limited to the number of individual particles, particle speed, particle position, population size, maximum generation number, chromosome crossover probability, chromosome mutation probability, fitness function, etc. The settings are as follows:

[0129] Table 1 Initial parameter settings of particle swarm algorithm and genetic algorithm

[0130]

[0131] ② For the particle swarm algorithm, initialize the particles, calculate the fitness value of each particle, and update the particle position and speed until the set conditions are met. Denormalize the predicted mechanical drilling speed and calculate the average relative error of the predicted mechanical drilling speed. The denormalization and average relative error formulas are:

[0132] y i =y i (x max -x min )+x min

[0133]

[0134] ③For the genetic algorithm, determine the input and output variables, convert the optimal solution problem into a population reproduction problem through encoding and randomly generate a population with several individuals, calculate the fitness value of each individual in the initial population, denormalize the predicted mechanical drilling speed, and calculate the average relative error of the predicted mechanical drilling speed.

[0135] ④Substitute the optimal parameter combination values ​​obtained by the two optimization algorithms into the random forest model and retrain the random forest model.

[0136] In a possible implementation, the present application also provides a mechanical drilling speed prediction system based on an optimized random forest model, such as Figure 8 As shown, it includes a data intelligent acquisition module 801, a data intelligent preprocessing module 802 and a mechanical drilling speed optimization and prediction module 803.

[0137] The function of the data intelligent collection module 801 is to collect various data generated during the whole process of drilling construction, and to organize, summarize and store them according to rules.

[0138] The function of the data intelligent preprocessing module 802 is to preprocess the data stored in the mobile phone, mainly including cleaning, screening, processing of missing values, and normalization, to obtain different data sets for training models.

[0139] The mechanical drilling speed prediction module 803 is used to construct a mechanical drilling speed prediction model, train the mechanical drilling speed prediction model using the training set, and optimize it to obtain the trained and optimized mechanical drilling speed prediction model, and use the mechanical drilling speed prediction model to predict the mechanical drilling speed of the test set data.

[0140] The methods involved in the above content and Xu Ting effectively solved the shortcomings of traditional methods. While being able to build a model in a short time, they utilized the relevant characteristics of massive data related to mechanical drilling speed and conducted a very thorough mining of the data. This is of great significance for on-site construction guidance and has a very broad application prospect.

[0141] Please refer to Fig. 9 , which shows a structural block diagram of a drilling speed prediction model training device provided by an exemplary embodiment of the present application, the device comprising:

[0142] A model updating module 901 is used to update the drilling speed prediction model based on the drilling speed prediction model parameters generated by the parameter optimization algorithm;

[0143] Prediction module 902, used for inputting sample feature vector into the drilling speed prediction model to obtain sample predicted drilling speed;

[0144] A determination module 903 is used to determine a fitness value corresponding to the parameter optimization algorithm based on an error between the sample predicted drilling speed and the sample labeled drilling speed;

[0145] The model updating module 901 is further used to iteratively update the algorithm parameters of the parameter optimization algorithm and the drilling speed prediction model parameters based on the change trend of the fitness value;

[0146] The control module 904 is used to stop iterative updating in response to the model training satisfying a preset condition, so as to obtain the drilling speed prediction model after the training is completed.

[0147] Optionally, the parameter optimization algorithm includes a particle swarm algorithm and / or a genetic algorithm, the drilling speed prediction model is a random forest model, and the drilling speed prediction model parameters include the number of decision trees and the depth of the decision trees of the random forest model.

[0148] Optionally, the parameter optimization algorithm is the particle swarm algorithm;

[0149] The model updating module 901 is further used for:

[0150] Based on the spatial position of each particle in the particle swarm algorithm, determine the number of decision trees and the depth of the decision tree corresponding to each particle;

[0151] The number of decision trees and the depth of the decision trees in each group are respectively substituted into the drilling speed prediction model to update the model.

[0152] Optionally, the determination module 903 is further configured to determine the fitness value of each particle based on the error between the sample predicted drilling speed corresponding to each particle and the sample label drilling speed;

[0153] The model updating module 901 is further used for:

[0154] In response to the fitness values ​​not satisfying the preset condition, based on a change trend of the fitness value compared to the fitness value in a previous iteration, updating the moving speed of the particle and the spatial position;

[0155] The number of decision trees and the depth of the decision tree corresponding to the particle in the next iteration process are determined based on the updated spatial position, and parameters of the drilling speed prediction are updated.

[0156] Optionally, the parameter optimization algorithm is the genetic algorithm;

[0157] The model updating module 901 is further used for:

[0158] Based on the chromosome codes of individuals in the population, determine the number of decision trees and the depth of the decision tree corresponding to each individual;

[0159] The number of decision trees and the depth of the decision trees in each group are respectively substituted into the drilling speed prediction model to update the model.

[0160] Optionally, the determination module 903 is further used to determine the fitness value of each individual based on the error between the sample predicted drilling speed corresponding to each individual and the sample label drilling speed;

[0161] The model updating module 901 is further used for:

[0162] In response to the fitness values ​​not satisfying the preset condition, individuals are eliminated from the population by selecting an operator, wherein the elimination probability corresponding to individuals with high fitness values ​​is lower than the elimination probability of individuals with low fitness values;

[0163] New individuals are obtained by crossover, mutation or direct inheritance of the remaining individuals in the population, and the number of decision trees and the depth of the decision tree corresponding to each individual in the next round of iteration are determined based on the chromosome coding of the new individuals, so as to update the parameters of the drilling speed prediction.

[0164] Optionally, the control module 904 is further configured to:

[0165] In response to a set of fitness values ​​corresponding to the drilling speed prediction model parameters satisfying the preset condition, stopping the iterative update, and determining the drilling speed prediction model parameters whose fitness values ​​satisfy the preset condition as the model parameters of the drilling speed prediction model;

[0166] In response to the existence of at least two groups of fitness values ​​corresponding to the drilling rate prediction model parameters that meet the preset conditions, the iterative update is stopped, and the drilling rate prediction model parameters whose fitness values ​​meet the preset conditions and have the largest fitness value are determined as the model parameters of the drilling rate prediction model.

[0167] Optionally, the device further comprises:

[0168] A data processing module is used to collect logging data as raw data for model training and pre-process the raw data;

[0169] A data partitioning module, used for partitioning the preprocessed raw data into a training set and a test set;

[0170] The feature generation module is used to determine the data corresponding to the drilling speed influencing factors in the training set as sample data, determine the actual drilling speed corresponding to the sample data as the sample label drilling speed, and generate the feature vector based on the sample data.

[0171] Optionally, the data processing module is further used to:

[0172] Removing noise data from the original data;

[0173] Supplementing the missing values ​​in the original data by using the mean value interpolation method;

[0174] The raw data is normalized based on a normalization algorithm.

[0175] Please refer to Fig.10 , which shows a schematic diagram of the structure of a computer device provided by an embodiment of the present application.

[0176] The computer device 1000 in the present application may include one or more of the following components: a processor 1010 and a memory 1020 .

[0177] The processor 1010 may include one or more processing cores. The processor 1010 uses various interfaces and lines to connect various parts within the entire computer device 1000, and executes various functions and processes data of the computer device 1000 by running or executing instructions, programs, code sets or instruction sets stored in the memory 1020, and calling data stored in the memory 1020. Optionally, the processor 1010 can be implemented in at least one hardware form of digital signal processing (Digital Signal Processing, DSP), field programmable gate array (Field-Programmable Gate Array, FPGA), and programmable logic array (Programmable Logic Array, PLA). The processor 1010 can integrate one or a combination of a central processing unit (Central Processing Unit, CPU), a graphics processing unit (Graphics Processing Unit, GPU) and a modem.

[0178] The memory 1020 may include a random access memory (RAM) or a read-only memory (ROM). Optionally, the memory 1020 includes a non-transitory computer-readable storage medium. The memory 1020 may be used to store instructions, programs, codes, code sets, or instruction sets. The memory 1020 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for implementing at least one function (such as a touch function, a sound playback function, an image playback function, etc.), instructions for implementing the above-mentioned various method embodiments, etc. The data storage area may also store data created by the computer device 1000 during use, etc.

[0179] In addition, those skilled in the art can understand that the structure of the computer device 1000 shown in the above figures does not constitute a limitation on the computer device 1000, and the computer device may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently. For example, the computer device 1000 also includes components such as a radio frequency circuit, an audio circuit, a Wi-Fi component, a power supply, and a Bluetooth component, which will not be described in detail here.

[0180] An embodiment of the present application also provides a computer-readable storage medium, in which at least one instruction, at least one program, code set or instruction set is stored, and the at least one instruction, at least one program, code set or instruction set is loaded and executed by a processor to implement the method described in the above embodiment.

[0181] The embodiment of the present application further provides a computer program product, which runs on a processor of a computer device, so that the computer device executes the method described in the above embodiment.

[0182] The protection scope of the present disclosure is not limited to the above-mentioned embodiments. Obviously, those skilled in the art can make various changes and modifications to the present disclosure without departing from the scope and spirit of the present disclosure. If these changes and modifications fall within the scope of the claims of the present disclosure and their equivalents, the intention of the present disclosure also includes these changes and modifications.

Claims

1. A method for training a drilling speed prediction model, characterized in that: The method comprises: Updating the drilling speed prediction model based on the drilling speed prediction model parameters generated by the parameter optimization algorithm; Inputting the sample feature vector into the updated drilling speed prediction model to obtain the sample predicted drilling speed; Determining a fitness value corresponding to the parameter optimization algorithm based on an error between the sample predicted drilling speed and the sample labeled drilling speed; Iteratively updating the algorithm parameters of the parameter optimization algorithm and the drilling speed prediction model based on the fitness value; In response to the model training satisfying a preset condition, the iterative update is stopped to obtain the drilling speed prediction model after the training is completed.

2. The method according to claim 1, characterized in that The parameter optimization algorithm includes a particle swarm algorithm and / or a genetic algorithm, the drilling speed prediction model is a random forest model, and the drilling speed prediction model parameters include the number of decision trees and the depth of the decision trees of the random forest model.

3. The method according to claim 2, characterized in that The parameter optimization algorithm is the particle swarm algorithm; The method of updating the drilling speed prediction model based on the drilling speed prediction model parameters generated by the parameter optimization algorithm includes: Based on the spatial position of each particle in the particle swarm algorithm, determine the number of decision trees and the depth of the decision tree corresponding to each particle; The number of decision trees and the depth of the decision trees in each group are respectively substituted into the drilling speed prediction model to update the model.

4. The method according to claim 3, characterized in that The determining of the fitness value corresponding to the parameter optimization algorithm based on the error between the sample predicted drilling speed and the sample label drilling speed includes: Determine the fitness value of each particle based on the error between the sample predicted drilling speed corresponding to each particle and the sample label drilling speed; The iterative updating of the algorithm parameters of the parameter optimization algorithm and the drilling speed prediction model based on the fitness value includes: In response to the fitness values ​​not satisfying the preset condition, based on a change trend of the fitness value compared to the fitness value in a previous iteration, updating the moving speed of the particle and the spatial position; The number of decision trees and the depth of the decision tree corresponding to the particle in the next iteration process are determined based on the updated spatial position, and parameters of the drilling speed prediction are updated.

5. The algorithm according to claim 2, characterized in that The parameter optimization algorithm is the genetic algorithm; The method of updating the drilling speed prediction model based on the drilling speed prediction model parameters generated by the parameter optimization algorithm includes: Based on the chromosome codes of individuals in the population, determine the number of decision trees and the depth of the decision tree corresponding to each individual; The number of decision trees and the depth of the decision trees in each group are respectively substituted into the drilling speed prediction model to update the model.

6. The method according to claim 5, characterized in that The determining of the fitness value corresponding to the parameter optimization algorithm based on the error between the sample predicted drilling speed and the sample label drilling speed includes: Determine the fitness value of each individual based on the error between the sample predicted drilling speed corresponding to each individual and the sample labeled drilling speed; The iterative updating of the algorithm parameters of the parameter optimization algorithm and the drilling speed prediction model based on the fitness value includes: In response to the fitness values ​​not satisfying the preset condition, individuals are eliminated from the population by selecting an operator, wherein the elimination probability corresponding to individuals with high fitness values ​​is lower than the elimination probability of individuals with low fitness values; New individuals are obtained by crossover, mutation or direct inheritance of the remaining individuals in the population, and the number of decision trees and the depth of the decision tree corresponding to each individual in the next round of iteration are determined based on the chromosome coding of the new individuals, so as to update the parameters of the drilling speed prediction.

7. The method according to any one of claims 1 to 6, characterized in that: In response to the model training satisfying a preset condition, stopping the iterative update to obtain the drilling speed prediction model after the training is completed, including: In response to a set of fitness values ​​corresponding to the drilling speed prediction model parameters satisfying the preset condition, stopping the iterative update, and determining the drilling speed prediction model parameters whose fitness values ​​satisfy the preset condition as the model parameters of the drilling speed prediction model; In response to the existence of at least two groups of fitness values ​​corresponding to the drilling rate prediction model parameters that meet the preset conditions, the iterative update is stopped, and the drilling rate prediction model parameters whose fitness values ​​meet the preset conditions and have the largest fitness value are determined as the model parameters of the drilling rate prediction model.

8. The method according to any one of claims 1 to 6, characterized in that: Before updating the drilling speed prediction model based on the drilling speed prediction model parameters generated by the parameter optimization algorithm, the method further includes: Collecting logging data as raw data for model training, and preprocessing the raw data; Dividing the preprocessed raw data into a training set and a test set; The data corresponding to the drilling speed influencing factors in the training set are determined as sample data, the actual drilling speed corresponding to the sample data is determined as the sample label drilling speed, and the feature vector is generated based on the sample data.

9. The method according to claim 8, characterized in that The preprocessing of the raw data comprises: Removing noise data from the original data; Supplementing the missing values ​​in the original data by using the mean value interpolation method; The raw data is normalized based on a normalization algorithm.

10. A drilling speed prediction model training device, characterized in that: The device comprises: A model updating module, used for updating the drilling speed prediction model based on the drilling speed prediction model parameters generated by the parameter optimization algorithm; A prediction module, used for inputting the sample feature vector into the drilling speed prediction model to obtain the sample predicted drilling speed; A determination module, configured to determine a fitness value corresponding to the parameter optimization algorithm based on an error between the sample predicted drilling speed and the sample labeled drilling speed; The model updating module is further used to iteratively update the algorithm parameters of the parameter optimization algorithm and the drilling speed prediction model parameters based on the change trend of the fitness value; The control module is used to stop iterative updating in response to the model training meeting the preset conditions, so as to obtain the drilling speed prediction model after the training is completed.

11. A computer device, characterized in that: The computer device includes a processor and a memory, wherein the memory stores at least one instruction, at least one program, a code set or an instruction set, and the at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by the processor to implement the method according to any one of claims 1 to 9.

12. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores at least one instruction, at least one program, a code set or an instruction set, and the at least one instruction, at least one program, a code set or an instruction set is loaded and executed by a processor to implement the method according to any one of claims 1 to 9.