Drilling machine fault diagnosis, alarm and processing method and device
By constructing a unified time-series multimodal feature set and using a large language model for drilling rig fault diagnosis, the problem of low accuracy and efficiency in existing drilling rig fault detection technologies is solved, and efficient, accurate diagnosis and intelligent processing of drilling rig faults are achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- CHINA UNIV OF PETROLEUM (BEIJING)
- Filing Date
- 2026-04-08
- Publication Date
- 2026-05-08
AI Technical Summary
Existing drilling rig fault detection methods rely on human experience and preset rules, which cannot effectively cope with complex geological conditions and high-frequency operating conditions, leading to false alarms, missed alarms, and major drilling rig failures that cause downtime. Furthermore, multi-source data lacks a unified semantic representation and systematic reasoning mechanism, and the training process for machine learning models is cumbersome and difficult to update and upgrade.
By acquiring drilling rig operation data and logging data, timestamp alignment, data normalization, and feature cleaning are performed to construct a unified time series multimodal feature set. Anomaly diagnosis is performed using a pre-trained large language model, and improvement suggestions are output. A multi-head self-attention mechanism is adopted to achieve cross-modal fusion and multi-task decoupling, and the model performance is optimized by combining a loss function.
It improves the accuracy, generalization, and response speed of drilling rig fault diagnosis, provides clear diagnostic explanations and handling suggestions, and supports decision support for front-line operators.
Smart Images

Figure CN121997089A_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of oil and gas drilling technology, and in particular relates to a method and device for drilling rig fault diagnosis, alarm and handling. Background Technology
[0002] In oil and gas drilling, the drilling rig, as the core mechanical equipment, plays a decisive role in the safety, efficiency, and cost control of well site operations. Existing drilling rig fault detection methods largely rely on human experience and preset rules, such as monitoring specific sensors for exceeding limits or conducting periodic manual inspections. These methods have significant limitations when facing complex geological conditions, frequent switching of operating conditions, or the evolution of downhole fault modes, easily leading to false alarms, missed alarms, or even major drilling rig failures and downtime.
[0003] With the widespread adoption of smart sensors and the improvement of real-time data acquisition capabilities in well logging, the sources of data at drilling sites are increasing. However, multi-source data is often scattered and independent, lacking unified semantic representation and systematic reasoning mechanisms, and thus cannot effectively support the diagnosis of complex conditions. Furthermore, existing machine learning models have cumbersome training processes, poor adaptability to environmental changes, and are difficult to update and upgrade once deployed. Moreover, most of them cannot provide clear diagnostic explanations and processing suggestions, making it difficult to provide decision support for front-line operators.
[0004] There is currently no effective solution for accurately diagnosing drilling rig malfunctions. Summary of the Invention
[0005] The purpose of this application is to provide a method and device for diagnosing, alarming and handling drilling rig faults, which can improve the accuracy, generalization and response speed of drilling rig fault diagnosis.
[0006] This application provides a method and apparatus for diagnosing, alarming, and handling drilling rig faults, which are implemented as follows: A method for diagnosing, alarming, and handling drilling rig faults includes: Acquire the operating data and logging data of the target drilling rig, wherein the operating data includes at least one of the following: motor torque, motor speed, motor power, and motor temperature, and the logging data includes at least one of the following: drilling pressure, rotation speed, pump pressure, well depth, and torque; The operational data and the logging data are time-stamp aligned, data normalized, feature cleaned, and missing data compensated to construct a unified time series multimodal feature set; The unified time-series multimodal feature set is input into a pre-trained large language model to perform anomaly diagnosis on the target drilling rig and output improvement suggestions.
[0007] In one implementation, the unified time-series multimodal feature set is input into a pre-trained large language model to perform anomaly diagnosis on the target drilling rig and output improvement suggestions, including: Numerical feature embeddings are obtained by performing multi-layer fully connected transformations and nonlinear mappings on numerical feature vectors. The text sequence is encoded by word embedding and positional encoding; Map the anomaly weights output by the anomaly clustering module to a set of anomaly indicator embeddings; The numerical feature embedding, the encoding embedding, and the anomaly indicator embedding are combined to form a unified input sequence, so as to realize cross-modal fusion of numerical features, text features, and anomaly weights in the same latent space through a self-attention mechanism; The unified input sequence is processed by the encoder in the large language model, and the hidden state sequence is obtained by multi-head self-attention calculation. The anomaly diagnosis results and improvement suggestions are then output.
[0008] In one implementation, the unified input sequence is processed by the encoder in the large language model, and a hidden state sequence is obtained through multi-head self-attention computation. Anomaly diagnosis results and improvement suggestions are then output, including: Task decoupling is achieved by using multiple task headers set at the top of the encoder output, resulting in state prediction results and improvement suggestions.
[0009] In one implementation, the plurality of task headers includes: a status judgment header, a cause tracing generation header, and a processing suggestion generation header, wherein: The state judgment head is used to perform linear mapping and softmax on the window-level hidden state sequence to obtain the state prediction result; The cause tracing generation head is used to generate a cause description sequence based on the autoregression of the hidden state sequence at the output position of the causal chain; The processing suggestion generation head is used to generate a suggestion sequence autoregressively at the processing suggestion output position based on the hidden state sequence and the generated state labels and cause descriptions.
[0010] In one implementation, the large language model is trained according to the following loss function: ; in, Loss is determined by the state. For causal language modeling loss, To suggest generating a loss, For attention saliency-constrained loss, , , , These are the weighting coefficients for each loss term.
[0011] In one implementation, the state determination loss is expressed as: ; in, The loss value is determined by the state. Labels for the actual state. The model prediction result is given, where k is the sample index for state judgment, and ∑ k This represents the summation of the logarithmic product of the true state labels and the model predictions for all samples; The loss for causal tracing language modeling is expressed as: ; in, These are manually labeled or curated standard cause description tokens, where t represents the time step in sequence generation. Represents the hidden state sequence, p( ) represents the conditional probability distribution given by the model; The proposed loss is expressed as: ; ; in, For ranking loss of multiple candidate suggestions, Each candidate suggestion is scored separately. The standard recommended sequence is in the first... The real target token at each time step. This represents the set of sample pairs that should be higher than the specified value. The attention saliency constraint loss is expressed as: ; in, As a weighting factor, These are the normalized outlier weights. Abnormal weights For the attention distribution of the layer, This is the set of locations corresponding to the outliers.
[0012] In one implementation, the unified time-series multimodal feature set is input into a pre-trained large language model to perform anomaly diagnosis on the target drilling rig, including: The large language model automatically learns the compact regions distributed under normal operating conditions and identifies outliers and their density clusters as abnormal state regions. The clustering results are visualized using a two-dimensional mapping diagram, where the first color region represents high-density abnormal clusters and the second color region represents low-risk or normal states.
[0013] In one implementation, the large language model automatically learns the compact regions distributed under normal operating conditions and identifies outliers and their density clusters as abnormal state regions, including: High-dimensional feature vectors are constructed using time windows as the granularity. For a sliding time window of length T, the following statistical and morphological features are extracted: ; in, The mean, Standard deviation, The maximum value, , where P is the correlation coefficient, P is the pressure parameter during the drilling process, and WOB is the downward pressure applied to the drill bit; A sample set is constructed for all window features. Then, standardize the matrix to obtain the normalized feature matrix. : ; in, Let be the normalized feature vector corresponding to the i-th sample, where i is the index of the sample. To estimate the mean obtained on the training set, To estimate the standard deviation obtained on the training set, N represents the number of samples, the number of sliding time windows, and d represents the dimension of the feature vector of each window; Density clustering is performed on the normalized feature matrix, and the neighborhood radius is defined. minimum number of neighbors For any sample Calculate its neighborhood: ; in, Indicates sample of Neighborhood, Indicates the neighborhood radius threshold. This represents the normalized feature vector corresponding to the j-th sample; exist In the case of, Mark the core points and form cluster labels according to the density reachability rule. Points that fail to be assigned to any cluster are marked as noise points-1.
[0014] A drilling rig fault diagnosis, alarm and handling device, comprising: The acquisition module is used to acquire the operating data and logging data of the target drilling rig, wherein the operating data includes at least one of the following: motor torque, motor speed, motor power, and motor temperature, and the logging data includes at least one of the following: drilling pressure, rotation speed, pump pressure, well depth, and torque; The module is used to perform timestamp alignment, data normalization, feature cleaning, and missing feature compensation on the running data and the logging data, so as to construct a unified time series multimodal feature set; The diagnostic module is used to input the unified time-series multimodal feature set into a pre-trained large language model to perform anomaly diagnosis on the target drilling rig and output improvement suggestions.
[0015] An electronic device includes a processor and a memory for storing processor-executable instructions, wherein the processor, when executing the instructions, implements the steps of the method described above.
[0016] A computer-readable storage medium having a computer program / instructions stored thereon, which, when executed by a processor, implement the steps of the above-described method.
[0017] This application provides a method for drilling rig fault diagnosis, alarm, and handling. The method acquires operational data and logging data of the target drilling rig. The operational data includes at least one of the following: motor torque, motor speed, motor power, and motor temperature. The logging data includes at least one of the following: drilling pressure, rotational speed, pump pressure, well depth, and torque. The method performs timestamp alignment, data normalization, feature cleaning, and missing data compensation on the operational data and logging data to construct a unified time-series multimodal feature set. This unified time-series multimodal feature set is input into a pre-trained large language model to diagnose anomalies in the target drilling rig and output improvement suggestions. This solution addresses the low efficiency and accuracy of existing drilling rig fault diagnosis methods, achieving improved accuracy, generalization, and response speed. Attached Figure Description
[0018] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0019] Figure 1 This is a flowchart of one embodiment of the drilling rig fault diagnosis, alarm and handling method provided in this application; Figure 2This is a schematic diagram of the large language model architecture provided in this application, after instruction fine-tuning and expert knowledge supplementation; Figure 3 This is a schematic diagram of the application process of the large model inference generation module provided in this application; Figure 4 This is a hardware structure block diagram of an electronic device for a drilling rig fault diagnosis, alarm and handling method provided in this application; Figure 5 This is a schematic diagram of the module structure of one embodiment of the drilling rig fault diagnosis, alarm and handling device provided in this application. Detailed Implementation
[0020] To enable those skilled in the art to better understand the technical solutions in this application, the technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of this application.
[0021] Figure 1 This is a flowchart illustrating one embodiment of the drilling rig fault diagnosis, alarm, and handling method provided in this application. While this application provides method operation steps or apparatus structures as shown in the following embodiments or figures, more or fewer operation steps or module units may be included in the method or apparatus based on conventional or non-inventive effort. In steps or structures where there is no logically necessary causal relationship, the execution order of these steps or the module structure of the apparatus is not limited to the execution order or module structure described in the embodiments and figures of this application. When the method or module structure is applied in actual devices or end products, it can be executed sequentially or in parallel according to the method or module structure shown in the embodiments or figures (e.g., in a parallel processor or multi-threaded processing environment, or even a distributed processing environment).
[0022] Specifically, such as Figure 1 As shown, the above-mentioned drilling rig fault diagnosis, alarm and handling methods may include the following steps: Step 101: Obtain the operating data and logging data of the target drilling rig, wherein the operating data includes at least one of the following: motor torque, motor speed, motor power, and motor temperature, and the logging data includes at least one of the following: drilling pressure, rotation speed, pump pressure, well depth, and torque; Step 102: Perform timestamp alignment, data normalization, feature cleaning, and missing feature compensation on the running data and the logging data to construct a unified time series multimodal feature set; Step 103: Input the unified time series multimodal feature set into the pre-trained large language model to perform anomaly diagnosis on the target drilling rig and output improvement suggestions.
[0023] Specifically, inputting the unified time-series multimodal feature set into a pre-trained large language model to perform anomaly diagnosis on the target drilling rig and output improvement suggestions may include: S1: Perform multi-layer fully connected transformation and nonlinear mapping on the numerical feature vectors to obtain the numerical feature embedding; S2: Obtain encoded embeddings from the text sequence through word embedding and positional encoding; S3: Map the anomaly weights output by the anomaly clustering module to a set of anomaly indicator embeddings; S4: The numerical feature embedding, the encoding embedding, and the anomaly indicator embedding are combined to form a unified input sequence, so as to realize cross-modal fusion of numerical features, text features, and anomaly weights in the same latent space through a self-attention mechanism; S5: The unified input sequence is processed by the encoder in the large language model, and the hidden state sequence is obtained by multi-head self-attention calculation. The abnormal diagnosis results and improvement suggestions are then output.
[0024] For example, a large language model can include: Numerical Feature Coding Submodule : Logistic eigenvectors By performing multi-layer fully connected transformations and nonlinear mappings, numerical feature embeddings are obtained: ; Encode it into several "numerical feature tokens" and mark them as special tags.<NUM_FEAT> It is inserted into the input sequence of the large language model.
[0025] Text Feature Encoding Submodule : Text sequence After word embedding and positional encoding, the following is obtained: ; Anomaly weight encoding submodule : The anomaly weights output by the anomaly clustering module Mapped to a set of exception indicator embeddings: ; And correspondingly marked as<ABN_1> …<ABN_M> Special tokens, such as these, reflect the exceptional importance of different time points or feature dimensions.
[0026] Cross-modal Transformer encoder : Combine the three types of tokens into a unified input sequence: ; The input is fed into a multi-layer Transformer encoder, and the hidden state sequence is obtained through multi-head self-attention computation: ; In this process, numerical features, text features, and anomaly weights are integrated across modalities through a self-attention mechanism within the same latent space.
[0027] In actual implementation, the unified input sequence is processed by the encoder in the large language model, and the hidden state sequence is obtained through multi-head self-attention calculation. The abnormal diagnosis results and improvement suggestions are output. This may include: decoupling tasks by using multiple task heads set at the top of the encoder output to obtain state prediction results and improvement suggestions.
[0028] The aforementioned task heads may include: a state judgment head, a cause tracing generation head, and a processing suggestion generation head, wherein: the state judgment head is used to perform linear mapping and softmax on the window-level hidden state sequence to obtain the state prediction result; the cause tracing generation head is used to generate a cause description sequence based on the hidden state sequence at the output position of the causal chain; and the processing suggestion generation head is used to generate a suggestion sequence based on the hidden state sequence and the generated state labels and cause descriptions at the output position of the processing suggestion.
[0029] When training the large language model described above, the following loss function can be used: ; in, Loss is determined by the state. For causal language modeling loss, To suggest generating a loss, For attention saliency-constrained loss, , , , These are the weighting coefficients for each loss term.
[0030] The state judgment loss can be expressed as: ; in, Labels for the actual state. The model's prediction results; The loss of causal language modeling can be expressed as: ; in, These are manually labeled or curated standard cause description tokens, where t represents the time step in sequence generation. Represents the hidden state sequence, p( ) represents the conditional probability distribution given by the model; Where t is the time step / token position index of the sequence generation (the first...) (words / subwords), which is to describe the standard cause. Treat it as a sequence The step number during the step-by-step generation process. This represents the conditional probability distribution given by the model. Specifically, here... Yes: a standard prefix that has already been generated / given. and condition information When the hidden state sequence / encoding result is given, the model assumes that the output token at the current position is equal to the real token. The probability of that. That is, It is the softmax output probability of the model (next-token probability in the sense of language modeling).
[0031] The proposed loss can be expressed as: ; ; in, For ranking loss of multiple candidate suggestions, Each candidate suggestion is scored separately. This represents the set of sample pairs that should be higher than the specified value. The standard recommended sequence is in the first... The true target token at each time step (location) has the following meaning: : A sequence of standard recommendation texts obtained through manual annotation or compilation; For the first in the recommended sequence of this standard Words / subwords / symbols; Indicates at time step Previous known true prefix sequences . Indicates a given sequence of hidden states Given the already generated standard suggestion prefix, the model generates a true suggestion token at the current position. The probability of.
[0032] Attention saliency constraint loss can be expressed as: ; in, As a weighting factor, These are the normalized outlier weights. Abnormal weights For the attention distribution of the layer, This is the set of locations corresponding to the outliers.
[0033] That is, during the training phase, a multi-task joint loss function is used to unify "state judgment, cause tracing, suggestion generation" and "anomaly significance constraint" into a single optimization objective.
[0034] In one specific implementation, the unified time-series multimodal feature set is input into a pre-trained large language model to perform anomaly diagnosis on the target drilling rig. This may include: the large language model automatically learning the compact regions distributed under normal operating conditions and identifying outliers and their density clusters as anomalous state regions; the clustering results are visualized using a two-dimensional mapping map, where the first color region represents high-density anomalous clusters and the second color region represents low-risk or normal states. That is, anomaly diagnosis is performed by identifying normal and anomalous state regions, and the results are visualized using different colors.
[0035] Specifically, the large language model automatically learns the compact regions distributed under normal operating conditions and identifies outliers and their density clusters as abnormal state regions, which may include: S1: Construct a high-dimensional feature vector with time window as the granularity. For a sliding time window of length T, extract the following statistical and morphological features: ; in, The mean, Standard deviation, The maximum value, The correlation coefficient; S2: Construct a sample set for all window features. Then, standardize the matrix to obtain the normalized feature matrix. : ; in, To estimate the mean obtained on the training set, To estimate the standard deviation obtained on the training set, N represents the number of samples, the number of sliding time windows, and d represents the dimension of the feature vector of each window; that is, N represents the number of samples, which is the number of sliding time windows (how many window feature vectors were extracted). (That is, how many samples there are). This represents the dimension of the feature vector of each window, that is, in How many statistical / morphological feature terms are defined in total? Each row corresponds to one window (total) (rows), each column corresponds to a feature (total) List).
[0036] S3: Perform density clustering on the normalized feature matrix and define the neighborhood radius. minimum number of neighbors For any sample Calculate its neighborhood: ; in, Indicates sample of Neighborhood, Indicates the neighborhood radius threshold. This represents the normalized feature vector corresponding to the j-th sample; that is, This indicates that in the normalized feature space, the sample The Euclidean distance does not exceed The set of all samples is represented as: ,in, This represents the neighborhood radius threshold, used to limit the maximum allowed distance between samples in the feature space: when At that time, it was considered that the sample Located in the sample Within the neighborhood; The scale that determines the "density" is one of the most critical hyperparameters in density clustering. This represents the normalized feature vector corresponding to the j-th sample, meaning: the original feature vector extracted by a sliding time window of length T. After standardization using the training set statistics, the following results were obtained: ,in, and All belong to the normalized characteristic matrix The row vector.
[0037] S4: In In the case of, Mark the core points and form cluster labels according to the density reachability rule. Points that fail to be assigned to any cluster are marked as noise points-1.
[0038] Specifically, the aforementioned large language model can provide adaptive evolution capabilities, support closed-loop human-machine interaction and continuous knowledge optimization, and allow engineers to evaluate, supplement, or question the model's reasoning results in natural language. The large language model dynamically adjusts its output based on user feedback and records the interaction data into a case database. This module can integrate a reinforcement learning-based human feedback fine-tuning mechanism, enabling periodic small-batch online retraining of the model to improve its diagnostic accuracy and knowledge adaptability in specific well sites and special working conditions. Thus, with the accumulation of interaction data, the system will gradually form a "personalized large model" deeply coupled with the specific engineering environment, achieving self-growth of fault knowledge and self-reinforcement of processing capabilities.
[0039] The example above presents an intelligent diagnostic method for drilling rig faults based on a large language model. This method involves collecting drilling rig operation data and logging data; fusing, aligning, and standardizing the collected data; constructing a corpus structure for input to the large language model; using the large model for state recognition, causal reasoning, and suggestion generation; and obtaining feedback through human-computer interaction for knowledge updates. The large language model can be a multi-task language model fine-tuned using drilling condition data and expert knowledge, possessing causal chain reasoning and natural language generation capabilities. The model output includes fault type, affecting conditions, possible causes, and multiple candidate processing suggestions, simultaneously outputting in structured data and text report formats. Furthermore, it can perform intent parsing based on user natural language input and correct the diagnostic path, achieving self-learning and updating of the model.
[0040] In the example above, by fusing well logging formation information and drilling rig operating parameters, a multimodal feature representation is constructed. A fine-tuned large language model is then used to perform state recognition, causal analysis, and recommendation generation on the input data, outputting diagnostic suggestions readable in natural language. Furthermore, it features a human-computer interaction feedback mechanism, dynamically adjusting the judgment results based on input from on-site engineers, forming a continuous learning loop. This method improves the accuracy, generalization, and response speed of drilling rig fault diagnosis, and is applicable to fault early warning and auxiliary decision-making scenarios in onshore and offshore oil and gas drilling projects.
[0041] The above method will be described below with reference to a specific embodiment. However, it should be noted that this specific embodiment is only for better illustration of this application and does not constitute an improper limitation of this application.
[0042] This example presents a method and system for intelligent diagnosis of drilling rig faults based on a large language model. It integrates logging data and drilling rig operation data, utilizing a large model to accurately identify abnormal drilling rig states, trace their causes, and intelligently generate handling suggestions. This system can proactively identify abnormal behaviors during drilling rig operation, determine possible downhole triggers or equipment fatigue causes, and provide explanations and operational suggestions in natural language. Furthermore, by introducing a human-computer interaction feedback mechanism, the system can continuously obtain feedback from on-site engineers, improving the model's scenario adaptability and knowledge capabilities, forming a knowledge-evolving self-learning closed loop.
[0043] Specifically, the drilling rig fault diagnosis system provided in this example may include: a data acquisition layer, a data fusion and processing layer, a large model inference layer, and an interactive feedback output layer, wherein: 1) Data Acquisition Layer: Deployed at the well site, this layer acquires key data using intelligent sensors and the logging system. This key data may include: drilling rig operating parameters (e.g., energy consumption, drilling rig torque) and data output from the logging system such as drilling pressure, rotary table speed, drill string torque, and displacement. Specifically, sensors can be deployed within the drilling rig to read data from both the logging terminal and the drilling rig itself.
[0044] 2) The data fusion processing layer standardizes, synchronizes, imputes missing data, and labels outliers from the aforementioned multi-source data to construct a unified feature vector set. This processing result is encoded into an embedded corpus suitable for large language models, containing structured labels and contextual descriptions to form a multimodal input corpus.
[0045] 3) The large-scale model inference layer can be a large language model that has been fine-tuned by instructions and supplemented with expert knowledge. The architecture of this model can be as follows: Figure 2 The system includes: a data fusion and corpus construction module, a semantic perception and instruction modeling module, a large-scale model inference and generation module, and an interactive feedback and continuous learning module. These modules work closely together to complete the entire process from data perception, semantic encoding, knowledge reasoning to interactive evolution. Specifically: A) The data fusion and corpus construction module serves as the input foundation, integrating operational data from the drilling rig itself (e.g., drill motor torque, motor speed, motor power, motor temperature, etc.) with information generated by the logging system (e.g., drilling pressure, speed, pump pressure, well depth, torque, etc.). Through timestamp alignment, data normalization, feature cleaning, and missing data compensation, a unified time-series multimodal feature set is constructed. Furthermore, a semantic mapping mechanism transforms structured data into natural language fragments with domain context; for example, "pump pressure fluctuations are severe and last for more than 3 minutes" is transformed into "there is a persistent pump pressure anomaly." These semantic encoding modules construct a corpus dataset for training large language models, providing a linguistic vehicle for downstream inference.
[0046] B) The semantic awareness and instruction modeling module transforms industrial tasks into "instruction prompts" that the language model can recognize. This module not only identifies the task objectives corresponding to drilling conditions (e.g., "identify whether it is abnormal," "analyze the cause chain," or "recommend a handling strategy"), but also automatically generates contextualized prompts based on the data corpus to activate the reasoning path of the large model. For example, for data involving abnormal pump pressure, bottom hole pressure fluctuations, and lithological changes, the module generates the instruction: "Please determine whether this condition is abnormal and explain the possible causes and suggested handling measures." Simultaneously, this module has a built-in instruction template library for engineering scenarios, adaptable to various abnormal situations such as stuck drill pipe, pump obstruction, well leakage, mechanical failure, and vibration. It dynamically combines instructions based on the model's usage context, thereby achieving semantic alignment of tasks and precise problem guidance.
[0047] C) The large-scale model inference and generation module, based on a multi-round fine-tuned large language model, completes advanced tasks such as working condition understanding, causal chain identification, and suggestion generation. This module uses a pre-trained language model as its foundation (such as LLaMA2, ChatGLM, etc.) and performs domain fine-tuning using industry corpora, enabling it to understand industrial contexts and state data. During inference, the model receives fused and semantically transformed data corpora and corresponding task instructions, automatically completing state judgment (whether an anomaly exists), cause tracing (fault cause, impact path), and suggestion generation (recommended measures and operational prompts). For example, the model can output: "The current working condition is suspected to be stuck drill bit, which may be caused by downhole cuttings accumulation or drill bit failure. It is recommended to stop drilling for a short period of time for observation and carry out pump flushing operations." In addition, this module also supports multi-candidate path generation and credibility ranking, making it easier for users to select the optimal strategy from multiple solutions and meet the diverse processing needs of complex well sites.
[0048] D) The interactive feedback and continuous learning module provides adaptive evolution capabilities, supporting closed-loop human-machine interaction and continuous knowledge optimization. This module allows engineers to evaluate, supplement, or question the model's reasoning results in natural language, such as inputting "Please reassess whether there are formation factors" or "The current solution is too risky; please recommend an alternative strategy." The model dynamically adjusts its output based on user feedback and records the interactive data in a case database. This module can integrate reinforcement learning-based human feedback fine-tuning mechanisms (such as RLHF), allowing for periodic small-batch online retraining of the model to improve its diagnostic accuracy and knowledge adaptability in specific well sites and special working conditions. With the accumulation of interactive data, the system will gradually form a "personalized large model" deeply coupled with the specific engineering environment, achieving self-growth of fault knowledge and self-reinforcement of processing capabilities.
[0049] Specifically, the aforementioned large-scale model inference generation module can be a large language model structure with dual numerical and text inputs and multi-task joint learning, used to improve the structure and inference mechanism for anomaly diagnosis scenarios of multi-source time-series data from drilling rigs. For example, for each time window w (e.g., a drilling time slice of 5 min or 10 min), the fusion processing layer outputs its corresponding high-dimensional numerical feature vector: ; And a sequence of text descriptions generated from logging data, drilling rig data, and operational condition summary templates: ; And the sequence of anomaly importance weights provided by the anomaly clustering module: .
[0050] Therefore, in this example, the large model inference generation module may include: Numerical Feature Coding Submodule : Logistic eigenvectors By performing multi-layer fully connected transformations and nonlinear mappings, numerical feature embeddings are obtained: ; Encode it into several "numerical feature tokens" and mark them as special tags.<NUM_FEAT> It is inserted into the input sequence of the large language model.
[0051] Text Feature Encoding Submodule : Text sequence After word embedding and positional encoding, the following is obtained: ; Anomaly weight encoding submodule : The anomaly weights output by the anomaly clustering module Mapped to a set of exception indicator embeddings: ; And correspondingly marked as<ABN_1> …<ABN_M> Special tokens, such as these, reflect the exceptional importance of different time points or feature dimensions.
[0052] Cross-modal Transformer encoder : Combine the three types of tokens into a unified input sequence: ; The input is fed into a multi-layer Transformer encoder, and the hidden state sequence is obtained through multi-head self-attention computation: ; In this process, numerical features, text features, and anomaly weights are integrated across modalities through a self-attention mechanism within the same latent space.
[0053] Multi-head output structure for task decoupling: Set multiple task headers at the top of the encoder output: State judgment head: Aggregates features at the window level (For example, perform mean pooling on all tokens or select the first token) Apply linear mapping and softmax to obtain the state prediction: ; The labels can include: normal, abnormal trend, early signs of failure, and already failed.
[0054] Cause-based tracing generation head: At the output position of the causal chain, based on the hidden state Autoregressive Genetic Descriptive Sequence ,satisfy: ; Processing suggestion generation header: At the processing suggestion output position, an autoregressive suggestion sequence is generated based on the hidden states and the generated state labels and cause descriptions. .
[0055] Through the above structure, the large model inference of the present invention generates a cross-modal, multi-task dedicated large model structure for drilling rig anomaly diagnosis.
[0056] For training the aforementioned large language model, a multi-task joint loss and attention constraint can be used: During the training phase, the large model inference generation module in this example uses a multi-task joint loss function to unify "state judgment, cause tracing, suggestion generation" and "anomaly significance constraint" into a single optimization objective: ; Among them, the state judgment loss is: ; in, The actual status label (normal / abnormal type). For model prediction.
[0057] Cause analysis of language modeling loss: ; in, This is a manually labeled or compiled standard reason description token.
[0058] Suggested loss generation: ; in, For ranking loss among multiple candidate suggestions, for example: ; in, For the set of sample pairs that "should be higher than", Each suggestion is rated separately.
[0059] Attention saliency constraint: The anomaly weights output by the anomaly clustering module Introduce attention weight constraints. Let the attention distribution of a certain Transformer layer be... Let the set of locations corresponding to the anomalies be denoted as Then the definition is: ; in, These are the normalized outlier weights. This is a weighting factor.
[0060] This loss allows the model to focus its self-attention more on the abnormal windows and dimensions determined by the clustering module when performing causal reasoning and suggestion generation. This can significantly improve the consistency between the diagnostic results and the real abnormal patterns and reduce "illusion" reasoning.
[0061] Through the joint loss design described above, the large model inference generation module in this example can learn "judgment-causation-suggestion" simultaneously during the same training process. Furthermore, by explicitly embedding the clustering results into the model's attention structure through anomaly salience constraints, it can be distinguished from ordinary large language model fine-tuning.
[0062] The application process of this system can be as follows: Figure 3 As shown, it consists of three consecutive steps: S1: Clustering detection of abnormal drilling rig conditions; Based on real-time operational data collected by drilling rig sensors, including key parameters such as pump pressure, drilling pressure, rotation speed, well depth, and hook load, a high-dimensional time-series feature space is constructed. The system employs unsupervised learning methods such as density clustering (e.g., DBSCAN) or principal component analysis combined with clustering algorithms (e.g., PCA+K-means) to cluster the operational data. During this process, the model automatically learns the compact regions distributed under "normal operating conditions" and identifies outliers and their density clusters as "abnormal state" regions. The clustering results are visualized using a two-dimensional mapping map, where the first color region represents high-density abnormal clusters, and the second color region represents low-risk or normal states. In this step, anomaly identification is achieved in a data-driven manner without human intervention, filtering suspected target state points for subsequent deep reasoning.
[0063] Specifically, high-dimensional feature vectors can be constructed using time windows as the granularity. For a sliding time window of length T, the following statistical and morphological features can be extracted: ; in, , , These are the mean, standard deviation, and maximum value, respectively. The correlation coefficient is used to construct a sample set for all window features. And standardize it: ; in, , To obtain the normalized feature matrix, we need to estimate the mean and standard deviation on the training set. .
[0064] For the normalized characteristic matrix Perform density clustering. Taking DBSCAN as an example, define the neighborhood radius. minimum number of neighbors For any sample Calculate its neighborhood: ; if Then Mark the core points and form cluster labels according to the density reachability rule. Points that fail to be assigned to any cluster are marked as noise points. .
[0065] In another embodiment, it is possible to first... Perform principal component analysis (PCA) and take the first few results. Principal components: ; Then apply K-means clustering to the Z-space to minimize the sum of squares within each cluster: ; in, For the first The centroid of a cluster.
[0066] To facilitate engineers' intuitive understanding of anomalous distributions, this example maps high-dimensional features to a two-dimensional plane. Taking t-SNE as an example, we first define the sample pair similarity in the high-dimensional space: ; Then, find the corresponding point in two-dimensional space. And define low-dimensional similarity: ; By minimizing the Kullback-Leibler divergence: ; Obtain two-dimensional mapped coordinates .
[0067] Based on this, in this example, outliers are identified by combining cluster labels and density information: DBSCAN noise points (cluster label -1) are directly marked as Level 1 anomalies; For each cluster Calculate the average distance within the cluster: ; If a certain point satisfies ( The standard deviation of the intra-cluster distance. If the threshold is set to an empirical threshold, then the point is marked as a level 2 anomaly.
[0068] For example, on a two-dimensional mapping graph, first-level anomalies can be marked as solid dots of the first color, second-level anomalies as hollow dots of the second color, and normal points are displayed in different colors according to their cluster numbers. The system supports clicking on anomaly points in the UI to view their time windows and the corresponding large model inference results, realizing integrated linkage from "cluster-point-cause-suggestion".
[0069] S2: Cause analysis of large-scale abnormal states; After the clustering module identifies abnormal state points, the system automatically retrieves multi-source information corresponding to that time period, including: drilling rig operating parameter change trends, gas and lithological data collected by the logging system, and formation structure records. Based on this, a multimodal input corpus containing context is constructed and input into a finely tuned large language model. This large model possesses strong semantic reasoning capabilities, able to understand combinations of operating conditions such as "pump pressure fluctuations accompanied by bottomhole pressure increases" and "drastic torque changes after traversing high-permeability zones," and uses a knowledge base to determine its causal chain. For example, the model might output: "This type of anomaly usually occurs as a precursor to stuck drill pipe caused by wellbore collapse or poor cuttings return." The causal tracing module not only locates the direct cause but also deduces the inducing mechanism and concurrent risks, providing a complete causal chain.
[0070] In one implementation, firstly, based on the suspected abnormal time period output by the clustering module, a length of [length missing] is extracted. sliding window data ,in, Let be the characteristic vector of the drilling rig's operation at time t. Standardization yields: ; in, These are the estimated mean and standard deviation under historical normal operating conditions. The input numerical feature encoding submodule obtains the latent vector sequence. The output is then obtained through an L-layer Transformer encoder. Select the convergence vector that represents the entire window: ; in, This can be either average pooling or attention pooling. The state probability distribution for that time window is then output via the state classification header. ; if If the corresponding label is an anomaly, then the window is marked as an anomaly state, and the corresponding probability value is output as the anomaly confidence level.
[0071] To enable explainable causal tracing of abnormal states, this example introduces an "attention saliency constraint" and a "knowledge item alignment mechanism" during the large model decoding process. These are then used in the autoregressive generation of causal descriptions. At that time, words are generated in each step. attention weight vector This reflects the degree to which the word depends on the features at each time step. In this example, a regularization term is added during training: ; in, The anomaly importance weights provided by the clustering module (e.g., assigning higher weights to times near outliers) are minimized. This encourages the model to pay more attention to anomalous moments when generating causal descriptions.
[0072] Furthermore, in this example, a drilling fault knowledge base is maintained. Knowledge entries are in "conditional mode" Stored in the form of "fault type", for example: ; During inference, the model is first based on latent vectors. Search for the most similar knowledge entries: ; in, Embed vectors for knowledge entries. The similarity is cosine. Then, during decoding, the retrieved entry content is concatenated as additional context into the prompt, thereby constraining the generated causal description to be consistent with existing engineering knowledge, so as to avoid generating "illusions" that do not conform to on-site experience.
[0073] S3: Error Prompt and Intelligent Recommendation Handling: After completing fault identification and root cause analysis, the large model generates natural language processing suggestions based on the context and historical cases. For example, if the cause is determined to be downhole (e.g., obstruction, stuck drill bit), the system will suggest "pausing drilling, observing the pump pressure drop trend, and performing reverse flushing"; if the cause is determined to be equipment fatigue or abnormal vibration, it will suggest "planned maintenance, checking the mud pump system or replacing the drill pipe section." The suggestions can be output in a structured format, including: measure name, execution priority, risk assessment, and explanation of the rationale, to facilitate integration with the well site monitoring system or for engineers to refer to and implement. Furthermore, this module supports a multi-candidate output mechanism and allows manual selection and evaluation of the suggestion results, thereby constructing a closed loop of diagnosis-feedback-learning.
[0074] For suggestion generation, this example uses a "multi-candidate generation + policy scoring" approach to output a structured suggestion list. Specifically, given the abnormal state and its explanation, a large model is used to generate K candidate suggestion sequences. And through the strategy scoring function Perform a quantitative evaluation on each candidate: ; in, , , Scores were calculated based on safety risk assessment rules, drilling downtime estimation models, and field experience rules. These are configurable weights. The system will ultimately prioritize them. Output a sorted list of recommendations from highest to lowest, and display the rating information to engineers to facilitate quick decision-making.
[0075] Throughout the process, an intelligent diagnostic closed-loop mechanism is formed, which first locates the problem, then interprets it, and finally makes recommendations. This effectively enables real-time identification, interpretation, and intervention control of drilling rig operation anomalies.
[0076] In the example above, the integration of drilling rig operation data and well logging geological data enables unified modeling of upstream and downstream operating conditions, providing a data foundation for understanding complex states and accurately locating faults. A large language model is employed for contextual understanding and expert-like reasoning of complex states, possessing cross-modal and cross-scenario generalization capabilities and rapid adaptation to new well sites. The model reasoning features causal chain analysis and natural language interpretation capabilities, significantly improving the interpretability of fault diagnosis and enhancing on-site user trust. The introduction of human-computer interaction and a learning closed-loop mechanism enables the system to continuously evolve and proactively learn, providing drilling teams with real-time, adjustable, and scalable intelligent decision support tools. Through multi-candidate strategies and recommendation ranking algorithms, the system can automatically determine the optimal processing path and output priorities based on actual experience weights, saving time and reducing risks in decision-making. This system significantly improves the intelligent operation and maintenance level of drilling rigs and is a key supporting technology for the evolution of oil and gas drilling automation towards intelligence.
[0077] The methods and embodiments provided in the above-described embodiments of this application can be executed in a mobile terminal, computer terminal, or similar computing device. Taking operation on an electronic device as an example... Figure 4 This is a hardware structure block diagram of an electronic device for a drilling rig fault diagnosis, alarm, and handling method provided in this application. (For example...) Figure 4 As shown, the electronic device 10 may include one or more (only one is shown in the figure) processors 02 (processors 02 may include, but are not limited to, processing devices such as microprocessors (MCUs) or programmable logic devices (FPGAs), a memory 04 for storing data, and a transmission module 06 for communication functions. Those skilled in the art will understand that... Figure 4 The structure shown is for illustrative purposes only and does not limit the structure of the electronic device described above. For example, electronic device 10 may also include... Figure 4 The more or fewer components shown, or having the same Figure 4 The different configurations shown.
[0078] The memory 04 can be used to store software programs and modules of application software, such as the program instructions / modules corresponding to the drilling rig fault diagnosis, alarm, and handling method in this embodiment. The processor 02 executes various functional applications and data processing by running the software programs and modules stored in the memory 04, thereby realizing the drilling rig fault diagnosis, alarm, and handling method of the above-mentioned application. The memory 04 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 04 may further include memory remotely located relative to the processor 02, and these remote memories can be connected to the electronic device 10 via a network. Examples of the above-mentioned networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
[0079] The transmission module 06 is used to receive or send data via a network. Specific examples of the network described above may include a wireless network provided by the communication provider of the electronic device 10. In one example, the transmission module 06 includes a Network Interface Controller (NIC), which can connect to other network devices via a base station to communicate with the Internet. In another example, the transmission module 06 may be a Radio Frequency (RF) module, used for wireless communication with the Internet.
[0080] At the software level, the aforementioned drilling rig fault diagnosis, alarm, and handling devices can, as follows: Figure 5 As shown, it may include: The acquisition module 501 is used to acquire the operating data and logging data of the target drilling rig, wherein the operating data includes at least one of the following: motor torque, motor speed, motor power, and motor temperature, and the logging data includes at least one of the following: drilling pressure, rotation speed, pump pressure, well depth, and torque. The construction module 502 is used to perform timestamp alignment, data normalization, feature cleaning, and missing feature compensation on the running data and the logging data, so as to construct a unified time series multimodal feature set; The diagnostic module 503 is used to input the unified time series multimodal feature set into a pre-trained large language model to perform anomaly diagnosis on the target drilling rig and output improvement suggestions.
[0081] In one implementation, the diagnostic module 503 can specifically perform multi-layer fully connected transformation and nonlinear mapping on the numerical feature vector to obtain numerical feature embedding; obtain coded embedding by word embedding and position encoding of the text sequence; map the abnormal weights output by the abnormal clustering module into a set of abnormal indicator embeddings; combine the numerical feature embedding, the coded embedding, and the abnormal indicator embedding to form a unified input sequence, so as to realize cross-modal fusion of numerical features, text features, and abnormal weights in the same latent space through a self-attention mechanism; process the unified input sequence through the encoder in the large language model, obtain the latent state sequence through multi-head self-attention calculation, and output the abnormal diagnosis results and improvement suggestions.
[0082] In one implementation, the diagnostic module 503 can specifically decouple tasks by using multiple task heads set at the top of the encoder output to obtain state prediction results and improvement suggestions.
[0083] In one implementation, the aforementioned multiple task headers may include: a status judgment header, a cause tracing generation header, and a processing suggestion generation header, wherein: The state judgment head is used to perform linear mapping and softmax on the window-level hidden state sequence to obtain the state prediction result; The cause tracing generation head is used to generate a cause description sequence based on the autoregression of the hidden state sequence at the output position of the causal chain; The processing suggestion generation head is used to generate a suggestion sequence autoregressively at the processing suggestion output position based on the hidden state sequence and the generated state labels and cause descriptions.
[0084] In one implementation, the large language model can be trained using the following loss function: ; in, Loss is determined by the state. For causal language modeling loss, To suggest generating a loss, For attention saliency-constrained loss, , , , These are the weighting coefficients for each loss term.
[0085] In one implementation, the state determination loss can be expressed as: ; in, Labels for the actual state. The model's prediction results; The loss for causal tracing language modeling can be expressed as: ; in, These are manually labeled or curated standard cause description tokens, where t represents the time step in sequence generation. Represents the hidden state sequence, p( ) represents the conditional probability distribution given by the model; The loss generated by the proposed solution can be expressed as: ; ; in, For ranking loss of multiple candidate suggestions, Each candidate suggestion is scored separately. The standard recommended sequence is in the first... The real target token at each time step. This represents the set of sample pairs that should be higher than the specified value. The attention saliency constraint loss can be expressed as: ; in, As a weighting factor, These are the normalized outlier weights. Abnormal weights For the attention distribution of the layer, This is the set of locations corresponding to the outliers.
[0086] In one implementation, inputting the unified time-series multimodal feature set into a pre-trained large language model to perform anomaly diagnosis on the target drilling rig may include: the large language model automatically learning the compact regions distributed under normal operating conditions and identifying outliers and their density clusters as abnormal state regions; and visualizing the clustering results in a two-dimensional mapping diagram, wherein the first color region represents high-density abnormal clusters and the second color region represents low-risk or normal states.
[0087] Among them, the large language model automatically learns the compact regions distributed under normal operating conditions and identifies outliers and their density clusters as abnormal state regions, which may include: High-dimensional feature vectors are constructed using time windows as the granularity. For a sliding time window of length T, the following statistical and morphological features are extracted: ; in, The mean, Standard deviation, The maximum value, The correlation coefficient; A sample set is constructed for all window features. Then, standardize the matrix to obtain the normalized feature matrix. : ; in, To estimate the mean obtained on the training set, To estimate the standard deviation obtained on the training set, N represents the number of samples, the number of sliding time windows, and d represents the dimension of the feature vector of each window; Density clustering is performed on the normalized feature matrix, and the neighborhood radius is defined. minimum number of neighbors For any sample Calculate its neighborhood: ; in, Indicates sample of Neighborhood, Indicates the neighborhood radius threshold. This represents the normalized feature vector corresponding to the j-th sample; exist In the case of, Mark the core points and form cluster labels according to the density reachability rule. Points that fail to be assigned to any cluster are marked as noise points-1.
[0088] This application also provides a specific implementation of an electronic device capable of implementing all steps in the drilling rig fault diagnosis, alarm, and handling methods described in the above embodiments. The electronic device specifically includes: a processor, a memory, a communication interface, and a bus; wherein the processor, memory, and communication interface communicate with each other via the bus; the processor is used to call a computer program in the memory, and when the processor executes the computer program, it implements all steps in the drilling rig fault diagnosis, alarm, and handling methods described in the above embodiments. For example, when the processor executes the computer program, it implements the following steps: Step 1: Obtain the operating data and logging data of the target drilling rig, wherein the operating data includes at least one of the following: motor torque, motor speed, motor power, and motor temperature, and the logging data includes at least one of the following: drilling pressure, rotation speed, pump pressure, well depth, and torque; Step 2: Perform timestamp alignment, data normalization, feature cleaning, and missing feature compensation on the operational data and the logging data to construct a unified time series multimodal feature set; Step 3: Input the unified time series multimodal feature set into the pre-trained large language model to perform anomaly diagnosis on the target drilling rig and output improvement suggestions.
[0089] Embodiments of this application also provide a computer-readable storage medium capable of implementing all steps of the drilling rig fault diagnosis, alarm, and handling methods in the above embodiments. The computer-readable storage medium stores a computer program that, when executed by a processor, implements all steps of the drilling rig fault diagnosis, alarm, and handling methods in the above embodiments. For example, when the processor executes the computer program, it implements the following steps: Step 1: Obtain the operating data and logging data of the target drilling rig, wherein the operating data includes at least one of the following: motor torque, motor speed, motor power, and motor temperature, and the logging data includes at least one of the following: drilling pressure, rotation speed, pump pressure, well depth, and torque; Step 2: Perform timestamp alignment, data normalization, feature cleaning, and missing feature compensation on the operational data and the logging data to construct a unified time series multimodal feature set; Step 3: Input the unified time series multimodal feature set into the pre-trained large language model to perform anomaly diagnosis on the target drilling rig and output improvement suggestions.
[0090] As described above, this application embodiment acquires the operating data and logging data of the target drilling rig. The operating data includes at least one of the following: motor torque, motor speed, motor power, and motor temperature. The logging data includes at least one of the following: drilling pressure, rotational speed, pump pressure, well depth, and torque. The operating data and logging data are time-stamp aligned, data normalized, feature cleaned, and missing data compensated to construct a unified time-series multimodal feature set. This unified time-series multimodal feature set is input into a pre-trained large language model to diagnose anomalies in the target drilling rig and output improvement suggestions. This solution addresses the existing technical problem of low efficiency and accuracy in drilling rig fault diagnosis, achieving the technical effect of improving the accuracy, generalization, and response speed of drilling rig fault diagnosis.
[0091] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to interchangeably. Each embodiment focuses on its differences from other embodiments. In particular, hardware + program embodiments are relatively simple in description because they are fundamentally similar to method embodiments; relevant parts can be referred to the descriptions in the method embodiments.
[0092] The foregoing has described specific embodiments of this specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims may be performed in a different order than that shown in the embodiments and may still achieve the desired result. Furthermore, the processes depicted in the drawings do not necessarily require the specific or sequential order shown to achieve the desired result. In some embodiments, multitasking and parallel processing are possible or may be advantageous.
[0093] While this application provides the method operation steps as described in the embodiments or flowcharts, more or fewer operation steps may be included based on conventional or non-inventive labor. The order of steps listed in the embodiments is merely one possible execution order among many and does not represent the only execution order. In actual device or client product execution, the methods shown in the embodiments or drawings can be executed sequentially or in parallel (e.g., in a parallel processor or multi-threaded processing environment).
[0094] While this specification provides method operation steps as described in the embodiments or flowcharts, more or fewer operation steps may be included based on conventional or non-inventive means. The order of steps listed in the embodiments is merely one possible execution order among many and does not represent the only execution order. In actual device or end product execution, the methods shown in the embodiments or drawings may be executed sequentially or in parallel (e.g., in a parallel processor or multi-threaded processing environment, or even a distributed data processing environment). The terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, product, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, product, or apparatus. Without further limitations, the presence of other identical or equivalent elements in the process, method, product, or apparatus that includes said elements is not excluded.
[0095] For ease of description, the above devices are described in terms of function, divided into various modules. Of course, in implementing the embodiments of this specification, the functions of each module can be implemented in one or more software and / or hardware components, or a module that performs the same function can be implemented by a combination of multiple sub-modules or sub-units. The device embodiments described above are merely illustrative. For example, the division of units is only a logical functional division; in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces, or indirect coupling or communication connection between devices or units, and may be electrical, mechanical, or other forms.
[0096] Those skilled in the art will also know that, besides implementing the controller using purely computer-readable program code, the same functions can be achieved by logically programming the method steps, making the controller function as logic gates, switches, application-specific integrated circuits (ASICs), programmable logic controllers (PLCs), and embedded microcontrollers. Therefore, such a controller can be considered a hardware component, and the devices within it used to implement various functions can also be considered structures within that hardware component. Alternatively, the devices used to implement various functions can be considered as both software modules implementing the method and structures within a hardware component.
[0097] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0098] Those skilled in the art will understand that the embodiments of this specification can be provided as methods, systems, or computer program products. Therefore, the embodiments of this specification can take the form of entirely hardware embodiments, entirely software embodiments, or embodiments combining software and hardware aspects. Furthermore, the embodiments of this specification can take the form of computer program products implemented on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0099] The embodiments described in this specification can be described in the general context of computer-executable instructions, such as program modules, that are executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc., that perform a specific task or implement a specific abstract data type. The embodiments of this specification can also be practiced in distributed computing environments where tasks are performed by remote processing devices connected via a communication network. In distributed computing environments, program modules can reside in local and remote computer storage media, including storage devices.
[0100] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, system embodiments are basically similar to method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions in the method embodiments. In the description of this specification, the terms "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., refer to specific features, structures, materials, or characteristics described in connection with that embodiment or example, which are included in at least one embodiment or example of the embodiments in this specification. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described can be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification and the features of different embodiments or examples.
[0101] The above description is merely an embodiment of the present specification and is not intended to limit the embodiments of the present specification. For those skilled in the art, various modifications and variations can be made to the embodiments of the present specification. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principle of the embodiments of the present specification should be included within the scope of the claims of the embodiments of the present specification.
Claims
1. A method for diagnosing, alarming, and handling drilling rig faults, characterized in that, include: Acquire the operating data and logging data of the target drilling rig, wherein the operating data includes at least one of the following: motor torque, motor speed, motor power, and motor temperature, and the logging data includes at least one of the following: drilling pressure, rotational speed, pump pressure, well depth, and torque; The operational data and the logging data are time-stamp aligned, data normalized, feature cleaned, and missing data compensated to construct a unified time series multimodal feature set; The unified time-series multimodal feature set is input into a pre-trained large language model to perform anomaly diagnosis on the target drilling rig and output improvement suggestions.
2. The method according to claim 1, characterized in that, The unified time-series multimodal feature set is input into a pre-trained large language model to perform anomaly diagnosis on the target drilling rig and output improvement suggestions, including: Numerical feature embeddings are obtained by performing multi-layer fully connected transformations and nonlinear mappings on numerical feature vectors. The text sequence is encoded by word embedding and positional encoding; Map the anomaly weights output by the anomaly clustering module to a set of anomaly indicator embeddings; The numerical feature embedding, the encoding embedding, and the anomaly indicator embedding are combined to form a unified input sequence, so as to realize cross-modal fusion of numerical features, text features, and anomaly weights in the same latent space through a self-attention mechanism; The unified input sequence is processed by the encoder in the large language model, and the hidden state sequence is obtained by multi-head self-attention calculation. The anomaly diagnosis results and improvement suggestions are then output.
3. The method according to claim 2, characterized in that, The unified input sequence is processed by the encoder in the large language model, and the hidden state sequence is obtained through multi-head self-attention calculation. Anomaly diagnosis results and improvement suggestions are then output, including: Task decoupling is achieved by using multiple task headers set at the top of the encoder output, resulting in state prediction results and improvement suggestions.
4. The method according to claim 3, characterized in that, The multiple task headers include: a status judgment header, a cause tracing generation header, and a processing suggestion generation header, wherein: The state judgment head is used to perform linear mapping and softmax on the window-level hidden state sequence to obtain the state prediction result; The cause tracing generation head is used to generate a cause description sequence based on the autoregression of the hidden state sequence at the output position of the causal chain; The processing suggestion generation head is used to generate a suggestion sequence autoregressively at the processing suggestion output position based on the hidden state sequence and the generated state labels and cause descriptions.
5. The method according to claim 1, characterized in that, The large language model is trained using the following loss function: ; in, This is the total loss value. Loss is determined by the state. For causal language modeling loss, To suggest generating a loss, For attention saliency-constrained loss, , , , These are the weighting coefficients for each loss term.
6. The method according to claim 5, characterized in that: The state determination loss is expressed as: ; in, The loss value is used to determine the state. Labels for the actual state. The model prediction result is given, where k is the sample index for state judgment, and ∑ k This represents the summation of the logarithmic product of the true state labels and the model predictions for all samples; The loss for causal tracing language modeling is expressed as: ; in, For causal language modeling loss value, These are manually labeled or curated standard cause description tokens, where t represents the time step in sequence generation. Represents the hidden state sequence, p( ) represents the conditional probability distribution given by the model; The proposed loss is expressed as: ; ; in, To suggest generating loss values, For ranking loss of multiple candidate suggestions, Each candidate suggestion is scored separately. The standard recommended sequence is in the first... The true target token at each time step. This represents the set of sample pairs that should be higher than the specified value. The attention saliency constraint loss is expressed as: ; in, The loss value is the one constrained by attention significance. As a weighting factor, These are the normalized outlier weights. Abnormal weights For the attention distribution of the layer, This is the set of locations corresponding to the outliers.
7. The method according to claim 1, characterized in that, The unified time-series multimodal feature set is input into a pre-trained large language model to perform anomaly diagnosis on the target drilling rig, including: The large language model automatically learns the compact regions distributed under normal operating conditions and identifies outliers and their density clusters as abnormal state regions. The clustering results are visualized using a two-dimensional mapping diagram, where the first color region represents high-density abnormal clusters and the second color region represents low-risk or normal states.
8. The method according to claim 7, characterized in that, The large language model automatically learns the compact regions distributed under normal operating conditions and identifies outliers and their density clusters as abnormal state regions, including: High-dimensional feature vectors are constructed using time windows as the granularity. For a sliding time window of length T, the following statistical and morphological features are extracted: ; in, The morphological features obtained through statistics The mean, Standard deviation The maximum value, , where P is the correlation coefficient, P is the pressure parameter during the drilling process, and WOB is the downward pressure applied to the drill bit; A sample set is constructed for all window features. Then, standardize the matrix to obtain the normalized feature matrix. : ; in, Let be the normalized feature vector corresponding to the i-th sample, where i is the index of the sample. To estimate the mean obtained on the training set, To estimate the standard deviation obtained on the training set, N represents the number of samples and the number of sliding time windows, and d represents the dimension of the feature vector of each window; Density clustering is performed on the normalized feature matrix, defining the neighborhood radius and the minimum number of neighbors for any sample. Calculate its neighborhood: ; in, Indicates sample of Neighborhood, Indicates the neighborhood radius threshold. This represents the normalized feature vector corresponding to the j-th sample; exist In the case of, Mark the core points and form cluster labels according to the density reachability rule. Points that fail to be assigned to any cluster are marked as noise points -1, where, The minimum number of neighbors.
9. A drilling rig fault diagnosis, alarm and handling device, characterized in that, include: The acquisition module is used to acquire the operating data and logging data of the target drilling rig, wherein the operating data includes at least one of the following: motor torque, motor speed, motor power, and motor temperature, and the logging data includes at least one of the following: drilling pressure, rotation speed, pump pressure, well depth, and torque; The module is used to perform timestamp alignment, data normalization, feature cleaning, and missing feature compensation on the running data and the logging data, so as to construct a unified time series multimodal feature set; The diagnostic module is used to input the unified time-series multimodal feature set into a pre-trained large language model to perform anomaly diagnosis on the target drilling rig and output improvement suggestions.
10. An electronic device comprising a processor and a memory for storing processor-executable instructions, characterized in that, When the processor executes the instructions, it implements the steps of the method according to any one of claims 1 to 8.
Citation Information
Patent Citations
Data cleaning method for ship information infrastructure fault diagnosis
CN121255782A
Intelligent teaching assisting system base LLM training method for well drilling simulator
CN121414554A
Underground equipment multi-source fault prediction method and system based on large model
CN121561792A
Construction method and application of well site real-time data pre-training model
CN121614976A
Method and system for artificial intelligence (AI) based alarm management
US20260037522A1