Drawing size extraction method and device, electronic equipment and storage medium

By acquiring and classifying drawing data, determining the relationship between dimension direction and bubble, the accuracy and efficiency issues of dimension extraction from PDF engineering drawings are resolved, achieving automated and efficient dimension extraction.

CN122366434APending Publication Date: 2026-07-10INVENTEC CHONGQING
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
INVENTEC CHONGQING
Filing Date
2026-04-10
Publication Date
2026-07-10

AI Technical Summary

Technical Problem

Existing technologies for extracting dimensions from PDF engineering drawings suffer from poor accuracy, low efficiency, and long processing times, especially in the identification of the correlation between bubbles and dimension values, which is difficult to meet practical needs.

Method used

This paper provides a method for extracting dimensions from drawings. By acquiring drawing data, extracting data elements and their positions, classifying them into dimension data and bubble data, determining the dimension direction, and generating dimension extraction results based on data positions and relationships, the paper uses a combination of regular expressions and coordinate distance thresholds to automatically associate bubbles with dimensions, and divides the paper into grids to improve accuracy and efficiency.

Benefits of technology

It enables automated dimension extraction from PDF drawings, improving the accuracy and efficiency of the correlation between bubbles and dimension data, and reducing the time spent on manual processing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122366434A_ABST
    Figure CN122366434A_ABST
Patent Text Reader

Abstract

The application provides a drawing size extraction method and device, electronic equipment and a storage medium. The method comprises the following steps: obtaining to-be-extracted drawing data, extracting data elements in the to-be-extracted drawing data and data positions of each data element; classifying the data elements to obtain size data and bubble data, determining a size direction of each size data, determining a bubble size association result based on the size direction and the data positions of all data elements, and generating a size extraction result based on all size data, bubble data and the bubble size association result. The method can automatically extract sizes from a PDF drawing, accurately associate bubbles with corresponding size data, and has higher accuracy, higher efficiency and shorter time consumption.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular to a method, apparatus, electronic device, and storage medium for extracting dimensions from drawings. Background Technology

[0002] PDF (Portable Document Format) drawings are technical drawings in engineering, architecture, or design fields that are saved in PDF format. They are widely used to display professional information such as structure, dimensions, and layout, and have advantages such as cross-platform viewing, anti-tampering, and preservation of original layout.

[0003] In related technologies, the extraction of dimensions from PDF engineering drawings is either achieved through manual processing or can only recognize some characters. The accuracy of recognizing the correlation between bubbles and dimension values ​​is not good, which cannot meet the actual needs. Manual supplementation is still required later, which is inefficient and time-consuming. Summary of the Invention

[0004] This application provides a method, apparatus, electronic device, and storage medium for extracting drawing dimensions, in order to solve the technical problems of poor accuracy, low efficiency, and long time consumption in the extraction of drawing dimensions in related technologies.

[0005] This application provides a method for extracting dimensions from drawings. The method includes: acquiring drawing data to be extracted; extracting data elements from the drawing data to be extracted, and the data position of each data element; classifying the data elements to obtain dimension data and bubble data; determining the dimension direction of each dimension data; determining a bubble size association result based on the dimension direction and the data positions of all data elements, wherein the bubble size association result includes the association relationship between each bubble data and the corresponding dimension data; and generating a dimension extraction result based on all dimension data, bubble data, and bubble size association result.

[0006] In one embodiment of this application, the determination of the dimension direction includes at least one of the following: when the number of characters in the dimension data is 1 or 2, and the width of the dimension data is less than the height of the dimension data, the dimension direction is determined to be horizontal; when the number of characters in the dimension data is 1 or 2, and the width of the dimension data is greater than the height of the dimension data, the dimension direction is determined to be vertical; when the number of characters in the dimension data is at least 3, and the width of the dimension data is less than the height of the dimension data, the dimension direction is determined to be vertical; when the application mode of the drawing data to be extracted is the target mode, the number of characters in the dimension data is at least 3, and the width of the dimension data is greater than the height of the dimension data, the dimension direction is determined to be horizontal; when the application mode of the drawing data to be extracted is the non-target mode, the height of the dimension data does not belong to a preset height range, the number of characters in the dimension data is at least 3, and the width of the dimension data is greater than the height of the dimension data, the dimension direction is determined to be horizontal; when the application mode of the drawing data to be extracted is the non-target mode, the height of the dimension data belongs to a preset height range, the number of characters in the dimension data is at least 3, and the width of the dimension data is greater than the height of the dimension data, the dimension direction is determined to be vertical.

[0007] In one embodiment of this application, the method for determining the association between a bubble data and its corresponding size data includes: obtaining a coordinate distance threshold combination based on the size direction matching of the size data, wherein the coordinate distance threshold combination includes an abscissa difference threshold and a ordinate difference threshold; determining a first abscissa difference and a first ordinate difference between each bubble data and the size data based on the data position of the size data and the data position of each bubble data; if there exists a bubble data whose first abscissa difference is less than or equal to the abscissa difference threshold and whose first ordinate difference is less than or equal to the ordinate difference threshold, determining the bubble data as a candidate bubble; determining the bubble size distance between each candidate bubble and the size data based on the data position of the candidate bubble and the data position of the size data; determining the candidate bubble with the smallest bubble size distance as the bubble data associated with the size data, thereby obtaining the association between a bubble data and its corresponding size data.

[0008] In one embodiment of this application, if there are no bubble data whose first horizontal coordinate difference is less than or equal to the horizontal coordinate difference threshold and whose first vertical coordinate difference is less than or equal to the vertical coordinate difference threshold, the method further includes: determining the bubble size distance between each bubble data and the size data based on the data position of each bubble data and the data position of the size data; determining the bubble data with the smallest bubble size distance as the bubble data that is associated with the size data, thereby obtaining the association relationship between a bubble data and the corresponding size data.

[0009] In one embodiment of this application, the method further includes: dividing the document page of the drawing data to be extracted into multiple grids, and determining the grid identifier position of each grid; determining the grid to which the target data belongs based on the data position of the target data and the grid identifier positions of all grids, thereby obtaining the grid to which each target data belongs, wherein the method for determining the target data includes: if the dimension data has associated bubble data, determining the bubble data as the target data, or determining the dimension data as the target data; generating a dimension extraction result based on all dimension data, bubble data, bubble dimension association results, and the grid identifier of the grid to which the target data belongs.

[0010] In one embodiment of this application, determining the grid to which the target data belongs based on the data location of the target data and the grid identifier locations of all grids includes: determining a second abscissa difference between the abscissa of the target data and the abscissa of each grid row identifier, and determining a second ordinate difference between the ordinate of the target data and the ordinate of each grid column identifier, wherein the data location of the target data includes the abscissa and ordinate of the target data, and the grid identifier location includes the abscissa of the grid row identifier and the ordinate of the grid column identifier, and each grid is identified by the grid row identifier and the grid column identifier; the grid row identifier corresponding to the smallest second abscissa difference is taken as the target row identifier; the grid column identifier corresponding to the smallest second ordinate difference is taken as the target column identifier; and the grid to which the target data belongs is determined based on the target row identifier and the target column identifier.

[0011] In one embodiment of this application, a dimension extraction result is generated based on all dimension data, bubble data, and bubble dimension association results, including: determining the dimension value, symbol, positive tolerance, negative tolerance, dimension data width, dimension data height, and page number in the drawing data to be extracted based on the dimension data; determining the bubble number and bubble sequence based on the bubble data; generating a dimension extraction sub-result based on the dimension value of a dimension data, the bubble number of the bubble data associated with the dimension data, and the extraction element; and obtaining the dimension extraction result based on the dimension extraction sub-results of all dimension data; wherein the extraction element includes at least one of the following: symbol, positive tolerance, negative tolerance, dimension data width, dimension data height, page number in the drawing data to be extracted, dimension direction, bubble sequence of the bubble data associated with the dimension data, data position of the dimension data, and grid identifier of the grid to which the dimension data belongs.

[0012] This application embodiment also provides a drawing dimension extraction device, the device comprising: an acquisition module for acquiring drawing data to be extracted; an element extraction module for extracting data elements from the drawing data to be extracted, and the data position of each data element; a classification module for classifying the data elements to obtain dimension data and bubble data; a determination module for determining the dimension direction of each dimension data, and determining a bubble size association result based on the dimension direction and the data positions of all data elements, the bubble size association result including the association relationship between each bubble data and the corresponding dimension data; and a generation module for generating a dimension extraction result based on all dimension data, bubble data, and bubble size association result.

[0013] This application also provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the steps of the method described in any of the above embodiments.

[0014] This application also provides an electronic device, including: a memory storing a computer program thereon; and a processor for executing the computer program in the memory to implement the steps of the method described in any of the above embodiments.

[0015] Beneficial Effects: This application proposes a method, apparatus, electronic device, and storage medium for extracting dimensions from drawings. The method acquires the drawing data to be extracted, extracts the data elements from the drawing data, and the data position of each data element; classifies the data elements to obtain dimension data and bubble data; determines the dimension direction of each dimension data; determines the bubble size association result based on the dimension direction and the data positions of all data elements; and generates the dimension extraction result based on all dimension data, bubble data, and the bubble size association result. If the drawing data to be extracted is PDF drawing data, this method can automatically extract dimensions from PDF drawings and accurately associate bubbles with the corresponding dimension data, resulting in higher accuracy, higher efficiency, and shorter processing time. Attached Figure Description

[0016] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application. It is obvious that the drawings described below are merely some embodiments of this application, and those skilled in the art can obtain other drawings based on these drawings without any inventive effort.

[0017] In the attached diagram: Figure 1 A schematic flowchart illustrating a method for extracting drawing dimensions according to an embodiment of this application; Figure 2A schematic diagram of an interface for a method of acquiring PDF drawing document data according to an embodiment of this application; Figure 3 Another schematic diagram of an interface for a method of acquiring PDF drawing document data provided in an embodiment of this application; Figure 4 This is a sample diagram of a PDF drawing document; Figure 5 A schematic diagram of a drawing dimension extraction device provided in an embodiment of this application; Figure 6 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0018] The following specific examples illustrate the implementation of this application. Those skilled in the art can easily understand other advantages and effects of this application from the content disclosed in this specification. This application can also be implemented or applied through other different specific embodiments. Various details in this specification can also be modified or changed based on different viewpoints and applications without departing from the spirit of this application. In the absence of conflict, the following embodiments and features in the embodiments can be combined with each other.

[0019] It should be noted that the illustrations provided in the following embodiments are only schematic representations of the basic concept of this application. The drawings only show the components related to this application and are not drawn according to the actual number, shape and size of the components in the actual implementation. In the actual implementation, the shape, quantity and proportion of each component can be arbitrarily changed, and the layout of the components may also be more complex.

[0020] In the following description, numerous details are explored to provide a more thorough explanation of embodiments of the present application. However, it will be apparent to those skilled in the art that embodiments of the present application may be practiced without these specific details. In other embodiments, well-known structures and devices are shown in block diagram form rather than in detail to avoid obscuring embodiments of the present application.

[0021] The inventors discovered that the extraction of dimensions from engineering drawings in related technologies either relies on simple OCR (Optical Character Recognition) technology to identify characters, which, while capable of recognizing numerical values, suffers from inaccuracies due to factors such as borders in the drawings. This is particularly true for symbol recognition, where associating symbols with text can lead to errors, requiring further manual processing. However, manual dimension extraction is time-consuming; for complex multi-page PDF documents, the process can take hours or even days. As projects expand, the number of drawings to be processed increases dramatically, making manual methods insufficient for efficient processing and handling large volumes of data. Furthermore, the association between dimensions and bubble numbers in engineering drawings requires manual matching, which is inefficient and prone to errors. Therefore, while manual processing addresses the dimension extraction problem to some extent, its inefficiency, error-proneness, and inconsistent nature cannot be ignored. Thus, in practical applications, due to the limitations of manual processing, automated solutions are urgently needed to improve the efficiency and accuracy of dimension extraction.

[0022] Based on this, this application provides a drawing dimension extraction method, offering an automated solution to improve the efficiency and accuracy of dimension extraction. The method involves acquiring the drawing data to be extracted, extracting data elements from the drawing data, and determining the data position of each data element; classifying the data elements to obtain dimension data and bubble data; determining the dimension direction of each dimension data; determining the bubble size association result based on the dimension direction and the data positions of all data elements; and generating the dimension extraction result based on all dimension data, bubble data, and the bubble size association result. This method can automatically extract dimensions from PDF drawings and accurately associate bubbles with corresponding dimension data, resulting in higher accuracy, higher efficiency, and shorter processing time.

[0023] Please see Figure 1 , Figure 1 A schematic flowchart illustrating a drawing dimension extraction method provided in an embodiment of this application is shown below. Figure 1 As shown, the method includes the following steps: Step S110: Obtain the drawing data to be extracted.

[0024] The drawing data to be extracted can be obtained by the user uploading a PDF drawing, or by obtaining a drawing image, or by other means known to those skilled in the art; no limitation is made here.

[0025] As an example, see Figure 2 , Figure 2 A schematic diagram of an interface for a method of acquiring PDF drawing document data according to an embodiment of this application is shown below. Figure 2As shown, based on the method provided in this embodiment, a PDF size extraction tool can be generated. This tool provides a document upload interface, allowing users to drag and drop PDF or image files to a pre-defined upload area, or click a preset selection button (such as...). Figure 2 You can select a file using the "Browse Files" button control, or you can directly paste drawings or images by copying and pasting.

[0026] As an example, prior to step S110, the method further includes displaying a drawing data acquisition interface, responding to a drawing data upload operation, receiving the uploaded PDF drawing document and / or drawing image, and thus obtaining the drawing data to be extracted. Subsequent steps can be triggered by activating the start processing control.

[0027] As an example, see Figure 3 , Figure 3 Another schematic diagram of an interface for a method of acquiring PDF drawing document data provided in an embodiment of this application is shown below. Figure 3 As shown, taking a PDF drawing document as an example, the user uploads the PDF drawing document to the system, or uploads the PDF drawing document by entering its file path. The system status then changes to "PDF file loaded." After loading the uploaded PDF drawing document and / or drawing images, a preset icon corresponding to the file format of the uploaded file will be displayed to indicate that the upload is complete.

[0028] In some embodiments, to avoid repeatedly processing the same PDF drawings, the already processed PDF drawing documents can be cached. When a new PDF document is received, it is compared with the historical PDF documents. If the same document exists, no processing is performed and a prompt is given; otherwise, the dimensions are extracted normally.

[0029] Step S120: Extract the data elements from the drawing data to be extracted, as well as the data position of each data element.

[0030] As an example, if the drawing data to be extracted is a PDF drawing document, the PyMuPDF library can be used to efficiently parse the PDF drawing document, extract text location and text content information, and obtain data elements and data locations.

[0031] As an example, if the drawing data to be extracted is an image drawing, data elements can be identified and the location of each data element can be determined using OCR recognition technology.

[0032] After obtaining the data location of each data element, the coordinate system can be converted to a preset unit, such as millimeters, to improve accuracy and consistency. Taking a PDF drawing document as an example, the initially obtained data location may be in pixels, which needs to be converted to millimeters because the original drawing unit is also millimeters.

[0033] Step S130: Classify the data elements to obtain size data and bubble data.

[0034] As an example, regular expressions can be used to distinguish between dimension data and bubble data. Dimension data includes dimension values, symbols, positive tolerances (if any), negative tolerances (if any), dimension data width, dimension data height, and data position. For example, symbols can be "°", "R", etc. Symbols such as "" are defined by those skilled in the art. These symbols can be those used in general dimensional standards, or they can be symbols defined by those skilled in the art that have a certain identifying meaning, such as "". The symbol represents key data to focus on.

[0035] The following are some examples and explanations of regular expressions. It should be noted that those skilled in the art can also set other regular expressions as needed, not limited to the following examples: r'(R\d+)|'# Matches R followed by an integer, such as R3, R5 r'(\$)|'# matches a single $ symbol `r'(R\d+\.\d+)|'` # Matches R followed by a decimal, such as R3.5, R2.0 r'(\d+(?:\.\d+)?°)|'# Matches angle values, such as 93°, 12.5° r'(\d+\$)|'# Matches an integer plus $, such as 150$ r'(^\d+$)|'# Matches pure integers, such as 123, 45 r'(BOSS\d+)|'# Matches BOSS followed by a number, such as BOSS1, BOSS12 r'(\-0)|'# Matches the case of -0 r'(^0$)|'# Matches a single 0 r'(\-\d+)|'# Matches negative integers, such as -1, -10 r'(\ \d+)|'# Match Followed by an integer, such as 309 r'(\ \s \d+\.\d+)|'# Match Followed by a decimal, such as 309.21 or 309.21 `r'(\d+\.\d+)|'` # Matches decimals, such as 3.14, 2.5 r'(\d+\.\d+\s [±≤≥><+-]\s \d+\.\d+)|'# Matching dimensions with tolerances, such as 10.5±0.1, 5.0+0.2 r'([±≤≥><+-]\s `\d+\.\d+)|'#` matches individual tolerance values, such as ±0.1, +0.2. r'(\d+\.\d+\s mm)|'# Matches decimals with mm units, such as 5.0mm `r'(\d+\.\d+[\+]\d+\.\d+)|'` # Matches a decimal plus a decimal format, such as 5.0+0.1 `r'(\d+\.\d+[\-+]\d+\.\d+)|'` # Matches a decimal with a range of ±, such as 5.0-0.1 or 5.0+0.1. r'(\(\d+\.\d+\))|'# Matches the size within the parentheses in English letters, such as (5.0) Bubble data includes bubble number, bubble sequence, and other data.

[0036] Step S140: Determine the dimension orientation of each dimension data, and determine the bubble size association result based on the dimension orientation and the data position of all data elements.

[0037] The bubble size correlation results include the relationship between each bubble data and its corresponding size data.

[0038] As an example, each size data corresponds to one bubble data, but it is also possible that the bubble data corresponding to a certain size data is an empty set, or the size data corresponding to a certain bubble data is an empty set.

[0039] By associating bubble size results, bubbles can be linked to size values, which facilitates the presentation of subsequent size extraction results.

[0040] In one embodiment, the dimension direction is determined in at least one of the following ways: when the number of characters in the dimension data is 1 or 2 and the width of the dimension data is less than the height of the dimension data, the dimension direction is determined to be horizontal; when the number of characters in the dimension data is 1 or 2 and the width of the dimension data is greater than the height of the dimension data, the dimension direction is determined to be vertical; when the number of characters in the dimension data is at least 3 and the width of the dimension data is less than the height of the dimension data, the dimension direction is determined to be vertical; when the application mode of the drawing data to be extracted is target mode, the number of characters in the dimension data is at least 3 and the width of the dimension data is greater than the height of the dimension data, the dimension direction is determined to be horizontal; when the application mode of the drawing data to be extracted is non-target mode, the height of the dimension data does not belong to the preset height range, the number of characters in the dimension data is at least 3 and the width of the dimension data is greater than the height of the dimension data, the dimension direction is determined to be horizontal; when the application mode of the drawing data to be extracted is non-target mode, the height of the dimension data belongs to the preset height range, the number of characters in the dimension data is at least 3 and the width of the dimension data is greater than the height of the dimension data, the dimension direction is determined to be vertical.

[0041] As an example, the target pattern can be a consumer pattern or other patterns defined by those skilled in the art. This pattern can be parsed from the drawing data to be extracted.

[0042] It is understandable that the above method determines the direction of the text based on its geometric characteristics (aspect ratio), and improves the accuracy of direction determination by combining the positional relationship of the character matrix, supporting the recognition of three directions: horizontal, vertical, and diagonal.

[0043] For example, the preset height range can be [3.90, 3.94] or [1.950, 1.954]. The preset height range can also be other ranges set by those skilled in the art.

[0044] To determine whether the height of the dimension data falls within a preset height range, you can use the round() function on the dimension height data to determine whether to retain one or two decimal places.

[0045] The following is a code implementation example of a dimension orientation determination method provided in an embodiment of this application: #Direction determination based on geometric features ifnode == "consumer": ifis_one_or_two_digit andwidth_nm <height_mm: orientation = "horizontal" else: orientation = "Landscape" if width_mm > height_nm else "Portrait" else : if is_one_or_two_digit and width_mm < height_mm: orientatian = "Landscape" else : orientation = "Landscape" if width_mm > heigh_mm and round(height_m,1)!= 3.9 and round(height_mm, 2)!= 1.95 else "Portrait" It should be noted that there may be some typos in the original text (such as "heigh_mm" which is likely a misspelling of "height_mm"), but the translation is carried out according to the original text.As shown in the code example above, when the application mode is target mode (consumer), if the number of characters in the dimension data is 1 or 2 and the width of the dimension data is less than the height of the dimension data, the dimension direction is determined to be horizontal; if the number of characters in the dimension data is 1 or 2 and the width of the dimension data is greater than the height of the dimension data, the dimension direction is determined to be vertical; if the number of characters in the dimension data is at least 3 and the width of the dimension data is less than the height of the dimension data, the dimension direction is determined to be vertical. When the application mode for the drawing data to be extracted is target mode, if the number of characters in the dimension data is at least 3 and the width of the dimension data is greater than the height of the dimension data, the dimension direction is determined to be horizontal. When the application mode for the drawing data to be extracted is non-target mode, if the height of the dimension data is not within the preset height range, if the number of characters in the dimension data is at least 3 and the width of the dimension data is greater than the height of the dimension data, the dimension direction is determined to be horizontal; if the application mode for the drawing data to be extracted is non-target mode, if the height of the dimension data is within the preset height range, if the number of characters in the dimension data is at least 3 and the width of the dimension data is greater than the height of the dimension data, the dimension direction is determined to be vertical. The determination of whether a value belongs to a preset height range can be achieved using the `round()` function. If `round(height_mm, 1) != 3.9`, then it belongs to the preset height range; if `round(height_mm, 1) != 1.95`, then it belongs to the preset height range. `height_mm` represents the height of the dimension data, `width_mm` represents the width of the dimension data, `orientation` represents the dimension direction, `mode` represents the application mode, and `digit` represents the number of characters. The purpose of orientation detection is to find the nearest bubble to the dimension. For horizontal rows (left-right direction), the nearest bubble in the X direction is prioritized; for vertical rows (top-bottom direction), the nearest bubble in the Y direction is prioritized. A special case is the 1.95mm height object, such as the extracted data '4'. If it were wider, what would normally be a horizontal direction would be judged as a top-bottom direction; this is a special filtering mechanism.

[0046] The following is an exemplary code example for direction determination: # Iterate through each word block in the words list for word_info in words: # Extract the bounding box coordinates of words (the original unit may be points / pixels, which need to be converted to millimeters). # Assume the word_info format is [x0, y0, x1, y1, text] x0 = word_info[0] PT_TO_MM# Top-left x-coordinate, converted to millimeters y0 = word_info[1] PT_TO_MM# Top-left y-coordinate, converted to millimeters x1 = word_info[2] PT_TO_MM# Bottom right x-coordinate, converted to millimeters y1 = word_info[3] PT_TO_MM# Bottom right y-coordinate, converted to millimeters # Calculate the physical dimensions (in millimeters) of the word bounding box. width_mm = x1 - x0 # width height_mm = y1 - y0 # Height x_center = (x0 + x1) / 2 # Center point x-coordinate (although not used later, it may be reserved) y_center = (y0 + y1) / 2 # Center point y-coordinate (reserved) # Extract and clean text: Remove leading and trailing whitespace characters text = word_info[4].strip() # Replace comma separators in numbers with decimal points (e.g., change "1,23" to "1.23"). text = re.sub(r'(\d),(\d)', r'\1.\2', text) # Determine if the text contains exactly two digits (e.g., "23"). is_one_or_two_digit = re.fullmatch(r'^\d{2}$', text) # Determine the text arrangement direction (horizontal / vertical) based on aspect ratio and text features. if is_one_or_two_digit and width_mm <height_mm: # Special case: Two-digit numbers, and width less than height -> judged as horizontal. # (Note: Vertical text is usually narrower than its height; this logic may be a correction for a specific scenario.) orientation = "horizontal" else: # General case: If width > height, it is horizontal; otherwise (width ≤ height), it is vertical. orientation = "horizontal" if width_mm > height_mm; otherwise, "vertical". As shown in the code example above, for each word information block, the bounding box coordinates are extracted, and the units of the coordinate data are converted to a unified unit, such as millimeters, to obtain the top-left, bottom-left, top-right, and bottom-right coordinates of the bounding box, thus obtaining the data position of a dimension. Then, the physical dimensions of the bounding box are determined, obtaining the dimension data height and dimension data width. The text is extracted and cleaned, removing leading and trailing whitespace characters, and replacing comma separators in the obtained numbers with decimal points, for example, changing "1,23" to "1.23". It is determined whether the text is a two-digit number, such as "23", and the text arrangement direction (horizontal / vertical) is determined based on the aspect ratio and text characteristics. For the special case of a one- or two-digit number with a width less than the height, it is determined to be horizontal; for a two-digit number with a width greater than the height, it is determined to be vertical. For the general case (not a one- or two-digit number), if the width is greater than the height, it is horizontal; otherwise, if the width is less than or equal to the height, it is vertical.

[0047] In one embodiment, the method for determining the association between a bubble data and its corresponding size data includes: obtaining a coordinate distance threshold combination based on the size direction matching of the size data, the coordinate distance threshold combination including an abscissa difference threshold and a ordinate difference threshold; determining a first abscissa difference and a first ordinate difference between each bubble data and the size data based on the data position of the size data and the data position of each bubble data; if there is a bubble data with a first abscissa difference less than or equal to the abscissa difference threshold and a first ordinate difference less than or equal to the ordinate difference threshold, the bubble data is determined as a candidate bubble; determining the bubble size distance between each candidate bubble and the size data based on the data position of the candidate bubble and the data position of the size data; determining the candidate bubble with the smallest bubble size distance as the bubble data with an association relationship with the size data, thereby obtaining the association between a bubble data and its corresponding size data.

[0048] As an example, the correlation between bubble data and corresponding size data can be obtained through a smart matching algorithm based on location distance, for example, by using different matching strategies according to the size orientation: Horizontal coordinate distance threshold combination: X distance ≤ 15mm, Y distance ≤ 3mm; Vertical coordinate distance threshold combination: X distance ≤ 5mm, Y distance ≤ 10mm; The coordinate distance threshold combination for diagonal layout is: X / Y distance ≤ 15mm each; Wherein, the X distance is the difference in the first horizontal coordinate, and the Y distance is the difference in the first vertical coordinate. The values ​​15, 3, 5, and 10 in the above example can be flexibly set by those skilled in the art as needed; this is merely an example.

[0049] Examples of dimensional orientations include horizontal, vertical, and diagonal layouts.

[0050] The following is a code implementation example of a bubble matching method provided in an embodiment of this application: #Set matching conditions based on size orientation iforientation=='horizontal': max_x_diff = 15 max_y_diff = 3 eliforientation== 'vertical layout': max_x_diff = 5 max_y_diff = 10 eliforientation= = 'diagonal arrangement': max_x_diff = 15 max_y_diff = 15 #Find the most recent bubble that matches the criteria forbubbleinpage_unnatched_bubbles: x_diff=abs(bubble['x']-dim_x) y_diff=abs(bubble['y']-dim_y) Ifx_diff<= max_x_diffandy_diff<=max_y_diff: distance = (x_diff 2 + y_diff 2) 0.5 ifdistance <min_distance: min_distance = distance nearest_bubble = bubble As shown in the example code above, if the dimension orientation is horizontal, then the first horizontal coordinate difference threshold `max_x_diff` in the coordinate distance threshold combination is 15, and the first vertical coordinate difference threshold is 3; if the dimension orientation is vertical, then the first horizontal coordinate difference threshold `max_x_diff` in the coordinate distance threshold combination is 5, and the first vertical coordinate difference threshold is 10; if the dimension orientation is diagonal, then the first horizontal coordinate difference threshold `max_x_diff` in the coordinate distance threshold combination is 15, and the first vertical coordinate difference threshold is 15; then, by calculating... Calculate the first horizontal coordinate difference x_diff and the first vertical coordinate difference y_diff between the data position (bubble['x'], bubble['y']) of each bubble data and the data position (dim_x, y) of a certain size data. Then, filter out a portion of bubble data that may be associated with the size data by checking whether the first horizontal coordinate difference x_diff and the first vertical coordinate difference y_diff meet the requirements of the coordinate distance threshold combination. Calculate the Euclidean distance between this portion of bubble data and the size data, and take the bubble data corresponding to the smallest distance value as the bubble data associated with the current size data.

[0051] As an example, the location data of dimension data can be identified by the center coordinates of the character position of the dimension data.

[0052] In one embodiment, if there are no bubble data points where the first horizontal coordinate difference is less than or equal to a threshold value and the first vertical coordinate difference is less than or equal to a threshold value, the method further includes: determining the bubble size distance between each bubble data point and the size data point based on the data position of each bubble data point and the data position of the size data point; identifying the bubble data point with the smallest bubble size distance as the bubble data point associated with the size data point, thereby obtaining the association relationship between a bubble data point and the corresponding size data point. The bubble size distance can be a Euclidean distance, determined by the center position coordinates of the size character and the data position of the bubble.

[0053] After establishing the association relationship as shown in the above embodiment, if the bubble data corresponding to a certain size data cannot be found, the search range can be expanded by finding the latest unassociated bubble as the associated bubble data for that size data.

[0054] Step S150: Generate dimension extraction results based on all dimension data, bubble data, and bubble dimension correlation results.

[0055] In some embodiments, the method further includes: dividing the document page from which drawing data is to be extracted into multiple grids, and determining the grid identifier position of each grid; determining the grid to which the target data belongs based on the data position of the target data and the grid identifier positions of all grids, thereby obtaining the grid to which each target data belongs, wherein the method for determining the target data includes: if the dimension data has associated bubble data, determining the bubble data as the target data, or determining the dimension data as the target data; generating dimension extraction results based on all dimension data, bubble data, bubble dimension association results, and the grid identifier of the grid to which the target data belongs.

[0056] Drawings are typically rectangular. Grid lines can be added to rows and columns to create multiple grids. The grids can be evenly or unevenly spaced, as determined by those skilled in the art. Each row has a row identifier, and each column has a column identifier. For example, a letter (AP) and number (1-24) grid system can be used. As an example, a grid identifier rule can be pre-defined based on different sizes of PDF documents or images, such as A4 being AD, 1-6, etc. Thus, A5 can represent one grid. When extracting dimensions, the grid identifiers can be added to facilitate quick and easy data location.

[0057] The grid forms a character matrix, and by constructing a reference coordinate system based on the character positions, it can provide a basis for subsequent size positioning.

[0058] In some embodiments, determining the grid to which the target data belongs based on the data location of the target data and the grid identifier locations of all grids includes: determining a second abscissa difference between the abscissa of the target data and the abscissa of each grid row identifier, and determining a second ordinate difference between the ordinate of the target data and the ordinate of each grid column identifier, wherein the data location of the target data includes the abscissa and ordinate of the target data, and the grid identifier location includes the abscissa of the grid row identifier and the ordinate of the grid column identifier, and each grid is identified by the grid row identifier and the grid column identifier; the grid row identifier corresponding to the smallest second abscissa difference is taken as the target row identifier; the grid column identifier corresponding to the smallest second ordinate difference is taken as the target column identifier; and the grid to which the target data belongs is determined based on the target row identifier and the target column identifier.

[0059] The following is a code implementation example of grid positioning provided in an embodiment of this application: def get_grid_position (x_mm,y_mm,leftmost_letters,topmost_digits): #Find the nearest column (number) min_col_distance = float('inf') nearest_col = 1 for digit, coordsin topmost_digits.items (): digit_x = coords['center_x'] distance = abs(x_mm - digit_x) ifdistance <min_col_distance: min_col_distance = distance nearest_col = int (digit ) #Find the nearest row (letter) min_row_distance =float ( 'inf ' ) nearest_row='A' for letter , coordsinleftmost_letters.items() : letter_y = coords['center_y'] distance = abs(y_mm -letter_y) ifdistance <min_row_distance: min_row_distance=distance nearest_row=letter returnf"{nearest_row}{nearest_col}" , nearest_row , nearest_col As shown in the code example above, grid positioning requires finding the nearest column and row of the target data. Taking columns identified by numbers and rows identified by letters as an example, grid positioning is achieved by calculating the difference between the second x-coordinate of the target data's x-coordinate and the x-coordinate of each row identifier, and by calculating the difference between the second y-coordinate of the target data's y-coordinate and the x-coordinate of each row identifier. Then, the row identifier nearest_row corresponds to the smallest second x-coordinate difference, and the column identifier nearest_col corresponds to the smallest second y-coordinate difference.

[0060] In some embodiments, a dimension extraction result is generated based on all dimension data, bubble data, and bubble dimension association results, including: determining the dimension value, symbol, positive tolerance, negative tolerance, dimension data width, dimension data height, and page number in the drawing data to be extracted based on the dimension data; determining the bubble number and bubble sequence based on the bubble data; generating a dimension extraction sub-result based on the dimension value of a dimension data, the bubble number of the bubble data associated with the dimension data, and the extraction element; and obtaining the dimension extraction result based on the dimension extraction sub-results of all dimension data; wherein the extraction element includes at least one of the following: symbol, positive tolerance, negative tolerance, dimension data width, dimension data height, page number in the drawing data to be extracted, dimension direction, bubble sequence of the bubble data associated with the dimension data, data position of the dimension data, and grid identifier of the grid to which the dimension data belongs.

[0061] As an example, size data may include symbols, which can be distinguished using regular expressions. For example, r'( `\d+(?:\.\d+)?)|'` can match a diameter symbol followed by a number, such as... 2. 1.5. For example, r'(R\d+)|' can match R3, an integer R3. For example, r'(\d+(?:\.\d+)?°)|' adds a new identifier: matches 93° or 12.5°.

[0062] When processing individual '°' symbols, they are added to the corresponding dimensions through positional association. For dimensions with empty bubble values, i.e., dimension data for which no suitable bubble has been matched yet, unused bubbles can be matched using the nearest neighbor algorithm.

[0063] Various regular expression patterns can be used to match various size formats, supporting diameter ( The system can automatically separate dimensional values ​​and tolerance information by recognizing special symbols such as radius (R) and tolerance (±).

[0064] As an example, an exemplary system architecture for implementing this drawing dimension extraction method is as follows: User interface layer. Includes a PyQt5-based graphical user interface that supports drag-and-drop file processing and batch processing, displaying processing progress and results in real time. Processing progress can be displayed as "System ready," "PDF file loaded," "Dimension extraction completed," etc. Results can be displayed as "Dimension extraction complete."

[0065] The data processing layer includes: a PDF parsing module for parsing PDF drawing documents to obtain the drawing data to be extracted; a text extraction module for extracting data elements; a dimension recognition module for recognizing dimension data within data elements; and a bubble matching module for associating dimension data with bubble data.

[0066] Cache management layer. PDF cache manager to avoid redundant processing. Memory optimizer to monitor and optimize memory usage.

[0067] Output layer. A CSV format output module is used to output the extracted dimensions in CSV format for... Subsequent use will support multiple data formats and sorting methods.

[0068] The above technical solution successfully achieved automated extraction of PDF drawing dimensions, solving the problems of low efficiency and error-proneness in manual processing methods in related technologies, and greatly improving the efficiency and accuracy of engineering drawing processing.

[0069] Please see Figure 4 , Figure 4 Here is a sample illustration of a PDF drawing document, such as... Figure 4 As shown, the grid rows are labeled 1 to 8 from right to left, and the grid columns are labeled A to F from bottom to top. X3 and other values ​​represent size data, while B-26 and other values ​​represent bubble data.

[0070] Please refer to Table 1, which is... Figure 4 This is an example of how to extract dimensions from a PDF drawing.

[0071] Table 1

[0072] The drawing dimension extraction method provided in the above embodiments obtains the drawing data to be extracted, extracts the data elements in the drawing data to be extracted, and the data position of each data element; classifies the data elements to obtain dimension data and bubble data, determines the dimension direction of each dimension data, determines the bubble size association result based on the dimension direction and the data position of all data elements, and generates the dimension extraction result based on all dimension data, bubble data and bubble size association result. It can automatically extract dimensions from PDF drawings and accurately associate bubbles with corresponding dimension data, with higher accuracy, higher efficiency and shorter time consumption.

[0073] The methods provided above can also achieve the following beneficial effects: Automated and efficient processing: It realizes the automatic extraction of PDF drawing dimensions, which greatly improves processing efficiency and reduces the processing time of a single page drawing from several minutes to several seconds.

[0074] Intelligent orientation recognition: Based on the geometric features of the text and the positional relationship of the character matrix, it can accurately identify horizontal, vertical and diagonal dimension annotations.

[0075] Precise grid positioning: Through character matrix construction and grid positioning algorithm, the dimensions are accurately positioned in the drawing with an error of less than 1mm.

[0076] Intelligent bubble matching: It realizes automatic association and matching of size and bubble number, and supports intelligent matching algorithms based on distance and direction.

[0077] Multi-mode support: Supports two different drawing formats, consumer and business, and can adapt to different drawing standards.

[0078] Memory optimization design: By employing intelligent caching and memory optimization technology, it can handle large PDF documents without memory overflow. The specific memory optimization design method can adopt the existing technology implementation method, which will not be elaborated here.

[0079] High-accuracy recognition: Through various regular expressions and geometric feature analysis, high-accuracy recognition of various size formats is achieved.

[0080] In one embodiment, a drawing size extraction device is provided, which is used to perform the drawing size extraction method provided in any of the above embodiments. Please refer to [link to previous document]. Figure 5 , Figure 5 A schematic diagram of a drawing dimension extraction device provided in an embodiment of this application is shown below. Figure 5 As shown, the drawing dimension extraction device 800 includes: an acquisition module 810 for acquiring drawing data to be extracted; an element extraction module 820 for extracting data elements from the drawing data to be extracted, and the data position of each data element; a classification module 830 for classifying the data elements to obtain dimension data and bubble data; a determination module 840 for determining the dimension direction of each dimension data, and determining the bubble dimension association result based on the dimension direction and the data position of all data elements, the bubble dimension association result including the association relationship between each bubble data and the corresponding dimension data; and a generation module 850 for generating dimension extraction results based on all dimension data, bubble data, and bubble dimension association results.

[0081] Specific limitations regarding the drawing dimension extraction device can be found in the limitations of the drawing dimension extraction method described above, and will not be repeated here. Each module in the aforementioned drawing dimension extraction device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in the electronic device, or stored in the memory of the electronic device in software form, so that the processor can call and execute the corresponding operations of each module.

[0082] In this embodiment, the drawing size extraction device is actually equipped with multiple modules to execute the drawing size extraction method in any of the above embodiments. The specific functions and technical effects can be referred to in the above embodiments, and will not be repeated here.

[0083] See Figure 6 , Figure 6 A schematic diagram of the structure of an electronic device provided in an embodiment of this application is shown below. Figure 6 As shown, this embodiment of the invention also provides an electronic device 900, including a processor 901, a memory 902, and a communication bus 903; the communication bus 903 is used to connect the processor 901 and the memory 902; the processor 901 is used to execute a computer program stored in the memory 902 to implement the method provided in any of the above embodiments.

[0084] This invention also provides a computer-readable storage medium having a computer program stored thereon, the computer program being used to cause a computer to perform the method described in any of the above embodiments.

[0085] This application also provides a computer-readable storage medium storing one or more modules (programs) that, when applied to a device, enable the device to execute the instructions included in the steps provided in this application.

[0086] This application also provides a computer program product, including a computer program or instructions, which, when executed by a processor, can implement the steps and corresponding content of the aforementioned method embodiments.

[0087] It should be noted that the computer-readable medium described in this disclosure can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this disclosure, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In this disclosure, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium can be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wires, optical fibers, RF (radio frequency), etc., or any suitable combination thereof.

[0088] The aforementioned computer-readable medium may be included in the aforementioned electronic device; or it may exist independently and not assembled into the electronic device.

[0089] Computer program code for performing the operations of this disclosure can be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, and C++, and conventional procedural programming languages ​​such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0090] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of methods and computer program products according to various embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.

[0091] It should be understood that the terms "first," "second," etc., used in this application are used to distinguish similar objects and do not necessarily indicate a specific order or sequence. The technical features to which these terms are used can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in a sequence other than that shown in the figures or text.

[0092] It should be understood that although the flowcharts provided in the embodiments of this application indicate the various steps with arrows, the order indicated by the arrows does not necessarily limit the implementation order of these steps. Those skilled in the art can perform these steps in other orders according to different implementation scenarios and requirements.

[0093] The above embodiments are merely illustrative of the principles and effects of this application and are not intended to limit this application. Any person skilled in the art can modify or alter the above embodiments without departing from the spirit and scope of this application. Therefore, all equivalent modifications or alterations made by those skilled in the art without departing from the spirit and technical concept disclosed in this application should still be covered by the claims of this application.

Claims

1. A method for extracting dimensions from drawings, characterized in that, The method includes: Obtain the drawing data to be extracted; Extract the data elements from the drawing data to be extracted, and the data position of each data element; The data elements are classified to obtain size data and bubble data; Determine the dimension orientation of each dimension data, and determine the bubble size association result based on the dimension orientation and the data position of all data elements. The bubble size association result includes the association relationship between each bubble data and the corresponding dimension data. The dimension extraction results are generated based on all the dimension data, bubble data, and bubble dimension correlation results.

2. The method for extracting drawing dimensions as described in claim 1, characterized in that, The method for determining the dimensional orientation includes at least one of the following: When the number of characters in the dimension data is 1 or 2, and the width of the dimension data is less than the height of the dimension data, the dimension direction is determined to be horizontal. When the number of characters in the dimension data is 1 or 2, and the width of the dimension data is greater than the height of the dimension data, the dimension direction is determined to be vertical. When the number of characters in the dimension data is at least 3 and the width of the dimension data is less than the height of the dimension data, the dimension direction is determined to be vertical. When the application mode of the drawing data to be extracted is the target mode, the number of characters in the dimension data is at least 3, and the width of the dimension data is greater than the height of the dimension data, the dimension direction is determined to be horizontal. When the application mode of the drawing data to be extracted is non-target mode, the height of the dimension data does not belong to the preset height range, the number of characters in the dimension data is at least 3, and the width of the dimension data is greater than the height of the dimension data, the dimension direction is determined to be horizontal. When the application mode of the drawing data to be extracted is non-target mode, the height of the dimension data is within the preset height range, the number of characters in the dimension data is at least 3, and the width of the dimension data is greater than the height of the dimension data, the dimension direction is determined to be vertical.

3. The method for extracting drawing dimensions as described in claim 1, characterized in that, The methods for determining the correlation between a bubble's data and its corresponding dimension data include: A coordinate distance threshold combination is obtained by matching the dimension direction of the dimension data, and the coordinate distance threshold combination includes the horizontal coordinate difference threshold and the vertical coordinate difference threshold. Based on the data position of the size data and the data position of each bubble data, determine the first horizontal coordinate difference and the first vertical coordinate difference between each bubble data and the size data; If there are bubble data where the first horizontal coordinate difference is less than or equal to the horizontal coordinate difference threshold and the first vertical coordinate difference is less than or equal to the vertical coordinate difference threshold, the bubble data is determined as a candidate bubble. The bubble size distance between each candidate bubble and the size data is determined based on the data position of the candidate bubble and the data position of the size data. The candidate bubble with the smallest bubble size distance is identified as the bubble data that is associated with the size data, thereby obtaining the association between a bubble data and the corresponding size data.

4. The method for extracting drawing dimensions as described in claim 3, characterized in that, If there are no bubble data where the first horizontal coordinate difference is less than or equal to the horizontal coordinate difference threshold and the first vertical coordinate difference is less than or equal to the vertical coordinate difference threshold, the method further includes: The bubble size distance between each bubble data point and the size data point is determined based on the data position of each bubble data point and the data position of the size data point. The bubble data with the smallest bubble size distance is identified as the bubble data that is associated with the size data, thereby obtaining the association relationship between a bubble data and the corresponding size data.

5. The method for extracting drawing dimensions as described in any one of claims 1-4, characterized in that, The method further includes: The document page containing the drawing data to be extracted is divided into multiple grids, and the grid identifier position of each grid is determined. The grid to which the target data belongs is determined based on the data location of the target data and the grid identifier location of all grids, thereby obtaining the grid to which each target data belongs. The method for determining the target data includes: if there is associated bubble data for the size data, the bubble data is determined as the target data, or the size data is determined as the target data. The dimension extraction results are generated based on all the dimension data, bubble data, bubble size correlation results, and the grid identifier of the target data's grid.

6. The method for extracting drawing dimensions as described in claim 5, characterized in that, Determining the grid to which the target data belongs based on the data location of the target data and the grid identifier locations of all grids includes: Based on the data location of the target data and the grid identifier locations of all grids, a second abscissa difference between the abscissa of the target data and the abscissa of each grid row identifier is determined, as well as a second ordinate difference between the ordinate of the target data and the ordinate of each grid column identifier is determined. The data location of the target data includes the abscissa and ordinate of the target data, and the grid identifier location includes the abscissa of the grid row identifier and the ordinate of the grid column identifier. Each grid is identified by the grid row identifier and the grid column identifier. Use the grid row identifier corresponding to the smallest second horizontal coordinate difference as the target row identifier; Use the grid column identifier corresponding to the smallest second ordinate difference as the target column identifier; The grid to which the target data belongs is determined based on the target row identifier and the target column identifier.

7. The method for extracting drawing dimensions as described in any one of claims 1-4, characterized in that, The dimension extraction results are generated based on all dimension data, bubble data, and bubble dimension correlation results, including: Based on the dimensional data, determine the dimensional value, symbol, positive tolerance, negative tolerance, dimensional data width, dimensional data height, and page number in the drawing data to be extracted; The bubble number and bubble sequence are determined based on the bubble data; A dimension extraction sub-result is generated based on the dimension value of a dimension data, the bubble number of the bubble data associated with the dimension data, and the extraction element. The dimension extraction result is obtained based on the dimension extraction sub-results of all dimension data. The extraction element includes at least one of the following: symbol, positive tolerance, negative tolerance, dimension data width, dimension data height, page number in the drawing data to be extracted, dimension direction, bubble sequence of the bubble data associated with the dimension data, data position of the dimension data, and grid identifier of the grid to which the dimension data belongs.

8. A drawing dimension extraction device, characterized in that, The device includes: The acquisition module is used to acquire the drawing data to be extracted; The element extraction module is used to extract data elements from the drawing data to be extracted, as well as the data position of each data element; The classification module is used to classify the data elements to obtain size data and bubble data; The determination module is used to determine the dimension direction of each dimension data, and to determine the bubble size association result based on the dimension direction and the data position of all data elements. The bubble size association result includes the association relationship between each bubble data and the corresponding dimension data. The generation module is used to generate dimension extraction results based on all dimension data, bubble data, and bubble dimension correlation results.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the method as described in any one of claims 1 to 6.

10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the method as described in any one of claims 1 to 6.