A drilling well leakage accident prediction method and device, electronic equipment and storage medium
Through BP neural network and simulated annealing algorithm optimization, the subjective judgment limitations of drilling lost circulation accident prediction were solved, the prediction accuracy and drilling operation efficiency were improved, and adaptive optimization and dynamic adjustment were achieved.
Patent Information
- Application Number
- CN202411819871.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-11
- Publication Date
- 2025-10-17
- Estimated Expiration
- 2044-12-11
AI Technical Summary
The existing technology for predicting drilling leakage accidents relies on the subjective judgment of experts, which has limitations and is difficult to replicate on a large scale, affecting the efficiency and safety of drilling operations.
The BP neural network combined with the simulated annealing algorithm is used. The drilling data is divided into a test set and a validation set, the BP network topology is initialized, the network is trained using the test set, and the network parameters and topology are dynamically adjusted to improve the prediction accuracy.
It improves the prediction accuracy and generalization ability of lost circulation accidents, enhances the safety and efficiency of drilling operations, and realizes adaptive optimization and dynamic adjustment.
Smart Images

Figure CN119801475B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing technology, and in particular to a method, device, electronic equipment and storage medium for predicting drilling lost circulation accidents. Background Art
[0002] Current technical solutions rely primarily on experts' subjective interpretation of real-time sensor data, combined with their extensive field experience. While this approach can achieve effective monitoring and assessment to a certain extent, it is inevitably subject to subjective bias, resulting in significant limitations in the resulting assessments.
[0003] At the same time, because drilling site experience and knowledge often rely on the personal experience and intuition of experts, it is difficult to achieve large-scale, systematic replication and application. This not only limits the efficiency and safety of drilling operations, but also hinders the widespread dissemination and in-depth application of relevant technologies and knowledge. Summary of the Invention
[0004] The present invention aims to at least partially address the limitations of related technologies. To this end, the present invention provides a method, device, electronic device, and storage medium for predicting lost circulation accidents in drilling, which can efficiently and accurately predict lost circulation accidents.
[0005] In one aspect, an embodiment of the present invention provides a method for predicting a lost circulation accident in a drilling operation, comprising:
[0006] Drilling data is obtained and split into a test set and a validation set based on the drilling data. Both the test set and the validation set include multiple sets of drilling feature data and whether a drilling loss accident has occurred in each set of data.
[0007] Initialize the topology of the BP network and randomly generate network parameters corresponding to the topology;
[0008] Apply the network parameters to the BP network, and then use the test set to train the BP network to obtain the first network;
[0009] The F1 score of the first network is obtained by evaluating the training results based on the test set. When the F1 score is greater than the score threshold, the F1 score is used as the score threshold and the historical score of the next round, and the network parameters are used as the optimal parameters and historical parameters. Otherwise, the acceptance probability of the network parameters is determined based on the F1 score and the historical score of the previous round, combined with the preset temperature. When the acceptance probability meets the preset conditions, the F1 score is used as the historical score of the next round, and the network parameters are used as the historical parameters.
[0010] The number of iterations is increased by 1, the historical parameters are updated for the first time, the results of the first update are used as the network parameters, and the step of applying the network parameters to the BP network is returned to be executed until the number of iterations reaches the number threshold;
[0011] Performing a decay process on the preset temperature, setting the number of iterations to 0, and returning to the step of applying the network parameters to the BP network until the preset temperature reaches the temperature threshold;
[0012] Apply the optimal parameters to the BP network, and then use the validation set to train the BP network to obtain the second network;
[0013] The target F1 score of the second network is obtained by evaluating the training results based on the validation set. When the target F1 score does not meet the expected conditions, the topology of the BP network is updated for the second time. The result of the second update is used as the topology of the BP network, the preset temperature is reset, and the process returns to the step of randomly generating network parameters for the corresponding topology until the target F1 score meets the expected conditions. The second network is then applied to the prediction of lost circulation accidents.
[0014] Optionally, the BP network includes an input layer, a hidden layer, and an output layer; initializing the topology of the BP network includes the following steps:
[0015] The number of input neurons of the input layer of the BP network is set according to the number of features of the drilling feature data;
[0016] Based on the input quantity, the number of neurons in the hidden layer of the BP network is set through a preset quantity relationship; wherein the output number of neurons in the output layer is 1.
[0017] Optionally, the BP network includes an input layer, a hidden layer, and an output layer; the topology structure includes the number of input neurons in the input layer, the number of neurons in the hidden layer, and the number of output neurons in the output layer; the network parameters include weight parameters and threshold parameters; and randomly generating the network parameters corresponding to the topology structure includes the following steps:
[0018] The number of weights of the weight parameter is determined according to the sum of the product of the number of inputs and the number of neurons and the product of the number of neurons and the number of outputs;
[0019] The threshold number of the threshold parameter is determined according to the sum of the number of neurons and the number of outputs;
[0020] The weight parameters of the weight quantity and the threshold parameters of the threshold quantity are randomly generated in a preset interval.
[0021] Optionally, the training results of the test set include a lost circulation prediction result for each set of drilling characteristic data in the test set, and obtaining an F1 score of the first network based on the training results of the test set includes the following steps:
[0022] Compare the lost circulation prediction results and accident annotations corresponding to each set of drilling characteristic data in the test set;
[0023] According to the comparison results, the number of first samples correctly predicted as positive, the number of second samples incorrectly predicted as positive, and the number of third samples incorrectly predicted as negative are obtained; wherein the positive class indicates that the well loss prediction result is the occurrence of well loss, and the negative class indicates that the well loss prediction result is the absence of well loss;
[0024] An F1 score of the first network is calculated based on the first number of samples, the second number of samples, and the third number of samples.
[0025] Optionally, determining the acceptance probability of the network parameters based on the F1 score and the historical score of the previous round in combination with a preset temperature includes the following steps:
[0026] The index parameter is obtained based on the ratio of the difference between the previous round's historical score and the F1 score to the preset temperature;
[0027] The natural constant is used as the base, the exponential parameter is used as the exponent, and the exponential operation is performed based on the base and the exponent to obtain the reception probability of the network parameter.
[0028] Optionally, performing a first update on the historical parameters includes the following steps:
[0029] Assign and update the value of each parameter in the historical parameters through a normally distributed random number;
[0030] The assignment update representation updates the corresponding parameter value by summing the parameter value and the random number;
[0031] When the result of the assignment update is greater than the first extreme value, the corresponding parameter value is replaced with the first extreme value;
[0032] When the result of the assignment update is less than the second extreme value, the corresponding parameter value is replaced with the second extreme value.
[0033] Optionally, the BP network includes an input layer, a hidden layer, and an output layer; performing a second update on the topological structure of the BP network includes the following steps:
[0034] The number of neurons in the hidden layer is increased and adjusted by using random integer values in a preset range.
[0035] On the other hand, an embodiment of the present invention provides a drilling lost circulation accident prediction device, comprising:
[0036] The first module is used to obtain drilling data and segment it into a test set and a validation set. Both the test set and the validation set include multiple sets of drilling feature data and whether a drilling loss accident has occurred in each set of data.
[0037] The second module is used to initialize the topology of the BP network and randomly generate network parameters corresponding to the topology;
[0038] The third module is used to apply the network parameters to the BP network, and then train the BP network using the test set to obtain the first network;
[0039] The fourth module is used to evaluate the training results of the test set to obtain the F1 score of the first network. When the F1 score is greater than the score threshold, the F1 score is used as the score threshold and the historical score of the next round, and the network parameters are used as the optimal parameters and historical parameters. Otherwise, based on the F1 score and the historical score of the previous round, combined with a preset temperature, the acceptance probability of the network parameters is determined. When the acceptance probability meets the preset conditions, the F1 score is used as the historical score of the next round, and the network parameters are used as the historical parameters.
[0040] The fifth module is configured to increase the number of iterations by 1, perform a first update on the historical parameters, use the result of the first update as the network parameter, and return to execute the third module until the number of iterations reaches a threshold;
[0041] The sixth module is used to perform attenuation processing on the preset temperature, set the number of iterations to 0, and return to execute the third module until the preset temperature reaches the temperature threshold;
[0042] The seventh module is used to apply the optimal parameters to the BP network, and then use the verification set to train the BP network to obtain a second network;
[0043] The eighth module is used to evaluate the training results of the validation set to obtain the target F1 score of the second network. When the target F1 score does not meet the expected conditions, the topology structure of the BP network is updated for the second time, the result of the second update is used as the topology structure of the BP network, the preset temperature is reset, and the step of randomly generating network parameters for the corresponding topology structure in the second module is returned to execute until the target F1 score meets the expected conditions, and the second network is applied to the prediction of well leakage accidents.
[0044] On the other hand, an embodiment of the present invention provides an electronic device, including: a processor and a memory; the memory is used to store programs; the processor executes the program to implement the above-mentioned drilling lost circulation accident prediction method.
[0045] On the other hand, an embodiment of the present invention provides a computer storage medium storing a program executable by a processor. When the program is executed by the processor, it is used to implement the above-mentioned method for predicting drilling lost circulation accidents.
[0046] The embodiment of the present invention obtains drilling data and obtains a test set and a validation set according to the segmentation of the drilling data; the test set and the validation set both include multiple groups of drilling feature data and whether a drilling leakage accident has occurred in each group of data; the topological structure of the BP network is initialized, and network parameters are randomly generated corresponding to the topological structure; the network parameters are applied to the BP network, and the BP network is then trained using the test set to obtain a first network; the F1 score of the first network is obtained based on the training result of the test set; when the F1 score is greater than the score threshold, the F1 score is used as the score threshold and the historical score of the next round, and the network parameters are used as the optimal parameters and historical parameters; otherwise, based on the F1 score and the historical score of the previous round, the acceptance probability of the network parameters is determined in combination with a preset temperature; when the acceptance probability meets the preset conditions, the F1 score is used as the historical score of the next round, and the network parameters are used as historical parameters; the iteration The number of times is increased by 1, and the historical parameters are updated for the first time. The result of the first update is used as the network parameter, and the step of applying the network parameter to the BP network is returned to execute until the number of iterations reaches the number threshold; the preset temperature is attenuated, the number of iterations is set to 0, and the step of applying the network parameter to the BP network is returned to execute until the preset temperature reaches the temperature threshold; the optimal parameters are applied to the BP network, and the BP network is trained using the validation set to obtain a second network; the target F1 score of the second network is obtained based on the training result of the validation set. When the target F1 score does not meet the expected conditions, the topology structure of the BP network is updated for the second time, and the result of the second update is used as the topology structure of the BP network. The preset temperature is reset, and the step of randomly generating network parameters for the corresponding topology structure is returned to execute until the target F1 score meets the expected conditions, and the second network is applied to the prediction of well leakage accidents. The beneficial effects of the present invention include:
[0047] Improved prediction accuracy: By adopting a BP neural network and combining it with a test set for training, the present invention can effectively learn the complex relationship between drilling characteristics and lost circulation accidents, thereby improving the prediction accuracy of lost circulation accidents.
[0048] Adaptive Optimization: This invention introduces an adaptive optimization mechanism based on the F1 score. When the network's F1 score reaches or exceeds a certain threshold, the score and network parameters are automatically saved as the optimal result. Otherwise, the network parameters are updated based on the probability of receipt. This mechanism enables the network to continuously optimize itself during training to adapt to different drilling environments and conditions.
[0049] Enhanced generalization capability: By introducing the temperature decay mechanism in the simulated annealing algorithm, the present invention can gradually lower the threshold of the acceptance probability during the training process, thereby encouraging the network to explore more parameter space, enhancing the generalization capability of the network, and enabling it to maintain high prediction performance in different scenarios.
[0050] Dynamically adjust the network structure: If the target F1 score on the validation set does not meet the expected conditions, the present invention will dynamically adjust the BP network topology and retrain it. This mechanism ensures that the network structure can be optimized according to actual needs, further improving the prediction effect.
[0051] Efficient and practical: This invention combines a variety of advanced machine learning and optimization technologies to efficiently process and analyze large amounts of drilling data, providing timely and accurate predictions of lost circulation accidents for drilling operations, thereby improving the safety and efficiency of drilling operations. BRIEF DESCRIPTION OF THE DRAWINGS
[0052] The accompanying drawings are used to provide a further understanding of the technical solution of the present invention and constitute a part of the specification. Together with the embodiments of the present invention, they are used to explain the technical solution of the present invention and do not constitute a limitation to the technical solution of the present invention.
[0053] Figure 1 A schematic diagram of an implementation environment for predicting a drilling lost circulation accident provided by an embodiment of the present invention;
[0054] Figure 2 A schematic flow chart of a method for predicting lost circulation accidents in drilling provided by an embodiment of the present invention;
[0055] Figure 3 A schematic diagram of an example of the topological structure of a BP neural network provided in an embodiment of the present invention;
[0056] Figure 4 A schematic diagram of the expansion process of initializing the topological structure of a BP network provided by an embodiment of the present invention;
[0057] Figure 5 A schematic diagram of an expanded process for generating network parameters provided by an embodiment of the present invention;
[0058] Figure 6 A schematic diagram of an expanded process for evaluating the F1 score of a first network provided in an embodiment of the present invention;
[0059] Figure 7 A schematic diagram of the expanded process of performing a first update of historical parameters provided by an embodiment of the present invention;
[0060] Figure 8 A schematic diagram of the overall process principle of a method for predicting lost circulation accidents in drilling provided by an embodiment of the present invention;
[0061] Figure 9 A schematic structural diagram of a drilling lost circulation accident prediction device provided by an embodiment of the present invention;
[0062] Figure 10 A schematic structural diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0063] In order to make the purpose, technical solutions and advantages of the present invention more clearly understood, the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.
[0064] It should be noted that although the system diagrams illustrate functional module divisions and the flowcharts illustrate a logical sequence, in certain circumstances, the steps shown or described may be performed in a sequence that differs from the module divisions in the system or the sequence in the flowcharts. The terms "first / S100," "second / S200," and the like in the specification, claims, and drawings are used to distinguish similar objects and are not necessarily intended to describe a specific sequence or precedence.
[0065] References to "embodiments" in this disclosure mean that a particular feature, structure, or characteristic described in connection with the embodiment may be included in at least one embodiment of the disclosure. The appearance of this phrase in various places in the specification does not necessarily refer to the same embodiment, nor does it constitute an independent or alternative embodiment that is mutually exclusive of other embodiments. It is understood, both explicitly and implicitly, by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0066] It is understandable that the method for predicting a drilling well leakage accident provided by an embodiment of the present invention can be applied to any computer device with data processing and computing capabilities, and this computer device can be various terminals or servers. When the computer device in the embodiment is a server, the server is an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms. Optionally, the terminal is a smart phone, tablet computer, laptop computer, desktop computer, etc., but is not limited to this.
[0067] To facilitate understanding of the technical solutions of the present invention, the following are the technical terms that may appear in the embodiments of the present invention:
[0068] The simulated annealing algorithm, derived from solid annealing, is a probability-based algorithm that heats a solid to a sufficient temperature and then slowly cools it. During heating, the particles within the solid become disordered as the temperature rises, increasing its internal energy. However, as the temperature gradually cools, the particles gradually become ordered, reaching equilibrium at each temperature. Simulated annealing is a general optimization algorithm that theoretically exhibits probabilistic global optimization performance and has been widely used in engineering fields such as VLSI, production scheduling, and control engineering. Simulated annealing is a serial optimization algorithm that effectively avoids local minima and ultimately approaches a global optimum by imposing a time-varying probability jump in the search process that eventually approaches zero.
[0069] A BP (back propagation) neural network is a multi-layer feedforward neural network trained using the back propagation algorithm. It is one of the most widely used neural network models. The BP neural network process is divided into two main stages. The first stage is the forward propagation of the signal, from the input layer through the hidden layer, and finally to the output layer. The second stage is the backward propagation of the error, from the output layer to the hidden layer, and finally to the input layer. The weights and biases from the hidden layer to the output layer and from the input layer to the hidden layer are adjusted in turn.
[0070] Reference Figure 3 The following focuses on the input layer, hidden layer, and output layer of a BP neural network. The input layer is the data input to the BP neural network. The number of input layers depends on the number of input variables. The hidden layer maps the data x transmitted from the input layer. Simply put, the formula is: HiddenLayerOutput = F(w*x+b), where w and b are weight and threshold parameters, and F() is the mapping rule, also called the activation function. In other words, the hidden layer maps the input influencing data x to produce a mapped value. There can be multiple hidden layers, and the number of neural networks in each hidden layer can be customized. The output layer is the result output of the BP neural network. The number of output layers depends on the number of output variables. Simply put, the formula is: OutputLayerOutput = w*HiddenLayerOutput + b, where w and b are weight and threshold parameters. The gradient descent algorithm calculates the deviation between the output result and the y value input to the neural network model and uses an algorithm to adjust parameters such as weights and thresholds accordingly.
[0071] In summary, for the BP neural network, the values of weight w and threshold b are very important. The present invention does not use the commonly used gradient descent algorithm, but introduces the simulated annealing method to find the optimal weight w and threshold b, thereby improving the prediction accuracy of the BP neural network. This is the main starting point of the present invention.
[0072] Lost circulation refers to the accidental loss of drilling fluid (commonly known as mud) into the formation during the drilling process due to geological reasons or improper technical operation. Lost circulation not only poses a pollution risk to the ecological environment, but can also cause serious consequences such as damage to equipment and endanger the safety of operators. It can even escalate to a blowout, triggering a chain reaction and ultimately rendering the wellbore inoperable. Therefore, foreseeing the precursors of lost circulation is extremely critical in drilling operations. In the early years, lost circulation prediction relied heavily on subjective judgments made by technicians based on real-time sensor data, which required technicians to possess extensive practical experience. However, manual judgment is inevitably influenced by subjective bias and has limitations. In recent years, leaps in intelligent algorithm technology have brought innovation to this field. Researchers at home and abroad have explored a variety of methods for predicting lost circulation using intelligent algorithms. These techniques are more rigorous and have significantly improved prediction accuracy. To further prevent lost circulation incidents and mitigate losses caused by drilling accidents, this paper proposes an improved simulated annealing algorithm to optimize the BP neural network model to enhance lost circulation prediction capabilities.
[0073] K-fold cross-validation is a commonly used technique for evaluating the performance of machine learning models. The specific operation process is as follows: First, the entire dataset is evenly divided into K non-overlapping subsets (or "folds"), and each subset maintains the consistency of the data distribution as much as possible to ensure that the proportion of samples in each category in each subset is similar. Next, K rounds of training and validation are performed. In each round: one subset is selected as the validation set, and the remaining K-1 subsets are combined as the test set. Repeating this for K rounds will result in K performance evaluation scores, and the average of these scores is usually taken as the final model evaluation metric. The advantage of K-fold cross-validation is that it can better utilize all data for training and testing, providing valuable information about the stability and reliability of the model, while helping to avoid overfitting during model selection and parameter tuning.
[0074] like Figure 1 FIG. 1 is a schematic diagram of an implementation environment provided by an embodiment of the invention. Figure 1 , the implementation environment includes at least one terminal 102 and a server 101. The terminal 102 and the server 101 can be connected to the network in a wireless or wired manner to complete data transmission and exchange.
[0075] Server 101 can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers. It can also be a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network), as well as big data and artificial intelligence platforms.
[0076] In addition, server 101 can also be a node server in a blockchain network. Blockchain is a new application model of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanism, and encryption algorithm.
[0077] The terminal 102 may be a smart phone, tablet computer, laptop computer, desktop computer, smart speaker, smart watch, etc., but is not limited thereto. The terminal 102 and the server 101 may be connected directly or indirectly via wired or wireless communication, which is not limited in this embodiment of the present invention.
[0078] Based on the example Figure 1 In the implementation environment shown, an embodiment of the present invention provides a method for predicting a drilling well leakage accident. The following is explained using the example of the method for predicting a drilling well leakage accident applied to the server 101. It can be understood that the method for predicting a drilling well leakage accident can also be applied to the terminal 102.
[0079] Reference Figure 2 , Figure 2 The flowchart of a method for predicting a drilling well leakage accident applied to a server provided in an embodiment of the present invention is provided. The execution subject of the method for predicting a drilling well leakage accident can be any of the aforementioned computer devices (including a server or a terminal). Figure 2 , the method comprises the following steps:
[0080] S100, obtaining drilling data, and dividing the drilling data into a test set and a validation set;
[0081] The test set and validation set both include multiple sets of drilling feature data and whether a drilling leak has occurred in each set of data.
[0082] For example, in some specific embodiments, the present invention can utilize drilling data primarily sourced from publicly available data sources, both domestically and internationally. This data includes multiple sets of data records collected from daily drilling reports, daily mud reports, and completion reports. Some data indicates lost circulation during drilling, while others indicate normal drilling. Each set of data includes multiple characteristics, such as lithology, pore size, porosity, pore pressure, fracture pressure, shear stress, gel strength, pump pressure, drill bit speed, and primary fracture direction, as well as information on whether lost circulation has occurred in that data set.
[0083] The present invention can use the idea of K-fold cross-validation to split the test set and the validation set, where K can be customized and is generally around 5 to 10. The value of K is evaluated based on the actual amount of data collected. First, K groups are obtained through K-fold cross-validation. Generally, VerifySize groups (VerifySize can be customized, generally 2) are randomly selected as the validation set, and the other K-VerifySize groups are used as the test set.
[0084] S200, initializing the topology of the BP network and randomly generating network parameters corresponding to the topology;
[0085] It should be noted that the BP network includes an input layer, a hidden layer and an output layer; in some embodiments, such as Figure 4 As shown, initializing the topological structure of the BP network may include the following steps: S201, setting the input number of neurons in the input layer of the BP network according to the number of features of the drilling feature data; S202, based on the input number, setting the number of neurons in the hidden layer of the BP network through a preset quantitative relationship; wherein the output number of neurons in the output layer is 1.
[0086] For example, in some specific implementations, the BP neural network topology can be determined for each set of drilling data. For example, the data features are 10 features such as lithology, pore size, porosity, pore pressure, fracture pressure, shear stress, gel strength, pump pressure, drill bit speed, and primary fracture direction. That is, the input variables are 10 and the output variable is 1, that is, whether to send a well leakage accident. That is, the input layer of the BP neural network is 10 and the output layer is 1. The present invention uses a three-layer BP neural network, the activation function is the Sigmoid function, and there is an approximate relationship between the number of hidden layer neural networks n2 and the number of input layer neurons n1, referring to the following formula (i.e., the preset quantitative relationship):
[0087] n2=2*n1+1
[0088] Therefore, the BP neural network topology has 10 input layers, 21 hidden layers, and 1 output layer. At this time, the weight parameters w to be optimized are 10*21+21*1=231, and the threshold parameters b to be optimized are 21+1=22. That is, the optimization variables of simulated annealing search are 231+22=253.
[0089] It should also be noted that in some embodiments, the BP network includes an input layer, a hidden layer, and an output layer. The topology includes the number of input neurons in the input layer, the number of neurons in the hidden layer, and the number of output neurons in the output layer. The network parameters include weight parameters and threshold parameters. Figure 5As shown, randomly generating network parameters corresponding to the topological structure may include the following steps: S203, determining the weight number of weight parameters based on the sum of the product of the number of inputs and the number of nerves and the product of the number of nerves and the number of outputs; S204, determining the threshold number of threshold parameters based on the sum of the number of nerves and the number of outputs; S205, randomly generating weight parameters of the weight number and threshold parameters of the threshold number in a preset interval.
[0090] For example, in some specific implementations, assuming that the current BP neural network topology has 10 input layers, n2 hidden layers, and 1 output layer, then the weight parameters w to be optimized are 10*n2+n2*1 in total, and the threshold parameters b to be optimized are n2+1 in total. Generally speaking, the value range of weight w and threshold b is [-1,1], and can also be flexibly adjusted according to actual conditions. The initialization of NewPara (i.e., network parameters) can be completed by random generation through the following formula, where R(-1,1) represents a random floating point number in [-1,1].
[0091] w i =R(-1,1),1≤i≤10*n2+n2*1
[0092] b i =R(-1,1),1≤i≤n2+1
[0093]
[0094] S300, applying the network parameters to the BP network, and then training the BP network using the test set to obtain a first network;
[0095] For example, in some specific implementations, in the previous steps, a test set is obtained, the topology of the BP neural network is determined, and the weights w and thresholds b of the neural network are obtained. A lost circulation prediction BP neural network model (i.e., the first network) can then be obtained through training based on the test set data.
[0096] S400: Evaluate the training results of the test set to obtain an F1 score of the first network. When the F1 score is greater than a score threshold, use the F1 score as the score threshold and the historical score for the next round, and use the network parameters as the optimal parameters and historical parameters. Otherwise, determine the acceptance probability of the network parameters based on the F1 score and the historical score for the previous round, combined with a preset temperature. When the acceptance probability meets a preset condition, use the F1 score as the historical score for the next round, and use the network parameters as the historical parameters.
[0097] It should be noted that the training results of the test set include the lost circulation prediction results of each set of drilling characteristic data in the test set. In some embodiments, such as Figure 6As shown, obtaining the F1 score of the first network based on the evaluation of the training results of the test set may include the following steps: S401, comparing the lost circulation prediction results and accident labels corresponding to each set of drilling characteristic data in the test set; S402, obtaining, based on the comparison results, a first number of samples correctly predicted as the positive class, a second number of samples incorrectly predicted as the positive class, and a third number of samples incorrectly predicted as the negative class; wherein the positive class indicates that the lost circulation prediction result is lost circulation, and the negative class indicates that the lost circulation prediction result is not lost circulation; S403, calculating the F1 score of the first network based on the first number of samples, the second number of samples, and the third number of samples.
[0098] The score threshold is initially set to a smaller value so that the F1 score obtained in the first evaluation can be smoothly replaced and the subsequent iteration process can be smoothly implemented.
[0099] For example, in some specific implementations, each array group in the test set is input into the BP neural network model to obtain the predicted results, which are then compared with the actual results. This article uses the commonly used F1 score as the fitness function for evaluation. The F1 score is between [0, 1], and the larger the score, the better the model performance. The calculation formula is as follows:
[0100]
[0101] True Positives represents the number of samples correctly predicted by the model as positive; False Positives represents the number of samples incorrectly predicted by the model as positive, but actually negative; and False Negatives represents the number of samples incorrectly predicted by the model as negative, but actually positive. Positives are predicted as leaks, while negatives are predicted as normal operations.
[0102] In general, the current test set is used as the benchmark, the current NewPara is used as the input, and the F1 score of the output result is calculated. NewPara , which is the fitness function value.
[0103] Among them, in some embodiments, determining the probability of receiving network parameters based on the F1 score and the historical score of the previous round in combination with a preset temperature can include the following steps: obtaining an exponential parameter based on the ratio of the difference between the historical score of the previous round and the F1 score and the preset temperature; using a natural constant as the base and the exponential parameter as the exponent, and performing an exponential operation based on the base and the exponent to obtain the probability of receiving the network parameters.
[0104] For example, in some specific implementations, if the parameter variable NewPara found this time does not perform as expected, you can choose to accept NewPara with a certain probability. The probability formula is as follows, where NowTemp represents the current temperature (i.e., the preset temperature) and gradually decreases.
[0105]
[0106] Then calculate a [0,1] random probability randomProb. If acceptBadProb (i.e., acceptance probability) is greater than randomProb, the new parameters are accepted according to the probability.
[0107] Here is an explanation of why this is done: In order to avoid falling into the local optimum, the simulated annealing algorithm will use a certain random probability to jump out of the current search range. This is why it accepts poor parameters with a certain probability. The calculation of this probability is related to the current temperature NowTemp.
[0108] S500, adding 1 to the number of iterations, performing a first update on the historical parameters, using the results of the first update as the network parameters, and returning to the step of applying the network parameters to the BP network until the number of iterations reaches a threshold;
[0109] It should be noted that, in some embodiments, Figure 7 As shown, the first update of the historical parameters may include the following steps: S501, assigning and updating each parameter value in the historical parameters by a normally distributed random number; wherein the assignment update represents updating the corresponding parameter value by the sum of the parameter value and the random number; S502, when the result of the assignment update is greater than the first extreme value, replacing the corresponding parameter value with the first extreme value; S503, when the result of the assignment update is less than the second extreme value, replacing the corresponding parameter value with the second extreme value.
[0110] For example, in some specific implementations, NewPara is generated based on CurrPara (i.e., historical parameters). Each parameter executes the following formula to complete the generation of new variables. Where normal(0,1) represents a normal distribution with a mean of 0 and a standard deviation of 1. The resulting random number satisfies the normal distribution, thereby ensuring search fairness.
[0111] NewPara i =CurrPara i +normal(0,1)
[0112] NewPara i =min(1,NewPara i )
[0113] NewPara i =max(-1,NewPara i )
[0114] Finally, the initialization of the parameter NewPara (ie, the first update) is completed.
[0115] S600. Perform decay processing on the preset temperature, set the iteration count to 0, and return to execute the step of applying the network parameters to the BP network until the preset temperature reaches the temperature threshold;
[0116] Exemplarily, in some specific embodiments, the temperature decay can be implemented as follows: NowTemp represents the current temperature, initialized to MaxTemp (resetting the preset temperature also resets it to MaxTemp, which can be customized, defaulting to 100), and the minimum value is MinTemp (i.e., the temperature threshold, which can be customized, and MinTemp < MaxTemp, defaulting to 1). The decay formula is as follows:
[0117] NowTemp = DecayRate * NowTemp
[0118] Where DecayRate represents the decay rate, with a value range of [0, 1), which can be customized, defaulting to 0.99.
[0119] When NowTemp ≤ MinTemp, that is, the current temperature has reached the temperature lower limit, indicating that the optimal parameter value has been found, and at this time the entire simulated annealing search process ends.
[0120] S700. Apply the optimal parameters to the BP network, and then use the validation set to train the BP network to obtain a second network; <OO00301>
[0121] Exemplarily, in some specific embodiments, when reaching this step, that is, when the entire simulated annealing process is completed, it indicates that the optimal parameter BestPara (i.e., the optimal parameter) has been obtained.
[0122]
[0123] In the previous steps, a validation set was obtained, the structure of the BP network topology was determined, and the optimal parameters were obtained, that is, the neural network weights w and thresholds b have been adjusted to the optimal. Facing the validation set data, a well leakage prediction BP neural network model (i.e., the second network) is obtained through training.
[0124] S800. Evaluate the target F1 score of the second network based on the training results of the validation set. When the target F1 score does not meet the expected conditions, perform a second update on the topology of the BP network, use the result of the second update as the topology of the BP network, reset the preset temperature, and return to execute the step of randomly generating network parameters for the corresponding topology until the target F1 score meets the expected conditions, and then apply the second network to well leakage accident prediction.
[0125] It should be understood that the logical principle of the process for evaluating the target F1 score of the second network based on the training results of the validation set is consistent with the logical principle of the expanded process for evaluating the F1 score of the first network based on the training results of the test set, and will not be repeated here.
[0126] The expected condition may be set as a score threshold. When the target F1 score is greater than or equal to the score threshold, the expected condition is met; otherwise, the expected condition is not met.
[0127] It should be noted that the BP network includes an input layer, a hidden layer and an output layer; in some embodiments, the second update of the topological structure of the BP network includes the following steps: increasing and adjusting the number of neurons in the hidden layer by integer random values within a preset range.
[0128] For example, in some specific implementations, the second update of the topology structure can be implemented by randomly adjusting the number of hidden layers n2. The adjustment formula is as follows, where R(1,5) represents a random integer value [1,5], which means that a number of neural network units are added each time, thereby improving the prediction accuracy of the BP neural network.
[0129] n2=n2+R(1,5)
[0130] In order to explain the principle of the technical solution of the present invention in detail, the overall process of the present invention is described below in combination with some specific embodiments. It is easy to understand that the following is an explanation of the technical principle of the present invention and cannot be regarded as a limitation of the present invention.
[0131] First, it's important to note that current technical solutions rely on subjective judgment by experts based on real-time sensor data, combined with accumulated field experience, to determine drilling status and trigger abnormal accident alerts. However, human judgment is inevitably influenced by subjective bias and has significant limitations. Furthermore, the relevant experience and knowledge are difficult to replicate and apply on a large scale.
[0132] The shortcomings of existing technologies include:
[0133] 1) Slow early warning response: The early warning mechanism that relies on manual judgment significantly reduces analysis efficiency, and emergency response is not timely enough to meet timeliness requirements.
[0134] 2) Limited dissemination of experience: Since early warning relies on personal work experience, relevant experience and knowledge are difficult to replicate and apply on a large scale.
[0135] 3) Data analysis becomes increasingly difficult: With the explosive growth of data volume and the rapid expansion of data dimensions, manual processing and analysis of data are becoming increasingly difficult.
[0136] In view of this, if Figure 8As shown, the present invention proposes a method for predicting drilling lost circulation accidents. By improving simulated annealing to find the optimal parameters of the BP neural network, a more accurate lost circulation prediction model is obtained. The method of the present invention can be implemented as follows:
[0137] Step 1: Obtain the test and validation sets. The drilling data used in this paper primarily comes from publicly available data sources, both domestically and internationally. Multiple data sets were collected from daily drilling reports, daily mud reports, and completion reports. Some data indicate lost circulation during drilling, while others indicate normal drilling. Each data set includes multiple characteristics, including lithology, pore size, porosity, pore pressure, fracture pressure, shear stress, gel strength, pump pressure, drill bit speed, and primary fracture direction, as well as information on whether lost circulation occurred in that data set.
[0138] This article uses K-fold cross-validation to split the test and validation sets. K can be customized, typically around 5 to 10, and the value of K is evaluated based on the actual amount of data collected. First, K groups are obtained through K-fold cross-validation. Typically, VerifySize groups (VerifySize can be customized, typically 2) are randomly selected as the validation set, and the remaining K-VerifySize groups are used as the test set.
[0139] Step 2: Update the BP network topology. This step mainly does two things: reset the simulated annealing parameters and update the BP network topology.
[0140] First, reset the parameters related to simulated annealing, including resetting the current temperature NowTemp to MaxTemp, resetting the number of inner loop iterations to 0, and so on.
[0141] The following is to determine the BP neural network topology. For each set of drilling data, the data features are 10 features, including lithology, pore size, porosity, pore pressure, fracture pressure, shear stress, gel strength, pump pressure, drill bit speed, and primary fracture direction. In other words, there are 10 input variables and 1 output variable, namely whether to send a well leakage accident. In other words, the BP neural network has 10 input layers and 1 output layer. This paper uses a three-layer BP neural network with a Sigmoid function as the activation function. There is an approximate relationship between the number of hidden layer neural networks n2 and the number of input layer neurons n1. Refer to the following formula:
[0142] n2=2*n1+1
[0143] Therefore, the BP neural network topology has 10 input layers, 21 hidden layers, and 1 output layer. At this time, the weight parameters w to be optimized are 10*21+21*1=231, and the threshold parameters b to be optimized are 21+1=22. That is, the optimization variables of simulated annealing search are 231+22=253.
[0144] The first time step 2 is executed, the network topology is 10-21-1. Each subsequent time step 2 is executed, the number of hidden layers, n2, is randomly adjusted. The adjustment formula is as follows, where R(1,5) represents a random integer value in the range [1,5]. This means that a certain number of neural network units are added each time, thereby improving the prediction accuracy of the BP neural network.
[0145] n2=n2+R(1,5)
[0146] Step 3: Randomly generate new parameters. Assuming the current BP neural network topology has 10 input layers, n² hidden layers, and 1 output layer, the total number of weight parameters w to be optimized is 10*n²+n²*1, and the total number of threshold parameters b to be optimized is n²+1. Generally speaking, the weight w and threshold b values are both in the range [-1, 1], but can be flexibly adjusted based on actual conditions.
[0147] If step 3 is executed for the first time (CurrPara has not yet completed initialization), the following formula is used to randomly generate and complete the initialization, where R(-1,1) represents a random floating point number in the range [-1,1].
[0148] w i =R(-1,1),1≤i≤10*n2+n2*1
[0149] b i =R(-1,1),1≤i≤n2+1
[0150]
[0151] If step 3 is executed for the second or subsequent times, NewPara is generated based on CurrPara, and the following formula is applied to each parameter to complete the generation of new variables. Where normal(0,1) represents a normal distribution with a mean of 0 and a standard deviation of 1. The resulting random numbers follow a normal distribution, thus ensuring search fairness.
[0152] NewPara i =CurrPara i +normal(0,1)
[0153] NewPara i =min(1,NewPara i )
[0154] NewPara i =max(-1,NewPara i )
[0155] Finally, the initialization of the parameter NewPara is completed, and go to step 4.
[0156] Step 4: Initialize the BP neural network parameters. In Step 1, the test set was obtained; in Step 2, the BP neural network topology was determined; and in Step 3, the neural network weights w and thresholds b were obtained. Using the test set data, a BP neural network model for lost circulation prediction was obtained through training.
[0157] Step 5: Calculate the F1 score based on the BP neural network. Traverse each array group in the test set, input it into the BP neural network model, obtain the predicted results, and then compare them with the actual results. This article uses the commonly used F1 score as the fitness function for evaluation. The F1 score is between [0, 1]. The larger the score, the better the model performance. The calculation formula is as follows:
[0158]
[0159] True Positives represents the number of samples correctly predicted by the model as positive; False Positives represents the number of samples incorrectly predicted by the model as positive, but actually negative; and False Negatives represents the number of samples incorrectly predicted by the model as negative, but actually positive. Positives are predicted as leaks, while negatives are predicted as normal operations.
[0160] In general, the current test set is used as the benchmark, the current NewPara is used as the input, and the F1 score of the output result is calculated. NewPara , which is the fitness function value.
[0161] Step 6: The new parameters are better than the current parameters. If F1 NewPara >F1 BestPara , it means that the NewPara network model performs better, go to step 7, otherwise go to step 8. Note that BestPara here is the parameter with the best performance of the BP network model so far.
[0162] Step 7: Receive new parameters. This means that better performing parameters have been found. Choose to update BestPara, F1 BestPara , CurrPara and F1 CurrPara . Refer to the following formula.
[0163] BestPara=NewPara
[0164] F1 BestPara =F1 NewPara
[0165] CurrPara=NewPara
[0166] F1 CurrPara = F1 NewPara
[0167] Step 8: Meet the acceptance probability (i.e., the reception probability). That is, the parameter variable NewPara found this time performs worse than expected. At this time, it is selected to accept NewPara with a certain probability. The probability formula is as follows, where NowTemp represents the current temperature and gradually decreases.
[0168]
[0169] Then calculate a random probability randomProb in the range [0, 1]. If acceptBadProb (i.e., the reception probability) is greater than randomProb, go to Step 9; otherwise, go to Step 10.
[0170] Here is an explanation of why this is done: In order to avoid getting stuck in local optima, the simulated annealing algorithm uses a certain random probability to jump out of the current search range. This is the reason for accepting worse parameters with a certain probability, and the calculation of this probability is related to the current temperature NowTemp.
[0171] Step 9: Accept the new parameter according to the probability. At this time, select to update CurrPara and F1 CurrPara , referring to the following formula.
[0172] CurrPara = NewPara
[0173] F1 CurrPara = F '1 NewPara
[0174] Step 10: Meet the iteration upper limit. Steps 3 to 9 are the innermost loop. Each time it is executed, the iteration count is incremented by one. If the iteration count exceeds the maximum value MaxIterCnt (which can be customized, default is 100), go to Step 11; otherwise, go to Step 3. <|0000414|>
[0175] Step 11: Decrease the temperature. After the innermost loop is executed, temperature decay is performed. NowTemp represents the current temperature, initialized to MaxTemp (which can be customized, default is 100), and the minimum value is MinTemp (which can be customized, and MinTemp < MaxTemp, default is |). The decay formula is as follows:
[0176] NowTemp = DecayRate * NowTemp
[0177] Where DecayRate represents the decay rate, and its value range is [0, 1), which can be customized, default is |).
[0178] Step 12: Reach the lower temperature limit. Steps 3 to 11 are the loops of the intermediate layer. Each time it is executed, the temperature decays once. When NowTemp ≤ MinTemp, that is, the current temperature has reached the lower temperature limit, it means that the optimal parameter values have been found. At this time, the entire simulated annealing search process ends, go to Step 13, otherwise go to Step 3.
[0179] Step 13: Find the optimal BP neural network parameters. When reaching this step, that is, the entire simulated annealing process is completed, indicating that the optimal parameters BestPara have been obtained.
[0180]
[0181] Step 14: Initialize the BP neural network parameters. In Step 1, the validation set is obtained. In Step 2, the structure of the BP network topology is clarified. In Step 13, the optimal parameters BestPara are obtained, that is, the neural network weights w and thresholds b have been adjusted to the optimal. Facing the validation set data, the BP neural network model for lost circulation prediction is obtained through training.
[0182] Step 15: Calculate the classification accuracy based on the BP neural network. At this time, the optimal BP neural network model for lost circulation prediction has been obtained. Traverse each array group in the validation set, input it into the BP neural network model, obtain the prediction results, and then compare them with the real results. Finally, calculate the F1 score F1 Verify 。
[0183] It should be noted that the F1 score is calculated based on the test set in Step 5, but here the F1 score is calculated based on the validation set.
[0184] Step 16: The classification accuracy meets the requirements. Steps 2 to 16 are the outermost loop. Whenever a BP neural network model for lost circulation prediction that meets the expectations is not found, it will start over. Only when the expected model is found will the entire process end. TargetF1 is a value in [0, 1], which can be customized. The default value is 0.9 and is used to determine the optimal model. The logic is as follows:
[0185] If F1 Verify ≥ TargetF1, it means that the verification result meets the expectations, that is, the BP neural network model for lost circulation prediction meets the expectations. At this time, go to Step 17 and the entire process ends.
[0186] If F1 Verify < TargetF1, it means that the verification result does not meet the expectations and there is still room for optimization in the BP neural network model for lost circulation prediction. At this time, go to Step 2, reset the relevant parameters of the simulated annealing, update the BP neural network topology structure, re-find the optimal parameters, and the entire process starts over.
[0187] Step 17: Find the optimal BP neural network model. This step indicates that the lost circulation prediction BP neural network model meets expectations, and the entire process is complete.
[0188] In summary, the present invention proposes a method for predicting lost circulation accidents in drilling. By improving simulated annealing to find the optimal parameters of the BP neural network, a more accurate lost circulation prediction model is obtained. Compared with the existing technology, the present invention has at least the following beneficial effects:
[0189] 1) A lost circulation prediction method based on BP neural network was proposed. Relying on BP neural network, the intelligent level of accident warning was significantly enhanced.
[0190] 2) A method based on improved simulated annealing to search for the optimal parameters of the BP neural network was proposed, which automated the network parameter adjustment process and improved the accuracy of the early warning.
[0191] 3) A dual-track verification process of test set and validation set is proposed, which strengthens the support for multi-dimensional expansion of input data and ensures the applicability and generalization ability of the BP neural network model.
[0192] On the other hand, Figure 9 As shown, an embodiment of the present invention provides a drilling lost circulation accident prediction device 900, which may include:
[0193] The first module 901 is used to obtain drilling data and segment the drilling data into a test set and a validation set; the test set and the validation set both include multiple sets of drilling feature data and whether a drilling loss accident has occurred in each set of data;
[0194] The second module 902 is used to initialize the topology of the BP network and randomly generate network parameters corresponding to the topology;
[0195] The third module 903 is used to apply the network parameters to the BP network, and then train the BP network using the test set to obtain a first network;
[0196] The fourth module 904 is configured to evaluate the training results of the test set to obtain an F1 score of the first network. When the F1 score is greater than a score threshold, the F1 score is used as the score threshold and the historical score for the next round, and the network parameters are used as the optimal parameters and historical parameters. Otherwise, based on the F1 score and the historical score for the previous round, combined with a preset temperature, the acceptance probability of the network parameters is determined. When the acceptance probability meets a preset condition, the F1 score is used as the historical score for the next round, and the network parameters are used as the historical parameters.
[0197] The fifth module 905 is configured to increase the number of iterations by 1, perform a first update on the historical parameters, use the result of the first update as the network parameter, and return to execute the third module until the number of iterations reaches a threshold;
[0198] The sixth module 906 is configured to perform attenuation processing on the preset temperature, set the number of iterations to 0, and return to executing the third module until the preset temperature reaches the temperature threshold;
[0199] The seventh module 907 is used to apply the optimal parameters to the BP network, and then train the BP network using the validation set to obtain a second network;
[0200] The eighth module 908 is used to evaluate the training results of the validation set to obtain the target F1 score of the second network. When the target F1 score does not meet the expected conditions, the topology structure of the BP network is updated for the second time, the result of the second update is used as the topology structure of the BP network, the preset temperature is reset, and the step of randomly generating network parameters for the corresponding topology structure in the second module is returned to execute until the target F1 score meets the expected conditions, and the second network is applied to the prediction of well leakage accidents.
[0201] The contents of the method embodiments of the present invention are all applicable to the device embodiments. The functions specifically implemented by the device embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.
[0202] In another aspect, an embodiment of the present invention further provides an electronic device comprising a memory and a processor. The memory stores a computer program, and the processor implements the above-described method for predicting the bottom boundary of the hydrate stability region when executing the computer program. The electronic device can be any smart terminal, including a tablet computer and an in-vehicle computer.
[0203] It can be understood that the contents of the above method embodiments are applicable to the present device embodiments, the functions specifically implemented by the present device embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.
[0204] like Figure 10 As shown, Figure 10 The hardware structure of an electronic device 1000 according to another embodiment is shown. The electronic device 1000 includes:
[0205] The processor 1001 may be implemented as a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is configured to execute relevant programs to implement the technical solutions provided by the embodiments of the present invention.
[0206] The memory 1002 can be implemented in the form of a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 1002 can store an operating system and other application programs. When the technical solutions provided in the embodiments of this specification are implemented through software or firmware, the relevant program code is stored in the memory 1002 and is called by the processor 1001 to execute the network node population optimization method of the embodiment of the present invention.
[0207] Input / output interface 1003, used to implement information input and output;
[0208] Communication interface 1004, used to implement communication interaction between this device and other devices, which can be achieved through wired means (such as USB, network cable, etc.) or wireless means (such as mobile network, WiFi, Bluetooth, etc.);
[0209] Bus 1005 , which transmits information between various components of the device (e.g., processor 1001 , memory 1002 , input / output interface 1003 , and communication interface 1004 );
[0210] The processor 1001 , the memory 1002 , the input / output interface 1003 and the communication interface 1004 are connected to each other in communication within the device via the bus 1005 .
[0211] The electronic device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, i.e., they may be located in one location or distributed across multiple network units. Some or all of these modules may be selected based on actual needs to achieve the objectives of this embodiment.
[0212] The contents of the method embodiments of the present invention are all applicable to the electronic device embodiments. The functions specifically implemented by the electronic device embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.
[0213] Another aspect of an embodiment of the present invention further provides a computer-readable storage medium, wherein the storage medium stores a program, and the program is executed by a processor to implement the above method.
[0214] It should be noted that the computer-readable medium shown in the embodiments of the present invention may be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or component, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a flash memory, an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present invention, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, device, or component. In the present invention, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, which carries computer-readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer-readable medium may be transmitted using any suitable medium, including but not limited to wireless, wired, or any suitable combination thereof.
[0215] The contents of the method embodiments of the present invention are all applicable to the computer-readable storage medium embodiments. The functions specifically implemented by the computer-readable storage medium embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.
[0216] The present invention also discloses a computer program product or computer program, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device can read the computer instructions from the computer-readable storage medium and execute the computer instructions, causing the computer device to perform the above method.
[0217] The flowcharts and block diagrams in the accompanying drawings illustrate the possible implementation architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present invention. In this regard, each box in the flowchart or block diagram can represent a module, program segment, or a part of code, and the above-mentioned module, program segment, or a part of code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in an order different from that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, and the combination of boxes in the block diagram or flowchart, can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0218] It should be noted that although several modules of the device for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to an embodiment of the present invention, the features and functions of two or more modules or units described above can be concretized in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided into multiple modules or units to be concretized.
[0219] Through the description of the above embodiments, it is easy for those skilled in the art to understand that the example embodiments described herein can be implemented by software or by combining software with necessary hardware. Therefore, the technical solution according to the embodiments of the present invention can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD to ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes a number of instructions to enable a computing device (which can be a personal computer, a server, a touch terminal, or a network device, etc.) to execute the method according to the embodiments of the present invention.
[0220] In some optional embodiments, the function / operation mentioned in the block diagram may not occur in the order mentioned in the operation diagram. For example, depending on the function / operation involved, the two boxes shown in succession can actually be executed substantially simultaneously or the boxes can sometimes be executed in reverse order. In addition, the embodiment presented and described in the flow chart of the present invention is provided in an exemplary manner for the purpose of providing a more comprehensive understanding of the technology. The disclosed method is not limited to the operation and logic flow presented by the present invention. Optional embodiments are contemplated in which the order of the various operations is changed and the sub-operations described as a part of a larger operation are performed independently.
[0221] Furthermore, while the present invention has been described in the context of functional modules, it should be understood that, unless otherwise indicated, one or more of the functions and / or features may be integrated into a single physical device and / or software module, or one or more functions and / or features may be implemented in separate physical devices or software modules. It will also be understood that a detailed discussion of the actual implementation of each module is not necessary for understanding the present invention. More specifically, given the properties, functions, and internal relationships of the various functional modules in the devices disclosed in the present invention, the actual implementation of the module will be understood within the ordinary skill of an engineer. Therefore, a person skilled in the art will be able to implement the present invention as set forth in the claims using ordinary skill without undue experimentation. It will also be understood that the specific concepts disclosed are merely illustrative and are not intended to limit the scope of the present invention, which is determined by the full scope of the appended claims and their equivalents.
[0222] If the function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, and other media that can store program code.
[0223] The logic and / or steps represented in the flowcharts or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing the logical functions, and can be embodied in any computer-readable medium for use by, or in conjunction with, an instruction execution apparatus, device, or apparatus (e.g., a computer-based apparatus, a device including a processor, or other apparatus that can fetch instructions from and execute instructions on an instruction execution apparatus, device, or apparatus). For purposes of this specification, a "computer-readable medium" can be any device that can contain, store, communicate, propagate, or transport a program for use by, or in conjunction with, an instruction execution apparatus, device, or apparatus.
[0224] More specific examples (a non-exhaustive list) of computer-readable media include the following: an electrical connection with one or more wires (electronic devices), a portable computer disk cartridge (magnetic devices), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), a fiber optic device, and a portable compact disc read-only memory (CDROM). In addition, the computer-readable medium may even be paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, deciphering, or processing in another suitable manner as necessary, and then stored in a computer memory.
[0225] It should be understood that various parts of the present invention can be implemented using hardware, software, firmware, or a combination thereof. In the above-described embodiments, multiple steps or methods can be implemented using software or firmware stored in a memory and executed by a suitable instruction execution device. For example, if implemented using hardware, as in another embodiment, any one of the following technologies known in the art or a combination thereof can be used: a discrete logic circuit having a logic gate circuit for implementing a logic function on a data signal, an application-specific integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.
[0226] Throughout this specification, reference to terms such as "one embodiment," "some embodiments," "examples," "specific examples," or "some examples" means that a specific feature, structure, material, or characteristic described in conjunction with that embodiment or example is included in at least one embodiment or example of the present invention. In this specification, schematic representations of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.
[0227] While embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions, and variations may be made to the embodiments without departing from the principles and spirit of the invention, and that the scope of the invention is defined by the claims and their equivalents.
[0228] The above is a specific description of the preferred implementation of the present invention, but the present invention is not limited to the embodiments. Those skilled in the art can make various equivalent modifications or substitutions without violating the spirit of the present invention. These equivalent modifications or substitutions are all included in the scope defined by the claims of the present invention.
Claims
1. A method for predicting lost circulation accidents in drilling, characterized in that: The following steps are involved: Drilling data is obtained, and a test set and a validation set are obtained based on the drilling data. The test set and the validation set each include multiple sets of drilling characteristic data and an annotation of whether a drilling loss accident has occurred in each set of drilling characteristic data. Each set of drilling characteristic data includes lithology, pore size, porosity, pore pressure, fracture pressure, shear stress, gel strength, pump pressure, drill bit speed, and primary fracture direction. Initializing the topology of the BP network and randomly generating network parameters corresponding to the topology; Applying the network parameters to the BP network, and then training the BP network using the test set to obtain a first network; Evaluate the training results of the test set to obtain an F1 score of the first network; when the F1 score is greater than a score threshold, use the F1 score as the score threshold and the historical score of the next round, and use the network parameters as the optimal parameters and historical parameters; otherwise, determine the acceptance probability of the network parameters based on the F1 score and the historical score of the previous round in combination with a preset temperature; when the acceptance probability meets a preset condition, use the F1 score as the historical score of the next round, and use the network parameters as the historical parameters; Increasing the number of iterations by 1, performing a first update on the historical parameters, using the result of the first update as the network parameters, and returning to the step of applying the network parameters to the BP network until the number of iterations reaches a threshold; performing a decay process on the preset temperature, setting the number of iterations to 0, and returning to the step of applying the network parameters to the BP network until the preset temperature reaches a temperature threshold; Applying the optimal parameters to the BP network, and then training the BP network using the validation set to obtain a second network; A target F1 score of the second network is obtained by evaluating the training results of the validation set. When the target F1 score does not meet the expected conditions, a second update is performed on the topological structure of the BP network. The result of the second update is used as the topological structure of the BP network. The preset temperature is reset, and the process returns to executing the step of randomly generating network parameters corresponding to the topological structure until the target F1 score meets the expected conditions, and the second network is applied to the prediction of lost circulation accidents.
2. A method for predicting lost circulation accidents in drilling according to claim 1, characterized in that: The BP network includes an input layer, a hidden layer and an output layer; the topological structure of the initialization BP network includes the following steps: Setting the number of input neurons of the input layer of the BP network according to the number of features of the drilling feature data; Based on the input quantity, the number of neurons in the hidden layer of the BP network is set through a preset quantity relationship; wherein the output number of neurons in the output layer is 1.
3. The method for predicting lost circulation in drilling according to claim 1, characterized in that: The BP network includes an input layer, a hidden layer, and an output layer. The topological structure includes the number of input neurons in the input layer, the number of neurons in the hidden layer, and the number of output neurons in the output layer. The network parameters include weight parameters and threshold parameters. The randomly generated network parameters corresponding to the topological structure include the following steps: Determine the weight number of the weight parameter according to the sum of the product of the number of inputs and the number of neurons and the product of the number of neurons and the number of outputs; Determining a threshold value of the threshold parameter according to the sum of the number of neurons and the number of outputs; The weight parameters of the weight quantity and the threshold parameters of the threshold quantity are randomly generated in a preset interval.
4. The method for predicting lost circulation accidents in drilling according to claim 1, characterized in that: The training results of the test set include a lost circulation prediction result for each set of drilling characteristic data in the test set, and the F1 score of the first network is obtained by evaluating the training results of the test set, comprising the following steps: Comparing the lost circulation prediction result and the accident annotation corresponding to each group of the drilling characteristic data in the test set; Obtaining, according to the comparison result, a first number of samples correctly predicted as a positive class, a second number of samples incorrectly predicted as a positive class, and a third number of samples incorrectly predicted as a negative class; wherein the positive class indicates that the lost circulation prediction result is lost circulation, and the negative class indicates that the lost circulation prediction result is not lost circulation; The F1 score of the first network is calculated based on the first number of samples, the second number of samples, and the third number of samples.
5. The method for predicting lost circulation in drilling according to claim 1, characterized in that: Determining the reception probability of the network parameters based on the F1 score and the historical score of the previous round in combination with a preset temperature includes the following steps: Obtaining an index parameter according to a ratio of a difference between the historical score and the F1 score of the previous round and the preset temperature; The natural constant is used as a base, the exponential parameter is used as an exponent, and an exponential operation is performed based on the base and the exponent to obtain the reception probability of the network parameter.
6. A method for predicting lost circulation accidents in drilling according to claim 1, characterized in that: The first updating of the historical parameters comprises the following steps: Assign and update the value of each parameter in the historical parameters using a normally distributed random number; The assignment update representation updates the corresponding parameter value by summing the parameter value and the random number; When the result of the assignment update is greater than a first extreme value, the corresponding parameter value is replaced with the first extreme value; When the result of the assignment update is less than the second extreme value, the corresponding parameter value is replaced with the second extreme value.
7. The method for predicting lost circulation accidents in drilling according to claim 1, characterized in that: The BP network includes an input layer, a hidden layer, and an output layer; and the second updating of the topological structure of the BP network includes the following steps: The number of neurons in the hidden layer is increased and adjusted by using integer random values within a preset range.
8. A drilling lost circulation accident prediction device, characterized in that: include: The first module is used to obtain drilling data and segment the drilling data into a test set and a validation set; the test set and the validation set each include multiple sets of drilling characteristic data and an annotation of whether a drilling loss accident has occurred in each set of drilling characteristic data; each set of drilling characteristic data includes lithology, pore size, porosity, pore pressure, fracture pressure, shear stress, gel strength, pump pressure, drill bit speed, and primary fracture direction; The second module is used to initialize the topology structure of the BP network and randomly generate network parameters corresponding to the topology structure; A third module is configured to apply the network parameters to the BP network, and then train the BP network using the test set to obtain a first network; A fourth module is configured to obtain an F1 score of the first network based on the training result of the test set; when the F1 score is greater than a score threshold, use the F1 score as the score threshold and the historical score of the next round, and use the network parameters as the optimal parameters and historical parameters; otherwise, determine the acceptance probability of the network parameters based on the F1 score and the historical score of the previous round in combination with a preset temperature; when the acceptance probability meets a preset condition, use the F1 score as the historical score of the next round, and use the network parameters as the historical parameters; A fifth module is configured to increase the number of iterations by 1, perform a first update on the historical parameters, use the result of the first update as the network parameter, and return to execute the third module until the number of iterations reaches a threshold; a sixth module, configured to perform attenuation processing on the preset temperature, set the number of iterations to 0, and return to executing the third module until the preset temperature reaches a temperature threshold; A seventh module is configured to apply the optimal parameters to the BP network, and then train the BP network using the validation set to obtain a second network; The eighth module is used to evaluate the training results of the validation set to obtain the target F1 score of the second network. When the target F1 score does not meet the expected conditions, the topology structure of the BP network is updated for a second time, the result of the second update is used as the topology structure of the BP network, the preset temperature is reset, and the step of randomly generating network parameters corresponding to the topology structure in the second module is returned to be executed until the target F1 score meets the expected conditions, and the second network is applied to the prediction of well leakage accidents.
9. An electronic device, characterized in that: including a processor and a memory; The memory is used to store programs; The processor executes the program to implement the method according to any one of claims 1 to 7.
10. A computer storage medium storing a program executable by a processor, characterized in that: The program executable by the processor is used to implement the method according to any one of claims 1 to 7 when executed by the processor.
Citation Information
Patent Citations
Well drilling accident early warning method and device, electronic equipment and storage medium
CN118981637A
Hybrid neural network for drilling anomaly detection
US20230082520A1