Intelligent monitoring method for sleeve gas recovery

By eliminating interference through a spectral intelligent sensor and the Transformer algorithm, and correcting the pressure threshold using a long short-term memory network, the problem of unreasonable concentration detection and pressure thresholds in jacket gas recovery is solved, achieving high-precision and stable jacket gas recovery monitoring.

CN120847014AActive Publication Date: 2025-10-28XIAN SHAN CHUAN PETROLEUM TECH CO LTD

Patent Information

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

AI Technical Summary

Technical Problem

In existing gas recovery monitoring technologies, concentration detection is severely affected by interference, and the pressure threshold is set unreasonably, resulting in large deviations in 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

This improves the accuracy of concentration detection and the adaptability of pressure thresholds, ensures the safety and rationality of gas recovery, and enhances the reliability and adaptability of the monitoring system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120847014A_ABST
    Figure CN120847014A_ABST
Patent Text Reader

Abstract

The invention discloses an intelligent monitoring method for casing gas recovery, and relates to the technical field of casing gas detection and analys.The method comprises the steps that casing gas parameters including gas pressure, instantaneous gas volume and gas temperature are collected in real time, and spectrum data are collected through ultraviolet and infrared spectrum sensors; a scattering feature calculation module and a shielding feature calculation module are introduced into a Transformer network, oil mist scattering interference features and shielding interference features are extracted, weight fusion is performed on ultraviolet and infrared spectrum data, interference spectrum hazard values are eliminated, a net absorption spectrum is generated, and concentration is calculated in combination with the Lambert-Beer law to perform safety early warning. Coupling between casing gas parameters is considered, and a long-short-term memory network is adopted to construct a pressure coupling model to correct a pressure threshold value; and the electric control adjustable pipeline is controlled through a PID algorithm to dynamically adjust the drift diameter, so that precise monitoring, safe early warning and stable recovery of the sleeve gas are realized.
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 purpose 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] Furthermore, considering the strong inherent coupling between gas pressure, instantaneous gas volume, and gas temperature in the gas-jacking system, the traditional fixed pressure threshold cannot adapt to dynamic operating conditions. Therefore, a pressure coupling model is adopted to achieve dynamic correction of the pressure threshold. Taking the standard operating condition defined when the initial pressure threshold is preset as a reference, the gas temperature difference and instantaneous gas volume difference between the current operating condition and the standard operating condition are calculated. These two differences are then input into the pre-trained pressure coupling model along with the initial pressure threshold of the standard operating condition. 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-jacking parameters of the current operating condition.

[0012] Furthermore, to address the operational condition drift during long-term operation of the gas exchange system, an online learning mechanism is introduced: The instantaneous gas volume and temperature changes are obtained by calculating the absolute value of the difference between the instantaneous gas volume and temperature at the current sampling time and the previous sampling time. When either change exceeds a preset warning value, incremental model training is triggered. Incremental training includes:

[0013] The gas parameters collected under the current operating conditions are appended to the historical data sequence according to the time series, and features are spliced ​​to form an updated training dataset containing information on the new operating conditions, so as to ensure the temporal continuity of the data.

[0014] Using the adaptive moment estimator optimizer and mean squared error loss function from the initial model training, the parameters of the pressure coupling model are fine-tuned according to the process of forward propagation to calculate the predicted value, loss function to calculate the error, and backpropagation to update the parameters.

[0015] The model performance is monitored in real time using the validation set. When the validation set loss no longer decreases over several consecutive training cycles, an early stopping mechanism is triggered to stop training.

[0016] Furthermore, based on the Mie scattering principle of oil mist particles, the interference effect is quantified, and a scattering characteristic calculation module is designed. Oil mist particles in the gas will produce Mie scattering on the ultraviolet spectrum, leading to optical path attenuation and signal distortion. To quantify this interference, the module will quantify the interference caused by the oil mist particles in the gas. The ratio of the absorption peak spectral intensity to the reference peak spectral intensity is used as the scattering characteristic value. 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.

[0017] Furthermore, based on water vapor and The characteristic absorption principle quantifies the interference effect, and a shading feature calculation module is designed to calculate water vapor and... In the infrared spectral region, there is spectral intensity interference. As the concentration of this interference increases, the intensity of the corresponding peak is enhanced, thereby masking the interference. The module uses the spectral intensity signal of the gas, i.e., the masking effect. Using the spectral intensity of the vibration peak as a reference, The sum of the spectral intensity of the vibration peak and the spectral intensity of the water vapor vibration peak divided by The vibration peak spectral intensity is used to obtain the shading characteristic value. When water vapor, As the concentration increases, the molecular size increases, and the masking characteristic value increases accordingly.

[0018] Furthermore, the core of the prediction branch is a multi-head attention layer. To comprehensively and accurately capture various types of interference features, a scaled dot product attention mechanism is adopted. Addressing the issue that the dot product of high-dimensional spectral data vectors easily leads to activation function saturation, the dot product results are scaled to pull the values ​​back into the linear response region of the activation function, enhancing the discriminative strength of feature associations. This clearly distinguishes between strongly correlated interference and weakly correlated signals of background noise, avoiding model misjudgment. The multi-head parallel architecture allows each attention head to focus on oil mist scattering, water vapor, and... Different types of occlusion features can be used to mine interference information in parallel from multiple dimensions. The outputs of each attention point are spliced ​​together and integrated into a comprehensive representation of global interference correlation and local interference details through linear transformation.

[0019] Furthermore, the net absorption spectrum and the incident light intensity collected by the spectral intelligent 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... concentration.

[0020] Furthermore, a pressure coupling model is constructed using a long short-term memory network, including the following steps:

[0021] Gas parameters under different operating conditions are collected in advance. Gas pressure is directly measured by a pressure sensor, instantaneous gas volume is collected by a flow meter, and gas temperature is recorded in real time by a temperature sensor. The Leytter criterion is used to filter out outliers in the collected data to ensure data quality.

[0022] The preprocessed gas parameters are sorted by time series. Based on the standard operating condition time, the gas temperature difference and instantaneous gas volume difference between each acquisition time and the standard operating condition are calculated. The gas pressure at the standard operating condition time and the actual gas pressure at each acquisition time are recorded simultaneously and integrated to generate a training set.

[0023] The training set is input into a long short-term memory network. The network processes the long-term dependencies of time series data through a gating mechanism. Through a multi-layer network architecture, coupling features at different levels are extracted step by step. Then, the features are mapped to stress prediction values ​​through a fully connected layer. During training, the goal is to minimize the mean squared error loss function. The network parameters are iteratively updated through an adaptive moment estimator optimizer. Finally, a stress coupling model with learnable parameter coupling relationships is obtained.

[0024] Furthermore, the Leytter criterion is used to process the gas parameters, including: 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 judged as an outlier and filtered out; outlier filtering is performed on the 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 a safety warning is triggered;

[0035] When no alarm is required, based on the ideal gas law, considering the inherent coupling correlation in the collected gas parameters, a pressure coupling model is constructed using a long short-term memory network to characterize the mapping relationship between the gas pressure at the operating time and the gas pressure, gas temperature difference, and instantaneous gas volume difference at the standard operating time, thereby quantifying the inherent coupling correlation of the gas parameters. The initial pressure threshold is corrected by calculating the difference between the gas temperature and instantaneous gas volume under the current operating condition and the gas temperature and instantaneous gas volume under the standard operating condition. A pressure correction threshold that conforms to the current operating condition is generated and compared with the gas pressure to decide whether to open the valve. Here, the standard operating condition is the operating condition defined when the initial pressure threshold is preset.

[0036] When the valve is opened to recover the jacket gas, an electrically controlled adjustable pipeline is used. Based on the difference between the actual gas pressure and the pressure correction threshold, the diameter of the delivery pipeline is dynamically adjusted through a PID control algorithm to ensure that the jacket gas flows smoothly in the recovery pipeline.

[0037] Furthermore, in the case of gas slinging During concentration detection, methods based on single-band spectral data struggle to effectively handle complex interference environments. According to Beer-Lambert's law, the absorption of light at a specific wavelength by gas molecules is linearly related to their concentration. However, in real-world detection scenarios, the presence of interfering components can severely impact detection accuracy, especially in the ultraviolet spectral range. The molecules exhibit characteristic absorption peaks, resulting in a large absorption cross-section for this gas; therefore, at low concentrations... The detection exhibits high sensitivity; however, the ultraviolet spectrum is susceptible to Mie scattering from oil mist particles, leading to optical path attenuation and increased background noise. In the presence of oil mist, the detection signal is prone to distortion. Infrared spectroscopy, on the other hand, is less sensitive to interfering components, including… Water vapor possesses a characteristic absorption fingerprint, which can effectively identify and quantify the concentration of these interfering components, but in the infrared spectrum... The absorption coefficient is relatively low, and the absorption peak easily overlaps with the spectra of other sulfur-containing compounds, leading to... The signal-to-noise ratio of the detector is reduced, making it difficult to achieve high-precision detection;

[0038] Because the composition of the casing gas is complex, it usually contains both oil mist and... Water vapor and other interfering components have different effects on different spectral bands. Oil mist particles will add absorbance to the ultraviolet spectrum, while the strong absorption of water vapor in the infrared band will mask the light. Therefore, a weighted fusion method of ultraviolet and infrared spectral data is adopted, using a Transformer network with a multi-head attention mechanism to calculate the optimal weight coefficients of ultraviolet and infrared spectra in real time, making full use of the characteristic signals of ultraviolet spectrum. The high sensitivity of the detector and the strong ability of infrared spectroscopy to identify interfering components, through complementary processing of ultraviolet and infrared spectral data, effectively suppress the influence of complex interfering components on the detection results, significantly improving the detection efficiency. The concentration detection accuracy meets the high-precision detection requirements of the intelligent gas monitoring system.

[0039] like Figure 2 As shown, further considering the influence of interfering components on the characteristic spectral data, the ultraviolet and infrared spectral data are weighted and fused, and spectral interference values ​​are removed. The results are then calculated using the Lambert-Beer law. The precise concentration is determined and compared with the danger threshold to issue a safety warning, including the following steps:

[0040] For oil mist in the air, Water vapor interference components lead to To address the issue of concentration detection deviation, the system integrates an ultraviolet (UV) spectral sensor and an infrared (IR) spectral sensor, coaxially mounted within the detection chamber of the gas sampling pipeline. The UV spectral sensor is controlled to... By continuously scanning the absorption peak and reference peak, ultraviolet spectroscopy can effectively capture... Strong absorption signal, while controlling the infrared spectral sensor in Vibration peak, Vibrational peaks and water vapor vibrational peaks are scanned to record the characteristic spectra of interfering components and output spectral data in real time, including ultraviolet spectra. The spectral intensity of the absorption peak is denoted as The reference peak spectral intensity is denoted as Infrared spectrum The spectral intensity of the vibration peak is denoted as , The spectral intensity of the vibration peak is denoted as The spectral intensity of the water vapor vibration peak is denoted as ;

[0041] The collected ultraviolet spectral data , and infrared spectral 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 It can accurately reflect the intensity of oil mist scattering;

[0045] Similarly, the Transformer network identifies water vapor and other components in infrared spectral data through a multi-head attention mechanism in the encoding layer. The occlusion characteristics, and clearly define the occlusion characteristics and The correlation between characteristic spectra is then analyzed, and the global features output from the coding layer are input into the masking feature calculation module. Through quantization calculation logic based on feature correlation strength, the interference component pair is then realized. The calculation formula used to accurately quantify the signal masking effect and construct the masking feature calculation module is shown below:

[0046] ,

[0047] in, These are masking characteristic values, reflecting the degree of influence of interfering components on the detection signal. for The spectral intensity of the vibration peak, used as a benchmark reference value, is employed to measure the degree of influence of interference on the target detection signal. represent Vibration peak spectral intensity Indicates the spectral intensity of the water vapor vibration peak. and The dynamic changes are directly related And the concentration fluctuations of water vapor, when the water vapor in the jacket gas, When the concentration increases, the corresponding wavelength , Increased strength The value also increases accordingly, clearly reflecting the increased interference;

[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 directly reflects the accuracy of the model's output net absorption spectrum. The true net absorption spectrum is obtained by detecting gas samples with known components and concentrations and then subtracting interference, while the net absorption spectrum predicted by the model is based on the input spectral data. The output result after feature extraction by the Transformer network, calculation by the fully connected layer, and spectral fusion. These are hyperparameters used to adjust the importance of different components in the composite loss function. Initial values ​​are set based on prior knowledge during the initial training phase, and Bayesian optimization algorithms are used to optimize these weight coefficients during subsequent training. Used to constrain oil mist scattering characteristics, where It is a pre-set feature threshold, representing the standard value of oil mist scattering characteristics under ideal working conditions. The actual scattering feature values ​​detected by the model are obtained through hyperparameters. Adjusting the constraint strength of oil mist scattering characteristics, when the oil mist scattering characteristics detected by the model deviate from the standard value, the oil mist scattering characteristic constraint term will generate a corresponding penalty. The larger the value, the stronger the penalty for deviations from the standard value. This balances the impact of oil mist scattering factors on model training, ensuring the model's accuracy in detecting oil mist scattering features. Its function is to constrain masking features, similar to the constraint of oil mist scattering features. It is the standard value of the shading characteristic under ideal working conditions. The actual detected occlusion feature values ​​are obtained through hyperparameters. The strength of the occlusion feature constraint is adjusted. When the occlusion features output by the model differ from the standard values, the occlusion feature constraint term will impose a corresponding penalty, thereby constraining the reasonableness of the occlusion features and making the model more consistent with reality in occlusion feature detection. Used to optimize the prediction of hazard values ​​for interfering spectra. Similarly, mean squared error is used to measure the spectral hazard value of interference predicted by the model. Compared with actual interference spectral hazard values ​​data The deviation between them Used to adjust the importance of interference spectral hazard value prediction in the overall loss function;

[0052] The stochastic gradient descent algorithm is used to iteratively update the fusion weight parameters, and the loss function is calculated. Regarding infrared spectral fusion weights Ultraviolet spectral fusion weights gradient , The weight parameters are updated along the opposite direction of the gradient, and the calculation formula is shown below:

[0053] ,

[0054] ,

[0055] in, The learning rate controls the step size of each parameter update. A learning rate decay strategy is used to gradually decrease the learning rate as the number of training epochs increases. , This is the calculated value from the previous weight update. During the first weight update, this value is randomly initialized. After training, the infrared spectral fusion weights are obtained. Weighting of fusion with ultraviolet spectroscopy ;

[0056] The fused spectral data is calculated based on the latest weights obtained from Transformer training, and the predicted spectral hazard values ​​are subtracted. The net absorption spectrum was obtained. The formula for calculating the net absorption spectrum is as follows:

[0057] ,

[0058] in, The output net absorption spectrum, and These are the infrared spectral fusion weights and the ultraviolet spectral fusion weights, respectively. The predicted spectral hazard value of the interference;

[0059] According to Lambert-Beer's Law ,in Absorbance is a measure of the degree to which light is absorbed after passing through a medium. ν is the molar absorptivity, a characteristic constant of a substance that reflects its ability to absorb light of a specific wavelength. For substance concentration, Optical path length is the distance light travels within the detection cavity, determined by the net absorption spectrum. It can be calculated absorbance The calculation formula is as follows:

[0060] ,

[0061] in, The incident light intensity is obtained by a smart spectral sensor, combined with pre-calibrated... molar absorptivity Check the optical path of the cavity It can calculate the effect of excluding interfering components. Concentration, calculated using the formula shown below:

[0062] ;

[0063] The calculated The concentration is compared with a preset danger threshold. When the concentration is greater than or equal to the danger threshold, a safety warning is triggered and the safety control equipment is activated.

[0064] like Figure 3 As shown, further, considering the coupling relationship between gas pressure and instantaneous gas volume, gas temperature, and gas composition in actual gas handling conditions, a pressure coupling model is constructed using a long short-term memory network algorithm, including the following steps:

[0065] Historical gas pressure, instantaneous gas volume, and gas temperature data were collected under different operating conditions. Among these, gas pressure... Instantaneous gas volume is directly measured by a pressure sensor. Gas temperature is obtained through a flow meter. Real-time data acquisition is performed using a temperature sensor;

[0066] The Leighton criterion is used to handle outliers in the data. First, the mean of each parameter is calculated. with standard deviation For gas pressure data, if one of the data points The difference from the pressure mean is greater than three times the pressure standard deviation, which satisfies the condition. If the data point is abnormal, it is determined to be an abnormal value caused by equipment failure or sensor malfunction and is removed. Similarly, the instantaneous gas volume and gas temperature data are processed to remove abnormal values.

[0067] The pre-processed gas-jacking parameters were sorted according to time series, based on standard operating conditions. Based on the standard operating conditions, the gas temperature at that time is used as a benchmark. Instantaneous air volume With each collection time gas temperature Instantaneous air volume By taking the differences separately, multiple sets of gas temperature differences were obtained. Instantaneous gas volume difference Simultaneously record the gas pressure at standard operating conditions. and gas pressure at each sampling time Integrate and generate a training set;

[0068] The training set is input into a Long Short-Term Memory (LSTM) network algorithm to construct a pressure-coupled model. The LSM network processes long-term dependencies in time-series data through a gating mechanism and progressively extracts features from different levels of the data through a multi-layer architecture. These features are then mapped to the final output through fully connected layers. During the training phase, an adaptive moment estimation optimizer is used to optimize the network parameters. By calculating the first and second moment estimates of the gradient, the learning rate is dynamically adjusted for each parameter, and the updated parameters are updated accordingly. The formula is as follows:

[0069] ,

[0070] ,

[0071] ,

[0072] ,

[0073] ,

[0074] in, For the current moment The first moment estimate of the gradient is used to record the average direction of the gradient. For the previous moment First-moment estimate of the gradient, decay coefficient of the first-moment estimate It controls the weight of historical gradient information in the current first-order moment estimate. For the current moment The gradient reflects the rate of change of the loss function with the current parameters. For the current moment The second moment estimate of the gradient is used to measure the magnitude of the gradient. For the previous moment Second-moment estimation of the gradient The attenuation coefficient for the second-order moment estimation determines the proportion of historical gradient squared information in the current second-order moment estimation. This is the first-order moment estimate after bias correction, where It is the attenuation coefficient. of The power is used to eliminate the effects of the first-order moment estimation in the early stages of training. The resulting deviation This is the second-order moment estimate after bias correction. It is the attenuation coefficient. of The power is used to eliminate the second-order moment estimation due to [variables] in the early stages of training. The resulting deviation, The network parameters at the current moment, 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 The linear control law, through the proportional coefficient Pressure deviation Signal amplification or attenuation is performed to achieve a linear transformation of the pressure deviation. This linear transformation process directly determines the state of the control input, thereby affecting the regulation behavior of the control system and achieving preliminary dynamic adjustment of the recovery pipeline diameter. The integral term effectively eliminates the system's steady-state error by accumulating historical pressure deviations over time. Specifically, the integral coefficient... Optimization is achieved through trial and error, which involves continuously adjusting the system based on the pressure control effect during operation. The numerical value is calculated until the pressure stabilizes within the allowable error range of the target value. The formula is as follows: In this formula, Represents the time from the initial time 0 to the current time. Pressure deviation The cumulative integral over time, by summing up the pressure deviations at all past moments, reflects the cumulative error state of the system over a period of time. As an integration coefficient, this accumulated error is weighted and amplified. Its magnitude determines the strength of the integration stage's response to the accumulated error. Over time, even small long-term deviations will accumulate in the integration operation. The value of the pressure deviation will continuously change, driving the regulating mechanism to gradually correct the deviation and ensure that the system pressure remains stable during long-term operation. The derivative element monitors the rate of change of the pressure deviation. Predict pressure fluctuation trends in advance, differential coefficient The Ziegler-Nichols method is used to determine the parameters, which combines the open-loop characteristics of the system to calculate the parameters. The formula is as follows: This describes the pressure deviation. The rate of change over time, or the instantaneous rate of change of pressure deviation, reflects the trend of pressure fluctuations. The output can intervene before significant pressure changes occur, where As a differential coefficient, it determines the degree to which the rate of change of pressure deviation affects the control output. When an accelerated rate of change of pressure deviation is detected, it means that a significant pressure fluctuation may be imminent. It will quickly output a reverse adjustment signal to suppress sudden pressure changes. By weighting and superimposing the outputs of these three stages, a regulation signal is formed. Its expression is as follows:

[0084] ,

[0085] Adjust the signal As the control command of the actuator, it can accurately adjust the diameter of the recovery pipeline based on the magnitude and trend of pressure deviation, so as to maintain the pressure balance of the entire recovery process while ensuring the stable flow rate of the jacket gas, and reduce the risk of jacket gas leakage during recovery.

[0086] This invention discloses an intelligent monitoring method for jacket gas recovery. This method collects gas pressure, instantaneous gas volume, and gas temperature in real time, and monitors the effects of other components in the jacket gas on… To mitigate interference in concentration detection, a spectral intelligent sensor is used to collect ultraviolet and infrared spectral data. A scattering characteristic calculation module and a water vapor and... The occlusion feature calculation module also includes an interference prediction branch. After weighted fusion of ultraviolet and infrared spectral data and removal of harmful interfering spectral values, it calculates the occlusion feature using the Lambert-Beer law. Concentration is used for decision-making and safety early warning; considering the inherent coupling relationship between gas pressure, instantaneous gas volume, and gas temperature, a pressure coupling model is constructed using a long short-term memory network to correct the pressure threshold, and the valve opening and closing is controlled by comparing the actual gas pressure with the corrected threshold; during gas recovery, an electrically controlled adjustable pipeline is used, and the pipeline diameter is dynamically adjusted according to the difference between the actual gas pressure and the corrected threshold through a PID control algorithm, effectively improving the accuracy of gas detection and the safety of the system.

[0087] The above description is merely a preferred embodiment of the present invention. The scope of protection of the present invention is not limited to the above embodiment. All technical solutions based on the concept of the present invention are within the scope of protection of the present invention. It should be noted that for those skilled in the art, various improvements and modifications that do not depart from the principles of the present invention should also be considered within the scope of protection of the present invention.

Claims

1. An intelligent monitoring method for gas recovery, characterized in that, The following steps are involved: 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.

2. The intelligent monitoring method for gas recovery as described in claim 1, characterized in that, The net absorption spectrum was obtained using the Transformer, and calculations were performed using Lambert-Beer's law. Concentration, including the following steps: After the encoder output of the Transformer, the scattering feature calculation module and the occlusion feature calculation module are connected to extract the interference features, iteratively calculate the ultraviolet weight and infrared weight, and weighted sum the ultraviolet spectral data and infrared spectral data to obtain the fused spectrum; Interference features are input into the prediction branch to mine the correlation of spectral features of interfering components and generate interference spectral hazard values ​​using feature transformation and dimensionality mapping. The interference spectral hazard values ​​are subtracted from the fused spectrum to generate the net absorption spectrum. The Lambert-Beer law, molar absorptivity, and optical path length of the detection cavity are then used to calculate... concentration.

3. 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.

4. The intelligent monitoring method for gas recovery as described in claim 3, 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.

5. The intelligent monitoring method for gas recovery as described in claim 2, characterized in that, Based on the Mie scattering principle of oil mist particles, the influence of interference is quantified, and a scattering characteristic calculation module is designed. 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.

6. The intelligent monitoring method for gas recovery as described in claim 2, characterized in that, 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.

7. The intelligent monitoring method for gas recovery as described in claim 2, 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.

8. The intelligent monitoring method for gas recovery as described in claim 2, 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.

9. The intelligent monitoring method for gas recovery as described in claim 3, 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.

10. The intelligent monitoring method for gas recovery as described in claim 9, 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

  • Analysis method and apparatus for sulfur component using ultraviolet fluorescence

    US20050079625A1

  • Hyperspectral data and image analysis using machine learning

    US20240288308A1

  • Internet of things system

    WO2023030513A1

Cited By

  • Intelligent door and window linkage control method based on multi-scene mode switching

    CN121364653A

  • An intelligent door and window linkage control method based on multi-scene mode switching

    CN121364653B