An interactive intelligent extraction method and device for drilling data
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-05-26
- Publication Date
- 2026-08-11
AI Technical Summary
[0004]上述现有技术虽然在CAD明细表提取、CAD表格导出、图纸表格识别和钻孔数据建模方面取得了一定进展,但仍存在如下不足:(1)部分方法依赖完整表格线、闭合单元格、线条端点坐标或预设表格模板,当钻孔数据表格存在表格线缺失、边框不闭合或仅由文字排布形成表格视觉效果时,行列关系恢复的稳定性容易受到影响;(2)部分方法主要依据文本插入点坐标判断文字位置,而文字插入点与文字实际显示中心可能存在偏差,特别是在多行文字、属性文字或不同对齐方式文字混合存在时,容易导致列归属判断不准确;(3)部分钻孔数据处理方法更侧重于三维地质建模或BIM模型构建,前端数据提取流程相对复杂,不适合现场资料整理中对普通CAD钻孔数据表的快速导出需求
1、本发明通过目标列中心和列分界位置确定CAD文字对象的列归属,不以完整表格线、闭合单元格或标准电子表格对象作为必要条件,能够适用于由普通文字、多行文字和属性文字组成的CAD钻孔数据表格,尤其适用于表格线不完整或仅由文字排布形成表格视觉效果的图纸场景。
Smart Images

Figure CN122551386A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of CAD drawing data processing and geological exploration borehole data organization technology, specifically relating to an interactive intelligent extraction method and device for borehole data. Background Technology
[0002] Borehole data is crucial foundational data for open-pit coal mine geological exploration, coal and rock strata identification, and 3D geological modeling. With the development of mine digitization and engineering data informatization, the rapid conversion of borehole data from CAD drawings into structured data readable by Excel has become a common requirement in geological data processing and subsequent analysis. In existing engineering data, information such as borehole number, depth, stratigraphic position, layer thickness, lithological description, borehole coordinates, and remarks are often stored in the form of CAD borehole columnar sections, borehole data tables, appendices to cross-section diagrams, or planar annotations. These data tables are typically composed of CAD elements such as single-line text, multi-line text, attribute text, lines, and borders. Although presented as tables on drawings, they are not necessarily standard spreadsheet objects, making it difficult to directly obtain clearly defined Excel data using conventional methods.
[0003] Among existing CAD table extraction technologies, patent CN105159685A discloses a method for extracting detailed content from CAD drawings to an Excel spreadsheet. This method involves creating an Excel template file and transferring the content of the user-selected detail row area to the Excel spreadsheet according to its original relative position. Patent CN116205206A discloses a method for importing CAD table data into an Excel spreadsheet. This method extracts the coordinates of line endpoints in the CAD table to form a spatial coordinate grid and determines the relative position of the text based on the coordinates of the text insertion point. Patent CN115841679B discloses a method for extracting tables from drawings. This method identifies table areas in DWG files, parses cells, and matches table headers and names using a preset table configuration file. Patent CN115035258A discloses a method for urban 3D geological modeling based on CAD borehole columnar sections. This method serves 3D geological modeling through steps such as obtaining the outer frame of the borehole columnar section, extracting object content, exporting to Excel, and standardizing strata.
[0004] Although the above-mentioned existing technologies have made some progress in CAD detail table extraction, CAD table export, drawing table recognition and borehole data modeling, they still have the following shortcomings: (1) Some methods rely on complete table lines, closed cells, line endpoint coordinates or preset table templates. When the borehole data table has missing table lines, unclosed borders or only text arrangement to form the table visual effect, the stability of the row and column relationship recovery is easily affected; (2) Some methods mainly rely on the text insertion point coordinates to determine the text position. However, there may be a deviation between the text insertion point and the actual display center of the text. Especially when multiple lines of text, attribute text or text with different alignment methods are mixed, it is easy to cause inaccurate column classification; (3) Some borehole data processing methods focus more on three-dimensional geological modeling or BIM model construction. The front-end data extraction process is relatively complex and is not suitable for the rapid export of ordinary CAD borehole data tables in the field data processing. Summary of the Invention
[0005] To address the shortcomings of existing technologies, this application proposes an interactive intelligent extraction method and apparatus for borehole data.
[0006] In a first aspect, the present invention provides an interactive intelligent extraction method for borehole data, comprising: Import the CAD drawing and select the drilling data table area in the CAD drawing; Specify the center positions of m target columns in the borehole data table area, where m is an integer greater than or equal to 2; Sort the center positions of the m target columns according to the horizontal coordinate order, and calculate the m-1 column boundary positions based on the center positions of adjacent target columns; Iterate through all objects within the borehole data table area and filter for text objects from all objects; Extract the text content of each text object and calculate the geometric center coordinates of the text object; Based on the relationship between the horizontal coordinates of the text objects and the column intervals formed by the column boundaries, and the geometric center coordinates of the text objects, the text objects are grouped to determine the target column to which each text object belongs. Determine the row grouping tolerance based on the specified adjacent row reference positions; The text objects are grouped into rows according to the row grouping tolerance; Within each row group, determine the target text content for each target column; Output the borehole data file according to the order of row grouping and the order of target columns.
[0007] The types of tables in the borehole data table area include: borehole detail table, borehole bar chart side data table, borehole data summary table, and other table areas containing borehole data. The types of objects in the borehole data table area include: text objects and non-text primitives, where non-text primitives include: table lines, border lines, and auxiliary lines.
[0008] Specifying the center positions of m target columns in the borehole data table area includes: Based on the target data to be extracted from the borehole data table, determine the center position of each target column of the target data; the target data includes: borehole number, borehole depth, borehole opening coordinates, borehole opening elevation, stratigraphy, stratigraphy thickness, lithological description, and two or more types of data in the remarks.
[0009] The step of sorting the center positions of the m target columns according to their horizontal coordinates and calculating the m-1 column boundary positions based on the center positions of adjacent target columns includes: Sort the x-coordinates of the center positions of the m target columns in ascending order, and denote them as c1, c2, ..., c3. m The column boundaries between two adjacent columns are denoted as b1, b2, ..., b1, b2, ..., b3, b4, b5, b6, b7, b8, b9, b1, b1, b1, b2, b1, b1, b2, b3 ... (m-1) , where c m Let b be the x-coordinate of the center position of the m-th target column. (m-1) The column boundary position between two adjacent columns is the (m-1)th column, and the column boundary position is the ith column. i Satisfy: b i =(c i +c (i+1) ) / 2, i=1, 2, ..., m-1; the borehole data table area is divided into m columns horizontally by the m-1 column boundaries.
[0010] The process of obtaining the geometric center coordinates of the text object includes: The display range of the text object in the CAD drawing is determined by the outer bounding box of the text object. The geometric center coordinates are the average of the minimum and maximum coordinate values of the outer bounding box. When the outer bounding box of the text object cannot be obtained, the coordinates of the insertion point of the text object are used as substitute coordinates. The geometric center coordinates are the average of the minimum and maximum coordinate values of the insertion point.
[0011] The process of grouping text objects based on the relationship between the horizontal coordinates of the text objects and the column intervals formed by the column boundaries, and the geometric center coordinates of the text objects, and determining the target column to which each text object belongs, includes: When the geometric center coordinates of the text objects to be grouped are less than the first column boundary position b1, the text objects to be grouped are assigned to the first target column. When the geometric center coordinates of the text object to be grouped are greater than or equal to the (i-1)th column boundary position and less than the ith column boundary position, the text object to be grouped is assigned to the ith target column, where i = 2, 3, ..., m-1; When the geometric center coordinates of the text object to be grouped are greater than or equal to the (m-1)th column boundary position, the text object to be grouped is assigned to the m-th target column.
[0012] The step of determining the row grouping tolerance based on the specified adjacent row reference position includes: In the borehole data table area, specify a reference position in each of two adjacent lines of text. Calculate the spacing between adjacent lines based on the difference in the vertical coordinates of the two reference positions. Select the smaller spacing between the two adjacent lines and determine the row grouping tolerance based on the smaller spacing between adjacent lines.
[0013] The step of grouping text objects into lines according to the line grouping tolerance includes: The text objects are sorted from largest to smallest according to their vertical coordinates, and the vertical coordinate of the first text object in the current row group is used as the base vertical coordinate. When the difference between the ordinate of the text object to be grouped and the reference ordinate is less than or equal to the row grouping tolerance, the text object to be grouped is assigned to the current row group. When the difference is greater than the row grouping tolerance, a new row group is created, and the ordinate of the text object to be grouped is used as the new reference ordinate.
[0014] The step of determining the target text content for each target column within each row group includes: When a text object exists in the same target column of the same row group, the text content of the text object is used as the target text content of the target column. When multiple text objects exist in the same target column in the same row group, the target text content of the target column is determined according to a preset processing rule; the preset processing rule includes: selecting the text object closest to the center of the target column, or splicing multiple text contents according to the spatial order of the text objects.
[0015] Secondly, the present invention provides an interactive intelligent extraction device for borehole data, comprising: The table selection module is used to import CAD drawings and select the drilling data table area in the CAD drawings. The center position specification module is used to specify the center positions of m target columns in the borehole data table area, where m is an integer greater than or equal to 2; The boundary position calculation module is used to sort the center positions of the m target columns according to the horizontal coordinate order, and calculate the m-1 column boundary positions based on the center positions of adjacent target columns. The text filtering module is used to traverse all objects within the borehole data table area and filter text objects from all objects; The center coordinate extraction module is used to extract the text content of each text object and calculate the geometric center coordinates of the text object; The column grouping module is used to group text objects based on the relationship between the horizontal coordinate of the text object and the column interval formed by the column boundary position, and the geometric center coordinates of the text object, and to determine the target column to which each text object belongs; The tolerance determination module is used to determine the row grouping tolerance based on the specified adjacent row reference positions; The line grouping module is used to group text objects into lines according to the line grouping tolerance. The content determination module is used to determine the target text content for each target column in each row group; The borehole data output module is used to output borehole data files according to the order of row grouping and the order of target columns.
[0016] Thirdly, this application proposes an electronic device, comprising: one or more processors, and a memory for storing instructions that, when executed by the one or more processors, cause the one or more processors to perform the interactive intelligent extraction method for borehole data.
[0017] Fourthly, this application proposes a computer-readable storage medium storing executable instructions that, when executed, cause a processor to perform the aforementioned interactive intelligent extraction method for drilling data.
[0018] Fifthly, this application proposes a computer program product, including a computer program or instructions, which, when executed by a processor, implements the aforementioned interactive intelligent extraction method for borehole data.
[0019] Beneficial effects: 1. This invention determines the column affiliation of CAD text objects by the center of the target column and the column boundary position. It does not require complete table lines, closed cells or standard spreadsheet objects as necessary conditions. It can be applied to CAD drilling data tables composed of ordinary text, multi-line text and attribute text, and is especially suitable for drawing scenarios where table lines are incomplete or the table visual effect is formed only by text arrangement.
[0020] 2. This invention determines the row grouping tolerance by referencing the positions of adjacent rows. It can adjust the row grouping conditions according to different CAD drawing scales, text heights and line spacing, thereby reducing the problems of serial lines, missing lines or row grouping errors caused by fixed thresholds.
[0021] 3. This invention prioritizes determining the geometric center coordinates by using the bounding box of the text object. Compared with simply using the text insertion point coordinates, this better reflects the actual display position of the text object in the CAD drawing, which helps improve the accuracy of determining the column affiliation of the text object.
[0022] 4. When multiple text objects exist in the same row and target column, the present invention can determine the target text content according to preset processing rules. It can reduce the influence of interfering text by filtering through column center distance, and can also splice multiple valid text contents in the same column when needed, thereby improving the adaptability of text extraction results in different CAD drawings.
[0023] 5. This invention can output drilling data from CAD drawings as an Excel-readable CSV file, reducing manual copying, manual entry, and secondary processing work, lowering the risk of omissions, errors, serial errors, and cross-referencing during the drilling data processing process, and improving the efficiency of CAD drilling data extraction. Attached Figure Description
[0024] Figure 1 Flowchart of an interactive intelligent extraction method for borehole data according to an embodiment of the present invention; Figure 2 This is a schematic diagram of a portion of the CAD drilling data according to an embodiment of the present invention. Figure 3 This is a schematic diagram of the Excel-readable extraction results according to an embodiment of the present invention; Figure 4 This is a schematic diagram of the target column center and column boundary positions, and the grouping of text object rows, according to an embodiment of the present invention. Figure 5 This is a block diagram of an interactive intelligent extraction device for borehole data according to an embodiment of the present invention. Detailed Implementation
[0025] The specific implementation methods of this application will be further described in detail below with reference to the accompanying drawings and embodiments.
[0026] To address the technical problems in existing technologies, such as missing table lines, unclosed borders, or inaccurate drilling data extraction based solely on text layout; and the issue of inaccurate column attribution when multiple lines of text, attribute text, or text with different alignments are mixed, this invention proposes an interactive intelligent extraction method and apparatus for drilling data. After the user selects a CAD (Computer-Aided Design) drilling data area, the method calculates the boundary positions of adjacent columns by specifying the center position of the target column, and determines the column attribution based on the geometric center coordinates of the text objects. It determines the row grouping tolerance by specifying the reference positions of adjacent rows, and completes row grouping according to the vertical coordinates of the text objects. When multiple text objects exist in the same row and column, the text object closest to the center of the target column is selected as the target content. Finally, the drilling data is output as a structured data file readable by Excel. Therefore, this invention can quickly extract CAD drilling data and restore row and column relationships without relying heavily on complete table lines or requiring complex preset table header templates, thereby reducing the risks of omissions, errors, serial errors, and misalignments in the manual input, copying, and secondary processing.
[0027] Example 1: This embodiment provides an interactive intelligent extraction method for borehole data, such as... Figure 1 As shown, it includes: Step S1: Import the CAD drawing and select the drilling data table area in the CAD drawing; In this embodiment, according to steps S1 to S10, a plugin for CAD software is created, namely a .lsp format file. Running this plugin directly in the CAD software allows for the use of an interactive intelligent extraction method for borehole data, ultimately outputting a CSV file readable by Excel. The CAD drawing containing the borehole data to be extracted is imported into the CAD software, the plugin is run, and the borehole data table area is selected in the CAD drawing.
[0028] In this embodiment, the types of tables in the borehole data table area include: borehole detail table, borehole bar chart side data table, borehole data summary table, and other table areas containing borehole data; the types of objects in the borehole data table area include: text objects and non-text elements, wherein non-text elements include: table lines, border lines, and auxiliary lines.
[0029] Specifically, the user selects a region in the CAD drawing from which to extract the drilling data table. This region can contain both text and non-text objects. After receiving the user's selected set of elements, the system iterates through the objects in the set and filters them for single-line text objects, multi-line text objects, and attribute text objects. Non-text objects such as line segments, border lines, and polylines are not included in the text content extraction.
[0030] Step S2: Specify the center positions of m target columns in the borehole data table area, where m is an integer greater than or equal to 2; In this embodiment, the borehole data table may include m target data columns, where m is an integer greater than or equal to 2. For example, the target data columns may include fields such as borehole number, borehole depth, lithological description, borehole coordinates, borehole elevation, layer thickness, or remarks. The borehole data table is composed of CAD elements such as single-line text, multi-line text, attribute text, line segments, and border lines. Because this table is not a standard spreadsheet object, structured data cannot be directly obtained by copying, such as... Figure 2 As shown.
[0031] Step S3: Sort the center positions of the m target columns according to their horizontal coordinates, and calculate the m-1 column boundary positions based on the center positions of adjacent target columns, including: Sort the x-coordinates of the center positions of the m target columns in ascending order, and denote them as c1, c2, ..., c3. m The column boundaries between two adjacent columns are denoted as b1, b2, ..., b1, b2, ..., b3, b4, b5, b6, b7, b8, b9, b1, b1, b1, b2, b1, b1, b2, b3 ... (m-1) , where c m Let b be the x-coordinate of the center position of the m-th target column. (m-1) The column boundary position between two adjacent columns is the (m-1)th column, and the column boundary position is the ith column. i Satisfy: b i =(c i +c (i+1) ) / 2, i=1, 2, ..., m-1; the borehole data table area is divided into m columns horizontally by the m-1 column boundaries.
[0032] In this embodiment, the user specifies the approximate center position of each target column in the borehole data table area. The x-coordinates of the center positions of the m target columns are obtained and sorted according to their x-coordinates, resulting in c1, c2, ..., c... m ,like Figure 4 As shown.
[0033] The column boundary positions are calculated based on the x-coordinates of the centers of adjacent target columns. The column boundary positions between two adjacent columns are denoted as b1, b2, ..., b... (m-1) , where: bi =(c i +c (i+1) ) / 2, i=1, 2,..., m-1.
[0034] For example, when the target column has five columns, the column boundary between the first and second columns is (c1+c2) / 2, the column boundary between the second and third columns is (c2+c3) / 2, the column boundary between the third and fourth columns is (c3+c4) / 2, and the column boundary between the fourth and fifth columns is (c4+c5) / 2.
[0035] Step S4: Traverse all objects within the borehole data table area and filter text objects from all objects; In this embodiment, all objects within the borehole data table area include: text objects and non-text graphic elements, wherein the non-text graphic elements include: table lines, border lines, and auxiliary lines.
[0036] In this embodiment, there are technical problems such as missing table lines, unclosed borders, or inability to obtain accurate drilling data from text layout alone. Therefore, this embodiment only extracts text objects from all objects, removes all non-text elements, and only performs the processing steps S5 to S10 on the text, so that this embodiment does not require complete table lines, closed cells, or standard spreadsheet objects as necessary conditions.
[0037] Step S5: Extract the text content of each text object and calculate the geometric center coordinates of the text object; The process of obtaining the geometric center coordinates of the text object includes: The display range of the text object in the CAD drawing is determined by the outer bounding box of the text object. The geometric center coordinates are the average of the minimum and maximum coordinate values of the outer bounding box. When the outer bounding box of the text object cannot be obtained, the coordinates of the insertion point of the text object are used as substitute coordinates. The geometric center coordinates are the average of the minimum and maximum coordinate values of the insertion point.
[0038] In this embodiment, for each text object, the system obtains its text content and geometric center coordinates. For single-line text objects and attribute text objects, the system reads their text content; for multi-line text objects, the system reads multiple segments of text content and concatenates them. The geometric center coordinates are preferentially determined based on the bounding box of the text object, that is, the average of the coordinates of the minimum and maximum points of the bounding box is used as the geometric center coordinates of the text object. When the system cannot obtain the bounding box of a certain text object, the coordinates of the insertion point of the text object are used as substitute coordinates.
[0039] Step S6: Based on the relationship between the horizontal coordinates of the text objects and the column intervals formed by the column boundaries, and the geometric center coordinates of the text objects, group the text objects and determine the target column to which each text object belongs; The text objects are grouped based on the relationship between the horizontal coordinates of the text objects and the column intervals formed by the column boundaries, and the geometric center coordinates of the text objects, to determine the target column to which each text object belongs. Figure 4 As shown, it includes: When the geometric center coordinates of the text objects to be grouped are less than the first column boundary position b1, the text objects to be grouped are assigned to the first target column. When the geometric center coordinates of the text object to be grouped are greater than or equal to the (i-1)th column boundary position and less than the ith column boundary position, the text object to be grouped is assigned to the ith target column, where i = 2, 3, ..., m-1; When the geometric center coordinates of the text object to be grouped are greater than or equal to the (m-1)th column boundary position, the text object to be grouped is assigned to the m-th target column.
[0040] In this embodiment, the horizontal coordinate of the geometric center of the text object is compared with the column boundary: when the horizontal coordinate of the text object is less than b1, the text object is assigned to the first target column; when the horizontal coordinate of the text object is greater than or equal to b1, the text object is assigned to the first target column. (i-1) And less than b i When the x-coordinate of the text object is greater than or equal to b, the text object is assigned to the i-th target column; when the x-coordinate of the text object is greater than or equal to b, the text object is assigned to the i-th target column. (m-1) When the text object is assigned to the m-th target column, this method allows you to determine the column affiliation of a text object without relying on the entire table line.
[0041] Step S7: Determine the row grouping tolerance based on the specified adjacent row reference positions; The step of determining the row grouping tolerance based on the specified adjacent row reference position includes: In the borehole data table area, specify a reference position in each of two adjacent lines of text, calculate the spacing between adjacent lines based on the difference in the vertical coordinates of the two reference positions, and determine the row grouping tolerance based on the spacing between adjacent lines.
[0042] Next, specify a reference position near each of the two adjacent lines of text. Calculate the line spacing between adjacent lines based on the difference in the ordinates of the two reference positions, select the smallest of the two line spacings, and use this smallest line spacing as the default line grouping tolerance. Preferably, the default line grouping tolerance is one-third of the line spacing. Users can also manually input the line grouping tolerance based on the actual text layout in the CAD drawing.
[0043] Step S8: Group the text objects into rows according to the row grouping tolerance; The text object is grouped into rows according to the row grouping tolerance, such as... Figure 4 As shown, it includes: The text objects are sorted from largest to smallest according to their vertical coordinates, and the vertical coordinate of the first text object in the current row group is used as the base vertical coordinate. When the difference between the ordinate of the text object to be grouped and the reference ordinate is less than or equal to the row grouping tolerance, the text object to be grouped is assigned to the current row group. When the difference is greater than the row grouping tolerance, a new row group is created, and the ordinate of the text object to be grouped is used as the new reference ordinate.
[0044] In this embodiment, the filtered text objects are sorted from largest to smallest according to their ordinates, and the ordinate of the first text object in the current row group is used as the reference ordinate. If the difference between the ordinate of the text object to be grouped and the reference ordinate is less than or equal to the row grouping tolerance, the text object is assigned to the current row group; if the difference is greater than the row grouping tolerance, a new row group is created, and the ordinate of the text object is used as the new reference ordinate.
[0045] Step S9: Within each row group, determine the target text content for each target column, including: When a text object exists in the same target column of the same row group, the text content of the text object is used as the target text content of the target column. When multiple text objects exist in the same target column in the same row group, the target text content of the target column is determined according to a preset processing rule; the preset processing rule includes: selecting the text object closest to the center of the target column, or splicing multiple text contents according to the spatial order of the text objects.
[0046] In this embodiment, after row grouping, the system searches for text objects belonging to each target column within each row group. When a target column of a row group contains a text object, the text content of that text object is used as the target text content for that row and column. When a target column of a row group contains multiple text objects, the system can determine the target text content for that target column according to preset processing rules. In one implementation, the system calculates the distance between the horizontal coordinate of each text object and the horizontal coordinate of the center of the corresponding target column, and selects the text object with the smallest distance as the target text content for that target column. In another implementation, when multiple text objects belong to the valid content of the target column, the system can concatenate the multiple text contents according to the horizontal or vertical spatial order of the text objects. This method can improve the adaptability of text extraction results from different CAD drawings.
[0047] Step S10: Output the borehole data file according to the row grouping order and the target column order.
[0048] In this embodiment, the system performs formatting processing on the target text content before outputting the borehole data file. This formatting processing includes: replacing text control characters, removing leading and trailing whitespace, processing numeric fields, and escaping CSV fields. For fields such as lithological descriptions, remarks, and stratigraphic descriptions, this processing prevents multi-line text or special characters from disrupting the row and column structure of the CSV file.
[0049] For fields such as borehole number, borehole depth, layer thickness, elevation, and coordinates, the system can make numerical judgments based on the field content. When the field content can be converted to a number, the system removes the thousands separator and outputs it directly so that Excel can read it as a numerical field. When the field content cannot be converted to a number, the system treats it as a text field and encloses it in double quotes when outputting the CSV file. This method reduces the formatting work after importing data into Excel and improves the convenience of subsequent calculations, statistics, and modeling.
[0050] Finally, the system writes the target text content corresponding to each row into a CSV file according to the row grouping order and the target column order. The output drilling data results are as follows: Figure 3 As shown. The CSV file can be directly opened or imported into Excel to form a structured borehole data table. This reduces manual copying, data entry, and secondary processing, and lowers the risks of omissions, errors, mismatches, and misalignments during the borehole data processing.
[0051] Example 2: This embodiment provides an interactive intelligent extraction device for borehole data, such as... Figure 5 As shown, it includes: a table selection module, a center position specification module, a boundary position calculation module, a text filtering module, a center coordinate extraction module, a column grouping module, a tolerance determination module, a row grouping module, a content determination module, and a borehole data output module. The table selection module, center position specification module, and boundary position calculation module are sequentially connected. The table selection module is also connected to the text filtering module, and the boundary position calculation module is also connected to the column grouping module. The text filtering module, center coordinate extraction module, column grouping module, tolerance determination module, row grouping module, content determination module, and borehole data output module are sequentially connected. The borehole data output module is also connected to the column grouping module. The table selection module is used to import CAD drawings and select the drilling data table area in the CAD drawings. The center position specification module is used to specify the center positions of m target columns in the borehole data table area, where m is an integer greater than or equal to 2; The boundary position calculation module is used to sort the center positions of the m target columns according to the horizontal coordinate order, and calculate the m-1 column boundary positions based on the center positions of adjacent target columns. The text filtering module is used to traverse all objects within the borehole data table area and filter text objects from all objects; The center coordinate extraction module is used to extract the text content of each text object and calculate the geometric center coordinates of the text object; The column grouping module is used to group text objects based on the relationship between the horizontal coordinate of the text object and the column interval formed by the column boundary position, and the geometric center coordinates of the text object, and to determine the target column to which each text object belongs; The tolerance determination module is used to determine the row grouping tolerance based on the specified adjacent row reference positions; The line grouping module is used to group text objects into lines according to the line grouping tolerance. The content determination module is used to determine the target text content for each target column in each row group; The borehole data output module is used to output borehole data files according to the order of row grouping and the order of target columns.
[0052] Example 3: This embodiment proposes an electronic device, including: one or more processors, and a memory, the memory being used to store instructions, which, when executed by the one or more processors, cause the one or more processors to execute the interactive intelligent extraction method for borehole data.
[0053] The electronic device may be a mobile phone, computer, or tablet computer, etc., and includes a memory and a processor. The memory stores a computer program, which, when executed by the processor, implements an interactive intelligent extraction method for borehole data as described in the embodiments. It is understood that the electronic device may also include an input / output (I / O) interface and communication components.
[0054] The processor is used to execute all or part of the steps in the interactive intelligent extraction method for borehole data as described in the above embodiments. The memory is used to store various types of data, which may include, for example, instructions for any application or method in an electronic device, as well as application-related data.
[0055] The processor can be implemented as an Application Specific Integrated Circuit (ASIC), Digital Signal Processor (DSP), Programmable Logic Device (PLD), Field Programmable Gate Array (FPGA), controller, microcontroller, microprocessor, or other electronic components, and is used to execute the interactive intelligent extraction method for borehole data described in the above embodiments.
[0056] Example 4: This embodiment proposes a computer-readable storage medium that stores executable instructions. When these instructions are executed, if they are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium.
[0057] The computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the interactive intelligent extraction method for borehole data described in various embodiments of this application.
[0058] The aforementioned storage media include: flash memory, hard disk, multimedia card, card-type memory (e.g., SD (Secure Digital Memory Card) or DX (Memory Data Register, MDR) memory), random access memory (RAM), static random-access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic storage, disk, optical disk, server, APP (Application) application store, and other media capable of storing program verification codes. These media store computer programs, which, when executed by a processor, can implement the various steps of the interactive intelligent extraction method for drilling data described above.
[0059] Example 5: This embodiment proposes a computer program product, including a computer program or instructions, which, when executed by a processor, implements the interactive intelligent extraction method for borehole data.
[0060] Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or part of the technical solution, can be embodied in the form of a computer program product.
[0061] The various embodiments in this application are described in a progressive manner. The same or similar parts between the various embodiments can be referred to each other. Each embodiment focuses on describing the differences from other embodiments.
[0062] The scope of protection of this application is not limited to the embodiments described above. Obviously, those skilled in the art can make various modifications and variations to this disclosure without departing from the scope and spirit of this disclosure. If such modifications and variations fall within the scope of equivalent technology of this disclosure, then the intent of this disclosure also includes such modifications and variations.
Claims
1. An interactive intelligent extraction method for borehole data, characterized in that, include: Import the CAD drawing and select the drilling data table area in the CAD drawing; Specify the center positions of m target columns in the borehole data table area, where m is an integer greater than or equal to 2; Sort the center positions of the m target columns according to the horizontal coordinate order, and calculate the m-1 column boundary positions based on the center positions of adjacent target columns; Iterate through all objects within the borehole data table area and filter for text objects from all objects; Extract the text content of each text object and calculate the geometric center coordinates of the text object; Based on the relationship between the horizontal coordinates of the text objects and the column intervals formed by the column boundaries, and the geometric center coordinates of the text objects, the text objects are grouped to determine the target column to which each text object belongs. Determine the row grouping tolerance based on the specified adjacent row reference positions; The text objects are grouped into rows according to the row grouping tolerance; Within each row group, determine the target text content for each target column; Output the borehole data file according to the order of row grouping and the order of target columns.
2. The interactive intelligent extraction method for borehole data according to claim 1, characterized in that, The types of tables in the borehole data table area include: borehole detail table, borehole bar chart side data table, borehole data summary table, and other table areas containing borehole data. The types of objects in the borehole data table area include: text objects and non-text primitives, where non-text primitives include: table lines, border lines and auxiliary lines.
3. The interactive intelligent extraction method for borehole data according to claim 1, characterized in that, Specifying the center positions of m target columns in the borehole data table area includes: Based on the target data to be extracted from the borehole data table, determine the center position of each target column of the target data; the target data includes: borehole number, borehole depth, borehole opening coordinates, borehole opening elevation, stratigraphy, stratigraphy thickness, lithological description, and two or more types of data in the remarks.
4. The interactive intelligent extraction method for borehole data according to claim 1, characterized in that, The step of sorting the center positions of the m target columns according to their horizontal coordinates and calculating the m-1 column boundary positions based on the center positions of adjacent target columns includes: Sort the x-coordinates of the center positions of the m target columns in ascending order, and denote them as c1, c2, ..., c3. m The column boundaries between two adjacent columns are denoted as b1, b2, ..., b1, b2, ..., b3, b4, b5, b6, b7, b8, b9, b1, b1, b1, b2, b1, b1, b1, b2, b3 ... (m-1) , where c m Let b be the x-coordinate of the center position of the m-th target column. (m-1) The column boundary position between two adjacent columns is the (m-1)th column, and the column boundary position is the ith column. i Satisfy: b i =(c i +c (i+1) ) / 2, i=1, 2, ..., m-1; the borehole data table area is divided into m columns horizontally by the m-1 column boundaries.
5. The interactive intelligent extraction method for borehole data according to claim 1, characterized in that, The process of obtaining the geometric center coordinates of the text object includes: The display range of the text object in the CAD drawing is determined by the outer bounding box of the text object. The geometric center coordinates are the average of the minimum and maximum coordinate values of the outer bounding box. When the outer bounding box of the text object cannot be obtained, the coordinates of the insertion point of the text object are used as substitute coordinates. The geometric center coordinates are the average of the minimum and maximum coordinate values of the insertion point.
6. The interactive intelligent extraction method for borehole data according to claim 1, characterized in that, The process of grouping text objects based on the relationship between the horizontal coordinates of the text objects and the column intervals formed by the column boundaries, and the geometric center coordinates of the text objects, and determining the target column to which each text object belongs, includes: When the geometric center coordinates of the text objects to be grouped are less than the first column boundary position b1, the text objects to be grouped are assigned to the first target column. When the geometric center coordinates of the text object to be grouped are greater than or equal to the (i-1)th column boundary position and less than the ith column boundary position, the text object to be grouped is assigned to the ith target column, where i = 2, 3, ..., m-1; When the geometric center coordinates of the text object to be grouped are greater than or equal to the (m-1)th column boundary position, the text object to be grouped is assigned to the m-th target column.
7. The interactive intelligent extraction method for borehole data according to claim 1, characterized in that, The step of determining the row grouping tolerance based on the specified adjacent row reference position includes: In the borehole data table area, specify a reference position in each of two adjacent lines of text. Calculate the spacing between adjacent lines based on the difference in the vertical coordinates of the two reference positions. Select the smallest spacing between the two adjacent lines and determine the row grouping tolerance based on the smallest spacing between adjacent lines.
8. The interactive intelligent extraction method for borehole data according to claim 1, characterized in that, The step of grouping text objects into lines according to the line grouping tolerance includes: The text objects are sorted from largest to smallest according to their vertical coordinates, and the vertical coordinate of the first text object in the current row group is used as the base vertical coordinate. When the difference between the ordinate of the text object to be grouped and the reference ordinate is less than or equal to the row grouping tolerance, the text object to be grouped is assigned to the current row group. When the difference is greater than the row grouping tolerance, a new row group is created, and the ordinate of the text object to be grouped is used as the new reference ordinate.
9. The interactive intelligent extraction method for borehole data according to claim 1, characterized in that, The step of determining the target text content for each target column within each row group includes: When a text object exists in the same target column of the same row group, the text content of the text object is used as the target text content of the target column. When multiple text objects exist in the same target column in the same row group, the target text content of the target column is determined according to a preset processing rule; the preset processing rule includes: selecting the text object closest to the center of the target column, or splicing multiple text contents according to the spatial order of the text objects.
10. An interactive intelligent extraction device for borehole data, implemented using the interactive intelligent extraction method for borehole data as described in any one of claims 1 to 9, characterized in that, include: The table selection module is used to import CAD drawings and select the drilling data table area in the CAD drawings. The center position specification module is used to specify the center positions of m target columns in the borehole data table area, where m is an integer greater than or equal to 2; The boundary position calculation module is used to sort the center positions of the m target columns according to the horizontal coordinate order, and calculate the m-1 column boundary positions based on the center positions of adjacent target columns. The text filtering module is used to traverse all objects within the borehole data table area and filter text objects from all objects; The center coordinate extraction module is used to extract the text content of each text object and calculate the geometric center coordinates of the text object; The column grouping module is used to group text objects based on the relationship between the horizontal coordinate of the text object and the column interval formed by the column boundary position, and the geometric center coordinates of the text object, and to determine the target column to which each text object belongs; The tolerance determination module is used to determine the row grouping tolerance based on the specified adjacent row reference positions; The line grouping module is used to group text objects into lines according to the line grouping tolerance. The content determination module is used to determine the target text content for each target column in each row group; The borehole data output module is used to output borehole data files according to the order of row grouping and the order of target columns.
Citation Information
Patent Citations
Method for extracting detail content of computer aided design (CAD) drawing to Excel form
CN105159685A