Component recommendation method, system and device for CAD drawing
By modeling the CAD component import process as sequence recommendations, and using text features and knowledge graphs to enhance component characterization, the problem of lack of global timing dependence and text attribute utilization in existing methods is solved, and the accuracy and robustness of component recommendations are improved.
Patent Information
- Application Number
- CN202510494048.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-19
- Publication Date
- 2025-07-18
AI Technical Summary
The existing CAD component recommendation methods lack global timing dependency modeling during dynamic design, fail to effectively utilize component text attributes, and find it difficult to capture functional compatibility and physical constraints between components, resulting in disconnection from the design intention and increasing the difficulty of generalization.
Model the component import process as a sequence recommendation problem, use the text feature extractor to encode component properties, build a knowledge graph, align multi-dimensional information through comparative learning and orthogonal decomposition technology, and use the self-attention mechanism to fusion features to generate component representations that enhance auxiliary information.
Accurately capture the timing logic added by components, improve the accuracy and logical consistency of component recommendations, enhance the understanding of component functions and compatibility, and improve the recommendation robustness in complex engineering scenarios.
Smart Images

Figure CN120337333A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the technical field of CAD drawing and recommendation systems, and particularly relates to a component recommendation method, system, and device for CAD drawing. Background Art
[0002] Although the existing modeling methods for graph generation tasks based on graph neural networks have achieved good recommendation effects for CAD component recommendation, there are still three deficiencies. First, the graph generation model relies on predefined graph expansion rules or local neighborhood information, which is essentially an incremental construction of a static structure, while the actual design process has significant temporal and dynamic characteristics. Second, the existing methods do not make full use of the text attributes of components. Third, the implicit functional compatibility rules (such as the matching of motor power and belt load) and physical constraints (such as differences in material thermal expansion coefficients) between components are difficult to fully capture by a data-driven graph structure. Only learning the surface co-occurrence pattern may lead to an assembly scheme where "the structure is connected but the functions conflict" (such as misrecommending civilian components to a high-voltage system), and cross-vendor data differences (such as naming rules and parameter granularity) further exacerbate the model generalization difficulty.
[0003] Therefore, there is an urgent need for a component recommendation method for CAD drawing that is efficient and highly compatible. Summary of the Invention
[0004] The present disclosure provides a component recommendation method, system, and device for CAD drawing. The import process of each component in the CAD drawing process is modeled as a sequential recommendation problem to capture the global temporal dependencies of each component in the component assembly process and the dynamic design logic of the designer. A text feature extractor is used to encode the text description of the CAD component, and attribute information such as the name, material, and specification of the CAD component is introduced to enhance the model's fine-grained understanding of the component function. A CAD component knowledge graph is constructed to describe the association relationships between CAD components, and knowledge graph embedding technology is used to extract component association knowledge to enhance the model's understanding of the implicit functional compatibility rules and physical constraints between components. A loss function based on contrastive learning is used to align the representation spaces of multi-dimensional information such as the ID embedding, text attributes, and component association knowledge of the CAD component. Orthogonal decomposition technology is used to extract isomorphic features from the aligned multi-dimensional component information. The self-attention mechanism is used to fuse the multi-dimensional isomorphic features to generate a component representation enhanced with auxiliary information, at least solving the technical problems of difficult model generalization and insufficient utilization of text attributes in the existing methods.
[0005] According to the first aspect of the present disclosure, there is provided a component recommendation method for CAD drawing, the method comprising: Obtain CAD component attribute information, and use a text feature extractor to encode the text description of the CAD component; Construct a CAD component knowledge graph based on the association relationships between CAD components, and use a knowledge graph embedding method to extract the component association knowledge representations in the knowledge graph; Construct a contrastive learning loss function, and align the ID embedding of the CAD component with the text description and the association knowledge representation to obtain aligned multi-dimensional component information; Use the orthogonal decomposition method to extract isomorphic features from the aligned multi-dimensional component information, and use the self-attention mechanism for fusion to generate a component representation enhanced by auxiliary information; Integrate the component representations of the component assembly context information, and predict the next CAD component required for the drawing design through a sequence recommendation process.
[0006] In the aspects and any possible implementation manners as described above, a further implementation manner is provided. The encoding of the text description of the CAD component by using the text feature extractor is: ; wherein, represents the text description of the attribute information about CAD component i, represents the pre-trained language model BERT, represents the text attribute representation of CAD component i.
[0007] In the aspects and any possible implementation manners as described above, a further implementation manner is provided. The process of constructing a CAD component knowledge graph based on the association relationships between CAD components and using a knowledge graph embedding method to extract the component association knowledge representations in the knowledge graph is: Collect the original information of CAD components from multi-source datasets and perform data processing to obtain preprocessed multi-source data; Identify entities and relationships from the preprocessed multi-source data, and based on the entities and relationships, represent the association relationships between CAD components and components as a graph structure based on triples to construct a knowledge graph; Based on the knowledge graph, use a knowledge graph embedding method to obtain the embedding of each node component in the knowledge graph as the association knowledge representation of the CAD component.
[0008] In the aspects and any possible implementation manners as described above, a further implementation manner is provided. The process of collecting the original information of CAD components from multi-source datasets and performing data processing to obtain preprocessed multi-source data is: Collect the original information of geometric data, assembly relationships, material properties, and functional descriptions of CAD components from CAD model libraries, BOM tables, technical documents, and user annotation information data; Clean the data of the original information, remove duplicate, missing or noisy content, convert material and specification attributes into domain standard terms through standardized mapping, and convert unstructured text into structured fields.
[0009] For the aspects and any possible implementation manners described above, a further implementation manner is provided. The process of constructing the contrast learning loss function and aligning the ID embedding of the CAD component with the text description and the associated knowledge representation is as follows: ; ; ; Among them, represents the ID embedding of CAD component i, represents the cosine similarity between the ID embedding of CAD component i and the text attribute representation of CAD component j, represents the cosine similarity between the ID embedding of CAD component i and the associated knowledge representation of CAD component j, represents the sequence of assembled CAD components represents the number of components included in represents the number of samples, is the contrast loss for constraining the alignment of the text attribute representation space and the ID embedding space, is the contrast loss for constraining the alignment of the associated knowledge representation space and the ID embedding space, is the text attribute representation of CAD component j, is the associated knowledge representation of CAD component j, is the cosine similarity between the ID embedding of CAD component i and the text attribute representation of CAD component i, is the cosine similarity between the ID embedding of CAD component i and the associated knowledge representation of CAD component i.
[0010] For the aspects and any possible implementation manners described above, a further implementation manner is provided. The process of extracting isomorphic features from the aligned multi-dimensional component information by using the orthogonal decomposition method is as follows: Represent the ID embedding, text description, and associated knowledge representation of the sequence of assembled CAD components in matrix form to obtain an ID embedding matrix, a text description matrix, and an associated knowledge matrix; Perform QR decomposition on the ID embedding matrix to generate the functional relationship between the ID embedding matrix and the orthogonal matrix and the upper triangular matrix; Map the ID embedding matrix to the orthogonal matrix respectively with the text description matrix and the associated knowledge matrix to obtain an ID embedding coordinate matrix, a text description coordinate matrix, and the associated knowledge coordinate matrix; Obtain the isomorphic part of the text description with the ID embedding by using the ID embedding coordinate matrix and the text description coordinate matrix, and obtain the isomorphic part of the associated knowledge with the ID embedding by using the ID embedding coordinate matrix and the associated knowledge coordinate matrix, and construct the isomorphic feature.
[0011] For the aspects and any possible implementation manners as described above, a further implementation manner is provided. The process of using the self-attention mechanism for fusion to generate the component representation enhanced with auxiliary information is as follows: ; ; ; ; where is the fusion feature output by the component information fusion layer of the th layer, , is the position embedding matrix of the th layer, , , , , , are all learnable weight matrices, and are the correlation matrices of the fusion feature and the position embedding matrix of the th layer respectively, is the dimension size, and the output of the component information fusion layer of the Lth layer is the component representation matrix enhanced with auxiliary information, is the output of the component information fusion layer of the th layer.
[0012] For the aspects and any possible implementation manners as described above, a further implementation manner is provided. The process of integrating the component representation of the component assembly context information and predicting the next CAD component required for the drawing design through the sequence recommendation process is as follows: Aggregate the component representations enhanced with auxiliary information of each component in the assembled CAD component sequence to obtain the component assembly context information, calculate the demand probability score of each candidate CAD component according to the context information, and generate a Top-K component recommendation list in descending order of scores: ; where is the vth candidate CAD component, is the demand probability score of the vth candidate CAD component.
[0013] According to a second aspect of the present disclosure, there is provided a component recommendation system for CAD drawing, which is used to implement the component recommendation method for CAD drawing as described in the first aspect, including: a text extraction module, an associated knowledge representation construction module, an alignment module, a component representation construction module, and a recommendation module; The text extraction module is used to obtain CAD component attribute information and encode the text description of CAD components by using a text feature extractor; The associated knowledge representation construction module is used to construct a CAD component knowledge graph based on the association relationship between CAD components, and extract the component association knowledge representation in the knowledge graph by using a knowledge graph embedding method; The alignment module is used to construct a contrastive learning loss function, and align the ID embedding of CAD components with the text description and the associated knowledge representation to obtain aligned multi-dimensional component information; The component representation construction module is used to extract isomorphic features from the aligned multi-dimensional component information by using an orthogonal decomposition method, and perform fusion by using a self-attention mechanism to generate a component representation enhanced with auxiliary information; The recommendation module is used to integrate the component representation of the component assembly context information, and predict the next CAD component required for the drawing design through a sequential recommendation process.
[0014] According to a third aspect of the present disclosure, there is provided a component recommendation device for CAD drawing, the device includes: a processor and a memory, and program instructions are stored in the memory, and the processor calls the program instructions stored in the memory to enable the device to execute the method described in the first aspect of the present disclosure.
[0015] Compared with the prior art, the present invention has the following technical effects: (1) The present invention models the import process of each component in the CAD drawing process as a sequential recommendation problem, which can accurately capture the timing logic of component addition and adapt to the evolution of the designer's intention, ensure the coherence of the design process, and improve the accuracy and logical self-consistency of component recommendation; (2) The present invention encodes the text description of CAD components by using a text feature extractor, introduces attribute information such as the name, material, and specification of CAD components, enhances the fine-grained understanding of the component function by the model, and improves the accuracy of recommendation; (3) The present invention constructs a CAD component knowledge graph to describe the association relationship between CAD components, and uses knowledge graph embedding technology to extract component association knowledge, which improves the model's understanding of the implicit functional compatibility rules and physical constraints between components; (4) The present invention aligns the representation spaces of multi-dimensional information such as the ID embeddings, text attributes, and component association knowledge of CAD components using contrastive loss, and extracts isomorphic features from the aligned multi-dimensional component information using orthogonal decomposition technology to enhance component representation. This can effectively suppress the interference of redundant information, enhance cross-modal feature consistency, thereby accurately recommend and adapt components, and improve the recommendation robustness in complex engineering scenarios.
[0016] It should be understood that the content described in the summary of the invention is not intended to limit the key or important features of the embodiments of the present disclosure, nor is it used to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] With reference to the accompanying drawings and the following detailed description, the above and other features, advantages, and aspects of the embodiments of the present disclosure will become more apparent. The drawings are used to better understand the solution and do not constitute a limitation to the present disclosure. In the drawings, the same or similar reference numerals represent the same or similar elements, where: Figure 1 FIG. shows a schematic flowchart of a component recommendation method for CAD drawing according to an embodiment of the present disclosure; Figure 2 FIG. shows a schematic structural diagram of a component recommendation system for CAD drawing according to an embodiment of the present disclosure. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0018] To make the objectives, technical solutions, and advantages of the embodiments of the present disclosure clearer, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present disclosure. Apparently, the described embodiments are some, but not all, of the embodiments of the present disclosure. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments of the present disclosure without creative efforts shall fall within the protection scope of the present disclosure.
[0019] Computer-Aided Design (CAD), as the core technology of modern industrial design, has penetrated all fields from daily consumer goods to heavy machinery by driving product design and optimization with digital tools. Its core task is assembly modeling, that is, constructing new products by combining standardized components. Assembly modeling usually can be divided into two stages: component import, that is, selecting the required parts from the component library and loading them into the CAD software; component assembly, that is, combining the parts into a complete product according to geometric constraints and functional requirements. Current research mostly focuses on intelligent component assembly. For example, the geometric matching prediction method based on neural network assists designers in completing physical assembly tasks by analyzing the geometric compatibility between components. However, the efficiency bottleneck in the component import stage has been overlooked for a long time. In actual design, designers need to manually retrieve and insert target components one by one from a catalog containing thousands of components. This process is very inefficient. Some research shows that designers spend about one-third of their time on assembly tasks, and a large amount of energy is occupied by inefficient component selection. Especially for complex products such as aerospace equipment, the frequency of component selection and the difficulty of decision-making increase sharply, further leading to an extended design cycle, rising costs, and resource waste.
[0020] Therefore, the component recommendation task has become a research direction that has gradually received attention. It aims to actively predict and recommend the next potentially required component to designers by analyzing the design context (e.g., assembled components, functional requirements). This task replaces manual retrieval through a recommendation system, significantly reducing the design time. It can provide efficient decision support for complex engineering and improve the automation level of CAD tools. Li et al. proposed a collaborative filtering-based framework to predict the next possible commands to be invoked in CAD software by mining the latent patterns in the user's historical operation sequences. However, their research focused on design process optimization and did not involve the selection and recommendation of physical components. Assembly retrieval uses information retrieval-based techniques to provide query components for similar component designs. Quan et al. used graph neural networks to model CAD components so that other similar components can be retrieved given a CAD component. However, these works focused on similar component retrieval rather than helping the entire product design process. In addition, some generative methods either generate typical geometric operation sequences of CAD to design components or generate the complete 3D shape of components from randomly placed components in a 3D mesh. MultiCAD uses multi-modal contrast learning to enhance 3D component representation. There are also some research works that focus on predicting whether different components geometrically match to assemble imported components rather than exploring how to import the required components. Gajek et al. first formulated the component recommendation task as a graph generation task, used graph neural networks to model the assembly structure, and proposed a fixed architecture model based on graph convolutional networks and graph attention networks. Liang et al. proposed an adaptive framework CusGNN based on neural architecture search to automatically customize data-specific graph neural network recommendation models for CAD component recommendations of different manufacturers to address the performance bottleneck of fixed graph neural network architectures under cross-vendor data distribution differences.
[0021] Although the existing graph generation task modeling method based on graph neural network has achieved good recommendation results for CAD component recommendation, there are still three defects. First, the graph generation model relies on predefined graph extension rules or local neighborhood information, which is essentially an incremental construction of static structures, while the actual design process has significant temporal dynamic characteristics. For example, designers often follow the progressive logic of "functional module division, interface positioning, and detail filling", or dynamically adjust the order of components according to design goals (such as building the main structure first and then adding connectors). Due to the lack of modeling of global temporal dependencies, the existing methods may cause the recommendation logic to be out of touch with the design intent, destroying the rationality of the design process. Second, the existing methods do not make sufficient use of component text attributes. CAD components usually contain text attribute information such as name, material, and specification, which implies functional semantics (such as "deep groove ball bearing" has a rotation support function) and physical constraints (such as "stainless steel" limits corrosion resistance). However, existing methods mostly rely on component IDs or low-dimensional encodings, and fail to integrate text semantics, resulting in the model being unable to distinguish between components with "similar names but different functions" (such as M6 and M8 bolts) or "different specifications but interchangeable" (such as hydraulic cylinders and pneumatic cylinders), which may lead to recommendation conflicts. Third, the implicit functional compatibility rules between components (such as motor power and belt load matching) and physical constraints (such as differences in material thermal expansion coefficients) are difficult to fully capture through data-driven graph structures. Learning only surface co-occurrence patterns may lead to assembly schemes with "structural connectivity but functional conflicts" (such as misrecommending civilian components to high-voltage systems), and cross-manufacturer data differences (such as naming rules and parameter granularity) further exacerbate the difficulty of model generalization.
[0022] Therefore, in view of the above analysis, the component recommendation task urgently needs to capture the dynamic design logic through sequence modeling, explicitly learn the transition probability and long-distance dependency between CAD components in the design process, and better fit the designer's incremental design decision-making process. In addition, the semantic perception ability of attribute information of the recommendation model is enhanced, and text attributes such as component name and material are introduced to improve the model's fine-grained understanding of component functions. At the same time, a CAD component knowledge graph is constructed to define association rules such as functional compatibility and physical constraints between components in the form of triples. The knowledge graph embedding technology is used to learn component relationship constraints, and domain knowledge is explicitly injected to avoid recommendation results that violate physical laws, while providing a traceable explanation path for recommendation decisions.
[0023] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.
[0024] Example 1 In the embodiment of the present invention, the task of recommending CAD components to designers during the CAD drawing process is modeled as a sequential recommendation process. Denote the historical assembly CAD component sequence imported by the designer in chronological order during the design process, where \(i\) represents the \(i\)-th CAD component in the historical assembly component sequence. Denote the length of the historical assembly component sequence, i.e., the number of components included. Denote the ID embedding of CAD component \(i\). Given the assembly history , the goal of component recommendation is to predict the next CAD component that the designer may use. It can be formulated as modeling the probability that all candidate CAD components are recommended , where is the \(v\)-th candidate CAD component.
[0025] An embodiment of the present invention provides a component recommendation method for CAD drawing. Refer to Figure 1 as shown, the method includes the following steps: S101: Encode the text description of the CAD component using a text feature extractor, introducing attribute information such as the name, material, and specification of the CAD component; Among them, the text feature extractor is implemented by the pre-trained language model BERT.
[0026] S102: Construct a CAD component knowledge graph to describe the association relationships between CAD components, and use knowledge graph embedding technology to extract component association knowledge; Among them, the CAD component knowledge graph is a graph structure composed of all CAD components and the association relationships between CAD components. The CAD components are represented as nodes in the graph, and the association relationships between CAD components are represented as edges in the graph. The knowledge graph embedding technology is implemented by the ConvKB algorithm.
[0027] S103: Use a contrastive learning-based loss function to align the representation spaces of multi-dimensional information such as the ID embedding, text attributes, and component association knowledge of CAD components; Among them, the ID embedding of the CAD component is a low-dimensional continuous vector mapped from the unique identifier (ID) of the CAD component, the text attributes are the attribute information represented in text modality such as the name, material, and specification of the CAD component, and the component association knowledge is the information describing the association between CAD components extracted from the CAD component knowledge graph.
[0028] S104: Use orthogonal decomposition technology to extract isomorphic features from the aligned multi-dimensional component information; S105: Use the self-attention mechanism to fuse the multi-dimensional isomorphic features to generate a component representation enhanced with auxiliary information.
[0029] Among them, this step aggregates the ID embeddings of CAD components, the isomorphic text attribute representations, and the associated knowledge representations, and fuses the component information in the aggregated representation through multiple layers of component information fusion layers based on the self-attention mechanism to generate component representations enhanced with auxiliary information.
[0030] S106: Integrate the component assembly context information, and predict the next CAD component required for the drawing design through a sequence recommendation process.
[0031] Among them, this step integrates the auxiliary information-enhanced representations of each component in the assembled CAD component sequence to obtain the component assembly context information, calculates the demand probability scores of each candidate CAD component according to the context information, and generates a Top-K component recommendation list in descending order of scores.
[0032] In summary, in the embodiment of the present invention, the import process of each component in the CAD drawing drawing process is modeled as a sequence recommendation problem through the above steps S101-106, which can effectively capture the timing logic of component assembly and the progressive design intention of the designer; when representing CAD components, a text feature extractor is used to encode the text descriptions of CAD components, and attribute information such as the name, material, and specifications of CAD components is introduced, enhancing the model's fine-grained understanding of component functions; a CAD component knowledge graph is constructed, the associated knowledge between CAD components is extracted and utilized, improving the model's understanding of the implicit functional compatibility rules and physical constraints between components; the contrast loss is used to align the multi-dimensional information representation space of components, and the orthogonal decomposition technology is used to extract isomorphic features to enhance component representations, effectively suppressing the interference of redundant information, enhancing the cross-modal feature consistency, and promoting the accurate representation of component assembly context information and the accurate recommendation of the next component.
[0033] Embodiment 2 The solution in Embodiment 1 will be further introduced below in combination with specific calculation formulas and examples. See the following description for details: Step 201: Use a text feature extractor to encode the text descriptions of CAD components, and introduce attribute information such as the name, material, and specifications of CAD components.
[0034] When making component recommendations, relying solely on the ID embedding information of components may not be sufficient to fully capture the semantic features and functional attributes of components, thus limiting the accuracy and practicality of the recommendation system. In the embodiments of the present invention, it is intended to introduce text attribute information such as the name, material, and specifications of CAD components to enhance the richness of component representation and semantic understanding ability. The component name can directly reflect the use and category of the component, the component material information can reveal its physical properties and applicable scenarios, and the component specifications provide key size and performance parameters. These text attribute information together constitute a comprehensive description of the component. By introducing this information, the recommendation system can better understand the information of the already assembled components and the designer's requirements, and thus generate appropriate recommendation results. Specifically, the embodiments of the present invention adopt the pre-trained language model BERT as a text feature extractor , encoding the text attribute information of CAD components: (1) Among them, represents the text description of the attribute information such as the name, material, and specifications of CAD component i, represents the text attribute representation of CAD component i.
[0035] Step 202: Construct a CAD component knowledge graph to describe the association relationships between CAD components, and use knowledge graph embedding technology to extract component association knowledge.
[0036] Existing component recommendation methods usually rely only on the isolated information of components (such as ID embedding), and it is difficult to capture the complex associations and semantic relationships between components, resulting in limited accuracy of the recommendation results. The knowledge graph, as a structured knowledge representation method, can clearly represent a complex knowledge system by organizing data in the form of a graph structure, thus supporting semantic understanding and reasoning. In intelligent recommendation and decision support scenarios, the knowledge graph can discover potential rules and patterns by mining the association relationships between entities, thereby improving the accuracy of recommendation and the scientific nature of decision-making. Therefore, in the embodiments of the present invention, it is intended to construct a CAD component knowledge graph, model the association rules such as functional compatibility and physical constraints between components, and extract and explicitly introduce component assembly association knowledge to further enhance the representation quality of CAD components.
[0037] First, data collection and preprocessing are carried out. The original information such as geometric data, assembly relationships, material properties, and functional descriptions of CAD components is collected from multi-source data (such as CAD model libraries, BOM tables, technical documents, and user annotations). After the collection is completed, the collected data is cleaned to remove duplicate, missing, or noisy content (for example, the non-standard name "screw" needs to be unified as "bolt"), and attributes such as materials and specifications are transformed into domain-standard terms through standardized mapping (such as "SS304" is mapped to "Stainless Steel 304"). At the same time, unstructured text is transformed into structured fields (such as "high temperature resistance" is parsed as "attribute: temperature resistance", "value: 500°C"), laying a high-quality data foundation for subsequent knowledge extraction and graph construction.
[0038] Then, knowledge extraction is carried out to identify entities and their relationships from the preprocessed multi-source data. In the embodiment of the present invention, the CAD parsing library OpenCASCADE and BiLSTM-CRF are used to identify entities (i.e., CAD components) and their relationships (i.e., the association relationships between CAD components, such as assembly relationships, functional dependency relationships, geometric relationships, etc.) from the CAD model library and technical documents respectively. Using the identified entities and their relationships, in the embodiment of the present invention, based on the (head entity, relationship, tail entity) triple, the association relationships between CAD components are represented as a graph structure, and a CAD component knowledge graph is constructed. , where represents the entity set, represents the relationship set. In the graph structure, CAD component entities are represented as nodes, and the association relationships between CAD components are represented as edges.
[0039] Finally, based on the constructed CAD component knowledge graph , the embedding of each node component i in the graph is obtained using the knowledge graph embedding technology ConvKB , as the associated knowledge representation of CAD component i. The training process of the ConvKB model is as follows: (2) (3) where and represent the embeddings of the head entity node h and the tail entity node t respectively, r represents the relationship embedding, represents the matrix concatenation operation, represents the convolution operation, represents the convolution kernel, represents the weight of the fully connected layer, represents the activation function, represents the operation of flattening the matrix into a vector, represents the rationality score of the triple association. is the set of positive samples, is the set of negative samples (generated by replacing the head entity or the tail entity ), is the margin hyperparameter, which forces the positive sample score to be at least higher than the negative sample, is the optimization function for the ConvKB model.
[0040] Step 203: Use the contrastive learning-based loss function to align the representation spaces of multi-dimensional information such as the ID embeddings, text attributes, and component association knowledge of CAD components.
[0041] Directly introducing the text attribute representation (including attribute information such as component name, material, and specification) of components and the associated knowledge representation extracted from the knowledge graph into the ID embedding representation of CAD components can enrich the semantic information of components, but may also bring significant noise problems. This is because the text attribute representation and the knowledge graph associated knowledge representation usually come from different data sources and modeling methods, and their representation space distributions are significantly different from the original ID embedding space. This difference will cause a large deviation between the fused representation space and the original ID space, thus affecting the performance and stability of the recommendation model. For example, the text attribute representation may focus more on semantic description, while the knowledge graph associated knowledge representation focuses on the structural relationship between components. The data distributions of both are inconsistent with the ID embedding, and direct fusion may lead to information conflicts or redundancies. Therefore, in order to effectively utilize multi-source information and avoid noise interference, it is necessary to align and optimize different feature spaces so that they are coordinated in a unified representation space. In the embodiment of the present invention, a contrastive learning loss function is designed at the historical assembly sequence level to align both the text attribute representation space and the associated knowledge representation space of components in the assembled sequence with the ID embedding space: (4) (5) (6) where represents the ID embedding of CAD component i, represents the cosine similarity between the ID embedding of CAD component i and the text attribute representation of CAD component j, represents the cosine similarity between the ID embedding of CAD component i and the associated knowledge representation of CAD component j, represents the sequence of assembled CAD components contains the number of components, represents the number of samples. is the contrastive loss that constrains the alignment of the text attribute representation space and the ID embedding space, The contrastive loss for constraining the alignment of the associated knowledge representation space and the ID embedding space is the text attribute representation of CAD component j is the associated knowledge representation of CAD component j is the cosine similarity between the ID embedding of CAD component i and the text attribute representation of CAD component i is the cosine similarity between the ID embedding of CAD component i and the associated knowledge representation of CAD component i
[0042] Step 204: Extract isomorphic features from the aligned multi-dimensional component information using orthogonal decomposition technology
[0043] Although the spatial alignment technology can effectively narrow the distributions of different representation spaces (i.e., the ID embedding space and the representation spaces of auxiliary information such as text attributes and knowledge graph associated knowledge), due to the heterogeneity of the representation sources, direct fusion may still lead to information conflicts or loss of some features. From a microscopic perspective, when projecting the ID embedding and the auxiliary information embedding onto the same coordinate system, it can be observed that the vector components of the two in some coordinate axes are in opposite directions, and these opposite components may cancel each other out, resulting in information loss. Intuitively, if the direction of the representation embedding of the auxiliary information is consistent with that of the ID embedding in a certain dimension, it indicates that the two contain isomorphic information, and this part of the information should be retained to the greatest extent to enhance the semantic consistency of the representation; on the contrary, if the directions are opposite, it indicates that there is heterogeneous information between the two, which may introduce conflicts or noise and should be removed to avoid negative impacts on the model performance. Therefore, the embodiments of the present invention perform orthogonal decomposition on the representation of the auxiliary information to extract the part isomorphic to the ID embedding. This requires an orthogonal coordinate system as the comparison granularity to fully adapt to all ID embeddings in the assembled CAD component sequence
[0044] Specifically, the ID embeddings, text attribute representations, and associated knowledge representations of the assembled CAD component sequence are all represented in matrix form to obtain the ID embedding matrix , the text attribute matrix and the associated knowledge matrix . Taking the extraction of isomorphic features in the text attribute information as an example. First, perform QR decomposition on the ID embedding matrix: , where is an orthogonal matrix is an upper triangular matrix. Then, map and to to obtain the coordinate matrix: (7) Use the coordinate matrix to obtain the part of the text attribute information isomorphic to the ID embedding : (8) (9) Among them, represents element-wise multiplication, represents the indicator function, which outputs 1 when the input value is greater than 0 and 0 otherwise. Similarly, through the same orthogonal decomposition process, the part isomorphic to the ID embedding can be obtained from the matrix . .
[0045] Step 205: Use the self-attention mechanism to fuse multi-dimensional isomorphic features to generate a component representation enhanced with auxiliary information.
[0046] Directly performing simple concatenation or weighted fusion on the multi-dimensional isomorphic features of CAD components cannot fully capture their internal relevance and importance, resulting in low information utilization efficiency. The self-attention mechanism can dynamically evaluate the importance of each feature by calculating the interaction weights between features and adaptively fuse multi-dimensional information. In addition, the self-attention mechanism also has the advantages of parallel computing and long-range dependence modeling, and can efficiently process the complex structural relationships between assembled components, meeting the modeling requirements of large-scale CAD component sequences. Therefore, in the embodiments of the present invention, the self-attention mechanism is used to fuse multi-dimensional isomorphic features to generate a component representation enhanced with auxiliary information. In addition, during the feature fusion process, the ID embedding has a strong correlation with auxiliary information such as text attributes and knowledge graph associated knowledge, and a weak correlation with the position encoding of each component in the assembled sequence. Directly fusing the position encoding with the ID embedding and auxiliary information will reduce the effectiveness of learning. Therefore, in the embodiments of the present invention, the attention information of the position information is calculated separately.
[0047] Specifically, in the embodiments of the present invention, an L-layer component information fusion layer based on the self-attention mechanism is used to fuse the multi-dimensional isomorphic features of CAD components, and the fusion operation of each layer is as follows: (10) (11) (12) (13) Among them, is the fusion feature output by the -th layer component information fusion layer, , is the position embedding matrix of the -th layer, , , , , , are all learnable weight matrices. and are the correlation matrices of the fused feature and the position embedding matrix of the -th layer respectively, and is the dimension size. The output of the -th layer component information fusion layer is the component representation matrix enhanced by auxiliary information.
[0048] Step 206: Integrate the component assembly context information and predict the next CAD component required for the drawing design through a sequence recommendation process.
[0049] Aggregate the auxiliary information enhanced representations of each component in the assembled CAD component sequence to obtain the component assembly context information. Perform a dot product operation on the context information and the embeddings of the candidate CAD components to calculate the probability scores of each candidate CAD component required by the designer: (14) where is the representation embedding of the -th candidate CAD component, and is the demand probability score of the -th candidate CAD component. Arrange all candidate components in descending order of scores and generate a Top-K component recommendation list to recommend to the designer.
[0050] Embodiment 3 As Figure 2 shown, this embodiment provides a component recommendation system for CAD drawing, including: a text extraction module 1, an associated knowledge representation construction module 2, an alignment module 3, a component representation construction module 4, and a recommendation module 5; The text extraction module 1 is used to obtain CAD component attribute information and encode the text description of CAD components by using a text feature extractor; The associated knowledge representation construction module 2 is used to construct a CAD component knowledge graph based on the association relationship between CAD components and extract the component association knowledge representation in the knowledge graph by using a knowledge graph embedding method; The alignment module 3 is used to construct a contrast learning loss function and align the ID embedding of CAD components with the text description and the associated knowledge representation to obtain aligned multi-dimensional component information; The component representation construction module 4 is used to extract isomorphic features from the aligned multi-dimensional component information by using an orthogonal decomposition method and perform fusion by using a self-attention mechanism to generate an auxiliary information enhanced component representation; The recommendation module 5 is used to integrate the component representation of the component assembly context, and predict the next CAD component required for the drawing design through the sequence recommendation process.
[0051] Embodiment 4 This embodiment also provides a component recommendation device for CAD drawing, which includes: a processor and a memory. Program instructions are stored in the memory, and the processor calls the program instructions stored in the memory to enable the device to execute the method steps in Embodiment 1.
[0052] It should be noted that for the foregoing method embodiments, for the sake of simple description, they are all expressed as a series of action combinations. However, those skilled in the art should know that the present disclosure is not limited by the described action sequence, because according to the present disclosure, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all optional embodiments, and the actions and modules involved are not necessarily essential to the present disclosure.
[0053] It should be understood that various forms of the processes shown above can be used, reordering, adding, or deleting steps. For example, the steps described in the present disclosure can be executed in parallel, sequentially, or in different orders, as long as the desired results of the technical solutions disclosed in the present disclosure can be achieved. No limitation is imposed herein.
[0054] The above specific implementation manners do not constitute a limitation on the protection scope of the present disclosure. Those skilled in the art should understand that various modifications, combinations, sub - combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present disclosure shall be included within the protection scope of the present disclosure.
Claims
1. A component recommendation method for CAD drawing, characterized in that, The method includes: Obtaining CAD component attribute information and encoding the text description of the CAD component using a text feature extractor; Constructing a CAD component knowledge graph based on the association relationships between CAD components, and extracting component association knowledge representations in the knowledge graph using a knowledge graph embedding method; Constructing a contrastive learning loss function, and aligning the ID embedding of the CAD component with the text description and the association knowledge representation to obtain aligned multi-dimensional component information; Using an orthogonal decomposition method to extract isomorphic features from the aligned multi-dimensional component information, and fusing them using a self-attention mechanism to generate a component representation enhanced with auxiliary information; Integrating the component representations of the component assembly context information, and predicting the next CAD component required for the drawing design through a sequence recommendation process.
2. The component recommendation method for CAD drawing according to claim 1, wherein The encoding of the text description of the CAD component using the text feature extractor is as follows: ; Among them, is the text description representing the attribute information about the CAD component i, represents the pre-trained language model BERT, represents the text attribute representation of the CAD component i.
3. The component recommendation method for CAD drawing according to claim 1, wherein The process of constructing a CAD component knowledge graph based on the association relationships between CAD components and extracting component association knowledge representations in the knowledge graph using a knowledge graph embedding method is as follows: Collecting the original information of CAD components from multi-source datasets and performing data processing to obtain preprocessed multi-source data; Identifying entities and relationships from the preprocessed multi-source data, and representing the association relationships between CAD components and between components as a graph structure based on triples to construct a knowledge graph; Based on the knowledge graph, using a knowledge graph embedding method to obtain the embedding of each node component in the knowledge graph as the association knowledge representation of the CAD component.
4. The component recommendation method for CAD drawing according to claim 1, wherein The process of collecting the original information of CAD components from multi-source datasets and performing data processing to obtain preprocessed multi-source data is as follows: Collecting the original information of geometric data, assembly relationships, material attributes, and functional descriptions of CAD components from CAD model libraries, BOM tables, technical documents, and user annotation information data; Performing data cleaning on the original information to remove duplicate, missing, or noisy content, and converting material and specification attributes into domain standard terms through standardization mapping, and converting unstructured text into structured fields.
5. The component recommendation method for CAD drawing according to claim 1, wherein The process of constructing a contrastive learning loss function and aligning the ID embedding of the CAD component with the text description and the association knowledge representation is as follows: ; ; ; Among them, represents the ID embedding of CAD component i, represents the cosine similarity between the ID embedding of CAD component i and the text attribute representation of CAD component j, represents the cosine similarity between the ID embedding of CAD component i and the associated knowledge representation of CAD component j, represents the number of components included in the assembled CAD component sequence in, represents the number of samples, is the contrastive loss for constraining the alignment of the text attribute representation space and the ID embedding space, is the contrastive loss for constraining the alignment of the associated knowledge representation space and the ID embedding space, is the text attribute representation of CAD component j, is the associated knowledge representation of CAD component j, is the cosine similarity between the ID embedding of CAD component i and the text attribute representation of CAD component i, is the cosine similarity between the ID embedding of CAD component i and the associated knowledge representation of CAD component i.
6. The component recommendation method for CAD drawing according to claim 1, characterized in that, The process of using an orthogonal decomposition method to extract isomorphic features from the aligned multi-dimensional component information is as follows: Representing the ID embedding, text description, and association knowledge representation of the sequence of assembled CAD components in matrix form to obtain an ID embedding matrix, a text description matrix, and an association knowledge matrix; Performing QR decomposition on the ID embedding matrix to generate the functional relationship between the ID embedding matrix and the orthogonal matrix and the upper triangular matrix; Mapping the ID embedding matrix to the text description matrix and the association knowledge matrix into the orthogonal matrix respectively to obtain an ID embedding coordinate matrix, a text description coordinate matrix, and the association knowledge coordinate matrix; Obtain the isomorphic part of the text description with the ID embedding by using the ID embedding coordinate matrix and the text description coordinate matrix, and obtain the isomorphic part of the associated knowledge with the ID embedding by using the ID embedding coordinate matrix and the associated knowledge coordinate matrix, and construct an isomorphic feature.
7. The component recommendation method for CAD drawing according to claim 1, characterized in that, The process of using the self-attention mechanism for fusion to generate a component representation enhanced with auxiliary information is as follows: ; ; ; ; Among them, is the fused feature output by the component information fusion layer of the th layer, , is the position embedding matrix of the th layer, , , , , , are all learnable weight matrices, and are the correlation matrices of the fused feature and the position embedding matrix of the th layer respectively, is the dimension size, and the output of the component information fusion layer of the th layer is the component representation matrix enhanced by auxiliary information, is the output of the component information fusion layer of the th layer.
8. The component recommendation method for CAD drawing according to claim 1, wherein The process of integrating the component representation of the component assembly context information and predicting the next CAD component required for the drawing design through a sequence recommendation process is as follows: Aggregate the sequence of assembled CAD components Enhance the component characterization with the auxiliary information of each component in it, obtain the component assembly context information, calculate the demand probability score of each candidate CAD component according to the context information, and generate a Top-K component recommendation list in descending order of scores: ; Among them, is the v-th candidate CAD component, is the requirement probability score of the v-th candidate CAD component.
9. A component recommendation system for CAD drawing, which is used to implement the component recommendation method for CAD drawing according to any one of claims 1-8, characterized in that, Including: A text extraction module (1), an associated knowledge representation construction module (2), an alignment module (3), a component representation construction module (4), and a recommendation module (5); The text extraction module (1) is used to obtain CAD component attribute information and encode the text description of the CAD component by using a text feature extractor; The associated knowledge representation construction module (2) is used to construct a CAD component knowledge graph based on the association relationship between CAD components, and extract the component association knowledge representation in the knowledge graph by using a knowledge graph embedding method; The alignment module (3) is used to construct a contrastive learning loss function and align the ID embedding of the CAD component with the text description and the associated knowledge representation to obtain aligned multi-dimensional component information; The component representation construction module (4) is used to extract isomorphic features from the aligned multi-dimensional component information by using an orthogonal decomposition method, and use the self-attention mechanism for fusion to generate a component representation enhanced with auxiliary information; The recommendation module (5) is used to integrate the component representation of the component assembly context information and predict the next CAD component required for the drawing design through a sequence recommendation process.
10. A component recommendation device for CAD drawing, characterized in that, The device includes: a processor and a memory, and program instructions are stored in the memory. The processor calls the program instructions stored in the memory to enable the device to execute the method according to any one of claims 1-8.