Cad component recognition method and device, computer device, readable storage medium and program product

CN122551378APending Publication Date: 2026-08-11苏州明新智算科技有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-04-08
Publication Date
2026-08-11

AI Technical Summary

Technical Problem

[0003]然而,当前主流的构件识别方法仍高度依赖人工判读或半自动辅助手段,存在效率低下、主观性强、一致性差等问题,难以满足大规模、高并发的批量图纸处理需求

Benefits of technology

[0019]The aforementioned CAD component recognition method, apparatus, computer equipment, computer-readable storage medium, and computer program product extract legend entities and corresponding equipment categories by parsing the legend table area in CAD drawings and generating feature signatures for the legend entities. Based on the component type of the legend entities, the drawing area of ​​the CAD drawing is identified, determining at least one set of component entities to be matched. A spatial index is constructed based on this set. Neighborhood or range queries are performed in the spatial index based on the spatial features of the components in the legend entities to obtain matching candidate component entities. A second feature signature is generated for each candidate component entity. The similarity between the first feature signature of the corresponding component in the legend entity and the second feature signature of the candidate component entity is obtained based on the component type. Candidate component entities whose similarity meets a similarity threshold are determined as the matching results for the legend entities. The matching results are verified and deduplicated based on the constraints of the legend entities to obtain the target component recognition result based on the legend entities. By converting legendary entities into computable feature signatures, combining spatial index candidate component entity retrieval and parallel matching mechanisms, and performing multi-dimensional verification and deduplication merging of matching results, it can achieve high-efficiency and high-accuracy identification of block-level components, primitive group components, and pipeline components, thereby providing reliable basic data support for applications such as engineering quantity calculation, automatic modeling, and intelligent review.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122551378A_ABST
    Figure CN122551378A_ABST
Patent Text Reader

Abstract

This application relates to a method, apparatus, computer device, readable storage medium, and program product for identifying CAD components. By converting legendary entities into computable feature signatures, combining spatial index-based candidate component entity retrieval and parallel matching mechanisms, and performing multi-dimensional verification and deduplication merging of matching results, it can automatically extract component geometric shapes, spatial topological relationships, and visual style attributes from CAD vector primitives. This enables highly efficient and accurate matching and identification of block-level components, primitive group components, and pipeline components, thereby providing reliable basic data support for applications such as engineering quantity calculation, automatic modeling, and intelligent review.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of engineering drawing information processing technology, and in particular to a CAD component identification method, apparatus, computer equipment, computer-readable storage medium, and computer program product. Background Technology

[0002] In engineering design across fields such as building installation, municipal engineering, and industrial pipeline networks, a large number of design deliverables are presented in the form of Computer-Aided Design (CAD) drawings. These drawings typically include block references, basic vector primitives (such as lines, arcs, and polylines), text annotations, and legends, carrying rich semantic information about the project. Accurate and efficient automatic identification and classification of various components within these drawings is a crucial prerequisite for downstream applications such as automatic quantity calculation, automatic generation of Building Information Modeling (BIM), rapid cost accounting, and intelligent review of design specifications.

[0003] However, current mainstream component identification methods still heavily rely on manual interpretation or semi-automatic assistance, which suffers from problems such as low efficiency, strong subjectivity, and poor consistency, making it difficult to meet the needs of large-scale, high-concurrency batch drawing processing. Summary of the Invention

[0004] Therefore, it is necessary to provide a CAD component identification method, apparatus, computer equipment, computer-readable storage medium, and computer program product that can automatically identify CAD components in order to address the above-mentioned technical problems.

[0005] In a first aspect, this application provides a method for identifying CAD components, the method comprising: The legend table area in the CAD drawing is parsed, the legend entities and their corresponding equipment categories are extracted, and the feature signatures of the legend entities are generated; the legend entities include at least one of the first block-level components, the first element group components, and the first pipeline components; the feature signatures include a first feature signature corresponding to at least one of the first block-level components, the first element group components, and the first pipeline components. The drawing area of ​​the CAD drawing is identified based on the component type of the legendary entity, and at least one set of component entities to be matched is determined. Each set of component entities includes at least one component entity of a corresponding component type, and the component type includes at least one of block-level components, element group components, and pipeline components. A spatial index is constructed based on at least one set of component entities to be matched. Neighborhood query or range query is performed in the spatial index according to the spatial characteristics of the components in the legend entities to obtain matching candidate component entities. Generate a second feature signature of the candidate component entity, and obtain the similarity between the first feature signature of the corresponding component in the legend entity and the second feature signature of the candidate component entity based on the component type; Candidate component entities whose similarity satisfies the similarity threshold are determined as the matching results of the legend entities. The matching results are then verified and deduplicated based on the constraints of the legend entities to obtain the target component recognition results based on the legend entities.

[0006] In one embodiment, generating the feature signature of the legend entity includes: if the legend entity includes a first primitive group component, performing translation, scaling, and rotation normalization on the coordinate point set of the first primitive group component to obtain geometric feature features that are insensitive to translation, scale, and direction changes, and performing feature encoding on the geometric feature features to obtain a first feature signature of the first primitive group component; if the legend entity includes a first block-level component, performing translation, scaling, and rotation normalization on the primitive group components of the first block-level component as a whole, obtaining the relative displacement vector, angular relationship, or distance ratio between the primitive group components as topological relationships, and performing feature encoding on the topological relationships to obtain a first feature signature of the first block-level component; if the legend entity includes a first pipeline component, extracting the line type, line width, color, and constant width parameters of the polyline of the first pipeline component for feature encoding to obtain a first feature signature of the first pipeline component.

[0007] In one embodiment, the normalization includes: extracting the effective coordinate point set of the primitive component and determining the geometric center point of the effective coordinate point set; performing a centering transformation on the effective coordinate point set based on the geometric center point to obtain a transformed coordinate point set; determining a scale factor based on the transformed coordinate point set; and performing scaling normalization on the transformed coordinate point set based on the scale factor to obtain the normalized coordinate point set of the primitive component.

[0008] In one embodiment, the step of identifying the drawing area of ​​the CAD drawing based on the component type of the legend entity and determining at least one set of component entities to be matched includes: determining at least one component entity corresponding to the component type from the drawing area of ​​the CAD drawing based on the component type of the component in the legend entity; and generating a set of component entities corresponding to the component type based on the at least one component entity corresponding to the component type.

[0009] In one embodiment, the spatial index employs at least one of R-tree, Kd-tree, uniform grid hash index, or quadtree index.

[0010] In one embodiment, constructing a spatial index based on at least one set of component entities to be matched includes: obtaining the geometric center coordinates of any component entity in the at least one set of component entities to be matched as an index key to construct a spatial index for spatial neighborhood query or range query; or, obtaining the bounding rectangle of any component entity in the at least one set of component entities to be matched as an index key to construct a spatial index for spatial neighborhood query or range query.

[0011] In one embodiment, the step of verifying and deduplicating the matching results based on the constraints of the legend entities to obtain the target component identification results based on the legend entities includes: verifying the geometric parameter consistency and relative positional relationship consistency of the matching results based on the constraints of the legend entities to obtain verified matching results; and deduplicating and merging the verified matching results to obtain the target component identification results based on the legend entities.

[0012] In one embodiment, the constraints of the legend entity include geometric parameter constraints; the geometric parameter consistency verification includes: obtaining the length, radius, angle, and circumscribed rectangle scale of the candidate component entity in the matching result; if the length, radius, angle, and circumscribed rectangle scale of the candidate component entity all satisfy the corresponding geometric parameter constraints of the legend entity, then the geometric parameter consistency verification of the candidate component entity is determined to be passed.

[0013] In one embodiment, the constraints of the legend entity include relative position constraints; the relative position relationship consistency verification includes: obtaining the relative displacement direction, included angle relationship, distance ratio and connection relationship of the candidate component entities in the matching result; if the relative displacement direction, included angle relationship, distance ratio and connection relationship of the candidate component entities all satisfy the corresponding relative position constraints of the legend entity, then it is determined that the relative position relationship consistency verification of the candidate component entities has passed.

[0014] In one embodiment, the step of deduplicating and merging the verified matching results to obtain the target component identification result based on the legend entity includes: calculating the geometric center coordinates of multiple verified matching results under the component type based on the component type of the legend entity; calculating the center distance between the geometric center coordinates of any two matching results based on Euclidean distance or equivalent distance metric; determining that the center distance is less than a preset distance threshold when it is a duplicate match, and retaining one of the matching results as the target component identification result according to a preset retention strategy.

[0015] Secondly, this application also provides a CAD component recognition device, the device comprising: The parsing module is used to parse the legend table area in the CAD drawing, extract the legend entities and their corresponding equipment categories, and generate feature signatures for the legend entities; the legend entities include at least one of a first block-level component, a first element group component, and a first pipeline component; the feature signatures include a first feature signature corresponding to at least one of the first block-level component, the first element group component, and the first pipeline component. The identification module is used to identify the drawing area of ​​the CAD drawing according to the component type of the legendary entity, and determine at least one set of component entities to be matched. Each set of component entities includes at least one component entity of a corresponding component type. The component type includes at least one of block-level components, element group components, and pipeline components. The query module is used to construct a spatial index based on at least one set of component entities to be matched, and to perform a neighborhood query or range query in the spatial index according to the spatial characteristics of the components in the legend entities to obtain matching candidate component entities; A similarity determination module is used to generate a second feature signature of the candidate component entity and obtain the similarity between the first feature signature of the corresponding component in the legend entity and the second feature signature of the candidate component entity based on the component type. The identification result determination module is used to determine the candidate component entities whose similarity meets the similarity threshold as the matching result of the legend entity, and to verify and deduplicate the matching result based on the constraints of the legend entity to obtain the target component identification result based on the legend entity.

[0016] Thirdly, this application also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of the method described in the first aspect.

[0017] Fourthly, this application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the method described in the first aspect.

[0018] Fifthly, this application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the method described in the first aspect above.

[0019] The aforementioned CAD component recognition method, apparatus, computer equipment, computer-readable storage medium, and computer program product extract legend entities and corresponding equipment categories by parsing the legend table area in CAD drawings and generating feature signatures for the legend entities. Based on the component type of the legend entities, the drawing area of ​​the CAD drawing is identified, determining at least one set of component entities to be matched. A spatial index is constructed based on this set. Neighborhood or range queries are performed in the spatial index based on the spatial features of the components in the legend entities to obtain matching candidate component entities. A second feature signature is generated for each candidate component entity. The similarity between the first feature signature of the corresponding component in the legend entity and the second feature signature of the candidate component entity is obtained based on the component type. Candidate component entities whose similarity meets a similarity threshold are determined as the matching results for the legend entities. The matching results are verified and deduplicated based on the constraints of the legend entities to obtain the target component recognition result based on the legend entities. By converting legendary entities into computable feature signatures, combining spatial index candidate component entity retrieval and parallel matching mechanisms, and performing multi-dimensional verification and deduplication merging of matching results, it can achieve high-efficiency and high-accuracy identification of block-level components, primitive group components, and pipeline components, thereby providing reliable basic data support for applications such as engineering quantity calculation, automatic modeling, and intelligent review. Attached Figure Description

[0020] To more clearly illustrate the technical solutions in the embodiments of this application or related technologies, the drawings used in the description of the embodiments of this application or related technologies will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.

[0021] Figure 1 This is a flowchart illustrating a CAD component identification method in one embodiment; Figure 2 This is a flowchart illustrating the steps for generating a feature signature in one embodiment; Figure 3 This is a flowchart illustrating the normalization step in one embodiment; Figure 4 This is a flowchart illustrating the verification and deduplication merging steps in one embodiment; Figure 5 This is a structural block diagram of a CAD component recognition device in one embodiment; Figure 6 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation

[0022] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0023] It should be noted that the terms "first," "second," etc., used in this application can be used to describe various elements, but these elements are not limited by these terms. These terms are only used to distinguish the first element from the second element. The terms "comprising" and "having," and any variations thereof, used in this application, are intended to cover non-exclusive inclusion. The term "multiple" used in this application refers to two or more. The term "and / or" used in this application refers to one of the embodiments, or any combination of multiple embodiments.

[0024] Current mainstream component identification methods still heavily rely on manual interpretation or semi-automatic assistance, mainly including the following three categories: The first type is rule matching methods based on metadata such as layer names, block names, or attribute tags. This method is simple to implement, but it relies heavily on the consistency of drafting standards. In actual engineering drawings, it often fails due to mixed use of layers, non-standard naming, "exploding" of blocks, or multiple ways of representing the same component, resulting in significant lack of robustness.

[0025] The second category is matching methods based on geometric feature similarity. While these methods can partially overcome the problem of non-standard naming, the number of candidate primitive combinations increases exponentially when dealing with complex drawings, leading to high computational complexity. At the same time, they are quite sensitive to geometric transformations such as translation, rotation, and scaling, as well as coordinate numerical errors, making them prone to false matches or missed detections.

[0026] The third approach involves rendering vector paper into raster images and then using computer vision or deep learning models for recognition. While this method can utilize mature image recognition technologies, the rasterization process introduces resolution limitations and quantization errors into vector information, resulting in a loss of geometric accuracy and disruption of the topological relationships and engineering semantic structures between the original primitives. Furthermore, visual styles such as line type, line width, and color, which have clear semantics in engineering, are difficult to model effectively in the image domain, leading to limitations in interpretability and generalization ability.

[0027] What makes things more complicated is that the components in engineering drawings are diverse in form: they may be represented as a single standardized block, or they may be composed of multiple heterogeneous elements (such as lines, circles, text, etc.) arranged in a specific spatial layout. Their semantics depend on relative position, connection relationship or context. Especially for pipeline entities, their functional categories are often implicitly expressed through non-geometric attributes such as line type, line width, color and constant drawing width, which are difficult to accurately determine by relying solely on geometric shape.

[0028] In summary, traditional technologies have significant limitations in terms of accuracy, robustness, scalability, and preservation of engineering semantics. They also suffer from inefficiency, high subjectivity, and poor consistency, making it difficult to meet the needs of large-scale, high-concurrency batch drawing processing.

[0029] Based on this, in an exemplary embodiment, such as Figure 1 As shown, a CAD component identification method is provided. This embodiment illustrates the application of this method to a terminal. It is understood that this method can also be applied to a server, and further to a system including both a terminal and a server, and is implemented through interaction between the terminal and the server. In this embodiment, the method may include the following steps: Step 102: Parse the legend table area in the CAD drawing, extract the legend entities and their corresponding equipment categories, and generate the feature signatures of the legend entities.

[0030] CAD drawings can be pre-drawn CAD format drawings that require CAD component identification. The legend area (or "legendary table") is a dedicated area in CAD drawings used to explain the meaning of various graphic symbols, line types, fill patterns, and blocks used in the drawing. It is an important part of the drawing and helps the reader accurately understand the design intent.

[0031] Legend tables are typically located in the blank space of a drawing, such as near the title block, in the corner of the drawing, or within a separate drawing frame. Their content and format vary depending on the discipline (e.g., architecture, structure, plumbing, HVAC, electrical, landscape, etc.). Legend tables are usually presented in tabular or block list form and typically contain the following core information: Legendary entities (such as graphic symbols / blocks): These represent specific graphics used in the drawings, such as graphics of valves, lamps, furniture, equipment, plants, etc.

[0032] Equipment category (e.g., equipment name): Clearly indicate the entity or component represented by the graphic, such as "DN150 stop valve", "double switch", "camphor tree", etc.

[0033] Legend number (optional): Some drawings will assign a number to each legend for easy reference in other parts of the drawing.

[0034] Explanatory text (optional): Supplementary explanations for special symbols or non-standard illustrations.

[0035] In this embodiment, the legend entity may include components of different categories. For example, the legend entity may include at least one of a first block-level component, a first primitive group component, and a first pipeline component. The feature signature of the legend entity is a feature representation that can be used for comparison, obtained by abstractly encoding the geometric elements of the component corresponding to the legend entity, the relative spatial relationship between primitives, and the visual style attributes of the pipeline entity.

[0036] For example, for the input CAD drawing, the legend table area is first located using a table detection algorithm (such as line segment intersection clustering). Then, the legend cells are traversed, and the graphic entities (such as block-level components, graphic element group components, pipeline components, etc.) and text entities (such as equipment categories) in each cell are extracted. The association is established according to spatial proximity, that is, the association between the legend entities and the corresponding equipment categories is established.

[0037] In one scenario, if a cell contains multiple texts, the text with the smallest Euclidean distance to the geometric center of the graphic can be used as the semantic label, or the text with the largest overlap with the graphic's projection can be used as the semantic label, or the text located to the right or below the graphic, etc., which are subject to relative positional constraints, can be used as the semantic label. If the graphic and text belong to adjacent cells, a cross-cell association is established based on the cell adjacency relationship and the text reading direction (such as reading order from left to right or from top to bottom), thereby obtaining a mapping between legend entities and equipment categories, which serves as the basis for subsequent component recognition. This embodiment establishes a mapping relationship between legend entities and equipment categories by parsing the legend table area of ​​CAD drawings, and generates a feature signature template library according to categories, transforming component recognition from empirical rule retrieval to template-based matching under legend semantic constraints, improving adaptability to different project standards, different drawing methods, and scenarios where blocks are exploded.

[0038] For example, the feature signature may include a first feature signature of at least one of the first block-level component, the first element group component, and the first pipeline component corresponding to the legend entity. Comparable feature signatures can be constructed for the legend entities associated with each equipment category, including at least one of geometric signatures, topological signatures, or visual style signatures. The feature signatures and equipment categories are then stored as a legend signature template library, and the signature template of the corresponding equipment category is called for candidate filtering and similarity determination when matching target drawings.

[0039] Step 104: Identify the drawing area of ​​the CAD drawing based on the component type of the legendary entity, and determine at least one set of component entities to be matched.

[0040] Each component entity set includes at least one component entity of a corresponding component type, and the component type includes at least one of block-level components, primitive group components, and pipeline components.

[0041] Specifically, based on the component type of the components in the legend entities associated with a certain equipment category, at least one component entity corresponding to the component type can be determined from the drawing area of ​​the CAD drawing; and a set of component entities corresponding to the component type can be generated based on the at least one component entity corresponding to the component type.

[0042] For example, component entities in CAD drawings can also be divided into block-level components, element group components, and pipeline components according to component type to obtain component entity sets of different component types. Furthermore, based on the component type of the components in the legend entities associated with the equipment category, the corresponding component entity set can be determined.

[0043] Step 106: Construct a spatial index based on at least one set of component entities to be matched, and perform a neighborhood query or range query in the spatial index according to the spatial characteristics of the components in the legend entities to obtain matching candidate component entities.

[0044] The spatial index can be any of the following: R-tree, Kd-tree, uniform grid hash index, or quadtree index, and supports K-nearest neighbor queries or range queries. Candidate component entities can be obtained by querying the spatial index with the query window being the bounding rectangle of the component in the legend entity.

[0045] For example, constructing a spatial index based on at least one set of component entities to be matched may specifically include: obtaining the geometric center coordinates of any component entity in the at least one set of component entities to be matched as the index key to construct a spatial index for spatial neighborhood query or range query; or, obtaining the bounding rectangle of any component entity in the at least one set of component entities to be matched as the index key to construct a spatial index for spatial neighborhood query or range query.

[0046] In one scenario, the geometric center coordinates of any component entity in at least one component entity set in a CAD drawing can be extracted as an index key to construct an index structure for spatial neighborhood retrieval, namely a spatial index, to support K-nearest neighbor queries or range queries.

[0047] In one scenario, the geometric center coordinates of primitives can be extracted as index keys, and the set of coordinate points can be organized into a balanced kd-tree index structure or an equivalent spatial partitioning index structure, i.e., a spatial index, to support k-nearest neighbor and range query operations on the set of coordinate points.

[0048] During the query, a k-nearest neighbor query or range query can be performed on the spatial index based on the spatial features of each template instance (such as the components in the legend entity) to obtain matching candidate component entities. The signature similarity is calculated only within the candidate component entities, thereby avoiding pairwise comparison of all primitives to improve the subsequent matching efficiency, achieving high-efficiency recognition in large-scale primitive scenarios, and avoiding the high computational overhead caused by full pairwise comparison.

[0049] The spatial features can be the bounding rectangle of a component in the legend entity or the center coordinates of a component in the legend entity. For example, the bounding rectangle of a component in the legend entity can be used as a query window to retrieve neighborhood candidates and obtain matching candidate component entities; alternatively, the center coordinates of a component in the legend entity can be used as the query point to retrieve the nearest K candidate entities as matching candidate component entities.

[0050] For example, suppose the legendary entity of the equipment category "gate valve" has a bounding rectangle of 10×10mm; if the CAD drawing contains 5000 block-level components, element group components, and pipeline components, the matching process for candidate component entities is as follows: First, take the bounding rectangle of the "gate valve" legendary entity and expand it to a query window of 15×15 mm; then perform a range query in the spatial index of the CAD drawing; if 3 block-level components and 1 element group component are returned (due to bounding box overlap), then after type filtering, the element group component can be eliminated (because "gate valve" only matches block-level components); then the remaining 3 block-level components are used as candidate component entities, and a topological signature comparison is performed with the "gate valve" legendary entity to obtain the final recognition result.

[0051] Step 108: Generate the second feature signature of the candidate component entity, and obtain the similarity between the first feature signature of the corresponding component in the legend entity and the second feature signature of the candidate component entity based on the component type.

[0052] The generation method for the second feature signature is similar to that for the first feature signature, and the generation process will be explained in detail later. In this embodiment, the similarity between the first feature signature of the corresponding component in the legend entity and the second feature signature of the candidate component entity can be obtained based on the component type.

[0053] For example, the process can be executed in parallel for different component types. For instance, for a block-level component in a legend entity under a certain device category, matching candidate component entities can be queried in the corresponding spatial index based on the above steps, and then a second feature signature of the candidate component entity can be generated. In this way, the similarity between the first feature signature of the corresponding block-level component under this type and the second feature signature of the corresponding candidate component entity can be obtained.

[0054] For a given set of graphic elements in a legend entity under a certain equipment category, matching candidate component entities can be obtained by querying the corresponding spatial index based on the steps described above. Then, a second feature signature of the candidate component entity is generated, and the similarity between the first feature signature of the corresponding graphic element set and the second feature signature of the corresponding candidate component entity can be obtained.

[0055] Similarly, for pipeline components in the legend entities under a certain equipment category, matching candidate component entities can be obtained by querying the corresponding spatial index based on the above steps, and then a second feature signature of the candidate component entity can be generated. In this way, the similarity between the first feature signature of the corresponding pipeline component under this type and the second feature signature of the corresponding candidate component entity can be obtained.

[0056] This embodiment limits similarity calculation to candidates with spatial proximity and processes the matching tasks of block-level components, primitive group components and pipeline components in parallel, thereby significantly improving processing efficiency while ensuring recognition accuracy.

[0057] Step 110: Determine candidate component entities whose similarity meets the similarity threshold as the matching results of the legend entities. Based on the constraints of the legend entities, verify and deduplicate the matching results to obtain the target component recognition results based on the legend entities.

[0058] Among them, verification and deduplication merging are used to resolve conflicts when the same area in a CAD drawing is matched by multiple component types, so as to improve the accuracy and uniqueness of the final identification result.

[0059] The similarity threshold can be a pre-configured conditional threshold used to filter matching results, and can be configured based on the actual application scenario. For example, the similarity threshold can be any value between 70% and 100%.

[0060] Specifically, after obtaining the similarity between the first feature signature of the corresponding component in the legend entity and the second feature signature of the candidate component entity based on the above steps, the matching results can be filtered according to the similarity. For example, candidate component entities whose similarity meets the similarity threshold can be used as the matching results of the legend entity. For instance, if the similarity threshold is 80%, and if the similarity between the first feature signature of the corresponding component in the legend entity and the second feature signature of a certain candidate component entity is 85%, then the candidate component entity can be determined as the matching result of the corresponding legend entity.

[0061] Furthermore, the matching results can be verified and deduplicated based on the constraints of the legendary entities to obtain the target component recognition results based on the legendary entities.

[0062] The final output of the target component identification result includes at least the device category corresponding to the component, the component entity location information (such as the bounding rectangle / center point / key point set), the associated attribute information (such as block attributes, text content, style attributes, etc.), the signature similarity or confidence level, and the verification pass status. This result can be used in various application scenarios such as engineering quantity surveying, cost accounting, automatic modeling, specification review, and engineering data assetization.

[0063] In the aforementioned CAD component recognition method, the legend table area in the CAD drawing is parsed to extract the legend entities and their corresponding equipment categories, and a feature signature of the legend entities is generated. The drawing area of ​​the CAD drawing is identified according to the component type of the legend entities to determine at least one set of component entities to be matched. A spatial index is constructed based on the at least one set of component entities to be matched. Neighborhood query or range query is performed in the spatial index according to the spatial features of the components in the legend entities to obtain matching candidate component entities. A second feature signature of the candidate component entities is generated. The similarity between the first feature signature of the corresponding component in the legend entity and the second feature signature of the candidate component entity is obtained based on the component type. Candidate component entities whose similarity meets the similarity threshold are determined as the matching result of the legend entities. The matching result is verified and deduplicated based on the constraints of the legend entities to obtain the target component recognition result based on the legend entities. By converting legendary entities into computable feature signatures, combining spatial index candidate component entity retrieval and parallel matching mechanisms, and performing multi-dimensional verification and deduplication merging of matching results, it can achieve high-efficiency and high-accuracy identification of block-level components, primitive group components, and pipeline components, thereby providing reliable basic data support for applications such as engineering quantity calculation, automatic modeling, and intelligent review.

[0064] In one exemplary embodiment, such as Figure 2 As shown, in step 102, feature signatures of legend entities are generated. Specifically, starting from the input legend set, signatures are generated in three ways according to the component type of the components in the legend entity. Finally, the feature signature of the legend entity, i.e., the legend feature identifier (Signature String / Hash), is obtained through serialization encoding and precision control. Specifically, it may include: First, based on the input legend set, the association between legend entities and equipment categories is established. Equipment categories can be generated from a pre-defined category dictionary, synonym rules, and specification field extraction rules, and can be disambiguated by combining the graphic geometry type.

[0065] Then, for different component types in the legend entity, construct the first feature signature of the corresponding type of component (e.g., Figure 2 (Three branches in the middle).

[0066] For example, for block-level components (such as...) Figure 2The left branch first performs geometric extraction, then block-level normalization, and finally constructs the corresponding topological signature. Geometric extraction includes extracting primitive types, key point coordinates, and text / text entities within the block-level component, as well as extracting block reference ATTRIBUTE key-value pairs as block attributes. Block-level normalization performs overall translation, scaling, and rotation normalization on the primitive set within the same block to ensure structural consistency. Topological signature construction uses relative displacement, relative angle, and relative distance ratio between primitives in the block-level component to form a topological code, maintaining the relative spatial structure between primitives unchanged, and outputs the geometric topological signature of the block-level component as the first feature signature of the block-level component.

[0067] For primitive components (such as) Figure 2 The middle branch first performs geometric extraction, such as extracting primitive types and key point coordinates; then it performs primitive-level normalization, such as performing translation, scaling and rotation normalization on the coordinate point set of a single primitive to obtain a stable geometric representation that is insensitive to changes in translation, scale and direction; then it performs topological signature construction, such as forming topological relationship encoding with relative displacement, relative angle and relative distance ratio, so as to output the geometric topological signature of the primitive group component as the first feature signature of the primitive group component.

[0068] For pipeline-type entities, i.e. pipeline components (such as...) Figure 2 The right-hand branch first extracts style attributes, such as pipeline type, line weight, color, line style, and constant width of polylines. Then, it performs style normalization, correcting case sensitivity, units, and outliers, and resolving the BYLAYER attribute to the actual layer attribute. This results in a style signature quadruple, such as a signature consisting of (linetype, lineweight, color, const_width) as the first feature signature of the pipeline component. For example, when the entity linetype is BYLAYER, the linetype name of the layer to which the entity belongs is read as linetype; when the entity line weight is BYLAYER or a default value, the line weight of the layer to which the entity belongs is read and converted to a numerical representation in a unified unit as lineweight; when the entity color is BYLAYER, the color index of the layer to which the entity belongs is read as color; only for LWPOLYLINE or POLYLINE is a constant width extracted as const_width, while for other entities, const_width takes the default value; string normalization, type unification, and outlier correction are performed on the above attributes to obtain the quadruple signature.

[0069] Then, the three types of signatures are serialized and encoded according to a unified field order, and the normalized values ​​are quantized or rounded with a preset precision to obtain comparable legend feature identifiers. The identifiers can be signature strings or their hash values, which are used for subsequent candidate matching and similarity determination.

[0070] Based on this, the feature signature of the legend entity includes at least the following: geometric coordinate sequence encoding, such as using a unified serialization representation for the control point sequences of lines, polylines, lightweight polylines, splines, solid fills, pattern fills, arcs, and ellipses; circle parameter encoding, including center coordinates and radius; text encoding, including text content and its insertion point coordinates and rotation angle parameters; block attribute encoding, such as using the key-value pair encoding format "tag:value" for block attributes (ATTRIBUTE), extracting the ATTDEF entity attribute tags and default values ​​from the block definition; and visual style encoding, such as using a quadruple (linetype, lineweight, color, const_width) to represent pipeline entities, where the attributes come from direct entity attributes or layer attributes parsed by the BYLAYER rule.

[0071] This embodiment employs a unified feature signature system encompassing geometry, topology, and visual style. For block-level components and primitive groups, it constructs topological signatures containing geometric elements and relative spatial relationships. For pipeline entities, it constructs visual style signatures including line type, line width, color, and constant width. These are uniformly encoded into comparable feature identifiers, achieving a comprehensive expression of geometric form, structural relationships, and engineering representation styles. This solves the problem of unstable differentiation based solely on layers / geometry. Furthermore, it does not rely on layer naming or manual rule assumptions. Instead, it abstractly encodes the geometric elements of the components corresponding to the legend entities in the engineering drawings, the relative spatial relationships between primitives, and the visual style attributes of pipeline entities. This constructs feature signature representations insensitive to translation, scaling, and rotation, ensuring that the same component maintains comparable consistency across different locations, drawing methods, or project standards.

[0072] In one exemplary embodiment, to improve the stability of geometric signature matching, this embodiment performs normalization and precision control on the geometric point set of the primitive components. For example... Figure 3 As shown, the coordinate point set of the input primitive component is used. For example, its normalization can specifically include: Step 302: Extract the effective coordinate point set of the graphic element group components and determine the geometric center point of the effective coordinate point set.

[0073] The effective coordinate point set is obtained by cleaning the original coordinate point set of the primitive component. For example, for the coordinate point set of the primitive component, empty points, NaN, and outliers are filtered out to obtain the effective coordinate point set of the primitive component.

[0074] Then, the corresponding geometric center point is calculated based on the set of valid coordinate points. For example, the geometric center point. Where n represents the number of coordinate points in the effective coordinate point set of the primitive component. This represents the set of valid coordinate points for a component of a graphical element group.

[0075] Step 304: Perform a centering transformation on the effective coordinate point set based on the geometric center point to obtain the transformed coordinate point set.

[0076] For example, the centralization transformation can be based on the formula To achieve, among which, This represents the set of coordinate points after the transformation.

[0077] Step 306: Determine the scale factor based on the transformed set of coordinate points.

[0078] Here, the scaling factor represents the distance from the origin to the point among all centered points. .

[0079] Step 308: Scale and normalize the transformed coordinate point set based on the scale factor to obtain the normalized coordinate point set of the primitive components.

[0080] Then, the transformed coordinate point set is scaled and normalized based on the scale factor to obtain the normalized coordinate point set of the primitive components. The scaling can be achieved using the formula... accomplish, This represents the scaled and normalized set of coordinate points. The scaled and normalized set of coordinate points satisfies... .

[0081] In this embodiment, the scaled and normalized coordinate point set can also be rotated to the standard direction using the PCA principal direction or the longest side direction. Then, numerical quantization / precision control is performed, such as rounding or discretizing the normalization result according to a preset quantization precision, thereby obtaining a stable and comparable numerical representation. The final normalized point set is then output for geometric coordinate sequence encoding, topological relationship calculation, and signature comparison, etc., to reduce mismatches caused by CAD coordinate errors.

[0082] In one exemplary embodiment, such as Figure 4 As shown, in step 110, the matching results are verified and deduplicated based on the constraints of the legend entities to obtain the target component recognition results based on the legend entities. Specifically, this may include: Step 402: Based on the constraints of the legendary entities, the matching results are verified for geometric parameter consistency and relative positional relationship consistency to obtain the verified matching results.

[0083] The constraints on the entities in the legend can include geometric parameter constraints and relative position constraints. Geometric parameter constraints can specifically include constraints on length, radius, angle, and the dimensions of the circumscribed rectangle. Relative position constraints can specifically include constraints on relative displacement direction, angular relationship, distance ratio, and connection relationship.

[0084] For example, the consistency verification of geometric parameters may specifically include: obtaining the length, radius, angle, and circumscribed rectangle scale of the candidate component entity in the matching results; if the length, radius, angle, and circumscribed rectangle scale of the candidate component entity all satisfy the corresponding geometric parameter constraints of the legend entity, then the consistency verification of the geometric parameters of the candidate component entity is determined to be passed.

[0085] For example, the consistency verification of relative positional relationships may specifically include: obtaining the relative displacement direction, included angle relationship, distance ratio and connection relationship of candidate component entities in the matching results; if the relative displacement direction, included angle relationship, distance ratio and connection relationship of candidate component entities all satisfy the corresponding relative position constraints of the legend entity, then it is determined that the consistency verification of the relative positional relationship of the candidate component entities has passed.

[0086] Step 404: Deduplication and merging of the verified matching results to obtain the target component recognition results based on the legend entity.

[0087] Specifically, based on the component type of the legendary entity, the geometric center coordinates of multiple verified matching results under the component type can be calculated separately, and the center distance between the geometric center coordinates of any two matching results can be calculated based on Euclidean distance or equivalent distance metric. When the center distance is less than a preset distance threshold, it is determined to be a duplicate match, and one of the matching results is retained as the target component identification result according to a preset retention strategy. The preset retention strategy may include: retaining the one with the highest signature similarity, retaining the one with the most verified items, or retaining the one with the smallest geometric parameter error.

[0088] In one scenario, signature frequency consistency verification can also be performed based on the set of components corresponding to the legend entity and the set of component entities in the matching result. For example, signature counts can be performed on the set of components corresponding to the legend entity and the set of component entities in the matching result to obtain a signature-frequency mapping; the matching result is determined to be a valid match if and only if the two sets of mappings are consistent in both signature value and corresponding frequency, thus avoiding incomplete matches caused by missing or redundant elements. The signature count can be implemented using frequency statistics based on hash keys or an equivalent multiset counting method.

[0089] For example, a legendary entity of the equipment category "water pump" contains {circle ×1, rectangle ×1, arrow ×2, text ×1}. If the matching result is only {circle ×1, rectangle ×1, arrow ×1}, it will be eliminated because the arrow frequency does not match, thereby improving the accuracy of recognition.

[0090] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages in other steps. It is understood that the steps in different embodiments can be freely combined as needed, and all non-contradictory solutions formed by such combinations are within the scope of protection of this application.

[0091] Based on the same inventive concept, this application also provides a CAD component identification device for implementing the CAD component identification method described above. The solution provided by this device is similar to the solution described in the above method; therefore, the specific limitations in one or more CAD component identification device embodiments provided below can be found in the limitations of the CAD component identification method described above, and will not be repeated here.

[0092] In one exemplary embodiment, such as Figure 5 As shown, a CAD component recognition device is provided, including: a parsing module 502, a recognition module 504, a query module 506, a similarity determination module 508, and a recognition result determination module 510, wherein: The parsing module 502 is used to parse the legend table area in the CAD drawing, extract the legend entities and their corresponding equipment categories, and generate feature signatures for the legend entities; the legend entities include at least one of a first block-level component, a first element group component, and a first pipeline component; the feature signatures include a first feature signature corresponding to at least one of the first block-level component, the first element group component, and the first pipeline component. The identification module 504 is used to identify the drawing area of ​​the CAD drawing according to the component type of the legendary entity, and determine at least one set of component entities to be matched. Each set of component entities includes at least one component entity of a corresponding component type. The component type includes at least one of block-level components, element group components and pipeline components. The query module 506 is used to construct a spatial index based on at least one set of component entities to be matched, and to perform a neighborhood query or range query in the spatial index according to the spatial characteristics of the components in the legend entities to obtain matching candidate component entities. The similarity determination module 508 is used to generate a second feature signature of the candidate component entity and obtain the similarity between the first feature signature of the corresponding component in the legend entity and the second feature signature of the candidate component entity based on the component type. The identification result determination module 510 is used to determine the candidate component entities whose similarity meets the similarity threshold as the matching result of the legend entity, and to verify and deduplicate the matching result based on the constraints of the legend entity to obtain the target component identification result based on the legend entity.

[0093] In an exemplary embodiment, generating the feature signature of the legend entity includes: if the legend entity includes a first primitive group component, performing translation, scaling, and rotation normalization on the coordinate point set of the first primitive group component to obtain geometric feature features that are insensitive to translation, scale, and direction changes, and performing feature encoding on the geometric feature features to obtain a first feature signature of the first primitive group component; if the legend entity includes a first block-level component, performing translation, scaling, and rotation normalization on the primitive group component of the first block-level component as a whole, obtaining the relative displacement vector, angular relationship, or distance ratio between the primitive group components as topological relationships, and performing feature encoding on the topological relationships to obtain a first feature signature of the first block-level component; if the legend entity includes a first pipeline component, extracting the line type, line width, color, and constant width parameters of the polyline of the first pipeline component for feature encoding to obtain a first feature signature of the first pipeline component.

[0094] In an exemplary embodiment, the normalization includes: extracting the effective coordinate point set of the primitive component and determining the geometric center point of the effective coordinate point set; performing a centering transformation on the effective coordinate point set based on the geometric center point to obtain a transformed coordinate point set; determining a scale factor based on the transformed coordinate point set; and performing scaling normalization on the transformed coordinate point set based on the scale factor to obtain the normalized coordinate point set of the primitive component.

[0095] In an exemplary embodiment, the step of identifying the drawing area of ​​the CAD drawing based on the component type of the legend entity and determining at least one set of component entities to be matched includes: determining at least one component entity corresponding to the component type from the drawing area of ​​the CAD drawing based on the component type of the component in the legend entity; and generating a set of component entities corresponding to the component type based on the at least one component entity corresponding to the component type.

[0096] In one exemplary embodiment, the spatial index employs at least one of R-tree, Kd-tree, uniform grid hash index, or quadtree index.

[0097] In an exemplary embodiment, constructing a spatial index based on at least one set of component entities to be matched includes: obtaining the geometric center coordinates of any component entity in the at least one set of component entities to be matched as an index key to construct a spatial index for spatial neighborhood query or range query; or, obtaining the bounding rectangle of any component entity in the at least one set of component entities to be matched as an index key to construct a spatial index for spatial neighborhood query or range query.

[0098] In an exemplary embodiment, the step of verifying and deduplicating the matching results based on the constraints of the legend entities to obtain the target component identification results based on the legend entities includes: verifying the geometric parameter consistency and relative positional relationship consistency of the matching results based on the constraints of the legend entities to obtain verified matching results; and deduplicating and merging the verified matching results to obtain the target component identification results based on the legend entities.

[0099] In an exemplary embodiment, the constraints of the legend entity include geometric parameter constraints; the geometric parameter consistency verification includes: obtaining the length, radius, angle, and circumscribed rectangle scale of the candidate component entity in the matching result; if the length, radius, angle, and circumscribed rectangle scale of the candidate component entity all satisfy the corresponding geometric parameter constraints of the legend entity, then it is determined that the geometric parameter consistency verification of the candidate component entity has passed.

[0100] In an exemplary embodiment, the constraints of the legend entity include relative position constraints; the relative position relationship consistency verification includes: obtaining the relative displacement direction, included angle relationship, distance ratio and connection relationship of the candidate component entities in the matching result; if the relative displacement direction, included angle relationship, distance ratio and connection relationship of the candidate component entities all satisfy the corresponding relative position constraints of the legend entity, then it is determined that the relative position relationship consistency verification of the candidate component entities has passed.

[0101] In an exemplary embodiment, the step of deduplicating and merging the verified matching results to obtain the target component identification result based on the legend entity includes: calculating the geometric center coordinates of multiple verified matching results under the component type based on the component type of the legend entity; calculating the center distance between the geometric center coordinates of any two matching results based on Euclidean distance or equivalent distance metric; determining that the center distance is less than a preset distance threshold when it is a duplicate match, and retaining one of the matching results as the target component identification result according to a preset retention strategy.

[0102] Each module in the aforementioned CAD component recognition device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in the processor of a computer device in hardware form or independent of it, or stored in the memory of a computer device in software form, so that the processor can call and execute the operations corresponding to each module.

[0103] In one exemplary embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as follows: Figure 6 As shown, the computer device includes a processor, memory, input / output interfaces, a communication interface, a display unit, and an input device. The processor, memory, and input / output interfaces are connected via a system bus, and the communication interface, display unit, and input device are also connected to the system bus via the input / output interfaces. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The input / output interfaces are used for exchanging information between the processor and external devices. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, mobile cellular networks, Near Field Communication (NFC), or other technologies. When executed by the processor, the computer program implements a CAD component recognition method. The display unit is used to form a visually visible image and can be a display screen, a projection device, or a virtual reality imaging device. The display screen can be an LCD screen or an e-ink screen. The input device of the computer device can be a touch layer covering the display screen, or buttons, trackballs, or touchpads set on the casing of the computer device, or external keyboards, touchpads, or mice, etc.

[0104] Those skilled in the art will understand that Figure 6The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0105] In one exemplary embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above-described method embodiments.

[0106] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the steps in the above method embodiments.

[0107] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above method embodiments.

[0108] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data must comply with relevant regulations.

[0109] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, artificial intelligence (AI) processors, etc., and are not limited to these.

[0110] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.

[0111] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.

Claims

1. A method for identifying CAD components, characterized in that, The method includes: The legend table area in the CAD drawing is parsed, the legend entities and their corresponding equipment categories are extracted, and the feature signatures of the legend entities are generated; the legend entities include at least one of the first block-level components, the first element group components, and the first pipeline components; the feature signatures include a first feature signature corresponding to at least one of the first block-level components, the first element group components, and the first pipeline components. The drawing area of ​​the CAD drawing is identified based on the component type of the legendary entity, and at least one set of component entities to be matched is determined. Each set of component entities includes at least one component entity of a corresponding component type, and the component type includes at least one of block-level components, element group components, and pipeline components. A spatial index is constructed based on at least one set of component entities to be matched. Neighborhood query or range query is performed in the spatial index according to the spatial characteristics of the components in the legend entities to obtain matching candidate component entities. Generate a second feature signature of the candidate component entity, and obtain the similarity between the first feature signature of the corresponding component in the legend entity and the second feature signature of the candidate component entity based on the component type; Candidate component entities whose similarity satisfies the similarity threshold are determined as the matching results of the legend entities. The matching results are then verified and deduplicated based on the constraints of the legend entities to obtain the target component recognition results based on the legend entities.

2. The method according to claim 1, characterized in that, The generation of the feature signature of the legend entity includes: If the legend entity includes a first primitive group component, the coordinate point set of the first primitive group component is normalized by translation, scaling and rotation to obtain geometric feature features that are insensitive to translation, scale and direction changes, and the geometric feature features are feature encoded to obtain the first feature signature of the first primitive group component. If the legend entity includes a first block-level component, the primitive group component of the first block-level component is treated as a whole and translated, scaled and rotated and normalized. The relative displacement vector, angular relationship or distance ratio between the primitive group components is obtained as the topological relationship. The topological relationship is feature-encoded to obtain the first feature signature of the first block-level component. If the legendary entity includes a first pipeline component, extract the line type, line width, color, and constant width parameters of the polyline of the first pipeline component for feature encoding to obtain the first feature signature of the first pipeline component.

3. The method according to claim 2, characterized in that, The normalization includes: Extract the effective coordinate point set of the primitive components and determine the geometric center point of the effective coordinate point set; Based on the geometric center point, the effective coordinate point set is centered to obtain the transformed coordinate point set. Determine the scaling factor based on the transformed set of coordinate points; The transformed coordinate point set is scaled and normalized based on the scale factor to obtain the normalized coordinate point set of the primitive component.

4. The method according to claim 1, characterized in that, The step of identifying the drawing area of ​​the CAD drawing based on the component type of the legendary entity, and determining at least one set of component entities to be matched, includes: Based on the component type of the component in the legend entity, at least one component entity corresponding to the component type is determined from the drawing area of ​​the CAD drawing; Generate a set of component entities corresponding to the component type based on at least one component entity corresponding to the component type.

5. The method according to claim 1, characterized in that, The spatial index uses at least one of R-tree, Kd-tree, uniform grid hash index, or quadtree index.

6. The method according to any one of claims 1 to 5, characterized in that, The construction of the spatial index based on at least one set of component entities to be matched includes: Obtain the geometric center coordinates of any component entity in at least one set of component entities to be matched as the index key, and construct a spatial index for spatial neighborhood queries or range queries; or, Obtain the bounding rectangle of any component entity in at least one component entity set to be matched as the index key, and construct a spatial index for spatial neighborhood query or range query.

7. The method according to any one of claims 1 to 5, characterized in that, The process of verifying and deduplicating the matching results based on the constraints of the legend entities to obtain the target component recognition result based on the legend entities includes: Based on the constraints of the legendary entities, the matching results are verified for geometric parameter consistency and relative positional relationship consistency to obtain a matching result that passes the verification. The verified matching results are deduplicated and merged to obtain the target component recognition result based on the legendary entity.

8. The method according to claim 7, characterized in that, The constraints on the legendary entities include geometric parameter constraints; the geometric parameter consistency verification includes: Obtain the length, radius, angle, and circumscribed rectangle dimensions of the candidate component entities in the matching results; If the length, radius, angle, and circumscribed rectangle dimensions of the candidate component entity all satisfy the corresponding geometric parameter constraints of the legend entity, then the geometric parameter consistency verification of the candidate component entity is deemed successful.

9. The method according to claim 7, characterized in that, The constraints on the legendary entities include relative position constraints; the consistency verification of the relative positional relationships includes: Obtain the relative displacement direction, included angle relationship, distance ratio, and connection relationship of the candidate component entities in the matching results; If the relative displacement direction, included angle relationship, distance ratio, and connection relationship of the candidate component entity all satisfy the corresponding relative position constraints of the legend entity, then the consistency verification of the relative position relationship of the candidate component entity is determined to be successful.

10. The method according to claim 7, characterized in that, The process of deduplicating and merging the verified matching results to obtain the target component recognition result based on the legend entity includes: Based on the component type of the legendary entity, calculate the geometric center coordinates for each of the multiple verified matching results under the component type; The center distance between the geometric center coordinates of any two matching results is calculated based on Euclidean distance or equivalent distance metric. When the center distance is less than a preset distance threshold, it is determined to be a duplicate match, and one of the matching results is retained as the target component identification result according to the preset retention strategy.

11. A CAD component recognition device, characterized in that, The device includes: The parsing module is used to parse the legend table area in the CAD drawing, extract the legend entities and their corresponding equipment categories, and generate feature signatures for the legend entities; the legend entities include at least one of a first block-level component, a first element group component, and a first pipeline component; the feature signatures include a first feature signature corresponding to at least one of the first block-level component, the first element group component, and the first pipeline component. The identification module is used to identify the drawing area of ​​the CAD drawing according to the component type of the legendary entity, and determine at least one set of component entities to be matched. Each set of component entities includes at least one component entity of a corresponding component type. The component type includes at least one of block-level components, element group components, and pipeline components. The query module is used to construct a spatial index based on at least one set of component entities to be matched, and to perform a neighborhood query or range query in the spatial index according to the spatial characteristics of the components in the legend entities to obtain matching candidate component entities; A similarity determination module is used to generate a second feature signature of the candidate component entity and obtain the similarity between the first feature signature of the corresponding component in the legend entity and the second feature signature of the candidate component entity based on the component type. The identification result determination module is used to determine the candidate component entities whose similarity meets the similarity threshold as the matching result of the legend entity, and to verify and deduplicate the matching result based on the constraints of the legend entity to obtain the target component identification result based on the legend entity.

12. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 10.

13. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 10.

14. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 10.