Ocean drilling mud proportion prediction method, device, equipment and medium
The weed population optimization algorithm is used to initialize the neural network topology and parameters, and combine normal distribution to generate the next generation of individuals, solving the problems of low accuracy and poor adaptability in mud ratio prediction in the prediction of mud ratio, and achieving efficient and reliable mud ratio prediction, suitable for different drilling environments.
Patent Information
- Application Number
- CN202510434447.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-08
- Publication Date
- 2025-08-15
AI Technical Summary
The existing neural network model has experience in parameter initialization dependence in mud ratio prediction, which leads to slow convergence speed or local optimality, insufficient adaptability, and difficulty in dealing with complex and variable formation conditions and real-time drilling parameters, resulting in poor prediction accuracy.
The weed population optimization algorithm is used to initialize the neural network topology and parameters. Through iterative optimization of the test set and verification set, the next generation of individuals are generated by combining normal distribution, dynamically adjusting the search range, improving parameter search efficiency and global optimization capabilities, avoiding the sensitivity of traditional gradient descent methods, and enhancing the model's adaptability to complex drilling feature data.
It significantly improves the accuracy and generalization ability of mud ratio prediction, realizes real-time and accurate ratio recommendations, reduces manual experience dependence, reduces drilling risks, and is suitable for different drilling environments such as land and ocean.
Smart Images

Figure CN120494148A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data prediction, and in particular to a method, device, equipment and medium for predicting ocean drilling mud ratio. Background Art
[0002] In oil and gas drilling, mud mix is a critical factor in ensuring safe and efficient drilling operations. A suitable mud mix effectively controls wellbore stability, lubricates the drill bit, carries cuttings, and balances formation pressure. Traditional mud mix design relies primarily on engineers' experience and laboratory testing. This approach is not only time-consuming but also struggles to adapt to complex and changing formation conditions and real-time drilling parameter changes.
[0003] In recent years, with the development of artificial intelligence technology, machine learning methods such as neural networks have been introduced into mud ratio prediction. However, existing neural network models still have the following problems in terms of prediction accuracy and generalization ability: Parameter initialization relies on experience: The topology and initial parameter settings of the neural network usually rely on manual experience or random initialization, which may cause the model to converge slowly or fall into a local optimum. Insufficient adaptability: Existing methods find it difficult to dynamically adjust model parameters to adapt to the distribution changes of different drilling characteristic data (such as formation lithology, drilling pressure, rotation speed, etc.). The related problems of existing technologies lead to poor prediction accuracy. Summary of the Invention
[0004] The present invention aims to at least partially address the limitations of the related art. To this end, the present invention provides a method, apparatus, device, and medium for accurately predicting the proportion of ocean drilling mud.
[0005] In one aspect, an embodiment of the present invention provides a method for predicting ocean drilling mud ratio, comprising the following steps:
[0006] Obtain drilling feature data and then divide it into a test set and a validation set; the drilling feature data is marked with mud ratio parameters;
[0007] Initialize the topology of the neural network; the neural network includes input layer, hidden layer and output layer, and the topology includes the number of neurons in each layer;
[0008] Initialize multiple sets of network parameters to construct a weed population; each weed individual in the weed population corresponds to a set of network parameters;
[0009] Based on the test set and neural network, the prediction error of each weed individual in the weed population is analyzed to obtain the prediction error of each weed individual, and the weed individual with the smallest prediction error is selected as the candidate individual;
[0010] When the prediction error of the candidate individual is less than the error threshold, the candidate individual is taken as the target individual; otherwise,
[0011] Generate the next generation of weed individuals based on each weed individual combined with a normal distributed random number, and add the next generation of weed individuals to the weed population; the standard deviation of the normal distribution is associated with the distribution range of the prediction error;
[0012] Increasing the first iteration number, if the first iteration number is greater than the first iteration threshold, taking the candidate individual as the target individual, otherwise, returning to the step of performing prediction error analysis on each weed individual in the weed population based on the test set and the neural network until the first iteration number is greater than the first iteration threshold;
[0013] Based on the target individual, the validation set is used to optimize the neural network to obtain the target prediction model;
[0014] The target prediction model is used to predict the mud ratio based on actual drilling data.
[0015] Optionally, initializing the topology of the neural network includes the following steps:
[0016] Initialize the number of neurons in the input layer and the number of neurons in the output layer based on the input dimension corresponding to the drilling characteristic data and the output dimension preset by the mud ratio prediction;
[0017] According to the number of neurons in the input layer, the number of neurons in the hidden layer is initialized using a preset numerical relationship.
[0018] Optionally, the network parameters include weight parameters and threshold parameters; initializing multiple sets of network parameters to construct weed populations includes the following steps:
[0019] Determining a first number of weight parameters based on a product of the sum of the number of neurons in the input layer and the number of neurons in the output layer and the number of neurons in the hidden layer;
[0020] Determining a second number of threshold parameters based on the sum of the number of neurons in the hidden layer and the number of neurons in the output layer;
[0021] Randomly generating a first number of weight parameters based on a preset weight interval, and randomly generating a second number of threshold parameters based on a preset threshold interval, thereby obtaining a weed individual;
[0022] The number of generated individuals is increased by one, and the process returns to the step of randomly generating a first number of weight parameters based on a preset weight interval until the number of generated individuals reaches a preset number, and a weed population is constructed based on the preset number of weed individuals.
[0023] Optionally, before the step of generating the next generation of weed individuals based on each weed individual in combination with a normally distributed random number, the method further comprises the following steps:
[0024] When the number of individuals in the weed population exceeds a preset number, all weed individuals are sorted in ascending order based on the prediction error to obtain an individual sequence;
[0025] The preset number of weed individuals in the first column of the individual sequence is used as the reserved individual set; the preset number is the initialization number of the weed population;
[0026] Update the weed population based on the set of retained individuals.
[0027] Optionally, based on the test set and the neural network, performing a prediction error analysis on each weed individual in the weed population to obtain a prediction error for each weed individual includes the following steps:
[0028] Traverse each weed individual in the weed population one by one, and use the traversed weed individuals as predicted individuals;
[0029] Apply the network parameters corresponding to the predicted individuals to the neural network to build a prediction training model;
[0030] The drilling characteristic data of each sample in the test set is input into the prediction training model to obtain the mud prediction results corresponding to each sample;
[0031] The training error is constructed based on the mud ratio parameters and mud prediction results corresponding to each sample in the test set as the prediction error of the prediction individual.
[0032] Optionally, the standard deviation of the normal distribution application is also associated with the iteration progress of the current weed population; generating the next generation of weed individuals based on each weed individual in combination with a random number from the normal distribution, and adding the next generation of weed individuals to the weed population, including the following steps:
[0033] The maximum error and minimum error in the current weed population are obtained based on the prediction error of each weed individual;
[0034] The distribution range parameter of the prediction error of the current weed population is obtained based on the difference between the maximum error and the minimum error;
[0035] Obtaining an iteration progress parameter of the current weed population based on a ratio of a difference between a first iteration threshold and a first iteration number corresponding to the current weed population and the first iteration threshold;
[0036] The search range parameter is constructed based on the iterative progress parameter combined with the preset maximum error rate, minimum error rate, and nonlinear adjustment factor. The expression of the search range parameter is:
[0037]
[0038] Wherein, sigma represents the search range parameter; MinErrorRate represents the minimum error rate; e is a natural constant; maxGenCnt represents the first iteration threshold; iterCnt represents the current first iteration number; nonlinearFactor represents the nonlinear adjustment factor; MaxErrorRate represents the maximum error rate;
[0039] Traverse each weed individual in the weed population one by one, and use the traversed weed individuals as the weed parent individuals;
[0040] The relative error value of the weed parent individual is obtained based on the ratio of the difference between the prediction error and the minimum error of the weed parent individual to the difference between the maximum error and the minimum error;
[0041] The number of seeds of the parent weed individual is obtained based on the relative error value combined with the preset maximum and minimum population numbers. The expression of the seed number is:
[0042]
[0043] Where seedNum i Indicates the search range parameter; minSeedNum indicates the minimum population number; curError i Indicates the prediction error of the weed parent individual; minError iter Indicates the minimum error; maxError iter Indicates the maximum error; nonlinearFactor indicates the nonlinear adjustment factor; maxSeedNum indicates the maximum population number;
[0044] Using the search range parameter as the standard deviation, the update random number is randomly generated based on the preset normal distribution;
[0045] The network parameters of the weed parent individual are updated based on the updated random number to obtain the next generation of weed individuals of the weed parent individual;
[0046] Return to execute the step of randomly generating and updating random numbers based on a preset normal distribution until the number of next-generation weed individuals of the weed parent individual reaches the number of seeds;
[0047] All next generation weed individuals of each weed parent individual are added to the weed population.
[0048] Optionally, based on the target individual, a target prediction model is obtained by optimizing the neural network using a validation set, including the following steps:
[0049] Based on the validation set and neural network, the validation error analysis is performed on the target individual to obtain the validation error;
[0050] When the verification error is less than the error threshold, the target individual is applied to the neural network to obtain the target prediction model. Otherwise,
[0051] The second iteration number is increased, the number of neurons in the hidden layer is randomly updated based on a preset interval range, and the step of initializing multiple sets of network parameters to construct a weed population is returned to execute until the second iteration number is greater than the second iteration threshold, and the target individual is applied to the neural network to obtain the target prediction model.
[0052] On the other hand, an embodiment of the present invention provides an ocean drilling mud ratio prediction device, comprising:
[0053] The first module is used to obtain drilling feature data and then divide it into a test set and a validation set; the drilling feature data is marked with mud ratio parameters;
[0054] The second module is used to initialize the topology of the neural network; the neural network includes an input layer, a hidden layer, and an output layer, and the topology includes the number of neurons in each layer;
[0055] The third module is used to initialize multiple sets of network parameters to construct a weed population; each weed individual in the weed population corresponds to a set of network parameters;
[0056] The fourth module is used to perform prediction error analysis on each weed individual in the weed population based on the test set and the neural network, obtain the prediction error of each weed individual, and select the weed individual with the smallest prediction error as a candidate individual;
[0057] The fifth module is configured to select the candidate individual as the target individual when the prediction error of the candidate individual is less than the error threshold; otherwise, execute the steps of the sixth module;
[0058] The sixth module is used to generate the next generation of weed individuals based on each weed individual combined with a normal distributed random number, and add the next generation of weed individuals to the weed population; the standard deviation of the normal distribution is associated with the distribution range of the prediction error;
[0059] The seventh module is configured to increment the first iteration number. If the first iteration number is greater than a first iteration threshold, the candidate individual is selected as the target individual. Otherwise, the steps of the fourth module are returned to be executed until the first iteration number is greater than the first iteration threshold.
[0060] The eighth module is used to optimize the neural network based on the target individual and use the validation set to obtain the target prediction model;
[0061] The ninth module is used to predict the mud ratio based on actual drilling data using the target prediction model.
[0062] Optionally, the apparatus further includes a tenth module configured to perform the following operations:
[0063] When the number of individuals in the weed population exceeds a preset number, all weed individuals are sorted in ascending order based on the prediction error to obtain an individual sequence;
[0064] The preset number of weed individuals in the first column of the individual sequence is used as the reserved individual set; the preset number is the initialization number of the weed population;
[0065] Update the weed population based on the set of retained individuals.
[0066] 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 ocean drilling mud ratio prediction method.
[0067] 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 the ratio of ocean drilling mud.
[0068] The embodiment of the present invention obtains drilling characteristic data and then divides it into a test set and a validation set; the drilling characteristic data is marked with mud ratio parameters; the topological structure of the neural network is initialized; the neural network includes an input layer, a hidden layer and an output layer, and the topological structure includes the number of neurons in each layer; multiple groups of network parameters are initialized to construct a weed population; each weed individual in the weed population corresponds to a group of network parameters; based on the test set and the neural network, a prediction error analysis is performed on each weed individual in the weed population to obtain a prediction error for each weed individual, and the weed individual with the smallest prediction error is selected as a candidate individual; when the prediction error of the candidate individual is less than an error threshold, the candidate individual is selected as a target individual. Individual; otherwise, based on each weed individual and a random number from a normal distribution, the next generation of weed individuals is generated, and the next generation of weed individuals is added to the weed population; the standard deviation of the normal distribution application is associated with the distribution range of the prediction error; the first iteration number is increased, and if the first iteration number is greater than the first iteration threshold, the candidate individual is used as the target individual, otherwise, the step of performing prediction error analysis on each weed individual in the weed population based on the test set and the neural network is returned to execution until the first iteration number is greater than the first iteration threshold; based on the target individual, the neural network is optimized using the validation set to obtain a target prediction model; the target prediction model is used to predict the mud ratio based on actual drilling data. The present invention constructs a weed population by initializing multiple sets of network parameters and dynamically generates the next generation of individuals based on the prediction error, thereby avoiding the sensitivity of the traditional gradient descent method to the initial value, significantly improving the parameter search efficiency and global optimization capability, and by associating the standard deviation of the normal distribution with the prediction error, the algorithm can adaptively adjust the search range, quickly approach the optimal solution in the early stage of iteration, and fine-tune the parameters in the later stage, taking into account both convergence speed and accuracy. At the same time, the present invention ensures that the model achieves optimal performance while avoiding overfitting by dividing the test set and the validation set, and combining the dual iteration termination conditions (error threshold and iteration number threshold). In addition, the present invention utilizes the diversity mechanism of the weed population (such as randomly generating the next generation of individuals) to enhance the adaptability of the model to complex drilling characteristic data and improve the generalization ability. In addition, the present invention directly associates the drilling characteristic data (such as formation parameters, drilling rig conditions) with the mud ratio parameters, and realizes real-time and accurate ratio recommendations through the target prediction model, reducing dependence on manual experience and reducing drilling risks. Finally, the present invention further ensures the reliability of the model in actual scenarios through the independent optimization steps of the validation set, and can be widely used in different drilling environments such as land and sea. The present invention solves the problems of low precision and poor adaptability in traditional mud ratio prediction through the deep integration of intelligent optimization algorithms and neural networks, and provides efficient and reliable technical support for drilling projects. BRIEF DESCRIPTION OF THE DRAWINGS
[0069] 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.
[0070] Figure 1 This is a schematic diagram of an implementation environment for a method for predicting ocean drilling mud ratios provided by an embodiment of the present invention;
[0071] Figure 2 This is a flow chart of a method for predicting ocean drilling mud ratios provided by an embodiment of the present invention;
[0072] Figure 3 A schematic diagram of the expanded flow of step S200 provided in an embodiment of the present invention;
[0073] Figure 4 A schematic diagram of the expanded flow of step S300 provided in an embodiment of the present invention;
[0074] Figure 5 A schematic diagram of the expanded flow of prediction error analysis provided by an embodiment of the present invention;
[0075] Figure 6 A schematic diagram of an expanded flow chart of a method for predicting ocean drilling mud ratios provided by an embodiment of the present invention;
[0076] Figure 7 A schematic diagram of the expanded flow of step S800 provided in an embodiment of the present invention;
[0077] Figure 8 A schematic diagram of the overall process of a method for predicting ocean drilling mud ratios provided by an embodiment of the present invention;
[0078] Figure 9 A schematic diagram of the structure of an ocean drilling mud ratio prediction device provided by an embodiment of the present invention;
[0079] Figure 10 A schematic structural diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0080] 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.
[0081] 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.
[0082] 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.
[0083] To facilitate understanding of the technical solution of the present invention, the following technical terms that may appear in the technical solution of the present invention are first explained:
[0084] Ocean drilling: This involves drilling deep into the ocean floor to obtain core samples from the Earth's crust and upper mantle to study its internal structure and geological processes. This process involves using specialized drilling equipment and vessels, such as ocean drilling vessels, to drill thousands of meters below the seafloor. This process not only helps scientists understand the Earth's internal structure but also reveals important geological phenomena such as its historical evolution and plate tectonics. For example, analyzing the sediments and rock composition in the cores can reveal historical information about climate change, biological succession, and other historical phenomena.
[0085] Drilling fluid: It can be called the "blood" of drilling operations, and is also called drilling flushing fluid. According to its different components, it can be roughly divided into types such as clean water, mud, clay-free flushing fluid, emulsion, foam and compressed air. In today's drilling engineering field, drilling fluid is playing an increasingly critical role. The effective solution to many complex problems often depends on the reasonable adjustment of the drilling fluid system or the precise optimization of its performance. Mud ratio is the basic form of drilling fluid ratio, and the two show a progressive relationship in terms of material selection, functional planning and dynamic regulation. In actual engineering projects, mud is usually determined as the core component of drilling fluid based on specific geological conditions, and then other functional additives are added to build a complete drilling fluid system.
[0086] Mud mix proportioning is a critical task requiring comprehensive consideration of multiple factors. Determining the mud mix proportion requires comprehensive weighing of various factors. Geological conditions are the primary consideration, as mud performance requirements vary significantly across different strata. Groundwater conditions are also crucial, as factors such as water levels and flow rates can affect mud stability. Furthermore, the characteristics and requirements of the construction process also influence the mud mix proportion. Mud components primarily include water, bentonite, and additives. Water is the primary carrier for mud, and its quality influences its performance. Bentonite, with its excellent suspending and thixotropic properties, effectively increases mud viscosity and wall protection. There are many types of additives, each with its own distinct functions. For example, soda ash improves bentonite dispersion and increases mud slurry yield; carbon methylcellulose (CMC) enhances mud viscosity and shear strength, preventing loss of fluid. Common mud mix proportioning methods are based on experience gained from previous projects, combined with the specific geological conditions of the current situation. Initially, the composition ratio is determined, and then the final composition is finalized through extensive testing. The present invention proposes a mud composition ratio method based on BP neural network. By analyzing a large amount of data and predicting the mud ratio composition based on machine learning method, the mud ratio efficiency can be improved.
[0087] 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.
[0088] 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. In summary, for 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 a swarm intelligence method to find the optimal weight w and threshold b, thereby improving the prediction accuracy of BP neural network.
[0089] 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.
[0090] It is understandable that the ocean drilling mud ratio prediction method provided in the 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.
[0091] To facilitate understanding of the technical solutions of the present invention, the following are first explained regarding the technical features that may appear in the embodiments of the present invention:
[0092] like Figure 1 FIG. 1 is a schematic diagram of an implementation environment provided by an embodiment of the present 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.
[0093] 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.
[0094] 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.
[0095] 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.
[0096] Based on the example Figure 1In the implementation environment shown, an embodiment of the present invention provides a method for predicting the ratio of ocean drilling mud. The following is explained using the example of the method being applied to the server 101. It can be understood that the method can also be applied to the terminal 102.
[0097] Reference Figure 2 , Figure 2 The flow chart of the ocean drilling mud ratio prediction method applied to the server provided in the embodiment of the present invention is provided. The execution subject of the ocean drilling mud ratio prediction method can be any of the aforementioned computer devices (including servers or terminals). Figure 2 , the method comprises the following steps:
[0098] S100, obtaining drilling feature data, and then dividing it into a test set and a validation set;
[0099] Among them, the drilling characteristic data are marked with mud ratio parameters;
[0100] Exemplarily, in some specific embodiments, the data used in the present invention mainly comes from public data at home and abroad (including characteristic vectors (i.e., drilling characteristic data) and their corresponding mud ratio parameters). The characteristic vector of each set of data includes two parts: geological information and drilling information. For example, the geological information may include parameters such as rock type, formation porosity, density, permeability, gas content, water content, formation pressure, pH, etc., and the drilling information may include parameters such as well depth, well diameter, drilling pressure, footage, pump pressure, pump displacement, standpipe pressure, and casing pressure.
[0101] S200, initializing the topological structure of the neural network;
[0102] Among them, the neural network includes input layer, hidden layer and output layer, and the topology includes the number of neurons in each layer;
[0103] It should be noted that, in some embodiments, Figure 3 As shown, step S200 may include the following steps: S201, based on the input dimension corresponding to the drilling characteristic data and the preset output dimension of the mud ratio prediction, the number of neurons in the input layer and the number of neurons in the output layer are initialized in sequence; S202, based on the number of neurons in the input layer, the number of neurons in the hidden layer is initialized using a preset numerical relationship.
[0104] For example, in some specific implementations, the number of input parameters is between 15 and 20, which is determined based on the dimension of the collected data. Generally speaking, the dimension of the input parameters is around 20. The output is the mud ratio parameter. The components and corresponding proportions of the output mud ratio are determined according to different drilling fluid systems (the sum of the proportions of these components is 1). For example, there are four main types of commonly used drilling fluid systems, such as the improved PEC drilling fluid system (suitable for upper and middle formations in marine drilling), PEM drilling fluid system (suitable for medium and deep formations and large displacement and horizontal wells in marine drilling), EZFLOW drilling fluid system (suitable for large displacement wells, horizontal wells and oil layer protection in marine drilling), invisible acid completion fluid system (suitable for completion operations in marine drilling). After determining the drilling fluid system, the dimension of the neural network output layer is determined based on the common components in the system.
[0105] In some specific application scenarios, the present invention uses a three-layer BP neural network, the activation function is a Sigmoid function, and there is an approximate relationship (i.e., a preset numerical relationship) between the number of hidden layer neural networks HiddenCnt and the number of input layer neurons InputCnt, refer to the following formula:
[0106] HiddenCnt=2×InputCnt+1
[0107] S300, initializing multiple groups of network parameters to construct a weed population;
[0108] Among them, each weed individual in the weed population corresponds to a set of network parameters;
[0109] It should be noted that the network parameters include weight parameters and threshold parameters; in some embodiments, such as Figure 4 As shown, step S300 may include the following steps: S301, determining a first number of weight parameters based on the product of the sum of the number of neurons in the input layer and the number of neurons in the output layer and the number of neurons in the hidden layer; S302, determining a second number of threshold parameters based on the sum of the number of neurons in the hidden layer and the number of neurons in the output layer; S303, randomly generating a first number of weight parameters based on a preset weight interval, and randomly generating a second number of threshold parameters based on a preset threshold interval, thereby arranging and obtaining a weed individual; S304, incrementing the number of generated individuals by one, returning to the step of randomly generating the first number of weight parameters based on the preset weight interval, until the number of generated individuals reaches a preset number, and constructing a weed population based on the preset number of weed individuals. It should be understood that the initial values of various times or quantities (such as the number of generated individuals, the first iteration number, the second iteration number, etc.) used in the iterative process of this embodiment of the present invention are all 0.
[0110] For example, in some specific implementations, taking the aforementioned BP neural network structure as an example, the number of corresponding weight parameters to be optimized is:
[0111] WeightCnt=InputCnt×HiddenCn+HiddenCn×OutputCnt
[0112] The number of threshold parameters Bias to be optimized is:
[0113] BiasCnt=HiddenCn+OutputCnt
[0114] Assuming the input dimension is 20 and the output dimension is 5, the number of hidden layer neurons is 41, the number of weight parameters to be optimized is 20*41+41*1=861, and the number of threshold parameters to be optimized is 41+5=46. That is, the total number of optimization variables searched by the weed optimization algorithm is 861+46=907.
[0115] In some specific application scenarios, initializing the weed population can be achieved as follows:
[0116] The maximum number of weeds in the population is maxWeedSize (preset number). It is set based on the needs and the default value is 50. The weed population is composed of a large number of individuals. Each individual includes two parts: the weight parameter Weight and the threshold parameter Bias. The initialization formula is as follows, where w i,j represents the jth weight parameter of individual i, and similarly b i,k represents the kth threshold parameter for individual i, and normal(0,1) represents a normal distribution with mean 0 and standard deviation 1. Execute maxWeedSize times to obtain a population of maxWeedSize weeds.
[0117] Weed i ={w i,1 ,w i,2 ,...w i,WeightCnt ,b i,1 ,b i,2 ,...b i,BiasCnt}
[0118] w i,j =normal(0,1),1≤j≤WeightCnt
[0119] b i,k =normal(0,1),1≤k≤BiasCnt
[0120] S400, performing prediction error analysis on each weed individual in the weed population based on the test set and the neural network, obtaining a prediction error for each weed individual, and selecting a weed individual with the smallest prediction error as a candidate individual;
[0121] It should be noted that, in some embodiments, Figure 5 As shown, based on the test set and the neural network, a prediction error analysis is performed on each weed individual in the weed population to obtain the prediction error of each weed individual, which may include the following steps: S401, traversing each weed individual in the weed population one by one, and using the traversed weed individual as the predicted individual; S402, applying the network parameters corresponding to the predicted individual to the neural network to construct a prediction training model; S403, inputting the drilling characteristic data of each sample in the test set into the prediction training model for processing to obtain the mud prediction result corresponding to each sample; S404, constructing the training error as the prediction error of the predicted individual based on the mud ratio parameter and the mud prediction result corresponding to each sample in the test set.
[0122] For example, in some specific implementations, each weed individual in the current population is traversed and the corresponding prediction error is calculated. Each individual represents the weight and threshold of the BP neural network, that is, each individual represents a BP neural network. Based on each individual, each array in the test set is traversed and input into the BP neural network model to obtain the prediction result. The training error of the current training sample is calculated using the following formula:
[0123]
[0124] OutputCnt is the output dimension, that is, the number of drilling fluid components, P i represents the predicted ratio of the i-th component, R i Represents the true ratio of the components in the i-th order (i.e., from the test data). Traverse the weeds in the population one by one and obtain the individual with the lowest error rate, that is, the best performing individual BestWeed (i.e., candidate individual).
[0125] BestWeed={w1,w2,...w WeightCnt ,b1,b2,...b BiasCnt}
[0126] For example, assuming the target content is 0.7 water, 0.2 dispersant, and 0.1 polymer, the model output value is 0.6 water, 0.25 dispersant, and 0.15 polymer. The error is |0.7-0.6|+|0.2-0.25|+|0.1-0.15|=0.2.
[0127] S500: When the prediction error of the candidate individual is less than the error threshold, the candidate individual is used as the target individual; otherwise, the subsequent steps are executed;
[0128] For example, in some specific implementations, if the training error of BestWeed satisfies e≤MinErrorRate, it means that the optimal individual (ie, the target individual) has been found, otherwise, the subsequent steps are continued.
[0129] S600, generating next-generation weed individuals based on each weed individual in combination with a normally distributed random number, and adding the next-generation weed individuals to the weed population;
[0130] Among them, the standard deviation of the normal distribution application is related to the distribution range of the prediction error;
[0131] In some embodiments, before executing step S600, Figure 6 As shown, the method may further include the following steps: T100, when the number of individuals in the weed population exceeds a preset number, sorting all weed individuals in ascending order based on the prediction error to obtain an individual sequence; T200, taking a preset number of weed individuals at the front of the individual sequence as a reserved individual set; the preset number is the initialization number of the weed population; T300, updating the weed population according to the reserved individual set.
[0132] For example, in some specific implementations, the number of weeds in the current population, curWeedSize, is counted. If curWeedSize exceeds maxWeedSize (i.e., a preset number), weed culling is performed to ensure the population does not exceed maxWeedSize. The culling rule is as follows: all weeds are sorted by error, from smallest to largest. The first maxWeedSize weeds are selected and propagate to the next generation, while all other weeds are culled. Because smaller errors indicate better performance, weeds with larger errors are culled.
[0133] It should be noted that, in some embodiments, step S600 may include the following steps: obtaining a maximum error and a minimum error in the current weed population based on the prediction error of each weed individual; obtaining a distribution range parameter of the prediction error of the current weed population based on the difference between the maximum error and the minimum error; obtaining an iteration progress parameter of the current weed population based on a ratio of a difference between a first iteration threshold and the first iteration number corresponding to the current weed population and the first iteration threshold; constructing a search range parameter based on the iteration progress parameter in combination with a preset maximum error rate, a minimum error rate, and a nonlinear adjustment factor; wherein the expression of the search range parameter is:
[0134]
[0135] Wherein, sigma represents the search range parameter; MinErrorRate represents the minimum error rate; e is a natural constant; maxGenCnt represents the first iteration threshold; iterCnt represents the current first iteration number; nonlinearFactor represents the nonlinear adjustment factor; MaxErrorRate represents the maximum error rate;
[0136] Traverse each weed individual in the weed population one by one and use the traversed weed individual as the weed parent individual; obtain the relative error value of the weed parent individual based on the ratio of the difference between the prediction error and the minimum error of the weed parent individual to the difference between the maximum error and the minimum error; obtain the number of seeds of the weed parent individual based on the relative error value combined with the preset maximum population size and minimum population size; where the expression for the number of seeds is:
[0137]
[0138] Where seedNum i Indicates the search range parameter; minSeedNum indicates the minimum population number; curError i Indicates the prediction error of the weed parent individual; minError iter Indicates the minimum error; maxError iter Indicates the maximum error; nonlinearFactor indicates the nonlinear adjustment factor; maxSeedNum indicates the maximum population number;
[0139] Using the search range parameter as the standard deviation, randomly generate update random numbers based on the preset normal distribution; based on the updated random numbers, reproduce and update the network parameters of the weed parent individual to obtain the next generation of weed individuals of the weed parent individual; return to execute the step of randomly generating update random numbers based on the preset normal distribution until the number of next generation weed individuals of the weed parent individual reaches the number of seeds; all next generation weed individuals of each weed parent individual are added to the weed population.
[0140] For example, in some specific implementations, the Sigma value (i.e., the search range parameter) is updated once per iteration. The calculation formula is as follows:
[0141]
[0142] Where maxGenCnt represents the maximum number of iterations, MaxErrorRate represents the maximum error rate, MinErrorRate represents the minimum error rate, nonlinearFactor is the nonlinear adjustment factor, and the above are constants. IterCnt is the current number of iterations (i.e., the first number of iterations) and its value range is [1, maxGenCnt]. IterCnt increases by one after each iteration.
[0143] At the same time, traverse the entire weed population and calculate the Weed i The number of seeds for the next generation seedNum i Where curError i Weed i Error, maxError iter Indicates the maximum training error of the current iteration iterCnt population, minError iter It represents the minimum training error of the current iteration iterCnt population. The subscript iter represents the number of iterations of the current population. Each time the population reproduces, the number of iterations iterCnt increases by one.
[0144] curError i The larger the seedNum i This means that when the population is further away from the optimal solution, more seeds need to be generated for search. When the population is closer to the optimal solution, at least minSeedNum seeds of each weed can be guaranteed to be used for search, that is, all weeds participating in reproduction have the opportunity to leave seeds.
[0145]
[0146] Finally, generate new weeds: traverse the entire weed population, the current weed Weed i Generate seedNum i Each execution of the following formula will generate a new seed, where normal(0,sigma) represents a normal distribution with a mean of 0 and a standard deviation of 1. i Indicates the current weed i Generate a seed and execute seedNum i times, based on Weed i Will generate seedNum i Traverse each weed, each seed will generate a new seed, and repeat this process until the traversal is completed, and the next generation of seeds will be obtained.
[0147] w i,j =w i,j +normal(0,sigma),1≤j≤WeightCnt
[0148] b i,k =b i,k +normal(0,sigma),1≤k≤BiasCnt
[0149] NewWeed i ={wi,1 ,w i,2 ,...w i,WeightCnt ,b i,1 ,b i,2 ,...b i,BiasCnt}
[0150] S700, incrementing the first iteration number. If the first iteration number is greater than a first iteration threshold, the candidate individual is used as the target individual. Otherwise, returning to the step of performing prediction error analysis on each weed individual in the weed population based on the test set and the neural network until the first iteration number is greater than the first iteration threshold.
[0151] For example, in some embodiments, if the first iteration number exceeds the maximum value MaxGenCnt (ie, the first iteration threshold), the optimal individual (ie, the target individual) is confirmed through the candidate individuals of the last iteration; otherwise, the weed population reproduction cycle is performed.
[0152] S800, based on the target individual, using the validation set to optimize the neural network to obtain the target prediction model;
[0153] It should be noted that, in some embodiments, Figure 7 As shown, step S800 may include the following steps: S801, performing validation error analysis on the target individual based on the validation set and the neural network to obtain a validation error; S802, when the validation error is less than an error threshold, applying the target individual to the neural network to obtain a target prediction model; otherwise, executing subsequent steps; S803, increasing the second iteration count, randomly updating the number of neurons in the hidden layer based on a preset interval, returning to the step of initializing multiple sets of network parameters to construct a weed population, until the second iteration count exceeds the second iteration threshold, and applying the target individual to the neural network to obtain a target prediction model. It should be noted that the process logic for performing validation error analysis on the target individual based on the validation set and the neural network to obtain the validation error is the same as the principle logic for performing prediction error analysis on the weed individual based on the test set and the neural network to obtain the prediction error, and will not be repeated here.
[0154] For example, in some specific implementations, the optimal parameter BestWeed (i.e., the network parameter of the target individual) is obtained through the above steps, that is, the neural network weight w and threshold b have been adjusted to the optimal value. For the validation set data, the BP neural network model of the mud ratio is ready. At this point, the optimal mud ratio prediction BP neural network model has been obtained. Traverse each array group of the validation set, input it into the BP neural network model, obtain the predicted result, and then compare it with the actual result, and finally calculate the prediction error Error verify(i.e. validation error). It should be noted that the previous steps are based on the test set to calculate the error, but here the error is calculated based on the validation set. verify , the test set is used for parameter optimization in model training, and the validation set is used for final model performance evaluation.
[0155] If Error verify ≤MinErrorRate, it means that the verification result is in line with expectations, that is, the mud ratio prediction BP neural network model is in line with expectations.
[0156] If Error verify >MinErrorRate, it means that the verification result does not meet expectations and there is still room for optimization in the BP neural network model for mud ratio prediction. At this time, the relevant parameters of the weed optimization algorithm are reset, the BP neural network topology is updated (the number of hidden layers HiddenCnt will be randomly adjusted. The adjustment formula is as follows, where Random(-InputCnt, InputCnt) represents an integer random value in the interval [-InputCnt, InputCnt]. With each iteration, the number of neurons in the hidden layer of the BP neural network will change), and the entire process starts over. To avoid infinite loops, the maximum number of iterations MaxIWOCnt is usually set here (i.e., the second iteration threshold, a constant, customized according to the situation, at least 1, and 5 by default), which means that the weed optimization algorithm is executed at most MaxIWOCnt times. If the optimal parameters that meet MinErrorRate are still not found, the currently found optimal parameters BestWeed are used as the result of this search.
[0157] S900: Utilize the target prediction model to predict the mud ratio based on the actual drilling data.
[0158] For example, in some specific implementations, the mud ratio prediction BP neural network model that meets the expected mud ratio prediction requirements constructed through the aforementioned steps can be used to predict the mud ratio based on actual drilling data.
[0159] 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.
[0160] First, it's important to note that the current common mud mix method relies on experience gained from previous projects, combined with the specific geological conditions of the current situation. Initially, the composition ratio is determined, and then the final composition is finalized through extensive testing. This entire process relies heavily on manual experience and repeated testing based on the current geological conditions.
[0161] However, the existing technology has the following shortcomings:
[0162] 1) Over-reliance on manual experience: Current mud proportioning work usually first refers to past proportioning data, then combines it with the geological conditions of the current area, and finally determines the specific proportioning composition through a large number of tests. This process relies heavily on personal experience and judgment.
[0163] 2) Inefficiency and poor real-time performance: Even with a readily available mud mix ratio, extensive testing is still required to finalize the solution. This process is labor-intensive, resulting in low efficiency and difficulty in making timely adjustments to changing conditions, resulting in poor real-time performance.
[0164] In view of this, the present invention provides a method for predicting the ratio of ocean drilling mud, such as Figure 8 As shown, the present invention can be implemented through the following process:
[0165] Step 1: Divide the test set and validation set. The data used in this invention mainly comes from public data at home and abroad. The characteristic vector of each set of data includes two parts: geological information and drilling information. The geological information includes parameters such as rock type, formation porosity, density, permeability, gas content, water content, formation pressure, pH, etc. The drilling information includes parameters such as well depth, well diameter, drilling pressure, footage, pump pressure, pump displacement, standpipe pressure, casing pressure, etc. The number of input parameters is between 15 and 20, which is determined according to the dimension of the collected data. Generally speaking, the dimension of the input parameters is about 20.
[0166] The output is the mud ratio parameters. The components and corresponding proportions of the output mud ratio should be determined according to different drilling fluid systems (the sum of the proportions of these components is 1). There are four main types of commonly used drilling fluid systems, such as the improved PEC drilling fluid system (suitable for upper and middle formations in marine drilling), PEM drilling fluid system (suitable for medium and deep formations and large displacement and horizontal wells in marine drilling), EZFLOW drilling fluid system (suitable for large displacement wells, horizontal wells and oil layer protection in marine drilling), and invisible acid completion fluid system (suitable for completion operations in marine drilling). After determining the drilling fluid system, the dimension of the neural network output layer is determined based on the common components in the system.
[0167] Generally speaking, the dimensions of input and output data are determined based on the similarity of mud ratios. Specifically, to develop an improved PEC drilling fluid system, relevant data must first be collected to clearly define the input dimensions, mud ratio components, and their corresponding proportions. After collecting data for four common drilling fluid systems, four BP neural network models can be simultaneously constructed. Subsequently, the most appropriate prediction model is selected based on the mud ratio requirements of each drilling fluid system to ensure the accuracy and reliability of the prediction results.
[0168] The present invention uses 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 (the default is 10). 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. Go to step 2.
[0169] Step 2: Update the BP network topology. This step primarily performs two tasks: resetting the parameters of the weed optimization algorithm and updating the BP network topology. Resetting the parameters related to the weed optimization algorithm includes resetting the number of inner loop iterations to 0 and clearing the current population. Next, determine the BP neural network topology, assuming the input data dimensions are InputCnt and the output data dimensions are OutputCnt. As described in Step 1, InputCnt and OutputCnt must be related to the collected data and the drilling fluid system; they are constants here.
[0170] The present invention 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 HiddenCnt and the number of input layer neurons InputCnt, as shown in the following formula:
[0171] HiddenCnt=2×InputCnt+1
[0172] At this time, the number of weight parameters to be optimized is:
[0173] WeightCnt=InputCnt×HiddenCn+HiddenCn×OutputCnt
[0174] The number of threshold parameters Bias to be optimized is:
[0175] BiasCnt=HiddenCn+OutputCnt
[0176] Suppose the input dimension is 20 and the output dimension is 5. Then the number of neurons in the hidden layer is 41, and the number of weight parameters Weight to be optimized is 20 * 41 + 41 * 1 = 861. The number of threshold parameters bias to be optimized is 41 + 5 = 46. That is, the total number of optimization variables searched by the weed optimization algorithm is 861 + 46 = 907. When step 2 is executed for the first time, the network topology is 20 - 41 - 5. Each time step 2 is executed later, the number of hidden layers HiddenCnt will be randomly adjusted. The adjustment formula is as follows, where Random(-InputCnt, InputCnt) represents an integer random value in the interval [-InputCnt, InputCnt]. In each iteration, the number of neurons in the hidden layer of the BP neural network will change, and the number of search parameters will also change. This design is to find the optimal BP neural network model topology and optimal parameters. Go to step 3.
[0177] HiddenCnt = 2 × InputCnt + 1 + Random(-InputCnt, InputCnt)
[0178] Step 3: Initialize the weed population. The parameters based on the improved weed optimization algorithm are mainly as follows: the maximum number of individuals in the population maxWeedSize, which is the maximum number of the weed population and is determined according to requirements, with a default value of 50; the maximum number of iterations of the weed population maxGenCnt, which is the maximum number of reproductions of the weed population and is determined according to requirements, with a default value of 10; the nonlinear adjustment factor nonlinearFactor, which is used to adjust the search accuracy, and its value range is [1, 5], with a default value of 3. Generally, it is a constant. The larger this value is, the larger the search range and the worse the search accuracy, and vice versa; the maximum number of seeds maxSeedNum, which is the maximum number of seeds generated by a weed individual and is used to adjust the scale of newly generated seeds in each generation, and is determined according to requirements, with a default value of 6; the minimum number of seeds minSeedNum, which is the minimum number of seeds generated by a weed individual and is used to adjust the scale of newly generated seeds in each generation, and is determined according to requirements, with a default value of 2, satisfying minSeedNum < maxSeedNum; the maximum error rate MaxErrorRate, which is used to adjust the search accuracy, and its physical meaning here is the error rate, and the maximum value is 1 (that is, all prediction component ratios are completely wrong), with a default value of 1; the minimum error rate MinErrorRate, which is the minimum error rate, with a default value of 0, that is, all component ratios are completely correct. Generally speaking, the value is 0.1 or 0.
[0179] The weed population is composed of a large number of individuals. Each individual includes two parts: the weight parameter Weight and the threshold parameter Bias. The initialization formula is as follows, where w i,j represents the j-th weight parameter of individual i. Similarly, b i,krepresents the kth threshold parameter for individual i, and normal(0,1) represents a normal distribution with mean 0 and standard deviation 1. Execute maxWeedSize times to obtain a population of maxWeedSize weeds.
[0180] Weed i ={w i,1 ,w i,2 ,...w i,WeightCnt ,b i,1 ,b i,2 ,...b i,BiasCnt}
[0181] w i,j =normal(0,1),1≤j≤WeightCnt
[0182] b i,k =normal(0,1),1≤k≤BiasCnt
[0183] In summary, in step 1, the test set was obtained; in step 2, the BP neural network topology was determined; and in step 3, the weed population was initialized. The BP neural network model for slurry proportioning is now ready for the test set data. Proceed to step 4.
[0184] Step 4: Calculate the prediction error based on the BP neural network. Traverse each weed individual in the current population and calculate the corresponding prediction error. Each individual represents the BP neural network weight and threshold, that is, each individual represents a BP neural network. Based on each individual, traverse each array in the test set, input it into the BP neural network model, obtain the prediction result, and calculate the training error of the current training sample. The formula is as follows:
[0185]
[0186] OutputCnt is the output dimension, that is, the number of drilling fluid components, P i represents the predicted ratio of the i-th component, R i Represents the true ratio of the i-th component (that is, from the test data). Traverse the weeds in the population one by one and get the individual with the lowest error rate, that is, the best performing individual BestWeed.
[0187] BestWeed={w1,w2,...w WeightCnt ,b1,b2,...b BiasCnt}
[0188] For example, suppose the target content is 0.7% water, 0.2% dispersant, and 0.1% multipolymer. The model output is 0.6% water, 0.25% dispersant, and 0.15% multipolymer. The error is |0.7 - 0.6| + |0.2 - 0.25| + |0.1 - 0.15| = 0.2. Go to step 5.
[0189] Step 5: Satisfy the minimum error. If the training error of BestWeed satisfies e≤MinErrorRate, it means that the optimal individual has been found. Go to step 11. Otherwise, go to step 6.
[0190] Step 6: Eliminate excess weeds. Count the number of weeds in the current population (curWeedSize). If curWeedSize exceeds maxWeedSize, weed culling is performed to ensure the population does not exceed maxWeedSize. The culling rule is as follows: sort all weeds by error, minimizing the error. The first maxWeedSize weeds are selected for the next generation, and all other weeds are eliminated. Because smaller errors indicate better performance, weeds with larger errors are eliminated. Go to step 7.
[0191] Step 7: Update the Sigma value. The calculation formula is as follows, where maxGenCnt represents the maximum number of iterations, MaxErrorRate represents the maximum error rate, MinErrorRate represents the minimum error rate, nonlinearFactor is the nonlinear adjustment factor, and these are all constants. IterCnt is the current number of iterations and has a value range of [1, maxGenCnt]. IterCnt increases by one after each iteration.
[0192]
[0193] sigma dynamically adjusts the standard deviation of the normal distribution for seed diffusion and can be thought of as the search range. As iterCnt increases, sigma decreases, indicating a gradual narrowing of the search range. Simultaneously, each generation eliminates poorly performing individuals and retains the best. As sigma decreases, the search becomes increasingly refined, shifting from a large standard deviation initially to cover a wide area to a gradually narrowing search for the optimal solution later on. Go to step 8.
[0194] Step 8: Dynamically calculate the number of seeds for the next generation. Traverse the entire weed population and calculate the number of seeds for each weed. i The number of seeds for the next generation seedNum i Where curError i Weed iError, maxError iter Indicates the maximum training error of the current iteration iterCnt population, minError iter It represents the minimum training error of the current iteration iterCnt population. The subscript iter represents the number of iterations of the current population. Each time the population reproduces, the number of iterations iterCnt increases by one.
[0195] curError i The larger the seedNum i The larger the number, the fewer the number. This means that as the population moves further away from the optimal solution, more seeds need to be generated for the search. As the population moves closer to the optimal solution, at least the minSeedNum number of seeds per weed can be guaranteed to be used for the search. This means that all weeds participating in the reproduction process have a chance to leave seeds. Go to step 9.
[0196]
[0197] Step 9: Generate new weeds. Traverse the entire weed population, the current weed i Generate seedNum i A new seed is generated each time the following formula is executed, where normal(0,sigma) represents a normal distribution with a mean of 0 and a standard deviation of 1. i Indicates the current weed i Generate a seed and execute seedNum i times, based on Weed i Will generate seedNum i Traverse each weed, each seed will generate a new seed, and repeat this process until the traversal is completed, and the next generation of seeds will be obtained.
[0198] w i,j =w i,j +normal(0,sigma),1≤j≤WeightCnt
[0199] b i,k =b i,k +normal(0,sigma),1≤k≤BiasCnt
[0200] NewWeed i ={w i,1 ,w i,2 ,...w i,WeightCnt ,b i,1 ,b i,2 ,...b i,BiasCnt}
[0201] After steps 6 through 9, the weeds have completed their growth and reproduction. The next generation of seeds has grown into weeds, and the population consists of parent and offspring weeds. Through natural selection, the global optimal solution is determined based on the new population. Then, proceed to step 10.
[0202] Step 10: Exceeding the maximum number of iterations. Steps 4 to 9 form a weed population reproduction cycle. Each time this cycle is executed, the number of iterations increases by one. If the number of iterations exceeds the maximum value, MaxGenCnt, proceed to step 11; otherwise, proceed to step 4.
[0203] Step 11: Find the optimal BP neural network parameters. When this step is reached, the entire weed optimization algorithm process is completed, indicating that the optimal BestWeed parameters have been obtained.
[0204] BestWeed={w1,w2,...w WeightCnt ,b1,b2,...b BiasCnt}
[0205] Step 12: Initialize the BP neural network parameters. In Step 1, the test set was obtained. In Step 2, the BP network topology was determined. In Step 11, the optimal parameters, BestWeed, were obtained. This means that the neural network weights w and threshold b have been optimized. The BP neural network model for mud proportioning is now ready for the validation set data. Proceed to Step 13.
[0206] Step 13: Calculate the prediction error based on the BP neural network. At this point, the optimal BP neural network model for mud ratio prediction has been obtained. Traverse each array group of the validation set, input it into the BP neural network model, obtain the prediction result, and then compare it with the actual result, and finally calculate the prediction error. verify It should be noted that step 4 calculates the error based on the test set, but here the error is calculated based on the validation set. verify , the test set is used for parameter optimization in model training, and the validation set is used for final model performance evaluation.
[0207] Step 14: Minimum error is achieved. Steps 2 to 13 are the BP neural network update loop. Whenever a BP neural network model that meets the expected mud ratio prediction is not found, it will restart. The entire process will not end until the expected model is found.
[0208] If Error verify If ≤MinErrorRate, it means that the verification result is in line with expectations, that is, the mud ratio prediction BP neural network model is in line with expectations. At this time, go to step 16 and the entire process is completed.
[0209] If Error verify >MinErrorRate, it means that the verification results do not meet expectations and there is still room for optimization in the mud ratio prediction BP neural network model. At this time, go to step 2, reset the parameters related to the weed optimization algorithm, update the BP neural network topology, and restart the entire process. To avoid infinite loops, the maximum number of iterations MaxIWOCnt (a constant, customized according to the situation, at least 1, default 5) is usually set here, that is, the weed optimization algorithm is executed at most MaxIWOCnt times. If the optimal parameters that meet MinErrorRate are still not found, go to step 16 and use the currently found optimal parameters BestWeed as the result of this search, and the entire process ends.
[0210] Step 15: Find the optimal BP neural network model. At this step, it indicates that the mud ratio prediction BP neural network model meets expectations, and the entire process is complete.
[0211] In summary, the present invention proposes a mud ratio prediction method using an optimized BP neural network. By using a weed optimization algorithm to find the optimal parameters of the BP neural network, a prediction model for ocean drilling mud ratio is obtained. Compared to existing technologies, the present invention has at least the following advantages:
[0212] 1) This paper proposes the use of weed optimization to find the optimal parameters of BP neural network. This paper utilizes the global search capability of weed optimization to enable the optimized BP neural network to more accurately predict the ratio of ocean drilling mud.
[0213] 2) The fusion of geological information and multi-source data of the drilling process can more comprehensively reflect the actual situation of the drilling process, drive the BP neural network model to predict the mud ratio based on richer information, and improve the accuracy and reliability of the prediction.
[0214] 3) An automated computational framework is proposed. By integrating multi-source data as input, a full-process automated prediction model for ocean drilling mud ratio is constructed, which reduces human intervention, enables timely and flexible adjustment of mud ratio, and improves drilling efficiency.
[0215] On the other hand, Figure 9 As shown, an embodiment of the present invention provides an ocean drilling mud ratio prediction device 900, which may include:
[0216] The first module 901 is used to obtain drilling characteristic data and then divide it into a test set and a validation set; the drilling characteristic data is marked with mud ratio parameters;
[0217] The second module 902 is used to initialize the topology of the neural network; the neural network includes an input layer, a hidden layer, and an output layer, and the topology includes the number of neurons in each layer;
[0218] The third module 903 is used to initialize multiple sets of network parameters to construct a weed population; each weed individual in the weed population corresponds to a set of network parameters;
[0219] The fourth module 904 is configured to perform prediction error analysis on each weed individual in the weed population based on the test set and the neural network, obtain the prediction error of each weed individual, and select the weed individual with the smallest prediction error as a candidate individual;
[0220] The fifth module 905 is used to select the candidate individual as the target individual when the prediction error of the candidate individual is less than the error threshold; otherwise, execute the steps of the sixth module;
[0221] The sixth module 906 is configured to generate next-generation weed individuals based on each weed individual in combination with a normally distributed random number, and add the next-generation weed individuals to the weed population; the standard deviation of the normal distribution is associated with the distribution range of the prediction error;
[0222] The seventh module 907 is configured to increment the first iteration number. If the first iteration number is greater than the first iteration threshold, the candidate individual is selected as the target individual. Otherwise, the process returns to the fourth module and continues until the first iteration number is greater than the first iteration threshold.
[0223] The eighth module 908 is used to optimize the neural network based on the target individual using the validation set to obtain a target prediction model;
[0224] The ninth module 909 is used to predict the mud ratio based on the actual drilling data using the target prediction model.
[0225] In some embodiments, the apparatus may further include a tenth module configured to perform the following operations:
[0226] When the number of individuals in the weed population exceeds a preset number, all weed individuals are sorted in ascending order based on the prediction error to obtain an individual sequence;
[0227] The preset number of weed individuals in the first column of the individual sequence is used as the reserved individual set; the preset number is the initialization number of the weed population;
[0228] Update the weed population based on the set of retained individuals.
[0229] 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.
[0230] 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 executes the computer program to implement the above-described method for predicting the ocean drilling mud ratio. The electronic device can be any smart terminal, including a tablet computer and an in-vehicle computer.
[0231] 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.
[0232] 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:
[0233] 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.
[0234] 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.
[0235] Input / output interface 1003, used to implement information input and output;
[0236] 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.);
[0237] 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 );
[0238] 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 .
[0239] 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.
[0240] 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.
[0241] 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.
[0242] 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.
[0243] 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.
[0244] 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.
[0245] 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.
[0246] 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.
[0247] 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.
[0248] 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.
[0249] 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.
[0250] 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.
[0251] 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.
[0252] 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.
[0253] 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.
[0254] 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.
[0255] 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.
[0256] 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 ocean drilling mud ratio, characterized in that: The following steps are involved: Acquire drilling characteristic data and divide them into a test set and a validation set; the drilling characteristic data is marked with mud ratio parameters; Initializing a topological structure of a neural network; the neural network includes an input layer, a hidden layer, and an output layer, and the topological structure includes the number of neurons in each layer; Initializing multiple groups of network parameters to construct a weed population; each weed individual in the weed population corresponds to a group of the network parameters; performing a prediction error analysis on each of the weed individuals in the weed population based on the test set and the neural network to obtain a prediction error for each of the weed individuals, and selecting the weed individual with the smallest prediction error as a candidate individual; When the prediction error of the candidate individual is less than an error threshold, the candidate individual is used as a target individual; otherwise, generating next-generation weed individuals based on each of the weed individuals in combination with a normally distributed random number, and adding the next-generation weed individuals to the weed population; The standard deviation of the normal distribution is associated with the distribution range of the prediction error; Increasing the first iteration number, if the first iteration number is greater than a first iteration threshold, taking the candidate individual as the target individual; otherwise, returning to the step of performing prediction error analysis on each weed individual in the weed population based on the test set and the neural network until the first iteration number is greater than the first iteration threshold; Based on the target individual, optimizing the neural network using the validation set to obtain a target prediction model; The target prediction model is used to predict the mud ratio based on actual drilling data.
2. The method for predicting ocean drilling mud ratio according to claim 1, characterized in that: Initializing the topological structure of the neural network includes the following steps: Initialize the number of neurons in the input layer and the number of neurons in the output layer in sequence based on the input dimension corresponding to the drilling characteristic data and the output dimension preset by the mud ratio prediction; According to the number of neurons in the input layer, the number of neurons in the hidden layer is initialized using a preset numerical relationship.
3. The method for predicting ocean drilling mud ratio according to claim 1, wherein: The network parameters include weight parameters and threshold parameters; the initialization of multiple sets of network parameters to construct weed populations includes the following steps: Determining a first number of the weight parameters based on a product of a sum of the number of neurons in the input layer and the number of neurons in the output layer and the number of neurons in the hidden layer; Determining a second number of the threshold parameters based on the sum of the number of neurons in the hidden layer and the number of neurons in the output layer; Randomly generating the first number of weight parameters based on a preset weight interval, and randomly generating the second number of threshold parameters based on a preset threshold interval, thereby obtaining one weed individual; The number of generated individuals is increased by one, and the step of randomly generating the first number of weight parameters based on a preset weight interval is returned to be executed until the number of generated individuals reaches a preset number, and the weed population is constructed based on the preset number of weed individuals.
4. The method for predicting ocean drilling mud ratio according to claim 1, wherein: Before the step of generating the next generation of weed individuals based on each of the weed individuals in combination with a normally distributed random number, the method further comprises the following steps: When the number of individuals in the weed population exceeds a preset number, all the weed individuals are sorted in ascending order based on the prediction errors to obtain an individual sequence; The preset number of weed individuals in the front row of the individual sequence is used as a reserved individual set; the preset number is the initialization number of the weed population; The weed population is updated according to the retained individual set.
5. The method for predicting ocean drilling mud ratio according to claim 1, wherein: The method of performing prediction error analysis on each of the weed individuals in the weed population based on the test set and the neural network to obtain a prediction error for each of the weed individuals comprises the following steps: traversing each of the weed individuals in the weed population one by one, and using the traversed weed individuals as predicted individuals; Applying the network parameters corresponding to the predicted individual to the neural network to construct a prediction training model; Inputting the drilling characteristic data of each sample in the test set into the prediction training model for processing to obtain the mud prediction result corresponding to each sample; A training error is constructed based on the mud ratio parameter and the mud prediction result corresponding to each sample in the test set as the prediction error of the prediction individual.
6. The method for predicting ocean drilling mud ratio according to claim 1, wherein: The standard deviation of the normal distribution application is also associated with the iteration progress of the current weed population; generating the next generation of weed individuals based on each weed individual in combination with a normal distributed random number, and adding the next generation of weed individuals to the weed population, comprises the following steps: Obtaining a maximum error and a minimum error in the current weed population based on the prediction error of each weed individual; Obtaining a distribution range parameter of the prediction error of the current weed population based on a difference between the maximum error and the minimum error; obtaining an iteration progress parameter of the current weed population based on a ratio of a difference between the first iteration threshold and the first iteration number corresponding to the current weed population and the first iteration threshold; A search range parameter is constructed based on the iterative progress parameter in combination with a preset maximum error rate, a minimum error rate, and a nonlinear adjustment factor; wherein the expression of the search range parameter is: Wherein, sigma represents the search range parameter; MinErrorRate represents the minimum error rate; e is a natural constant; maxGenCnt represents the first iteration threshold; iterCnt represents the current first iteration number; nonlinearFactor represents the nonlinear adjustment factor; MaxErrorRate represents the maximum error rate; Traversing each of the weed individuals in the weed population one by one, and taking the traversed weed individuals as weed parent individuals; Obtaining a relative error value of the weed parent individual based on a ratio of a difference between the predicted error and the minimum error of the weed parent individual to a difference between the maximum error and the minimum error; The number of seeds of the parent weed individual is obtained based on the relative error value combined with the preset maximum population number and minimum population number; wherein the expression of the seed number is: Where seedNum i Indicates the search range parameter; minSeedNum indicates the minimum population number; curError i Indicates the prediction error of the weed parent individual; minError iter Indicates the minimum error; maxError iter Indicates the maximum error; nonlinearFactor indicates the nonlinear adjustment factor; maxSeedNum indicates the maximum population number; Using the search range parameter as a standard deviation, randomly generating an updated random number based on a preset normal distribution; Generate and update the network parameters of the weed parent individual based on the updated random number to obtain the next generation weed individual of the weed parent individual; Returning to the step of randomly generating and updating random numbers based on a preset normal distribution until the number of the next generation weed individuals of the weed parent individual reaches the number of seeds; All of the next generation weed individuals of each of the weed parent individuals are added to the weed population.
7. The method for predicting ocean drilling mud ratio according to claim 1, wherein: The method of optimizing the neural network based on the target individual and using the validation set to obtain a target prediction model includes the following steps: Based on the verification set and the neural network, performing a verification error analysis on the target individual to obtain a verification error; When the verification error is less than the error threshold, the target individual is applied to the neural network to obtain a target prediction model; otherwise, The second iteration number is incremented, the number of neurons in the hidden layer is randomly updated based on a preset interval range, and the step of initializing multiple sets of network parameters to construct a weed population is returned to execution until the second iteration number is greater than a second iteration threshold, and the target individual is applied to the neural network to obtain the target prediction model.
8. A device for predicting the ratio of ocean drilling mud, characterized in that: include: The first module is used to obtain drilling characteristic data and then divide it into a test set and a validation set; the drilling characteristic data is marked with mud ratio parameters; The second module is used to initialize the topological structure of the neural network; the neural network includes an input layer, a hidden layer and an output layer, and the topological structure includes the number of neurons in each layer; The third module is used to initialize multiple groups of network parameters to construct a weed population; each weed individual in the weed population corresponds to a group of the network parameters; a fourth module, configured to perform a prediction error analysis on each of the weed individuals in the weed population based on the test set and the neural network, obtain a prediction error for each of the weed individuals, and select the weed individual with the smallest prediction error as a candidate individual; A fifth module is configured to use the candidate individual as a target individual when the prediction error of the candidate individual is less than an error threshold; Otherwise, execute the steps of the sixth module; A sixth module is configured to generate a next generation of weed individuals based on each of the weed individuals in combination with a normal distributed random number, and add the next generation of weed individuals to the weed population; the standard deviation of the normal distribution is associated with the distribution range of the prediction error; A seventh module is configured to increment the first iteration number, and if the first iteration number is greater than a first iteration threshold, use the candidate individual as the target individual; otherwise, return to executing the steps of the fourth module until the first iteration number is greater than the first iteration threshold; An eighth module is configured to optimize the neural network based on the target individual and utilize the validation set to obtain a target prediction model; The ninth module is used to use the target prediction model to predict the mud ratio based on actual drilling data.
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.