A safety monitoring method and monitoring system for oil well construction
By using multimodal feature fusion and dynamic anomaly detection with Transformer networks, the problem of abnormal sensor data during oil well construction was solved, achieving efficient and accurate safety monitoring and real-time alarms, thus improving construction safety.
Patent Information
- Application Number
- CN202511036660.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-28
- Publication Date
- 2025-10-21
- Estimated Expiration
- 2045-07-28
AI Technical Summary
In the complex and ever-changing oil well construction environment, sensor data anomalies or loss increase the difficulty of data monitoring, and existing technologies struggle to achieve efficient anomaly detection and safety assessment.
A multimodal feature fusion method is adopted to process oil well construction data through machine learning prediction models, including data cleaning, noise removal, outlier identification and data normalization. Dynamic anomaly detection is performed by combining a Transformer network and the weights are updated by Bayes' formula to achieve real-time identification and alarm of anomalies.
It improves the efficiency and accuracy of oil well construction data monitoring, enables timely identification of potential risks, reduces false alarm rates, and ensures construction safety.
Smart Images

Figure CN120541585B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of electronic digital data processing, and in particular to a safety monitoring method and a monitoring system for oil well construction. Background Art
[0002] Sensor networks and Industrial Internet of Things (IIoT) systems at construction sites generate massive amounts of real-time data, including pressure, temperature, flow, vibration, equipment operating status, and environmental conditions. This data is crucial for ensuring the safety and efficiency of oil well construction. This data is crucial for ensuring construction safety, efficiency, and quality. However, construction sites are complex environments, and sensors can be subject to interference or malfunctions over long periods of operation, leading to data anomalies or loss, posing potential risks to construction safety.
[0003] For example, extreme environmental conditions (such as high temperatures, high pressures, or corrosive media) can affect sensor accuracy or lifespan, leading to data inconsistencies. Furthermore, dynamic factors present during construction, such as pressure fluctuations, equipment vibration, or changes in operating conditions, can introduce noisy data, further complicating data monitoring.
[0004] With the development of large-scale model technology, large-scale models based on deep learning and reinforcement learning can generate test data that simulates the oil well construction process. This data is often used to simulate extreme scenarios or test the robustness and emergency response capabilities of construction systems. However, due to model bias during the generation process or incomplete input data, the data generated by large models may contain potential anomalies or logical contradictions, further increasing the requirements for data security monitoring.
[0005] Therefore, achieving efficient anomaly detection and security assessment in complex and changing environments has become an important research direction. Summary of the Invention
[0006] In response to the above technical problems existing in the prior art, the present invention provides a safety monitoring method and monitoring system for oil well construction, which improves the efficiency and safety of oil well construction data monitoring.
[0007] The present invention discloses a safety monitoring method for oil well construction, comprising the following steps: collecting monitoring data of the oil well construction; extracting features from the monitoring data, and fusing the features and the monitoring data to obtain fused features; predicting a detection value of the fused features using a prediction model based on machine learning to obtain a predicted value; calculating a first abnormality degree based on the predicted value and the detected value; judging whether the first abnormality degree exceeds a first threshold; if so, obtaining a second abnormality degree and a safety score based on the predicted value and the detected value; and issuing an abnormality alarm based on the safety score and the second threshold.
[0008] Preferably, the extracted features include any one of the following indicators or a combination thereof: temperature, pressure, flow rate, humidity, pressure change rate, temperature gradient and flow rate fluctuation amplitude;
[0009] Fusion features include any of the following indicators or their combination: data source features, feature-level features, and decision-level features;
[0010] The monitoring data is also preprocessed, which includes: data cleaning, noise removal, outlier identification and data normalization.
[0011] Preferably, the pressure change rate is expressed as:
[0012] ;
[0013] in, P(t) is the pressure value at time t, is the time interval, is the pressure change value, is the pressure change rate;
[0014] Temperature gradient Expressed as:
[0015] ;
[0016] in, T(t2) and T(t1) Time t1 and t2 The temperature value, d is the distance between temperature sensors;
[0017] Traffic fluctuation range Expressed as:
[0018] ;
[0019] in, Q max and Q min are the maximum flow rate and the minimum flow rate in the time window respectively;
[0020] Data source characteristics F fusion Expressed as:
[0021] ;
[0022] in, w i is the weight of the data source, d ik Indicates the i The first k data points,m is the total number of data points, n1 Expressed as the total number of data sources;
[0023] Feature-level features X fusion Expressed as:
[0024] ;
[0025] in, X fusion is a feature-level feature, X j is the feature vector of the j-th data source, w j is the weight of the eigenvector, n2 is the total number of eigenvectors;
[0026] Decision-level features Y fusion Expressed as:
[0027] ;
[0028] in, Y q It is q The decision output of each data source, w q is the weight of the decision output, .
[0029] Preferably, the weights are updated based on the Bayesian formula, which is expressed as:
[0030] ;
[0031] in, w Expressed as weight, w Selected from the weights of data sources, feature vectors and decision outputs, is the posterior probability of the weight in the case of data D, is the likelihood of data D under weight, P( w ) is the prior distribution of weights, and P(D) is the total probability of data D.
[0032] Preferably, the machine learning method includes: support vector machine, decision tree or neural network,
[0033] The neural network includes a Transformer.
[0034] Preferably, the first abnormality degree is calculated as follows:
[0035] ;
[0036] in, A(t) is the time step t The first abnormality degree, X i2 (t) Indicates the i2 sensors at time step t Input data / test value, For the prediction model at time step t The predicted value of d2 is the total number of sensors;
[0037] The first threshold value P1 is determined as follows:
[0038] ;
[0039] in, A max Indicates the maximum abnormality value in historical data, is the safety factor.
[0040] Preferably, the second abnormality degree is expressed as:
[0041] ;
[0042] in, A(X i3 ) is the second abnormality degree, X i3 No. i3 The detection value of a time window, is the predicted value, is the standard deviation of historical data;
[0043] The safety evaluation S is expressed as:
[0044] ;
[0045] in, Expressed as the weight coefficient of the impact of the second abnormality on the safety score, l Represents the current time window i3 The number of data items below.
[0046] Preferably, the abnormal alarm level determination method is:
[0047] ;
[0048] Wherein, L represents the level of the alarm.
[0049] Preferably, the threshold or the boundary of the threshold interval is updated, and the updated threshold or threshold interval is expressed as:
[0050] ;
[0051] Where T is the initial threshold or threshold interval boundary, the correlation coefficient R represents the matching degree between the alarm event and the real anomaly in the historical data, and the historical false alarm rate Wb represents the proportion of alarm errors in the past;
[0052] The expression of the correlation coefficient R is as follows:
[0053] ;
[0054] Among them, represents the probability of an actual anomaly occurring after the alarm is triggered, which indicates the reliability of the alarm; represents the probability of issuing an alarm when an anomaly occurs, that is, the proportion of valid alarms in history; P(E) is the prior probability of the anomaly, that is, the overall frequency of anomaly occurrence; and P(A) is the overall frequency of alarm occurrence.
[0055] The present invention also provides a monitoring system for implementing the above-mentioned security monitoring method, comprising an acquisition module, a feature extraction module, a fusion module, an anomaly detection module and an alarm module;
[0056] The acquisition module is used to collect monitoring data of oil well construction; the feature extraction module is used to extract features from the monitoring data; the fusion module is used to fuse the features and the monitoring data to obtain fusion features;
[0057] The anomaly detection module is used to analyze the fusion features based on the prediction model to obtain a prediction value; obtain a first anomaly degree based on the prediction value and the detection value; if the first anomaly degree exceeds a first threshold, call the alarm module;
[0058] The alarm module is used to obtain a second abnormality degree and a safety score based on the predicted value and the detected value; and to issue an abnormality alarm based on the safety score and the second threshold.
[0059] Compared with the existing technology, the beneficial effects of the present invention are: through multimodal feature fusion, it can adapt to complex and changeable construction environments, adapt to large-scale, high-dimensional monitoring data, and improve computing efficiency; through anomaly detection and anomaly alarm based on the predicted values and detection values of the prediction model, the accuracy and reliability of monitoring are improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0060] Figure 1 This is a flow chart of the safety monitoring method for oil well construction of the present invention;
[0061] Figure 2 It is the logic block diagram of the monitoring system. DETAILED DESCRIPTION
[0062] To make the objectives, technical solutions, and advantages of the embodiments of the present invention more clear, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts shall fall within the scope of protection of the present invention.
[0063] The present invention is described in further detail below with reference to the accompanying drawings:
[0064] A first aspect of the present invention provides a safety monitoring method for oil well construction, comprising the following steps:
[0065] Step S1: Collect monitoring data of oil well construction and perform pre-processing.
[0066] At oil well construction sites, data collection is achieved through the deployment of a variety of sensors and monitoring equipment. These sensors include pressure sensors, temperature sensors, flow meters, vibration sensors, and environmental monitoring instruments, which are used to monitor key parameters inside the oil well and the surrounding environment in real time.
[0067] Step S2: Extract features from the monitoring data, and fuse the features with the monitoring data to obtain fused features.
[0068] Step S3: construct the training set according to the fusion features.
[0069] Step S4: Train the training set based on a machine learning method to obtain a prediction model.
[0070] Step S5: Obtain the predicted value through the prediction model.
[0071] Step S6: Obtain a first abnormality degree according to the predicted value and the detected value.
[0072] Step S7: Determine whether the first abnormality degree exceeds a first threshold.
[0073] If not, continue to monitor the data.
[0074] If so, execute step S8 to obtain a second abnormality degree and a safety score based on the predicted value and the detected value.
[0075] Step S9: issuing an abnormality alarm based on the safety score and the second threshold.
[0076] Through multimodal feature fusion, it adapts to complex and changing construction environments, adapts to large-scale, high-dimensional monitoring data, and improves computing efficiency; through anomaly detection and anomaly alarm based on the predicted values and detection values of the prediction model, it improves the accuracy and reliability of monitoring.
[0077] Example: To achieve real-time monitoring and abnormality alerts for oil well construction data, one of the core steps is data collection and preprocessing in step S1. Preprocessing includes data cleaning, noise removal, outlier identification, and data normalization.
[0078] This step is the foundation of the entire monitoring system, ensuring the high quality, integrity, and consistency of data collected from multiple sources, thereby providing reliable input for subsequent dynamic anomaly detection, multimodal data fusion, and alert mechanisms. The data acquisition and preprocessing module not only acquires and cleans data, but also normalizes and extracts features using a series of algorithms, ensuring the monitoring system can accurately and effectively identify potential safety hazards in complex construction environments. At the oil well construction site, data collection is achieved through the deployment of a variety of sensors and monitoring equipment. These sensors, including pressure sensors, temperature sensors, flow meters, vibration sensors, and environmental monitoring instruments, monitor key parameters within the well and surrounding environment in real time. These sensors can transmit the collected data in real time via the Industrial Internet of Things (IIoT) network, for example, uploading it to a central data processing system. Simultaneously, test data generated by the large model is fed into the system through pre-defined interfaces to simulate extreme operating conditions and abnormal scenarios, supplementing and enriching the monitoring scope of real-time data.
[0079] The collected raw data often contains noise and outliers, which may be introduced due to sensor failure, environmental interference or data transmission errors. In practical applications, real-time data from the construction site and test data generated by large models need to be used in combination to fully cover various scenarios in the construction process. However, these two types of data come from different sources and have different characteristics. How to effectively integrate them and conduct unified safety monitoring is one of the current technical challenges. Traditional rule-driven data monitoring methods rely on static safety rules or empirical knowledge and cannot dynamically adapt to complex and changing construction environments. This method has weak detection capabilities for sudden anomalies or unknown patterns, which can easily lead to blind spots in monitoring. In addition, traditional methods often face the problem of low computational efficiency when processing large-scale, high-dimensional data, making it difficult to meet the needs of real-time monitoring.
[0080] Therefore, the data must first be cleaned and denoised. To effectively remove high-frequency noise, a Gaussian filter can be used for smoothing. The Gaussian filter effectively suppresses the influence of high-frequency noise by performing a weighted average of the data of each data point and its surrounding neighborhood, with the weight determined by a Gaussian function. The specific formula is as follows:
[0081] (1);
[0082] in, X(t) Indicates time t The data value of is the standard deviation of the filter, k Time window i Through the Gaussian filtering process, the system is able to preserve the main trends of the data while reducing fluctuations caused by environmental noise or equipment errors.
[0083] After denoising, outliers are further identified and removed from the data. Because construction data may contain extreme values due to sensor failure or transient interference, the system uses a statistical method based on boxplots for outlier detection. First, the system calculates the first quartile Q1 and third quartile Q3 of the dataset, as well as the interquartile range (IQR = Q3 - Q1). The outlier range is defined as:
[0084] Outlier range = [Q1 1.5·IQR, Q3 + 1.5·IQR] (2);
[0085] Data points outside this range are considered outliers and are removed. This effectively identifies and removes outliers that significantly deviate from the normal data distribution while preserving the overall characteristics and distribution of the dataset. This ensures that data from different sources and types can be compared and analyzed within a unified feature space, and also allows for data normalization. Specifically, the minimum-maximum normalization method is used to compress all data into the range of 0 and 1, eliminating the impact of differences in the magnitude of data from different sensors. The normalization formula is as follows:
[0086] (3);
[0087] in, X min and X max are the minimum and maximum values in the data set, respectively. Through normalization, the system ensures that all input data X are fused and analyzed at the same scale, improving the efficiency and accuracy of algorithm processing.
[0088] The purpose of feature extraction in step S2 is to extract key indicators reflecting the construction status and potential risks from the original data and construct a high-dimensional feature vector for use in subsequent anomaly detection algorithms.
[0089] Specifically, in addition to basic features such as temperature, pressure, flow rate, and humidity, the following key features are also extracted: pressure change rate, temperature gradient, and flow rate fluctuation amplitude.
[0090] The pressure change rate is an important indicator reflecting the dynamic changes in pressure in the oil well. The calculation formula is:
[0091] (4);
[0092] in, P(t) For time t The pressure value, is the time interval, is the pressure change value, is the pressure change rate. This feature can reveal the instantaneous change trend of pressure and is of great significance for detecting pressure anomalies.
[0093] Temperature gradient It is used to reflect the temperature change rate of the oil well and its equipment. The calculation formula is:
[0094] (5);
[0095] in, T(t2) and T(t1) Time t1 and t2 The temperature value, d is the distance between temperature sensors. Changes in temperature gradients can indicate overheating or uneven cooling of equipment, signaling potential equipment failure or environmental issues.
[0096] Traffic fluctuation range An important characteristic reflecting the fluid dynamics of the oil well, and its calculation formula is:
[0097] (6);
[0098] in, Q max and Q min The maximum and minimum flow rates within the time window are shown in Figure 2. The increase in flow fluctuation amplitude may indicate problems such as fluid flow instability or pipeline blockage.
[0099] Through the above-mentioned feature extraction, multiple key parameters are converted into high-dimensional feature vectors, providing a rich information basis for subsequent dynamic anomaly detection and multimodal data fusion. This process not only improves the interpretability of the data, but also enhances the anomaly detection algorithm's ability to identify potential risks in complex construction environments. Data acquisition and preprocessing play a vital role in the present invention. Through efficient denoising, precise outlier removal, unified normalization methods and extraction of key features, the high quality and consistency of the input data can be ensured. It lays a solid foundation for the successful implementation of intelligent data safety monitoring methods, enabling subsequent dynamic anomaly detection and multimodal feature fusion to accurately identify and warn of potential safety risks in the oil well construction process with reliable data support.
[0100] The feature fusion in step S2 is a key step in achieving efficient data analysis and anomaly detection. Its main function is to fuse multimodal data from different data sources to improve monitoring accuracy and reliability. During oil well construction, data comes from a variety of sources, including real-time data collected on-site (such as sensor data such as pressure, temperature, flow, vibration, etc.), as well as simulation data and historical data generated by large models. Because these data types have different sources, scales, and formats, an effective fusion mechanism is needed to comprehensively understand the real-time status of oil well construction from multiple dimensions. The design of the multimodal data fusion module aims to explore the potential connections between different data types through deep data fusion, thereby improving the detection ability of complex anomalies. By processing various heterogeneous data sources, eliminating data redundancy and enhancing data complementarity, it helps subsequent anomaly detection and early warning systems to more accurately identify potential risks.
[0101] In the specific feature fusion, a fusion strategy based on weighted summation is adopted to fuse: data source features F fusion , feature-level features X fusion and decision-level features Y fusion。 It can assign different weights to each data type based on the credibility and importance of different data sources, thereby achieving a more accurate comprehensive evaluation.
[0102] Given a set of multimodal data, each of which D i Each corresponds to a weight W i , where the weight reflects the importance of the data in the final fusion. The goal of data fusion is to calculate a weighted average or weighted sum so that the contribution of each data source to the final result is proportional to its weight. For each data source = {,,...,}, the fusion result is expressed as:
[0103] (7);
[0104] in, w i is the weight of the data source, d ik Indicates the i The first k data points, m is the total number of data points. The final multimodal data fusion result F fusion is the sum of the weighted sums of all data sources:
[0105] (8);
[0106] In this process, w i The weight is set based on the importance and reliability of the data source, which can usually be determined through historical data analysis or expert evaluation. n1 The weighted summation approach ensures that each data source has a different influence in the fusion process, thereby obtaining a fusion result that comprehensively considers multiple factors.
[0107] Weight w i The determination of is usually a dynamic process. In order to more accurately reflect the influence of each data source, the weight can be dynamically adjusted in combination with the historical performance and reliability of the data. A common approach is to use the accuracy, stability, and relevance of the data source to adjust the weight. For example, when a data source (such as pressure sensor data) exhibits a strong anomaly recognition ability, its weight can be appropriately increased; and when a data source has errors or large deviations, its weight can be appropriately reduced. In practical applications, weights can be optimized through learning algorithms, such as using Bayesian inference methods to infer the credibility of each data source based on historical data, and using this credibility to dynamically adjust the weight. Specifically, by calculating the contribution of the data source in historical monitoring and its correlation with other data sources, the Bayesian formula is used to update the weight:
[0108] (9);
[0109] in, is the weight in the case of data D w i The posterior probability of The weight of data D w i The likelihood under w i ) is the prior distribution of weights, and P(D) is the total probability of data D.
[0110] Multimodal data fusion is not just a direct weighted average of the original data, but can also be fused at the feature level and decision level. Feature-level fusion refers to the joint modeling of features from different data sources (such as pressure change rate, temperature gradient, flow fluctuation, etc.) to extract more comprehensive comprehensive features through feature fusion. This process can be modeled using methods such as multivariate linear regression or neural networks. The features of each data source can be represented as a vector X j =[x j1 ,x j2 ,..., x jn2] , then the feature-level fusion process can be performed by weighted features:
[0111] (10);
[0112] in, X fusion is a feature-level feature, X j For the j The feature vector of the data source, w j is the weight of the eigenvector, n2 is the total number of eigenvectors. The fused eigenvectors X fusion It will contain information from multiple data sources and be processed by the subsequent anomaly detection module.
[0113] Decision-level fusion is performed based on the detection results of each data source. When each data source uses its own detection model to determine whether an anomaly exists, these results can be combined through voting or weighted averaging. Assuming that the decision output of each data source is , where 0 indicates no anomaly and 1 indicates an anomaly, the decision-level fusion process can be expressed as:
[0114] (11);
[0115] According to the comprehensive decision value Y fusion , Y q It is q The decision output of each data source, w q Is the weight of the decision output. The system will determine whether there is an abnormal situation. If If the value is greater than a certain threshold (usually 0.5), it is considered abnormal; otherwise, the data is considered normal. w k and w q It can also be updated through the Bayesian formula, and the Bayesian formula can be expressed as:
[0116] (12);
[0117] in, w Expressed as weights, selected from the weights of data sources, feature vectors, and decision outputs, is the posterior probability of the weight in the case of data D, is the likelihood of data D under weight, P( w) is the prior distribution of weights, and P(D) is the total probability of data D.
[0118] By fusing feature-level and decision-level data, a comprehensive representation of multimodal data is obtained. Based on this comprehensive representation, comprehensive assessment of the safety status of oil well operations and anomaly detection are performed. Furthermore, the multi-layer perceptron model in deep learning can be used to map field data and test data into a unified feature space to generate a fused feature representation. This fused data captures the inherent correlations between the two types of data, improving the accuracy and applicability of anomaly detection.
[0119] Machine learning models (such as support vector machines, decision trees, or neural networks) can be used to train and classify the fused data, automatically determining whether the current well construction status is abnormal. The results of anomaly detection will provide input for subsequent alarm mechanisms, ensuring that alerts are issued promptly and early in the event of an anomaly, thereby avoiding potential safety incidents. The design and implementation of the multimodal data fusion module enables the present invention to effectively integrate data from different sources and perform a weighted summation or weighted average fusion operation based on the weight, historical performance, and credibility of each data source. Through feature-level and decision-level fusion, the system can more comprehensively and accurately assess the safety status of oil well construction, providing precise data support for subsequent anomaly detection and alarm mechanisms.
[0120] With the development of artificial intelligence (AI) technology, intelligent algorithms based on machine learning and deep learning have demonstrated tremendous potential in data security monitoring. For example, anomaly detection algorithms can automatically identify potential anomalous patterns by learning from the distribution characteristics of historical data. Time series analysis techniques can capture dynamic patterns in data and predict potential anomalous trends. However, the application of these technologies in oil well construction is still in its early stages. Designing efficient and accurate algorithms tailored to the specific characteristics of data generated by construction sites and large models, while ensuring the reliability and interpretability of monitoring results, remains an urgent technical challenge.
[0121] In step S5, the prediction model, another core component of the present invention, is responsible for real-time monitoring and anomaly identification of oil well construction data. During the oil well construction process, it automatically identifies potential anomaly patterns and triggers an alarm mechanism. With the rapid growth of data during oil well construction, traditional static monitoring methods are no longer able to effectively identify complex and changing anomaly patterns.
[0122] The present invention specifically proposes a method based on Transformer Prediction models based on (Transformer) networks can process high-dimensional, multimodal time series data more accurately and efficiently.
[0123] Oil well construction data has the following characteristics: diverse data types, frequent generation, large fluctuations, and unpredictable abnormal patterns. In order to promptly detect potential safety hazards, data streams must be monitored dynamically and continuously. Traditional anomaly detection methods, such as control chart methods based on statistical analysis and rule-based detection methods, often have strong limitations and are difficult to cope with the complexity and diversity of oil well construction data. Especially when the amount of data increases, traditional methods are easily affected by data noise and changing patterns, resulting in false positives and false negatives. Introducing a new anomaly detection method based on statistical analysis. Transformer The prediction model, through Transformer The powerful time series modeling capabilities and self-attention mechanism of the algorithm can accurately model the dynamic data of oil well construction and detect abnormal changes in the data stream in real time. Transformer It can automatically capture long-term dependencies in data, avoiding the shortcomings of traditional methods in dealing with long-term dependent data, thereby improving the accuracy of anomaly detection.
[0124] In the process of dynamic anomaly detection, Transforme The self-attention mechanism plays a key role. Compared with the traditional recurrent neural network ( RNN )compared to, Transformer It does not rely on serialized computing processes and can process input data in parallel, which significantly improves processing efficiency, especially when processing large-scale oil well construction data.
[0125] First, the data generated during the oil well construction process X(t) is a time series dataset, where t represents the time step, X(t) Indicates at a point in time t The input data of the sensors (such as temperature, pressure, flow, etc.) is usually multi-dimensional, and each dimension may represent different sensor information, so these multi-modal data need to be fused and processed. Transformer In the input and embedding layer, the original time series data is processed and transformed to ensure that the input data meets the requirements of the model. Assume that there are T time steps and the input data of each time step is a d dimensional vector, representing the values of all sensors at that moment. The input of the model can be expressed as a matrix In order for the model to process these input data, it needs to be embedded in a higher-dimensional space. Position encoding is usually used to represent the sequential information of time series data. The calculation formula of position encoding is as follows:
[0126] (13) ;
[0127] (14);
[0128] in, t is the time step, i is the dimension index, d is the embedding dimension, i.e., vector, and PE stands for position encoding. By adding position encoding, the relative relationship between data points in the time series can be captured. Transformer The core of the self-attention mechanism is Self-Attention ). The self-attention mechanism allows the model to consider the data at other moments in the global time range when processing the data at each time point, which enables the model to effectively learn the long-range dependencies of the data. The calculation formula of the self-attention mechanism is as follows:
[0129] (15);
[0130] in, Q 、 K 、 V matrices representing queries, keys, and values, respectively, d k is the dimension of the key vector. Specifically, the query Q and key K The values are obtained by embedding the input data. V represents the characteristic information of the input data. Through the self-attention mechanism, the model can assign a weight to each input point in time, reflecting the correlation between the current time point and other time points. These weights help the model learn important patterns and dependencies in the data, thereby revealing potential anomalies in the data.
[0131] In step S6, based on the predicted value of the prediction model, the abnormality score of each time step can be further calculated. Assume that at time step t When the model outputs the first abnormality A(t) Calculated by the following formula:
[0132] (16);
[0133] in, A(t) is the time step t The first abnormality degree, X i2 (t) Indicates the i2 sensors at time step t Input data / test value, For the prediction model at time step t The predicted value of d2 is the total number of sensors. The first abnormality score A(t)Indicates the difference between the data at the current time point and the model prediction value. The larger the difference, the higher the abnormality of the time point. When the first abnormality exceeds the set first threshold, it is considered that the time step is abnormal. t When an anomaly occurs, an alarm mechanism may be triggered. In order to improve the accuracy and sensitivity of anomaly detection, the setting of the first threshold P1 is crucial. Usually, the first threshold P1 is determined by the statistical characteristics of historical data, business requirements, and security standards. A max represents the maximum abnormality value in the historical data and is the safety factor. The first threshold P1 can be set by the following formula:
[0134] (17);
[0135] When the first abnormality of real-time data A(t) When the threshold value T is exceeded, it is determined that an abnormality has occurred at that time point, the alarm mechanism is activated, and step S9 is executed.
[0136] The alarm mechanism is another key step in achieving safety and risk control in this invention. Its primary function is to respond to and address anomalies detected during oil well construction in real time, based on the output of the dynamic anomaly detection module and combined with comprehensive analysis using multimodal data fusion. Through scientific evaluation and a rational alarm strategy, the alarm mechanism accurately transmits anomaly information to relevant personnel and provides appropriate action recommendations. This not only improves safety during construction but also reduces disruptions caused by false alarms or missed alarms, providing reliable technical support for the stable operation of oil well construction.
[0137] The development of an alarm mechanism stems from the complex anomalies that can occur during oil well construction. These anomalies are often sudden and complex, potentially involving the interconnected changes of multi-dimensional data. Without a timely alarm mechanism, these anomalies could go unnoticed and lead to serious safety incidents. Therefore, a system must balance real-time performance, accuracy, and adaptability to ensure that alarms are triggered promptly in any anomaly, prompting operators to take necessary measures.
[0138] More specifically, in step S9, given the sensor data within a time window , first calculate the second abnormality of each data A(X i3 ):
[0139] (18);
[0140] in, X i3 For the i3 The detection value of a time window, is the predicted value, The second abnormality degree can be calculated in the same manner as the first abnormality degree, or the two can be interchanged.
[0141] Average abnormality in the current time window Expressed as:
[0142] (19);
[0143] in, l Represents the current time window i3 The number of data items below.
[0144] The safety score S is calculated as follows:
[0145] (20);
[0146] in, This represents the weighting coefficient of the second anomaly's impact on the safety score, determined by historical data and expert experience. The safety score S ranges from 0 to 100, with higher values indicating safer construction conditions. When the safety score S falls below a preset threshold (e.g., 80), the system determines that the construction status presents a safety hazard and triggers an alarm.
[0147] The alarm mechanism not only needs to determine whether to trigger an alarm, but also needs to set the alarm level according to the severity of the anomaly and provide corresponding handling suggestions. The alarm level is divided based on the level of the safety score and the type and severity of the anomaly output by the dynamic anomaly detection module. The graded alarm strategy includes three levels, and the second threshold is divided into multiple threshold intervals: Low-level alarm: When the safety score is slightly lower than the third threshold interval (such as 70 points ≤ S < 80 points), the system triggers a low-level alarm, prompting construction personnel to observe data trends and conduct preventive inspections. Medium-level alarm: When the fourth threshold interval of the safety score is further reduced (such as 50 points ≤ S < 70 points), the system triggers a medium-level alarm, recommends suspending construction and conducting a detailed inspection of abnormal data points. High-level alarm: When the fifth threshold interval of the safety score is extremely low (such as S < 50 points), a high-level alarm is triggered, construction is immediately stopped, and the emergency response procedure is initiated. The corresponding second threshold judgment formula for the alarm level is:
[0148] (twenty one);
[0149] in, L is the alert level, with values of 1 (low), 2 (medium), or 3 (high).
[0150] After determining the alarm level, alerts are sent to relevant personnel through multiple channels, including SMS, email, and app push notifications. Alert information includes the detailed location and type of abnormal data, the safety score, an analysis of the cause of the abnormality, and recommended countermeasures. For example, if a sensor's pressure value deviates significantly from the normal range, the alert will include the sensor number, a comparison of the actual pressure data with the predicted value, and possible causes (such as sensor failure or abnormal actual pressure). A visual alarm information interface displays abnormal data trends, safety score curves, and alarm level distribution, helping construction personnel quickly understand the construction status and make informed decisions. To enhance the adaptability of the alarm mechanism, the system includes the ability to dynamically adjust thresholds. Alert thresholds and grading strategies can be updated in real time as the construction environment and monitoring data change. For example, during critical construction phases (such as high-pressure testing or deep drilling), the system dynamically lowers the safety score thresholds to increase alert sensitivity and detect potential issues earlier.
[0151] The core algorithm for dynamic adjustment is based on statistical analysis of historical data. By analyzing the correlation between historical alarm records and actual events, the system can dynamically adjust thresholds and weights using Bayesian updating methods. For example, for a specific construction phase, the updated alarm threshold is calculated as follows:
[0152] (twenty two);
[0153] Where T is the initial threshold or threshold interval boundary, the correlation coefficient R represents the degree of match between alarm events and real anomalies in historical data, and the historical false alarm rate Wb represents the proportion of past alarm errors. The correlation coefficient R is expressed as follows:
[0154] (twenty three);
[0155] in, It indicates the probability of an abnormality actually occurring after the alarm is triggered, indicating the reliability of the alarm; It represents the probability of issuing an alarm when an anomaly occurs, that is, the proportion of valid alarms in history; P(E) is the prior probability of the anomaly, that is, the overall frequency of anomaly occurrence; P(A) is the overall frequency of alarm occurrence.
[0156] Through safety score calculation, graded alert strategies, and dynamic adjustment capabilities, the system achieves efficient response to abnormal events during oil well construction. It not only detects anomalies promptly but also provides graded alerts and action suggestions based on their severity. Through scientific algorithms and a multi-channel notification mechanism, it effectively reduces safety risks and improves the overall safety and management efficiency of oil well construction. The adaptive adjustment of the alert mechanism allows it to flexibly adapt to the safety monitoring needs of different construction phases, further enhancing the practicality and reliability of safety detection and monitoring.
[0157] The second aspect of the present invention also provides a monitoring system for implementing the above oil well construction safety monitoring method, such as Figure 2 As shown, it includes an acquisition module 1, a preprocessing module 2, a feature extraction module 3, a fusion module 4, an anomaly detection module 5 and an alarm module 6.
[0158] Among them, the acquisition module 1 is used to collect monitoring data of oil well construction; the preprocessing module 2 is used to preprocess the monitoring data. The feature extraction module 3 is used to extract features from the monitoring data. The fusion module 4 is used to fuse the features and monitoring data to obtain fused features. The anomaly detection module 5 is used to obtain a predicted value based on the prediction model, and obtain a first anomaly degree based on the predicted value and the detection value. If the first anomaly degree exceeds a first threshold, the alarm module 6 is called. The alarm module 6 is used to obtain a second anomaly degree and a safety score based on the predicted value and the detection value; and an anomaly alarm is issued based on the safety score and the second threshold.
[0159] The detection system further includes a training module 7, which is used to construct the training set according to the fusion features; and to train the training set based on a machine learning method to obtain a prediction model.
[0160] A third aspect of the present invention provides a monitoring device, such as Figure 2 As shown, it includes a processor and a memory, and the memory stores a code / program for implementing the above-mentioned security monitoring method; when the code is processed by the processor, the above-mentioned code / program is executed.
[0161] This invention achieves safety monitoring and risk warning for oil well construction data through four core steps: data acquisition and preprocessing, multimodal data fusion, dynamic anomaly detection, and an alarm mechanism. Data from different data sources are weighted and fused to improve monitoring accuracy and reliability. Real-time anomaly identification is performed based on the fused data, triggering an alarm mechanism to promptly warn of potential safety risks. By integrating multiple data sources and intelligent algorithms, this invention provides efficient and accurate safety monitoring for oil well construction, significantly improving safety and reliability during the construction process. It addresses issues such as complex data sources, high real-time requirements, and insufficient anomaly detection accuracy.
[0162] During oil well construction, the complexity and variability of real-time data require high real-time and adaptability. This invention achieves precise monitoring of real-time data through a dynamic anomaly detection algorithm. Specifically, the overall data security is quantified by calculating a safety score within each time window. When the safety score falls below a set threshold, an alarm is triggered and the location, characteristics, and possible causes of the abnormal data are marked. The alarm mechanism also supports multi-channel notifications, including SMS, email, and app push, ensuring that construction personnel can obtain abnormal information and take appropriate measures in the shortest possible time.
[0163] The present invention optimizes the entire process from data collection to anomaly detection to alarm response through a streaming data processing architecture, so that the delay of the entire process is controlled within the millisecond range. This real-time performance is particularly critical in the high-risk environment of oil well construction, and can significantly reduce the potential losses or dangers caused by anomalies not being discovered in time. In addition, the design of the present invention also fully considers the stage characteristics of the construction process. The focus of data monitoring in different stages of oil well construction is different. For example, in the early stage, more attention is paid to the status of the equipment when it is started, while in the middle of construction, more emphasis is placed on the monitoring of core indicators such as pressure and flow. The present invention dynamically adjusts the detection strategy, combines scenario-specific rules with intelligent algorithms, and enables the system to flexibly adapt to different needs during the construction process. This adaptability not only enhances the practical application value of the system, but also lays the foundation for its widespread promotion in complex industrial environments.
[0164] In summary, this invention addresses numerous challenges in oil well construction data security monitoring through the design of an intelligent data security monitoring method and alarm system. By combining dynamic anomaly detection, multimodal data fusion, and intelligent alarms, a real-time, efficient, and highly adaptable security monitoring system has been constructed, providing comprehensive safety assurance for oil well operations. Furthermore, this invention's design concepts and technical architecture provide important insights for subsequent research in intelligent processing and anomaly prevention technologies.
[0165] The above are merely preferred embodiments of the present invention and are not intended to limit the present invention. Those skilled in the art will readily appreciate that various modifications and variations of the present invention are possible. Any modifications, equivalent substitutions, or improvements made within the spirit and principles of the present invention shall be included within the scope of protection of the present invention.
Claims
1. A safety monitoring method for oil well construction, characterized in that: The following steps are involved: Collect monitoring data of oil well construction; Extract features from monitoring data and fuse the features with monitoring data to obtain fused features; Fusion features include any of the following indicators or their combination: data source features, feature-level features, and decision-level features; The detection value of the fusion feature is predicted through a prediction model based on machine learning to obtain a predicted value; Calculating a first abnormality degree according to the predicted value and the detected value; determining whether the first abnormality degree exceeds a first threshold; If yes, a second abnormality and a safety score are obtained based on the predicted value and the detected value. The second abnormality is expressed as: ; Among them, A(Xi3) is the second abnormality, Xi3 is the detection value of the i3th time window, is the predicted value, is the standard deviation of historical data; The safety evaluation S is expressed as: ; in, It represents the weight coefficient of the second abnormality degree on the safety score, and l represents the number of data in the current time window i3; An abnormality alarm is issued based on the safety score and the second threshold.
2. The safety monitoring method according to claim 1, characterized in that: The extracted features include any of the following indicators or their combination: temperature, pressure, flow rate, humidity, pressure change rate, temperature gradient and flow rate fluctuation amplitude; The monitoring data is also preprocessed, which includes: data cleaning, noise removal, outlier identification and data normalization.
3. The safety monitoring method according to claim 2, characterized in that: The rate of pressure change is expressed as: ; in, P(t) is the pressure value at time t, is the time interval, is the pressure change value, is the pressure change rate; Temperature gradient Expressed as: ; in, T(t2) and T(t1) Time t1 and t2 The temperature value, d is the distance between temperature sensors; Traffic fluctuation range Expressed as: ; in, Q max and Q min are the maximum flow rate and the minimum flow rate in the time window respectively; Data source characteristics F fusion Expressed as: ; in, w i is the weight of the data source, d ik Indicates the i The first k data points, m is the total number of data points, n1 Expressed as the total number of data sources; Feature-level features X fusion Expressed as: = ; in, X fusion is a feature-level feature, X j is the feature vector of the j-th data source, w j is the weight of the eigenvector, n2 is the total number of eigenvectors; Decision-level features Y fusion Expressed as: ; in, Y q It is q The decision output of each data source, w q is the weight of the decision output, .
4. The safety monitoring method according to claim 1, characterized in that: Update the weights based on the Bayesian formula, which is expressed as: ; in, w Expressed as weights, selected from the weights of data sources, feature vectors, and decision outputs, is the posterior probability of the weight in the case of data D, is the likelihood of data D under weight, is the prior distribution of weights, and P(D) is the total probability of data D.
5. The safety monitoring method according to claim 1, characterized in that: Machine learning methods include: support vector machines, decision trees or neural networks, The neural network includes Transformer .
6. The safety monitoring method according to claim 1, characterized in that: The calculation method of the first abnormality degree is: ; in, A(t) is the time step t The first abnormality degree, X i2 (t) Indicates the i2 sensors at time step t Input data / test value, (t) is the prediction model at time step t The predicted value of d2 is the total number of sensors; The first threshold value P1 is determined as follows: ; in, Indicates the maximum abnormality value in historical data, is the safety factor.
7. The safety monitoring method according to claim 1, characterized in that: The level of abnormal alarm is determined as follows: ; Wherein, L represents the level of the alarm.
8. The safety monitoring method according to claim 1, characterized in that: Also included is a method for updating the boundary of a threshold or threshold interval, and the updated threshold or threshold interval Expressed as: ; Where T is the initial threshold or threshold interval boundary, the correlation coefficient R represents the matching degree between the alarm event and the real anomaly in the historical data, and the historical false alarm rate Wb represents the proportion of alarm errors in the past; The expression of the correlation coefficient R is as follows: ; in, It indicates the probability of an abnormality actually occurring after the alarm is triggered, indicating the reliability of the alarm; It represents the probability of issuing an alarm when an anomaly occurs; P(E) is the prior probability of the anomaly; and P(A) is the overall frequency of alarm occurrence.
9. A monitoring system, characterized in that: For implementing the security monitoring method according to any one of claims 1 to 8, the monitoring system includes an acquisition module, a feature extraction module, a fusion module, an anomaly detection module and an alarm module; The acquisition module is used to collect monitoring data of oil well construction; the feature extraction module is used to extract features from the monitoring data; The fusion module is used to fuse features and monitoring data to obtain fusion features; The anomaly detection module is used to analyze the fusion features based on the prediction model to obtain the prediction value; Obtaining a first abnormality degree according to the predicted value and the detected value; If the first abnormality exceeds a first threshold, calling an alarm module; The alarm module is used to obtain a second abnormality degree and a safety score based on the predicted value and the detected value; An abnormality alarm is issued based on the safety score and the second threshold.
Citation Information
Patent Citations
Mechanical state monitoring method and system based on multiple heterogeneous sensors
CN111551383A
Real-time monitoring and fault prediction method and system for intelligent medium-voltage switch cabinet
CN119891530A