A method for recognizing a channeling mode based on artificial intelligence and an electronic device
Patent Information
- Application Number
- CN202510448731.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-10
- Publication Date
- 2026-10-20
AI Technical Summary
[0004]本发明的目的在于克服现有技术中所存在的人工分析速度慢,从而导致干预周期长,并且没有严格统一的分析标准的不足,提供一种基于人工智能的压窜模式识别方法及电子设备
[0032]与现有技术相比,本发明的有益效果在于:能够丰富特征信息,从而更加简单高效地使用Anomaly-Attention Transformer模型进行拟合,效果更好,能够实现快速准确的压窜状态识别,通过及时发现压窜情况,从而指导人工介入调整生产安排。
Smart Images

Figure BDA0005353375800000021 
Figure BDA0005353375800000031 
Figure BDA0005353375800000032
Abstract
Description
Technical Field
[0001] This invention relates to the field of oil and gas reservoir development technology, and in particular to an artificial intelligence-based method and electronic device for identifying pressure crosstalk patterns. Background Technology
[0002] Currently, there is no complete and systematic method for identifying gas well fracturing channeling. On-site, it is usually determined by manually observing pressure fluctuations and production levels in adjacent wells during fracturing operations. The main indicators are the presence of the following characteristics of channeling: 1. Significant changes in the composition of the produced well after channeling; 2. Decreased flowing pressure and velocity after channeling. Channeling is determined by identifying whether these characteristics appear in adjacent producing wells.
[0003] Generally speaking, combining the two characteristics mentioned above is the most accurate way to identify pressure channeling. However, a decrease in gas flow velocity in a production well may not necessarily occur in the field. It is more important to rely on changes in pressure and production components for identification. This can lead to a long time to identify pressure channeling in the field (it takes a long time from data collection to component analysis, and when the flow pressure just starts to fluctuate, it is difficult for humans to immediately determine whether it is pressure channeling. It is necessary to observe for a period of time before drawing a conclusion), slow response, and each person's judgment is affected by historical production experience, making it impossible to strictly unify the standards. Summary of the Invention
[0004] The purpose of this invention is to overcome the shortcomings of existing technologies, such as slow manual analysis speed leading to long intervention cycles and lack of strict and unified analysis standards, and to provide an artificial intelligence-based compression pattern recognition method and electronic device.
[0005] To achieve the above-mentioned objectives, the present invention provides the following technical solution:
[0006] An artificial intelligence-based method for identifying compression patterns includes the following steps:
[0007] S1: Define the feature space;
[0008] S2: Construct an Anomaly-Attention Transformer model and input the feature space into the Anomaly-Attention Transformer model for training to obtain a trained Anomaly-Attention Transformer model.
[0009] The Anomaly-Attention Transformer model includes: a data preprocessing module, an anomaly attention module, a binary multi-means clustering module, a labeling module, and a multilayer perception module. The data preprocessing module, the anomaly attention module, the binary multi-means clustering module, the labeling module, and the multilayer perception module are connected sequentially. The data preprocessing module is also connected to the multilayer perception module.
[0010] S3: Input the data points to be tested into the trained Anomaly-Attention Transformer model and output the compression state recognition result.
[0011] By adopting the above technical solution and defining the feature space, the feature information can be enriched, making it easier and more efficient to use the Anomaly-Attention Transformer model for fitting, resulting in better performance. This enables fast and accurate identification of compression and cross-contamination status, allowing for timely detection of compression and cross-contamination situations and guiding manual intervention to adjust production schedules.
[0012] As a preferred embodiment of the present invention, the characteristic indicators of the characteristic space mentioned in step S1 include: oil pressure, casing pressure, gas well operating conditions, skewness, kurtosis, mean, variance, and first-order difference.
[0013] As a preferred embodiment of the present invention, the data preprocessing module in step S2 preprocesses the feature space, including encoding non-data features and calculating the skewness, kurtosis, mean, variance and first-order difference.
[0014] As a preferred embodiment of the present invention, the anomaly attention module in step S2 is a dual-branch structure, including a Prior-Association branch and a Series-Association branch. The Prior-Association branch is used to calculate the local association degree, and the Series-Association branch is used to calculate the global association degree.
[0015] As a preferred embodiment of the present invention, the Prior-Association branch is represented as follows:
[0016]
[0017] Where, p l This represents the correlation between the current time point sample and the surrounding samples, and σ represents the scale of the Gaussian kernel function. After passing through the Gaussian kernel, Rescale can obtain the discrete distribution of the correlation between point j and each sample point within the range n.
[0018] The Series-Association branch is represented as follows:
[0019]
[0020] Where Q and K are both matrix products of the model input x and a random matrix, and d model This refers to the model's dimensionality, a hyperparameter. The hyperparameters of AI models vary depending on the training scenario. Softmax is a normalization calculation. l It is the global correlation coefficient, which is the correlation between the sample at the current time point and all samples.
[0021] As a preferred embodiment of the present invention, the correlation difference can be defined based on the Prior-Association branch and the Series-Association branch, and the correlation difference is calculated using the following formula:
[0022]
[0023] Where AssDis is the correlation difference value, P i l Let S be the correlation between the sample at time point i and its surrounding samples. i l Let x be the i-th global correlation coefficient, x be the input of the model, and L be the number of model layers.
[0024] As a preferred embodiment of the present invention, the correlation difference score is optimized using a minimax strategy, and the calculation formula is as follows:
[0025]
[0026] Among them, W Q W K W V W σ Both are random matrices; Ltotal is the output of the anomaly attention module.
[0027] As a preferred embodiment of the present invention, the global flow of the anomaly attention module is as follows: first, the input passes through the anomaly attention module, then regularization is performed, the forward propagation layer is calculated, and then a regularization layer is performed again. Finally, the input is reconstructed through the anomaly attention module to obtain the reconstruction result.
[0028] As a preferred embodiment of the present invention, the binary multi-means clustering module in step S2 divides the data points into K clusters based on the correlation anomaly scores of each node of the anomaly attention module using the sum of squared errors function;
[0029] The labeling module determines which cluster's data belongs to an outlier by comparing the mean of the outlier scores of the K clusters output by the binary multi-means clustering module.
[0030] The multi-layer sensing module analyzes the abnormal points and identifies data points belonging to the gas leakage state.
[0031] On the other hand, an electronic device is disclosed, including at least one processor and a memory communicatively connected to the at least one processor; the memory stores instructions executable by the at least one processor, which, when executed by the at least one processor, enable the at least one processor to perform the AI-based compression pattern recognition method described above.
[0032] Compared with the prior art, the beneficial effects of the present invention are: it can enrich feature information, thereby making it simpler and more efficient to use the Anomaly-Attention Transformer model for fitting, with better results, and can achieve fast and accurate identification of compression state. By timely detecting compression situation, it can guide manual intervention to adjust production schedule. Attached Figure Description
[0033] Figure 1 This is a flowchart of an artificial intelligence-based compression pattern recognition method according to Embodiment 1 of the present invention;
[0034] Figure 2 This is a flowchart illustrating the artificial intelligence-based compression pattern recognition method described in Embodiment 1 of the present invention.
[0035] Figure 3 This is a structural diagram of a multilayer sensing module for a compression pattern recognition method based on artificial intelligence, as described in Embodiment 2 of the present invention.
[0036] Figure 4 This is a structural diagram of the Anomaly-Attention Transformer model for an artificial intelligence-based compression pattern recognition method as described in Embodiment 2 of the present invention.
[0037] Figure 5 This is a structural block diagram of an electronic device according to Embodiment 3 of the present invention. Detailed Implementation
[0038] The present invention will now be described in further detail with reference to specific embodiments. However, this should not be construed as limiting the scope of the present invention to the following embodiments; all technologies implemented based on the content of the present invention fall within the scope of the present invention.
[0039] Example 1
[0040] An AI-based method for identifying compression patterns, such as Figure 1 As shown, it includes the following steps:
[0041] S1: Define the feature space;
[0042] S2: Construct an Anomaly-Attention Transformer model and input the feature space into the Anomaly-Attention Transformer model for training to obtain a trained Anomaly-Attention Transformer model.
[0043] like Figure 2 As shown, the Anomaly-Attention Transformer model includes: a data preprocessing module, an anomaly attention module, a binary multi-means clustering module, a labeling module, and a multilayer perception module. The data preprocessing module, the anomaly attention module, the binary multi-means clustering module, the labeling module, and the multilayer perception module are connected sequentially. The data preprocessing module is also connected to the multilayer perception module.
[0044] like Figure 3 As shown, the multilayer sensing module includes: an input layer, a hidden layer, and an output layer;
[0045] S3: Input the data points to be tested into the trained Anomaly-Attention Transformer model and output the compression state recognition result.
[0046] By adopting the above technical solution, feature information can be enriched, making it easier and more efficient to use the Anomaly-Attention Transformer model for fitting, resulting in better performance. It can achieve fast and accurate identification of compression and cross-contamination status, and guide manual intervention to adjust production schedules by timely detection of compression and cross-contamination.
[0047] Example 2
[0048] This embodiment is a specific implementation of embodiment 1;
[0049] The characteristic indicators of the characteristic space include: oil pressure, casing pressure, gas well operating conditions (shutdown, normal production), skewness (oil pressure and casing pressure), kurtosis (oil pressure and casing pressure), mean (oil pressure and casing pressure), variance (oil pressure and casing pressure), and first-order difference (oil pressure and casing pressure). These characteristic indicators show more obvious differences in characteristics at abnormal data points.
[0050] The data preprocessing module preprocesses the feature space, including encoding non-data features and calculating the skewness, kurtosis, mean, variance, and first-order difference.
[0051] The formula for calculating the skewness is:
[0052]
[0053] Where μ3 is the third central moment and σ is the standard deviation;
[0054]
[0055] Where n is the number of elements, x i Let be the i-th data point in the time series data; μ is the sample mean; f(x) is the probability density function of sample x. In this scenario, there is usually no probability density function, so the intermediate formula is used to calculate the third central moment; E is the sign of the expected value; X is the sample value; E(X) is the expected value of sample X.
[0056] The formula for calculating the kurtosis is:
[0057]
[0058] Where μ4 is the fourth central moment;
[0059]
[0060] The formula for calculating the mean is:
[0061]
[0062] Where n is the number of elements, x i This refers to the i-th data point in the time series data;
[0063] The formula for calculating the first-order difference is:
[0064] D1 = x i -x i-1 .
[0065] Specifically, for data with no logical correlation, i.e., no logical relationship between data categories, one-hot encoding is used, such as gas well conditions; for data with logical correlation, i.e., no logical relationship between data categories, such as formation parameters like coarse sandstone and fine sandstone, label encoding is used.
[0066] One-hot coding for gas well operating conditions: 0 indicates well shut-in, 1 indicates normal production, and 2 indicates other downhole operations.
[0067] Average oil pressure:
[0068]
[0069] Where n represents the number of elements, P oi It is the oil pressure at the i-th moment;
[0070] Mean value of casing pressure:
[0071]
[0072] Among them, P ei It is the oil pressure at the i-th moment;
[0073] Hydraulic pressure deviation:
[0074]
[0075] Where, μ 3o Let σ be the third-order central moment of the oil pressure. o The standard deviation of oil pressure;
[0076]
[0077] Sleeve deviation:
[0078]
[0079] Where, μ 3e Let σ be the third central moment of the sleeve compression. e The standard deviation of the sleeve pressure;
[0080]
[0081] Peak of oil pressure:
[0082]
[0083]
[0084] Where, μ 4o The fourth-order central moment of the oil pressure;
[0085] Kurtosis of the sleeve pressure:
[0086]
[0087] Where, μ 4e The fourth central moment of the sleeve compression;
[0088] Variance of oil pressure:
[0089]
[0090] Variance of sleeve pressure:
[0091]
[0092] First-order difference in oil pressure:
[0093]
[0094] For the oil pressure at time 0, because P oi-1 It does not exist, so when i = 0, D o1 It is zero;
[0095] First-order difference in sleeve pressure:
[0096]
[0097] For the oil pressure at time 0, because P ei-1 It does not exist, so when i = 0, D e1 It is zero.
[0098] like Figure 4 As shown, the anomaly attention module has a two-branch structure, including a Prior-Association (local relevance score) branch and a Series-Association (global relevance score) branch. The Prior-Association branch is used to calculate the local relevance, and the Series-Association branch is used to calculate the global relevance.
[0099] The Prior-Association branch is represented as follows:
[0100]
[0101] Where, p l This represents the calculated correlation between the sample at the current time point and the surrounding samples. σ represents the scale of the Gaussian kernel function. After passing through the Gaussian kernel, Rescale can be used to obtain the discrete distribution of the correlation between point j and each sample point within the range n.
[0102] Specifically, for the Prior-Association branch, a Gaussian kernel function is used to calculate the relative temporal distance. Using a Gaussian kernel function allows the computational model to focus more on the correlation between adjacent positions. Designing the scaling parameter σ of the Gaussian kernel function as a learnable parameter makes the local correlation applicable to various time series patterns, even sequences with unequal time intervals. In the above formula, P... l This represents the calculated correlation between the sample at the current time point and its surrounding samples, where σ represents the scale of the Gaussian kernel function. After applying the Gaussian kernel, Rescale can be used to obtain the discrete distribution of the correlation between point j and each sample point within a range of n.
[0103] The Series-Association branch is represented as follows:
[0104]
[0105] Where Q and K are both matrix products of the model input x and a random matrix, and d model This refers to the model's dimensionality, a hyperparameter. The hyperparameters of AI models vary depending on the training scenario. Softmax (a normalization function) is a normalization calculation process. l It is the global correlation coefficient, which is the correlation between the sample at the current time point and all samples.
[0106] Specifically, the calculation of the Series-Assocition branch is a normalization of the ordinary attention formula combined with softmax, so that the output is a score.
[0107] The correlation difference can be defined based on the Prior-Association branch and the Series-Association branch, and the formula for calculating the correlation difference is as follows:
[0108]
[0109] Where AssDis represents the correlation difference value. Let be the correlation between the sample at time point i and its surrounding samples. Let x be the i-th global correlation coefficient, x be the input of the model, and L be the number of model layers.
[0110] The correlation difference score is optimized using a minimax strategy, and the calculation formula is as follows:
[0111]
[0112] Among them, W Q W K W V W σ Both are random matrices; Ltotal is the output of the anomaly-attention layer.
[0113] Specifically, the above formula uses KL divergence to calculate the difference between the two distributions obtained in each layer. The result is the correlation difference of the entire input data, with a value corresponding to each time point. The value of AssDis for abnormal data will be smaller than that for normal data.
[0114] Building upon AssDis's basic OI (Online Inquiry), to make the differences between outlier and normal data points more apparent, the correlation difference is amplified. Since the global correlation difference between outlier data points is already small, forcing it to increase makes it more difficult (and therefore less accurate) for the model to reconstruct outliers, thus achieving differentiation in the reconstruction results. During training, the model will optimize the minimax strategy.
[0115] The global flow of the anomaly attention module is as follows: first, it passes through Anomaly-Attention, then Layer Norm (regularization) is performed sequentially, Feed Forward is calculated, Layer Norm (regularization) is performed again, and then the input is reconstructed through the anomaly attention module to obtain the reconstruction result. The calculation formula for the reconstruction result is as follows:
[0116]
[0117] In this diagram, LayerNorm is the normalization layer, and feedforward is the feedforward propagation layer, both corresponding to a layer in the attention model on the right side of the figure. l Here, it's an intermediate value symbol, x. l This is the result of the reconstruction.
[0118] Once the reconstruction result is obtained, its local correlation score and global correlation score can be calculated according to the process on the left side of the model diagram. Finally, it is calculated using L... Total This is used to calculate the overall correlation anomaly score.
[0119] For time series data, the sequential relationship between data sample points contains a lot of information. In order to preserve and extract the sequential features in the time series, the input sample data is positionally encoded. The sequential features of the time series data are extracted through positional encoding. Positional encoding usually includes cosine encoding and learnable positional encoding. The feature extraction capability of learnable positional encoding is generally better than that of cosine encoding.
[0120] The binary multi-means clustering module divides the data points into K clusters based on the correlation anomaly scores of each node in the anomaly attention module using the sum of squared errors function.
[0121] Specifically, the binary multi-means clustering module uses the outlier scoring results of the Anomaly-Attention-transformer module to cluster the data points into data point 1 and data point 2. The principle is as follows:
[0122] Because the Anomaly-Attention-transformer module is an unsupervised training model, its scoring of normal and abnormal data points has a clear boundary. By performing bi-Keams clustering, two classes can be obtained. The labeling module calculates the mean of the two classes of data points and then judges the mean. Data points with larger means are judged as abnormal nodes, thus labeling the data points as normal or abnormal data points.
[0123] The main idea of the BI-Keams algorithm is as follows: First, treat all points as a single cluster, then divide that cluster into two. Next, select the cluster that minimizes the clustering cost function (i.e., the sum of squared errors) and divide it into two further clusters. Continue this process until the number of clusters equals the user-defined number K.
[0124] The computation process of the algorithm is described in Table 1:
[0125]
[0126] Table 1
[0127] The labeling module determines which cluster's data belongs to outliers by comparing the mean of the outlier scores of the K clusters output by the binary multi-means clustering module, as shown in Table 2:
[0128]
[0129]
[0130] Table 2
[0131] The multi-layer sensing module analyzes the abnormal points and identifies data points belonging to the gas leakage state.
[0132] Example 3
[0133] like Figure 5 As shown, an electronic device includes at least one processor, a memory communicatively connected to the at least one processor, and at least one input / output interface communicatively connected to the at least one processor. The memory stores instructions executable by the at least one processor, which, when executed by the at least one processor, enable the at least one processor to perform a method described in the foregoing embodiments. The input / output interface may include a display, keyboard, mouse, and USB interface for inputting and outputting data.
[0134] Those skilled in the art will understand that all or part of the steps of the above method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it performs the steps of the above method embodiments. The aforementioned storage medium includes various media that can store program code, such as mobile storage devices, read-only memory (ROM), magnetic disks, or optical disks.
[0135] When the integrated units of this invention are implemented as software functional units and sold or used as independent products, they can also be stored in a computer-readable storage medium. Based on this understanding, the technical solutions of the embodiments of this invention, or the parts that contribute to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the methods described in the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as mobile storage devices, ROMs, magnetic disks, or optical disks.
[0136] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A compression pattern recognition method based on artificial intelligence, characterized in that, Includes the following steps: S1: Define the feature space; S2: Construct an Anomaly-Attention Transformer model and input the feature space into the Anomaly-Attention Transformer model for training to obtain a trained Anomaly-Attention Transformer model. The Anomaly-Attention Transformer model includes: a data preprocessing module, an anomaly attention module, a binary multi-means clustering module, a labeling module, and a multilayer perception module. The data preprocessing module, the anomaly attention module, the binary multi-means clustering module, the labeling module, and the multilayer perception module are connected sequentially. The data preprocessing module is also connected to the multilayer perception module. S3: Input the data points to be tested into the trained Anomaly-Attention Transformer model and output the compression state recognition result.
2. The method for identifying compression patterns based on artificial intelligence according to claim 1, characterized in that, The characteristic indicators of the characteristic space mentioned in step S1 include: oil pressure, casing pressure, gas well operating conditions, skewness, kurtosis, mean, variance, and first-order difference.
3. The method for identifying compression patterns based on artificial intelligence according to claim 2, characterized in that, The data preprocessing module in step S2 preprocesses the feature space, including encoding non-data features and calculating the skewness, kurtosis, mean, variance and first-order difference.
4. The method for identifying compression patterns based on artificial intelligence according to claim 1, characterized in that, The anomaly attention module mentioned in step S2 has a two-branch structure, including a Prior-Association branch and a Series-Association branch. The Prior-Association branch is used to calculate the local association degree, and the Series-Association branch is used to calculate the global association degree.
5. The compression pattern recognition method based on artificial intelligence according to claim 4, characterized in that, The Prior-Association branch is represented as follows: Where, p l This represents the correlation between the current time point sample and the surrounding samples, and σ represents the scale of the Gaussian kernel function. After passing through the Gaussian kernel, Rescale can obtain the discrete distribution of the correlation between point j and each sample point within the range n. The Series-Association branch is represented as follows: Where Q and K are both matrix products of the model input x and a random matrix, and d model This refers to the model's dimensionality, a hyperparameter. The hyperparameters of AI models vary depending on the training scenario. Softmax is a normalization calculation. l It is the global correlation coefficient, which is the correlation between the sample at the current time point and all samples.
6. The method for identifying compression patterns based on artificial intelligence according to claim 6, characterized in that, The correlation difference can be defined based on the Prior-Association branch and the Series-Association branch, and the formula for calculating the correlation difference is as follows: Where AssDis is the correlation difference value, P i l Let S be the correlation between the sample at time point i and its surrounding samples. i l Let x be the i-th global correlation coefficient, x be the input of the model, and L be the number of model layers.
7. The method for identifying compression patterns based on artificial intelligence according to claim 6, characterized in that, The correlation difference score is optimized using a minimax strategy, and the calculation formula is as follows: Among them, W Q W K W V W σ Both are random matrices; Ltotal is the output of the anomaly attention module.
8. The method for identifying compression patterns based on artificial intelligence according to claim 1, characterized in that, The global process of the anomaly attention module is as follows: first, the input passes through the anomaly attention module, then regularization is performed, the forward propagation layer is calculated, regularization is performed again, and then the input is reconstructed through the anomaly attention module to obtain the reconstruction result.
9. The method for identifying compression patterns based on artificial intelligence according to claim 1, characterized in that, In step S2, the binary multi-means clustering module divides the data points into K clusters based on the correlation anomaly scores of each node in the anomaly attention module using the sum of squared errors function. The labeling module determines which cluster's data belongs to an outlier by comparing the mean of the outlier scores of the K clusters output by the binary multi-means clustering module. The multi-layer sensing module analyzes the abnormal points and identifies data points belonging to the gas leakage state.
10. An electronic device, characterized in that, It includes at least one processor and a memory communicatively connected to the at least one processor; the memory stores instructions executable by the at least one processor, which, when executed by the at least one processor, enable the at least one processor to perform the AI-based compression pattern recognition method according to any one of claims 1 to 9.