Gas cut while-drilling detection method

By acquiring and processing downhole signals in real time on a gas intrusion simulation experimental platform, and combining it with the LightGBM model, the problems of delay and high false alarm rate of existing gas intrusion detection methods are solved, and efficient and accurate gas intrusion identification and early warning are achieved.

CN121475321APending Publication Date: 2026-02-06SOUTHWEST PETROLEUM UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511634146.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-10
Publication Date
2026-02-06

AI Technical Summary

Technical Problem

Existing gas intrusion detection methods suffer from delays and high false alarm rates in deep, high-speed drilling, making it difficult to identify and differentiate between gas intrusion and false signals caused by drill string vibration when the drilling fluid gas content is less than 3%.

Method used

A gas invasion simulation experimental platform was used to simulate the high temperature and high pressure environment downhole. A baseline model of detection signals was established, and real-time acquisition of drilling vibration and flow signals was performed. Feature quantities were extracted by wavelet packet decomposition and flow acceleration features, and combined with the LightGBM model for gas invasion status identification and graded early warning.

Benefits of technology

It improves the accuracy of air intrusion detection, shortens the identification time, reduces energy consumption, and reduces the false alarm rate to <3%. It can identify abnormalities in the early stage of air intrusion and detect air intrusion 4-5 minutes in advance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121475321A_ABST
    Figure CN121475321A_ABST
Patent Text Reader

Abstract

The invention discloses a gas cut detection while drilling method. The method comprises the steps that a gas cut simulation experiment platform is built to simulate the gas cut process of an underground high-temperature and high-pressure environment; establishing a baseline model of a detection signal on the gas cut simulation experiment platform under a normal drilling working condition; gas cut simulation is started, gas is injected into the gas cut simulation experiment platform, and a while-drilling vibration signal and a drilling fluid flow signal are collected in real time; preprocessing the collected while-drilling vibration signal and extracting a first characteristic quantity, wherein the first characteristic quantity is an energy proportion characteristic of a specific frequency band; preprocessing the collected drilling fluid flow signal and extracting a second characteristic quantity, wherein the second characteristic quantity is an acceleration characteristic of flow change; performing standardization and feature alignment on the first feature quantity and the second feature quantity, combining the first feature quantity and the second feature quantity into a feature vector, and inputting the feature vector into a pre-trained integrated learning classification model; and performing gas cut state identification and grading early warning according to the gas cut occurrence probability value output by the integrated learning classification model.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application belongs to the technical field of gas invasion detection, and particularly relates to a gas invasion while drilling detection method. BACKGROUND

[0002] Gas invasion refers to the phenomenon that gas in the formation invades into the wellbore during the drilling process of an oilfield, causing the properties of the drilling fluid to change. The reasons are mainly three: first, when a fractured or large cave type formation is drilled, a large amount of gas will suddenly flow into the wellbore and the drilling fluid will be lost. Second, when a gas layer is drilled, as the rock is broken, the gas in the formation will invade the wellbore. Third, when the downhole pressure is less than the formation pressure at the same depth, the formation is in an underbalanced drilling state, and the gas in the formation will invade the wellbore in the form of gas or dissolved gas due to the pressure difference. Once gas invasion occurs, the density of the drilling fluid will decrease, and accidents such as overflow and blowout are likely to occur. Therefore, early and accurate detection of downhole gas invasion can effectively prevent accidents from occurring.

[0003] In terms of gas invasion detection, the methods commonly used in China include drilling fluid pool liquid level detection (drilling fluid increment method), flow difference overflow detection method, and acoustic gas invasion monitoring method. For example, the existing technology of outlet flow method has a delay of 5-10 minutes, which cannot meet the needs of deep well high-speed drilling. Moreover, as can be known from the experimental data of the existing technology, the current dynamic testing device is greatly disturbed by the pressure fluctuation of the wellbore, and it is difficult to have accurate data display. Furthermore, the false positive rate of the existing early warning model is >25% (according to the industry standard SY / T 6426-2019), so a more efficient early warning model is needed to meet the needs.

[0004] Using modern methods to detect gas invasion, how to achieve early identification when the gas content of the drilling fluid is <3% and how to distinguish gas invasion from false signals caused by drill string vibration are problems that need to be considered. SUMMARY

[0005] To solve the above technical problems, the present application provides a gas invasion while drilling detection method, which can effectively improve the accuracy of gas invasion detection, greatly shorten the time to discover gas invasion, and effectively reduce energy consumption.

[0006] To achieve the above purpose, the present application provides a gas invasion while drilling detection method, comprising: Building a gas invasion simulation experiment platform to simulate the gas invasion process in a high temperature and high pressure downhole environment; Establishing a baseline model of detection signals under normal drilling conditions on the gas invasion simulation experiment platform; Starting gas invasion simulation, injecting gas into the gas invasion simulation experiment platform, and collecting real-time drilling vibration signals and drilling fluid flow signals; The collected drilling vibration signal is preprocessed and a first characteristic quantity is extracted, and the first characteristic quantity is an energy proportion characteristic of a specific frequency band; The collected drilling fluid flow signal is preprocessed and a second characteristic quantity is extracted, and the second characteristic quantity is an acceleration characteristic of flow change; The first characteristic quantity and the second characteristic quantity are standardized and aligned in features, combined into a feature vector, and input into a pre-trained ensemble learning classification model; According to the gas invasion occurrence probability value output by the ensemble learning classification model, the gas invasion state is identified and graded early warning.

[0007] Optionally, the gas invasion simulation experiment platform comprises: According to the design drawing, connect the fluid circuit comprising pump, storage tank, autoclave, back pressure valve and flowmeter; connect the gas injection circuit composed of gas cylinder, booster pump and mass flow controller; install all sensors and connect to the data acquisition system; perform system pressure test and leakage test; calibrate all sensors and controllers.

[0008] Optionally, the baseline model of the detection signal comprises: Fill the system with drilling fluid of a predetermined density, start the advection pump to set a constant displacement, start the back pressure control system to raise the system pressure to the target value, and start the temperature control system to raise the temperature to the target value; after the system pressure, temperature and flow are stable, run for a period of time; during this period, continuously collect vibration and flow data, and calculate the mean and standard deviation of the characteristic quantity under normal working conditions to establish the baseline model.

[0009] Optionally, the collected drilling vibration signal is preprocessed and comprises: The continuous vibration signal stream is converted into a plurality of analyzable time segments by using a sliding window method; the signal in each data window is de-trended to remove potential linear or slowly changing trend items; the de-trended signal is multiplied by a window function to reduce spectral leakage.

[0010] Optionally, the first characteristic quantity comprises: The preprocessed vibration signal is subjected to wavelet packet decomposition in frequency bands; the ratio of the energy sum of all frequency components in the target frequency band to the energy sum in the entire Nyquist frequency range is calculated to quantify the proportion of the energy of the target frequency band in the total energy, and the ratio is taken as the first characteristic quantity.

[0011] Optionally, the collected drilling fluid flow signal is preprocessed and the second characteristic quantity is extracted, and comprises: The collected discrete flow signal sequence is smoothed and filtered to eliminate noise; the first derivative of the flow signal with respect to time is calculated to obtain the flow change trend; the second derivative of the first derivative signal is calculated as the second characteristic quantity.

[0012] Optionally, the ensemble learning classification model is the LightGBM model, which inputs the feature vector into the LightGBM model and outputs continuous probability values ​​of air intrusion.

[0013] Optionally, the air intrusion status identification and graded early warning based on the air intrusion occurrence probability value output by the ensemble learning classification model includes: The probability value of gas intrusion is compared with a preset threshold; if the probability value is greater than the first threshold, an audible and visual alarm is activated; if the probability value is greater than the higher second threshold, the drilling pump speed is automatically adjusted; if the probability value is greater than the highest third threshold, the well control program is interlocked and started.

[0014] Technical advantages of this invention: This invention discloses a gas intrusion detection method while drilling, which significantly improves detection sensitivity, greatly reduces response time, significantly reduces false alarm rate, and greatly improves adaptability to complex operating conditions; by fusing 2-8kHz vibration characteristics, it can identify gas intrusion in its early stages (gas content <1%), detecting anomalies 4-5 minutes earlier than the traditional flow rate comparison method; by using wavelet packet decomposition + dynamic threshold, under interference such as drill string vibration (50Hz) and pump pressure fluctuation, the false alarm rate is reduced from the industry average of 25% to <3%, achieving zero false triggers in 6 consecutive months of testing in oilfields. Attached Figure Description

[0015] The accompanying drawings, which form part of this application, are used to provide a further understanding of this application. The illustrative embodiments and descriptions of this application are used to explain this application and do not constitute an undue limitation of this application. In the drawings: Figure 1 This is a schematic diagram of the dynamic testing platform structure according to an embodiment of the present invention; Figure 2 This is a schematic diagram of the gas intrusion detection model algorithm architecture according to an embodiment of the present invention; Figure 3 This is a comparison diagram between the innovative algorithm and the traditional algorithm in this embodiment of the invention; Figure 4 This is a schematic flowchart of a gas intrusion detection method according to an embodiment of the present invention. Detailed Implementation

[0016] It should be noted that, unless otherwise specified, the embodiments and features described in this application can be combined with each other. This application will now be described in detail with reference to the accompanying drawings and embodiments.

[0017] It should be noted that the steps shown in the flowchart of the drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from here.

[0018] As Figure 4 shown, the embodiment provides a gas invasion while drilling detection method, comprising: A gas invasion simulation experiment platform is built to simulate the gas invasion process in a high temperature and high pressure environment downhole; A baseline model of detection signals is established under normal drilling conditions on the gas invasion simulation experiment platform; Start the gas invasion simulation, inject gas into the gas invasion simulation experiment platform, and collect real-time drilling vibration signals and drilling fluid flow signals; The collected drilling vibration signals are preprocessed and first characteristic quantities are extracted, the first characteristic quantities being energy proportion characteristics of specific frequency bands; The collected drilling fluid flow signals are preprocessed and second characteristic quantities are extracted, the second characteristic quantities being acceleration characteristics of flow changes; The first characteristic quantities and the second characteristic quantities are standardized and aligned, combined into a feature vector and input into a pre-trained integrated learning classification model; According to the gas invasion occurrence probability value output by the integrated learning classification model, the gas invasion state is identified and graded early warning.

[0019] Further, the gas invasion simulation experiment platform comprises: According to the design drawing, connect the fluid circuit comprising the pump, the storage tank, the autoclave, the back pressure valve and the flowmeter; connect the gas injection circuit composed of the gas cylinder, the booster pump and the mass flow controller; install all sensors and connect to the data acquisition system; perform system pressure test and leakage test; calibrate all sensors and controllers.

[0020] Further, the baseline model of detection signals comprises: Fill the system with drilling fluid of a predetermined density, start the advection pump to set a constant displacement, start the back pressure control system to raise the system pressure to the target value, and start the temperature control system to raise the temperature to the target value; after the system pressure, temperature and flow are stable, run for a period of time; during this period, continuously collect vibration and flow data, and calculate the mean and standard deviation of the characteristic quantities under normal conditions to establish the baseline model.

[0021] Specifically, an implementation manner of the embodiment: Fill the system with drilling fluid of a predetermined density, start the constant flow pump and set a constant displacement (e.g. 30 L / min). Start the back pressure control system and gradually increase the system pressure to the target value (50 MPa) to simulate the bottom hole pressure of a specific well depth. Start the temperature control system and increase the temperature to the target value (120°C). After the system pressure, temperature and flow rate are completely stable, run for 10-15 minutes. During this period, the gas influx detection algorithm continuously acquires vibration and flow rate data and calculates the mean and standard deviation of the characteristic quantities (F1, F2) under normal operating conditions, establishing a baseline model. At this point, the algorithm output probability P should be close to 0.

[0022] Further, the pre-processing of the acquired vibration signal while drilling includes: Converting the continuous vibration signal stream into multiple analyzable time segments using a sliding window method; detrending the signal within each data window to remove potential linear or slowly varying trend terms; multiplying the detrended signal with a window function to reduce spectral leakage.

[0023] In particular, an implementation of the present embodiment: Set the gas mass flow controller (MFC) to start injecting gas at an extremely low rate. This process simulates the initial invasion of formation gas into the wellbore annulus under the action of high pressure difference. Acquire the drilling fluid flow rate, standpipe pressure and drill string vibration signals in real time and perform signal preprocessing: Preprocessing of the vibration signal Data segmentation: convert the continuous vibration signal stream into multiple analyzable time segments using a sliding window method for real-time or quasi-real-time calculation.

[0024] Let the original signal be X(n), n=0,1,2,....,N-1; The i-th data window is: Xi=(m)=x(m+i·R), m=0,1,2,....,M-1; Where: M: window length (e.g. for 2 seconds of data, if the sampling rate fs=20kHz then M=40000 points). R: sliding step (e.g. R=M / 2 indicates 50% overlap to improve time resolution).

[0025] Detrending: directly subtract the least squares fitting straight line of the window signal to remove potential linear or slowly varying trend terms in the signal, preventing them from contaminating the low frequency components after FFT.

[0026] For each window Xi(m), fit a straight line y(m)=a·m+b.

[0027] The detrended signal is: ; The de-trended signal is multiplied by a window function (Hanning window) to reduce spectral leakage caused by the discontinuity at the beginning and end of the data segment in the FFT ; The vibration signal is decomposed by wavelet packet in the frequency band of 2-8 kHz (db6 wavelet basis). The ratio of the energy sum of all frequency components in the target frequency band to the energy sum of the whole Nyquist frequency range is calculated. The proportion of the energy of the target frequency band (2-8 kHz) in the total energy is quantified.

[0028] Preprocessing of flow signal: The existing filter Savitzky-Golay filter is used to remove high-frequency noise and spike interference in the flow signal, so as to facilitate stable derivation. For the flow data points in a window, a k-order polynomial is used to fit 2N+1 adjacent data points. The smoothed output value is the fitting value of the polynomial at the center point of the window. The process is completed by convolution: ; Where c i is the convolution coefficient pre-calculated by the polynomial order k and the window size 2N+1.

[0029] Then another set of convolution coefficients d i pre-calculated for calculating the second derivative are used for convolution: ; This F2(t) is the flow change acceleration feature at time t.

[0030] Calculation of step response time and false alarm rate of the computing device under composite excitation: Calculate the response time Tr: Generate a composite excitation step signal on the simulation platform. First, simulate a stable normal drilling condition. At time t0, the gas injection rate is switched from 0 to a fixed, small value through a mass flow controller. This step change simulates the start of a sudden, small gas invasion. Determine the response endpoint T (find the point on the algorithm input curve P(t) that meets the condition: P(t) ≥ warning threshold).

[0031] T r =t-t0; This Tr is the step response time of the system in this test. Repeat the above test N (>20) times under the same step amplitude but different random noise background to obtain a set of response time data: T r1 , T r2 ,..., T rN . Finally, calculate the average step response time T r and its standard deviation σ Tr : ; False alarm rate: P(t) value jumps above the warning threshold for the first time and stays above the warning threshold, and then falls below the warning threshold again. One continuous overcount is counted as one false alarm event, regardless of its duration. Scan the entire P(t) time series to identify all false alarm events. The time-based false alarm rate is the total number of false alarm events N t within the total statistical test duration T FA, Calculate the false alarm rate F AR : .

[0032] Further, the first feature quantity comprises: Wavelet packet decomposition of the preprocessed vibration signal in the frequency band; calculate the ratio of the energy sum of all frequency components in the target frequency band to the energy sum in the entire Nyquist frequency range, to quantify the proportion of the energy of the target frequency band in the total energy, and take the ratio as the first feature quantity.

[0033] Specifically, one implementation of the embodiment: Vibration signal frequency energy feature extraction: Pretreatment of the collected while-drilling vibration signal sequence x(n) includes denoising and standardization; apply fast Fourier transform (FFT) to convert the vibration signal from time domain to frequency domain to obtain the frequency domain representation ; Calculate the energy Eband of the vibration signal in the frequency band f1=2kHz to f2=8kHz and the total energy Etotal of the signal: ; Further calculate the energy proportion feature F1 of the frequency band as the first feature quantity: ; This is used as the first feature quantity representing early gas invasion anomalies.

[0034] Further, the preprocessed drilling fluid flow signal is collected and the second feature quantity comprises: Smooth filtering processing is performed on the collected discrete flow signal sequence to eliminate noise; calculate the first derivative of the flow signal with respect to time to obtain the flow change trend; calculate the second derivative of the first derivative signal as the second feature quantity.

[0035] Specifically, one implementation of the embodiment: Flow signal time domain change feature extraction: Real-time acquisition of drilling fluid outlet flow signal, and smoothing filtering processing is carried out on the signal to eliminate noise, smoothing filtering is carried out on the collected discrete flow signal sequence q(t) to obtain q~(t); The first derivative (instantaneous change rate) dq(t) of the flow signal relative to time is calculated to obtain the flow change trend, ; The second derivative (change acceleration) d2q(t) of the first derivative signal is calculated as the second feature F2, ; The acceleration feature of flow change is extracted as the second feature quantity representing the flow fluctuation caused by gas invasion.

[0036] Further, according to the gas invasion occurrence probability value output by the integrated learning classification model, the gas invasion state is identified and graded early warning includes: The gas invasion occurrence probability value is compared with a preset threshold value; if the probability value is greater than a first level threshold value, an audible and visual alarm is activated; if the probability value is greater than a higher second level threshold value, the drilling pump speed is automatically adjusted; if the probability value is greater than a highest third level threshold value, an interlock is started to start the well control program.

[0037] Specifically, one implementation of the embodiment: The first feature F1 and the second feature F2 are standardized and aligned, and combined into a feature vector ; The feature vector is input into a pre-trained LightGBM classification model, LightGBM (Light Gradient Boosting Machine) is a gradient (Gradient Bo) integrated learning model based on decision tree (Decision Tree) algorithm. The model outputs a continuous gas invasion occurrence probability value P: ; The LightGBM classification model is obtained by training historical gas invasion data and normal working condition data, and the key parameter configuration of the model is as follows: The num_leaves parameter is set to 31 to control the model complexity and overfitting risk; The learning_rate parameter is set to 0.05 to balance the model training speed and performance; The feature_fraction parameter is set to 0.8, which means that 80% of the features are randomly selected during the training of each tree, so as to enhance the model generalization ability; The algorithm finally compares the probability value P with a preset threshold value T, and if P≥T, it is determined that gas invasion occurs and triggers an early warning.

[0038] Gas invasion early warning system, comprising: The first step is hierarchical early warning: Level 1 early warning (0.7 < P < 0.85): activate sound and light alarm; Level 2 early warning (0.85 < P < 0.95): automatically adjust the drilling pump speed; Level 3 early warning (P > 0.95): interlock start well control program.

[0039] The second step is the man-machine interaction interface: A) Real-time dashboard and three-dimensional probability surface graph displayed side by side, wherein: The dashboard dynamically displays the flow, pressure, and vibration energy parameters; The three-dimensional graph takes X-time, Y-characteristic value, and Z-probability as the coordinate system; B) Early warning state indication area, dynamically displaying: Current early warning level (blue / yellow / red three-color coding); Automatic upgrade countdown (default 30 seconds); Recommended treatment measures; C) Anti-mis-touch emergency panel, whose emergency brake button needs: First lift the physical protective cover plate; Two consecutive clicks for confirmation (interval > 1s).

[0040] An application example of the present application: As shown in Figure 1 The top drive unit includes: simulating the rotation of the drill string in actual drilling, the key parameters of the drill string rotation movement: speed 0-200 rpm stepless adjustable, torque fluctuation < ± 5%. The vibration excitation system includes: electromagnetic vibration table (frequency 2-200 Hz, amplitude ± 5 mm), eccentric mechanism (simulating drill string lateral vibration), gas-liquid mixed injection cabin including: liquid phase pump (flow 0-50 L / min, ± 0.5% accuracy), gas phase injector (gas content 0.1-15% adjustable), static mixer (gas-liquid mixing uniformity > 95%). High pressure simulation cabin: pressure shell (0-5000 m equivalent pressure, ± 0.1 MPa), measured sensor array (vibration / flow / pressure), high-speed data acquisition card (1 MHz sampling rate, 24 bit precision).

[0041] Control system: PLC (Siemens S7-1500), excitation signal generator (arbitrary waveform output), safety interlocking device (pressure / vibration overrun protection).

[0042] As shown in Figure 2As shown, the sensor is responsible for the synchronous acquisition of three channels: flow rate, pressure, and vibration. The signal preprocessing module includes: flow rate signal: moving average filtering (window width 0.5s); vibration signal: wavelet packet decomposition (db6 wavelet basis); pressure signal: outlier removal (3σ criterion). Time-frequency feature extraction includes: flow rate feature: second derivative / fluctuation entropy; vibration feature: energy proportion in the 2-8kHz frequency band; pressure feature: dP / dt. Multi-feature fusion and standardization (Min-Max normalization + PCA dimensionality reduction to 5 dimensions). LightGBM classification model, input: 5-dimensional feature vector, output: air intrusion probability (0-1).

[0043] Three-level early warning decision: Level 1 (probability > 0.7): audible and visual alarm; Level 2 (probability > 0.85): adjust pump speed; Level 3 (probability > 0.95): activate well control.

[0044] like Figure 3 As shown in the figure, the probability exceeds 0.7 (the first-level warning threshold) at t=60s, identifying the risk of air intrusion 120 seconds in advance, demonstrating the technical advantages of this invention (no delay and anti-interference). In contrast, traditional algorithms only reach the alarm threshold at t=210s, a 30-second lag. Furthermore, they suffer from drawbacks: long initial response time, large response fluctuations, and excessively large jumps.

[0045] This invention discloses a gas intrusion detection method while drilling, which significantly improves detection sensitivity, greatly reduces response time, significantly reduces false alarm rate, and greatly improves adaptability to complex operating conditions. By fusing 2-8kHz vibration characteristics, it can identify gas intrusion in its early stages (gas content <1%), detecting anomalies 4-5 minutes earlier than the traditional flow rate comparison method. By employing wavelet packet decomposition and dynamic thresholding, the false alarm rate is reduced from the industry average of 25% to <3% under interference such as drill string vibration (50Hz) and pump pressure fluctuations, achieving zero false triggers in 6 consecutive months of testing in oilfields.

[0046] The above are merely preferred embodiments of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A method of gas detection while drilling, characterized in that, The method comprises the following steps: building a gas invasion simulation experiment platform to simulate the gas invasion process in the high temperature and high pressure environment downhole; establishing a baseline model of detection signals under normal drilling conditions on the gas invasion simulation experiment platform; starting the gas invasion simulation, injecting gas into the gas invasion simulation experiment platform, and collecting real-time drilling vibration signals and drilling fluid flow signals; preprocessing the collected drilling vibration signals and extracting first characteristic quantities, the first characteristic quantities being energy proportion characteristics of specific frequency bands; preprocessing the collected drilling fluid flow signals and extracting second characteristic quantities, the second characteristic quantities being acceleration characteristics of flow rate changes; standardizing and aligning the first characteristic quantities and the second characteristic quantities, combining them into a feature vector, and inputting the feature vector into a pre-trained integrated learning classification model; performing gas invasion state identification and hierarchical early warning according to the gas invasion occurrence probability value output by the integrated learning classification model.

2. The gas invasion while drilling detection method according to claim 1, wherein building a gas invasion simulation experiment platform comprises: connecting a fluid circuit comprising a pump, a storage tank, an autoclave, a back pressure valve, and a flowmeter according to design drawings; connecting a gas injection circuit composed of a gas cylinder, a booster pump, and a mass flow controller; installing all sensors and connecting them to a data acquisition system; performing system pressure test and leakage test; and calibrating all sensors and controllers.

3. The gas invasion while drilling detection method according to claim 1, wherein establishing a baseline model of detection signals comprises: filling the system with drilling fluid of a predetermined density, starting a constant displacement pump to set a constant displacement, starting a back pressure control system to raise the system pressure to a target value, and starting a temperature control system to raise the temperature to a target value; after the system pressure, temperature, and flow rate are stable, continuously operating for a period of time; during this period, continuously collecting vibration and flow data, and calculating the mean and standard deviation of the characteristic quantities under normal conditions to establish a baseline model.

4. The gas invasion while drilling detection method according to claim 1, wherein preprocessing the collected drilling vibration signals comprises: using a sliding window method to convert continuous vibration signal streams into multiple analyzable time segments; performing detrending on the signals in each data window to remove potential linear or slowly changing trend items; and multiplying the detrended signals by a window function to reduce spectral leakage.

5. The gas invasion while drilling detection method according to claim 4, wherein extracting first characteristic quantities comprises: performing wavelet packet decomposition of the preprocessed vibration signals in frequency bands; calculating the ratio of the energy sum of all frequency components in the target frequency band to the energy sum in the entire Nyquist frequency range to quantify the proportion of the energy of the target frequency band in the total energy, and taking the ratio as the first characteristic quantity.

6. The gas invasion while drilling detection method according to claim 1, wherein preprocessing the collected drilling fluid flow signals and extracting second characteristic quantities comprises: performing smoothing filter processing on the collected discrete flow signal sequence to eliminate noise; calculating the first derivative of the flow signal with respect to time to obtain the flow change trend; and calculating the second derivative of the first derivative signal as the second characteristic quantity.

7. The method of gas detection while drilling according to claim 1, wherein, the integrated learning classification model is a LightGBM model, and the feature vector is input into the LightGBM model to output a continuous gas occurrence probability value.

8. The method of gas detection while drilling according to claim 1, wherein, the gas occurrence probability value output by the integrated learning classification model is used for gas state identification and hierarchical early warning, including: comparing the gas occurrence probability value with a preset threshold value; if the probability value is greater than a first-level threshold value, activating an audible and visual alarm; if the probability value is greater than a second-level threshold value which is higher, automatically adjusting the drilling pump speed; and if the probability value is greater than a third-level threshold value which is the highest, interlocking and starting a well control program.