A vector space partitioning-based borehole columnar chart information extraction method and system
Patent Information
- Application Number
- CN202611085622.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-21
- Publication Date
- 2026-10-23
AI Technical Summary
[0026](2)如何自适应地实现表体区域的列分离:基于包围盒X区间重叠关系而非固定模板进行列分离,解决文字溢出跨列导致的列边界模糊问题
[0055]1、保留矢量坐标精确性,规避OCR根本失效。本发明直接在DWG矢量文本包围盒坐标系内运算,不进行栅格化,从根本上规避了文字重叠导致的OCR识别失效问题。每个文本实体的中心坐标、宽度、高度均精确可读,不存在像素覆盖与信息不可逆丢失。
Smart Images

Figure CN122964948A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of geological exploration data digitization and structured extraction technology, specifically to an automatic extraction method and system for structured data from borehole logs based on a vector space partitioning algorithm and a large language model. Background Technology
[0002] Borehole columnar sections are the most crucial output of geological exploration, recording key parameters such as lithology, depth, thickness, dip angle, and azimuth. They are the primary data source for 3D geological modeling (GemPy / GOCAD / Leapfrog / Surpac / 3DMine). However, DWG format borehole columnar sections generally suffer from severe format heterogeneity: different mining areas have vastly different header fields, number of columns, column order, and scales due to different CAD templates used by different geological exploration units; even within the same mining area, the columnar section format can change significantly over different periods due to personnel changes and standard adjustments.
[0003] 1. Overview of Existing Technologies
[0004] Searching the State Intellectual Property Office's patent publication system and Google Patents using terms such as "borehole columnar section," "structured data extraction," "DWG," "CAD vector," "table structure recognition," "column separation," and "large language model geological data," existing technologies can be categorized into the following three areas:
[0005] Direction 1: Methods for Extracting Borehole Columnar Data
[0006] (1) CN103714203A discloses an automatic generation method for borehole columnar plots based on CAD template binding technology. By using a custom CAD dynamic template configuration tool, configuration information, drawing coordinates, and attribute status are bound to CAD blocks and configured as templates to achieve automatic generation of reports and maps such as borehole stratigraphic systems. This patent is a forward generation from database to drawing (data to map), rather than a reverse extraction from drawing to data (map to data); it relies on predefined template binding rules and cannot handle non-standard columnar plots with heterogeneous formats.
[0007] (2) CN116166729A discloses a method for processing borehole columnar plot data. It reads GIS or CAD format borehole columnar plot engineering files, performs simplification processing to remove decorative elements, and then extracts borehole data in batches based on information and experience location sets. This method still requires converting the columnar plot into an Excel format table first, relies on a fixed "information and experience location set" template, and cannot adapt to the format heterogeneity of different mining areas and different eras; it does not support data checking and map positioning.
[0008] (3) CN118658174B discloses a method for digitizing borehole columnar sections based on structural pattern recognition. This method determines the left and right boundaries of the columnar section from the borehole columnar section file, identifies lithological symbols, segments the stratigraphic sections according to the lithological symbol boundaries, and matches each layer with a preset lithological identification database template to determine the lithological name. This patent only processes the single dimension of lithological symbol identification and cannot extract numerical parameters such as depth, thickness, dip angle, and azimuth angle; it relies on a preset lithological identification database template and lacks cross-mining area generalization capability.
[0009] (4) CN121904797A discloses an intelligent method for extracting key information from borehole columnar sections. The method divides the borehole columnar sections into key information blocks and uses OCR technology to recognize text in the key areas. This patent relies on OCR technology and cannot solve the recognition failure problem caused by overlapping DWG vector text; it only extracts three types of key information (number, name, and depth) and does not cover all parameters such as dip angle, azimuth angle, and coordinates.
[0010] (5) CN202210009620 discloses an automatic data extraction method based on DWG format static cone penetration test bar charts, which extracts basic data header information and hierarchical result information based on keywords. This patent is only applicable to the specific type of static cone penetration test bar charts. It extracts data by keyword matching, but cannot handle scenarios where keywords are missing or naming differences, and does not have cross-format generalization ability.
[0011] Direction 2: Table Structure Identification and Column Separation Methods
[0012] (6) CN121545174A discloses a table recognition method based on GNN and OCR system, which extracts visual features of table images and fuses them with text semantic features. It predicts the physical layout of cells based on CellPose segmentation network and uses GNN to infer the row and column relationships of cells. This method relies on a deep learning model (CellPose+GNN) and requires large-scale training data; it processes rasterized images rather than vector coordinates and cannot utilize the precise spatial information of DWG vector text; it cannot handle the text overflow phenomenon unique to CAD.
[0013] (7) CN114529777A discloses a table recognition method based on structural units, which divides text into rows and columns based on the position information of text detection boxes and uses the Hungarian algorithm to match text boxes in adjacent rows. This method is based on pixel-level text detection boxes and is suitable for raster images rather than vector coordinate data; it cannot handle the bounding box overlap and overflow across columns problems unique to CAD vector text.
[0014] Direction 3: Application of large language models in the field of geology
[0015] (8) CN120087465B discloses a method for extracting geological prospecting knowledge triples using prompt word engineering. It defines a prospecting knowledge graph ontology model and uses prompt word engineering to extract entity and relation triples from geological documents step by step. This method processes electronic text documents rather than DWG drawings; it extracts knowledge triples rather than structured numerical parameters; and it does not involve spatial geometric processing such as layout analysis and column separation.
[0016] (9) CN121685708A discloses a method for generating geological profile maps based on a large language model. It performs content positioning and text-image separation on geological reports, uses a large language model to parse text data to obtain structured data, and combines it with DEM data to generate geological profile maps. This patent is a forward generation (data to image) rather than a reverse extraction (image to data); it does not involve the layout parsing of DWG vector graphics.
[0017] 2. Shortcomings of existing technologies
[0018] In summary, the existing technologies exhibit the following insurmountable technological gaps:
[0019] (1) The fundamental failure of OCR / rasterization methods: In DWG vector text, a large number of text entities are spatially overlapping. After rasterization, the pixels in the overlapping area are covered by the subsequently drawn text, and the original text information is irreversibly lost. OCR methods are based on pixel pattern matching to recognize text, which is fundamentally ineffective in text overlapping scenarios.
[0020] (2) Multiple obstacles to template / keyword matching methods: Different mining areas have vastly different header fields, number of columns, column order, scale, and lithological description methods due to different geological exploration units and different CAD templates. The bar chart format of the same mining area will also change significantly over different years due to personnel changes, software upgrades, and standard adjustments. Methods that rely on predefined keywords or templates cannot cover format heterogeneity.
[0021] (3) Existing DWG parsing methods lack the ability to geometrically partition the layout: Existing DWG data extraction methods can only locate data areas by keyword matching, and cannot automatically identify the three-part layout structure of "table header-table body-table footer", nor can they handle column separation and text overflow issues within the table body area.
[0022] (4) Lack of automatic column semantic discrimination capability: All existing methods have failed to solve the core problem of "knowing the column location but not the column type". The column type is a prerequisite for subsequent parameter extraction. Existing methods either rely on manual annotation or fixed template mapping, neither of which has the ability to automatically discriminate across formats.
[0023] (5) Existing LLM geological applications do not involve drawing layout analysis: Existing LLM applications in the geological field all process electronic text or database data, and do not involve the core engineering problem of spatial layout analysis and structured data extraction of DWG vector drawings. Summary of the Invention
[0024] In view of the shortcomings of the prior art, the technical problem to be solved by the present invention is:
[0025] (1) How to achieve automatic recognition of the layout structure of the drilled column chart while preserving the accuracy of vector coordinates: Directly calculate within the coordinate system of the DWG vector text bounding box, without rasterization, avoid information loss caused by text overlap, and realize the three-segment layout division of "table header-table body-table footer".
[0026] (2) How to adaptively achieve column separation of the table body area: Column separation is based on the overlapping relationship of the bounding box X interval instead of a fixed template to solve the problem of blurred column boundaries caused by text overflow across columns.
[0027] (3) How to automatically determine the semantic type of a column: Construct a computable discrimination signal system, and automatically determine the semantic type of each column through multi-signal fusion adjudication without manual annotation or predefined templates.
[0028] (4) How to extract structured parameters from column text: Use the LLM Function Calling interface to force constraints on the output format, and use the Agent loop mechanism to achieve end-to-end structured extraction to eliminate output format uncertainty.
[0029] (5) How to organically combine deterministic geometric algorithms with LLM semantic reasoning: Construct a "rigid-flexible collaborative" pipeline. The rigid algorithm handles deterministic tasks such as layout partitioning and column separation, while the flexible LLM handles uncertain tasks such as semantic understanding and parameter extraction. The two are bridged by column type discrimination signals.
[0030] To address the aforementioned technical issues, this invention proposes a borehole column chart information extraction method based on vector space partitioning. The overall architecture adopts a "rigid-flexible collaborative" approach: a deterministic vector space partitioning algorithm (MBAP+XOCP) is used to process the geometric structure recognition of the layout, while LLM is used to flexibly process semantic understanding and parameter extraction. The two are bridged by multi-signal fusion and column type discrimination to form an end-to-end automatic extraction pipeline from DWG vector text to 9 columns of standardized structured data.
[0031] The input is a collection of vector text entities of borehole columnar sections in DWG / DXF format. The output is a 9-column standardized structured data table, including: stratigraphic lithology description, stratigraphic age, single layer thickness, cumulative depth, stratigraphic dip angle, stratigraphic dip direction, borehole X coordinate, borehole Y coordinate, and borehole Z elevation.
[0032] The complete process of this method is as follows: Figure 1 As shown, the method includes seven steps, S1 to S7, which contain two decision branches: column type decision confidence judgment and Pydantic verification judgment. The specific steps of this method are as follows:
[0033] S1. Parse the DWG / DXF format borehole column chart file, extract the center coordinates, text content, width and height of all TEXT / MTEXT vector text entities, and abstract each text entity into an axis-aligned bounding box AABB on a two-dimensional plane to form a vector text entity set T;
[0034] S2. In the vertical direction of the vector text entity set, execute the MBAP maximum blank area region segmentation algorithm. Based on the scan line and CoverageTree counting segment tree optimization, find two maximum blank area horizontal segmentation lines y_h and y_f in O(n log n) time, and divide the page into three functional areas: header area H, body area B, and footer area F.
[0035] Among them, the segmentation line of the MBAP maximum blank area region segmentation algorithm satisfies: S(y_h) + S(y_f) = max{S(y_1) + S(y_2)}, where S(y) represents the horizontal blank area of the scan line at the Y coordinate y that is not covered by any text bounding box. The CoverageTree counting segment tree optimizes the area calculation from O(n^2) to O(n log n).
[0036] S3. Execute the XOCP X-interval overlap clustering column separation algorithm in the table body region B. Construct an interval overlap graph based on the text bounding box X-interval overlap relationship. Divide the table body text into several semantically independent column regions C_k through a four-layer progressive filtering strategy.
[0037] The four-layer progressive filtering strategy of the XOCP X-interval overlap clustering column separation algorithm includes: the first layer, constructing an X-interval overlap graph G=(V,E), where nodes are text entities and edges are X-interval overlap relationships; the second layer, removing overflow text with a width greater than the overflow judgment threshold; the third layer, clustering and merging based on connected components to form candidate column regions; and the fourth layer, redistributing the overflow text to candidate column regions based on the nearest neighbor principle of the center coordinate.
[0038] S4. Calculate the discrimination signal for each column region, including five types of signals: numerical features, monotonicity, difference relationship, Chinese keywords and spatial location. Automatically determine the semantic type of the column based on the multi-signal fusion adjudication mechanism. When the confidence level is lower than the threshold, submit the large language model to assist in the adjudication.
[0039] The column type decision formula is: rho(tau, C_k) = sum(w_j * sigma_j(C_k) * I(tau,j)) / sum(w_j), where w_j is the weight of the j-th type signal, sigma_j(C_k) is the j-th type discrimination signal value of column C_k, I(tau,j) is the type-signal indication function, and rho(tau, C_k) is the decision confidence of column C_k with type tau;
[0040] S5. Serialize text data by column type label to construct a Prompt, define and enforce the output format of the large language model through the JSON Schema tool, and use the Function Calling interface to call the large language model to extract structured parameters;
[0041] The Agent loop mechanism includes: a serialization phase where Prompt text is constructed by column type tags and JSONSchema tool definitions are attached; a calling phase where the large language model returns structured JSON according to the schema through the Function Calling interface; a parsing phase where JSON is converted into a Pydantic model instance; and a validation phase where the correctness of the data type and the consistency of the logical constraints are verified, and if the validation fails, error feedback is attached, the serialization is re-serialized and the call is repeated until all parameters are extracted and the validation passes.
[0042] S6. Parse the JSON returned by the large language model into a Pydantic model instance, verify the data type and logical constraints, and trigger the Agent to cyclically correct until it passes when the verification fails.
[0043] S7. Summarize the extraction results of each column and output a standardized structured data table with 9 columns.
[0044] This invention also proposes a borehole columnar section information extraction system based on vector space partitioning, such as... Figure 2 As shown, the functions of each module in the system are as follows:
[0045] (1) Vector Text Extraction and Preprocessing Module: Parses DWG / DXF files, extracts the center coordinates, text content, width, and height of all TEXT / MTEXT entities, and abstracts each text into an axis-aligned bounding box (AABB) on a two-dimensional plane, forming a vector text entity set T = {t_1, t_2, ..., t_n}. This provides input data for the MBAP page partitioning algorithm, bounding box coordinate information for the XOCP column separation algorithm, and raw text content for LLM Agent extraction.
[0046] (2) MBAP Page Partitioning Module: In the vertical direction of the vector text entity set, through scan line + CoverageTree counting segment tree optimization, two horizontal dividing lines with the largest blank area are found, dividing the page into three functional areas: header area H, body area B, and footer area F. It receives the vector text set as input, passes the text subset within body area B to the XOCP column separation module, and passes the text in the header area to the column type discrimination module for header keyword analysis.
[0047] (3) XOCP column separation module: Within the table body region B, an interval overlap graph is constructed based on the text bounding box X interval overlap relationship. Through a four-layer progressive filtering strategy (X interval overlap graph construction, long text overflow removal, cluster merging, and secondary partitioning), the table body text is divided into several semantically independent column regions. It receives the table body region text subset output by MBAP and passes the text of each column region and bounding box information to the column type discrimination module.
[0048] (4) Automatic Column Type Determination Module: Calculates discrimination signals (numerical features, monotonicity, difference relationship, Chinese keywords, spatial location) for each column region, and automatically determines the semantic type of the column (accumulated depth / layer thickness / dip angle / azimuth angle / lithological description / stratigraphic age) based on the multi-signal overlap matrix and priority adjudication mechanism. Uncertain columns are submitted for LLM auxiliary adjudication. As a rigid-flexible bridging layer, it transforms the rigid geometric partitioning results into semantic constraints that can be understood by the flexible LLM.
[0049] (5) LLM Agent Loop Extraction Module: The text data with column type annotations is serialized into a Prompt. The LLM Function Calling output format is defined and constrained using a JSON Schema tool. The Agent executes the process cyclically (serialization, calling, parsing, verification, and correction) until all six types of parameters are extracted. The type correctness and logical consistency of the extracted results are verified using a Pydantic model.
[0050] (6) Result Parsing and Verification Module: Parses the JSON parameters returned by LLM Function Calling into a Pydantic model instance, verifies the data type (floating-point number / integer / string) and logical constraints (monotonically increasing cumulative depth, layer thickness = cumulative depth difference, tilt angle 0-90 degrees, azimuth angle 0-360 degrees). If the verification fails, the Agent is triggered to perform loop correction. After the verification passes, a 9-column structured data table is output.
[0051] Figure 3This demonstrates the core technology of vector text bounding box abstraction. The left side shows the text entities in the original borehole histogram, and the right side shows the result after abstracting each text entity into an axis-aligned bounding box (AABB). Each bounding box is defined by four coordinate values: left, right, bottom, and top. In particular, text whose width exceeds the overflow threshold (such as lithological descriptions) is marked as overflow text.
[0052] The present invention also proposes an electronic device, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform a method for automatically extracting borehole columnar plot structured data.
[0053] The present invention also proposes a computer-readable storage medium storing computer instructions for causing a computer to execute a method for automatically extracting structured data from borehole column diagrams.
[0054] Compared with the prior art, the technical effects of the present invention are as follows:
[0055] 1. Preserves vector coordinate accuracy, avoiding fundamental OCR failure. This invention performs calculations directly within the DWG vector text bounding box coordinate system without rasterization, fundamentally avoiding OCR recognition failure caused by text overlap. The center coordinates, width, and height of each text entity are accurately readable, with no pixel overlap or irreversible information loss.
[0056] 2. Rigid-Flexible Synergy: Organic Integration of Deterministic Algorithms and LLM Inference. This invention is the first to organically combine the deterministic vector space partitioning algorithm (MBAP+XOCP) with LLM semantic reasoning: the rigid algorithm handles deterministic geometric tasks such as layout partitioning and column separation, with reliable and reproducible results; the flexible LLM handles uncertain tasks such as semantic understanding and parameter extraction, possessing cross-format generalization capabilities. The two are bridged through column type discrimination signals, ensuring the reliability of geometric partitioning while leveraging the semantic understanding advantages of LLM.
[0057] 3. No large-scale data pre-training required, cross-format adaptive. The MBAP and XOCP algorithms are based on spatial geometric relationship calculations of vector text bounding boxes, without relying on any training data or predefined templates, and naturally possess the ability to adapt across mining areas and eras. Although the bar charts of different mining areas and eras have different formats, the underlying spatial rules of the "table header-table body-table footer" three-segment layout structure and column text distribution remain stable, and the algorithm can automatically discover and utilize these rules.
[0058] 4. Multi-signal fusion adjudication enables automatic column semantic discrimination. This invention constructs a discrimination signal system for six core columns (numerical features + monotonicity + difference relationship + Chinese keywords + spatial location), and automatically determines the column type through a multi-signal overlap matrix and priority adjudication mechanism. When the confidence level is insufficient, it submits an LLM auxiliary adjudication. This mechanism requires no manual annotation or predefined templates and has cross-format generalization capabilities.
[0059] 5. LLM Function Calling eliminates output format uncertainty. This invention uses a JSON Schema tool to define and enforce constraints on the LLM output format, obtaining structured data through a Function Calling interface instead of free text generation, fundamentally eliminating LLM output format uncertainty. Pydantic model validation ensures data type correctness and logical consistency, while an Agent cyclic correction mechanism guarantees extraction quality.
[0060] 6. End-to-end pipeline covering the entire process. This invention forms an end-to-end automatic extraction pipeline from DWG vector text extraction, page layout partitioning, column separation, column type identification, LLM parameter extraction to result verification, directly outputting a 9-column standardized structured data table, which can be integrated with all mainstream 3D geological modeling software such as GemPy / GOCAD / Leapfrog / Surpac / 3DMine. Attached Figure Description
[0061] Figure 1 This is a flowchart of the method of the present invention (S1 to S7).
[0062] Figure 2 This is a block diagram of the rigid-flexible collaborative system of the present invention;
[0063] Figure 3 An abstract schematic diagram of a vector text bounding box (AABB);
[0064] Figure 4 This is a diagram illustrating the sections of the MBAP page.
[0065] Figure 5 A schematic diagram of the four-layer progressive filtering of the XOCP column separation algorithm;
[0066] Figure 6 A schematic diagram of the overlap matrix and decision mechanism for column type discrimination signals;
[0067] Figure 7 This is a schematic diagram of the LLM Agent cyclic extraction mechanism;
[0068] Figure 8 This is a diagram illustrating the data docking for 3D geological modeling. Detailed Implementation
[0069] The technical solution of the present invention will be further described below with reference to the embodiments and accompanying drawings.
[0070] A method for extracting borehole columnar section information based on vector space partitioning includes the following steps:
[0071] I. MBAP Maximum Blank Area Region Segmentation Algorithm
[0072] Step S1: Parse the DWG / DXF file, extract all TEXT / MTEXT vector text entities, and abstract each text into an axis-aligned bounding box t_i = (left_i, right_i, bottom_i, top_i), forming an entity set T.
[0073] Step S2: Execute the MBAP algorithm, which is optimized based on scan lines and CoverageTree counting segment trees. In O(n logn) time, find two horizontal dividing lines y_h and y_f with the largest blank area, and divide the page into the header area H, the body area B, and the footer area F. Figure 4 A diagram illustrating the MBAP page sections is provided.
[0074] like Figure 4 As shown, the header area H contains metadata such as borehole number, borehole coordinates, construction unit, and header field names; the body area B contains the actual data rows of each column; and the footer area F contains signature information such as compiler, reviewer, and date. The selection criteria for the two dividing lines y_h and y_f is to maximize the sum of the horizontal blank areas, that is, to satisfy formula (1): S(y_h) + S(y_f) = max{S(y_1) + S(y_2)}, where S(y) represents the horizontal blank area of the scan line at the Y coordinate y that is not covered by any text bounding box. The CoverageTree counting segment tree maintains the set of intervals covered by text bounding boxes in the horizontal direction, supports interval insertion, deletion, and total coverage length query operations in O(log n) time, and optimizes the overall algorithm complexity from O(n^2) to O(n log n).
[0075] II. XOCP X-interval overlap clustering column separation algorithm
[0076] Step S3: Execute the XOCP algorithm within the table body region B. Figure 5 The four-layer progressive filtering process of the XOCP column separation algorithm is demonstrated.
[0077] like Figure 5 As shown, the four-layer progressive filtering strategy of the XOCP algorithm is as follows:
[0078] First layer (constructing the X-interval overlap graph): Project the bounding box of each text entity onto the X-axis to form an interval I_i = [left_i, right_i], and construct the interval overlap graph G=(V,E), where node V is a text entity and edge E connects text pairs that overlap in the X interval.
[0079] The second layer (overflow removal): Iterate through all text, mark text with a width w_i > theta_overflow as overflow text, and temporarily remove it from the graph. The overflow threshold theta_overflow is dynamically calculated based on the average column width of the table body area, and is usually taken as 1.5 times the average column width.
[0080] The third layer (clustering and merging): find the connected components on the graph after removing the overflow text, and each connected component corresponds to a candidate column region C_k.
[0081] The fourth layer (secondary allocation of overflowing text): The overflowing text is allocated to the nearest candidate column area according to the nearest neighbor principle of its center X coordinate, thereby restoring the complete column area division.
[0082] III. Automatic Determination of Multi-Signal Fusion Decision Type
[0083] Step S4: Calculate the discrimination signal for each column region and perform multi-signal fusion to determine the semantic type of the column. Figure 6 The signal overlap matrix and decision mechanism are demonstrated.
[0084] like Figure 6 As shown, the five types of discrimination signals are: sigma1 numerical features (whether all column text can be parsed into numerical values), sigma2 monotonically increasing (whether the column values are monotonically increasing, cumulative depth column features), sigma3 difference relationship (whether the difference between adjacent rows is equal to the value of another column, layer thickness = cumulative depth difference), sigma4 Chinese keywords (whether the column text contains Chinese keywords for lithology / age), and sigma5 spatial location (the corresponding field name in the table header).
[0085] The column type decision formula (2) is: rho(tau, C_k) = sum(w_j * sigma_j(C_k) * I(tau,j)) / sum(w_j), where w_j is the weight of the j-th type signal, and I(tau,j) is the type-signal indicator function. The column type is confirmed when the decision confidence rho >= theta_conf (default 0.7); otherwise, an LLM-assisted decision is submitted. This mechanism is the core of the rigid-flexible bridging mechanism, enabling automatic conversion from geometric location to semantic type.
[0086] IV. LLM Agent Cyclic Extraction Mechanism
[0087] Steps S5-S6: Serialize text data by column type label to construct a Prompt, define the constraint LLM output format using the JSON Schema tool, extract structured parameters using the Function Calling interface, and validate using the Pydantic model. Figure 7 The LLM Agent cyclic extraction mechanism was demonstrated.
[0088] like Figure 7 As shown, the Agent loop mechanism consists of four phases:
[0089] (1) Serialization stage: Organize text data into structured Prompt text by column type labels, attach JSONSchema tool definition, and explicitly specify the name, type and constraints of output fields.
[0090] (2) Function Calling stage: The large language model is called through the OpenAI-compatible Function Calling interface. The LLM returns structured JSON data according to the JSON Schema definition. The temperature parameter is set to 0 to ensure output determinism.
[0091] (3) Parsing stage: Parse the JSON returned by LLM into a Pydantic model instance, and automatically perform data type conversion and preliminary verification.
[0092] (4) Verification Phase: Perform Pydantic model verification to validate data types (floating-point / integer / string) and logical constraints (strictly monotonically increasing cumulative depth, layer thickness = cumulative depth difference within positive and negative tolerance range, tilt angle range 0–90 degrees, azimuth angle range 0–360 degrees). If the verification passes, output the result; if the verification fails, attach specific error feedback information, rebuild the Prompt, and enter the next iteration. Set a maximum iteration limit to prevent infinite loops.
[0093] Step S7: Summarize the extraction results of each column and output a 9-column standardized structured data table.
[0094] V. Data Integration for 3D Geological Modeling
[0095] The extracted nine-column structured data table can be directly used to construct the input data structure for three-dimensional geological modeling software. Figure 8 It demonstrates the complete data integration process. For example... Figure 8As shown, through formula (3) z_i = z_collar - d_i (elevation conversion) and formula (4) Gx = sin(alpha)*cos(beta), Gy = sin(alpha)*sin(beta), Gz = cos(alpha) (attitude gradient vector conversion), the 9-column data can be used to construct the structured input of the three-dimensional geological model, including SurfacePoints (stratigraphic interface control points: X, Y, Z) and Orientations (stratigraphic attitude direction vectors: X, Y, Z, Gx, Gy, Gz), realizing the automated data link from DWG drawings to three-dimensional geological modeling software such as GemPy / GOCAD / Leapfrog / Surpac / 3DMine.
[0096] Example 1: Extraction of cross-mining borehole columnar section data
[0097] Taking borehole columnar sections from three mining areas (HQ mining area 2007-2021, BE mining area 2006, and MC mining area 2015) as examples, the cross-mining area adaptability of the method of this invention is verified. The columnar section formats of the three mining areas differ greatly: the 2007 version of the HQ mining area uses a 6-column layout (cumulative depth + layer thickness + lithological description + dip angle + azimuth angle + age), the 2016 version expands to a 12-column layout, and the 2021 version is adjusted to a 10-column layout; the BE mining area uses an 8-column layout, and the MC mining area uses a 16-column layout. The header field naming, column order, and scale are also different.
[0098] The MBAP algorithm successfully segmented all column charts from the three mining areas into a three-segment structure of "header-body-tail" without any format parameter adjustments. The XOCP algorithm adaptively identified the different column distributions of columns 6-6, correctly handling the issue of lithological description text overflowing across columns. The column type identification module accurately identified six core columns: cumulative depth, layer thickness, dip angle, azimuth angle, lithological description, and stratigraphic age. The LLM Agent cyclic extraction module successfully extracted all nine columns of structured parameters.
[0099] Technical results: Full data extraction from over 200 boreholes in a single mining area can be completed within hours, while manual data entry, line by line, would take weeks or even months. The cumulative depth monotonicity verification pass rate of the extracted results is over 98%, and the dip and azimuth range verification pass rate is over 99%.
[0100] Example parameter settings: The overflow threshold theta_overflow is dynamically calculated based on the average column width of the table body area, and is usually taken as 1.5 times the average column width; the decision confidence threshold theta_conf is 0.7 by default, and can be reduced to 0.5 for mining areas with large format differences; the LLM model uses the OpenAI-compatible Function Calling interface, and the temperature parameter is set to 0; the Pydantic verification requires that the accumulated depth must be strictly monotonically increasing, with a dip angle range of 0 to 90 degrees, an azimuth angle range of 0 to 360 degrees, and the layer thickness = the positive and negative tolerance range of the accumulated depth difference.
[0101] Example 2: Data Interoperability for 3D Geological Modeling
[0102] The extracted nine columns of structured data tables can be converted using formulas (3) and (4) to directly construct the input data structure (SurfacePoints and Orientations) of the three-dimensional geological modeling software, realizing an automated data link from DWG drawings to three-dimensional geological modeling, thus eliminating the efficiency bottleneck of traditional manual hole-by-hole data entry.
[0103] Symbols and Formulas
[0104] Table 1 Vector Text and Bounding Box Symbols
[0105] T Vector text entity collection T = {t_1, t_2, ..., t_n}, where n is the total number of texts. t_i The bounding box of the i-th text entity i = 1, ..., n img_x,i The center X coordinate of the i-th text entity pixel unit img_y,i The center Y coordinate of the i-th text entity pixel unit w_i Width of the i-th text entity pixel unit h_i The height of the i-th text entity pixel unit left_i The left boundary of the bounding box of the i-th text entity left_i = img_x,i - w_i / 2 right_i The right boundary of the bounding box of the i-th text entity right_i = img_x,i + w_i / 2 bottom_i The bottom boundary of the bounding box of the i-th text entity bottom_i = img_y,i - h_i / 2 top_i The top boundary of the bounding box of the i-th text entity top_i = img_y,i + h_i / 2
[0106] Table 2 MBAP Page Partition Symbols
[0107] y_h The horizontal dividing line between the watch head and the watch body Pixel coordinates y_f The horizontal dividing line between the watch body and the watch tail. Pixel coordinates H Header area H = {(x,y) | y>y_h} B Surface area B = {(x,y) | y_f<= y<= y_h} F Tail area F = {(x,y) | y<y_f} S(y) The horizontal blank area of the scan line at the Y coordinate y Pixels^2 CT CoverageTree - Counting Segment Tree Used to accelerate scan line area calculation
[0108] MBAP core formula (1): The two dividing lines y_h and y_f satisfy:
[0109] S(y_h) + S(y_f) = max{S(y_1) + S(y_2)}
[0110] Where S(y) represents the total length of the horizontal blank space at the Y coordinate y that is not covered by any text bounding box, multiplied by the page width, i.e., the horizontal blank area. CoverageTree, a counting segment tree, optimizes the calculation of the scan line area from O(n^2) to O(n log n).
[0111] Table 3 XOCP column delimiter
[0112] I_i The X interval of the i-th text I_i = [left_i, right_i] G X-interval overlap map G = (V, E), where V is a text node and E is an overlapping edge. O(I_i, I_j) Interval overlap determination function If the intersection of I_i and I_j is not empty, then O=1. C_k The kth column region C_k = {(x,y) belongs to B | x_{k-1}<= x<= x_k} L(t_i) Text overflow tag If w_i > theta_overflow, then mark it as overflow text. theta_overflow Overflow detection threshold The pixel unit can be dynamically adjusted.
[0113] Table 4 Column Type Discrimination Symbols
[0114] tau Column semantic types Tau belongs to {depth, thickness, dip, azimuth, lithology, age} sigma_j(C_k) The j-th class discrimination signal of column C_k j belongs to {1,...,5} Sigma Discrimination signal overlap matrix Binary matrix of 6 types x5 signals rho(tau, C_k) Confidence level of the ruling for column C_k of type tau The value range is [0, 1]. theta_conf Confidence threshold for adjudication The default value is 0.7; values below this will trigger an LLM adjudication.
[0115] Column type decision formula (2):
[0116] rho(tau, C_k) = sum(w_j * sigma_j(C_k) * I(tau,j)) / sum(w_j)
[0117] Where w_j is the weight of the j-th type of signal, and I(tau,j) is the type-signal indicator function (whether type tau has signal j as a discriminant feature).
[0118] Table 5 LLM Extraction and Verification Symbols
[0119] P_k Serialized Prompt text of column C_k String S_tau JSON Schema tool definition for type tau JSON object R_k LLM extraction results for column C_k JSON object V(R_k) Pydantic model validation function Pass / Fail d_i Cumulative depth of the i-th stratigraphic boundary Meter (m) z_i 3D elevation of the i-th stratigraphic boundary z_i = z_collar - d_i, meters (m)
[0120] Three-dimensional elevation conversion formula (3):
[0121] z_i = z_collar - d_i
[0122] Formula (4) for converting attitude gradient vector:
[0123] Gx = sin(alpha) * cos(beta), Gy = sin(alpha) * sin(beta), Gz = cos(alpha)
[0124] Where alpha is the dip angle (Dip) and beta is the azimuth angle (Azimuth).
[0125] Table 6 Key Technical Parameters
[0126] Scan line blank area S(y) Total horizontal blank area at the Y coordinate Pixels^2, depending on text distribution Table header dividing line y_h The dividing line between the watch head and the watch body Pixel coordinates are determined by the MBAP algorithm. Tail dividing line y_f The dividing line between the watch body and the watch tail. Pixel coordinates are determined by the MBAP algorithm. Overflow detection threshold theta_overflow Text width exceeding this value is considered overflow. The pixel unit can be dynamically adjusted. Confidence threshold for adjudication theta_conf Submit an LLM ruling if the value is below this. Default value is 0.7, range is [0.5, 1.0] Signal weights w_j Weights of the j-th class discriminant signal The signal weights are derived from the overlap matrix. Tilt range alpha Stratum dip angle 0~90 degrees Azimuth range beta Stratigraphic dip azimuth 0~360 degrees Cumulative monotonicity -- The cumulative depth column must be strictly monotonically increasing. Strict Incremental Constraints
[0127] 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, and all such modifications or substitutions should be covered within the scope of the claims of the present invention.
Claims
1. A method for extracting borehole columnar section information based on vector space partitioning, characterized in that, The method includes the following steps: S1. Parse the DWG / DXF format borehole column chart file, extract the center coordinates, text content, width and height of all TEXT / MTEXT vector text entities, and abstract each text entity into an axis-aligned bounding box AABB on a two-dimensional plane to form a vector text entity set T; S2. In the vertical direction of the vector text entity set, execute the MBAP maximum blank area region segmentation algorithm. Based on the scan line and CoverageTree counting segment tree optimization, find two horizontal segmentation lines y_h (table header) and y_f (table tail) with the maximum blank area in O(n log n) time, and divide the page into three functional areas: table header area H, table body area B, and table tail area F. S3. Execute the XOCP X-interval overlap clustering column separation algorithm in the table body region B. Construct an interval overlap graph based on the text bounding box X-interval overlap relationship. Divide the table body text into several semantically independent column regions C_k through a four-layer progressive filtering strategy. S4. Calculate the discrimination signal for each column region, including five types of signals: numerical features, monotonicity, difference relationship, Chinese keywords and spatial location. Automatically determine the semantic type of the column based on the multi-signal fusion adjudication mechanism. When the confidence level is lower than the threshold, submit the large language model to assist in the adjudication. S5. Serialize text data by column type label to construct a Prompt, define and enforce the output format of the large language model through the JSON Schema tool, and use the Function Calling interface to call the large language model to extract structured parameters; S6. Parse the JSON returned by the large language model into a Pydantic model instance, verify the data type and logical constraints, and trigger the Agent to cyclically correct until it passes when the verification fails. S7. Summarize the extraction results of each column and output a standardized structured data table with 9 columns.
2. The method for extracting borehole columnar section information based on vector space partitioning according to claim 1, characterized in that, In step S2, the segmentation line of the MBAP maximum blank area region segmentation algorithm satisfies: S(y_h) + S(y_f) = max{S(y_1) + S(y_2)}, where S(y) represents the horizontal blank area of the scan line at the Y coordinate y that is not covered by any text bounding box. The CoverageTree counting segment tree optimizes the area calculation from O(n^2) to O(n log n).
3. The method for extracting borehole columnar section information based on vector space partitioning according to claim 1, characterized in that, In step S3, the four-layer progressive filtering strategy of the XOCP X-interval overlap clustering column separation algorithm includes: the first layer, constructing an X-interval overlap graph G=(V,E), where nodes are text entities and edges are X-interval overlap relationships; the second layer, removing overflow text with a width greater than the overflow judgment threshold; the third layer, clustering and merging based on connected components to form candidate column regions; and the fourth layer, redistributing the overflow text to the candidate column regions based on the nearest neighbor principle of the center coordinate.
4. The method for extracting borehole columnar section information based on vector space partitioning according to claim 1, characterized in that, In step S4, the column type decision formula is: rho(tau, C_k) = sum(w_j * sigma_j(C_k) * I(tau,j)) / sum(w_j), where w_j is the weight of the j-th type signal, sigma_j(C_k) is the j-th type discrimination signal value of column C_k, I(tau,j) is the type-signal indication function, and rho(tau, C_k) is the decision confidence of column C_k with type tau.
5. The method for extracting borehole columnar section information based on vector space partitioning according to claim 1, characterized in that, In step S5, the Agent loop mechanism includes: a serialization phase where Prompt text is constructed by column type labels and JSONSchema tool definitions are attached; a calling phase where the large language model returns structured JSON according to the schema through the Function Calling interface; a parsing phase where JSON is converted into a Pydantic model instance; and a verification phase where the correctness of the data type and the consistency of the logical constraints are verified, and if the verification fails, error feedback is attached, the serialization is re-serialized and the call is repeated until all parameters are extracted and the verification is successful.
6. A borehole columnar section information extraction system based on vector space partitioning, used to implement the method described in any one of claims 1-5, characterized in that, include: The vector text extraction and preprocessing module is used to parse DWG / DXF files, extract vector text entities, and abstract them into a set of axis-aligned bounding boxes. The MBAP page partitioning module is used to divide the page into three functional areas: header, body, and footer, based on the scan line and CoverageTree optimization algorithm. The XOCP column separation module is used to divide the table body text into column regions based on the X interval overlap relationship and a four-level progressive filtering strategy. The column type automatic identification module is used to automatically identify the semantic type of each column based on a multi-signal fusion decision mechanism; The LLM Agent Loop Extraction Module is used to extract structured parameters from column text through the Function Calling interface and Agent loop mechanism; The results parsing and verification module is used to verify the type correctness and logical consistency of the extracted results through the Pydantic model.
7. The borehole columnar section information extraction system based on vector space partitioning according to claim 6, characterized in that, In the MBAP page partitioning module, the CoverageTree counting segment tree maintains the set of intervals covered by text bounding boxes in the horizontal direction, supporting interval insertion, deletion, and total coverage length query operations in O(log n) time.
8. The borehole columnar section information extraction system based on vector space partitioning according to claim 6, characterized in that, In the XOCP column separation module, the overflow threshold theta_overflow is dynamically calculated based on the average column width of the table body area, and is taken as 1.5 times the average column width.
9. An electronic device, characterized in that, include: At least one processor; And a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-5.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions for causing a computer to perform the method of any one of claims 1-5.
Citation Information
Patent Citations
Drilling histogram automatic mapping method based on CAD template binding technology
CN103714203A
Automatic data extraction method based on dwg format static sounding histogram
CN114495148A
Commodity feature recognition model training method, device and equipment
CN114529777A
Drilling histogram data processing method and device, electronic equipment and storage medium
CN116166729A
A method and device for digitizing drilling column chart based on structural pattern recognition
CN118658174B