Intelligent monitoring method for casing recovery

By eliminating interference using a spectral intelligent sensor and the Transformer algorithm, and correcting the pressure threshold using a long short-term memory network, the problems of concentration detection interference and pressure threshold deviation in jacket gas recovery are solved, achieving high-precision jacket gas monitoring and recovery.

CN120847014BActive Publication Date: 2025-12-23XIAN SHAN CHUAN PETROLEUM TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511341876.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-09-19
Publication Date
2025-12-23
Estimated Expiration
2045-09-19

AI Technical Summary

Technical Problem

In existing gas recovery monitoring technologies, concentration detection is subject to interference and pressure threshold deviation, resulting in inaccurate detection results and making it difficult to meet the requirements for high-precision and stable monitoring.

Method used

The system uses a spectral intelligent sensor to collect ultraviolet and infrared spectral data, combines the Transformer algorithm to remove interference, corrects the pressure threshold through a long short-term memory network, constructs a pressure coupling model, calculates the concentration using Lambert-Beer law, and adjusts the pipe diameter using a PID control algorithm.

Benefits of technology

It improves the accuracy of concentration detection and the adaptability of pressure thresholds, ensuring the safety and rationality of jacket gas recovery, and realizing high-precision jacket gas monitoring and recovery.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120847014B_ABST
    Figure CN120847014B_ABST
Patent Text Reader

Abstract

The application discloses an intelligent monitoring method for casing head gas recovery, relates to the technical field of casing head gas detection and analysis, and realizes real-time acquisition of casing head gas parameters, including gas pressure, instantaneous gas volume and gas temperature, adopts ultraviolet and infrared spectrum sensors to acquire spectrum data, introduces a scattering feature calculation module and a shielding feature calculation module into a Transform network, extracts oil mist scattering interference features and shielding interference features, performs weight fusion on the ultraviolet and infrared spectrum data, removes interference spectrum hazard values, generates a net absorption spectrum, calculates concentration in combination with a Lambert-Beer law, and performs safety early warning, considers the coupling between casing head gas parameters, adopts a long short-term memory network to construct a pressure coupling model to correct a pressure threshold value, and realizes accurate monitoring, safety early warning and stable recovery of casing head gas through PID algorithm control of an electrically-controlled adjustable pipeline dynamic adjustment path.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of gas detection and analysis technology, and specifically to an intelligent monitoring method for gas recovery. Background Technology

[0002] As a critical process in crude oil extraction, accurate monitoring and control of gas parameters within the casing are essential for ensuring production safety and efficiency. Currently, casing gas monitoring technology has significant shortcomings: in gas concentration detection, single-band spectroscopy is ill-equipped to withstand interference from complex components; while ultraviolet spectroscopy is sensitive to low-concentration target gases, Mie scattering caused by oil mist particles severely distorts the detection signal; and although infrared spectroscopy can identify… Interfering components such as water vapor, however, suffer from insufficient signal-to-noise ratio due to low absorption coefficients and spectral overlap, resulting in... The concentration detection results have large deviations, making it difficult to guarantee the accuracy of safety warnings. In addition, the pressure threshold is generally set to a fixed value, ignoring the coupling relationship between gas pressure, instantaneous gas volume, and gas temperature. This results in poor adaptability to actual working conditions and makes it difficult to meet the needs of high-precision and stable gas monitoring and recovery. Summary of the Invention

[0003] The purpose of this invention is to provide an intelligent monitoring method for gas recovery, by addressing the shortcomings of existing gas recovery monitoring methods. To address issues such as interference in concentration detection and operational deviations in pressure thresholds, this study aims to improve monitoring accuracy and ensure production safety.

[0004] The technical solution to achieve the objective of this invention is as follows:

[0005] A smart monitoring method for jacket gas recovery includes the following steps:

[0006] Real-time acquisition of gas parameters, including gas pressure, instantaneous gas volume, and gas temperature, is performed. Ultraviolet and infrared spectral data are collected using a spectral intelligent sensor. A scattering feature calculation module and a shielding feature calculation module are introduced into the Transformer to extract interference features. Based on these interference features, ultraviolet weights, infrared weights, and interference spectral hazard values ​​are calculated. A net absorption spectrum is then generated and calculated based on Lambert-Beer's law. The concentration is compared with a danger threshold to determine whether to trigger an alarm.

[0007] When no alarm is required, the inherent coupling relationship in the gas parameters is considered. A pressure coupling model is constructed using a long short-term memory network to characterize the mapping relationship between the gas pressure change when migrating from the standard operating condition to any operating condition and the changes in the two operating conditions. The initial pressure threshold is corrected by calculating the gas temperature difference and instantaneous gas volume difference between the current operating condition and the standard operating condition. The pressure correction threshold of the current operating condition is generated and compared with the gas pressure to decide whether to open the valve.

[0008] Furthermore, to accurately eliminate oil mist, water vapor, and other pollutants in the casing gas... The impact of interfering components on concentration detection is addressed by using a Transformer network to remove and fuse spectral data, followed by calculations based on the Lambert-Beer law. Concentration, including the following steps:

[0009] Capturing low concentrations using ultraviolet spectroscopy sensors The strong absorption signal was detected, and an infrared spectral sensor was used to record water vapor. The characteristic absorption signals of interfering components are used to stack the collected ultraviolet and infrared spectral data into a three-dimensional tensor along the time dimension. A position encoding module is introduced to retain time series information. A scattering feature calculation module and a masking feature calculation module are connected to the output of the Transformer encoder. The encoder captures the global correlation of the spectral data through a multi-head attention mechanism, and then performs feature transformation through a feedforward neural network, outputting feature data containing global correlation information. The two feature calculation modules extract oil mist scattering interference features and water vapor, respectively, from this output. The interference features are masked. Based on the extracted interference features, the fusion weights of the ultraviolet and infrared spectra are calculated through an iterative optimization algorithm. The ultraviolet weight focuses on preserving... The high-sensitivity signal of the gas is used, and the infrared weighting is used to enhance the ability to identify interfering components. The fused spectrum is obtained by weighted summation of the two types of spectral data.

[0010] The extracted interference features are input into the prediction branch of the Transformer. This branch, by mining the correlation between the interference components and the target spectrum, and combining feature nonlinear transformation and dimensionality mapping, generates a quantifiable interference spectral hazard value. This interference spectral hazard value is subtracted from the fused spectrum to obtain the net absorption spectrum after interference removal. The target gas concentration is calculated using Lambert-Beer's law. The incident light intensity is obtained by a spectral intelligent sensor, and the negative logarithm of the ratio of the net absorption spectrum to the incident light intensity is used to obtain the absorbance, reflecting the degree of light absorption. This is then combined with pre-calibrated... The molar absorptivity and the optical path length of the detection cavity are calculated to obtain the result after eliminating the influence of interfering components. Concentration, where the molar absorptivity is a material property constant, calibrated through standard sample experiments, and the optical path length of the detection cavity is a fixed distance that light travels within the cavity.

[0011] Further, considering that there is strong internal coupling among gas pressure, instantaneous gas volume and gas temperature in the gas sampling system, the traditional fixed pressure threshold cannot adapt to dynamic working conditions, so a pressure coupling model is used to realize dynamic correction of the pressure threshold. The gas temperature difference and the instantaneous gas volume difference between the current working condition and the standard working condition defined by the initial pressure threshold are calculated, and the two difference values and the initial pressure threshold of the standard working condition are input into the pre-trained pressure coupling model, and the pressure correction threshold of the current working condition is generated through nonlinear mapping. When the instantaneous gas volume change value and / or the gas temperature change value exceeds the early warning value, the incremental training is started, and the pressure coupling model is updated using the gas sampling parameters of the current working condition.

[0012] Further, to cope with the working condition drift in the long-term operation of the gas sampling system, an online learning mechanism is introduced. The instantaneous gas volume change value and the gas temperature change value are obtained by calculating the absolute value of the difference between the instantaneous gas volume and the gas temperature at the current sampling time and the last sampling time. When any of the change values exceeds the preset warning value, the model incremental training is triggered. The incremental training includes:

[0013] The gas sampling parameters of the current working condition are appended to the historical data sequence in time sequence, and feature splicing is performed to form an updated training data set containing new working condition information, ensuring the time sequence continuity of the data;

[0014] The adaptive matrix estimation optimizer and the mean square error loss function used in the initial training of the model are followed, and the parameter fine-tuning of the pressure coupling model is performed according to the forward propagation algorithm to predict the value, the loss function algorithm to calculate the error, and the backward propagation algorithm to update the parameters;

[0015] The model performance is monitored in real time through the validation set. When the validation set loss of multiple consecutive training periods no longer decreases, the early stopping mechanism is triggered to stop training.

[0016] Further, based on the Mie scattering principle of oil mist particles, a scattering feature calculation module is designed. The oil mist particles in the gas sampling will cause Mie scattering of the ultraviolet spectrum, resulting in light path attenuation and signal distortion. To quantify this interference, the module divides the reference peak spectral intensity by the absorption peak spectral intensity of the ultraviolet spectrum as the scattering feature value, wherein the reference peak spectral intensity is obtained by selecting the spectral feature with the lowest correlation with oil mist concentration through principal component analysis.

[0017] Further, based on the characteristic absorption principle of water vapor and , a shielding feature calculation module is designed. Water vapor and have spectral intensity interference in the infrared spectrum range. When the concentration of water vapor and increases, the intensity of the corresponding peak will increase, thereby masking the spectral intensity signal of the gas, i.e., the shielding effect. The module takes the ratio of the reference peak spectral intensity to the absorption peak spectral intensity of the infrared spectrum as the shielding feature value. ​The intensity of the vibration peak spectrum is taken as a reference, and the ratio of the intensity of the vibration peak spectrum of water vapor to the intensity of the vibration peak spectrum of water vapor is taken as a shielding characteristic value. The intensity of the vibration peak spectrum is taken as a reference, and the ratio of the intensity of the vibration peak spectrum of water vapor to the intensity of the vibration peak spectrum of water vapor is taken as a shielding characteristic value. The intensity of the vibration peak spectrum is taken as a reference, and the ratio of the intensity of the vibration peak spectrum of water vapor to the intensity of the vibration peak spectrum of water vapor is taken as a shielding characteristic value. When the concentration increases, the molecule increases, and the shielding characteristic value rises.

[0018] Further, the core of the prediction branch is a multi-head attention layer. In order to comprehensively and accurately capture multiple types of interference characteristics, a scaled dot-product attention mechanism is used. In view of the problem that vector dot product of high-dimensional spectral data vector is easy to cause saturation of activation function, the scaling processing is performed on the vector dot product result, the numerical value is pulled back to the linear response region of the activation function, and the feature correlation strength distinction is strengthened, that is, the strong correlation interference and the weak correlation signal of background noise are clearly distinguished, so as to avoid model misjudgment. Through the multi-head parallel architecture, each attention head focuses on oil mist scattering, water vapor and Shielding different types of interference characteristics, interference information can be mined from multiple dimensions in parallel, and the outputs of each attention head are spliced and integrated into a comprehensive representation of global interference correlation and local interference details through linear transformation.

[0019] Further, the net absorption spectrum and the incident light intensity collected by the spectral intelligent sensor are obtained, the ratio of the net absorption spectrum to the incident light intensity is taken as the negative logarithm to obtain the absorbance, and the absorbance is divided by the product of the molar absorption coefficient and the optical path of the detection cavity to obtain The concentration.

[0020] Further, a long short-term memory network is used to construct a pressure coupling model, including the following steps:

[0021] The jacket gas parameters under different working conditions are collected in advance. The gas pressure is directly measured by a pressure sensor, the instantaneous gas volume is collected by a flow meter, and the gas temperature is recorded in real time by a temperature sensor. The collected data is filtered for abnormal values by using the Leuier criterion to ensure data quality.

[0022] The preprocessed jacket gas parameters are sorted in time sequence, and the gas temperature difference and the instantaneous gas volume difference between each collection time and the standard working condition are calculated based on the standard working condition time as a reference. The gas pressure of the standard working condition and the actual gas pressure of each collection time are recorded synchronously, and a training set is integrated and generated.

[0023] The training set is input into the long short-term memory network. The network processes the long-term dependence relationship of the time sequence data through the gating mechanism. The coupling characteristics at different levels are gradually extracted through the multi-layer network architecture. Then, the characteristics are mapped to the pressure prediction value through the full connection layer. In the training process, the minimum mean square error loss function is taken as the target, and the network parameters are iteratively updated through the adaptive moment estimation optimizer. Finally, the pressure coupling model with learnable parameter coupling relationship is obtained.

[0024] Furthermore, processing gas parameters using the Leytter criterion includes: calculating the mean and standard deviation of each gas parameter; when the difference between a data point and the mean is greater than three times the standard deviation, it is identified as an outlier and filtered out; outlier filtering is performed on gas pressure, instantaneous gas volume, and gas temperature parameters respectively.

[0025] Compared with the prior art, the significant advantages of this invention are:

[0026] 1. Ultraviolet and infrared spectral data are collected through a spectral intelligent sensor, and interference is eliminated using the Transformer algorithm, enabling… More accurate concentration calculations ensure reliable safety warnings and effectively protect production safety.

[0027] 2. Considering the coupling relationship between multiple parameters, the pressure threshold is corrected using a long short-term memory network to make the threshold more consistent with the actual working conditions, thereby improving the safety and rationality of gas recovery. Attached Figure Description

[0028] Figure 1 This is a flowchart of an intelligent monitoring method for gas recovery.

[0029] Figure 2 This is a flowchart of the ultraviolet and infrared spectral data fusion and interference removal process in this invention;

[0030] Figure 3 This is a flowchart of the pressure coupling model construction and threshold correction process in this invention;

[0031] Figure 4 This is a flowchart of the dynamic adjustment of pipe diameter based on PID control in this invention. Detailed Implementation

[0032] The present invention will be further described in detail below with reference to the accompanying drawings and embodiments.

[0033] like Figure 1 As shown, this invention discloses an intelligent monitoring method for jacket gas recovery, comprising the following steps:

[0034] Real-time acquisition of casing gas parameters, including gas pressure, instantaneous gas volume, and gas temperature, and analysis of the effects of other components in the casing gas on... To mitigate interference in concentration detection, a spectral intelligent sensor collects ultraviolet and infrared spectral data. Scattering feature calculation and masking feature calculation modules are then integrated after the Transformer encoding layer. After extracting interference features, the dual-spectral data are weighted and fused. A prediction branch is used to calculate the hazard value of the interference spectrum. After removing the hazard value from the fused spectral data, the net absorption spectrum is obtained. The Lambert-Beer law is then used to calculate... Concentration, through detection The concentration is used to determine whether to trigger a safety warning.

[0035] When there is no need for an alarm, based on the ideal gas state equation, considering the internal coupling correlation in the collected gas parameters, a long short-term memory network is used to construct a pressure coupling model to represent the mapping relationship between the gas pressure at the running time and the gas pressure, gas temperature difference, and instantaneous gas volume difference at the standard working condition time to quantify the internal coupling correlation of the gas parameters. The difference between the gas temperature and the instantaneous gas volume under the current working condition and the gas temperature and the instantaneous gas volume under the standard working condition is calculated to correct the initial pressure threshold value, generate a pressure correction threshold value that meets the current working condition, and compare it with the gas pressure to determine whether to open the valve. The standard working condition is the working condition defined when the initial pressure threshold value is preset.

[0036] When the valve is opened to recover the gas, an electrically controlled adjustable pipeline is used to dynamically adjust the diameter of the delivery pipeline according to the difference between the actual gas pressure and the pressure correction threshold value through a PID control algorithm to ensure smooth flow of the gas in the recovery pipeline.

[0037] Further, in the gas recovery process During the concentration detection process, the detection method based on single-band spectral data is difficult to effectively cope with complex interference environments. According to the Lambert-Beer law, the absorption degree of gas molecules to light of a specific wavelength is linearly related to their concentration. However, the presence of interference components in actual detection scenarios can severely affect detection accuracy. In the ultraviolet spectral range, Molecules have characteristic absorption peaks and a large absorption cross section for this gas, so they exhibit high sensitivity in low-concentration detection. However, ultraviolet spectra are susceptible to Mie scattering of oil mist particles, leading to attenuation of the optical path and increased background noise. In the presence of oil mist, the detection signal is prone to distortion. Infrared spectra have characteristic absorption fingerprints for interference components, including and water vapor, which can effectively identify and quantify the concentrations of these interference components. However, in the infrared spectral range the absorption coefficient is relatively low, and the absorption peaks are prone to spectral overlap with other sulfur-containing compounds, resulting in a decrease in the signal-to-noise ratio of the detection, making it difficult to achieve high-precision detection.

[0038] Due to the complexity of the gas composition, it usually contains oil mist and water vapor. These interference components have differential effects on different spectral bands. Oil mist particles cause additional absorbance in the ultraviolet spectrum, while the strong absorption of water vapor in the infrared band masks the characteristic signal. Therefore, a weight fusion method of ultraviolet and infrared spectral data is used to calculate the optimal weight coefficient of ultraviolet and infrared spectra in real time through a Transformer network with a multi-head attention mechanism, fully utilizing the advantages of ultraviolet spectra in The high sensitivity advantage in detection and the strong recognition ability of infrared spectrum to interference components, through the complementary processing of ultraviolet and infrared spectrum data, effectively suppress the influence of complex interference components on the detection result, significantly improve the concentration detection accuracy, meet the high-precision detection demand of the gas intelligent monitoring system.

[0039] As shown in Figure 2 , further, considering the influence of interference components on characteristic spectral data, the ultraviolet and infrared spectrum data are weighted and fused, and the spectral interference values are removed, and the accurate concentration is calculated combined with the Lambert-Beer law , and compared with the dangerous threshold value, safety warning is carried out, including the following steps:

[0040] Aiming at the problem that the oil mist, , water vapor interference components cause concentration detection deviation, the system integrates ultraviolet spectrum sensor and infrared spectrum sensor, installs them coaxially in the detection cavity of the gas sampling pipeline, controls the ultraviolet spectrum sensor to continuously scan absorption peak and reference peak, the ultraviolet spectrum can effectively capture strong absorption signal, at the same time, controls the infrared spectrum sensor to scan vibration peak, vibration peak and water vapor vibration peak, realizes the recording of interference component characteristic spectrum, and outputs the spectral data in real time, wherein the absorption peak spectral intensity of ultraviolet spectrum is recorded as , the reference peak spectral intensity is recorded as , the vibration peak spectral intensity of infrared spectrum is recorded as , the vibration peak spectral intensity is recorded as , and the water vapor vibration peak spectral intensity is recorded as ; ;

[0041] The collected ultraviolet spectrum data , and infrared spectrum data , , ​The data is stacked along the time dimension to form a three-dimensional tensor with batch, time step, and feature dimensions. This tensor serves as the input to the Transformer network. The batch dimension facilitates batch processing of data to improve training efficiency, the time step dimension records the changes in spectral data over time and captures dynamic information during the detection process, and the feature dimension contains spectral intensity information at different wavelengths. To enable the Transformer network to perceive the temporal order of the data, a position encoding module is introduced to incorporate position information into the input tensor, avoiding the loss of time series information during parallel computation, thereby ensuring that the network can effectively process dynamic spectral data.

[0042] A Transformer network based on a multi-head attention mechanism is used to capture potential correlations between spectral data in parallel, in order to realize the characteristics of oil mist scattering and water vapor. Targeted extraction of occlusion features involves two independent feature calculation modules following the output of the Transformer encoding layer. The encoding layer uses a multi-head attention mechanism and a feedforward neural network to extract and transform features from the input spectral data, obtaining an output containing globally correlated features. Subsequently, the feature data output from the encoding layer is transmitted to the two feature calculation modules respectively to process oil mist scattering features and water vapor... To quantify the shading characteristics, firstly, under gas detection conditions, the Mie scattering effect induced by oil mist particles significantly alters the spectral intensity distribution characteristics. The Transformer network, utilizing a multi-head attention mechanism, performs global feature analysis on the ultraviolet spectral data, accurately capturing the impact of oil mist on... To understand the role of spectral intensity and to quantitatively characterize the scattering effect, a feature calculation module is embedded after the Transformer encoding layer output. By comparing the spectral intensities of regions significantly affected by oil mist scattering with those of regions with weak scattering, the degree of oil mist scattering can be accurately measured. The calculation formula used to construct the scattering feature calculation module is shown below:

[0043] ,

[0044] in, These are scattering characteristic values ​​used to reflect the intensity of oil mist scattering. Characterization The intensity of the absorption peak spectrum shows a significant energy attenuation in this wavelength region due to oil mist scattering, and its intensity variation effectively reflects the influence of oil mist scattering. The reference peak spectral intensity was obtained by using principal component analysis to screen for the spectral feature with the lowest correlation to oil mist concentration, and then extracting it from that spectral feature. Because the reference peak's spectral intensity has the lowest correlation with oil mist concentration, It remains stable during changes in oil mist concentration, thereby enabling Can accurately reflect the oil mist scattering intensity

[0045] Similarly, the Transformer network identifies the masking features of water vapor and in the infrared spectrum data through the multi-head attention mechanism in the encoding layer, and clearly associates the masking features with characteristic spectrum, then inputs the global features output by the encoding layer into the masking feature calculation module, and through the quantitative calculation logic based on the feature correlation strength, further realizes the accurate quantification of the masking effect of the interference component on the detection signal, and the calculation formula used by the masking feature calculation module is as follows:

[0046] ,

[0047] Among them, is the masking feature value, reflecting the influence degree of the interference component on the detection signal, is the vibration peak spectrum intensity, which is used as a reference value to measure the influence degree of the interference on the target detection signal, represents the vibration peak spectrum intensity, represents the water vapor vibration peak spectrum intensity, and the dynamic change of and water vapor is directly related to the concentration fluctuation of water vapor, when the concentration of water vapor in the gas, increases, the intensity at the corresponding wavelength increases,

[0048] A prediction branch consisting of an attention layer and a fully connected layer is constructed after the encoding layer of the Transformer network. The attention layer employs a scaled dot product attention mechanism and includes three key components: a query vector, a key vector, and a value vector, generated by linear transformation of the output features from the encoding layer. The query vector is used to locate the current spectral feature, the key vector associates historical or cross-sensor spectral features, and the value vector carries the core information for interference assessment. During the attention calculation process, the vector dot product of high-dimensional spectral data is prone to producing numerically large values, causing the activation function to enter the saturation region. At this point, the numerical difference in the association strength between different features is compressed, meaning that the feature association strength discrimination is significantly reduced. Specifically, the feature association strength discrimination refers to the relationship between oil mist scattering features and water vapor masking features, and cross-sensor homogeneous features. The ability to discern the differences in the degree of correlation between features and heterogeneous interference is crucial for helping the model distinguish between strongly correlated interference and the target, and weakly correlated noise and the target. Activation function saturation can cause the strong correlation values ​​between water vapor shading features and oil mist scattering features to become nearly identical to the weak correlation values ​​between background noise features and target features, making it impossible for the model to distinguish between key interference and irrelevant noise. To address the issue of activation function saturation caused by the dot product of high-dimensional spectral data vectors, the dot product results are scaled back to the linear response region of the activation function, clearly preserving the numerical differences between strong and weak correlations. This effectively improves the discriminative power of feature correlation and enhances recognition accuracy. Furthermore, a multi-parallel attention head structure is employed, with each head focusing on oil mist scattering, water vapor, and... Different types of interference features, such as occlusion and cross-sensor feature ratio changes, are combined by concatenating the outputs of each sensor and integrating them into a comprehensive representation of global and local features through linear transformation. This enables accurate mining of multi-dimensional interference features and improves adaptability to complex interference scenarios. The subsequent two fully connected layers perform feature transformation using the ReLU activation function in the first layer to enhance the model's non-linear expressive ability, and use linear transformation to complete dimensionality mapping, converting high-dimensional features into numerical values ​​of interference severity. The final output is the predicted spectral hazard value of the interference. During the training process, historical spectral data with labeled interference spectral hazard values ​​are used to train together with the main network through the backpropagation algorithm to optimize the parameters of the prediction branch.

[0049] Constructing a composite loss function The loss function, used to guide weight optimization and prediction branch training, is expressed as follows:

[0050] ,

[0051] in, Mean squared error, used to measure the net absorption spectrum predicted by the model. Compared with the true net absorption spectrum The overall deviation between the two, which intuitively reflects the accuracy of the model output net absorption spectrum, wherein the true net absorption spectrum is obtained by detecting a bagged sample with known components and concentrations and then subtracting the interference, and the model predicted net absorption spectrum is based on the input spectral data , the result output after the feature extraction of the Transformer network, full connection layer calculation and spectral fusion, is a hyperparameter used to adjust the importance of each part in the composite loss function, and the initial value is set according to prior knowledge at the beginning of training, and the Bayesian optimization algorithm is used to optimize the hyperparameters in subsequent training, is used to constrain the oil mist scattering feature, wherein, is a pre-set feature threshold value representing the standard value of the oil mist scattering feature under ideal working conditions, is the actual scattering feature value detected by the model, and the oil mist scattering feature constraint strength is adjusted by the hyperparameter When the model detects the oil mist scattering feature deviating from the standard value, the oil mist scattering feature constraint term will produce a corresponding penalty, The greater the value, the greater the penalty for deviating from the standard value, so as to balance the influence of oil mist scattering factor on model training and ensure the accuracy of the model in oil mist scattering feature detection, The role of is to constrain the shielding feature, which is similar to the oil mist scattering feature constraint, is the standard value of the shielding feature under ideal working conditions, is the actual shielding feature value detected by the model, and the shielding feature constraint strength is adjusted by the hyperparameter When the model output shielding feature deviates from the standard value, the shielding feature constraint term will give a corresponding penalty, thereby constraining the rationality of the shielding feature and making the model more in line with the actual situation in shielding feature detection, is used to optimize the prediction of the interference spectrum hazard value, is also the mean square error, which is used to measure the deviation between the model predicted interference spectrum hazard value data and the true interference spectrum hazard value data , is used to adjust the importance of interference spectrum hazard value prediction in the entire loss function;

[0052] The random gradient descent algorithm is used to iteratively update the fusion weight parameters, and the loss function is calculated with respect to the infrared spectrum fusion weight , the ultraviolet spectrum fusion weight , , The weight parameters are updated in the opposite direction of the gradient, and the calculation formula is as follows:

[0053] ,

[0054] ,

[0055] wherein, is the learning rate, controlling the step size of each parameter update, the learning rate is gradually reduced with the increase of training rounds through the learning rate decay strategy, , is the calculated value of the previous weight update, when the weight update is first performed, the value is a randomly initialized value, and after the training is completed, the infrared spectrum fusion weight and the ultraviolet spectrum fusion weight are obtained ; ;

[0056] The latest weight obtained according to the training of the Transformer is used to calculate the fused spectrum data, and by deducting the predicted interference spectrum hazard value , the net absorption spectrum is obtained , and the calculation formula of the net absorption spectrum is as follows:

[0057] ,

[0058] wherein, is the output net absorption spectrum, and are the infrared spectrum fusion weight and the ultraviolet spectrum fusion weight respectively, is the predicted interference spectrum hazard value;

[0059] According to the Lambert-Beer law , wherein is the absorbance, used to measure the degree of absorption of light after passing through the medium, is the molar absorption coefficient, which is a characteristic constant of the substance, reflecting the absorption ability of the substance to the light of a specific wavelength, is the concentration of the substance, is the optical path, which is the distance of light propagation in the detection cavity, and according to the net absorption spectrum , the absorbance can be calculated, and the calculation formula is as follows:

[0060] ,

[0061] wherein, is the incident light intensity, obtained by the intelligent spectrum sensor, combined with the pre-calibrated molar absorption coefficient , the optical path of the detection cavity , the concentration excluding the influence of the interference component can be calculated, and the calculation formula is as follows: ​

[0062] ;

[0063] The calculated concentration is compared with a preset danger threshold value, and when the concentration is greater than or equal to the danger threshold value, a safety warning is triggered, and a safety control device is started. The concentration is compared with a preset danger threshold value, and when the concentration is greater than or equal to the danger threshold value, a safety warning is triggered, and a safety control device is started.

[0064] As shown in Figure 3 , further, for the coupling relationship between the gas pressure and the instantaneous gas volume, the gas temperature and the gas components in the actual working condition of the sleeve gas, a long short-term memory network algorithm is used to construct a pressure coupling model, including the following steps:

[0065] The historical gas pressure, instantaneous gas volume and gas temperature data under different working conditions are collected, wherein the gas pressure is directly measured by a pressure sensor, the instantaneous gas volume is obtained by a flow meter, and the gas temperature is collected in real time by a temperature sensor;

[0066] The data is processed for abnormal values by using the Leuier criterion, and the mean value and the standard deviation of each parameter data are calculated first. For the gas pressure data, if the difference between one data point and the mean value of the pressure is greater than three times the standard deviation of the pressure, that is, when is satisfied, it is determined that the data point is a jump abnormal value caused by equipment failure or sensor abnormality, and is rejected. Similarly, the instantaneous gas volume and the gas temperature data are processed, and the abnormal values are rejected.

[0067] The preprocessed sleeve gas parameters are sorted in time sequence, and the standard working condition time is taken as the reference. The gas temperature , the instantaneous gas volume at the standard working condition time are respectively subtracted from the gas temperature , the instantaneous gas volume at each collection time, to obtain a plurality of groups of gas temperature differences , instantaneous gas volume differences , and the gas pressure at the standard working condition time and the gas pressure at each collection time are recorded, and a training set is generated by integration.

[0068] ​​The training set is input into a long short-term memory network algorithm to construct a stress coupling model. The long short-term memory neural network processes long-term dependencies in time series data through a gating mechanism, and gradually extracts different levels of features in the data through a multi-layer architecture. These features are mapped to the final output through a fully connected layer. In the training stage, the adaptive matrix estimator optimizer is used to optimize the network parameters. The first and second moment estimates of the gradient are calculated to dynamically adjust the learning rate for each parameter, and the updated parameters The formula is as follows:

[0069] ,

[0070] ,

[0071] ,

[0072] ,

[0073] ,

[0074] wherein, is the first moment estimate of the gradient at the current time , used to record the average direction of the gradient, is the first moment estimate of the gradient at the previous time , the decay coefficient of the first moment estimate controls the weight of historical gradient information in the current first moment estimate, is the gradient at the current time , reflecting the change rate of the loss function under the current parameters, is the second moment estimate of the gradient at the current time , used to measure the size of the gradient, is the second moment estimate of the gradient at the previous time , is the decay coefficient of the second moment estimate, which determines the proportion of historical gradient square information in the current second moment estimate, is the first moment estimate after bias correction, wherein is the decay coefficient raised to the power of , used to eliminate the bias caused by in the early stage of first moment estimate training, is the second moment estimate after bias correction, is the decay coefficient raised to the power of , used to eliminate the bias caused by in the early stage of second moment estimate training, is the network parameter at the current time, For the updated network parameters, The learning rate controls the step size for parameter updates. This is a very small constant used to prevent the denominator from being zero, ensuring computational stability. The loss function uses the mean squared error, and its mathematical expression is as follows:

[0075] ,

[0076] in, For the sample size, Indicates the first The actual gas pressure value of each sample Indicates the first Based on the gradient descent principle, the predicted gas pressure values ​​of each sample are continuously optimized by minimizing the mean square error. This enables the learning of the nonlinear mapping relationship between the gas pressure at the operating time and the standard operating pressure, gas temperature difference, and instantaneous gas volume difference. This mapping relationship accurately describes the coupling characteristics between pressure, temperature, and flow parameters within the gas-jacking system. The pressure coupling model expression is shown below:

[0077] ,

[0078] in, This is the pressure correction threshold, i.e., the corrected pressure threshold. The initial pressure threshold, This is the difference between the gas temperature under the current operating conditions and the standard operating temperature when the threshold is set. This is the difference between the instantaneous gas volume under the current operating conditions and the instantaneous gas volume under the standard operating conditions when the threshold is set. This represents the nonlinear functional relationship learned by the Long Short-Term Memory Network. Through training with historical data, this function can quantify the intrinsic coupling correlation of gas sleeting parameters.

[0079] When real-time data is input, the difference between the gas temperature and instantaneous gas volume at the current moment and the initial pressure threshold under standard operating conditions is calculated. This difference, along with the initial pressure threshold, is then input into the trained pressure coupling model. Based on the learned coupling relationship, the model outputs a pressure correction threshold that conforms to the current operating conditions. To further improve the model's adaptability, an online learning mechanism is introduced. This mechanism calculates the difference in instantaneous gas volume and temperature between the current sampling moment and the previous sampling moment, and takes their absolute values ​​to obtain the instantaneous gas volume change and gas temperature change, respectively. When the instantaneous gas volume change and / or gas temperature change exceed preset gas volume warning values ​​and / or temperature warning values, incremental training of the model is triggered. Real-time gas exchange parameters are fused with historical data saved during model training to form an updated training dataset. The adaptive moment estimation optimizer and mean squared error loss function from the original training are used. The pressure coupling model is fine-tuned by following the process of forward propagation to calculate predicted values, calculating errors based on the loss function, and backpropagation to propagate errors and update network parameters. At the same time, an early stopping strategy is introduced. The model performance is monitored through the validation set. When the loss on the validation set no longer decreases, training is stopped in time to ensure that the pressure coupling model maintains good generalization ability while adapting to new data. By continuously learning the constantly changing parameter relationships in the gas exchange system, the pressure coupling model is adaptively updated to better reflect actual working conditions and improve the accuracy and reliability of gas exchange detection and analysis.

[0080] like Figure 4 As shown, furthermore, in the jacket gas recovery process, an electrically controlled adjustable pipeline is adopted. By constructing an adaptive adjustment system based on a PID control algorithm, the dynamic response of the recovery pipeline diameter to real-time gas pressure changes is realized, ensuring smooth flow of the jacket gas in the recovery pipeline. This includes the following steps:

[0081] During crude oil extraction, when the pressure inside the casing exceeds a pressure threshold, the valve connecting the casing and the recovery pipeline opens, initiating the casing gas recovery process. At this time, the pressure sensor installed on the casing collects the gas pressure in real time. And combined with gas pressure correction threshold Calculate pressure deviation The calculation formula is as follows:

[0082] ;

[0083] After obtaining the pressure deviation, a dynamic adjustment mechanism for the pressure deviation is constructed through three independent but coordinated control links of the PID controller: proportional, integral, and derivative. The proportional link adjusts the pressure deviation based on the pressure deviation. As a control input, the proportional coefficient is precisely tuned using the critical proportionality method. , build linear control law, through the proportional coefficient the pressure deviation is amplified or reduced to realize linear transformation of the pressure deviation, which directly determines the state of the control input and further affects the regulation behavior of the control system, realizing preliminary dynamic regulation of the diameter of the recovery pipeline. The integral element effectively eliminates the steady-state error of the system by performing time accumulation operation on the historical pressure deviation. Specifically, the integral coefficient is optimized by trial and error, that is, during the operation of the system, the pressure control effect is continuously adjusted according to the numerical value until the pressure is stable within the allowable error range of the target value, and the calculation formula is In the formula, represents the cumulative integral of the pressure deviation over time from the initial time 0 to the current time , which reflects the cumulative error state of the system over a period of time, The integral coefficient weights and amplifies this cumulative error, and the value determines the response strength of the integral element to the cumulative error. As time goes on, even a small long-term deviation will continue to accumulate in the integral operation, The value will continue to change, driving the regulating mechanism to act and gradually correct the deviation, ensuring that the system is stable over a long period of time. The derivative element monitors the rate of change of the pressure deviation and predicts the trend of pressure fluctuations in advance. The derivative coefficient is determined using the Ziegler-Nichols method, which calculates the parameters in combination with the open-loop characteristics of the system, and the formula describes the rate of change of the pressure deviation over time, that is, the instantaneous change speed of the pressure deviation, which reflects the trend of pressure fluctuations, The output of the derivative element can intervene before the pressure changes significantly, where as the derivative coefficient, determines the degree of influence of the rate of change of the pressure deviation on the control output. When the rate of change of the pressure deviation is detected to increase, it means that the pressure may soon fluctuate by a large amplitude, at which time will quickly output a reverse regulation signal to suppress the pressure mutation. By weighting and superimposing the outputs of the three elements, the regulation signal is formed, and its expression is as follows:

[0084] ,

[0085] The regulation signal As the control instruction of the actuator, according to the pressure deviation size and change trend, the accurate adjustment of the recovery pipeline diameter is realized, the pressure balance of the whole recovery process is maintained while the sleeve gas conveying flow is stable, and the sleeve gas leakage hidden danger during recovery is reduced.

[0086] The application discloses an intelligent monitoring method for sleeve gas recovery, which collects gas pressure, instantaneous gas volume and gas temperature in real time, and adopts a spectrum intelligent sensor to collect ultraviolet spectrum data and infrared spectrum data. In view of the interference of other components in the sleeve gas on concentration detection, a scattering feature calculation module and a water vapor and shielding feature calculation module are constructed in the Transform, and an interference prediction branch is additionally added. After the weight fusion of the ultraviolet and infrared spectrum data and the elimination of interference spectrum hazard values, the concentration is calculated in combination with the Lambert-Beer law to make a decision on safety warning. Considering the internal coupling correlation of gas pressure, instantaneous gas volume and gas temperature, a pressure coupling model is constructed by using a long short-term memory network to correct the pressure threshold value, and the valve opening and closing are controlled by comparing the actual gas pressure with the corrected threshold value. During the sleeve gas recovery, an electrically controlled adjustable pipeline is used to dynamically adjust the conveying pipeline diameter according to the difference between the actual gas pressure and the corrected threshold value through a PID control algorithm, so that the sleeve gas detection accuracy and system safety are effectively improved.

[0087] The above is only the preferred embodiment of the application, and the protection scope of the application is not limited to the above examples only. Any technical solution falling within the idea of the application shall fall within the protection scope of the application. It should be noted that, for ordinary skilled persons in the technical field, some improvements and decorations without departing from the principles of the application shall also be considered as the protection scope of the application.

Claims

1. An intelligent monitoring method for gas recovery, characterized in that, Includes the following steps: Real-time acquisition of gas parameters, including gas pressure, instantaneous gas volume, and gas temperature, is performed. Ultraviolet and infrared spectral data are collected using a spectral intelligent sensor. A scattering feature calculation module and a shielding feature calculation module are introduced into the Transformer to extract interference features. Based on these interference features, ultraviolet weights, infrared weights, and interference spectral hazard values ​​are calculated. A net absorption spectrum is then generated and calculated based on Lambert-Beer's law. The concentration is compared with a danger threshold to determine whether to trigger an alarm. When no alarm is required, the inherent coupling relationship in the gas parameters is considered. A pressure coupling model is constructed using a long short-term memory network to characterize the mapping relationship between the gas pressure change when migrating from the standard operating condition to any operating condition and the changes in the two operating conditions. The initial pressure threshold is corrected by calculating the gas temperature difference and instantaneous gas volume difference between the current operating condition and the standard operating condition. The pressure correction threshold of the current operating condition is generated and compared with the gas pressure to decide whether to open the valve. Among them, the interference effect is quantified based on the Mie scattering principle of oil mist particles, and a scattering characteristic calculation module is designed to... The scattering characteristic value is obtained by dividing the absorption peak spectral intensity by the reference spectral intensity. The reference peak spectral intensity is obtained by selecting the spectral feature with the lowest correlation to oil mist concentration through principal component analysis and then extracting it from that spectral feature. Based on water vapor and Based on the principle of feature absorption, the influence of interference is quantified, and a masking feature calculation module is designed to... The sum of the spectral intensity of the vibration peak and the spectral intensity of the water vapor vibration peak divided by The spectral intensity of the vibration peak is used to obtain the masking characteristic value; The net absorption spectrum was obtained using the Transformer, and calculations were performed using Lambert-Beer's law. Concentration calculation includes: inputting scattering feature calculation module and occlusion feature calculation module after the encoder output of Transformer to extract interference features, iteratively calculating ultraviolet weight and infrared weight, and weighted summing ultraviolet and infrared spectral data to obtain fused spectrum; inputting interference features into prediction branch to mine the correlation of spectral features of interference components and using feature transformation and dimensional mapping to generate interference spectral hazard value; subtracting interference spectral hazard value from fused spectrum to generate net absorption spectrum; and combining Lambert-Beer law, molar absorptivity and optical path length of detection cavity to calculate... concentration.

2. The intelligent monitoring method for gas recovery as described in claim 1, characterized in that, Considering the inherent coupling relationship between the gas exchange parameters, the pressure threshold is corrected by inputting the gas temperature difference, instantaneous gas volume difference, and initial pressure threshold of the standard operating condition into the pressure coupling model. The pressure correction threshold for the current operating condition is generated through nonlinear mapping. When the instantaneous gas volume change and / or gas temperature change exceed the warning value, incremental training is initiated to update the pressure coupling model using the gas exchange parameters of the current operating condition.

3. The intelligent monitoring method for gas recovery as described in claim 2, characterized in that, Incremental training includes: appending the gas parameters collected under the current operating conditions to the historical data sequence in a time series manner, and performing feature concatenation to form an updated training dataset; using the adaptive moment estimation optimizer and mean squared error loss function to fine-tune the parameters of the pressure coupling model; and triggering an early stopping mechanism to stop training when the validation set loss no longer decreases.

4. The intelligent monitoring method for gas recovery as described in claim 1, characterized in that, The prediction branch includes a multi-head attention layer, which introduces a scaled dot product attention mechanism. By scaling the vector dot product results, the discriminative strength of feature associations is enhanced. Simultaneously, a multi-head parallel architecture focuses on oil mist scattering, water vapor, and... Different types of interference features are masked, and the outputs of each head are spliced ​​together and integrated into a comprehensive representation of global and local interference features through linear transformation.

5. The intelligent monitoring method for gas recovery as described in claim 1, characterized in that, The net absorption spectrum and the incident light intensity collected by the intelligent spectral sensor are obtained. The negative logarithm of the ratio of the net absorption spectrum to the incident light intensity is taken to obtain the absorbance. The absorbance is then divided by the product of the molar absorptivity and the optical path length of the detection cavity to obtain the... concentration.

6. The intelligent monitoring method for gas recovery as described in claim 2, characterized in that, The stress-coupled model is constructed using a long short-term memory network, including the following steps: Pre-collect gas parameters under different operating conditions and process the gas parameters using the Leytter criterion to filter out abnormal gas parameters; Using the standard operating condition time as a benchmark, calculate the gas temperature difference and instantaneous gas volume difference between the operating condition and the standard operating condition at each sampling time, record the gas pressure at each sampling time and the standard operating condition time, and integrate them to generate a training set. A long short-term memory network was trained using the training set to obtain a pressure coupling model.

7. The intelligent monitoring method for gas recovery as described in claim 6, characterized in that, The process of processing gas parameters using the Leytter criterion includes: calculating the mean and standard deviation of each gas parameter; when the difference between a data point and the mean is greater than three times the standard deviation, it is determined to be an outlier and filtered out; and outlier filtering is performed on the gas pressure, instantaneous gas volume, and gas temperature parameters respectively.

Citation Information

Patent Citations

  • Detection and analysis system for oil-control soothing extract

    CN120043983A

  • Anode protection device for bringing oil pipe into sleeve

    CN211142182U