AI monitoring method for analyzing corrosion risk of drilling pipe based on time series data
By employing an AI monitoring method based on time-series data analysis, combined with multi-source sensor data and composite models, the accuracy and adaptability issues of corrosion monitoring for drilling pipelines on offshore drilling platforms have been resolved. This has enabled accurate prediction and efficient early warning of corrosion risks, thereby enhancing the safe production capabilities of marine oil and gas equipment.
Patent Information
- Application Number
- CN202610458460.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-04-09
- Publication Date
- 2026-06-19
- Estimated Expiration
- 2046-04-09
Smart Images

Figure CN121980208B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of safety monitoring technology for offshore oil engineering, and in particular to an AI monitoring method for monitoring the corrosion risk of drilling pipelines based on time-series data analysis. Background Technology
[0002] The drilling pipelines of offshore drilling platforms are the core channels for oil and gas extraction and transportation. They are in a complex environment of "high salt spray, strong erosion, and multi-media interaction" for a long time. Corrosion is directly related to the safe production of the platform. Once the pipeline leaks or ruptures due to corrosion, it will not only cause huge economic losses, but may also cause major safety accidents such as marine pollution, fire and explosion.
[0003] There are three major pain points in the current pipeline corrosion monitoring technology in the industry:
[0004] 1. Limitations of monitoring methods: Traditional monitoring mainly relies on "regular manual inspections + fixed-point sampling and testing", which not only has a limited coverage (it cannot monitor hidden locations such as the inner wall of the pipeline and deep-sea sections), but also has a long testing cycle (usually once every 1-3 months), making it difficult to capture the dynamic changes in corrosion risk and easily missing the opportunity for early risk intervention.
[0005] 2. Insufficient data utilization: Although some sensors (such as corrosion rate sensors and temperature sensors) have been deployed in the existing monitoring, data processing is mostly limited to the level of "simple threshold comparison" (such as alarming when the preset corrosion rate is exceeded). The nonlinear interaction relationship of multi-source data (such as the synergistic acceleration of corrosion by salinity and temperature) and key temporal characteristics (such as the triggering effect of instantaneous pressure change on corrosion) have not been fully explored, resulting in a high rate of false positives and false negatives.
[0006] 3. Poor model adaptability: Some intelligent monitoring solutions use a single AI model (such as simple LSTM or extreme gradient boosting), which cannot simultaneously solve the three major characteristics of corrosion data: "nonlinear interaction", "time-series key focus" and "long-term cumulative dependence". A single LSTM is difficult to capture the complex interaction between features, and a single extreme gradient boosting cannot learn the long-term trend of time-series data. As a result, the model has weak generalization ability under complex marine conditions (such as typhoons and medium switching), and its accuracy is prone to decline after long-term use. Summary of the Invention
[0007] This invention provides an AI monitoring method for corrosion risk of drilling pipelines based on time-series data analysis. Through full-link optimization of "data-model-application-iteration", it upgrades the corrosion monitoring of offshore drilling pipelines from "passive detection" to "proactive intelligent prevention and control", providing technical support for the safe production of marine oil and gas equipment.
[0008] To achieve the above objectives, the present invention adopts the following technical solution:
[0009] An AI-based monitoring method for drilling pipeline corrosion risk analysis based on time-series data includes the following steps:
[0010] S1: Collect real-time time-series data and static basic data from drilling pipeline sensors to form the raw dataset;
[0011] S2: Preprocess and standardize the original dataset to form a standardized structured dataset;
[0012] S3: Based on a standardized structured dataset, features are extracted using a dual-window approach, then a feature set for the fusion model is formed by filtering features and removing redundant features.
[0013] S4: Based on the feature set of the fusion model, the corrosion risk label is labeled on the standardized structured dataset, the sample balance is achieved by using the time series SMOTE algorithm, and then the dataset is divided into training set, validation set and test set.
[0014] S5: AI corrosion risk prediction model training. After inputting the training set, the model first extracts the feature importance weight vector through extreme gradient boosting. Then, the weight vector and the temporal feature sequence of the training set are input into the attention mechanism to generate the focused temporal feature sequence. The focused temporal feature sequence is then input into the bidirectional long short-term memory network model. The Adam optimizer and cross-entropy loss function are used to jointly optimize the parameters of the three algorithms end-to-end. The loss is calculated using the validation set in each iteration. Training stops when the loss does not decrease for 5 consecutive iterations, thus forming the initial AI corrosion risk prediction model.
[0015] S6: Input the test set into the initial AI corrosion risk prediction model, verify it through core indicators, fusion specific indicators and working condition tests, optimize the sub-algorithms to meet the standards, and form the final AI corrosion risk prediction model.
[0016] S7: Acquire real-time data from sensors, preprocess and extract features, then input the final AI corrosion risk prediction model to output real-time corrosion risk inference results;
[0017] S8: Based on the risk level and probability of real-time corrosion risk inference results, set early warning thresholds, trigger corresponding early warning methods and response processes, and collect real data to form classified feedback data, which is then synchronized to S2, S3, and S5.
[0018] In this manual, the AI monitoring method for drilling pipeline corrosion risk based on time series data analysis also includes S9: monthly collection of historical full-process data, performance review of each algorithm, quarterly small iterations every 3 months using classification feedback data to supplement the training set, annual large iterations of sensor deployment and feature engineering logic, and replacement of the original model if the verification indicators meet the standards after iteration, thus forming a monitoring closed loop.
[0019] In this specification, the interaction process of the three algorithms in step S5 is as follows: the feature importance weight vector output by the extreme gradient boosting model after training is directly used as the input of the feature weight weighting step in the attention mechanism to amplify the contribution of high-importance features; the attention mechanism calculates the attention weight at each time step based on the weight vector to generate a focused temporal feature sequence, which serves as the sole input of the bidirectional long short-term memory model to capture long-term dependencies; and the parameters of the three algorithms are updated synchronously through end-to-end joint optimization. During the optimization process, the cross-entropy loss of bidirectional long short-term memory is used as the target, and backpropagation is used to adjust the tree structure parameters of extreme gradient boosting, the weight matrix and bias of the attention mechanism, and the hidden layer parameters of bidirectional long short-term memory to ensure that the three algorithms work together to improve prediction accuracy.
[0020] In this manual, in step S1, the sensors specifically include: corrosion rate sensor, temperature sensor, pressure sensor, medium composition sensor, environmental parameter sensor, medium flow rate sensor, and pipeline stress sensor; the static basic data specifically include: pipeline material, wall thickness, service life, historical maintenance records, historical pipeline operating data, and anti-corrosion measures data.
[0021] In this manual, in step S2, the handling of missing values during preprocessing is as follows: for high-frequency sensors, the sliding window mean method is used, and for low-frequency sensors, the linear interpolation method is used. When the missing value rate exceeds the threshold, redundant sensor data is called or manual inspection is triggered. The handling of outliers during preprocessing is as follows: first, the sensors are screened according to their physical constraints, and then the 3σ criterion is used in conjunction with industry thresholds for verification. Faulty data is smoothly replaced, and real outlier data is marked. The quality assessment is based on scores for completeness, accuracy, and continuity. A score of 80 or higher is considered to meet the quality standards.
[0022] In this specification, step S3 specifically includes the following features: time-domain features, frequency-domain features, time-series trend features, two-factor interaction features, three-factor interaction features, time-series abrupt change features, and long-term cumulative features; dual-window extraction is: a 1-hour small window to extract short-term features and a 24-hour large window to extract long-term features; the feature selection algorithm specifically includes: extreme gradient boosting to select non-linearly related features, attention mechanism to select time-series sensitive features, and bidirectional long short-term memory to select long-term related features.
[0023] In this specification, in step S4, the sample dataset is divided as follows: it is divided in chronological order, with the training set consisting of data from the first 8 months, accounting for 75%; the validation set consisting of data from the 9th month, accounting for 15%; and the test set consisting of data from the 10th month, accounting for 10%; and each dataset covers all pipeline regions.
[0024] In this manual, step S6 verifies the core indicators including: accuracy ≥ 90%, high-risk recall ≥ 95%, and extremely high-risk recall ≥ 98%; the fusion specificity indicators include: feature weight contribution rate ≥ 3%, time step focusing accuracy ≥ 90%, and long-term dependent capture rate ≥ 85%; the operating conditions include: typhoon weather, medium switching, and sensor failure scenarios.
[0025] In this manual, in step S7, when the sensor acquires data in real time, data from high-risk areas is prioritized. The real-time corrosion risk inference results include pipeline ID, risk level, risk probability, key influencing factors, key time steps, and recommended measures.
[0026] In this manual, in step S8, the specific warning thresholds are as follows: Attention warning: medium risk and probability ≥ 0.7; General warning: high risk and probability ≥ 0.7 or medium risk and probability ≥ 0.9; Emergency warning: extremely high risk and probability ≥ 0.6 or high risk and probability ≥ 0.9; Warning methods include text prompts, audible and visual alarms, and SMS notifications; The response process is: 24-hour monitoring, 1-hour inspection, and 10-minute shutdown.
[0027] In summary, the present invention has at least the following beneficial effects:
[0028] 1. Improved Monitoring Accuracy and Robustness: By integrating three algorithms—extreme gradient boosting, attention mechanism, and bidirectional long short-term memory—the technical shortcomings of single models are addressed. Extreme gradient boosting captures nonlinear interactions of multiple factors, attention mechanism focuses on key time steps in the time series (such as sudden pressure changes and rapid increases in corrosion rate), and bidirectional long short-term memory learns long-term cumulative effects (such as the cumulative corrosion effects of continuous high-salinity environments). This enables the model to adapt to complex marine environments (typhoons, media switching, etc.), effectively reducing the probability of false positives and false negatives. In particular, the ability to identify high-risk and extremely high-risk samples is significantly enhanced, providing accurate evidence for safety prevention and control.
[0029] 2. Improved Early Warning Response Efficiency: The solution constructs a complete process link of "real-time data acquisition - rapid preprocessing - instant inference and early warning". Through optimizations such as sensor data priority scheduling, parallel preprocessing, and model quantization acceleration, the latency from data acquisition to risk early warning is controlled at the minute level. It can also output differentiated early warning strategies according to the risk level (such as triggering immediate shutdown for extremely high risk and conducting inspection within 1 hour for high risk), which completely changes the traditional passive mode of "periodic inspection" and advances risk intervention from "post-event repair" to "early warning".
[0030] 3. Improved long-term model adaptability: Through a long-term closed-loop mechanism of "monthly review - quarterly iteration - annual optimization", the system continuously collects on-site inspection feedback data and pipeline maintenance records to feed back into data preprocessing (updating anomaly thresholds), feature engineering (adjusting interactive feature logic), and model training (optimizing algorithm parameters). This enables the model to dynamically adapt to pipeline aging and changes in operating conditions (such as adjustments to media type and updates to anti-corrosion measures), avoiding accuracy decay after long-term use and ensuring the long-term effectiveness of the monitoring system.
[0031] 4. Improved Operation and Maintenance Efficiency: The solution not only outputs risk warning results, but also provides "key influencing factors" (such as corrosion risk mainly caused by the synergy of salinity and temperature) and "decision recommendations" (such as focusing on inspecting elbow sections and prioritizing cathodic protection measures), providing clear operation and maintenance guidance for on-site engineers; at the same time, it analyzes corrosion patterns through historical data review (such as the causes of long-term high risk in specific areas), providing data support for the platform to formulate long-term anti-corrosion plans and equipment upgrade plans, reducing the blindness of operation and maintenance decisions. Attached Figure Description
[0032] Figure 1 This is a flowchart illustrating the AI monitoring method for drilling pipeline corrosion risk based on time-series data analysis involved in this invention.
[0033] Figure 2 This is a schematic diagram of the data acquisition and preprocessing process involved in this invention.
[0034] Figure 3 This is a schematic diagram of the training and verification process of the fusion model involved in this invention.
[0035] Figure 4 This is a schematic diagram of the real-time reasoning and early warning process involved in this invention. Detailed Implementation
[0036] The embodiments of the present invention will now be described in detail with reference to the accompanying drawings.
[0037] like Figure 1 As shown, this embodiment provides an AI monitoring method for drilling pipeline corrosion risk based on time-series data analysis, including the following steps:
[0038] S1: Multi-source time-series data acquisition for drilling pipelines on offshore drilling platforms
[0039] Objective: To obtain comprehensive raw data to support corrosion risk analysis and provide a foundation for subsequent processing. The data acquisition and preprocessing workflow is as follows: Figure 2 As shown.
[0040] 1.1 Determine the data acquisition targets and sensor deployment
[0041] For different corrosion risk areas of drilling pipelines on offshore drilling platforms, a deployment principle of "densified core area + coverage of ordinary areas" is adopted. The specific locations are as follows: High-risk area (typical area with corrosion rate ≥ 0.3 mm / a): including the pipeline inlet section (strong medium scouring), the outside of the bend (stress concentration), the weld location (material inhomogeneity), and the bottom of the seawater-immersed section (static corrosion), with 2 sets of redundant sensors deployed at each location (to avoid single point of failure); Medium-risk area (0.1 mm / a ≤ corrosion rate < 0.3 mm / a): including the middle of the pipeline (stable medium flow rate) and the exposed section above the platform deck (atmospheric corrosion), with 1 set of sensors deployed at each location; Low-risk area (corrosion rate < 0.1 mm / a): including the pipeline outlet section (few media impurities), with 1 set of sensors deployed every 50 meters.
[0042] Sensor type and parameters:
[0043]
[0044] 1.2 Data Acquisition and Storage
[0045] Data acquisition method: Through the industrial IoT system of the offshore drilling platform, all sensor data is transmitted in real time to the platform's local data storage server. The transmission protocol uses MQTT-SN (Lightweight IoT Protocol), which supports batch data transmission under low bandwidth. At the same time, "data check bits" (one check code is added for every 100 data entries) are used to ensure that the data transmission is not lost or tampered with.
[0046] Static foundation data acquisition: Static foundation data for drilling pipelines is obtained from the design documents and equipment ledgers of the offshore drilling platform, including: pipeline material (e.g., 316L stainless steel, N80 steel); pipeline wall thickness (design value and initial inspection value); service life; historical maintenance records (e.g., past corrosion repair time and repair location); historical pipeline operating data: including whether acidic media (e.g., crude oil containing H2S) have been transported in the past, and whether pipeline cleaning operations have been performed (number of cleaning operations and cleaning time in the past year); anti-corrosion measures data: including whether internal coatings have been used (coating type and application time), and whether cathodic protection has been performed (protection current intensity and protection time). This type of data is imported into the local data storage server in one go and stored in association with time-series data (matched by the pipeline's unique ID).
[0047] 1.3 Output and Connection
[0048] This step outputs a raw dataset of "real-time time-series data (7 types of sensors) + static data", which is stored in the "raw database" of the platform's local data server and transmitted to S2 in real time through the data interface, providing a "high-resolution, full-dimensional" data foundation for subsequent preprocessing.
[0049] S2: Raw Data Preprocessing and Standardization
[0050] Objective: To address issues such as noise, missing data, and inconsistent formats in the original data, and to output high-quality, standardized data that can be directly used for feature extraction.
[0051] 2.1 Data Cleaning
[0052] Missing value handling: Different missing value completion strategies are adopted according to different sensor types;
[0053] For high-frequency sensors (sampling frequency ≥ 1 time / 30 seconds, such as temperature, pressure, and flow rate sensors): if the missing rate is ≤ 5%, use the "sliding window mean method" to complete the data (the window size is 5 time points before and after the missing point); if the missing rate is > 5%, call the synchronous data of redundant sensors in the same location to complete the data (e.g., if corrosion rate sensor 1 is missing, use the data of sensor 2). If there are no redundant sensors, mark them as "to be reviewed" and trigger manual inspection (complete the on-site sensor inspection within 2 hours).
[0054] For low-frequency sensors (sampling frequency ≤ 1 time / 1 hour, such as media composition and environmental parameter sensors): if the missing rate is ≤ 10%, use the "linear interpolation method" to complete the data (based on two time points before and after the missing point); if the missing rate is > 10%, combine historical data from the same period (such as seawater salinity at the same time last week) to complete the data and ensure data continuity.
[0055] Outlier handling: Different outlier thresholds are set based on the physical characteristics of different sensors;
[0056] 1. Outlier screening based on physical constraints: First, eliminate obvious anomalies based on the sensor's measurement range (e.g., a temperature sensor displaying 200℃ exceeds the upper limit of 150℃ and is therefore considered an anomaly).
[0057] 2. Outlier Validation Based on Statistical Methods: For data within physical constraints, a dual validation method combining the "3σ criterion" and industry thresholds is employed.
[0058] Corrosion rate sensor: After screening according to the 3σ criterion, it is then compared with the industry safety threshold (>0.5mm / a is abnormal).
[0059] Pressure sensor: After screening using the 3σ criterion, compare with the pipeline design pressure (>10MPa is abnormal).
[0060] 3. Outlier Handling Strategy: Data confirmed as sensor malfunction (e.g., loose wiring) is supplemented using the "adjacent time point smooth replacement method" (e.g., if an outlier occurs at time t1, the average of times t0 and t2 is used to replace it); data confirmed as a true outlier (e.g., a sudden increase in instantaneous pressure) is retained and marked as an "abnormal event" (e.g., "pressure surge at 14:30 on 20xx-10-23") to provide a basis for the subsequent extraction of "mutation point features" in S3.
[0061] 2.2 Data Standardization
[0062] Timestamp alignment: Timestamp alignment is at the "millisecond level" to ensure precise matching of data from different sensors at the same time point—for example, data collected by the temperature sensor at 14:30:00.000 corresponds strictly to data collected by the pressure sensor at 14:30:00.000, preventing temporal misalignment when calculating time step scores for Attention. Data with different sampling frequencies are unified to 1 time / minute through resampling; high-frequency data is averaged, and low-frequency data is padded with linear interpolation.
[0063] Data units and formats are standardized.
[0064] Units are standardized: temperature is standardized to ℃, pressure is standardized to MPa, corrosion rate is standardized to mm / a, medium flow velocity is standardized to m / s, and pipeline stress is standardized to MPa.
[0065] Standardized format: numerical values should be retained to 3 decimal places (e.g., corrosion rate 0.256 mm / a), timestamp format should be "YYYY-MM-DDHH:MM:SS.sss" (e.g., 20xx-10-23 14:30:00.500), and text data (e.g., pipe ID) should use the format "P + 6 digits" (e.g., P000001).
[0066] 2.3 Data Correlation and Quality Assessment
[0067] Data association: The standardized time-series data is combined with the static basic data in S1 to form structured data of "timestamp + pipeline ID + sensor ID + region ID + dynamic parameter + static parameter" - for example, "20xx-10-23 14:30:00.500+P000001+S001+R01 (high-risk area) + temperature 35℃ + material 316L", which facilitates the subsequent feature extraction by region in S3 and the labeling by sensor in S4.
[0068] Data quality assessment
[0069] Data is scored based on three dimensions: completeness, accuracy, and continuity (out of 100). Only data with a score of ≥80 is transmitted to S3.
[0070] Completeness (40 points): 40 points for ≤1 missing field in a single data record, 20 points for 2 missing fields, and 0 points for ≥3 missing fields; Accuracy (30 points): 30 points for outlier percentage ≤1%, 1% < percentage ≤3% for 15 points, and percentage >3% for 0 points; Continuity (30 points): 30 points for continuous data without missing data for ≥24 hours, 15 points for 12 hours ≤ duration < 24 hours, and 0 points for duration < 12 hours.
[0071] 2.4 Output and Connection
[0072] This step outputs a standardized structured dataset that meets quality standards (≥80 points), stored in a standardized database, and transmitted to S3 in real time. The dataset's characteristics of "millisecond-level timestamps," "no abnormal redundant data," and "multi-dimensional association keys" will directly support S3 in extracting high-precision interaction features and S4 in accurately labeling risk tags, laying the data foundation for the three-algorithm fusion training in S5.
[0073] S3: Feature Engineering and Feature Selection for Time Series Data
[0074] Objective: This step requires extracting features from standardized time-series data that reflect the patterns of corrosion risk, ensuring that the output feature set maximizes the performance of the three algorithms.
[0075] 3.1 Feature Extraction Dimensions
[0076] 3.1.1 Nonlinear Interaction Characteristics
[0077] "Two-factor interaction features" and "three-factor interaction features" provide XGBoost with materials for non-linear relationship learning. The specific types and calculation methods are as follows:
[0078]
[0079] 3.1.2 Feature Extraction
[0080] 1. Time-domain characteristics: Calculate the statistics of each dynamic parameter within each window, including mean (e.g., average corrosion rate over 1 hour), variance (e.g., temperature fluctuation variance over 1 hour), maximum value (e.g., highest pressure over 1 hour), minimum value (e.g., lowest seawater salinity over 1 hour), and median (e.g., median sulfur content of crude oil over 1 hour).
[0081] 2. Frequency domain characteristics: Perform Fast Fourier Transform (FFT) on the time-series data (such as corrosion rate and temperature) within each window to extract frequency peaks (such as the main frequency of temperature fluctuations) and spectral energy (such as the energy concentration range of corrosion rate changes) to reflect the periodic variation of parameters.
[0082] 3. Time-series trend characteristics: Calculate the trend indicators of each dynamic parameter within each window, including linear slope (such as the rising / falling slope of corrosion rate in 1 hour), number of abrupt change points (such as the number of times pressure changes suddenly in 1 hour, with the threshold set at ±0.5MPa), and cumulative change (such as the total change in seawater salinity in 1 hour).
[0083] 4. Temporal mutation features (supporting Attention): Mutation amplitude: Calculate the absolute value of the difference between the feature value at each time step and the previous time step (e.g., pressure mutation amplitude = |pressure at time t - pressure at time t-1|), and set the threshold to the 3σ value of the feature (if it exceeds the threshold, it is judged as a mutation); Mutation duration: Count the time from the start of a single mutation to recovery (e.g., after a sudden increase in pressure, it takes 10 minutes to recover to normal, then the duration is 10 minutes); Mutation frequency: Count the number of mutations within a 1-hour window (e.g., 2 pressure mutations and 1 corrosion rate mutation within 1 hour).
[0084] 5. Long-term cumulative characteristics (supporting Bi-LSTM): 24-hour cumulative corrosion: calculate the average corrosion rate over the past 24 hours × 24 hours (e.g., average 0.2 mm / a × 24h = 4.8 mm·h / a); 72-hour high-risk duration: calculate the total duration of corrosion rates ≥ 0.3 mm / a over the past 72 hours (e.g., if the cumulative duration is 10 hours, then the duration is 10h); Weekly characteristic trend slope: calculate the linear regression slope of a certain characteristic (e.g., salinity) over the past 7 days (a positive slope indicates that salinity is continuously rising).
[0085] 3.1.3 Feature Extraction Window: Considering the "short-term fluctuations (hourly level)" and "long-term trends (daily level)" of corrosion in offshore drilling pipelines, a "dual-window extraction strategy" is adopted: Small window (1 hour): extracts time-domain features (mean, variance) and time-series abrupt change features (amplitude and frequency of abrupt change points) for Attention to focus on short-term key time steps; Large window (24 hours): extracts long-term cumulative features (24-hour cumulative corrosion amount) and frequency-domain features (spectral energy) for Bi-LSTM to learn long-term dependencies.
[0086] 3.2 Feature Association and Filtering
[0087] Algorithm-specific feature selection: Based on the characteristics of the three algorithms, features are selected in stages to ensure that the features match the requirements of each algorithm.
[0088] 1. First step: XGBoost feature selection (selecting non-linear correlation features): Train a simplified XGBoost model using a portion (20%) of the S4 training set and output the feature importance ranking; retain the top 80% of the features in importance (e.g., retain 16 out of 20 features) and remove low-importance features (e.g., atmospheric humidity, which has little impact on corrosion).
[0089] 2. Second step: Attention feature selection (selecting time-sensitive features): Calculate the "time-series variation coefficient" (variance coefficient = standard deviation / mean) of the features retained in the first step; retain features with a variation coefficient ≥ 0.2 (such as pressure, corrosion rate, which have large time-series fluctuations and are suitable for Attention focusing), and remove features with a variation coefficient < 0.2 (such as pipe material, static features, which have no time-series fluctuations).
[0090] 3. Third step: Bi-LSTM feature selection (selecting long-term relevant features): Calculate the Pearson correlation coefficient between the features retained in the second step and the "corrosion rate in the next 24 hours"; retain features with an absolute value of correlation coefficient ≥ 0.5 (such as 24-hour cumulative corrosion amount, salinity trend slope, which are strongly correlated with long-term corrosion), and finally form the "fusion model feature set".
[0091] 3.2.2 Feature Redundancy Removal Optimization: The "Variance Inflation Factor (VIF)" is used to remove multicollinear features (to avoid XGBoost weight bias): The VIF value of each pair of features in the feature set is calculated (VIF > 10 indicates severe collinearity); for feature pairs with VIF > 10 (such as "salinity × temperature" and "salinity × temperature × flow rate"), the feature with higher importance is retained (such as retaining "salinity × temperature × flow rate").
[0092] 3.3 Output and Connection: This step outputs the "fusion model feature set" (including interaction features, temporal mutation features, and long-term cumulative features, totaling 15 to 20 features), which is stored in the "feature database" and transferred to S4 for dataset construction.
[0093] S4: Corrosion Risk Labeling and Dataset Partitioning
[0094] Objective: To provide labeled training data for AI models, clarify the correspondence between features and corrosion risks, and divide the dataset for model training, validation, and testing, ensuring that the output dataset can effectively train the fusion model.
[0095] 4.1 Optimization of Corrosion Risk Labeling
[0096] 4.1.1 Definition of Corrosion Risk Label
[0097]
[0098] Note: "Minor abnormal event" refers to a pressure surge ≤1MPa lasting <5 minutes; "serious abnormal event" refers to a pressure surge >1MPa lasting ≥5 minutes, or a corrosion rate surge >0.2mm / a.
[0099] 4.1.2 Labeling process: A dual process of "automatic labeling + manual review" is adopted to ensure label accuracy;
[0100] 1. Automatic labeling: Based on the standardized data of S2 (corrosion rate, remaining wall thickness, stress) and the abnormal event markers of S3, labels are automatically generated according to the above rules; 2. Manual review: For samples automatically labeled as "high risk (2)" and "extremely high risk (3)", engineers review them in conjunction with on-site inspection records (such as whether there are rust spots on the appearance of the pipeline). The review pass rate must be ≥90% (otherwise the labeling rules will be adjusted); 3. Label correction: For samples that fail the review (such as those automatically labeled as high risk, but no abnormalities were found during on-site inspection), the sensor data is re-examined (whether it is a sensor failure), the labels are corrected, and the samples are re-added to the dataset.
[0101] 4.2 Sample Balancing Process
[0102] 4.2.1 Sample Category Distribution Statistics: First, the proportion of samples of each risk level in the automatically labeled dataset is statistically analyzed. Typically, offshore drilling pipeline data has the problem of "many low-risk samples and few high-risk samples" (e.g., low risk accounts for 60%, medium risk 25%, high risk 10%, and extremely high risk 5%), and high-risk samples need to be expanded through the SMOTE algorithm.
[0103] 4.2.2 SMOTE Algorithm Parameter Settings: Considering the characteristics of time-series data, the "Time-Series SMOTE Algorithm" is adopted (to avoid disrupting temporal continuity). Specific parameters are as follows: Sampling Rate: 100% sampling is used for high-risk samples (doubles the sample size), and 200% sampling is used for extremely high-risk samples (triples the sample size); Number of Nearest Neighbors: Five temporal nearest neighbors are selected for each high-risk sample (instead of random neighbors) to ensure that the generated virtual samples conform to the temporal trend; Feature Constraints: When generating virtual samples, the variation range of core features such as "corrosion rate" and "stress" is ensured to be ≤10% to avoid generating unreasonable samples (e.g., the corrosion rate abruptly changes from 0.3 mm / a to 0.6 mm / a).
[0104] 4.3 Refinement of Dataset Splitting Rules
[0105] 4.3.1 Optimization of Time-Series Partition Ratio: The "feature-label" pairs are divided into three datasets according to time sequence: Training set: accounting for 75% of the total data, selecting samples from the first 8 months (e.g., January to August 20xx), ensuring complete seasonal variation data (e.g., high salinity in summer, low temperature in winter); Validation set: accounting for 15% of the total data, selecting samples from the 9th month (September 20xx), used for parameter adjustment during training; Test set: accounting for 10% of the total data, selecting samples from the 10th month (October 20xx), used for final model performance validation.
[0106] 4.3.2 Constraints: To avoid data leakage (e.g., the training set contains future data from the test set), two constraints are defined: 1. No overlap in time: The time intervals of the training set, validation set, and test set are completely independent and have no overlap (e.g., the training set ends on August 31, and the validation set starts on September 1); 2. Full coverage of regions: Each dataset must contain samples from all pipeline regions (high, medium, and low risk regions), and the sample proportion of each region must be consistent with the overall proportion (e.g., the sample proportion of high-risk regions is 10%) to ensure that the model can generalize in all regions.
[0107] 4.4 Output and Connection: Output training, validation, and test sets (all containing feature-label pairs) that are "equalized, time-continuous, and accurately labeled", store them in the "dataset database", and transfer them to S5 for training of the three-algorithm fusion model.
[0108] S5: Training of AI Corrosion Risk Prediction Model
[0109] Objective: This step takes the "balanced dataset" output by S4 as input and constructs a multi-dimensional collaborative prediction model through deep fusion of Extreme Gradient Boosting Tree (XGBoost), Attention Mechanism, and Bidirectional Long Short-Term Memory (Bi-LSTM). The three components form a closed loop through parameter passing: XGBoost first extracts the non-linear importance weights of features, providing a "feature priority" basis for Attention; Attention focuses on features at key time steps (such as moments of abrupt changes in corrosion rate) based on these weights, reducing interference from irrelevant information; Bi-LSTM then captures long-term cumulative effects (such as the continuous impact of high salinity environments on corrosion) based on the focused features, ultimately outputting an accurate corrosion risk level. The training and validation process of the fusion model is as follows: Figure 3 As shown, the following are the specific implementation details:
[0110] 5.1 Algorithm Selection Criteria and Fusion Logic
[0111] The corrosion risk of offshore drilling pipelines is dynamically affected by multiple factors, and its data has three main characteristics: 1. Nonlinear interaction: the corrosion rate is not affected by a single factor (e.g., the effect of a 10% increase in seawater salinity at 30°C is significantly different from that at 50°C), and it is necessary to capture the nonlinear correlation between features; 2. Time-series criticality: the characteristics at certain time points (e.g., a sudden increase in instantaneous pressure) have a much greater impact on corrosion than during stable periods, and it is necessary to focus on critical time steps; 3. Long-term accumulation: corrosion is a gradual process (e.g., continuous flow of high-sulfur media for 72 hours will lead to an accelerated corrosion rate), and it is necessary to capture the long-term dependence of time-series data.
[0112] Based on this, the division of labor and integration logic of the three algorithms are as follows: XGBoost: as a "feature weight extractor", it learns the nonlinear interaction between features by integrating multiple decision trees (such as the synergistic effect of "salinity × temperature × flow rate"), outputs the importance weight of each feature, and solves the problem of "nonlinear interaction"; Attention mechanism: as a "critical time series focuser", it calculates the attention weight of each time step based on the feature weight of XGBoost (the higher the weight, the more critical the time step), and focuses the original time series features with weights to solve the problem of "time series criticality"; Bi-LSTM: as a "long-term dependency capturer", it receives the features focused by Attention, and learns the relationship between past and future time steps (such as the relationship between the current corrosion rate and the medium composition in the previous 24 hours) through bidirectional memory units to solve the problem of "long-term accumulation".
[0113] The interaction path among the three is as follows: XGBoost output (feature weights) → Attention input parameters; Attention output (focused features) → Bi-LSTM input; Bi-LSTM prediction loss backpropagates, simultaneously optimizing the parameters of the three, forming a collaborative closed loop of "extraction-focusing-capture".
[0114] 5.2 Step 1: Construction and Training of Extreme Gradient Boosting Tree (XGBoost) Model (Nonlinear Feature Weight Extraction)
[0115] XGBoost is an ensemble learning algorithm based on Gradient Boosting Decision Tree (GBDT), which excels at handling nonlinear relationships of high-dimensional features. In this scheme, its core role is to identify the features (such as seawater salinity and medium temperature) that have the greatest impact on corrosion risk from the training set output by S4, and to quantify their importance, providing a basis for "feature priority" for the subsequent Attention mechanism.
[0116] 5.2.1 Model Construction
[0117] Input data: The training set output by S4, containing "feature-label" pairs. The feature matrix is denoted as... The label vector is denoted as N: Number of training set samples (e.g., selecting 10,000 time window samples, each window corresponding to 1 hour of monitoring data); F: Number of features after S3 filtering (e.g., 20, including time domain features: average corrosion rate and temperature variance within 1 hour; frequency domain features: main frequency of pressure fluctuations; trend features: slope of salinity change, etc.). : The j-th feature value of the i-th sample (e.g., the average corrosion rate of the 3rd sample within 1 hour is 0.2 mm / a); Corrosion risk label of the i-th sample (defined by S4: 0 = low risk, 1 = medium risk, 2 = high risk, 3 = very high risk).
[0118] Model structure and parameter settings: XGBoost parameter settings are as follows:
[0119]
[0120] 5.2.2 Model Training Process
[0121] 1. Data adaptation: The time-series feature matrix of the S4 training set... Convert to an XGBoost-compatible 2D table format (1 sample per row, 1 feature per column), label. Maintain integer coding (0-3). For example, a sample's characteristics include "average corrosion rate 0.25 mm / a" and "temperature variance 5℃". 2 "Salinity change slope 0.5‰ / h", etc., are labeled "2" (high risk).
[0122] 2. Phased Training: Phase 1 (First 100 Trees): Training is performed using the initial parameters described above. Every 10 trees trained, the validation set output by S4 is used ( Calculate merror. If merror does not decrease for 10 consecutive rounds (i.e., adding 100 trees), trigger early stopping to avoid ineffective training. The goal of this stage is to quickly learn the main nonlinear relationships of features (such as the effect of salinity and temperature interaction on corrosion); Second stage (remaining 100 trees): Based on the optimal tree depth of the first stage, fine-tune the learning rate to... Continue training until the total number of trees reaches 200 or early stopping. In this stage, the model is finely optimized with a smaller learning rate to capture more subtle feature interactions (such as the weak effect of sulfur content on corrosion at low flow rates).
[0123] 3. Feature Weight Extraction: After training, extract the "feature importance weight vector" of the XGBoost model. ,in The weight represents the importance of the j-th feature (ranging from 0 to 1; the higher the weight, the greater the impact of the feature on corrosion risk). For example, if the weight of "seawater salinity" is 0.8 and the weight of "atmospheric humidity" is 0.1, it indicates that salinity is a more critical factor affecting corrosion.
[0124] 5.2.3 Output: Feature Importance Weight Vector (As input parameters for the Attention mechanism); the trained XGBoost model (saved locally for subsequent joint optimization with Attention and Bi-LSTM).
[0125] 5.3 Step 2: Construction and Training of the Attention Mechanism (Focusing on Key Temporal Features)
[0126] The core function of the Attention mechanism is to "focus on key time steps"—within a 1-hour monitoring window (containing 60 time points), features at certain time points (such as the sudden increase in corrosion rate at the 30th minute) have a far greater impact on corrosion risk than at other time points. This is based on the feature weights output by XGBoost. Attention can calculate the "importance weight" of each time step and weight the original temporal features to highlight the contribution of key time points.
[0127] 5.3.1 Model Construction
[0128] Input data: Time series feature sequences: from the S4 training set Remodeling into a timing format , where T is the time step (a 1-hour window corresponds to 60 time points, i.e., T=60). This represents the value of the i-th sample, the t-th time step, and the j-th feature (e.g., the 5th sample, the 10th minute, and the "seawater salinity" feature value is 35‰); Feature weight: XGBoost feature weight vector .
[0129] Attention calculation logic: It achieves the focusing of key temporal features through four steps, and the specific formulas and explanations are as follows:
[0130] 1. Feature weighting: using The features at each time step are weighted to amplify the influence of highly important features. For example, if the weight of "seawater salinity" is 0.8, then the value of this feature will be multiplied by 0.8 at all time steps, while the influence of "atmospheric humidity" (weight 0.1) is weakened. The formula is: ; The time series matrix is weighted by the feature weights. This represents the weighted value of the i-th sample, the t-th time step, and the j-th feature.
[0131] 2. Time-series scoring: Introducing trainable attention parameters (Weight matrix) and (Bias) Performs a linear transformation on the weighted features at each time step, outputting the "importance score" (range 0-1) for that time step. For example, if the weighted features at minute 30 (salinity × 0.8 + temperature × 0.7 + ...) score 0.9 after the transformation, it indicates that this time step is relatively critical. The formula is: ; Let be the score of the i-th sample at time step t; the sigmoid function is... Ensure the score is between 0 and 1; " represents the matrix dot product.
[0132] 3. Weight Normalization: For each sample, the scores at T time steps are softmax normalized to obtain the "attention weight" (ensuring the sum of the weights at all time steps is 1). For example, if the score at minute 30 is 0.9, and the sum of the scores at other time steps is 0.1, then its attention weight is 0.9 / (0.9+0.1)=0.9. The formula is: ; The attention weight for the i-th sample at the t-th time step (range 0-1, the higher the weight, the more critical the time step).
[0133] 4. Focus on key features: using attention weights Original time series features Weighting is applied to obtain the focused temporal feature sequence. For example, the feature value at the 30th minute is multiplied by 0.9, while the feature values at other time steps are multiplied by lower weights to highlight the influence of that time step. The formula is: ; This is the time-series feature sequence after focusing.
[0134] 5.3.2 Model Training Process
[0135] 1. Parameter initialization: Random initialization (Following a normal distribution with mean 0 and variance 0.01) and (Initially set to 0) to ensure that the weights of each time step are relatively balanced in the initial state.
[0136] 2. Joint Training Preparation: Focusing on the Temporal Feature Sequence As the input to the Bi-LSTM, the training of the Attention mechanism relies on the prediction loss of the Bi-LSTM. Specifically, the prediction error of the Bi-LSTM is backpropagated to the Attention mechanism to adjust its parameters. and This allows attention weights to be more precisely focused on the time step that has the greatest impact on corrosion risk (such as the moment of sudden change in corrosion rate).
[0137] 3. Intermediate Output: Calculated based on initial parameters before formal joint training. (Initial version), transferred to Section 5.4 as the initial input to the Bi-LSTM; simultaneously saved and This is used for subsequent joint optimization.
[0138] 5.3.3 Output: Focused temporal feature sequence (Initial version, directly transferred to Section 5.4 as input to Bi-LSTM); Attention parameters and (Save to local storage for joint optimization with Bi-LSTM).
[0139] 5.4 Step 3: Construction and Training of Bidirectional Long Short-Term Memory Network (Bi-LSTM) (Long-Term Temporal Dependency Capture)
[0140] Bi-LSTM is an extended form of LSTM. Through two memory streams, forward and backward, it can simultaneously capture the impact of past time steps on the present (e.g., high salinity in the previous 2 hours leads to accelerated corrosion) and the prediction of future time steps on the present (e.g., upcoming high pressure may exacerbate corrosion). It is very suitable for dealing with the long-term cumulative effects of corrosion in offshore drilling pipelines.
[0141] 5.4.1 Model Construction
[0142] Input data: The focused temporal feature sequence output from Section 5.3 (Initial version), and tags for the S4 training set. .
[0143] Model structure: The architecture adopted is "input layer → Bi-LSTM hidden layer → fully connected layer → output layer". The parameters and formulas of each layer are as follows:
[0144]
[0145] 5.4.2 Model Training Process
[0146] 1. Loss Function Definition: The cross-entropy loss function is used to measure the difference between the predicted probability and the true label. For corrosion risk prediction, the prediction accuracy of high / extremely high-risk samples needs to be emphasized. Therefore, the loss function naturally imposes a higher penalty on misclassified high-risk samples (such as predicting extremely high-risk samples as medium-risk). The formula is: ; For indicator functions (when) The value is 1 if the condition is met, and 0 otherwise; L is the total loss value (the smaller the value, the more accurate the prediction).
[0147] 2. End-to-end joint optimization: Optimizer selection: The Adam optimizer (an adaptive optimizer suitable for deep learning) is used, with a learning rate of... Momentum parameters (First-order moment estimation of attenuation rate) (Second-order moment estimation of decay rate); Backpropagation process: Calculate the gradient of loss L with respect to all parameters, including: Bi-LSTM parameters: and Internal parameters , , , Attention parameters: , XGBoost parameters: These are the feature weights of XGBoost. As learnable parameters, they are incorporated into gradient calculation (Note: XGBoost is typically a static model; here, "feature weight differentiability" is used to enable backpropagation). Iteration and early stopping: Validation loss is calculated using the S4 validation set after each epoch. .like If there is no improvement after 5 consecutive rounds (i.e. the model no longer improves), training should be stopped to avoid overfitting.
[0148] 3. Model Saving: After training stops, save all parameters of the "XGBoost+Attention+Bi-LSTM" fusion model (including...). , , The parameters of each layer of Bi-LSTM are used to form the "Initial AI Corrosion Risk Prediction Model (Fusion Version)".
[0149] 5.4.3 Output Results: The core output result is the "Initial AI Corrosion Risk Prediction Model (Fusion Version)". This model can receive new time-series feature sequences and output the predicted probability and label of level 4 corrosion risk.
[0150] 5.5 Validation of the Synergistic Effect of the Three Algorithms: To ensure that the fusion of XGBoost, Attention, and Bi-LSTM can truly improve prediction accuracy, comparative experiments are needed to verify the synergistic effectiveness of the three algorithms.
[0151] 1. Comparative Experiment Design: On the S4 validation set, test the performance of the following 3 models (the core metrics are accuracy and high / very high risk recall): Model A: Single Bi-LSTM (without XGBoost and Attention, trained only with the original temporal features); Model B: Bi-LSTM+Attention (without XGBoost feature weights, Attention parameters are randomly initialized); Model C: XGBoost+Attention+Bi-LSTM (the fusion model of this scheme).
[0152] 2. Performance requirements: The accuracy of model C should be ≥5% higher than that of model A (to verify the gain of XGBoost + Attention); the high / very high risk recall of model C should be ≥3% higher than that of model B (to verify the improvement of XGBoost feature weights on Attention).
[0153] 3. Result Confirmation: If the above requirements are met, it indicates that the fusion of the three algorithms is effective; otherwise, return to Sections 5.2-5.4, adjust the parameters (such as increasing the tree depth of XGBoost to 6 and reducing the learning rate of Attention to 0.0005) and retrain until the target is met.
[0154] The model will be directly transferred to S6 for performance validation (such as accuracy and recall) on the test set. Based on the validation results, it will be further optimized to form the "final AI corrosion risk prediction model" that can be used for real-time monitoring. Through the deep fusion of XGBoost, Attention, and Bi-LSTM, the model built in this step can capture the nonlinear interaction of corrosion features, focus on key temporal information, and learn long-term cumulative effects, providing high-precision algorithmic support for subsequent real-time risk inference.
[0155] S6: AI Model Performance Verification
[0156] Objective: S5 outputs a three-algorithm fusion model, and its performance verification needs to cover both the "individual contribution of each algorithm" and the "overall synergistic effect" to ensure that the final model can adapt to the complex environment of offshore drilling platforms.
[0157] 6.1 Model Performance Validation
[0158] 6.1.1 Validation Metric Calculation: Input the test set output by S4 into the initial AI corrosion risk prediction model and calculate the core evaluation metrics: Accuracy: The proportion of correctly predicted "feature-label" pairs in the total test set, target value ≥ 90%; Recall: The proportion of correctly predicted samples in each risk level out of the total samples of that level, target value (high / very high risk) ≥ 95%, (low / medium risk) ≥ 85%; Feature Weight Contribution Rate: The proportion of the fusion model accuracy minus the accuracy of the model without XGBoost to the fusion model accuracy, target value ≥ 3%, evaluating the improvement effect of XGBoost feature weights on prediction; Time Step Focus Accuracy: The proportion of samples correctly focusing on key time steps out of the total number of high-risk samples, target value ≥ 90%, evaluating the AI corrosion risk prediction model. Whether the ttention accurately focuses on the real key time step (such as the moment of sudden stress change); Long-term capture rate: the proportion of samples that correctly predict long-term high risk (≥72 hours) out of the total number of long-term high-risk samples, with a target value of ≥85%, to evaluate whether Bi-LSTM effectively learns the long-term cumulative effect; F1 score: the harmonic mean of accuracy and recall, with a target value of ≥90%; Prediction latency: the time taken for the model to output risk level from input features, with a target value of ≤1 second (to meet real-time monitoring requirements); Error case analysis: extracting samples that are predicted incorrectly in the test set and analyzing the reasons for the errors, such as "high-risk samples being predicted as medium-risk" may be because the impact of sudden changes in ocean current velocity was not considered, and "low-risk samples being predicted as medium-risk" may be due to feature redundancy;
[0159] 6.1.2 Risk Level Verification
[0160]
[0161] 6.1.3 Real-world operating condition testing: Simulate complex scenarios of offshore drilling platforms (such as typhoon weather and medium switching) to verify the robustness of the model: 1. Scenario 1: Typhoon weather simulation: Input historical data during typhoons (ocean current speed ≥ 5 m / s, large fluctuations in seawater salinity) and test whether the model's accuracy decreases (target: decrease ≤ 5%); 2. Scenario 2: Medium switching simulation: Input data on switching from ordinary crude oil to sulfur-containing crude oil (sulfur content increases from 1% to 4%) and test whether the model can quickly respond to changes in corrosion risk (target: response time ≤ 10 minutes); 3. Scenario 3: Sensor failure simulation: Randomly block sensor data from one high-risk area and test whether the model can maintain accuracy based on other sensor data (target: accuracy decrease ≤ 3%).
[0162] 6.2 Model Optimization Strategy
[0163] 6.2.1 Algorithm Parameter Tuning: Developing Differentiated Tuning Strategies:
[0164] 1. XGBoost optimization (addressing feature weight bias): If "feature weight contribution rate < 3%": increase the number of trees (from 200 to 250) and increase the tree depth (from 5 to 6) to enhance non-linear learning ability; if the weight of high-risk samples is too low: adjust the "scale_pos_weight" parameter (set to the number of low-risk samples / the number of high-risk samples) to increase the loss weight of high-risk samples.
[0165] 2. Attention optimization (addressing time step focus bias): If "time step focus accuracy < 90%": reduce the learning rate of the attention parameter (from 0.001 to 0.0005) and increase the number of training epochs (from 50 to 60) to avoid parameter oscillations; if too many redundant time steps are focused: add "L1 regularization term" (weight decay coefficient set to 0.01) to suppress the weights of irrelevant time steps.
[0166] 3. Bi-LSTM tuning (addressing insufficient long-term dependency capture): If "long-term dependency capture rate < 85%": increase the number of neurons in the LSTM hidden layer (from 64 to 80) and extend the training window (from 1 hour to 2 hours) to enhance long-term information storage capacity; If the model is overfitting (test set accuracy is ≥ 5% lower than validation set accuracy): add a "Dropout layer" (dropout rate set to 0.2) to reduce overfitting.
[0167] 6.2.2 Optimization Iteration Process: Adopt a "small-step iteration + rapid verification" process: 1. Adjust only 1-2 parameters of one type of algorithm each time (e.g., adjust the number of trees in XGBoost first); 2. Quickly verify the adjustment effect using the S4 validation set (only 10% of the validation set data is needed); 3. If the indicator improves (e.g., the feature weight contribution rate increases from 2% to 4%), retain the adjustment; if the indicator decreases, restore the original parameters; 4. Repeat the above steps until all indicators meet the standards (core indicators + risk level indicators + working condition test indicators).
[0168] 6.3 Output and Integration: The final AI corrosion risk prediction model (fusion version) (all validation indicators meet the standards) is output, stored in the model database, and transmitted to S7 for real-time risk inference. The model's characteristics of "high-risk recall rate ≥95%" and "strong robustness under operating conditions" will ensure accurate identification of corrosion risks in the complex environment of offshore drilling platforms, providing reliable algorithmic support for subsequent real-time monitoring.
[0169] S7: Real-time Corrosion Risk Reasoning: Inputs real-time collected data into the final model and outputs the real-time corrosion risk level of the drilling pipeline. The real-time reasoning and early warning process is as follows: Figure 4 As shown.
[0170] 7.1 Real-time Data Access and Preprocessing
[0171] 7.1.1 Real-time Data Priority Scheduling: Real-time Data Access: The latest sensor data is acquired in real time from the offshore drilling platform IIoT system of S1 (once every 1 minute), while simultaneously accessing static basic data in S1 to form real-time raw data. A "high-risk area data priority" scheduling strategy is adopted to ensure that critical data is processed first: High-risk area sensor data: transmission priority is set to "highest," and processing is performed immediately upon access (delay ≤ 1 second); Medium- and low-risk area sensor data: transmission priority is set to "normal," and processing is performed in queue order (delay ≤ 3 seconds); Redundant sensor data: access is only provided when the primary sensor data is abnormal, serving as backup data (without occupying normal bandwidth).
[0172] 7.1.2 Real-time Preprocessing: Real-time data preprocessing: Real-time raw data is processed according to the standard S2 process to output real-time standardized data; at the same time, the real-time preprocessing process is optimized to reduce processing time: 1. Accelerated missing value completion: A "historical average value library" (such as the average temperature value of the same period in the past 30 days) is pre-generated for each sensor, and the average value is directly called to complete the missing value (no need to calculate the sliding window in real time); 2. Accelerated outlier detection: A "dynamic threshold library" is preset for each sensor (based on the 3σ value of the data in the past 24 hours, updated once per hour), and anomalies can be detected by comparing the real-time data with the threshold (no need to calculate the σ value in real time); 3. Parallel processing: Multi-threaded parallel processing of sensor data in different areas is adopted (such as 1 thread for high-risk areas and 2 threads for medium and low-risk areas), and the total preprocessing delay is controlled to ≤2 seconds.
[0173] 7.2 Real-time Feature Extraction: Based on real-time standardized data, real-time time-series features are extracted according to the S3 feature extraction rules. For interactive features, a "real-time feature calculation module" is developed to ensure that the feature generation speed matches the inference requirements: feature calculation formulas (such as the multiplication logic of "salinity × temperature") are preloaded, and the formulas are directly called for calculation after real-time data access (no real-time parsing logic is required); for three-factor interactive features (such as salinity × temperature × flow rate), "step-by-step calculation" is adopted (first calculate salinity × temperature, then multiply by flow rate) to reduce the amount of calculation per operation, with a calculation delay ≤ 0.5 seconds. Real-time Time Step Focus: A "real-time time step scoring module" is set up for the Attention mechanism, updating the attention weights once every 1 minute to ensure focus on real-time key time steps, specifically as follows: the "abrupt point amplitude" of each time step is calculated in real time (such as the difference between the current pressure and the previous minute); for time steps with amplitudes exceeding the threshold (3σ value), their attention weights are automatically increased (weight coefficient × 1.5) to ensure that the model prioritizes abnormal time points.
[0174] 7.3 Risk Reasoning and Result Output
[0175] 7.3.1 Model Inference: The "model quantization + hardware acceleration" approach is adopted to control the inference latency of the fused model (target ≤ 1 second): Model quantization: 32-bit floating-point numbers (FP32) are quantized into 16-bit floating-point numbers (FP16), reducing the model size by 50% and increasing the inference speed by 2 times; Hardware acceleration: GPU inference cards (such as NVIDIA Jetson AGX) are deployed to handle matrix operations of Bi-LSTM, further reducing inference time.
[0176] 7.3.2 Inference Result Output Format: To meet the needs of field engineers, the inference result output format includes "risk information + decision recommendations":
[0177]
[0178] 7.4 Output and Integration: This step stores the "Real-time Corrosion Risk Inference Results" in the "Real-time Risk Database" and transmits them through two paths: first, in real-time transmission to S8 for early warning triggering and data feedback; second, generation of an hourly "Real-time Risk Report" and transmission to the platform's central control system (displayed on a large screen) for engineers to monitor in real time. The "Key Influencing Factors" and "Key Time Steps" in the inference results will provide a basis for S8's early warning classification, and the "Real-time Risk Data" will provide material for S8's feedback optimization.
[0179] S8: Corrosion Risk Early Warning and Data Feedback: The inference results output by S7 include details such as "risk probability" and "key influencing factors," which can support more accurate early warning classification. At the same time, the parameter optimization of the fusion model requires continuous feedback data. This step sets probabilistic early warning thresholds, algorithmic feedback strategies, and early warning response processes to form a closed loop of "early warning-feedback-optimization."
[0180] 8.1 Warning Thresholds and Triggers
[0181] 8.1.1 Probabilistic Early Warning Threshold Setting: A tiered threshold is set based on "risk level + risk probability":
[0182]
[0183] 8.1.2 Early Warning Response Process: To ensure a rapid response after an early warning, a "three-level response process" is established, clearly defining the responsibilities of each role: 1. Attention-based early warning response: The central control engineer records the early warning information, incorporates it into the daily inspection plan, and completes the on-site visual inspection within 24 hours; 2. General early warning response: The maintenance team leader leads a team to the site within 1 hour with a portable corrosion detector (accuracy ±0.001mm / a) for testing, and provides feedback on the test results within 30 minutes; 3. Emergency early warning response: The platform director initiates the emergency procedure, shuts down the machine within 10 minutes, closes relevant valves, the emergency team arrives on site within 5 minutes, and issues a preliminary handling plan within 1 hour.
[0184] 8.2 Data Feedback Strategy
[0185] 8.2.1 Algorithm Feedback Data: Regarding the requirements for XGBoost, Attention, and Bi-LSTM, the following data feedback optimizations are provided: 1. Feedback to XGBoost (Optimizing Feature Weights): Collect the "actual corrosion rate detected manually after the warning" and compare it with the feature weights predicted by the model (e.g., the model considers salinity to be the key factor, but the actual detection is flow velocity); transmit the "feature weight deviation data" to S5 for retraining XGBoost and adjusting the feature weights (e.g., increasing the weight of flow velocity). 2. Feedback to Attention (Optimizing Time Step Focus): Record the "actual abnormal time step confirmed after the warning" (e.g., the actual pressure surge is at 14:28, but the model focuses at 14:30); transmit the "time step deviation data" to S5 for adjusting the Attention scoring parameters (e.g., shortening the time step detection window). 3. Feedback to Bi-LSTM (Optimize long-term dependence): Track the "corrosion trend 72 hours after the warning" (e.g., if the model predicts a sustained high risk, the risk actually decreases after 36 hours); transmit the "long-term trend deviation data" to S5 to adjust the number of hidden layer neurons in Bi-LSTM (e.g., increase from 64 to 80).
[0186] 8.2.2 Feedback Data Storage and Synchronization: Set up a "Feedback Database" to store all feedback data and achieve real-time synchronization with the front-end steps: Feedback data format: "Warning ID + Pipeline ID + Actual Corrosion Data + Deviation Reason + Adjustment Suggestion"; Synchronization frequency: Every 24 hours, the feedback data is synchronized to S2 (update the anomaly threshold), S3 (adjust the feature calculation logic), and S5 (retrain the model) to ensure that the front-end steps can be continuously optimized based on actual feedback.
[0187] 8.3 Output and Integration: This step outputs "tiered early warning information" (triggering the corresponding early warning method) and "categorized feedback data" (stored in the feedback database and synchronized to S2, S3, and S5). The early warning information will directly guide on-site emergency response, and the feedback data will provide practical basis for optimizing the front-end steps, promoting the upgrade of the entire monitoring system from "passive monitoring" to "proactive optimization".
[0188] S9: Historical data review and model iteration optimization: S5-S8 formed a short-term closed loop of "data-model-early warning-feedback", while S9 needs to review the performance changes of the integrated model from a long-term perspective (monthly / quarterly) to ensure that the model can adapt to long-term factors such as the aging of offshore drilling pipelines and changes in operating conditions.
[0189] 9.1 Historical Data Collection and Model Performance Review
[0190] 9.1.1 Scope of Historical Data Collection: Collect "full-process data" to ensure that the review covers all stages from data acquisition to early warning feedback: Basic data: raw sensor data of S1, standardized data of S2, feature data of S3; Model data: dataset of S4, model training log of S5, validation report of S6; Application data: real-time inference results of S7, early warning records and feedback data of S8; Field data: engineer's inspection records, pipeline maintenance records (such as pipeline cleaning, coating repair), and fault handling reports.
[0191] 9.1.2 Long-term performance review of the algorithms: Monthly reviews of the long-term performance of XGBoost, Attention, and Bi-LSTM are conducted to assess the model's adaptability to changes in pipeline operating conditions: 1. XGBoost review (feature weight stability): Compare the feature importance rankings of this month with last month (e.g., salinity weight decreased from 0.8 to 0.6, flow velocity weight increased from 0.5 to 0.7); analyze the reasons for weight changes (e.g., increased flow velocity impact due to pipeline coating aging). If the weight fluctuation of core features (e.g., corrosion rate) is >10%, XGBoost needs to be retrained. 2. Attention review (time-step focusing stability): Statistically analyze the time-step focusing accuracy of all high-risk samples this month (e.g., decreased from 90% to 85%); analyze the reasons for the accuracy decline (e.g., sensor deployment location shift causing timing misalignment). If the accuracy continues to decline for 3 months, the Attention parameters need to be readjusted. 3. Bi-LSTM Retrospective (Long-term Dependency Adaptability): Compare the "long-term dependency capture rate" of this month with that of last month (e.g., from 85% to 80%); analyze adaptive changes (e.g., the long-term corrosion trend changes due to the increase in pipeline service time). If the capture rate is <80%, the training window of Bi-LSTM needs to be extended (e.g., from 24 hours to 48 hours).
[0192] 9.2 Long-term iterative plan for the model
[0193] 9.2.1 Iteration Cycle and Process: A "quarterly small iteration + annual large iteration" plan is established to ensure the model can continuously adapt to long-term changes: Quarterly Small Iteration (every 3 months): 1. Supplement the S4 training set with feedback data from the past 3 months (S8 output); 2. Retrain some parameters of the fusion model (e.g., the number of trees in XGBoost, the learning rate of Attention); 3. Verify performance using the latest test set (data from the past month), and replace the original model after it meets the standards. Annual Large Iteration (every year): 1. Completely update the sensor deployment of S1 (e.g., replace aging sensors, deploy sensors in newly added pipeline areas); 2. Redesign the feature engineering of S3 (e.g., add an interactive feature of "coating aging degree × corrosion rate"); 3. Retrain the fusion model with historical data from the entire year, optimize all parameters, and ensure the model adapts to the annual operating conditions of the pipeline (e.g., increased service life, changes in environmental media).
[0194] 9.2.3 Iteration Effect Verification: After each iteration, a "full-scenario verification" is performed to ensure that the performance of the model after the iteration is not lower than that before the iteration: Verification dataset: "historical test set + new test set" (historical test set accounts for 70%, new test set accounts for 30%); Verification indicators: must meet the following requirements: "core indicators do not decrease (accuracy ≥ 90%, high-risk recall ≥ 95%) + new scenario indicators meet the standards (such as accuracy ≥ 88% for newly added pipeline areas)"; Verification report: Generate a model iteration verification report, record the comparison of indicators before and after the iteration, the reasons for the iteration, optimization measures, and archive it to the "iteration database".
[0195] 9.3 Historical Data Archiving and Value Mining
[0196] 9.3.1 Data Archiving Strategy: To ensure the security and reusability of historical data, a "tiered archiving strategy" is established: Core data (such as model training logs and early warning feedback data): stored on the platform's local server + cloud backup (dual backup), with a retention period of ≥5 years; Ordinary data (such as raw sensor data and standardized data): stored on the local server, with a retention period of ≥2 years, and compressed and archived after the retention period (retaining monthly summary data); Redundant data (such as duplicate inspection records): retained for ≤6 months, and cleaned up regularly (once per quarter).
[0197] 9.3.2 Long-term Data Value Mining: Annually, based on historical data, "corrosion risk pattern mining" is conducted to provide decision support for the platform's long-term operation and maintenance: Mining "regional corrosion patterns": Statistically analyzing the annual average corrosion rate of each pipeline area, identifying long-term high-risk areas (e.g., the annual corrosion rate at the bottom of the seawater-immersed section is 30% higher than other areas), and recommending additional anti-corrosion measures (e.g., thickening the coating); Mining "operating condition impact patterns": Analyzing the changes in corrosion rate under different operating conditions (e.g., sulfur content, flow rate), and recommending optimization of process parameters (e.g., controlling the sulfur content to <2% can reduce the corrosion rate by 40%); Outputting an annual corrosion risk analysis report, submitted to the platform management for the formulation of the next year's maintenance budget and anti-corrosion plan.
[0198] 9.4 Output and Integration: This step outputs a monthly model review report, a quarterly iteration verification report, and an annual corrosion risk analysis report. The iterated "Final AI Corrosion Risk Prediction Model (Annual Version)" is then transferred to S7 to replace the original model for real-time inference. Simultaneously, historical data archiving provides long-term data support for subsequent model training and pattern mining, forming a complete monitoring system of "short-term closed loop + long-term iteration."
Claims
1. An AI monitoring method for analyzing corrosion risk of drilling pipes based on time series data, characterized in that, Includes the following steps: S1: Collect real-time time-series data and static basic data from drilling pipeline sensors to form the raw dataset; S2: Preprocess and standardize the original dataset to form a standardized structured dataset; S3: Based on a standardized structured dataset, features are extracted using a dual-window approach, then a feature set for the fusion model is formed by filtering features and removing redundant features. S4: Based on the feature set of the fusion model, the corrosion risk label is labeled on the standardized structured dataset, the sample balance is achieved by using the time series SMOTE algorithm, and then the dataset is divided into training set, validation set and test set. S5: AI corrosion risk prediction model training. After inputting the training set, the feature importance weight vector is first extracted through the extreme gradient boosting model. The extreme gradient boosting model is trained in stages. In the first stage, the first 100 trees are trained with an initial learning rate of 0.
01. Every 10 trees are trained, the multi-class error rate is calculated using the validation set. If there is no decrease for 10 consecutive rounds, early stopping is triggered. In the second stage, the remaining 100 trees are finely optimized using the optimal tree depth from the first stage, with the learning rate finely adjusted to 0.
005. The feature importance weight vector output from the extreme gradient boosting model is directly used as input to the feature weighting step in the attention mechanism to amplify the contribution of highly important features. This weight vector, along with the temporal feature sequence of the training set, is then input into the attention mechanism. The attention mechanism generates the focused temporal feature sequence as follows: First, the feature importance weight vector output from the extreme gradient boosting model is used to weight the features at each time step. Then, a trainable attention weight matrix and bias are introduced, and the importance score at each time step is calculated using the sigmoid function. The scores at all time steps for each sample are then normalized using softmax to obtain the attention weights. Finally, the attention weights are used to weight the original temporal features. The generated focused temporal feature sequence serves as the sole input to the bidirectional long short-term memory network model to capture long-term dependencies. The focused features are then... The temporal feature sequence is input into the bidirectional long short-term memory network model. The bidirectional long short-term memory network model concatenates the forward hidden state and the backward hidden state to obtain the hidden state that integrates bidirectional information. By incorporating the feature weights of the extreme gradient boosting model as learnable parameters into the gradient calculation, the feature weights are made differentiable. The Adam optimizer and cross-entropy loss function are adopted. During training, the scale_pos_weight parameter is set as the ratio of the number of low-risk samples to the number of high-risk samples to increase the loss weight of high-risk samples. The parameters of the three algorithms are updated synchronously through end-to-end joint optimization. During the optimization process, the cross-entropy loss of the bidirectional long short-term memory network is used as the overall objective. Backpropagation synchronously adjusts the tree structure parameters of the extreme gradient boosting, the weight matrix and bias of the attention mechanism, and the hidden layer parameters of the bidirectional long short-term memory network to ensure that the three algorithms work together to improve the prediction accuracy. The loss is calculated using the validation set in each iteration. Training stops after five consecutive iterations when the loss does not decrease, forming the initial AI corrosion risk prediction model. S6: Input the test set into the initial AI corrosion risk prediction model, verify it through core indicators, fusion specific indicators and working condition tests, optimize the sub-algorithms to meet the standards, and form the final AI corrosion risk prediction model. S7: Acquire real-time data from sensors, preprocess and extract features, then input the final AI corrosion risk prediction model to output real-time corrosion risk inference results; S8: Based on the risk level and probability of real-time corrosion risk inference results, set early warning thresholds, trigger corresponding early warning methods and response processes, and collect real data to form classified feedback data, which is then synchronized to S2, S3, and S5.
2. The AI monitoring method for analyzing corrosion risk of drilling pipes based on time series data according to claim 1, characterized in that, It also includes S9: monthly collection of historical full-process data, performance review of each algorithm, quarterly small iterations every 3 months using classification feedback data to supplement the training set, annual large iterations of sensor deployment and feature engineering logic, and replacement of the original model if the verification indicators meet the standards after iteration, thus forming a monitoring closed loop.
3. The AI monitoring method for analyzing corrosion risk of drilling pipes based on time series data according to claim 1, characterized in that, In step S1, the sensors specifically include: corrosion rate sensor, temperature sensor, pressure sensor, medium composition sensor, environmental parameter sensor, medium flow rate sensor, and pipeline stress sensor; the static basic data specifically include: pipeline material, wall thickness, service life, historical maintenance records, historical pipeline operating data, and anti-corrosion measures data.
4. The AI monitoring method for drilling pipeline corrosion risk based on time-series data analysis according to claim 1, characterized in that, In step S2, the handling of missing values in the preprocessing is as follows: high-frequency sensors use the sliding window mean method, and low-frequency sensors use the linear interpolation method. When the missing rate exceeds the threshold, redundant sensor data is called or manual inspection is triggered. The handling of outliers in the preprocessing is as follows: first, the sensors are filtered according to their physical constraints, and then the 3σ criterion is used in combination with industry thresholds for verification. Faulty data is smoothly replaced, and real outlier data is marked.
5. The AI monitoring method for drilling pipeline corrosion risk based on time-series data analysis according to claim 1, characterized in that, In step S3, the extracted features specifically include: time domain features, frequency domain features, time series trend features, two-factor interaction features, three-factor interaction features, time series abrupt change features, and long-term cumulative features; dual-window extraction is: a 1-hour small window to extract short-term features and a 24-hour large window to extract long-term features; the feature selection algorithm specifically includes: extreme gradient boosting to select nonlinear related features, attention mechanism to select time-sensitive features, and bidirectional long short-term memory to select long-term related features.
6. The AI monitoring method for drilling pipeline corrosion risk based on time-series data analysis according to claim 1, characterized in that, In step S4, the sample dataset is divided as follows: it is divided in chronological order, with the training set consisting of data from the first 8 months, accounting for 75%; the validation set consisting of data from the 9th month, accounting for 15%; and the test set consisting of data from the 10th month, accounting for 10%; and each dataset covers all pipeline regions.
7. The AI monitoring method for drilling pipeline corrosion risk based on time-series data analysis according to claim 1, characterized in that, In step S6, the core verification indicators include: accuracy ≥ 90%, high-risk recall ≥ 95%, and extremely high-risk recall ≥ 98%; the fusion specificity indicators include: feature weight contribution rate ≥ 3%, time step focusing accuracy ≥ 90%, and long-term dependent capture rate ≥ 85%; the operating conditions include: typhoon weather, medium switching, and sensor failure scenarios.
8. The AI monitoring method for analyzing corrosion risk of drilling pipes based on time series data according to claim 1, wherein, In step S7, when the sensor acquires data in real time, data from high-risk areas is prioritized for scheduling. The real-time corrosion risk inference results include pipeline ID, risk level, risk probability, key influencing factors, key time steps, and recommended measures.
9. The AI monitoring method for analyzing corrosion risk of drilling pipes based on time series data according to claim 1, characterized in that, In step S8, the warning threshold is specifically defined as: Warning of concern: medium risk and probability ≥ 0.7; General warning: High risk with a probability ≥ 0.7 or medium risk with a probability ≥ 0.9; urgent Warning: Extremely high risk with a probability ≥ 0.6 or high risk with a probability ≥ 0.9; The warning methods include text prompts, audible and visual alarms, and SMS notifications; the response process is: 24-hour monitoring, 1-hour inspection, and 10-minute shutdown.
Citation Information
Patent Citations
Power equipment fault prediction and health management method based on industrial big data
CN117556347A
Marine corrosion real-time monitoring method and system, terminal and storage medium
CN119198525A
New energy vehicle high-voltage system dynamic risk assessment method and device based on multi-source data fusion
CN121366457A