A method and system for automatically identifying formation lithology while drilling
By decoding frames and processing feature tensors in dynamic image streams, and combining them with a standard stratigraphic library for lithology identification, the problems of invalid information interference and fusion rendering in existing lithology identification technologies are solved, achieving high-precision and visualized lithology identification results.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- CHENGDU HAOSHENGYU PETROLEUM TECHNOLOGY CO LTD
- Filing Date
- 2026-04-01
- Publication Date
- 2026-06-19
AI Technical Summary
The current process of identifying formation lithology while drilling lacks a standardized frame decoding process, resulting in invalid information interference in the image data, making it difficult to extract accurate visual features of formation cuttings, lacking objective numerical basis for lithology identification, and failing to achieve the fusion rendering of lithology columnar plots and drilling curves, thus affecting identification efficiency and accuracy.
By performing frame decoding on the dynamic image stream, extracting the rock cuttings feature tensor set, performing affine invariant moment registration and color space transformation, combining it with a standard stratigraphic library for lithology identification, and fusing the rendered lithology columnar section with drilling parameters, a real-time drilling lithology interpretation map is generated.
It has significantly improved the accuracy and visualization of lithology identification, provided objective quantitative evidence and reliable lithology discrimination results, and met the real-time requirements of drilling operations.
Smart Images

Figure CN122244680A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image recognition technology, and in particular to an automatic method and system for identifying formation lithology while drilling. Background Technology
[0002] In current drilling lithology identification processes, the processing of dynamic image streams acquired at the drilling site lacks a standardized frame decoding procedure. This hinders accurate protocol parsing and image reconstruction of image stream data packets, easily retaining duplicate and corrupted frames. Consequently, the acquired image data contains invalid information interference, making it difficult to extract accurate visual features of formation cuttings and directly impacting the quality of the basic data for lithology identification. Drilling lithology identification relies on manual comprehensive analysis of cuttings characteristics and engineering parameters, lacking automated parsing and registration of cuttings feature tensors. This prevents accurate quantitative analysis of cuttings contour descriptors and spectral features, resulting in a lack of objective numerical basis for lithology judgment and hindering the formation of unified lithology identification standards.
[0003] Existing technologies do not accurately calibrate lithology identification results and drilling engineering parameters in the depth domain, nor do they achieve the fusion rendering of lithology columnar sections and drilling curves. They can only obtain isolated lithology identification labels and engineering parameter data, and cannot form visualized real-time drilling lithology interpretation maps. As a result, it is impossible to intuitively and efficiently obtain the vertical distribution characteristics of formation lithology during drilling operations. The application efficiency of lithology identification results is low, and it is difficult to meet the real-time and accuracy requirements of formation lithology identification in drilling operations. Summary of the Invention
[0004] This invention provides an automatic formation lithology identification method and system while drilling to solve the problems mentioned in the background art.
[0005] To achieve the above objectives, the present invention provides an automatic formation lithology identification method while drilling, comprising: S1. Perform frame decoding on the dynamic image stream of the target region to obtain the original image frame sequence of the target region; S2. Based on the grayscale change detection results of adjacent frames in the original image frame sequence, perform connected component analysis on the stable pixel region of the original image frame sequence to obtain the rock debris feature tensor set of the target region; S3. Based on a preset standard stratigraphic map library, perform affine invariant moment registration on the contour descriptors in the rock debris feature tensor set, and perform chromaticity space transformation on the spectral features in the rock debris feature tensor set to obtain the shape similarity coefficient and spectral matching index of the target area. S4. Based on the shape similarity coefficient and the spectral matching index, retrieve the stratigraphic lithology identification code from the standard spectral library of the target area to obtain the preliminary lithology discrimination label of the target area; S5. Perform field parsing on the drilling engineering parameters of the original image frame sequence to obtain the drilling time parameter sequence and well depth parameter sequence of the target area; S6. Perform depth domain calibration on the preliminary lithology discrimination label and the well depth parameter sequence to obtain the lithology columnar plot data stream of the target area, and fuse and render the lithology columnar plot data stream with the drilling time parameter sequence to obtain the real-time drilling lithology interpretation map of the target area.
[0006] In a preferred embodiment, the step of frame decoding the dynamic image stream of the target region to obtain the original image frame sequence of the target region includes: Read the data buffer queue of the dynamic image stream in the target area, and perform protocol parsing on the data packets in the data buffer queue to obtain the video basic stream of the target area; Entropy decoding is performed on the video elementary stream to obtain single-frame image data of the target region; The macroblock partitioning information, motion vector field and residual coefficients of the single frame image data are used to reconstruct the image to obtain the image frame of the target region. The image frames are labeled with their frame types, duplicate and corrupted frames are removed, and the image frames are rearranged in the order of acquisition time to obtain the original image frame sequence of the target area.
[0007] In a preferred embodiment, the step of performing connected component analysis on stable pixel regions of the original image frame sequence based on grayscale change detection results of adjacent frames in the original image frame sequence to obtain the rock debris feature tensor set of the target region includes: Convolutional filtering is performed on adjacent frames in the original image frame sequence to obtain the differential response map of the target region; Binary masking is performed on the pixel locations in the differential response map where the grayscale response value is lower than a preset dynamic fluctuation threshold to obtain a stable pixel spatial distribution mask for the target region. Based on the stable pixel spatial distribution mask, an eight-neighbor region adjacency graph traversal is performed on the temporal stable pixels of the stable pixel region to obtain the connected component labeling map of the target region; edge pixel tracking is performed on the connected components in the connected component labeling map to obtain the contour descriptor tensor of the target region. Channel pixel values are extracted from the pixel regions covered by the connected components in the connected component marker map to obtain the spectral feature tensor of the target region; The contour descriptor tensor and the spectral feature tensor are dimensionally aligned and encapsulated to obtain the rock debris feature tensor set of the target region.
[0008] In a preferred embodiment, the step of performing edge pixel tracking on the connected components in the connected component marker map to obtain the contour descriptor tensor of the target region includes: Based on the connected component marker map, the boundary starting pixels of the connected components are initialized with eight-neighbor directional encoding to obtain the initial tracking base point of the target region; Starting from the initial tracking base point, a counterclockwise neighborhood traversal is performed on the initial tracking base point, and the initial tracking base point and subsequent boundary points are encoded by direction vector to obtain the local chain code fragment of the target region. The successor boundary point is updated to the current tracking base point, and the neighborhood traversal and direction vector encoding are repeated to obtain the original chain code sequence of the target region. The original chain code sequence is subjected to Fourier contour descriptor transform to obtain the contour descriptor of the target region; The contour descriptors of the connected components in the connected component marker map are tensorized and stacked to obtain the contour descriptor tensor of the target region.
[0009] In a preferred embodiment, the process of performing affine invariant moment registration on the contour descriptors in the rock debris feature tensor set based on a preset standard stratigraphic library, and performing chromaticity space transformation on the spectral features in the rock debris feature tensor set to obtain the shape similarity coefficient and spectral matching index of the target area, includes: The contour descriptors in the rock debris feature tensor set are fitted with the standard contour primitive sequences in the standard stratigraphic library to obtain the optimal affine transformation matrix for the target area. Based on the optimal affine transformation matrix, the contour descriptor is mapped to the coordinate space of the standard contour primitive, and the mapped contour descriptor and the standard contour primitive are paired with shape context feature points to obtain the shape similarity coefficient of the target region. The spectral feature quantities in the rock debris feature tensor set are mapped from the red-green-blue hue space to the uniform hue space to obtain the spectral feature vector of the target region; The spectral feature vectors are compared with the standard spectral templates in the standard stratigraphic library, and the extracted channel chromatic difference vectors are then fused by modulus weighting to obtain the spectral matching index of the target region.
[0010] In a preferred embodiment, the step of retrieving stratigraphic lithology identification codes from a standard spectral library of the target region based on the shape similarity coefficient and the spectral matching index to obtain a preliminary lithological discrimination label for the target region includes: The shape similarity coefficient is compared with a preset shape matching tolerance, and the spectral matching index is compared with a preset spectral matching threshold to obtain the shape pass mark and spectral pass mark of the target area. Based on the shape via marker and the spectral via marker, a hash mapping is performed on the contour identifiers in the rock debris feature tensor set to obtain the contour index key value of the target region; The spectral feature fingerprints of the spectral feature quantities in the rock debris feature tensor set are subjected to feature encoding and matching, and the spectral index key values of the target region are retrieved from the standard spectral library; Using the combination of the contour index key value and the spectral index key value as a composite query condition, a joint primary key retrieval is performed in the lithological association table of the standard spectral library to obtain the stratigraphic lithology coding field of the target area; The stratigraphic lithology coding field is associated and bound with the timestamp of the original image frame sequence to encapsulate and obtain the preliminary lithology discrimination label of the target area.
[0011] In a preferred embodiment, associating the stratigraphic lithology coding field with the timestamp of the original image frame sequence further includes: The shape similarity coefficient and the spectral matching index are read, and preset shape matching tolerance, spectral matching threshold, confidence weight factor, nonlinear shape index, and nonlinear spectral index are obtained. The shape similarity coefficient and the spectral matching index are fused using the following formula to obtain the lithological discrimination confidence level of the target area, wherein the lithological discrimination confidence level is calculated using the following formula: ; In the formula, The confidence level for the lithology discrimination is... The shape similarity coefficient is... To provide a tolerance for the shape, The spectral matching index is... The spectral matching threshold is... The preset weighting factors, For the preset nonlinear shape index, This is a preset nonlinear spectral index; The lithology discrimination confidence level is associated with and stored with the stratigraphic lithology coding field, and the lithology discrimination confidence level is encapsulated as an additional attribute field to obtain the preliminary lithology discrimination label for the target area.
[0012] In a preferred embodiment, the step of parsing the drilling parameters of the original image frame sequence to obtain the drilling time parameter sequence and well depth parameter sequence for the target area includes: Read the original record file of drilling engineering parameters from the original image frame sequence, and perform binary stream parsing on the original record file of drilling engineering parameters to obtain the pure parameter data body of the target area; Based on the preset field delimiter, the pure parameter data body is segmented by field to obtain the original drilling time value stream and the original well depth value stream of the target area; Abnormal spikes are filtered out from the original drilling time data stream and the original well depth data stream to obtain the drilling time data sequence and well depth data sequence for the target area. The drilling time numerical sequence is timestamped and resampled to obtain the drilling time parameter sequence for the target area; The well depth numerical sequence is subjected to depth zero-point correction to obtain the well depth parameter sequence for the target area.
[0013] In a preferred embodiment, the step of performing depth domain calibration on the preliminary lithology discrimination label and the well depth parameter sequence to obtain a lithology columnar section data stream for the target area, and fusing and rendering the lithology columnar section data stream with the drilling time parameter sequence to obtain a real-time drilling lithology interpretation map of the target area, includes: Based on the timestamp information of the preliminary lithology discrimination label, labels are attached to the well depth node values in the well depth parameter sequence to obtain the depth domain lithology point sequence table of the target area. Neighborhood voting smoothing is performed on the lithological abrupt change interfaces between adjacent well depth nodes in the depth domain lithological point sequence list to obtain the depth domain lithological segmentation sequence of the target area. Based on the filling legend and texture identifier of lithology categories in the depth domain lithology segment sequence, the map is rasterized with well depth as the vertical axis and lithology category as the horizontal axis to obtain the lithology columnar map data stream of the target area; The drilling time values in the drilling time parameter sequence are mapped by curve amplitude. A curve trajectory is generated with well depth as the vertical axis and drilling time amplitude as the horizontal axis to obtain the drilling time curve data layer of the target area. Using the lithology columnar data stream as the base map layer and the drilling time curve data layer as the overlay map layer, layer registration is performed to obtain the real-time drilling lithology interpretation map of the target area.
[0014] To address the above problems, the present invention also provides an automatic formation lithology identification system while drilling, the system comprising: The image frame sequence decoding module is used to perform frame decoding on the dynamic image stream of the target region to obtain the original image frame sequence of the target region. The rock debris feature tensor parsing module is used to perform connected component parsing on the stable pixel region of the original image frame sequence based on the grayscale change detection results of adjacent frame images in the original image frame sequence, so as to obtain the rock debris feature tensor set of the target region; The rock debris feature registration and conversion module is used to perform affine invariant moment registration on the contour descriptors in the rock debris feature tensor set based on a preset standard stratigraphic map library, and to perform chromaticity space conversion on the spectral features in the rock debris feature tensor set to obtain the shape similarity coefficient and spectral matching index of the target area. The preliminary lithology labeling module is used to retrieve stratigraphic lithology identification codes from the standard spectral library of the target area based on the shape similarity coefficient and the spectral matching index, and obtain the preliminary lithology labeling of the target area. The drilling parameter field parsing module is used to parse the drilling engineering parameters of the original image frame sequence to obtain the drilling time parameter sequence and well depth parameter sequence of the target area; The lithological map fusion rendering module is used to perform depth domain calibration on the preliminary lithological discrimination labels and the well depth parameter sequence to obtain the lithological columnar plot data stream of the target area, and to fuse and render the lithological columnar plot data stream with the drilling time parameter sequence to obtain the real-time drilling lithological interpretation map of the target area.
[0015] Compared with the prior art, the present invention has the following beneficial effects: 1. This invention achieves precise processing and effective filtering of image data through a standardized dynamic image stream frame decoding process. It utilizes adjacent frame grayscale change detection to complete connected component analysis of stable pixel regions, accurately extracting the contours and spectral features of rock cuttings and encapsulating them into feature tensor sets. Then, affine invariant moment registration and chromaticity space transformation are used to achieve quantitative analysis of rock cutting features. Combined with a standard stratigraphic library, it completes accurate lithology identification, significantly improving the accuracy of drilling lithology identification and providing objective and consistent quantitative evidence for lithology identification results. Furthermore, confidence assessment is integrated into the lithology identification process, encapsulating the identification confidence level as an additional attribute in the lithology identification label, further enhancing the reliability and reference value of the lithology identification results.
[0016] 2. This invention achieves standardized field parsing of drilling engineering parameters, accurately acquires drilling time and well depth parameter sequences, associates lithology discrimination labels with well depth parameters through depth domain calibration, optimizes lithology segmentation results through neighborhood voting smoothing, and achieves fusion rendering of lithology columnar plots and drilling time curves based on rasterization drawing and curve trajectory generation, outputting visualized real-time drilling lithology interpretation maps, significantly improving the visualization and application efficiency of lithology identification results, realizing an intuitive presentation of the vertical distribution characteristics of formation lithology, meeting the real-time requirements of drilling operations for lithology identification, and simultaneously achieving deep integration of lithology identification and engineering parameters, making the lithology interpretation results more complete. Attached Figure Description
[0017] Figure 1 This is a flowchart illustrating an automatic formation lithology identification method provided in an embodiment of the present invention. Figure 2 This is a functional module diagram of an automatic formation lithology identification system provided in an embodiment of the present invention; The realization of the objective, functional features and advantages of the present invention will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation
[0018] It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
[0019] This application provides an automatic formation lithology identification method while drilling. The execution subject of this automatic formation lithology identification method includes, but is not limited to, at least one of the following electronic devices that can be configured to execute the method provided in this application embodiment: a server, a terminal, etc. In other words, the automatic formation lithology identification method while drilling can be executed by software or hardware installed on a terminal device or a server device. The server includes, but is not limited to, a single server, a server cluster, a cloud server, or a cloud server cluster. The server can be an independent server or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CDN), and big data and artificial intelligence platforms.
[0020] Reference Figure 1 The diagram shown is a flowchart illustrating an automatic formation lithology identification method during drilling according to an embodiment of the present invention. In this embodiment, the automatic formation lithology identification method during drilling includes: S1. Perform frame decoding on the dynamic image stream of the target region to obtain the original image frame sequence of the target region; In this embodiment of the invention, the step of performing frame decoding on the dynamic image stream of the target region to obtain the original image frame sequence of the target region includes: Read the data buffer queue of the dynamic image stream in the target area, and perform protocol parsing on the data packets in the data buffer queue to obtain the video basic stream of the target area; Entropy decoding is performed on the video elementary stream to obtain single-frame image data of the target region; The macroblock partitioning information, motion vector field and residual coefficients of the single frame image data are used to reconstruct the image to obtain the image frame of the target region. The image frames are labeled with their frame types, duplicate and corrupted frames are removed, and the image frames are rearranged in the order of acquisition time to obtain the original image frame sequence of the target area.
[0021] The real-time data buffer queue of the dynamic image stream is retrieved from the drilling data acquisition terminal in the target area. According to the transmission protocol format of the dynamic image stream, each data packet in the data buffer queue is split and parsed by header identification, data segment and check segment, and valid image transmission data is extracted and integrated to form the basic video stream of the target area.
[0022] According to the reverse encoding rules of entropy coding, the encoded data in the video basic stream is decoded and restored character by character to restore the uncompressed original image data. All the restored original image data are then integrated to form a single frame image data of the target area.
[0023] The system extracts the pre-defined macroblock segmentation information from the single-frame image data, divides the image region according to the coordinates and size information of the macroblocks, and then determines the pixel offset position of each macroblock by combining the motion vector field in the single-frame image data. At the same time, the residual coefficients are compensated to the pixel position of the corresponding macroblock, and the pixel values of all macroblocks are restored and stitched together to form an image frame of the target region.
[0024] Based on the acquisition identification information of the image frames, each image frame is classified and labeled according to its frame type. Duplicate frames with completely identical feature values are removed by comparing the feature values of the image frames. Damaged frames with a pixel missing rate exceeding a preset threshold are removed by verifying the integrity of the image frames. Then, the acquisition timestamps of all valid image frames are extracted, and the valid image frames are arranged in order of their timestamps to form the original image frame sequence of the target area.
[0025] The beneficial effects include standardized frame decoding processing of dynamic image streams from the target area, effective extraction of the basic video stream through precise reading and protocol parsing of the data buffer queue, restoration of single-frame image data through entropy decoding, and accurate reconstruction of image frames through the collaborative processing of macroblock partitioning information, motion vector fields, and residual coefficients. Subsequently, effective removal of duplicate and damaged frames is achieved through frame type marking, and the original image frame sequence is formed by rearranging the acquisition time sequence. The entire process realizes refined processing of dynamic image streams from raw data to effective image frame sequences, effectively filtering invalid information and erroneous data in the image data, ensuring that the acquired original image frame sequences have temporal continuity, data integrity, and content validity. This provides high-quality and highly reliable basic image data support for subsequent operations such as cuttings feature extraction and stratigraphic lithology identification based on image frame sequences, improving the overall processing effect and discrimination accuracy of automatic formation lithology identification while drilling from the data source.
[0026] S2. Based on the grayscale change detection results of adjacent frames in the original image frame sequence, perform connected component analysis on the stable pixel region of the original image frame sequence to obtain the rock debris feature tensor set of the target region; In this embodiment of the invention, the step of performing connected component analysis on stable pixel regions of the original image frame sequence based on the grayscale change detection results of adjacent frame images in the original image frame sequence to obtain the rock debris feature tensor set of the target region includes: Convolutional filtering is performed on adjacent frames in the original image frame sequence to obtain the differential response map of the target region; Binary masking is performed on the pixel locations in the differential response map where the grayscale response value is lower than a preset dynamic fluctuation threshold to obtain a stable pixel spatial distribution mask for the target region. Based on the stable pixel spatial distribution mask, an eight-neighbor region adjacency graph traversal is performed on the temporal stable pixels of the stable pixel region to obtain the connected component labeling map of the target region; edge pixel tracking is performed on the connected components in the connected component labeling map to obtain the contour descriptor tensor of the target region. Channel pixel values are extracted from the pixel regions covered by the connected components in the connected component marker map to obtain the spectral feature tensor of the target region; The contour descriptor tensor and the spectral feature tensor are dimensionally aligned and encapsulated to obtain the rock debris feature tensor set of the target region.
[0027] The step of performing edge pixel tracking on the connected components in the connected component marker map to obtain the contour descriptor tensor of the target region includes: Based on the connected component marker map, the boundary starting pixels of the connected components are initialized with eight-neighbor directional encoding to obtain the initial tracking base point of the target region; Starting from the initial tracking base point, a counterclockwise neighborhood traversal is performed on the initial tracking base point, and the initial tracking base point and subsequent boundary points are encoded by direction vector to obtain the local chain code fragment of the target region. The successor boundary point is updated to the current tracking base point, and the neighborhood traversal and direction vector encoding are repeated to obtain the original chain code sequence of the target region. The original chain code sequence is subjected to Fourier contour descriptor transform to obtain the contour descriptor of the target region; The contour descriptors of the connected components in the connected component marker map are tensorized and stacked to obtain the contour descriptor tensor of the target region.
[0028] A convolution kernel of a preset size is selected to perform pixel-by-pixel convolution operation on two adjacent frames in the original image frame sequence according to the acquisition time. The pixel values obtained after the operation are converted to grayscale. The grayscale values of corresponding pixels in adjacent frames are calculated by difference. The grayscale difference results of all pixels are integrated to form the differential response map of the target area.
[0029] The preset dynamic fluctuation threshold is retrieved, and the grayscale response value in the differential response map is read pixel by pixel. Pixels with grayscale response values less than the threshold are marked as valid pixels and assigned a value of 1, while pixels with grayscale response values greater than or equal to the threshold are marked as invalid pixels and assigned a value of 0. All marking results are integrated according to the pixel coordinate distribution of the differential response map to form a stable pixel spatial distribution mask for the target area.
[0030] Using the temporally stable pixels with a value of 1 in the stable pixel spatial distribution mask as the traversal object, starting from the first temporally stable pixel in the upper left corner of the mask, pixel search is performed on the eight neighboring regions of each pixel in the directions of the top, bottom, left, right and four diagonals. Adjacent temporally stable pixels are grouped into the same connected component and assigned the same identification number. After the traversal is completed, all connected components with identification numbers are integrated to form a connected component label map of the target region.
[0031] Based on the identifier number of each connected component in the connected component marker map, the edge pixels of each connected component are located one by one. Starting from the first edge pixel of each connected component, the pixel trajectory is continuously tracked, the coordinate information of the tracked edge pixels is extracted and converted into contour feature data, and the contour feature data of all connected components are integrated according to the tensor dimension rule to form the contour descriptor tensor of the target region.
[0032] According to the pixel region range of each connected component in the connected component marker spectrum, the pixel values of all pixels in the red, green and blue channels of each region are extracted. The extracted channel pixel values are characterized and organized. The spectral feature data of all connected components are integrated according to the tensor dimension rules to form the spectral feature tensor of the target region.
[0033] The dimensional information of the contour descriptor tensor and the spectral feature tensor is retrieved. Based on the identification number of the connected components, the dimensional hierarchy and data dimension of the two tensors are calibrated to ensure that the dimensional information of the two tensors are completely matched. The dimensionally aligned contour descriptor tensor and the spectral feature tensor are then encapsulated to form a rock debris feature tensor set for the target region.
[0034] Based on the pixel coordinate range of each connected component in the connected component marker map, the outermost boundary pixel of each connected component is located. This pixel is used as the boundary start pixel of the connected component. The eight neighboring regions of the boundary start pixel in the top, bottom, left, right and four diagonal directions are oriented and assigned values. The boundary start pixel after the encoding and assignment is the initial tracking base point of the target area.
[0035] Centered on the pixel position of the initial tracking base point, perform position-by-position pixel retrieval of its eight neighboring regions in a counterclockwise order of top left, top, top right, right, bottom right, bottom, bottom left, left. The retrieved connected component boundary pixels are the successor boundary points. Determine the direction vector based on the relative position of the initial tracking base point and the successor boundary points and complete the encoding. The encoding result of this direction vector is the local chain code segment of the target region.
[0036] Replace the pixel coordinates of the initial tracking base point with the pixel coordinates of the retrieved successor boundary point to become the new current tracking base point. Continue to perform neighborhood traversal according to the same counterclockwise eight-neighborhood retrieval rule. At the same time, complete the direction vector encoding based on the relative position of the new current tracking base point and the new successor boundary point. Continue to repeat this operation until the initial tracking base point is tracked back. Integrate all the generated local chain code fragments to obtain the original chain code sequence of the target region.
[0037] The original chain code sequence is continuously extracted into sequence data, which is then converted into continuous contour feature data. The contour feature data is then transformed into frequency domain data, retaining the low-frequency feature portion and removing the high-frequency feature portion. The processed frequency domain data is then restored into spatial domain contour feature information, which is the contour descriptor of the target region.
[0038] According to the identification number order of each connected component in the connected component label map, the contour descriptors corresponding to each connected component are arranged and stacked in sequence according to the preset tensor dimension rules, so that all contour descriptors form a tensor data volume with a unified dimensional structure. This tensor data volume is the contour descriptor tensor of the target region.
[0039] The beneficial effects are as follows: Based on the detection of gray-level changes between adjacent frames in the original image frame sequence, stable pixel region connected component analysis is carried out. Convolutional filtering is used to accurately capture the gray-level differences between frames to form a differential response map. Combined with a preset threshold, binary mask marking is completed to achieve accurate positioning of stable pixels. Then, through eight-neighbor traversal, the connected components are effectively identified and marked. Fine edge pixel tracking is carried out for the connected components. Chain code sequence extraction and transformation are completed through eight-neighbor direction encoding initialization, counterclockwise neighborhood traversal and direction vector encoding. Contour descriptors are accurately generated and tensorized and stacked into contour descriptor tensors. At the same time, the channel pixel values of the connected components are extracted to form spectral feature tensors. After dimension alignment and encapsulation, the rock cutting feature tensor set is obtained. The whole process realizes the fine processing of rock cutting features from pixel level detection to tensor level integration. The contour and spectral core features of rock cuttings are accurately extracted, ensuring the integrity and accuracy of the rock cutting feature tensor set. This provides highly reliable feature data support for subsequent registration and conversion of rock cutting features and lithology discrimination, and improves the accuracy and effectiveness of automatic identification of formation lithology while drilling from the feature extraction level.
[0040] S3. Based on a preset standard stratigraphic map library, perform affine invariant moment registration on the contour descriptors in the rock debris feature tensor set, and perform chromaticity space transformation on the spectral features in the rock debris feature tensor set to obtain the shape similarity coefficient and spectral matching index of the target area. In this embodiment of the invention, the process of performing affine invariant moment registration on the contour descriptors in the rock debris feature tensor set based on a preset standard stratigraphic map library, and performing chromaticity space transformation on the spectral features in the rock debris feature tensor set to obtain the shape similarity coefficient and spectral matching index of the target area, includes: The contour descriptors in the rock debris feature tensor set are fitted with the standard contour primitive sequences in the standard stratigraphic library to obtain the optimal affine transformation matrix for the target area. Based on the optimal affine transformation matrix, the contour descriptor is mapped to the coordinate space of the standard contour primitive, and the mapped contour descriptor and the standard contour primitive are paired with shape context feature points to obtain the shape similarity coefficient of the target region. The spectral feature quantities in the rock debris feature tensor set are mapped from the red-green-blue hue space to the uniform hue space to obtain the spectral feature vector of the target region; The spectral feature vectors are compared with the standard spectral templates in the standard stratigraphic library, and the extracted channel chromatic difference vectors are then fused by modulus weighting to obtain the spectral matching index of the target region.
[0041] All contour descriptors are extracted from the rock debris feature tensor set. At the same time, the preset standard contour primitive sequence in the standard stratigraphic library is retrieved. The contour descriptors and the standard contour primitive sequence are matched point by point with geometric transformation parameters. The combination of translation, rotation and scaling transformation methods is tried in turn. The combination of transformation parameters that makes the contours of the two the highest overlap is selected. The combined parameters are integrated to form the optimal affine transformation matrix of the target area.
[0042] All parameters of the optimal affine transformation matrix are retrieved. According to the coordinate transformation rules of the matrix, the coordinates of each feature point of the contour descriptor in the rock debris feature tensor set are mapped to the coordinate space corresponding to the standard contour primitive to obtain the mapped contour descriptor. Then, the mapped contour descriptor and the standard contour primitive are paired one-to-one with the shape context feature points. Based on the comprehensive judgment result of the pairing overlap degree and position deviation degree of the feature points, the shape similarity coefficient of the target area is generated.
[0043] All spectral features are extracted from the rock debris feature tensor set. These features are initially constructed based on the pixel channel values in the red-green-blue hue space. According to the preset hue space conversion rules, the three-channel pixel values in the red-green-blue hue space are converted one by one into the corresponding channel values in the uniform hue space. All the converted channel values are integrated to form a spectral feature vector of the target region with uniform dimension.
[0044] The standard spectral template corresponding to the rock fragment features is retrieved from the standard stratigraphic map library. The pixel value difference between the spectral feature vector and the standard spectral template is calculated for each channel according to the same channel position. The color difference vector of each channel is extracted. Then, according to the preset weight ratio of each channel in colorimetric recognition, the color difference vectors of all channels are weighted and fused by the modulus. The spectral matching index of the target area is generated based on the fusion result.
[0045] The beneficial effects include the registration and transformation of cuttings features based on a pre-set standard stratigraphic library. The optimal affine transformation matrix is obtained by fitting the contour descriptor and the standard contour primitive sequence with affine transformation parameters, achieving accurate mapping of contour features in the standard coordinate space. The shape similarity coefficient, formed by pairing shape context feature points, accurately quantifies the matching degree between the cuttings contour and the standard contour. Simultaneously, spectral features are mapped from the red-green-blue hue space to a uniform chromaticity space to form spectral feature vectors, eliminating the visual bias of the chromaticity space itself. The spectral matching index, obtained through channel-by-channel chromaticity difference vector extraction and modulus-weighted fusion, accurately quantifies the fit between the cuttings spectrum and the standard spectrum. This process achieves standardized and quantitative analysis of cuttings contour and spectral features throughout, providing precise numerical references for lithology identification, effectively improving the accuracy and rationality of cuttings feature matching, laying a solid foundation for subsequent accurate stratigraphic lithology identification, and ensuring the reliability and scientific rigor of the feature matching stage during drilling lithology identification.
[0046] S4. Based on the shape similarity coefficient and the spectral matching index, retrieve the stratigraphic lithology identification code from the standard spectral library of the target area to obtain the preliminary lithology discrimination label of the target area; In this embodiment of the invention, the step of retrieving stratigraphic lithology identification codes from the standard spectral library of the target region based on the shape similarity coefficient and the spectral matching index to obtain preliminary lithological discrimination labels for the target region includes: The shape similarity coefficient is compared with a preset shape matching tolerance, and the spectral matching index is compared with a preset spectral matching threshold to obtain the shape pass mark and spectral pass mark of the target area. Based on the shape via marker and the spectral via marker, a hash mapping is performed on the contour identifiers in the rock debris feature tensor set to obtain the contour index key value of the target region; The spectral feature fingerprints of the spectral feature quantities in the rock debris feature tensor set are subjected to feature encoding and matching, and the spectral index key values of the target region are retrieved from the standard spectral library; Using the combination of the contour index key value and the spectral index key value as a composite query condition, a joint primary key retrieval is performed in the lithological association table of the standard spectral library to obtain the stratigraphic lithology coding field of the target area; The stratigraphic lithology coding field is associated and bound with the timestamp of the original image frame sequence to encapsulate and obtain the preliminary lithology discrimination label of the target area.
[0047] The step of associating and binding the stratigraphic lithology coding field with the timestamp of the original image frame sequence further includes: The shape similarity coefficient and the spectral matching index are read, and preset shape matching tolerance, spectral matching threshold, confidence weight factor, nonlinear shape index, and nonlinear spectral index are obtained. The shape similarity coefficient and the spectral matching index are fused using the following formula to obtain the lithological discrimination confidence level of the target area, wherein the lithological discrimination confidence level is calculated using the following formula: ; In the formula, The confidence level for the lithology discrimination is... The shape similarity coefficient is... To provide a tolerance for the shape, The spectral matching index is... The spectral matching threshold is... The preset weighting factors, For the preset nonlinear shape index, This is a preset nonlinear spectral index; The lithology discrimination confidence level is associated with and stored with the stratigraphic lithology coding field, and the lithology discrimination confidence level is encapsulated as an additional attribute field to obtain the preliminary lithology discrimination label for the target area.
[0048] The preset shape matching tolerance and spectral matching threshold are retrieved. The shape similarity coefficient is compared with the shape matching tolerance. If the shape similarity coefficient is greater than or equal to the shape matching tolerance, it is marked as a shape pass; otherwise, it is marked as a shape fail. At the same time, the spectral matching degree index is compared with the spectral matching threshold. If the spectral matching degree index is greater than or equal to the spectral matching threshold, it is marked as a spectral pass; otherwise, it is marked as a spectral fail. In this way, the shape pass and spectral pass indicators of the target area are obtained.
[0049] When the shape pass marker and the spectral pass marker are in the pass state, the contour identifiers in the rock debris feature tensor set are extracted. According to the preset hash mapping rules, the character information of the contour identifiers is converted into fixed-length numerical information, which is the contour index key value of the target area.
[0050] Spectral fingerprints of spectral features are extracted from the rock debris feature tensor set. The spectral fingerprints are then encoded and converted according to the preset feature coding rules in the standard stratigraphic map library. The converted encoded information is then fully matched and searched in the spectral index library of the standard stratigraphic map library. The corresponding numerical information obtained after a successful match is the spectral index key value of the target area.
[0051] Using the contour index key value and the spectral index key value as composite query conditions, a joint primary key retrieval operation is performed in the lithology association table of the standard stratigraphic map library. During the retrieval, the two key values are precisely matched with the preset joint primary key field in the lithology association table. After a successful match, the corresponding lithology code information is retrieved, which is the stratigraphic lithology code field of the target area.
[0052] The timestamp information corresponding to the collection time of rock cuttings features in the original image frame sequence is extracted, and the stratigraphic lithology coding field is associated and bound to the timestamp information one-to-one. At the same time, the shape pass mark, spectral pass mark, contour index key value, and spectral index key value are integrated as auxiliary information. All information is uniformly encapsulated according to the preset data encapsulation format. The encapsulated data package is the preliminary lithology discrimination label of the target area.
[0053] The shape similarity coefficient and spectral matching index of the target area are extracted from the lithological feature matching results data. At the same time, the shape matching tolerance, spectral matching threshold, confidence weight factor, nonlinear shape index, and nonlinear spectral index set for lithological discrimination are retrieved from the preset parameter library of the standard stratigraphic map library. All parameters are preset fixed reference values in the field of stratigraphic lithology identification, and all parameters and indices are retrieved and collected in a unified manner.
[0054] The shape similarity coefficient is ratioed to the shape matching tolerance, and the result is exponentially processed using a nonlinear shape exponent. This result is then multiplied by the confidence weight factor to obtain the confidence component of the shape dimension. The spectral matching index is ratioed to the spectral matching threshold, and the result is exponentially processed using a nonlinear spectral exponent. This result is then multiplied by the complement of the confidence weight factor to obtain the confidence component of the spectral dimension. The confidence components of the two dimensions are summed to obtain the lithological discrimination confidence of the target area.
[0055] Establish a one-to-one correspondence between the stratigraphic lithology coding field and the lithology discrimination confidence level, and store the lithology discrimination confidence level as an auxiliary data of the stratigraphic lithology coding field synchronously to ensure that the two remain associated and inseparable during data retrieval and retrieval.
[0056] The lithology discrimination confidence level is treated as an independent additional attribute field and integrated into the data packet structure of the preliminary lithology discrimination label. It is then integrated with the encapsulated stratigraphic lithology coding field, the timestamp of the original image frame sequence, and other information. The data is standardized and encapsulated according to the preset label data encapsulation format to obtain the preliminary lithology discrimination label of the target area.
[0057] The shape similarity coefficient and spectral matching index used in the lithology discrimination confidence calculation are quantitative results obtained after registering and transforming the rock cutting feature tensor set. The shape matching tolerance and spectral matching threshold are fixed judgment thresholds pre-set for stratigraphic lithology identification in the standard stratigraphic map library. The confidence weight factor is a fixed coefficient pre-set based on the actual influence ratio of contour features and spectral features in lithology discrimination. The nonlinear shape index and nonlinear spectral index are fixed indices pre-set to conform to the nonlinear law of lithology discrimination feature matching. All relevant values involved in the calculation come from the feature analysis results in the stratigraphic lithology identification process and the preset standard parameter library.
[0058] The calculation process involves ratioing the shape similarity coefficient to the shape matching tolerance, then performing a power transformation using a nonlinear shape index, followed by weighting with a confidence weighting factor. Simultaneously, the spectral matching index is ratioed to the spectral matching tolerance, then combined with a nonlinear spectral index for a power transformation, and finally weighted with the complement of the confidence weighting factor. The two weighted results are then fused to obtain a lithology discrimination confidence level that comprehensively reflects the degree of matching between contour features and spectral features. This result is encapsulated as an additional attribute field in the preliminary lithology discrimination label, directly demonstrating the reliability of lithology discrimination and providing a quantitative confidence reference for stratigraphic lithology identification results. This gives the lithology discrimination label a more comprehensive information dimension, enhancing the reference value and verifiability of lithology identification results.
[0059] The beneficial effects are as follows: preliminary screening of lithological features is achieved through threshold discrimination using shape similarity coefficient and spectral matching index; accurate acquisition of contour and spectral index key values is achieved by relying on hash mapping and feature coding matching; efficient retrieval of stratigraphic lithology coding fields is achieved by using composite query conditions; and the association and binding of lithology coding fields is completed by combining timestamps. At the same time, the confidence level of lithology discrimination is calculated by integrating shape and spectral related feature parameters and encapsulated as an additional attribute into the preliminary lithology discrimination label. This not only realizes the accurate retrieval of stratigraphic lithology identification codes and the standardized generation of lithology discrimination labels, but also adds a quantitative confidence reference dimension to the lithology discrimination results. This allows the preliminary lithology discrimination labels to have both lithology identification information and discrimination reliability information, improving the information integrity and reference value of the lithology discrimination results. Meanwhile, the standardized retrieval and encapsulation process ensures the efficiency and accuracy of the generation of preliminary lithology discrimination labels, providing high-quality basic data support for subsequent depth domain calibration and lithology map rendering.
[0060] S5. Perform field parsing on the drilling engineering parameters of the original image frame sequence to obtain the drilling time parameter sequence and well depth parameter sequence of the target area; In this embodiment of the invention, the step of parsing the drilling engineering parameters of the original image frame sequence to obtain the drilling time parameter sequence and well depth parameter sequence of the target area includes: Read the original record file of drilling engineering parameters from the original image frame sequence, and perform binary stream parsing on the original record file of drilling engineering parameters to obtain the pure parameter data body of the target area; Based on the preset field delimiter, the pure parameter data body is segmented by field to obtain the original drilling time value stream and the original well depth value stream of the target area; Abnormal spikes are filtered out from the original drilling time data stream and the original well depth data stream to obtain the drilling time data sequence and well depth data sequence for the target area. The drilling time numerical sequence is timestamped and resampled to obtain the drilling time parameter sequence for the target area; The well depth numerical sequence is subjected to depth zero-point correction to obtain the well depth parameter sequence for the target area.
[0061] Retrieve the original record file of drilling engineering parameters corresponding to the original image frame sequence from the storage medium. Read all data in the file byte by byte according to the binary data reading rules. Remove non-parameter related data such as format identifiers and check codes from the file. Only retain the valid binary data that reflects the engineering parameters. Integrate all valid binary data to form a pure parameter data body for the target area.
[0062] The preset field separator is retrieved. This separator is a fixed character combination set in the drilling engineering parameter record. Based on this separator, the pure parameter data body is continuously segmented. All data segments corresponding to the drilling time parameters after segmentation are integrated into a continuous data stream to obtain the original drilling time value stream of the target area. All data segments corresponding to the well depth parameters after segmentation are integrated into a continuous data stream to obtain the original well depth value stream of the target area.
[0063] A threshold for judging numerical fluctuations is set. This threshold is a fixed value preset based on the fluctuation range of conventional parameters during drilling operations. The values in the original drilling time data stream and the original well depth data stream are read point by point. Values whose difference with adjacent values exceeds the threshold are judged as abnormal peak values. All abnormal peak values are directly removed. The drilling time values after removal are arranged continuously in the acquisition order to obtain the drilling time value sequence of the target area. The well depth values after removal are arranged continuously in the acquisition order to obtain the well depth value sequence of the target area.
[0064] The unified timestamp acquisition interval of the original image frame sequence is retrieved, and the corresponding timestamp information is supplemented to the drilling time value sequence according to this fixed time interval. Timestamp nodes in the drilling time value sequence without corresponding values are interpolated to complete the sequence, ensuring a perfect match between the completed drilling time value sequence and the timestamps of the original image frame sequence, thus forming the drilling time parameter sequence for the target area. The zero-point reference position for the drilling operation is determined. This position is a fixed well depth reference point calibrated before drilling operations. All well depth values in the well depth value sequence are subtracted from the value corresponding to the zero-point reference position to complete the reference correction for all well depth values. The corrected well depth values are then arranged continuously in the acquisition order to form the well depth parameter sequence for the target area.
[0065] The beneficial effects include standardized field parsing of the drilling engineering parameters corresponding to the original image frame sequence, accurate extraction of pure parameter data through binary stream parsing, elimination of invalid format data to ensure the purity of parameter data, accurate segmentation of drilling time and well depth numerical streams based on preset field separators to achieve effective separation of the two types of parameter data, removal of abnormal values in the parameter data through abnormal peak filtering to ensure the accuracy and continuity of drilling time and well depth numerical sequences, timestamp resampling of the drilling time numerical sequence to achieve temporal dimension matching with the original image frame sequence, and depth zero-point correction of the well depth numerical sequence to unify the measurement benchmark of well depth parameters. Finally, standardized and normalized drilling time parameter sequences and well depth parameter sequences are obtained, providing accurate and matching engineering parameter data support for subsequent depth domain calibration of lithology discrimination labels and fusion rendering of lithology maps, ensuring the synergy between drilling engineering parameters and lithology identification data, and improving the data matching degree and application effectiveness of overall drilling formation lithology identification.
[0066] S6. Perform depth domain calibration on the preliminary lithology discrimination label and the well depth parameter sequence to obtain the lithology columnar plot data stream of the target area, and fuse and render the lithology columnar plot data stream with the drilling time parameter sequence to obtain the real-time drilling lithology interpretation map of the target area.
[0067] In this embodiment of the invention, the step of performing depth domain calibration on the preliminary lithology discrimination label and the well depth parameter sequence to obtain a lithology columnar section data stream for the target area, and fusing and rendering the lithology columnar section data stream with the drilling time parameter sequence to obtain a real-time drilling lithology interpretation map of the target area, includes: Based on the timestamp information of the preliminary lithology discrimination label, labels are attached to the well depth node values in the well depth parameter sequence to obtain the depth domain lithology point sequence table of the target area. Neighborhood voting smoothing is performed on the lithological abrupt change interfaces between adjacent well depth nodes in the depth domain lithological point sequence list to obtain the depth domain lithological segmentation sequence of the target area. Based on the filling legend and texture identifier of lithology categories in the depth domain lithology segment sequence, the map is rasterized with well depth as the vertical axis and lithology category as the horizontal axis to obtain the lithology columnar map data stream of the target area; The drilling time values in the drilling time parameter sequence are mapped by curve amplitude. A curve trajectory is generated with well depth as the vertical axis and drilling time amplitude as the horizontal axis to obtain the drilling time curve data layer of the target area. Using the lithology columnar data stream as the base map layer and the drilling time curve data layer as the overlay map layer, layer registration is performed to obtain the real-time drilling lithology interpretation map of the target area.
[0068] Extract the timestamp information carried in the preliminary lithology discrimination label, associate the timestamp information with the well depth node value corresponding to the acquisition time in the well depth parameter sequence, attach all the information of the preliminary lithology discrimination label to the matching well depth node value, integrate all the well depth node values with completed label attachment and lithology discrimination information, and arrange them in order from shallow to deep well depth values to obtain the depth domain lithology point sequence table of the target area.
[0069] The lithology discrimination information corresponding to adjacent well depth nodes in the depth domain lithology point sequence table is extracted group by group. If there is a difference in lithology category between adjacent nodes, it is determined to be a lithology abrupt change interface. Taking this abrupt change interface as the center, a preset number of adjacent well depth nodes are selected as the neighborhood range. The occurrence frequency of each lithology category within the neighborhood range is counted. The lithology category with the most occurrence frequency is taken as the final lithology category at the interface. After completing this processing for all lithology abrupt change interfaces, the lithology segment information after division is integrated according to the well depth order to obtain the depth domain lithology segment sequence of the target area.
[0070] Retrieve the preset fill legends and texture labels corresponding to each lithology category in the lithology segment sequence of the depth domain, establish a drawing coordinate system with well depth value as the vertical axis and lithology category as the horizontal axis, and fill the fill legends and texture labels corresponding to each lithology segment into the raster area of the corresponding well depth range according to the pixel raster division rules of the coordinate system. After completing the rasterization drawing of all lithology segments, integrate the pixel data and coordinate information of the drawing to obtain the lithology columnar plot data stream of the target area.
[0071] Extract all drilling time values from the drilling time parameter sequence, convert the drilling time values into corresponding horizontal axis pixel values in the drawing coordinate system according to the preset amplitude mapping rules, use the well depth values in the well depth parameter sequence as the vertical axis and the converted horizontal axis pixel values as coordinate points, connect all coordinate points in sequence to form a continuous curve trajectory, integrate the coordinate data, amplitude information and well depth correlation data of the curve trajectory to obtain the drilling time curve data layer of the target area.
[0072] Using the lithology columnar plot data stream as the base map layer and the drilling time curve data layer as the overlay layer, with well depth values as the unified registration benchmark, the coordinate origin, pixel ratio, and well depth of the two layers are precisely aligned to ensure that the drilling time curve trajectory of the overlay layer and the lithology segment of the base map layer are completely matched in the well depth dimension. After completing the layer registration, all data information from the two layers is integrated to obtain a real-time drilling lithology interpretation map of the target area.
[0073] The beneficial effects include: accurately calibrating and attaching preliminary lithology identification labels and well depth parameter sequences using timestamp information to achieve deep correlation between lithology information and well depth data; optimizing the judgment results of lithology abrupt change interfaces through neighborhood voting smoothing, making the depth domain lithology segment sequence more closely match the actual formation lithology distribution characteristics; completing the rasterization of lithology columnar plots based on standardized fill legends, texture markers, and coordinate systems to form a structured lithology columnar plot data stream; simultaneously, amplitude mapping and curve trajectory generation of drilling time parameters to obtain drilling time curve data layers; and then completing the layer registration and fusion rendering of lithology columnar plots and drilling time curves using well depth as a unified benchmark to output visualized real-time drilling lithology interpretation maps, achieving an intuitive fusion presentation of formation lithology distribution and drilling engineering parameters, giving lithology identification results a visualized and intuitive expression, facilitating the rapid acquisition of the vertical distribution patterns of formation lithology and their correlation characteristics with drilling time parameters during drilling operations, improving the practical application efficiency of lithology identification results, and providing accurate and intuitive geological data support for real-time decision-making in drilling operations.
[0074] like Figure 2 The diagram shown is a functional module diagram of an automatic formation lithology identification system provided in an embodiment of the present invention.
[0075] The automatic formation lithology identification system 100 described in this invention can be installed in an electronic device. Depending on the functions implemented, the automatic formation lithology identification system 100 may include an image frame sequence decoding module 101, a cuttings feature tensor parsing module 102, a cuttings feature registration and conversion module 103, a preliminary lithology label discrimination module 104, a drilling parameter field parsing module 105, and a lithology map fusion and rendering module 106. The module described in this invention can also be called a unit, which refers to a series of computer program segments that can be executed by the processor of an electronic device and can perform a fixed function, stored in the memory of the electronic device.
[0076] In this embodiment, the functions of each module / unit are as follows: The image frame sequence decoding module 101 is used to perform frame decoding on the dynamic image stream of the target region to obtain the original image frame sequence of the target region. The rock debris feature tensor parsing module 102 is used to perform connected component parsing on the stable pixel region of the original image frame sequence based on the grayscale change detection results of adjacent frame images in the original image frame sequence, so as to obtain the rock debris feature tensor set of the target region. The rock debris feature registration and conversion module 103 is used to perform affine invariant moment registration on the contour descriptors in the rock debris feature tensor set based on a preset standard stratigraphic map library, and to perform chromaticity space conversion on the spectral features in the rock debris feature tensor set to obtain the shape similarity coefficient and spectral matching index of the target area. The preliminary lithology labeling module 104 is used to retrieve the stratigraphic lithology identification code from the standard spectral library of the target area based on the shape similarity coefficient and the spectral matching index, so as to obtain the preliminary lithology label of the target area; The drilling parameter field parsing module 105 is used to parse the drilling engineering parameters of the original image frame sequence to obtain the drilling time parameter sequence and well depth parameter sequence of the target area; The lithology map fusion rendering module 106 is used to perform depth domain calibration on the preliminary lithology discrimination label and the well depth parameter sequence to obtain the lithology columnar plot data stream of the target area, and to fuse and render the lithology columnar plot data stream with the drilling time parameter sequence to obtain the real-time drilling lithology interpretation map of the target area.
[0077] In the several embodiments provided by this invention, it should be understood that the disclosed methods and systems can be implemented in other ways. For example, the system embodiments described above are merely illustrative; for instance, the division of modules is only a logical functional division, and other division methods may be used in actual implementation.
[0078] The modules described as separate components may or may not be physically separate. The components shown as modules may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.
[0079] Furthermore, the functional modules in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or in the form of hardware plus software functional modules.
[0080] It will be apparent to those skilled in the art that the present invention is not limited to the details of the exemplary embodiments described above, and that the present invention can be implemented in other specific forms without departing from the spirit or essential characteristics of the present invention.
[0081] This application embodiment can acquire and process relevant data based on artificial intelligence technology. Artificial intelligence is the theory, method, technology, and application system that uses digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use that knowledge to obtain optimal results.
[0082] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention.
Claims
1. A method for automatic identification of formation lithology while drilling, characterized in that, The method includes: S1. Perform frame decoding on the dynamic image stream of the target region to obtain the original image frame sequence of the target region; S2. Based on the grayscale change detection results of adjacent frames in the original image frame sequence, perform connected component analysis on the stable pixel region of the original image frame sequence to obtain the rock debris feature tensor set of the target region; S3. Based on a preset standard stratigraphic map library, perform affine invariant moment registration on the contour descriptors in the rock debris feature tensor set, and perform chromaticity space transformation on the spectral features in the rock debris feature tensor set to obtain the shape similarity coefficient and spectral matching index of the target area. S4. Based on the shape similarity coefficient and the spectral matching index, retrieve the stratigraphic lithology identification code from the standard spectral library of the target area to obtain the preliminary lithology discrimination label of the target area; S5. Perform field parsing on the drilling engineering parameters of the original image frame sequence to obtain the drilling time parameter sequence and well depth parameter sequence of the target area; S6. Perform depth domain calibration on the preliminary lithology discrimination label and the well depth parameter sequence to obtain the lithology columnar plot data stream of the target area, and fuse and render the lithology columnar plot data stream with the drilling time parameter sequence to obtain the real-time drilling lithology interpretation map of the target area.
2. The method for automatic formation lithology identification while drilling as described in claim 1, characterized in that, The step of performing frame decoding on the dynamic image stream of the target region to obtain the original image frame sequence of the target region includes: Read the data buffer queue of the dynamic image stream in the target area, and perform protocol parsing on the data packets in the data buffer queue to obtain the video basic stream of the target area; Entropy decoding is performed on the video elementary stream to obtain single-frame image data of the target region; The macroblock partitioning information, motion vector field and residual coefficients of the single frame image data are used to reconstruct the image to obtain the image frame of the target region. The image frames are labeled with their frame types, duplicate and corrupted frames are removed, and the image frames are rearranged in the order of acquisition time to obtain the original image frame sequence of the target area.
3. The method for automatic formation lithology identification while drilling as described in claim 1, characterized in that, Based on the grayscale change detection results of adjacent frames in the original image frame sequence, connected component analysis is performed on the stable pixel regions of the original image frame sequence to obtain the rock debris feature tensor set of the target region, including: Convolutional filtering is performed on adjacent frames in the original image frame sequence to obtain the differential response map of the target region; Binary masking is performed on the pixel locations in the differential response map where the grayscale response value is lower than a preset dynamic fluctuation threshold to obtain a stable pixel spatial distribution mask for the target region. Based on the stable pixel spatial distribution mask, an eight-neighbor region adjacency graph traversal is performed on the temporal stable pixels of the stable pixel region to obtain the connected component labeling map of the target region; edge pixel tracking is performed on the connected components in the connected component labeling map to obtain the contour descriptor tensor of the target region. Channel pixel values are extracted from the pixel regions covered by the connected components in the connected component marker map to obtain the spectral feature tensor of the target region; The contour descriptor tensor and the spectral feature tensor are dimensionally aligned and encapsulated to obtain the rock debris feature tensor set of the target region.
4. The method for automatic formation lithology identification while drilling as described in claim 3, characterized in that, The step of performing edge pixel tracking on the connected components in the connected component marker map to obtain the contour descriptor tensor of the target region includes: Based on the connected component marker map, the boundary starting pixels of the connected components are initialized with eight-neighbor directional encoding to obtain the initial tracking base point of the target region; Starting from the initial tracking base point, a counterclockwise neighborhood traversal is performed on the initial tracking base point, and the initial tracking base point and subsequent boundary points are encoded by direction vector to obtain the local chain code fragment of the target region. The successor boundary point is updated to the current tracking base point, and the neighborhood traversal and direction vector encoding are repeated to obtain the original chain code sequence of the target region. The original chain code sequence is subjected to Fourier contour descriptor transform to obtain the contour descriptor of the target region; The contour descriptors of the connected components in the connected component marker map are tensorized and stacked to obtain the contour descriptor tensor of the target region.
5. The method for automatic formation lithology identification while drilling as described in claim 1, characterized in that, The method, based on a preset standard stratigraphic library, performs affine invariant moment registration on the contour descriptors in the rock debris feature tensor set, and performs chromaticity space transformation on the spectral features in the rock debris feature tensor set to obtain the shape similarity coefficient and spectral matching index of the target area, including: The contour descriptors in the rock debris feature tensor set are fitted with the standard contour primitive sequences in the standard stratigraphic library to obtain the optimal affine transformation matrix for the target area. Based on the optimal affine transformation matrix, the contour descriptor is mapped to the coordinate space of the standard contour primitive, and the mapped contour descriptor and the standard contour primitive are paired with shape context feature points to obtain the shape similarity coefficient of the target region. The spectral feature quantities in the rock debris feature tensor set are mapped from the red-green-blue hue space to the uniform hue space to obtain the spectral feature vector of the target region; The spectral feature vectors are compared with the standard spectral templates in the standard stratigraphic library, and the extracted channel chromatic difference vectors are then fused by modulus weighting to obtain the spectral matching index of the target region.
6. The method for automatic formation lithology identification while drilling as described in claim 1, characterized in that, The step of retrieving stratigraphic lithology identification codes from the standard spectral library of the target area based on the shape similarity coefficient and the spectral matching index to obtain preliminary lithological discrimination labels for the target area includes: The shape similarity coefficient is compared with a preset shape matching tolerance, and the spectral matching index is compared with a preset spectral matching threshold to obtain the shape pass mark and spectral pass mark of the target area. Based on the shape via marker and the spectral via marker, a hash mapping is performed on the contour identifiers in the rock debris feature tensor set to obtain the contour index key value of the target region; The spectral feature fingerprints of the spectral feature quantities in the rock debris feature tensor set are subjected to feature encoding and matching, and the spectral index key values of the target region are retrieved from the standard spectral library; Using the combination of the contour index key value and the spectral index key value as a composite query condition, a joint primary key retrieval is performed in the lithological association table of the standard spectral library to obtain the stratigraphic lithology coding field of the target area; The stratigraphic lithology coding field is associated and bound with the timestamp of the original image frame sequence to encapsulate and obtain the preliminary lithology discrimination label of the target area.
7. The method for automatic formation lithology identification while drilling as described in claim 6, characterized in that, The step of associating and binding the stratigraphic lithology coding field with the timestamp of the original image frame sequence further includes: The shape similarity coefficient and the spectral matching index are read, and preset shape matching tolerance, spectral matching threshold, confidence weight factor, nonlinear shape index, and nonlinear spectral index are obtained. The shape similarity coefficient and the spectral matching index are fused using the following formula to obtain the lithological discrimination confidence level of the target area, wherein the lithological discrimination confidence level is calculated using the following formula: ; In the formula, The confidence level for the lithology discrimination is... The shape similarity coefficient is... To provide a tolerance for the shape, The spectral matching index is... The spectral matching threshold is... The preset weighting factors, For the preset nonlinear shape index, This is a preset nonlinear spectral index; The lithology discrimination confidence level is associated with and stored with the stratigraphic lithology coding field, and the lithology discrimination confidence level is encapsulated as an additional attribute field to obtain the preliminary lithology discrimination label for the target area.
8. The method for automatic formation lithology identification while drilling as described in claim 1, characterized in that, The step of parsing the drilling parameters of the original image frame sequence to obtain the drilling time parameter sequence and well depth parameter sequence for the target area includes: Read the original record file of drilling engineering parameters from the original image frame sequence, and perform binary stream parsing on the original record file of drilling engineering parameters to obtain the pure parameter data body of the target area; Based on the preset field delimiter, the pure parameter data body is segmented by field to obtain the original drilling time value stream and the original well depth value stream of the target area; Abnormal spikes are filtered out from the original drilling time data stream and the original well depth data stream to obtain the drilling time data sequence and well depth data sequence for the target area. The drilling time numerical sequence is timestamped and resampled to obtain the drilling time parameter sequence for the target area; The well depth numerical sequence is subjected to depth zero-point correction to obtain the well depth parameter sequence for the target area.
9. The method for automatic formation lithology identification while drilling as described in claim 1, characterized in that, The process involves depth domain calibration of the preliminary lithology discrimination labels and the well depth parameter sequence to obtain a lithology columnar section data stream for the target area. This data stream is then fused and rendered with the drilling time parameter sequence to obtain a real-time drilling lithology interpretation map of the target area, including: Based on the timestamp information of the preliminary lithology discrimination label, labels are attached to the well depth node values in the well depth parameter sequence to obtain the depth domain lithology point sequence table of the target area. Neighborhood voting smoothing is performed on the lithological abrupt change interfaces between adjacent well depth nodes in the depth domain lithological point sequence list to obtain the depth domain lithological segmentation sequence of the target area. Based on the filling legend and texture identifier of lithology categories in the depth domain lithology segment sequence, the map is rasterized with well depth as the vertical axis and lithology category as the horizontal axis to obtain the lithology columnar map data stream of the target area; The drilling time values in the drilling time parameter sequence are mapped by curve amplitude. A curve trajectory is generated with well depth as the vertical axis and drilling time amplitude as the horizontal axis to obtain the drilling time curve data layer of the target area. Using the lithology columnar data stream as the base map layer and the drilling time curve data layer as the overlay map layer, layer registration is performed to obtain the real-time drilling lithology interpretation map of the target area.
10. An automatic formation lithology identification system while drilling, characterized in that, The system for implementing the automatic formation lithology identification method while drilling as described in claim 1 includes: The image frame sequence decoding module is used to perform frame decoding on the dynamic image stream of the target region to obtain the original image frame sequence of the target region. The rock debris feature tensor parsing module is used to perform connected component parsing on the stable pixel region of the original image frame sequence based on the grayscale change detection results of adjacent frame images in the original image frame sequence, so as to obtain the rock debris feature tensor set of the target region; The rock debris feature registration and conversion module is used to perform affine invariant moment registration on the contour descriptors in the rock debris feature tensor set based on a preset standard stratigraphic map library, and to perform chromaticity space conversion on the spectral features in the rock debris feature tensor set to obtain the shape similarity coefficient and spectral matching index of the target area. The preliminary lithology labeling module is used to retrieve stratigraphic lithology identification codes from the standard spectral library of the target area based on the shape similarity coefficient and the spectral matching index, and obtain the preliminary lithology labeling of the target area. The drilling parameter field parsing module is used to parse the drilling engineering parameters of the original image frame sequence to obtain the drilling time parameter sequence and well depth parameter sequence of the target area; The lithological map fusion rendering module is used to perform depth domain calibration on the preliminary lithological discrimination labels and the well depth parameter sequence to obtain the lithological columnar plot data stream of the target area, and to fuse and render the lithological columnar plot data stream with the drilling time parameter sequence to obtain the real-time drilling lithological interpretation map of the target area.