Real-Time Drilling Parameter Optimization Model Based on the Constrained Bayesian Method

: To solve the problems of the low energy efﬁciency and slow penetration rate of drilling, we took the geological data of adjacent wells, real-time logging data, and downhole engineering parameters as inputs; the mechanical speciﬁc energy and unit footage cost as multi-objective optimization functions; and the machine pump equipment limit as the constraint condition. A constrained Bayesian optimization algorithm model was established for the optimization solution, and drilling parameters such as weight-of-bit, revolutions per minute, and ﬂowrate were optimized in real time. Through a comparison with NSGA-II, random search, and other optimization algorithms, and the application results of example wells, we show that the established Bayesian optimization algorithm has a good optimization effect while maintaining timeliness. It is suitable for real-time optimization of drilling parameters, can aid a driller in identifying the drilling rate and potential tapping area, and provides a decision-making basis for avoiding the low-efﬁciency rock-breaking working area and improving rock-breaking efﬁciency.


Introduction
The optimization of drilling parameters is conducted under certain objective conditions by adopting appropriate optimization methods based on the impact of different parameter combinations on the drilling process.The optimization of drilling parameters is an important link in the drilling process [1].By optimizing the drilling parameters, the drilling cycle can be shortened, the drilling cost can be reduced, and the drilling efficiency can be improved.
Over the last century, scholars and major drilling service companies have conducted exploratory studies on drilling parameter optimization.Currently, the optimization of drilling parameters is primarily divided into two categories: one is to establish a single objective optimization model of drilling parameters [2][3][4][5], taking a single-unit footage cost or mechanical specific energy as the objective function, and pursuing cost minimization or energy efficiency maximization.The second is to establish a multi-objective optimization model of drilling parameters to determine the optimal cooperation between them [6][7][8].
In the single-objective optimization model of drilling parameters, many studies have been conducted on the prediction model of the rate of penetration (ROP).Bourgonye and Young [9] proposed a penetration rate model that uses a regression method to evaluate the impact of drilling parameters on the drilling speed.Ziaja and Miska [10] proposed a mathematical model for calculating the ROP for different bits.In recent years, machinelearning technology has rapidly developed.In the field of drilling, machine-learning Energies 2022, 15, 8030 2 of 15 algorithms are primarily applied to ROP prediction [11].Batruny et al. [12] used an artificial neural network to predict the ROP.Singh et al. [13] used machine learning to drill parameter optimization to improve ROP.
In the above ROP model, the objective function adopted is to maximize the ROP as the optimization objective.Although increasing the ROP can improve drilling efficiency and reduce drilling costs, it is essentially a single-objective optimization problem.The results obtained by solving the model do not optimize the drilling efficiency and cost.
In the development process of real-time drilling optimization, many scholars have adopted a single-objective optimization model for real-time drilling optimization.Young [14] was the first to attempt real-time drilling optimization.The model adopted used the drilling cost as the optimization target and minimized the drilling cost by controlling parameters such as weight on bit (WOB) and revolutions per minute (RPM).Simmons [15] collected drilling data directly from a drilling site and improved the drilling performance by optimizing the hydraulic parameters, WOB, and RPM.The adopted model used drilling efficiency as the optimization objective.With the continuous development of the ability to collect realtime data, customized models for drilling optimization can be developed.In recent studies, Iqbal [16] proposed an algorithm to optimize drilling parameters using real-time drilling data of the insert bit, which can improve drilling efficiency by improving bit performance to achieve drilling optimization.Dupriest and Koederitz [17] used the mechanical specific energy (MSE) in a real-time monitoring system to improve drilling efficiency.The MSE was calculated in real time to monitor whether the drilling was effective and whether the lithology had changed.The adopted model considers drilling efficiency as the optimization target.The above-mentioned real-time drilling optimization models all adopt single-objective optimization, which targets only drilling efficiency or drilling cost and does not consider the two objectives comprehensively.
For the multi-objective optimization problem, although traditional optimization methods are relatively systematic and mature, they can only solve simple multi-objective optimization problems under a specific condition.Considering the actual scenario of a drilling site, the drilling models are relatively complex nonlinear equations, and the multiparameter and multi-objective models are more complex.Solving such optimization problems using traditional optimization methods is difficult.With the continuous development of optimization methods, some methods for solving multi-parameter and multi-objective optimization problems have emerged, such as the particle swarm optimization (PSO) algorithm [18] and genetic algorithm (GA) [19].However, these algorithms are unstable and experience some problems, such as limited search efficiency and local optimality.
When optimizing real-time drilling parameters, the calculation of a multi-objective function with constraints is often complex.To replace the function with a high calculation cost by the Gaussian processing model [20] (pp.63-71), Bayesian optimization algorithms can optimize complex objective functions by constructing probability substitution models, and they have had many successful applications [21][22][23].
In this paper, a multi-objective multi-parameter real-time drilling parameter optimization model is mainly developed.In addition, a constrained Bayesian optimization algorithm is used to solve the multi-objective optimization problem to achieve drilling parameter optimization.Based on this, this study examined the applicability of the constrained Bayesian optimization algorithm in drilling.The optimization objectives considered were drilling efficiency and drilling cost, and the limit of equipment was used as the constraint condition.Two optimization algorithms, random search and nondominated sorting genetic algorithms (NSGA-II), were used for comparative analysis.In addition, a statistical method was used to adjust the Bayesian optimization algorithm.The Bayesian optimization algorithm was applied to adjacent wells to verify the applicability of the algorithm.

Drilling Parameter Optimization Model
The traditional method limits the optimization of drilling parameters to a singleobjective optimization problem, which makes it difficult to satisfy the requirements of field engineering to reduce the drilling cycle, reduce the drilling cost, and improve the drilling efficiency.Therefore, a multi-objective optimization model of drilling parameters that can both reflect the impact of drilling parameters on the drilling process and quantitatively evaluate the drilling cost and drilling efficiency must be established.The parameter combination that satisfies the conditions of the multi-objective optimization model is the optimal drilling parameter combination.

Drilling Cost Model
The drilling cost model is typically used to measure the economic effect of the drilling process [24].The drilling cost is solved using the following formula: where C pm is the drilling cost per meter (USD/m); C r is the rig operating cost (USD/h); t E is the conversion time of the drill bit and start-up cost (h); A f is the formation abrasiveness factor (dimensionless); a 1 and a 2 are the RPM effective coefficients, determined by the drill bit type (dimensionless); Z 1 and Z 2 are the WOB influence coefficients; W is the WOB (kN); h f is the bit wear; C 1 is the tooth wear slowdown coefficient; C 2 is the tooth wear coefficient (dimensionless); C H is the hydraulic purification factor; C p is the differential pressure influence factor; K d is the rock drillability factor (dimensionless); M is the threshold WOB (kN); λ is the RPM index; and n is the RPM (r/min).The hydraulic purification factor is the ratio of the actual specific water power to the specific water power at perfect purification as follows: where P is the actual specific water power (kW/cm 2 ), P s is the specific water power required for perfect purification (kW/cm 2 ), and the actual water power is related to the flowrate (Q).The differential pressure influence coefficient is the ratio of the actual ROP to the ROP under zero-differential pressure conditions as follows: where v pc is the actual penetration rate (m/h), v pc = v pc0 e −β∆P ; v pc0 is the penetration rate at zero pressure difference (m/h); β is a parameter related to the rock; ∆P is the difference between the liquid column pressure in the well and the pore formation pressure (MPa); and the liquid column pressure in the well is related to Q.

Mechanical Specific Energy Model
The mechanical specific energy is a parameter used to measure the rock-breaking efficiency of a drill bit [25].The larger the mechanical specific energy of the bit, the lower its rock-breaking efficiency, and the worse the matching between the bit and formation.Because the rock-breaking efficiency is related not only to mechanical energy action but also to hydraulic energy action, the more commonly used mechanical specific energy model currently considers the impact of hydraulic action based on the traditional mechanical specific energy model to match its impact on drilling efficiency.In the actual drilling process, the energy utilization rate is very low, owing to the influence of unfavorable factors, such as wellbore friction and downhole vibration.Therefore, to satisfy the actual requirements of the field and make the specific energy calculated using the model closer to the actual strength of the rock, the effective energy utilization rate of the drill bit is defined as E f , and the modified mechanical specific energy model is where E m is the corrected mechanical specific energy (MPa); A b is the cross-sectional area of the drill bit (m 2 ); RPM is the revolutions per minute (r/min); T is the drill bit torque, (N•m).For applications, E f is often set to 0.35.
Owing to the lack of measurement values of the real torque of the downhole bit, the bit torque must be calculated using the measured data on the ground, that is, using the sliding friction coefficient of the bit and WOB to calculate the bit torque.Based on the dual integral correlation theorem, the torque during drilling can be expressed as where l is the length of the micro-element of the radius of the drill bit (mm) and m is the sliding friction coefficient of the drill bit, generally 0.25 for the roller cone bit and 0.5 for the PDC bit.

Multi-Objective Optimization Model of Drilling Parameters
This model comprehensively considers drilling efficiency and drilling cost, takes the unit footage cost and bit mechanical specific energy as objectives, establishes a multiobjective optimization model of minimum unit footage cost and minimum mechanical specific energy, and optimizes the WOB, RPM, and Q in real time.The optimization of the drilling parameters is a multi-objective optimization problem consisting of the above two optimization objective functions, which are expressed in the form of minF( where F( The index of hypervolume measurements is typically used to represent the quality of the solution set of multi-objective optimization problems [26].The larger the hypervolume measurement, the better the quality of the solution set.The hypervolume measurement function can be expressed as where λ m represents the Lebesgue measure on the D region, and r D is the set of calculation boundary values corresponding to the objective function.For the drilling parameter optimization model, f is the set of two objective functions C pm (W, RPM, Q), MSE(W, RPM, Q) .In addition, under the site conditions of an actual drilling project, the constraint conditions of the g j

→
x inequality are set as follows: (1) WOB (W): M < W < Z 2 /Z 1 , and W > 0; (2) RPM: 0 < RPM < RPM max , where RPM max is the maximum RPM of the drilling device; Energies 2022, 15, 8030 5 of 15 (3) Q: Q min < Q < Q max , Q min is the minimum flowrate to maintain the safety of the wellbore, and Q max is the rated flowrate of the drilling pump; (4) Drill bit wear (h f ): 0 < h f < 1; (5) The WOB and RPM satisfy the constraint WOB•RPM < PD (PD is the maximum allowable value recommended by the drill manufacturer); (6) Bearing wear (B f ): 0 < B f < 1.

Bayesian Optimization Algorithm
A Bayesian optimization algorithm is used to solve the problem of the multi-objective optimization model definition of the drilling parameters (Equation ( 6)).For complex objective functions with constrained optimization, Gelbart et al. [27] (pp.250-259) proposed using a Gaussian function instead of a probabilistic proxy model for objective functions and constraints.The Gaussian function consists of the mean function m(x) and the positive semidefinite covariance function k(x, x ), which can be expressed as For ease of calculation, the a priori mean function is assumed to be zero, which has little effect on the accuracy of the posterior distribution.The covariance function uses a highly flexible covariance function of Matérn clusters, and a second-order differentiable sample function is generated, which can be expressed as where v is the smoothing parameter, l is the scale parameter; and K v is the second kind of deformed Bessel function.
Finally, the following form of the constrained weighted acquisition function is used: where EI is the standard expected improvement acquisition function, Pr is the probability function that satisfies the constraints, and g GP j is the Gaussian process surrogate model of constraint function g j .When a new correction point is required, the optimal solution promotion formula is I(x) = f best − f (x), where f best is the optimal solution in the current feasible solution set.
For the drilling parameter optimization model, by replacing the standard expected acquisition function EI with the definition of the hypervolume measurement value described in Equation ( 7), the hypervolume improvement (HVI) can be defined as Finally, the acquisition function of Equation ( 10) can be rewritten as Figure 1 shows a flowchart of the proposed Bayesian optimization algorithm.

Comparative Analysis of Optimization Algorithms
To evaluate the Bayesian optimization algorithm, we compared and analyzed the changes in the hypervolume measurements calculated using the random search algorithm, NSGA-II, and the Bayesian optimization algorithm.The test data used was the actual data of a tight oil well with a depth of 2000-2400 m.The drillability coefficient d was 0.0023, and abrasiveness coefficient f was 2.89 × 10 −3 .Drilling was performed using a 311.2 mm diameter tricone bit, and the parameters of the drill bit were as follows: WOB influence coefficient 1 = 0.013, 2 = 7.15; RPM influence coefficient 1 = 0.5, 2 = 0.218 × 10 −4 ; and drill bit wear slowing coefficient 1 = 2.7.The parameters of the drill cost were as follows: drill bit cost b = 879.2USD/piece, drilling rig daily cost d = 13,816 USD/day, and drilling rig operating cost r = 62.8 USD/piece.
When establishing the NSGA-II algorithm, the initial population size, initial crossover rate, and initial mutation rate were set to 50, 0.6, and 0.1, respectively.The random search algorithm is a random sampling in the input space; in the evaluation of random sampling input target value, if the sampling target value does not produce a positive improvement, then there is a need to re-sample the input and repeat the process, until there is a positive improvement in the target value.For each algorithm, Figure 2 shows the hypervolume measurements calculated using the multi-objective optimization function with constraints, and Table 1 lists the hypervolume measurements of the three algorithms in the final constraint evaluation.

Comparative Analysis of Optimization Algorithms
To evaluate the Bayesian optimization algorithm, we compared and analyzed the changes in the hypervolume measurements calculated using the random search algorithm, NSGA-II, and the Bayesian optimization algorithm.The test data used was the actual data of a tight oil well with a depth of 2000-2400 m.The drillability coefficient K d was 0.0023, and abrasiveness coefficient A f was 2.89 × 10 −3 .Drilling was performed using a 311.When establishing the NSGA-II algorithm, the initial population size, initial crossover rate, and initial mutation rate were set to 50, 0.6, and 0.1, respectively.The random search algorithm is a random sampling in the input space; in the evaluation of random sampling input target value, if the sampling target value does not produce a positive improvement, then there is a need to re-sample the input and repeat the process, until there is a positive improvement in the target value.For each algorithm, Figure 2 shows the hypervolume measurements calculated using the multi-objective optimization function with constraints, and Table 1 lists the hypervolume measurements of the three algorithms in the final constraint evaluation.As shown in Figure 2, the Bayesian optimization algorithm performed the best, followed by the NSGA-II algorithm, and the random search algorithm performed poorly.After the random initialization phase, the Bayesian optimization algorithm quickly improved its hypervolume.The Bayesian optimization algorithm exceeded the NSGA-II and random search algorithms after 60 iterations.After approximately 80 iterations, the improvement rate of the Bayesian optimization algorithm was very small, and the growth trend on the graph was very small and hardly changed.In addition, the final mean square error of the Bayesian optimization algorithm was ±0.0013, which was the smallest of the three algorithms.The mean square error is the variation range of the final hypervolume value obtained after 10 repeated calculations.The Bayesian optimization algorithm produced a volume 54.09% larger than that of the random search algorithm for the mean of the final hypervolume value at the end of the run listed (Table 1).After 60 iterations of the NSGA-II algorithm, the algorithm performance began to significantly outperform the Random search algorithm.As shown in Table 1, the final hypervolume value increased by approximately 48.78% compared with the random search results.The random search algorithm exhibited a relatively low rate of improvement and had a maximum mean squared error over all the algorithms in the final performance evaluation.

Algorithm Application to Actual Drilling
Using the above actual drilling data as an example, we tested whether the established Bayesian optimization model can achieve the optimization effect of WOB, RPM, and Q, and whether it can reduce drilling costs and improve drilling efficiency.
The unknown coefficient value in the model can be determined from field drilling and relevant data.The Bayesian optimization algorithm was used to calculate the model of the well section drilled by each bit, and the optimal drilling parameter combination of WOB, RPM, and flowrate (Q) was calculated.The calculation results for the drilling-parameter combination are shown in Figure 3.The orange curve in the figure shows the WOB, RPM, and Q of the production well during actual drilling, whereas the blue curve shows the corresponding parameter values after optimization.The figure shows that the  As shown in Figure 2, the Bayesian optimization algorithm performed the best, followed by the NSGA-II algorithm, and the random search algorithm performed poorly.After the random initialization phase, the Bayesian optimization algorithm quickly improved its hypervolume.The Bayesian optimization algorithm exceeded the NSGA-II and random search algorithms after 60 iterations.After approximately 80 iterations, the improvement rate of the Bayesian optimization algorithm was very small, and the growth trend on the graph was very small and hardly changed.In addition, the final mean square error of the Bayesian optimization algorithm was ±0.0013, which was the smallest of the three algorithms.The mean square error is the variation range of the final hypervolume value obtained after 10 repeated calculations.The Bayesian optimization algorithm produced a volume 54.09% larger than that of the random search algorithm for the mean of the final hypervolume value at the end of the run listed (Table 1).After 60 iterations of the NSGA-II algorithm, the algorithm performance began to significantly outperform the Random search algorithm.As shown in Table 1, the final hypervolume value increased by approximately 48.78% compared with the random search results.The random search algorithm exhibited a relatively low rate of improvement and had a maximum mean squared error over all the algorithms in the final performance evaluation.

Algorithm Application to Actual Drilling
Using the above actual drilling data as an example, we tested whether the established Bayesian optimization model can achieve the optimization effect of WOB, RPM, and Q, and whether it can reduce drilling costs and improve drilling efficiency.
The unknown coefficient value in the model can be determined from field drilling and relevant data.The Bayesian optimization algorithm was used to calculate the model of the well section drilled by each bit, and the optimal drilling parameter combination of WOB, RPM, and flowrate (Q) was calculated.The calculation results for the drilling-parameter combination are shown in Figure 3.The orange curve in the figure shows the WOB, RPM, and Q of the production well during actual drilling, whereas the blue curve shows the corresponding parameter values after optimization.The figure shows that the optimized WOB was higher than the WOB value in the actual drilling process of the well, and the optimized RPM was stable and slightly lower than that in the actual drilling process.The optimized Q, which was larger than Q in the actual drilling process, fluctuated significantly with the well depth, and the trends of the two curves were consistent.
Energies 2022, 15, x FOR PEER REVIEW 8 of 15 optimized WOB was higher than the WOB value in the actual drilling process of the well, and the optimized RPM was stable and slightly lower than that in the actual drilling process.The optimized Q, which was larger than Q in the actual drilling process, fluctuated significantly with the well depth, and the trends of the two curves were consistent.Figure 4,b show a comparison of the drilling cost per meter and the mechanical specific energy before and after the optimization of the drilling parameters.The drilling cost significantly reduced after the optimization of drilling parameters, which is about 18% less than that before optimization.and it fluctuated within a small range against the increase in depth with the optimized WOB and RPM.This experimental results show that the optimization of the WOB, RPM, and Q parameters can effectively optimize the drilling cost; moreover, a before-and-after comparison of the mechanical specific energy shows that the mechanical specific energy after optimization is reduced by about 20% compared with that before optimization.The definition of mechanical specific energy shows that the size of the mechanical specific energy value is related to the type of bit, degree of wear of the bit, effectiveness of drilling chip removal, and type and nature of the rock; the lower the mechanical specific energy value, the higher the rock-breaking efficiency of the bit.For a given drill bit, such as that limited by the implementation of this study, the mechanical specific energy of the drill bit can be reduced by optimizing only WOB, RPM, and Q.A comparison of these two sets of experimental data shows that a reasonable WOB, RPM, and Q for a given bit can reduce the cost consumption and achieve efficient drilling.Figure 4a,b show a comparison of the drilling cost per meter and the mechanical specific energy before and after the optimization of the drilling parameters.The drilling cost significantly reduced after the optimization of drilling parameters, which is about 18% less than that before optimization.and it fluctuated within a small range against the increase in depth with the optimized WOB and RPM.This experimental results show that the optimization of the WOB, RPM, and Q parameters can effectively optimize the drilling cost; moreover, a before-and-after comparison of the mechanical specific energy shows that the mechanical specific energy after optimization is reduced by about 20% compared with that before optimization.The definition of mechanical specific energy shows that the size of the mechanical specific energy value is related to the type of bit, degree of wear of the bit, effectiveness of drilling chip removal, and type and nature of the rock; the lower the mechanical specific energy value, the higher the rock-breaking efficiency of the bit.For a given drill bit, such as that limited by the implementation of this study, the mechanical specific energy of the drill bit can be reduced by optimizing only WOB, RPM, and Q.A comparison of these two sets of experimental data shows that a reasonable WOB, RPM, and Q for a given bit can reduce the cost consumption and achieve efficient drilling.Figure 4c shows a comparison of the ROP before and after optimization of the drilling parameters and the difference between the ROP before and after optimization.The experimental results indicate that the ROP improved after using the Bayesian optimization method, and the average ROP increased by approximately 1.5 m/h.

Adjusting the Bayesian Algorithm Using Statistical Analysis Model
Similarly, using the above real drilling as an example, by exploring the relationship between the drilling parameters and drilling performance variables, we constructed a statistical analysis model to adjust the Bayesian optimization algorithm.The corresponding information data were collected, the value of the coefficient in the model is the value of the above real drilling example coefficient, and a trend analysis was conducted according to a section of real-time drilling data to determine the direction of drilling parameter optimization.It is found that the objective function value after Bayesian optimization is lower than the objective function value without optimization calculation, which indicates that the Bayesian optimization method needs to be adjusted.A regression method was used to generate a plane of drilling performance and drilling parameters.The fitted data were determined using a section of real-time drilling data.Figures 5-7 show the changes in MSE, drilling cost, and objective function value with the WOB and RPM. Figure 4c shows a comparison of the ROP before and after optimization of the drilling parameters and the difference between the ROP before and after optimization.The experimental results indicate that the ROP improved after using the Bayesian optimization method, and the average ROP increased by approximately 1.5 m/h.

Adjusting the Bayesian Algorithm Using Statistical Analysis Model
Similarly, using the above real drilling as an example, by exploring the relationship between the drilling parameters and drilling performance variables, we constructed a statistical analysis model to adjust the Bayesian optimization algorithm.The corresponding information data were collected, the value of the coefficient in the model is the value of the above real drilling example coefficient, and a trend analysis was conducted according to a section of real-time drilling data to determine the direction of drilling parameter optimization.It is found that the objective function value after Bayesian optimization is lower than the objective function value without optimization calculation, which indicates that the Bayesian optimization method needs to be adjusted.A regression method was used to generate a plane of drilling performance and drilling parameters.The fitted data were determined using a section of real-time drilling data.Figures 5-7 show the changes in MSE, drilling cost, and objective function value with the WOB and RPM.As shown in Figure 5, under the conditions of low WOB and high RPM, the MSE value was very high; therefore, a low WOB and high RPM should be avoided as much as possible.As shown in Figure 6, the drilling cost was very high when the WOB was high and the RPM was low; therefore, a high WOB and low RPM should be avoided as much as possible.The hypervolume measurement value in Figure 7 was calculated from the mechanical specific energy function and unit footage cost function using Equation (7).As shown in Figure 7, the hypervolume measurement value is suitable for a medium WOB and medium RPM, and the target value at this time is small, indicating that the drilling performance is better.
The trend of the actual drilling in this period indicated that the optimization direction of the drilling parameters is toward a medium WOB and medium RPM.After applying the Bayesian optimization method, we monitored whether the optimization direction of the drilling parameters deviated from the optimization direction.To eliminate accidental scenarios, if the optimization direction of the Bayesian optimization method deviates from the optimization direction of the objective function for a period, the constraint conditions in the Bayesian optimization method may need to be re-determined and adjusted, owing to the change in the constraint conditions to ensure that the Bayesian optimization method can be better applied to the actual drilling process.When the Bayesian optimization algorithm is adjusted, the acquisition function of the Bayesian optimization algorithm needs to be changed and the samples need to be re-sampled.The collection function is EI function, which is used in this paper, and the aim is to sample the area with high mean value; that is, under the current information, get a better combination of parameters to sample the areas with higher probability.At this time, the Bayes algorithm sampling point is not good, so it needs to be sampled in a larger range; that is, the sampling function should be converted from development to exploration stage, sampling in areas with high variance.The ε-Greedy sampling function [28] is used as the sampling function.The statistical analysis model was obtained from real-time drilling parameter regression; therefore, there was sufficient data for drilling performance trend analysis to aid in the drilling parameter optimization.As shown in Figure 5, under the conditions of low WOB and high RPM, the MSE value was very high; therefore, a low WOB and high RPM should be avoided as much as possible.As shown in Figure 6, the drilling cost was very high when the WOB was high and the RPM was low; therefore, a high WOB and low RPM should be avoided as much as possible.The hypervolume measurement value in Figure 7 was calculated from the mechanical specific energy function and unit footage cost function using Equation (7).As shown in Figure 7, the hypervolume measurement value is suitable for a medium WOB and medium RPM, and the target value at this time is small, indicating that the drilling performance is better.

Applicability Analysis of the Algorithm
The trend of the actual drilling in this period indicated that the optimization direction of the drilling parameters is toward a medium WOB and medium RPM.After applying the Bayesian optimization method, we monitored whether the optimization direction of the drilling parameters deviated from the optimization direction.To eliminate accidental scenarios, if the optimization direction of the Bayesian optimization method deviates from the optimization direction of the objective function for a period, the constraint conditions in the Bayesian optimization method may need to be re-determined and adjusted, owing to the change in the constraint conditions to ensure that the Bayesian optimization method can be better applied to the actual drilling process.When the Bayesian optimization algorithm is adjusted, the acquisition function of the Bayesian optimization algorithm needs to be changed and the samples need to be re-sampled.The collection function is EI function, which is used in this paper, and the aim is to sample the area with high mean value; that is, under the current information, get a better combination of parameters to sample the areas with higher probability.At this time, the Bayes algorithm sampling point is not good, so it needs to be sampled in a larger range; that is, the sampling function should be converted from development to exploration stage, sampling in areas with high variance.The ε-Greedy sampling function [28] is used as the sampling function.The statistical analysis model was obtained from real-time drilling parameter regression; therefore, there was sufficient data for drilling performance trend analysis to aid in the drilling parameter optimization.

Applicability Analysis of the Algorithm
Similarly, the above test well was used for comparison and analysis with an adjacent well.The adjacent well was not optimized using the Bayesian optimization method.To reduce the impact of other factors on the drilling performance and ensure that the test and adjacent wells used the same bit and bottom-hole assembly (BHA), we selected the adjacent well for comparison to ensure that they had similar formations and that the comparison process would not be affected by the formations.
Figure 8 shows the relationship between the cumulative drilling time and depth.On average, compared with the adjacent wells that did not use the drilling parameter optimization method, the test wells that used the drilling parameter optimization required approximately 4.5 h less, saving approximately 10% of the drilling time.
reduce the impact of other factors on the drilling performance and ensure that the test and adjacent wells used the same bit and bottom-hole assembly (BHA), we selected the adjacent well for comparison to ensure that they had similar formations and that the comparison process would not be affected by the formations.
Figure 8 shows the relationship between the cumulative drilling time and depth.On average, compared with the adjacent wells that did not use the drilling parameter optimization method, the test wells that used the drilling parameter optimization required approximately 4.5 h less, saving approximately 10% of the drilling time.Figure 9 shows the relationship between the cumulative drilling cost and depth.On average, compared with the adjacent wells that did not use the drilling parameter optimization method, the test wells that used the drilling parameter optimization required approximately 1000 USD less, saving approximately 18% of the drilling cost.In addition, the influence of different lithologies on the algorithm was analyzed.Adjacent wells were selected for comparative analysis, and the Bayesian optimization Figure 9 shows the relationship between the cumulative drilling cost and depth.On average, compared with the adjacent wells that did not use the drilling parameter optimization method, the test wells that used the drilling parameter optimization required approximately 1000 USD less, saving approximately 18% of the drilling cost.
reduce the impact of other factors on the drilling performance and ensure that the test and adjacent wells used the same bit and bottom-hole assembly (BHA), we selected the adjacent well for comparison to ensure that they had similar formations and that the comparison process would not be affected by the formations.
Figure 8 shows the relationship between the cumulative drilling time and depth.On average, compared with the adjacent wells that did not use the drilling parameter optimization method, the test wells that used the drilling parameter optimization required approximately 4.5 h less, saving approximately 10% of the drilling time.Figure 9 shows the relationship between the cumulative drilling cost and depth.On average, compared with the adjacent wells that did not use the drilling parameter optimization method, the test wells that used the drilling parameter optimization required approximately 1000 USD less, saving approximately 18% of the drilling cost.In addition, the influence of different lithologies on the algorithm was analyzed.Adjacent wells were selected for comparative analysis, and the Bayesian optimization In addition, the influence of different lithologies on the algorithm was analyzed.Adjacent wells were selected for comparative analysis, and the Bayesian optimization method was not used for adjacent wells.To explore whether lithologic factors affected the optimization effect of the algorithm, we selected five different lithologic stratigraphic segments.The following figure shows the comparative analysis results for the different lithological formations.
Figure 10 shows that the optimization results were not the same for different lithological formations.After adopting the Bayesian optimization method in formations 3 and 5, the optimization effect was general, and the average ROP increased by approximately 5% and 8%, respectively.Further analysis showed that formations 3 and 5 had heterogeneous characteristics, and the rock formation was difficult to break, which resulted in the failure to optimize the ROP when using a cone bit.However, in formations 1, 2, and 4, the results of Bayesian optimization were better, with the average ROP increasing by 17%, 11%, and 13%, respectively.Overall, the average ROP increased by approximately 11% when using the Bayesian optimization method.In different lithological formations, the Bayesian optimization method produced a certain optimization effect, which shows that the algorithm has good applicability in various lithological formations.
Energies 2022, 15, x FOR PEER REVIEW 13 of 15 method was not used for adjacent wells.To explore whether lithologic factors affected the optimization effect of the algorithm, we selected five different lithologic stratigraphic segments.The following figure shows the comparative analysis results for the different lithological formations.
Figure 10 shows that the optimization results were not the same for different lithological formations.After adopting the Bayesian optimization method in formations 3 and 5, the optimization effect was general, and the average ROP increased by approximately 5% and 8%, respectively.Further analysis showed that formations 3 and 5 had heterogeneous characteristics, and the rock formation was difficult to break, which resulted in the failure to optimize the ROP when using a cone bit.However, in formations 1, 2, and 4, the results of Bayesian optimization were better, with the average ROP increasing by 17%, 11%, and 13%, respectively.Overall, the average ROP increased by approximately 11% when using the Bayesian optimization method.In different lithological formations, the Bayesian optimization method produced a certain optimization effect, which shows that the algorithm has good applicability in various lithological formations.

Conclusions
(1) The constrained Bayesian optimization algorithm can be used to solve the problem of the drilling parameter optimization model.When the algorithm was applied to actual drilling, we observed that the unit footage cost and the mechanical specific energy of the bit were reduced by 18% and 20% respectively compared with those before optimization.The application of the Bayesian optimization algorithm can improve the mechanical penetration rate, optimize drilling efficiency, and reduce drilling cost.Through a comparison and analysis of the other two optimization algorithms, we observed that the Bayesian optimization algorithm has a fast convergence speed, is suitable for real-time optimization of drilling parameters, and can ensure timeliness.
(2) The statistical analysis model established using real-time drilling data can be used to adjust the Bayesian optimization algorithm to make it more suitable for an actual drilling process.In addition, by comparing the cumulative drilling time and drilling cost of the test well with that of the adjacent well, we observed that the Bayesian optimization method shortens the drilling time, improves the drilling efficiency and reduce the drilling cost.In addition, the constrained Bayesian optimization method has good applicability for different lithologic formations.
(3) This paper does not analyze the influence of bit, BHA, and other factors on the optimization of drilling parameters, which also have a significant impact on drilling efficiency.In addition, the constrained Bayesian method is not applicable to all formations,

Conclusions
(1) The constrained Bayesian optimization algorithm can be used to solve the problem of the drilling parameter optimization model.When the algorithm was applied to actual drilling, we observed that the unit footage cost and the mechanical specific energy of the bit were reduced by 18% and 20% respectively compared with those before optimization.The application of the Bayesian optimization algorithm can improve the mechanical penetration rate, optimize drilling efficiency, and reduce drilling cost.Through a comparison and analysis of the other two optimization algorithms, we observed that the Bayesian optimization algorithm has a fast convergence speed, is suitable for real-time optimization of drilling parameters, and can ensure timeliness.
(2) The statistical analysis model established using real-time drilling data can be used to adjust the Bayesian optimization algorithm to make it more suitable for an actual drilling process.In addition, by comparing the cumulative drilling time and drilling cost of the test well with that of the adjacent well, we observed that the Bayesian optimization method shortens the drilling time, improves the drilling efficiency and reduce the drilling cost.In addition, the constrained Bayesian optimization method has good applicability for different lithologic formations.
(3) This paper does not analyze the influence of bit, BHA, and other factors on the optimization of drilling parameters, which also have a significant impact on drilling efficiency.In addition, the constrained Bayesian method is not applicable to all formations, particularly for lithologies with heterogeneous characteristics, and the optimization effect of the algorithm is not very apparent.

→x)
R represents all the target variables of the entire multi-target in the Y dimension, C pm is the target component function of unit footage cost, MSE is the target component function of the mechanical specific energy, g j ( → x ) ≤ 0 represents the constraint conditions of inequalities, D is the decision space of all targets, → x = (WOB, RPM, Q), and → x ∈ D represents all the decision variables.

Figure 1 .
Figure 1.Flowchart of the constrained Bayesian optimization algorithm.

Figure 1 .
Figure 1.Flowchart of the constrained Bayesian optimization algorithm.
2 mm diameter tricone bit, and the parameters of the drill bit were as follows: WOB influence coefficient Z 1 = 0.013, Z 2 = 7.15; RPM influence coefficient a 1 = 0.5, a 2 = 0.218 × 10 −4 ; and drill bit wear slowing coefficient C 1 = 2.7.The parameters of the drill cost were as follows: drill bit cost C b = 879.2USD/piece, drilling rig daily cost C d = 13,816 USD/day, and drilling rig operating cost C r = 62.8 USD/piece.

Figure 3 .
Figure 3.Comparison of WOB, RPM, and Q results before and after optimization.

Figure 3 .
Figure 3.Comparison of WOB, RPM, and Q results before and after optimization.

Figure 4 .
Figure 4. Comparison of , MSE, and ROP results before and after optimization

Figure 4 .
Figure 4. Comparison of C pm , MSE, and ROP results before and after optimization.

Figure 6 .
Figure 6.drilling cost-Avoid high WOB and low RPM.

Figure 6 .
Figure 6.drilling cost-Avoid high WOB and low RPM.

Figure 6 .
Figure 6.Drilling cost-Avoid high WOB and low RPM.

Figure 7 .
Figure 7. Objective function-favors medium WOB and medium RPM.

Figure 7 .
Figure 7. Objective function-favors medium WOB and medium RPM.

Table 1 .
Final constraint evaluation with each algorithm hypervolume value.

Table 1 .
Final constraint evaluation with each algorithm hypervolume value.