A mud proportioning method based on clonal selection and related equipment

CN122930316APending Publication Date: 2026-10-16GUANGZHOU MARINE GEOLOGICAL SURVEY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611085753.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-21
Publication Date
2026-10-16

AI Technical Summary

Technical Problem

[0004]2)效率低下且实时性差:即便有现成的泥浆配比方案可供参考,仍需开展大量试验才能确定最终方案

Benefits of technology

[0017] The embodiments of the present invention include at least the following beneficial effects: The present invention provides a mud formulation method, apparatus, electronic device, storage medium, and program product based on clonal selection. This scheme obtains a target dataset; wherein each data sample in the target dataset includes geological parameters and drilling parameters, and each data sample is labeled with the formulation ratio of mud components; initializes the number of iterations and the topology of the neural network, and initializes a parameter population based on the topology; wherein the parameter population includes a first number of antibodies, and each antibody includes a set of network parameters corresponding to the topology; traverses each antibody in the parameter population, performs a first prediction verification using the neural network and the target dataset, and obtains the prediction similarity corresponding to each antibody; when there is a prediction similarity greater than a first threshold, the optimal parameter is determined according to the corresponding antibody; otherwise, a second number of excellent antibodies are selected based on the prediction similarity, and the antibody with the highest prediction similarity is taken as the optimal antibody; for all Superior antibodies are cloned to obtain a set of cloned antibodies. The number of cloning operations is positively correlated with the predicted similarity of the corresponding superior antibodies. Based on the number of iterations and the optimal antibody, the cloned antibody set is mutated. Then, combined with the superior antibodies, a third number of antibodies are selected through a selection operation to obtain a temporary population. If the third number is less than the first number, new antibodies are generated based on the number of iterations, the optimal antibody, and random antibodies in the parameter population. The number of antibodies in the temporary population is supplemented to the first number using the new antibodies. If the number of iterations does not exceed the first threshold, the number of iterations is incremented. The temporary population is used as the parameter population, and the step of traversing each antibody in the parameter population is repeated until the optimal parameters are determined. If the number of iterations exceeds the first threshold, the optimal parameters are determined based on the optimal antibody. The optimal parameters are applied to a neural network to obtain a prediction model. The prediction model is used to predict mud ratios based on real-time geological parameters and real-time drilling parameters. This invention is based on a clonal selection algorithm coupled with a neural network. Driven by mud mixing data samples, it automatically optimizes network parameters, effectively overcoming the shortcomings of traditional methods that rely excessively on human experience. It also enables objectivity and intelligentization of mixing decisions. Furthermore, through antibody prediction similarity assessment, adaptive clonal mutation, and iterative evolution mechanisms, this invention can quickly converge to the optimal network parameters with limited experimental samples, significantly reducing the number of trials and human intervention, and effectively improving the efficiency of mixing scheme determination. Finally, the resulting prediction model outputs an appropriate mud formula in real time based on the input geological and drilling parameters, exhibiting excellent dynamic response capabilities. This overcomes the shortcomings of existing technologies, such as poor real-time performance and difficulty in adapting to changing working conditions, making it suitable for complex and variable geological drilling environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122930316A_ABST
    Figure CN122930316A_ABST
Patent Text Reader

Abstract

The application discloses a mud proportioning method based on clone selection and related equipment, and is coupled with a neural network based on a clone selection algorithm, automatically searches for network parameters with mud proportioning data samples as driving, can effectively overcome the defects of excessive dependence on artificial experience of traditional methods, and can realize objectification and intelligentization of proportioning decision; meanwhile, through antibody prediction similarity evaluation, adaptive clone variation and iterative evolution mechanism, the optimal network parameters can be quickly converged under limited test samples, the test number and artificial intervention can be significantly reduced, and the determination efficiency of the proportioning scheme is effectively improved; finally, the obtained prediction model is used to instantaneously output the adapted mud formula according to real-time input geological parameters and drilling parameters, has good dynamic response capability, overcomes the defects of poor real-time performance and difficulty in adapting to working condition changes of the prior art, is suitable for complex and changeable geological drilling environment, and can be widely applied to the technical field of data processing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of data processing technology, and in particular to a mud mixing method and related equipment based on cloning selection. Background Technology

[0002] Currently, common mud mixing methods are based on the mixing experience of existing projects, combined with the specific geological conditions, to initially determine the component ratios, and finally to finalize the composition through extensive testing. The entire process relies heavily on human experience and repeated testing in conjunction with the current geological conditions.

[0003] The existing technological approach has the following shortcomings: 1) Over-reliance on human experience: Current mud mixing work usually starts by referring to past mixing data, then combining it with the geological conditions of the current area, and finally determining the specific mixing components through a large number of experiments. This process relies heavily on personal experience and judgment.

[0004] 2) Inefficient and lacking real-time performance: Even with readily available mud mixing schemes for reference, numerous experiments are still required to determine the final scheme. This process consumes a significant amount of manpower, resulting in low work efficiency. Furthermore, it is difficult to make timely adjustments when faced with changes in actual conditions, leading to poor real-time performance. Summary of the Invention

[0005] The main objective of this invention is to provide a slurry mixing method, apparatus, electronic device, storage medium, and program product based on clonal selection, aiming to solve at least one problem of the prior art.

[0006] To achieve the above objectives, one aspect of this invention proposes a mud mixing method based on clonal selection, the method comprising: Obtain the target dataset; each data sample in the target dataset includes geological parameters and drilling parameters, and each data sample is labeled with the formula ratio of mud components; Initialize the number of iterations and the topology of the neural network, and initialize the parameter population based on the topology; wherein, the parameter population includes a first number of antibodies, and each antibody includes a set of network parameters corresponding to the topology; Iterate through each antibody in the parameter population, and use the neural network and the target dataset to perform the first prediction verification to obtain the prediction similarity corresponding to each antibody. If the predicted similarity is greater than the first threshold, the optimal parameters are determined based on the corresponding antibody; otherwise, a second number of excellent antibodies are selected based on the predicted similarity, and the antibody with the highest predicted similarity is selected as the optimal antibody. All excellent antibodies were cloned to obtain a set of cloned antibodies; the number of cloning operations was positively correlated with the predicted similarity of the corresponding excellent antibodies. Based on the number of iterations and the optimal antibody, a mutation operation is performed on the clonal antibody set, and then a temporary population is obtained by selecting a third number of antibodies through a selection operation, combined with excellent antibodies. If the third quantity is less than the first quantity, a new antibody is generated based on the number of iterations, the optimal antibody, and random antibodies in the parameter population. The number of antibodies in the temporary population is then supplemented to the first quantity using the new antibody. If the number of iterations does not exceed the threshold of the first iteration, the number of iterations is incremented, the temporary population is used as the parameter population, and the step of traversing each antibody in the parameter population is returned until the optimal parameters are determined; if the number of iterations exceeds the threshold of the first iteration, the optimal parameters are determined based on the optimal antibody. The optimal parameters are applied to a neural network to obtain a prediction model, which is then used to predict mud ratios based on real-time geological parameters and real-time drilling parameters.

[0007] In some embodiments, the target dataset includes a test set. The process involves iterating through each antibody in the parameter population, performing a first prediction validation using a neural network and the target dataset, and obtaining the predicted similarity for each antibody. This includes the following steps: The first antibody in the parameter population is used as a candidate antibody; Candidate parameters are determined based on candidate antibodies, and these parameters are applied to a neural network to obtain a candidate model. The first data sample in the test set is used as the candidate sample; The candidate samples are input into the candidate model so that the candidate model can obtain the first predicted mud ratio based on the geological parameters and drilling parameters of the candidate samples. Based on the first predicted mud ratio corresponding to the candidate sample and the formula ratio of various mud components in the label data, the first similarity of the candidate sample is obtained by cosine similarity calculation. The next data sample in the test set is used as a candidate sample. The process of inputting the candidate sample into the candidate model is repeated until the first similarity corresponding to each data sample in the test set is obtained. Then, the predicted similarity corresponding to the candidate antibody is obtained by standard deviation statistics. The next antibody in the parameter population is selected as a candidate antibody, and the process is repeated until the predicted similarity of each antibody in the parameter population is obtained.

[0008] In some embodiments, screening a second number of superior antibodies based on predicted similarity includes the following steps: The number of first candidates is determined based on the number of antibodies in the parameter population whose predicted similarity is greater than the second threshold; The second candidate quantity is determined by multiplying the first quantity by the preset ratio; The maximum value between the first and second candidate quantities is taken as the second quantity; The first antibody sequence is obtained by arranging all antibodies in the parameter population in descending order of predicted similarity. The second-highest number of antibodies in the first antibody sequence are considered excellent antibodies.

[0009] In some embodiments, cloning is performed on all superior antibodies to obtain a cloned antibody set, including the following steps: All excellent antibodies are arranged in descending order of predicted similarity to obtain the excellent antibody sequences. The predicted similarity of the last excellent antibody in the excellent antibody sequence is used as the benchmark similarity. The first excellent antibody in the excellent antibody sequence is selected as a candidate excellent antibody. The number of clones of the candidate excellent antibody is obtained by multiplying the ratio of the predicted similarity of the candidate excellent antibody to the baseline similarity by the minimum number of times. The candidate excellent antibody is cloned a number of times to obtain multiple cloned antibodies corresponding to the candidate excellent antibody, and the cloned antibody group of the candidate excellent antibody is obtained by summing them. The next excellent antibody in the excellent antibody sequence is taken as a candidate excellent antibody. The process is repeated by multiplying the ratio of the predicted similarity of the candidate excellent antibody to the baseline similarity by the number of times the minimum similarity is guaranteed, until the clonal antibody group corresponding to each excellent antibody is obtained, and then the clonal antibody set is obtained.

[0010] In some embodiments, the cloned antibody set includes multiple cloned antibodies corresponding to each superior antibody. The cloned antibody set is mutated based on the number of iterations and the optimal antibody. Then, a temporary population is obtained by selecting a third number of antibodies in combination with the superior antibodies, including the following steps: The iterative mutation strength is updated based on the maximum mutation strength, minimum mutation strength, number of iterations, and first-time threshold. The expression for the intensity of iterative mutation is: ; In the formula, Indicates the intensity of iterative mutation. Indicates the minimum variation intensity. represents the maximum mutation intensity, g represents the current iteration number, and MaxG represents the first iteration threshold; The first clonal antibody in the clonal antibody set is selected as the candidate clonal antibody. Based on iterative mutation intensity, optimal antibody, normally distributed random numbers, and preset correlation coefficients, mutation operations are performed on candidate clone antibodies to obtain mutated antibodies of candidate clone antibodies; The expression for the mutant antibody is: ; In the formula, express Mutant antibodies, This represents the j-th clone antibody corresponding to the i-th excellent antibody. Represents the correlation coefficient. This indicates the optimal antibody. Indicates the intensity of iterative mutation. This represents a normal distribution with a mean of 0 and a standard deviation of 1. The next clone antibody in the clone antibody set is taken as a candidate clone antibody. The steps of performing mutation operation on the candidate clone antibody based on iterative mutation intensity, optimal antibody, normally distributed random number and preset correlation coefficient are returned until the mutated antibody corresponding to each clone antibody is obtained. All mutated antibodies are summarized to obtain the mutated antibody set. For each variant antibody in the set of variant antibodies, a second prediction verification is performed using a neural network and the target dataset to obtain the predicted similarity of each variant antibody. The mutant antibody set and all excellent antibodies were combined to form a candidate population; The number of third candidates is determined based on the number of antibodies in the candidate population whose predicted similarity is greater than the second threshold. The fourth candidate quantity is determined by multiplying the first quantity by the preset ratio; The maximum value between the third and fourth candidate numbers is taken as the third number; The second antibody sequence is obtained by arranging all antibodies in the candidate population in descending order of predicted similarity. The third number of antibodies preceding the second antibody sequence is used as a temporary population.

[0011] In some embodiments, each antibody in the temporary population is associated with a predicted similarity. New antibodies are generated based on the number of iterations, the optimal antibody, and random antibodies in the parameter population. The number of antibodies in the temporary population is then replenished to a first quantity using these new antibodies. This includes the following steps: If the predicted similarity of an antibody in the temporary population is greater than the predicted similarity of the optimal antibody, the optimal antibody is updated using the antibody with the highest predicted similarity in the temporary population. The fourth quantity is determined based on the difference between the first and third quantities; The initial generation quantity is 0; Two random antibodies are randomly selected from the parameter population; New antibodies are generated based on random antibodies, optimal antibodies, number of iterations, first-stage threshold, and preset correlation coefficients. The expression for the new antibody is as follows: ; In the formula, Indicates a new antibody, and Both represent correlation coefficients. This indicates the optimal antibody. and Let g represent the current iteration number, and MaxG represent the threshold for the first iteration. Represents the natural constant; Increment the number of generated antibodies, and return to the step of randomly selecting two random antibodies from the parameter population, until the number of generated antibodies reaches the fourth number. All new antibodies were added to the temporary population.

[0012] In some embodiments, the neural network includes an input layer, a hidden layer, and an output layer. The number of neurons in the input layer is determined based on the total types of geological parameters and drilling parameters, and the number of neurons in the output layer is determined based on the total types of mud components. The target dataset includes a test set and a validation set, with the test set used for first prediction validation. Before using the prediction model to predict mud proportions based on real-time geological parameters and real-time drilling parameters, the method further includes the following steps: Use the first data sample in the validation set as the validation sample; The validation sample is input into the prediction model so that the prediction model can process the geological parameters and drilling parameters of the validation sample to obtain the second predicted mud ratio. Based on the second predicted mud ratio corresponding to the verification sample and the formulation ratio of various mud components in the label data, the second similarity of the verification sample is obtained by cosine similarity calculation; The next data sample in the validation set is used as the validation sample. The process of inputting the validation sample into the prediction model is repeated until the second similarity corresponding to each data sample in the validation set is obtained. Then, the validation similarity corresponding to the prediction model is obtained by standard deviation statistics. If the similarity is lower than the second threshold, the number of neurons in the hidden layer of the neural network is randomly adjusted to update the topology of the neural network. Increment the number of loops, reset the number of iterations, return to execute the step of initializing the parameter population based on the topology, until the similarity is verified to be no less than the second threshold, and update the prediction model; If the number of iterations exceeds the threshold of the second iteration, the prediction model is updated based on the optimal antibody from the last iteration.

[0013] To achieve the above objectives, another aspect of the present invention provides a mud mixing device based on clonal selection, the device comprising: The first module is used to acquire the target dataset; each data sample in the target dataset includes geological parameters and drilling parameters, and each data sample is labeled with the formula ratio of mud components; The second module is used to initialize the number of iterations and the topology of the neural network, and to initialize the parameter population based on the topology; wherein, the parameter population includes a first number of antibodies, and each antibody includes a set of network parameters corresponding to the topology; The third module is used to traverse each antibody in the parameter population, perform the first prediction verification using the neural network and the target dataset, and obtain the prediction similarity corresponding to each antibody. The fourth module is used to determine the optimal parameters based on the corresponding antibody when there is a predicted similarity greater than the first threshold; otherwise, it selects a second number of excellent antibodies based on the predicted similarity and takes the antibody with the highest predicted similarity as the optimal antibody. The fifth module is used to clone all the excellent antibodies to obtain a set of cloned antibodies; the number of cloning operations is positively correlated with the predicted similarity of the corresponding excellent antibodies. The sixth module is used to perform mutation operations on the cloned antibody set based on the number of iterations and the best antibody, and then combine excellent antibodies to screen a third number of antibodies through selection operations to obtain a temporary population; The seventh module is used to generate new antibodies based on the number of iterations, the optimal antibody, and random antibodies in the parameter population if the third quantity is less than the first quantity, and to supplement the number of antibodies in the temporary population to the first quantity using the new antibodies; The eighth module is used to increment the number of iterations if the number of iterations does not exceed the threshold of the first iteration, use the temporary population as the parameter population, and return to execute the operation of the third module until the optimal parameters are determined; if the number of iterations exceeds the threshold of the first iteration, the optimal parameters are determined based on the optimal antibody. The ninth module is used to apply the optimal parameters to the neural network to obtain the prediction model, and then use the prediction model to predict the mud ratio based on real-time geological parameters and real-time drilling parameters.

[0014] To achieve the above objectives, another aspect of the present invention provides an electronic device, which includes a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the aforementioned method.

[0015] To achieve the above objectives, another aspect of the present invention provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the aforementioned method.

[0016] To achieve the above objectives, another aspect of the present invention provides a computer program product, including a computer program that, when executed by a processor, implements the aforementioned method.

[0017] The embodiments of the present invention include at least the following beneficial effects: The present invention provides a mud formulation method, apparatus, electronic device, storage medium, and program product based on clonal selection. This scheme obtains a target dataset; wherein each data sample in the target dataset includes geological parameters and drilling parameters, and each data sample is labeled with the formulation ratio of mud components; initializes the number of iterations and the topology of the neural network, and initializes a parameter population based on the topology; wherein the parameter population includes a first number of antibodies, and each antibody includes a set of network parameters corresponding to the topology; traverses each antibody in the parameter population, performs a first prediction verification using the neural network and the target dataset, and obtains the prediction similarity corresponding to each antibody; when there is a prediction similarity greater than a first threshold, the optimal parameter is determined according to the corresponding antibody; otherwise, a second number of excellent antibodies are selected based on the prediction similarity, and the antibody with the highest prediction similarity is taken as the optimal antibody; for all Superior antibodies are cloned to obtain a set of cloned antibodies. The number of cloning operations is positively correlated with the predicted similarity of the corresponding superior antibodies. Based on the number of iterations and the optimal antibody, the cloned antibody set is mutated. Then, combined with the superior antibodies, a third number of antibodies are selected through a selection operation to obtain a temporary population. If the third number is less than the first number, new antibodies are generated based on the number of iterations, the optimal antibody, and random antibodies in the parameter population. The number of antibodies in the temporary population is supplemented to the first number using the new antibodies. If the number of iterations does not exceed the first threshold, the number of iterations is incremented. The temporary population is used as the parameter population, and the step of traversing each antibody in the parameter population is repeated until the optimal parameters are determined. If the number of iterations exceeds the first threshold, the optimal parameters are determined based on the optimal antibody. The optimal parameters are applied to a neural network to obtain a prediction model. The prediction model is used to predict mud ratios based on real-time geological parameters and real-time drilling parameters. This invention is based on a clonal selection algorithm coupled with a neural network. Driven by mud mixing data samples, it automatically optimizes network parameters, effectively overcoming the shortcomings of traditional methods that rely excessively on human experience. It also enables objectivity and intelligentization of mixing decisions. Furthermore, through antibody prediction similarity assessment, adaptive clonal mutation, and iterative evolution mechanisms, this invention can quickly converge to the optimal network parameters with limited experimental samples, significantly reducing the number of trials and human intervention, and effectively improving the efficiency of mixing scheme determination. Finally, the resulting prediction model outputs an appropriate mud formula in real time based on the input geological and drilling parameters, exhibiting excellent dynamic response capabilities. This overcomes the shortcomings of existing technologies, such as poor real-time performance and difficulty in adapting to changing working conditions, making it suitable for complex and variable geological drilling environments. Attached Figure Description

[0018] Figure 1 This is a schematic diagram of an implementation environment for the clonal selection-based mud mixing method provided in this embodiment of the invention; Figure 2 This is a schematic flowchart of the clonal selection-based mud mixing method provided in an embodiment of the present invention; Figure 3 This is a schematic diagram of the overall process of the clonal selection-based mud mixing method provided in the embodiments of the present invention; Figure 4 This is a schematic diagram of the clonal selection-based mud mixing device provided in an embodiment of the present invention; Figure 5 This is a schematic diagram of the structure of the electronic device provided in an embodiment of the present invention. Detailed Implementation

[0019] To make the objectives, technical solutions, and advantages of this invention clearer, the 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 merely illustrative of the invention and are not intended to limit the invention. In the following description, when referring to the accompanying drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the embodiments of this invention; they are merely examples of apparatuses and methods consistent with some aspects of the embodiments of this invention as detailed in the appended claims.

[0020] It is understood that the terms "first," "second," etc., used in this invention may be used to describe various concepts, but unless specifically stated otherwise, these concepts are not limited by these terms. These terms are only used to distinguish one concept from another. For example, without departing from the scope of embodiments of this invention, first information may also be referred to as second information, and similarly, second information may also be referred to as first information. Depending on the context, the words "if" or "when" as used herein may be interpreted as "when," "in response to determination," or "in the event of a determination."

[0021] The terms “at least one,” “multiple,” “each,” “any,” etc., used in this invention, “at least one” includes one, two, or more than two; “multiple” includes two or more than two; “each” refers to each of the corresponding multiple; and “any” refers to any one of the multiple.

[0022] Unless otherwise defined, all technical and scientific terms used in this invention have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains. The terminology used in this invention is for descriptive purposes only and is not intended to limit the invention.

[0023] To facilitate understanding of the technical solution of this invention, the key terms that may be involved in the technical solution of this invention will first be explained: Ocean drilling refers to drilling activities at the bottom of the deep sea to obtain core samples of the Earth's crust and upper mantle in order to study the Earth's internal structure and geological changes. This process involves using specialized drilling equipment and vessels, such as ocean drilling ships, to drill at depths of several thousand meters on the seabed. This process not only helps scientists understand the Earth's internal structure but also reveals important geological phenomena such as the Earth's historical changes and plate tectonics. For example, by analyzing the sediments and rock composition in the core samples, we can understand historical information such as climate change and biological succession.

[0024] Drilling fluid, often referred to as the "blood" of drilling operations or borehole flushing fluid, can be broadly categorized based on its composition into water, mud, clay-free flushing fluid, emulsions, foam, and compressed air. In today's drilling engineering field, drilling fluid plays an increasingly crucial role. Effective solutions to many complex problems often rely on the rational adjustment or precise optimization of the drilling fluid system's performance. Mud proportioning, as the fundamental form of drilling fluid proportioning, exhibits a progressive relationship between the two in terms of material selection, functional planning, and dynamic control. In actual engineering projects, mud is typically identified as the core component of the drilling fluid based on specific geological conditions, followed by the addition of other functional additives to construct a complete drilling fluid system. Mud mixing is a crucial task requiring comprehensive consideration of multiple factors. Geological conditions are paramount, as different geological formations significantly alter mud performance requirements. Groundwater conditions are also critical, with water level and flow velocity affecting mud stability. Furthermore, the characteristics and requirements of the construction process also influence mud mixing. Mud components primarily include water, bentonite, and additives. Water is the fundamental carrier of the mud, and its quality impacts its performance. Bentonite possesses excellent suspension and thixotropic properties, effectively improving mud viscosity and wall-supporting capabilities. Additives are diverse, each with different functions. For example, soda ash improves bentonite dispersibility and increases mud preparation rate; CMC enhances mud viscosity and shear strength, preventing mud loss. Common mud mixing methods are based on existing engineering experience, combined with specific geological conditions, to initially determine the component ratios, and finally, through extensive experimentation, finalize the composition. This invention proposes a mud composition ratio method based on BP neural network. By analyzing a large amount of data, the mud composition ratio is predicted based on machine learning, which can improve the mud ratio efficiency.

[0025] The Clone Selection Algorithm (CSA) is an important branch of artificial immune algorithms. It searches for the global optimum by simulating the selection, cloning, mutation, and updating behaviors of B cells in a living organism. It possesses excellent self-learning and adaptive capabilities, as well as strong robustness, giving it significant advantages in intelligent optimization algorithms. It is widely used in scheduling, fault diagnosis, and intrusion detection.

[0026] A back propagation (BP) neural network is a multilayer feedforward neural network trained using an error backpropagation algorithm, and it is one of the most widely used neural network models. The BP neural network process mainly consists of two stages: the first stage is the forward propagation of the signal, from the input layer through the hidden layers, and finally to the output layer; the second stage is the backward propagation of the error, from the output layer to the hidden layers, and finally to the input layer, adjusting the weights and biases from the hidden layers to the output layer, and from the input layer to the hidden layers, in sequence.

[0027] Backpropagation (BP) neural network: consists of an input layer, hidden layers, and an output layer. Input layer: receives the data from the BP neural network; the number of input layers depends on the number of input variables. Hidden layer: maps the data x from the input layer; simply put, refer to the formula... In this context, w and b are called weights and threshold parameters, respectively, and F() is the mapping rule, also known as the activation function. In other words, the hidden layer maps the input influencing factor data x, producing mapped values. There can be multiple hidden layers, and the number of neural networks in each hidden layer can be customized. Output layer: The output of the BP neural network; the number of output layers depends on the number of output variables. Simply put, refer to the formula... Here, w and b are the weight and threshold parameters, respectively. Gradient descent algorithm: By calculating the deviation between the output result and the y-value input to the neural network model, the algorithm adjusts the weights and threshold parameters accordingly. In summary, for a BP neural network, the values ​​of weight w and threshold b are crucial. This invention does not use the commonly used gradient descent algorithm, but instead introduces a swarm intelligence method to find the optimal weights w and threshold b, thereby improving the prediction accuracy of the BP neural network.

[0028] K-fold cross-validation is a commonly used technique for evaluating the performance of machine learning models. The specific process is as follows: First, the entire dataset is uniformly divided into K non-overlapping subsets (or "folds"), with each subset maintaining a consistent data distribution to ensure similar proportions of samples from each category. 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. This process is repeated K times, resulting in K performance evaluation scores. The average of these scores is typically used as the final model evaluation metric. The advantage of K-fold cross-validation is that it makes better use of all data for training and testing, provides valuable information about model stability and reliability, and helps avoid overfitting during model selection and parameter tuning.

[0029] In related technologies, common mud mixing methods are based on the mixing experience of existing projects, combined with the specific geological conditions of the current situation, and then the composition ratio is initially determined. Finally, the mixing components are determined through a large number of experiments. The whole process is highly dependent on human experience.

[0030] In view of this, this invention provides a mud formulation method and related equipment based on cloning selection. This method involves acquiring a target dataset; each data sample in the target dataset includes geological parameters and drilling parameters, and each data sample is labeled with the formulation ratio of mud components; initializing the number of iterations and the topology of the neural network, and initializing a parameter population based on the topology; the parameter population includes a first number of antibodies, each antibody including a set of network parameters corresponding to the topology; traversing each antibody in the parameter population, performing a first prediction verification using the neural network and the target dataset to obtain the predicted similarity for each antibody; when a predicted similarity greater than a first threshold exists, the optimal parameter is determined based on the corresponding antibody; otherwise, a second number of excellent antibodies are selected based on the predicted similarity, and the antibody with the highest predicted similarity is taken as the optimal antibody; cloning operations are performed on all excellent antibodies. A set of cloned antibodies is obtained; the number of cloning operations is positively correlated with the predicted similarity of the corresponding superior antibodies; the cloned antibody set is mutated based on the number of iterations and the optimal antibody, and then a third number of antibodies are selected by selection operations to obtain a temporary population. If the third number is less than the first number, a new antibody is generated based on the number of iterations, the optimal antibody, and random antibodies in the parameter population, and the number of antibodies in the temporary population is supplemented to the first number using the new antibody; if the number of iterations does not exceed the first number threshold, the number of iterations is incremented, the temporary population is used as the parameter population, and the step of traversing each antibody in the parameter population is returned until the optimal parameter is determined; if the number of iterations exceeds the first number threshold, the optimal parameter is determined based on the optimal antibody; the optimal parameter is applied to the neural network to obtain a prediction model, and the prediction model is used to predict mud ratio based on real-time geological parameters and real-time drilling parameters. This invention is based on a clonal selection algorithm coupled with a neural network. Driven by mud mixing data samples, it automatically optimizes network parameters, effectively overcoming the shortcomings of traditional methods that rely excessively on human experience. It also enables objectivity and intelligentization of mixing decisions. Furthermore, through antibody prediction similarity assessment, adaptive clonal mutation, and iterative evolution mechanisms, this invention can quickly converge to the optimal network parameters with limited experimental samples, significantly reducing the number of trials and human intervention, and effectively improving the efficiency of mixing scheme determination. Finally, the resulting prediction model outputs an appropriate mud formula in real time based on the input geological and drilling parameters, exhibiting excellent dynamic response capabilities. This overcomes the shortcomings of existing technologies, such as poor real-time performance and difficulty in adapting to changing working conditions, making it suitable for complex and variable geological drilling environments.

[0031] It is understood that the clonal selection-based mud mixing method provided by this 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 communication, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms. Optionally, the terminal can be a smartphone, tablet, laptop, or desktop computer, but it is not limited to these.

[0032] like Figure 1 The diagram shown is a schematic representation of an implementation environment provided by an embodiment of the present invention. (Refer to...) 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 via a network, either wirelessly or via a wired connection, to complete data transmission and exchange.

[0033] Server 101 can be a standalone physical server, a server cluster or distributed system consisting 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 communication, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms.

[0034] Additionally, server 101 can also be a node server in a blockchain network. Blockchain is a novel application model of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanisms, and encryption algorithms.

[0035] Terminal 102 can be a smartphone, tablet computer, laptop computer, desktop computer, smart speaker, smartwatch, etc., but is not limited to these. Terminal 102 and server 101 can be directly or indirectly connected via wired or wireless communication, and this embodiment of the invention does not impose any limitations.

[0036] For example, based on Figure 1 The implementation environment shown in this embodiment of the invention provides a mud mixing method based on clone selection. The following description uses the application of this mud mixing method based on clone selection in server 101 as an example. It can be understood that this mud mixing method based on clone selection can also be applied to terminal 102.

[0037] Reference Figure 2 , Figure 2 This is an optional flowchart of the cloning-selection-based mud mixing method provided in the embodiments of the present invention. The executing entity of the cloning-selection-based mud mixing method can be any of the aforementioned computer devices (including servers or terminals). Figure 2 The method may include, but is not limited to, steps S100 to S900.

[0038] Step S100: Obtain the target dataset; Each data sample in the target dataset includes geological parameters and drilling parameters, and each data sample is labeled with the formula ratio of mud components. For example, in some specific embodiments, the data used in this invention mainly comes from publicly available datasets both domestically and internationally. The feature vectors of each data set cover two main categories of parameters: geological and drilling information. Geological information includes rock type, formation porosity, density, permeability, gas / water content, formation pressure, and pH. Drilling information includes well depth, well diameter, drilling pressure, footage, pump pressure, pump flow rate, riser pressure, and casing pressure. The number of input parameters is typically between 15 and 20, with the specific dimensions determined based on the actual collected data, generally around 20. The output target is the mud formulation parameters, i.e., the specific proportions of various components (summing to 1). The specific component composition and output layer dimensions need to be determined based on the selected drilling fluid system. Commonly used systems include: the improved PEC system suitable for upper and middle formations in offshore drilling; the PEM system suitable for medium-deep formations, extended reach wells, and horizontal wells; the EZFLOW system suitable for extended reach wells and horizontal wells while also protecting the oil reservoir; and a stealthy acid completion fluid system specifically designed for well completion operations. Specifically, the system can collect input data including 20 features such as rock type, formation porosity, density, permeability, gas content, water content, formation pressure, well depth, well diameter, drilling pressure, footage, pump pressure, pump discharge rate, riser pressure, and casing pressure. The label data is the formula ratio of the mud composition.

[0039] Step S200: Initialize the number of iterations and the topology of the neural network, and initialize the parameter population based on the topology; The parameter population includes a first number of antibodies, and each antibody includes a set of network parameters corresponding to the topology. For example, in some specific embodiments, the present invention uses a three-layer BP neural network, with the number of neurons in the input layer being [missing information]. (In this invention, (Constantly 20), the number of hidden layer neurons is The number of neurons in the output layer is (In this invention, (Constant value 5), activation function is Sigmoid function, number of hidden layer neurons and the number of neurons in the input layer There is an approximate relationship between them, as shown in the following formula, where k is a random value in the range [0, 10], with a default value of 5: (* indicates multiplication, and the same applies to subsequent multiplications); The initialization of the population can be achieved as follows: The population consists of a large number of antibodies, each with multiple parameters, representing the weight parameters w and threshold parameters b of a BP neural network. Assume the current network topology is 20- -5, the total weight parameter w to be optimized is... There are a total of [number] threshold parameters b to be optimized. There are a total of 1, meaning the cloning selection algorithm searches for a total of 1,000 optimization variables. .

[0040] Assuming the network topology is 20-10-5, there are a total of 20*10+10*5=250 weight parameters w to be optimized, and a total of 10+1=11 threshold parameters b to be optimized. That is, the cloning selection algorithm searches for a total of 250+11=261 optimization variables.

[0041] The core of population initialization is to generate maxS antibodies (this can be customized, with a default of 20). For each antibody, the corresponding parameters are initialized: the weight parameter w and the threshold parameter b, as shown in the formula below. The values ​​of both the weight parameter w and the threshold parameter b are in the range [-1, 1]. This represents a normal distribution with a mean of 0 and a standard deviation of 1.

[0042] ; ; ; Step S300: Traverse each antibody in the parameter population, use the neural network and the target dataset to perform the first prediction verification, and obtain the prediction similarity corresponding to each antibody; It should be noted that the target dataset includes a test set. In some embodiments, step S300 may include the following steps: using the first antibody of the parameter population as a candidate antibody; determining candidate parameters based on the candidate antibody, applying the candidate parameters to a neural network to obtain a candidate model; using the first data sample of the test set as a candidate sample; inputting the candidate sample into the candidate model so that the candidate model processes the geological parameters and drilling parameters of the candidate sample to obtain a first predicted mud ratio; based on the first predicted mud ratio corresponding to the candidate sample and the formulation ratio of various mud components in the label data, obtaining the first similarity of the candidate sample through cosine similarity calculation; using the next data sample of the test set as a candidate sample, returning to execute the step of inputting the candidate sample into the candidate model until the first similarity corresponding to each data sample in the test set is obtained, and then obtaining the predicted similarity corresponding to the candidate antibody through standard deviation statistics; using the next antibody of the parameter population as a candidate antibody, returning to execute the step of determining candidate parameters based on the candidate antibody until the predicted similarity corresponding to each antibody in the parameter population is obtained.

[0043] For example, in some specific implementations, similarity calculation based on a prediction model can be achieved as follows: The similarity is calculated for each antibody in the current population. Each antibody represents a key parameter of the BP neural network, meaning each antibody represents a BP neural network prediction model. Based on each antibody, each array in the test set is traversed and input into the BP neural network prediction model to obtain the similarity. The formula is as follows. The standard deviation is calculated from the similarity of all test data. It is used to evaluate the accuracy of the BP neural network model.

[0044] ; ; ; in The output dimension is the quantity of drilling fluid components. A vector representing the predicted proportions. This represents the predicted proportion of the i-th component. A vector representing the actual proportions. This represents the actual proportion of the i-th component (i.e., from test data). This is the cosine of the predicted and true vectors, ranging from -1 to 1. A larger value indicates greater similarity in direction. The antibody with the highest similarity is obtained by iterating through the population, i.e., the best-performing antibody. .

[0045] ; Step S400: When there is a predicted similarity greater than the first threshold, the optimal parameters are determined according to the corresponding antibody; otherwise, a second number of excellent antibodies are screened based on the predicted similarity, and the antibody with the highest predicted similarity is taken as the optimal antibody. It should be noted that, in some embodiments, the screening of a second number of excellent antibodies based on predicted similarity may include the following steps: determining a first candidate number based on the number of antibodies in the parameter population with predicted similarity greater than a second threshold; determining a second candidate number based on the product of the first number and a preset ratio; taking the maximum value between the first candidate number and the second candidate number as the second number; arranging all antibodies in the parameter population in descending order of predicted similarity to obtain a first antibody sequence; and selecting the first second number of antibodies in the first antibody sequence as excellent antibodies.

[0046] For example, in some specific implementations, the similarity of each antibody in the population is traversed. If similarity occurs If an antibody exceeds TargetR (the similarity threshold, which is defined according to requirements, with a default value of 0.95), it means that the optimal parameters have been found, and the inner loop for finding the optimal parameters ends at this point; otherwise, iteration needs to continue.

[0047] Specifically, selecting the Top N excellent antibodies can be achieved by: all antibodies being selected based on predicted similarity. Sort the antibodies from largest to smallest, and then select the top N best antibodies for cloning. Here, N is the number of best antibodies, which dynamically changes with the overall performance of antibody predicted similarity, with a minimum of 20%~60% of maxS, and a default of 40%. Assume that among the antibodies, the similarity... No less than If the number of antibodies (values ​​are chosen based on requirements, default is 0.5) is M, then the formula for calculating N is as follows. The core idea here is that the top N excellent antibodies undergo cloning, mutation, and other operations, forming a new temporary population with the remaining antibodies. Finally, the excess antibodies are eliminated through competition.

[0048] ; ; Step S500: Perform cloning operations on all excellent antibodies to obtain a collection of cloned antibodies; Among them, the number of cloning operations is positively correlated with the predicted similarity of the corresponding excellent antibodies; It should be noted that in some embodiments, step S500 may include the following steps: arranging all excellent antibodies in descending order of predicted similarity to obtain excellent antibody sequences; using the predicted similarity corresponding to the last excellent antibody in the excellent antibody sequence as the baseline similarity; using the first excellent antibody in the excellent antibody sequence as a candidate excellent antibody; multiplying the ratio of the predicted similarity of the candidate excellent antibody to the baseline similarity by the minimum number of times to obtain the number of clones of the candidate excellent antibody; performing cloning operations on the candidate excellent antibody according to the number of clones to obtain multiple cloned antibodies corresponding to the candidate excellent antibody, and summing them to obtain a cloned antibody group of the candidate excellent antibody; using the next excellent antibody in the excellent antibody sequence as a candidate excellent antibody, returning to execute the step of multiplying the ratio of the predicted similarity of the candidate excellent antibody to the baseline similarity by the minimum number of times, until a cloned antibody group corresponding to each excellent antibody is obtained, and then summing them to obtain a cloned antibody set.

[0049] For example, in some specific implementations, the N excellent antibodies selected in the aforementioned steps are traversed, and each excellent antibody is cloned, that is, replicated, at least C times. The number of cloning times is also related to the similarity of the current antibody. Related. The similarity of these N excellent antibodies. They are arranged from largest to smallest, antibodies. Cloning factor The formula for calculating the work is as follows: ; ; Wherein, minC represents the number of times each antibody clone is fixed as a baseline, and the antibody... similarity The larger the number of clones, the more clones. The larger the value, the better. The minimum value for minC is two, which can be determined based on requirements. The core idea of ​​cloning is to preserve more superior antibody genes; the more superior the antibody, the higher the likelihood of preservation.

[0050] ; ; Step S600: Based on the number of iterations and the optimal antibody, a mutation operation is performed on the cloned antibody set, and then a third number of antibodies are selected by combining excellent antibodies to obtain a temporary population. It should be noted that the clonal antibody set includes multiple clonal antibodies corresponding to each superior antibody. In some embodiments, step S600 may include the following steps: updating the iterative mutation intensity based on the maximum mutation intensity, minimum mutation intensity, number of iterations, and a first threshold number; selecting the first clonal antibody in the clonal antibody set as a candidate clonal antibody; performing a mutation operation on the candidate clonal antibody based on the iterative mutation intensity, the optimal antibody, a normally distributed random number, and a preset correlation coefficient to obtain a mutated antibody of the candidate clonal antibody; selecting the next clonal antibody in the clonal antibody set as a candidate clonal antibody, and returning to execute the step of performing a mutation operation on the candidate clonal antibody based on the iterative mutation intensity, the optimal antibody, a normally distributed random number, and a preset correlation coefficient, until a mutated antibody is obtained. For each cloned antibody, a variant antibody is identified, and all variant antibodies are aggregated to obtain a variant antibody set. Each variant antibody in the variant antibody set is iterated over, and a second prediction verification is performed using a neural network and the target dataset to obtain the predicted similarity for each variant antibody. The variant antibody set and all excellent antibodies are aggregated as a candidate population. The number of antibodies in the candidate population with a predicted similarity greater than a second threshold is determined as the third candidate number. The number of antibodies in the candidate population is determined as the product of the first number and a preset ratio. The maximum value between the third and fourth candidate numbers is taken as the third number. All antibodies in the candidate population are arranged in descending order of predicted similarity to obtain the second antibody sequence. The antibodies in the first third number of the second antibody sequence are taken as a temporary population.

[0051] For example, in some specific embodiments, superior antibody mutations can be implemented as follows: Iterate through the collection of cloned antibodies generated in the preceding steps. A mutation formula is applied to each antibody. The mutation simulates immune mutation behavior, introducing random perturbations to enhance the exploration capability. , The minimum and maximum values ​​of the mutation intensity are represented by g, which represents the current iteration number, with a minimum of 1 and a maximum of MaxG (i.e., the threshold for the first iteration). This represents the mutation intensity in the g-th iteration. As the iterations proceed, It will gradually grow bigger. This represents the correlation coefficient, with a value range of [0,1] and a default value of 0.5. This indicates the best antibody currently available. This represents a normal distribution with a mean of 0 and a standard deviation of 1. This indicates that a new antibody has been obtained through mutation. This is done so that, with each iteration, the mutated antibody will gradually move closer to the best antibody.

[0052] ; ; express Mutant antibodies, This represents the j-th clone antibody corresponding to the i-th excellent antibody.

[0053] The selection operation can be implemented as follows: For the mutated antibody set, each antibody (with weight parameter w and threshold parameter b) represents a backpropagation (BP) neural network. The process iterates through each antibody in the mutated antibody set, applies the antibody gene to the BP neural network, inputs historical data for mud ratio identification and prediction, and compares the prediction results with real label data to calculate the similarity. For N (i.e., the third quantity, defined in the same way as the second quantity) excellent antibodies, and all cloned antibodies, a temporary population is formed, and then... Sort the antibodies from largest to smallest and select the top N antibodies to proceed to the next iteration.

[0054] Step S700: If the third quantity is less than the first quantity, generate a new antibody based on the number of iterations, the optimal antibody, and random antibodies in the parameter population, and use the new antibody to supplement the number of antibodies in the temporary population to the first quantity. It should be noted that each antibody in the temporary population is associated with a predicted similarity. In some embodiments, new antibodies are generated based on the number of iterations, the optimal antibody, and random antibodies in the parameter population. The number of antibodies in the temporary population is then supplemented to the first quantity using these new antibodies. This process may include the following steps: if the predicted similarity of an antibody in the temporary population is greater than that of the optimal antibody, the optimal antibody is updated using the antibody with the highest predicted similarity in the temporary population; a fourth quantity is determined based on the difference between the first and third quantities; the generated quantity is initialized to 0; two random antibodies are randomly selected from the parameter population; new antibodies are generated based on the random antibodies, the optimal antibody, the number of iterations, the first number threshold, and a preset correlation coefficient; the generated quantity is incremented, and the step of randomly selecting two random antibodies from the parameter population is repeated until the generated quantity reaches the fourth quantity; all new antibodies are then added to the temporary population.

[0055] For example, in some specific implementations, by obtaining N antibodies, the population size needs to be maintained at maxS antibodies. Therefore, it is necessary to randomly generate maxS-N new antibodies to maintain population diversity. There is a special case where N is maxS, in which case no additional antibodies need to be added.

[0056] Newly generated antibodies The calculation formula is as follows, where, and It was randomly selected from the existing maxS antibodies. and Both represent correlation coefficients, with values ​​ranging from [0,1] and a default value of 0.5. This indicates the best antibody currently available. This represents the perturbation parameter in the g-th iteration. This represents the newly generated antibodies. A total of maxS-N new antibodies are generated, at which point a new generation of antibody population is obtained.

[0057]

[0058] One important detail to mention is the predicted similarity of the selected N antibodies. The calculations have been completed and supplemented. Several new antibodies need to be identified, and these antibodies require calculation of predicted similarity. Together, these two groups form a new generation of N antibody populations. Predicted similarity has already been calculated. Antibodies can be processed without undergoing secondary calculations, thus improving processing speed.

[0059] Step S800: If the number of iterations does not exceed the threshold of the first iteration, increment the number of iterations, use the temporary population as the parameter population, and return to the step of traversing each antibody of the parameter population until the optimal parameters are determined. If the number of iterations exceeds the threshold of the first iteration, the optimal parameters are determined based on the optimal antibody. For example, in some specific implementations, steps S300 to S800 belong to the inner loop of the clonal selection algorithm for optimization. Each time it is executed, the iteration count is incremented by 1. If the current iteration count exceeds the maximum iteration count MG, the optimal parameters are determined directly based on the latest optimal antibody; otherwise, iteration needs to continue. The maximum iteration parameter MG (i.e., the first iteration threshold) can be defined according to requirements, with a default value of 10.

[0060] Step S900: Apply the optimal parameters to the neural network to obtain the prediction model, and use the prediction model to predict the mud ratio based on real-time geological parameters and real-time drilling parameters. It should be noted that the neural network includes an input layer, a hidden layer, and an output layer. The number of neurons in the input layer is determined based on the total types of geological parameters and drilling parameters, and the number of neurons in the output layer is determined based on the total types of mud components. The target dataset includes a test set and a validation set. The test set is used for the first prediction validation. In some embodiments, before using the prediction model to predict mud ratios based on real-time geological parameters and real-time drilling parameters, the method may further include the following steps: using the first data sample of the validation set as a validation sample; inputting the validation sample into the prediction model so that the prediction model processes the geological parameters and drilling parameters of the validation sample to obtain a second predicted mud ratio; and based on the second predicted mud ratio corresponding to the validation sample and the formulation ratio of various mud components in the label data, ... The second similarity of the validation samples is obtained through cosine similarity calculation; the next data sample in the validation set is used as the validation sample, and the process of inputting the validation sample into the prediction model is repeated until the second similarity corresponding to each data sample in the validation set is obtained. Then, the validation similarity corresponding to the prediction model is obtained through standard deviation statistics; if the validation similarity is lower than the second threshold, the number of neurons in the hidden layer of the neural network is randomly adjusted to update the topology of the neural network; the number of iterations is incremented, the number of iterations is reset, and the process of initializing the parameter population based on the topology is repeated until the validation similarity is not lower than the second threshold, and the prediction model is updated; if the number of iterations exceeds the second threshold, the prediction model is updated based on the optimal antibody of the last iteration.

[0061] For example, in some specific implementations, optimal parameters are obtained. Afterwards, the neural network weights w and threshold b have been optimally adjusted. The BP neural network model for predicting mud ratios is ready for the validation set data. It iterates through each antibody in the current population, calculating the similarity. Each antibody represents a key parameter of the BP neural network, meaning each antibody represents a BP neural network prediction model. Based on each antibody, it iterates through each array in the validation set, inputting it into the BP neural network prediction model to obtain the similarity. The standard deviation of the similarity of all validation data was calculated. It is used to evaluate the accuracy of the BP neural network model. This calculation process is consistent with the implementation of step S300, the difference being that step S300 is for test data, while this is for validation data.

[0062] If the validation set corresponds to If the value is not lower than TargetR (i.e., the second threshold, which is defined according to requirements, with a default value of 0.95), it means that the optimal parameters have been found, and the inner loop for finding the optimal parameters ends at this point.

[0063] if If the value is below the TargetR, it indicates that the current model still has room for optimization and requires further iteration. This involves resetting parameters related to the cloning selection algorithm, including clearing and resetting the antibody population, resetting the inner loop iteration count to 0, clearing and resetting all backpropagation neural networks, and resetting the outer loop iteration count to 0. This also affects the number of hidden layers. Make random adjustments. The adjustment formula is as follows: ; in This represents a random integer value in the range [-5, 5], which means that a certain number of neural network units will be added or removed each time (with a minimum value of k), thereby improving the prediction accuracy of the BP neural network.

[0064] To avoid infinite iteration, an outer loop iteration count (i.e., the second number threshold) is set. If the number of iterations exceeds the maximum iteration count MaxCSCnt (i.e., the second number threshold), the prediction model is updated based on the optimal antibody from the last iteration.

[0065] To explain in detail the principle of the technical solution of the present invention, the overall process of the present invention will be described below with reference to some specific embodiments. It is easy to understand that the following is an explanation of the technical principle of the present invention and should not be regarded as a limitation of the present invention.

[0066] To address the shortcomings of existing technologies, this invention proposes a mud mixing method based on clonal selection. By employing a clonal selection algorithm to find the optimal parameters of a BP neural network, a prediction model for ocean drilling mud mixing is obtained, such as... Figure 3 As shown, the clonal selection-based mud mixing method of the present invention can be specifically implemented as follows: Step 1: Divide the data into test and validation sets. The data used in this invention mainly comes from publicly available datasets both domestically and internationally. The feature vectors of each data set cover two main categories of parameters: geological and drilling information. Geological information includes rock type, formation porosity, density, permeability, gas / water content, formation pressure, and pH. Drilling information includes well depth, well diameter, drilling pressure, footage, pump pressure, pump displacement, riser pressure, and casing pressure. The number of input parameters is typically between 15 and 20, with the specific dimensions determined based on the actual collected data, generally around 20. The output target is the mud formulation parameters, i.e., the specific proportions of various components (summing to 1). The specific component composition and output layer dimensions need to be determined based on the selected drilling fluid system. Commonly used systems include: the improved PEC system suitable for upper and middle formations in offshore drilling; the PEM system suitable for medium-deep formations, extended reach wells, and horizontal wells; the EZFLOW system suitable for extended reach wells and horizontal wells while also protecting the oil reservoir; and a stealthy acid completion fluid system specifically designed for well completion operations.

[0067] This invention employs a K-fold cross-validation method to divide the test and validation sets. The value of K is typically set to 5 to 10 (default is 10), with the specific value depending on the amount of data. The specific process is as follows: Divide the dataset into K subgroups; randomly select a specified number (VerifySize, usually 2, configurable) of subgroups as the validation set; the remaining K-VerifySize subgroups constitute the test set. Proceed to step 2.

[0068] Step 2: Update the BP topology. Based on the data obtained in Step 1, input data including 20 features are compiled, such as rock type, formation porosity, density, permeability, gas content, water content, formation pressure, well depth, well diameter, drilling pressure, footage, pump pressure, pump flow rate, riser pressure, and casing pressure. The label data is the mud composition formula ratio. This invention uses a three-layer BP neural network, with the number of neurons in the input layer being... (In this invention, (Constantly 20), the number of hidden layer neurons is The number of neurons in the output layer is (In this invention, (Constant value 5), activation function is Sigmoid function, number of hidden layer neurons and the number of neurons in the input layer There is an approximate relationship between them, as shown in the following formula, where k is a random value in the range [0, 10], with a default value of 5:

[0069] The first time step 3 is executed, the network topology is 20-10-5. The number of hidden layers increases with each subsequent execution of step 3. Random adjustments will be made. The adjustment formula is as follows, where... This represents a random integer value in the range [-5, 5], meaning that a certain number of neural network units will be added or removed each time (with a guaranteed minimum value of k), thereby improving the prediction accuracy of the BP neural network. Proceed to step 3.

[0070]

[0071] Step 3: Initialize the population. The population consists of a large number of antibodies, each with multiple parameters, representing the weight parameters w and threshold parameters b of the BP neural network. Based on Step 2, the current network topology is 20- -5, the total weight parameter w to be optimized is... There are a total of [number] threshold parameters b to be optimized. There are a total of 1, meaning the cloning selection algorithm searches for a total of 1,000 optimization variables. .

[0072] Taking the first execution as an example, the network topology is 20-10-5. There are a total of 20*10+10*5=250 weight parameters w to be optimized, and a total of 10+1=11 threshold parameters b to be optimized. That is, the cloning selection algorithm searches for a total of 250+11=261 optimization variables.

[0073] The core of population initialization is to generate maxS antibodies (this can be customized, with a default of 20). For each antibody, the corresponding parameters are initialized: the weight parameter w and the threshold parameter b, as shown in the formula below. The values ​​of both the weight parameter w and the threshold parameter b are in the range [-1, 1]. This represents a normal distribution with a mean of 0 and a standard deviation of 1. Proceed to step 4.

[0074]

[0075]

[0076]

[0077] In step 1, the test set was obtained; in step 2, the topology of the BP neural network was defined. With the test set data in hand, the mud-equipped predictive BP neural network model is ready. Proceed to step 4.

[0078] Step 4: Calculate similarity based on the prediction model. Iterate through each antibody in the current population and calculate the similarity. Each antibody represents a key parameter of the BP neural network, meaning each antibody represents a BP neural network prediction model. Based on each antibody, iterate through each array in the test set, inputting it into the BP neural network prediction model to obtain the similarity. The formula is as follows. The standard deviation is calculated from the similarity of all test data. It is used to evaluate the accuracy of the BP neural network model.

[0079]

[0080]

[0081]

[0082] in The output dimension is the quantity of drilling fluid components. A vector representing the predicted proportions. This represents the predicted proportion of the i-th component. A vector representing the actual proportions. This represents the actual proportion of the i-th component (i.e., from test data). This is the cosine of the predicted and true vectors, ranging from -1 to 1. A larger value indicates greater similarity in direction. The antibody with the highest similarity is obtained by iterating through the population, i.e., the best-performing antibody. .

[0083]

[0084] For example, assuming the target content is 0.7% water, 0.2% dispersant, and 0.1% polymer, and the model output is 0.6% water, 0.25% dispersant, and 0.15% polymer, then the similarity between the predicted vector [0.6, 0.25, 0.15] and the true vector [0.7, 0.2, 0.1] is... The calculated value is 0.989383. Proceed to step 5.

[0085]

[0086] Step 5: Meet the similarity requirement. Iterate through the similarity of each antibody in the population. If similarity occurs If an antibody exceeds TargetR (the similarity threshold, which is defined according to requirements, with a default value of 0.95), it means that the optimal parameters have been found. At this point, the inner loop for finding the optimal parameters ends, and we proceed to step 13. Otherwise, we need to continue iterating and proceed to step 6.

[0087] Step 6: Select Top N excellent antibodies. All antibodies are selected based on predicted similarity. Sort the antibodies from largest to smallest, and then select the top N best antibodies for cloning. Here, N is the number of best antibodies, which dynamically changes with the overall performance of antibody predicted similarity, with a minimum of 20%~60% of maxS, and a default of 40%. Assume that among the antibodies, the similarity... No less than (The value is chosen based on requirements, defaulting to 0.5) If the number of antibodies is M, then the formula for calculating N is as follows. The core idea here is that the top N excellent antibodies undergo cloning, mutation, and other operations, forming a new temporary population with the remaining antibodies. Finally, the excess antibodies are eliminated through competition. Proceed to step 7.

[0088]

[0089]

[0090] Step 7: Cloning of Excellent Antibodies. Iterate through the N excellent antibodies selected in Step 6, cloning (replicating) each excellent antibody at least C times. The number of cloning iterations is also related to the similarity of the current antibody. Related. Step 6 shows the similarity of these N excellent antibodies. They are arranged from largest to smallest, antibodies. Cloning factor The formula for calculating the work is as follows:

[0091]

[0092] Wherein, minC represents the number of times each antibody clone is fixed as a baseline, and the antibody... similarity The larger the number of clones, the more clones. The larger the value, the better. The minimum value for minC is 2, determined by requirements; the default is 10. The core idea of ​​cloning is to preserve more superior antibody genes; the more superior the antibody, the higher the likelihood of preservation. Proceed to step 8.

[0093]

[0094]

[0095] Step 8: Excellent antibody mutation. Iterate through the set of cloned antibodies generated in Step 7. A mutation formula is applied to each antibody. The mutation simulates immune mutation behavior, introducing random perturbations to enhance the exploration capability. , This represents the minimum and maximum values ​​of the mutation intensity, where g represents the current iteration number, with a minimum of 1 and a maximum of MaxG. This represents the mutation intensity in the g-th iteration. As the iterations proceed, It will gradually grow bigger. This represents the correlation coefficient, with a value range of [0,1] and a default value of 0.5. The best antibody currently available, This represents a normal distribution with a mean of 0 and a standard deviation of 1. This indicates the new antibody obtained through mutation. This is done so that, with each iteration, the mutated antibody will gradually move closer to the optimal antibody. Proceed to step 10.

[0096]

[0097]

[0098] Step 9: Perform the selection operation. For the set of mutated antibodies after step 8, each antibody (with weight parameter w and threshold parameter b) represents a BP neural network. Iterate through each antibody in the set, apply the antibody gene to the BP neural network, input historical data for mud ratio identification and prediction, and compare the prediction results with the real label data to calculate the similarity. Step 6 selects N excellent antibodies (definition principle as in Step 6), along with all cloned antibodies, to form a temporary population, which is then processed according to... Sort the antibodies from largest to smallest and select the top N antibodies to proceed to the next iteration.

[0099] Existing work targets single antibodies. Cloned antibodies, in The best antibody is selected from the cloned antibodies. In this invention, all mutated antibodies and the original antibody are reordered, and the top N antibodies are selected to enter the next round of iteration. This is the biggest difference between the two methods. Proceed to step 10.

[0100] Step 10: Replenish remaining antibodies. Having obtained N antibodies in Step 9, the population size needs to be maintained at maxS antibodies. Therefore, maxS-N new antibodies need to be randomly generated to maintain population diversity. There is a special case where N is maxS; in this case, no additional antibodies need to be replenished.

[0101] Newly generated antibodies The calculation formula is as follows, where, and It was randomly selected from the existing maxS antibodies. and Both represent correlation coefficients, with values ​​ranging from [0,1] and a default value of 0.5. This indicates the best antibody currently available. This represents the perturbation parameter in the g-th iteration. This indicates the generation of new antibodies. A total of maxS-N new antibodies are generated, at which point a new generation of antibody population is obtained. Proceed to step 12.

[0102]

[0103] One important detail to mention is the predicted similarity of the N antibodies selected in step 9. The calculation has been completed; step 10 provides the supplementary information. Several new antibodies need to be identified, and these antibodies require calculation of predicted similarity. Together, these two groups form a new generation of N antibody populations. In step 4, the predicted similarity has already been calculated. The antibody does not undergo secondary calculations, thus improving processing speed.

[0104] Step 11: Exceeding the maximum number of iterations. Steps 4 to 12 belong to the inner loop of the cloning selection algorithm for optimization. Each execution increments the iteration count by 1. If the current iteration count exceeds the maximum number of iterations MG, proceed to step 12; otherwise, continue iterating and return to step 4. The maximum iteration parameter MG is defined according to requirements, with a default value of 10.

[0105] Step 12: Find the optimal parameter vector. Reaching this step indicates that the inner loop of the cloning selection algorithm has been completed, based on... - - The optimal parameters for the network topology have been found. Proceed to step 13.

[0106]

[0107] Step 13: Update the prediction model. In Step 1, the validation set was obtained. In Step 2, the BP network topology was defined. In Step 12, the optimal parameters were obtained. This means the neural network weights w and threshold b have been optimally adjusted. The BP neural network model for mud mix ratio prediction is ready for the validation set data. Proceed to step 14.

[0108] Step 14: Calculate similarity based on the prediction model. Iterate through each antibody in the current population and calculate the similarity. Each antibody represents a key parameter of the BP neural network, meaning each antibody represents a BP neural network prediction model. Based on each antibody, iterate through each array in the validation set, inputting it into the BP neural network prediction model to obtain the similarity. The standard deviation of the similarity of all validation data was calculated. This is used to evaluate the accuracy of the BP neural network model. This calculation process is consistent with step 4, the difference being that step 4 is for test data, while step 14 is for validation data. Proceed to step 15.

[0109] Step 15: Update the iteration count. Steps 2 to 17 are the update loop of the BP neural network. Each execution increments the iteration count by 1. To avoid infinite loops, a maximum number of iterations, MaxCSCnt (a constant, customizable based on the situation, at least 1, default is 5), is usually set here, meaning the algorithm is executed a maximum of MaxCSCnt times. Proceed to Step 17.

[0110] Step 16: Meet the accuracy requirements. This mainly determines whether the optimal model's performance on the validation data meets the accuracy requirements. Step 14 yielded the similarity score based on the validation data. .

[0111] if If the value is not lower than TargetR (which is defined according to requirements, with a default value of 0.95), it means that the optimal parameter has been found. At this point, the inner loop for finding the optimal parameter ends, and the process proceeds to step 18, thus completing the entire process.

[0112] if If the value is lower than the TargetR, it indicates that the current model still has room for optimization and needs to be iterated further, proceeding to step 17. The entire process will only end when the optimal model that meets expectations is found.

[0113] To avoid an infinite iteration loop from step 2 to step 17, step 15 calculates the number of iterations in the outer loop. If the number of iterations exceeds the maximum number of iterations MaxCSCnt, then proceed to step 18, and the entire process ends.

[0114] Step 17: Reset all parameters. Reset the parameters related to the selection cloning algorithm, including clearing and resetting the antibody population, resetting the inner loop iteration count to 0, clearing and resetting all BP neural networks, and resetting the outer loop iteration count to 0. Proceed to Step 2.

[0115] Step 18: Find the optimal prediction model. Reaching this step indicates that the BP neural network model for predicting mud proportions meets expectations, and the entire process is complete.

[0116] In summary, this invention uses a clonal selection algorithm to find the optimal parameters of a BP neural network, thereby obtaining a prediction model for ocean drilling mud proportions. Compared with existing technologies, this invention has at least the following beneficial effects: 1) Introducing the clonal selection algorithm to optimize parameters: The global search capability of the clonal selection algorithm is used to optimize the parameters of the BP neural network, which significantly improves the accuracy of the ocean drilling mud ratio prediction model.

[0117] 2) Multi-source data-driven modeling: Integrating geological information and drilling process data from multiple sources provides more comprehensive input to the BP neural network, enhancing the accuracy and reliability of mud ratio prediction.

[0118] 3) Construct an automated prediction framework: Establish a fully automated calculation framework based on multi-source data to realize the automatic construction and real-time adjustment of mud ratio prediction models, reduce manual intervention, and improve drilling efficiency.

[0119] like Figure 4 As shown, this embodiment of the invention also provides a clonal selection-based mud proportioning device 900, which can implement the above-described method. This device may include: The first module 901 is used to acquire the target dataset; each data sample in the target dataset includes geological parameters and drilling parameters, and each data sample is labeled with the formula ratio of mud components; The second module 902 is used to initialize the number of iterations and the topology of the neural network, and to initialize the parameter population based on the topology; wherein, the parameter population includes a first number of antibodies, and each antibody includes a set of network parameters corresponding to the topology; The third module 903 is used to traverse each antibody in the parameter population, perform the first prediction verification using the neural network and the target dataset, and obtain the prediction similarity corresponding to each antibody. The fourth module 904 is used to determine the optimal parameters based on the corresponding antibody when there is a predicted similarity greater than the first threshold; otherwise, it selects a second number of excellent antibodies based on the predicted similarity and takes the antibody with the highest predicted similarity as the optimal antibody. Module 5, 905, is used to perform cloning operations on all excellent antibodies to obtain a set of cloned antibodies; the number of cloning operations is positively correlated with the predicted similarity of the corresponding excellent antibodies. Module 6, 906, is used to perform mutation operations on the clonal antibody set based on the number of iterations and the best antibody, and then combine excellent antibodies to screen a third number of antibodies through selection operations to obtain a temporary population; Module 7 907 is used to generate new antibodies based on the number of iterations, the optimal antibody, and random antibodies in the parameter population if the third quantity is less than the first quantity, and use the new antibodies to supplement the number of antibodies in the temporary population to the first quantity. Module 8, 908, is used to increment the number of iterations if the number of iterations does not exceed the threshold of the first iteration, use the temporary population as the parameter population, and return to execute the operation of Module 3 until the optimal parameters are determined; wherein, if the number of iterations exceeds the threshold of the first iteration, the optimal parameters are determined based on the optimal antibody. Module 909 is used to apply the optimal parameters to the neural network to obtain the prediction model, and to use the prediction model to predict the mud ratio based on real-time geological parameters and real-time drilling parameters.

[0120] It is understood that the content of the above method embodiments is applicable to the present device embodiments. The specific functions 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.

[0121] This invention also provides an electronic device, which includes a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the method described above. This electronic device can be any smart terminal, including tablet computers, in-vehicle computers, etc.

[0122] It is understood that the content of the above method embodiments is applicable to this device embodiment. The specific functions implemented by this device embodiment 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.

[0123] like Figure 5 As shown, Figure 5 The hardware structure of an electronic device 1000 according to another embodiment is illustrated. The electronic device 1000 includes: The processor 1001 can be implemented using a general-purpose CPU (Central Processing Unit), microprocessor, application-specific integrated circuit (aSIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of the present invention. The memory 1002 can be implemented as a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RaM). The memory 1002 can store the 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 and executed by the processor 1001. Input / output interface 1003 is used to implement information input and output; The communication interface 1004 is used to enable communication and interaction between this device and other devices. Communication can be achieved through wired means (such as USB, network cable, etc.) or wireless means (such as mobile network, WIFI, Bluetooth, etc.). Bus 1005 transmits information between various components of the device (e.g., processor 1001, memory 1002, input / output interface 1003, and communication interface 1004); The processor 1001, memory 1002, input / output interface 1003 and communication interface 1004 are connected to each other within the device via bus 1005.

[0124] The electronic device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.

[0125] This invention also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described method.

[0126] It is understood that the content of the above method embodiments is applicable to this storage medium embodiment. The specific functions implemented in this storage medium embodiment are the same as those in the above method embodiments, and the beneficial effects achieved are also the same as those achieved in the above method embodiments.

[0127] This invention also provides a computer program product, including a computer program that, when executed by a processor, implements the above-described method.

[0128] It is understood that the content of the above method embodiments is applicable to the embodiments of this program product. The specific functions implemented by the embodiments of this program product 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.

[0129] Memory, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs and non-transitory computer-executable programs. Furthermore, memory may include high-speed random access memory, and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some embodiments, memory may optionally include memory remotely located relative to the processor, and these remote memories can be connected to the processor via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.

[0130] The present invention provides a mud formulation method, apparatus, electronic device, storage medium, and program product based on cloning selection. It acquires a target dataset; each data sample in the target dataset includes geological parameters and drilling parameters, and each data sample is labeled with a mud formulation ratio. It initializes the number of iterations and the topology of the neural network, and initializes a parameter population based on the topology. The parameter population includes a first number of antibodies, each antibody including a set of network parameters corresponding to the topology. It iterates through each antibody in the parameter population, performs a first prediction verification using the neural network and the target dataset, and obtains the prediction similarity for each antibody. If a prediction similarity is greater than a first threshold, the optimal parameter is determined based on the corresponding antibody; otherwise, a second number of excellent antibodies are selected based on the prediction similarity, and the antibody with the highest prediction similarity is selected as the optimal antibody. Cloning operations are then performed on all excellent antibodies. The process involves obtaining a set of cloned antibodies. The number of cloning operations is positively correlated with the predicted similarity of the corresponding superior antibodies. Based on the number of iterations and the optimal antibody, a mutation operation is performed on the cloned antibody set. Then, combined with the superior antibodies, a selection operation is used to screen a third number of antibodies to obtain a temporary population. If the third number is less than the first number, new antibodies are generated based on the number of iterations, the optimal antibody, and random antibodies from the parameter population. These new antibodies are used to supplement the number of antibodies in the temporary population to the first number. If the number of iterations does not exceed the first threshold, the number of iterations is incremented, and the temporary population is used as the parameter population. The process of traversing each antibody in the parameter population is repeated until the optimal parameters are determined. If the number of iterations exceeds the first threshold, the optimal parameters are determined based on the optimal antibody. The optimal parameters are applied to a neural network to obtain a prediction model. This prediction model is then used to predict mud ratios based on real-time geological parameters and real-time drilling parameters. This invention is based on a clonal selection algorithm coupled with a neural network. Driven by mud mixing data samples, it automatically optimizes network parameters, effectively overcoming the shortcomings of traditional methods that rely excessively on human experience. It also enables objectivity and intelligentization of mixing decisions. Furthermore, through antibody prediction similarity assessment, adaptive clonal mutation, and iterative evolution mechanisms, this invention can quickly converge to the optimal network parameters with limited experimental samples, significantly reducing the number of trials and human intervention, and effectively improving the efficiency of mixing scheme determination. Finally, the resulting prediction model outputs an appropriate mud formula in real time based on the input geological and drilling parameters, exhibiting excellent dynamic response capabilities. This overcomes the shortcomings of existing technologies, such as poor real-time performance and difficulty in adapting to changing working conditions, making it suitable for complex and variable geological drilling environments.

[0131] The embodiments described in this invention are for the purpose of more clearly illustrating the technical solutions of the embodiments of this invention, and do not constitute a limitation on the technical solutions provided by the embodiments of this invention. As those skilled in the art will know, with the evolution of technology and the emergence of new application scenarios, the technical solutions provided by the embodiments of this invention are also applicable to similar technical problems.

[0132] Those skilled in the art will understand that the technical solutions shown in the figures do not constitute a limitation on the embodiments of the present invention, and may include more or fewer steps than shown, or combine certain steps, or different steps.

[0133] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.

[0134] Those skilled in the art will understand that all or some of the steps in the methods disclosed above, as well as the functional modules / units in the systems and devices, can be implemented as software, firmware, hardware, or suitable combinations thereof.

[0135] The preferred embodiments of the present invention have been described above with reference to the accompanying drawings, but this does not limit the scope of the claims of the present invention. Any modifications, equivalent substitutions, and improvements made by those skilled in the art without departing from the scope and spirit of the present invention should be within the scope of the claims of the present invention.

Claims

1. A mud mixing method based on clonal selection, characterized in that, The method includes the following steps: Obtain the target dataset; wherein each data sample in the target dataset includes geological parameters and drilling parameters, and each data sample is labeled with the formula ratio of mud components; Initialize the number of iterations and the topology of the neural network, and initialize the parameter population based on the topology; wherein, the parameter population includes a first number of antibodies, and each antibody includes a set of network parameters corresponding to the topology; Each antibody in the parameter population is traversed, and a first prediction verification is performed using the neural network and the target dataset to obtain the prediction similarity corresponding to each antibody. If the predicted similarity is greater than the first threshold, the optimal parameters are determined based on the corresponding antibody; otherwise, a second number of excellent antibodies are selected based on the predicted similarity, and the antibody with the highest predicted similarity is selected as the optimal antibody. All the aforementioned superior antibodies are cloned to obtain a set of cloned antibodies; wherein the number of cloning operations is positively correlated with the predicted similarity of the corresponding superior antibodies; Based on the number of iterations and the optimal antibody, the cloned antibody set is mutated, and then combined with the excellent antibody, a third number of antibodies are selected through a selection operation to obtain a temporary population. If the third quantity is less than the first quantity, a new antibody is generated based on the number of iterations, the optimal antibody, and the random antibodies in the parameter population, and the number of antibodies in the temporary population is supplemented to the first quantity using the new antibody; If the number of iterations does not exceed the first threshold, the number of iterations is incremented, the temporary population is used as the parameter population, and the step of traversing each antibody of the parameter population is returned until the optimal parameter is determined; wherein, if the number of iterations exceeds the first threshold, the optimal parameter is determined based on the optimal antibody; The optimal parameters are applied to the neural network to obtain a prediction model, which is then used to predict mud ratios based on real-time geological parameters and real-time drilling parameters.

2. The method according to claim 1, characterized in that, The target dataset includes a test set. The process of traversing each antibody in the parameter population and performing a first prediction verification using the neural network and the target dataset to obtain the predicted similarity for each antibody includes the following steps: The first antibody in the parameter population is used as a candidate antibody; Candidate parameters are determined based on the candidate antibodies, and the candidate parameters are applied to the neural network to obtain a candidate model; The first data sample in the test set is used as a candidate sample; The candidate samples are input into the candidate model so that the candidate model processes the geological parameters and drilling parameters of the candidate samples to obtain a first predicted mud ratio. Based on the first predicted mud ratio corresponding to the candidate sample and the formula ratio of various mud components in the label data, the first similarity of the candidate sample is obtained by cosine similarity calculation; The next data sample in the test set is used as the candidate sample. The step of inputting the candidate sample into the candidate model is returned until the first similarity corresponding to each data sample in the test set is obtained. Then, the predicted similarity corresponding to the candidate antibody is obtained by standard deviation statistics. The next antibody in the parameter population is selected as the candidate antibody, and the process returns to the step of determining candidate parameters based on the candidate antibody until the predicted similarity corresponding to each antibody in the parameter population is obtained.

3. The method according to claim 1, characterized in that, The process of selecting a second number of superior antibodies based on the predicted similarity includes the following steps: The number of first candidates is determined based on the number of antibodies in the parameter population whose predicted similarity is greater than the second threshold. The second candidate quantity is determined by multiplying the first quantity by a preset ratio; The maximum value between the first candidate number and the second candidate number is taken as the second number; Arrange all antibodies in the parameter population in descending order of predicted similarity to obtain the first antibody sequence; The antibody in the first antibody sequence that is the second number is considered the superior antibody.

4. The method according to claim 1, characterized in that, The cloning operation on all the aforementioned superior antibodies to obtain a cloned antibody set includes the following steps: All the superior antibodies are arranged in descending order of predicted similarity to obtain the superior antibody sequence; The predicted similarity corresponding to the last excellent antibody in the excellent antibody sequence is used as the benchmark similarity; The first excellent antibody in the excellent antibody sequence is selected as a candidate excellent antibody. The ratio of the predicted similarity of the candidate excellent antibody to the benchmark similarity is multiplied by the minimum number of times the backup is performed to obtain the number of clones of the candidate excellent antibody. The candidate excellent antibody is cloned a certain number of times to obtain multiple cloned antibodies corresponding to the candidate excellent antibody, and the cloned antibody group of the candidate excellent antibody is obtained by summing them up. The next excellent antibody in the excellent antibody sequence is taken as a candidate excellent antibody. The step of multiplying the ratio of the predicted similarity of the candidate excellent antibody to the benchmark similarity by the minimum number of times is repeated until the clonal antibody group corresponding to each excellent antibody is obtained, and then the clonal antibody set is obtained by summing them up.

5. The method according to claim 1, characterized in that, The clonal antibody set includes multiple clonal antibodies corresponding to each superior antibody. The step of performing a mutation operation on the clonal antibody set based on the number of iterations and the optimal antibody, and then combining the superior antibodies to screen a third number of antibodies through a selection operation to obtain a temporary population, includes the following steps: The iterative mutation intensity is updated based on the maximum mutation intensity, the minimum mutation intensity, the number of iterations, and the first number threshold. The expression for the intensity of the iterative mutation is: ; In the formula, Indicates the intensity of iterative mutation. Indicates the minimum variation intensity. represents the maximum mutation intensity, g represents the current iteration number, and MaxG represents the first iteration threshold; The first cloning antibody in the cloning antibody set is selected as the candidate cloning antibody; Based on the iterative mutation intensity, the optimal antibody, the normally distributed random number, and the preset correlation coefficient, the candidate clone antibody is subjected to mutation operation to obtain the mutated antibody of the candidate clone antibody; The expression for the mutant antibody is as follows: ; In the formula, express Mutant antibodies, This represents the j-th clone antibody corresponding to the i-th excellent antibody. Represents the correlation coefficient. This indicates the optimal antibody. Indicates the intensity of iterative mutation. This represents a normal distribution with a mean of 0 and a standard deviation of 1. The next clone antibody in the clone antibody set is taken as the candidate clone antibody. The step of performing mutation operation on the candidate clone antibody based on the iterative mutation intensity, the optimal antibody, the normally distributed random number and the preset correlation coefficient is returned until the mutated antibody corresponding to each clone antibody is obtained. All mutated antibodies are summarized to obtain the mutated antibody set. By iterating through each mutant antibody in the mutant antibody set, a second prediction verification is performed using the neural network and the target dataset to obtain the predicted similarity corresponding to each mutant antibody. The set of mutant antibodies and all the superior antibodies are combined to form a candidate population; The number of third candidates is determined based on the number of antibodies in the candidate population whose predicted similarity is greater than the second threshold. The fourth candidate quantity is determined by multiplying the first quantity by a preset ratio; The maximum value between the third candidate quantity and the fourth candidate quantity shall be taken as the third quantity; Arrange all antibodies in the candidate population in descending order of predicted similarity to obtain the second antibody sequence; The third number of antibodies in the second antibody sequence mentioned above are used as the temporary population.

6. The method according to claim 1, characterized in that, Each antibody in the temporary population is associated with the predicted similarity. The process of generating new antibodies based on the number of iterations, the optimal antibody, and random antibodies in the parameter population, and using these new antibodies to supplement the number of antibodies in the temporary population to the first number, includes the following steps: If the predicted similarity of an antibody in the temporary population is greater than the predicted similarity of the optimal antibody, the optimal antibody is updated using the antibody with the highest predicted similarity in the temporary population. The fourth quantity is determined based on the difference between the first quantity and the third quantity; The initial generation quantity is 0; Two random antibodies are randomly selected from the parameter population; A new antibody is generated based on the random antibody, the optimal antibody, the number of iterations, the first threshold number, and a preset correlation coefficient. The expression for the new antibody is as follows: ; In the formula, Indicates a new antibody, and Both represent correlation coefficients. This indicates the optimal antibody. and Let g represent the current iteration number, and MaxG represent the threshold for the first iteration. Represents the natural constant; The number of generated antibodies is incremented, and the step of randomly selecting two random antibodies from the parameter population is returned to be executed until the number of generated antibodies reaches the fourth number. All of the new antibodies were added to the temporary population.

7. The method according to claim 1, characterized in that, The neural network includes an input layer, a hidden layer, and an output layer. The number of neurons in the input layer is determined based on the total types of the geological parameters and the drilling parameters. The number of neurons in the output layer is determined based on the total types of the mud components. The target dataset includes a test set and a validation set. The test set is used for the first prediction validation. Before using the prediction model to predict mud ratios based on real-time geological parameters and real-time drilling parameters, the method further includes the following steps: The first data sample in the validation set is used as the validation sample; The verification sample is input into the prediction model so that the prediction model can process the geological parameters and drilling parameters of the verification sample to obtain a second predicted mud ratio. Based on the second predicted mud ratio corresponding to the verification sample and the formulation ratio of various mud components in the label data, the second similarity of the verification sample is obtained by cosine similarity calculation; The next data sample in the validation set is used as the validation sample. The step of inputting the validation sample into the prediction model is returned until the second similarity corresponding to each data sample in the validation set is obtained. Then, the validation similarity corresponding to the prediction model is obtained by standard deviation statistics. If the verification similarity is lower than the second threshold, the number of neurons in the hidden layer of the neural network is randomly adjusted to update the topology of the neural network; The number of iterations is incremented, the iteration count is reset, and the step of initializing the parameter population based on the topology is returned to be executed until the verification similarity is not lower than the second threshold, and the prediction model is updated. If the number of cycles exceeds the second threshold, the prediction model is updated based on the optimal antibody from the last cycle.

8. A mud mixing device based on clonal selection, characterized in that, The apparatus for implementing the method of claim 1 includes: The first module is used to acquire the target dataset; wherein each data sample of the target dataset includes geological parameters and drilling parameters, and each data sample is labeled with the formula ratio of mud components; The second module is used to initialize the number of iterations and the topology of the neural network, and to initialize a parameter population based on the topology; wherein, the parameter population includes a first number of antibodies, and each antibody includes a set of network parameters corresponding to the topology; The third module is used to traverse each antibody in the parameter population, perform a first prediction verification using the neural network and the target dataset, and obtain the prediction similarity corresponding to each antibody. The fourth module is used to determine the optimal parameters based on the corresponding antibody when the predicted similarity is greater than the first threshold; otherwise, it selects a second number of excellent antibodies based on the predicted similarity and takes the antibody with the highest predicted similarity as the optimal antibody. The fifth module is used to perform cloning operations on all the aforementioned superior antibodies to obtain a set of cloned antibodies; wherein the number of cloning operations is positively correlated with the predicted similarity of the corresponding superior antibodies; The sixth module is used to perform mutation operations on the cloned antibody set based on the number of iterations and the optimal antibody, and then combine the excellent antibody to screen a third number of antibodies through a selection operation to obtain a temporary population; The seventh module is used to generate a new antibody based on the number of iterations, the optimal antibody, and random antibodies in the parameter population if the third quantity is less than the first quantity, and to supplement the number of antibodies in the temporary population to the first quantity using the new antibody; The eighth module is used to increment the number of iterations if the number of iterations does not exceed the first threshold, use the temporary population as the parameter population, and return to execute the operation of the third module until the optimal parameters are determined; wherein, if the number of iterations exceeds the first threshold, the optimal parameters are determined based on the optimal antibody. The ninth module is used to apply the optimal parameters to the neural network to obtain a prediction model, and to use the prediction model to predict mud ratio based on real-time geological parameters and real-time drilling parameters.

9. An electronic device, characterized in that, The electronic device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the method according to any one of claims 1 to 7.

10. A computer program product, characterized in that, The computer program product includes a computer program that, when executed by a processor, implements the method according to any one of claims 1 to 7.