Three-dimensional part retrieval method based on self-supervised graph representation learning

By employing a self-supervised graph representation learning method, the topological relationships of 3D parts are directly extracted from Brep format CAD data, solving the problems of reliance on manual annotation and information loss, and achieving efficient and accurate 3D part retrieval.

CN122019822APending Publication Date: 2026-05-12HEFEI ARTIFICIAL INTELLIGENCE & BIG DATA RES INST CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
HEFEI ARTIFICIAL INTELLIGENCE & BIG DATA RES INST CO LTD
Filing Date
2026-01-29
Publication Date
2026-05-12

AI Technical Summary

Technical Problem

Existing 3D part retrieval methods rely on manual annotation, resulting in high costs. Furthermore, when converting CAD models into point clouds or meshes, parametric geometric features are lost, leading to limited generalization capabilities.

Method used

A self-supervised graph representation learning method is adopted. By constructing an edge-face connection graph and using node-level and graph-level self-supervised training, the topological relationships of surfaces and curves are directly extracted from Brep format CAD data. The local geometric details and global topological structure of 3D parts are learned, and a multi-granularity vector database is constructed for retrieval.

Benefits of technology

It enables the extraction of high-quality features without manual annotation, reducing retrieval costs and improving retrieval accuracy and efficiency. It is suitable for efficient retrieval of massive amounts of industrial parts, and is especially suitable for complex assembly scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122019822A_ABST
    Figure CN122019822A_ABST
Patent Text Reader

Abstract

The invention provides a three-dimensional part retrieval method based on self-supervised graph representation learning, relates to the field of deep learning, and solves the technical problem of high retrieval cost caused by dependence on manual part labeling in a part retrieval method in the prior art. The method comprises the following steps: acquiring and analyzing a CAD three-dimensional part data set in a boundary representation format, and constructing an edge-surface connection diagram according to a topological relation between a curved surface and a curve in a three-dimensional part to obtain an undirected graph; inputting the undirected graph into an encoder-decoder structure, carrying out node-level self-supervision training on node information in the side-surface connection graph, and reserving a trained encoder as a node feature extractor; performing graph-level self-supervision training on the side surface connection graph by utilizing a node feature extractor to obtain a pre-trained part retrieval model; and extracting feature vectors of each part in the three-dimensional part data set by using the part retrieval model, and storing the feature vectors as a part feature library for part retrieval.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of deep learning, specifically a three-dimensional part retrieval method based on self-supervised graph representation learning. Background Technology

[0002] With the development of industrial digitalization, the number of computer-aided design (CAD) models has increased dramatically, making efficient retrieval of target parts a key issue in the engineering field. Traditional CAD part retrieval mainly relies on manually designed geometric features, but these methods have limited generalization ability for complex structures. With the rise of deep learning, methods based on 3D deep learning, multi-view rendering, and 2D CNNs have significantly improved retrieval accuracy. However, converting CAD to point clouds / meshes results in the loss of parametric geometric features, and mainstream 3D retrieval methods, based on sensor data, cannot utilize the complete design semantics of the native CAD format. Furthermore, the annotation cost of 3D parts is high, requiring professional engineers to spend a significant amount of time accurately annotating information such as part category, functional attributes, and topological features. It is also difficult to cover massive CAD models to form a large-scale, high-quality annotated dataset, limiting the performance improvement and widespread application of these methods in industrial scenarios for retrieving massive CAD models. Summary of the Invention

[0003] This application provides a 3D part retrieval method based on self-supervised graph representation learning, which solves the technical problem of high retrieval cost caused by the reliance on manual part annotation in existing part retrieval methods.

[0004] To achieve the above objectives, this application adopts the following technical solution: Firstly, a method for retrieving 3D parts based on self-supervised graph representation learning is provided, including: Obtain and parse the CAD 3D part dataset in boundary representation format, construct the edge-face connection graph based on the topological relationship between surfaces and curves in the 3D part, and obtain the undirected graph; The undirected graph is input into the encoder-decoder structure, and node-level self-supervised training is performed on the node information in the edge-face connection graph. The trained encoder is retained as a node feature extractor. A pre-trained parts retrieval model is obtained by using a node feature extractor to perform graph-level self-supervised training on the edge-face connection graph. The feature vectors of each part in the 3D parts dataset are extracted using a parts retrieval model and stored as a parts feature library. The parts feature library is used to calculate the cosine similarity with the feature vectors of the 3D parts to be retrieved, and the information of the parts is returned in order of cosine similarity.

[0005] Based on the above technical solution, the 3D part retrieval method based on self-supervised graph representation learning provided in this application, through a two-stage self-supervised learning mode, can autonomously learn feature representations that can effectively distinguish different 3D parts without manually annotating the category or attribute information of the 3D parts. At the same time, by constructing an edge-face connection graph, the topological relationship of surfaces and curves is directly extracted from Brep format CAD data, accurately preserving the essential geometric structure and topological information of the 3D parts. In addition, node-level self-supervised training is used to focus on the reconstruction of local surface features, while graph-level self-supervised training is used to focus on the discriminativeness of the global structure. The two-level training works together to enable the model to learn both the local geometric details and the global topological structure of the parts. The extracted feature vectors are more representative, enabling rapid matching between the parts to be retrieved and the feature library, balancing retrieval accuracy and efficiency, and is suitable for the actual industrial parts retrieval needs.

[0006] Furthermore, the step of constructing the edge-face connection diagram based on the topological relationship between surfaces and curves in the three-dimensional part includes: An open-source geometric kernel is used to parse the CAD file in the boundary representation format to obtain the geometric structure information of the three-dimensional parts in the file; The topological relationships between surfaces and curves are extracted from the geometric structure information. Surfaces are defined as nodes of an undirected graph, and the intersecting curves of intersecting surfaces are defined as edges of the corresponding nodes. By integrating all nodes and edges, we obtain an edge-face connection graph.

[0007] Furthermore, the node-level self-supervised training of the node information in the edge-face connection graph includes: Calculate the original features of nodes and edges in the edge-face connected graph; Randomly select several nodes in the edge-face connection graph and mark them as invalid, and record the index of the marked invalid nodes to obtain the second edge-face connection graph; The second side-face connection map is input into the encoder for encoding to obtain the first output feature; Based on the index of the node marked as invalid, the corresponding node in the first output feature is marked as invalid, and the second output feature is obtained; The second output feature is used as the node feature of the second edge-face connection graph and input into the decoder. The decoder is then used to reconstruct the node features marked as invalid in the second output feature. The original features and the output features of the decoder are normalized, and the encoder-decoder structure is iteratively trained with the goal of minimizing the mean square error of both features until the loss converges.

[0008] Furthermore, the calculation of the original features of nodes and edges in the edge-face connection graph includes: Uniform sampling is performed on the UV parameter space of the surface to form surface mesh points, and the surface mesh points are represented as two-dimensional vectors to obtain the original features of the nodes; Uniform sampling is performed on the parameter domain of the curve to form curve grid points, and the curve grid points are represented as one-dimensional vectors to obtain the original features of the edges.

[0009] Furthermore, the encoder in the encoder-decoder structure comprises a two-dimensional convolutional neural network, a one-dimensional convolutional neural network, and a graph attention network; wherein, The two-dimensional convolutional neural network is used to process the original features of the nodes and output the initial geometric embedding vector of the nodes. The one-dimensional convolutional neural network is used to process the original features of the edges and output the initial geometric embedding vector of the edges. The graph attention network is used to fuse the initial geometric embedding vectors of nodes and edges with the topology of the graph, calculate the message passing weights between nodes through the attention mechanism, and output node features containing global context information.

[0010] Furthermore, the graph attention network employs a dynamic graph attention mechanism, where the edge weights between node i and node j are... The calculation formula is: ;in, , Let be the node features of nodes i and j, respectively; W be the learnable parameter matrix; d be the feature dimension; σ be the activation function; and λ be the balance coefficient. Let be the surface similarity between the surfaces containing node i and node j, calculated based on Gaussian curvature.

[0011] Furthermore, the step of performing graph-level self-supervised training on the edge-face connectivity graph using a node feature extractor includes: Input the edge-face connection graph into the trained node feature extractor, and output node features containing set information and topological information; A random data transformation is performed on the edge-face connectivity graph, and the transformed graph is used as the positive sample of the current edge-face connectivity graph. Other edge-face connectivity graphs in the same training batch are selected as the negative samples of the current edge-face connectivity graph. A single training batch contains N edge-face connectivity graphs and N corresponding positive samples. The node features are input into the graph neural network, and the graph neural network is trained to learn the global trapped representation of the edge-face connectivity graph with the contrastive learning loss function as the optimization objective. The contrastive learning loss function is used to quantify the similarity difference between the current edge-face connectivity graph and positive and negative samples. By minimizing the similarity difference between the current edge-face connectivity graph and positive samples, the graph neural network is trained. Once the contrastive learning loss function converges, training stops, resulting in a pre-trained parts retrieval model.

[0012] Furthermore, the loss function for the graph-level self-supervised training is: Where L represents the loss value, s ij s represents the similarity between the current edge-face connectivity graph i and the positive sample j. ik The cosine similarity between the current edge-face connectivity graph i and the negative sample k is represented by N, where N is the training batch size and τ is the temperature hyperparameter. The positive sample represents the graph generated by performing random data transformation on the current edge-face connectivity graph, and the negative sample represents other edge-face connectivity graphs in the same training batch besides the current edge-face connectivity graph.

[0013] Furthermore, the construction of the edge-face connection graph also includes: Construct a three-level hierarchical graph structure including surface level, feature level, and part level; The surface level diagram is the edge-face connection diagram; The feature-level map is a feature sub-map that identifies specific geometric functions by performing curvature clustering on surface nodes; the feature sub-map includes holes, chamfers, and bosses; The part-level drawing is a global drawing that aggregates all surfaces and features; The three-layer graph structure enables bidirectional message passing between each other through cross-layer connection edges.

[0014] Furthermore, the part feature library is a multi-granularity vector database used to store the global graph embedding vector of the part and the embedding vectors of each feature subgraph; the process of returning part information sorted by cosine similarity includes a three-level retrieval process: First-level retrieval: Calculate the cosine similarity between the query part and the global image embedding vector of the part in the part feature library, and filter out the results with similarity higher than the first threshold to obtain the first filtering result; Second-level retrieval: In the first filtering results, calculate the cosine similarity between the query part and the embedding vector of the feature sub-image in the first filtering results, filter out the results with a cosine similarity higher than the second threshold, and obtain the second filtering results; Third-level screening: The results of the second-level screening are compared with parametric geometric equations and analyzed for tolerance mating surfaces to generate assembly compatibility. The parts are then sorted according to the compatibility score to obtain the final list of retrieved parts.

[0015] Compared with the prior art, the beneficial effects of the present invention are: This invention effectively solves the problems of traditional 3D part retrieval methods, such as strong dependence on labeled data and incomplete geometric feature extraction, by constructing an edge-face connectivity graph and employing a self-supervised training strategy combining node-level and graph-level methods. Specifically, the graph construction method based on native CAD data in boundary representation format directly parses the topological relationships between surfaces and curves, avoiding information loss during the conversion of CAD models into point clouds or meshes, and fully preserving parametric geometric features. Through node-level self-supervised training using masking reconstruction, the model can learn node representations that are robust to the loss of local geometric features; and the encoder design combined with a dynamic graph attention mechanism further enhances the model's ability to perceive subtle geometric features such as changes in surface curvature, enabling the extracted features to contain both geometric and topological information. This hierarchical self-supervised training paradigm not only reduces dependence on large amounts of labeled data but also significantly improves the discriminative power of feature representations.

[0016] This invention further achieves multi-scale part retrieval from local features to global semantics by introducing a three-layer hierarchical graph structure and a multi-granularity retrieval process. The surface-feature-part three-level graph structure enables bidirectional message passing through cross-layer connections, allowing the model to simultaneously capture local geometric features and global structural constraints. The construction of the multi-granularity vector database supports a progressive retrieval strategy: first, rapid coarse screening based on global graph embedding; then, fine screening through feature subgraph matching; and finally, assembly compatibility reports generated by combining parametric geometric equation comparison and tolerance analysis. This retrieval mechanism not only improves retrieval efficiency but also accurately assesses the functional matching degree between parts, making it particularly suitable for complex assembly scenarios requiring high-precision fit.

[0017] Furthermore, this invention organically combines geometric features with topological relationships, achieving effective extraction of deep semantic features of 3D parts through an end-to-end self-supervised learning framework. Compared to traditional methods, this invention significantly reduces reliance on labeled data while maintaining retrieval accuracy, demonstrating strong engineering practical value. Its multi-level retrieval process and compatibility analysis capabilities better support part reuse and assembly design optimization in intelligent manufacturing environments, providing new technical support for digital applications in the industrial field. Attached Figure Description

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

[0019] Figure 1 A flowchart illustrating a 3D part retrieval method based on self-supervised graph representation learning, provided for an embodiment of this application; Figure 2 A flowchart illustrating another 3D part retrieval method based on self-supervised graph representation learning provided in this application embodiment; Figure 3 A flowchart illustrating another 3D part retrieval method based on self-supervised graph representation learning provided in this application embodiment; Figure 4 This is a flowchart illustrating another 3D part retrieval method based on self-supervised graph representation learning provided in an embodiment of this application. Detailed Implementation

[0020] In the description of this application, unless otherwise stated, " / " means "or," for example, A / B can mean A or B. The "and / or" in this document is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, and B alone. Furthermore, "at least one" means one or more, and "multiple" means two or more. The terms "first," "second," etc., do not limit the quantity or order of execution, and "first," "second," etc., do not necessarily imply differences.

[0021] It should be noted that, in this application, the terms "exemplary" or "for example" are used to indicate that something is being described as an example, illustration, or illustration. Any embodiment or design described as "exemplary" or "for example" in this application should not be construed as being more preferred or advantageous than other embodiments or design solutions. Specifically, the use of terms such as "exemplary" or "for example" is intended to present the relevant concepts in a concrete manner.

[0022] To address the technical problems of high costs due to reliance on manual annotation in existing 3D part retrieval technologies, easy loss of parametric geometric features and design semantics when converting CAD models to point clouds or meshes, and limited generalization ability, this application provides a 3D part retrieval method based on self-supervised graph representation learning. This method includes: Acquire and parse a CAD 3D part dataset in boundary representation format, and construct an edge-face connection diagram based on the topological relationship between surfaces and curves in the 3D part; The undirected graph is input into the encoder-decoder structure, and node-level self-supervised training is performed on the node information in the edge-face connection graph. The trained encoder is retained as a node feature extractor. A pre-trained parts retrieval model is obtained by using a node feature extractor to perform graph-level self-supervised training on the edge-face connection graph. The feature vectors of each part in the 3D parts dataset are extracted using a parts retrieval model and stored as a parts feature library. The parts feature library is used to calculate the cosine similarity with the feature vectors of the 3D parts to be retrieved, and the information of the parts is returned in order of cosine similarity.

[0023] Based on this, the method does not rely on manual annotation, can completely preserve the original geometric and semantic information of 3D parts, and balances retrieval accuracy and efficiency, making it suitable for efficient retrieval scenarios of massive industrial 3D parts.

[0024] like Figure 1 As shown in the embodiment of this application, a 3D part retrieval method based on self-supervised graph representation learning is provided, including: S1. Obtain and parse the CAD 3D part dataset in the boundary representation format, and construct the edge-face connection diagram based on the topological relationship between surfaces and curves in the 3D part.

[0025] The edge-face connection diagram reflects the core geometric structure of a 3D part and the logical relationships between its components. Surfaces serve as the basic geometric units of the part, while curves act as the connecting links between surfaces. This diagram visually presents the part's topological structure and geometric distribution characteristics. CAD stands for Computer-Aided Design, and its boundary representation format is the Boundary Representation format, or Brep format for short. This format accurately records the geometric elements of a part, such as surfaces and curves, and their topological relationships, making it a commonly used storage format for CAD models in industrial settings.

[0026] In some implementation methods, datasets can be acquired through various means such as collecting data from industrial design databases, importing internal CAD model archives, and downloading publicly available 3D part datasets. The parsing process can employ different methods such as API interfaces of professional geometric processing software, custom geometric parsing algorithms, and commercial geometric kernel tools. The core is to extract the topological relationship information between surfaces and curves in 3D parts. When constructing the edge-face connection diagram, it is sufficient to reflect the topological relationship between surfaces and curves through the correspondence between nodes and edges. The specific definitions of nodes and edges can be flexibly adjusted according to the actual scenario.

[0027] It should be noted that constructing the edge-face connection diagram directly based on the CAD data in the boundary representation format is the key to avoiding the loss of geometric features and design semantics. Compared with converting the CAD model into point cloud or mesh, this method can preserve the original parametric geometric information of the part to the greatest extent, providing a high-quality data foundation for subsequent feature extraction.

[0028] For example, a set of CAD files in boundary representation format is obtained by publicly available industrial parts datasets. Each file is parsed using commercial geometric kernel tools to extract the type, parameters, and intersection curve information of all surfaces. Each surface is defined as a node, and the intersection curve of any two intersecting surfaces is defined as the edge connecting the two nodes. After integrating all nodes and edges, a complete edge-surface connection graph is formed.

[0029] S2. Input the undirected graph into the encoder-decoder structure, perform node-level self-supervised training on the node information in the edge-face connection graph, and retain the trained encoder as a node feature extractor.

[0030] The undirected graph is the edge-face connectivity graph constructed in step S1. Since the topological relationship between surfaces and curves has no directional attribute, the edge-face connectivity graph naturally possesses the characteristic of being undirected. Node-level self-supervised training utilizes the inherent characteristics of the data to allow the model to autonomously learn effective representations of nodes without relying on external information such as manually labeled node categories and attributes. The core focus is on feature extraction and optimization at the individual node level in the edge-face connectivity graph.

[0031] In some implementations, common methods for node-level self-supervised training include contrastive learning training, autoencoder reconstruction training, and generative node feature prediction training. Contrastive learning training constructs positive and negative sample pairs by transforming node features in different ways, allowing the model to learn to distinguish sample differences. Autoencoder reconstruction training masks or perturbs some node features, allowing the decoder to reconstruct the original node features, thereby training the encoder's feature extraction capabilities. Generative node feature prediction training predicts the features of the target node based on the features of neighboring nodes, achieving effective learning of node features.

[0032] It should be noted that in the encoder-decoder structure, the encoder is used to extract node features, and the decoder is used to assist in completing the self-supervised training task to optimize the encoder parameters. After training, the decoder no longer participates in the subsequent process, and only the trained encoder is retained as a node feature extractor to ensure that the key features of the nodes can be extracted efficiently in the future.

[0033] S3. Use a node feature extractor to perform graph-level self-supervised training on the edge-face connection graph to obtain a pre-trained part retrieval model.

[0034] Among them, graph-level self-supervised training focuses on the global feature learning of the entire edge-face connection graph based on node feature extraction. It does not rely on external information such as manually labeled part categories and functions. The model learns the differences and commonalities between different edge-face connection graphs autonomously to obtain a global feature representation that can characterize the entire 3D part.

[0035] In some implementations, common methods for graph-level self-supervised training include contrastive learning training, metric learning training, and self-supervised clustering training. Contrastive learning training obtains positive samples by augmenting the same edge-connection graph and selects other edge-connection graphs as negative samples, allowing the model to learn to narrow the feature distance between the same part graph and positive samples, and widen the feature distance between it and negative samples. Metric learning training optimizes the feature similarity distribution between different edge-connection graphs by defining a reasonable distance metric function. Self-supervised clustering training allows the model to autonomously cluster edge-connection graphs with similar features into the same group, using the clustering effect as the optimization objective for model training.

[0036] It should be noted that graph-level self-supervised training relies on the node features output by the node feature extractor. These features are global feature fusion and optimization based on local node features. This is to enable the model to learn global discriminative features that can distinguish different 3D parts, providing highly discriminative feature vectors for subsequent retrieval.

[0037] For example, a graph-level self-supervised training method based on contrastive learning is adopted. The node feature extractor extracts all node features of the edge-face connection graph. The edge-face connection graph is randomly perturbed to obtain positive sample graphs. The edge-face connection graphs corresponding to other 3D parts in the same training batch are selected as negative sample graphs. The node features are input into the graph neural network. The optimization objective is to narrow the feature similarity between the current graph and the positive sample graph and widen the feature similarity between the current graph and the negative sample graph. The graph neural network is trained iteratively. When the training loss converges, the node feature extractor and the trained graph neural network are combined to form a pre-trained part retrieval model.

[0038] S4. Use the part retrieval model to extract the feature vectors of each part in the 3D part dataset and store them as a part feature library.

[0039] The part feature library is used to calculate the cosine similarity with the feature vector of the 3D part to be retrieved, and the part information is returned in order of cosine similarity.

[0040] In some implementations, when extracting feature vectors, the output features of the part retrieval model can be preprocessed by normalization, dimensionality reduction, etc., to improve the efficiency and accuracy of subsequent similarity calculations. The storage method of the part feature library can adopt distributed vector databases, local vector index files, in-memory vector storage structures, etc., as long as it can support efficient feature vector storage and similarity query. In addition to cosine similarity calculation, other similarity measurement methods such as Euclidean distance and Manhattan distance can also be used according to actual needs, as long as they can reflect the degree of similarity between the part to be retrieved and the parts in the feature library through quantitative indicators.

[0041] It should be noted that the construction of the part feature library is the foundation for achieving fast retrieval. The quality of the stored feature vectors directly determines the retrieval accuracy, while an efficient storage and query scheme affects the retrieval efficiency. Therefore, a balance needs to be struck between feature vector quality and storage and query efficiency.

[0042] For example, a pre-trained parts retrieval model is used to process each part in the 3D parts dataset one by one, extracting the feature vector of each part and performing L2 normalization. The normalized feature vector is then associated with the corresponding basic information of the part (such as part number, design parameter summary, etc.) and stored in a distributed vector database to build a parts feature library. When a new 3D part is to be retrieved, its feature vector is extracted and normalized using the same parts retrieval model. The cosine similarity between the feature vector and all stored feature vectors is calculated in the distributed vector database, and the corresponding part information is returned in descending order of similarity.

[0043] Based on the above technical solutions, this application provides a 3D part retrieval method based on self-supervised graph representation learning. Through a two-stage self-supervised training mode, it eliminates the reliance on manually labeled data, reducing the training cost of the retrieval model. It directly constructs an edge-face connection graph based on CAD data in boundary representation format, fully preserving the original geometric features and design semantics of the parts, providing a high-quality data foundation for feature extraction. Node-level self-supervised training focuses on local node feature learning, while graph-level self-supervised training focuses on global graph feature learning. The two-stage training works synergistically, enabling the extracted feature vectors to simultaneously contain local geometric details and global topological structure information, possessing strong discriminative power. By constructing a part feature library, it achieves efficient similarity matching, balancing retrieval accuracy and efficiency. This method effectively meets the retrieval needs of massive 3D parts in industrial scenarios, providing strong support for industrial applications such as part reuse and assembly design optimization.

[0044] In one possible implementation of the embodiments of this application, combined with Figure 1 ,like Figure 2 As shown, the above S1 can be implemented through the following S101, S102 and S103, which are explained in detail below: S101. Uses an open-source geometric kernel to parse CAD files in boundary representation format and obtains the geometric structure information of 3D parts in the file.

[0045] Among them, the open-source geometry kernel is a collection of free and open-source tools with functions such as geometric data parsing and topological relationship extraction, which can directly read the raw data of Brep format CAD files; geometric structure information is key data reflecting the geometric composition of three-dimensional parts, including the type of surface, parametric equations, size range, curve shape, parameter domain, length and other core information.

[0046] In some implementations, the open-source geometry kernel can be selected from tools such as Open CASCADE Technology, CGAL computational geometry algorithm library, and Libigl. The specific choice depends on factors such as CAD file format compatibility, parsing speed requirements, and the completeness of geometric information extraction. The parsing process can be executed by calling the API interface of the open-source geometry kernel, following the flow of "file reading - geometric element identification - preliminary extraction of topological relationships - geometric parameter quantization". For Brep files of different formats, such as STEP format and IGES format, they can be unified into a kernel-supported format through a format conversion tool before parsing to ensure parsing universality.

[0047] It should be noted that, compared to converting CAD models into point clouds or meshes, using an open-source geometric kernel to parse Brep format CAD files—this method of directly parsing the native format—can fully preserve the parametric features of the part, such as surface equations and constraint relationships.

[0048] For example, the commonly used step format Brep file in industrial scenarios is selected as the parsing object. The OpenCASCADE Technology open-source geometry kernel is used to load the step file through its provided reading interface. The geometric element traversal function is called to identify all surfaces and curves in the file. The type of each surface (such as cylindrical surface, spherical surface, plane), parametric equations (such as the radius, height, and axis equation of the cylindrical surface), and the parameter domain range, control point coordinates, and other information of each curve are extracted to form a structured geometric structure information dataset.

[0049] S102. Extract the topological relationships between surfaces and curves from the geometric structure information, define the surfaces as nodes of an undirected graph, and define the intersecting curves of intersecting surfaces as edges of the corresponding nodes.

[0050] Among them, topological relationships refer to the inherent spatial relationships such as connection, intersection, and containment between surfaces and curves in a three-dimensional part; undirected graphs refer to graphs where the edges between nodes do not have directional attributes and conform to the bidirectional characteristics of the intersection relationship between surfaces and curves.

[0051] In some implementations, topological relationships can be extracted through the topological query function of the open-source geometric kernel. That is, by calling the kernel's interfaces such as "querying adjacent curves of a surface" and "determining whether surfaces intersect", the association information between surfaces and curves can be quickly obtained. Alternatively, a custom topological judgment algorithm can be used to calculate the spatial positional relationship between surfaces based on the surface parameter equations and curve parameters in the geometric structure information, and to determine whether they intersect and the ownership of intersecting curves.

[0052] It should be noted that defining surfaces as nodes and intersecting curves as edges transforms the geometric topological information of 3D parts into a data format that can be processed by graph neural networks. This transformation method intuitively reflects the core position of surfaces as the basic geometric units of parts, as well as the linking role of intersecting curves in surface relationships. This ensures that the graph data contains both geometric parameter information and retains topological connections, laying the foundation for subsequent model learning of local and global features.

[0053] S103. Integrate all nodes and edges to obtain a surface-level graph.

[0054] Integration refers to the process of organizing and storing all nodes, edges, and corresponding geometric topology information defined in S102 according to a unified graph data structure. The resulting surface-level graph, i.e., the edge-face connection graph, is the final graph data that can completely represent the geometric structure and topological relationship of the three-dimensional part.

[0055] In some implementations, the specific integration method can be selected based on the data scale and the input requirements of subsequent models: when the number of parts is small and the graph data scale is small, an adjacency matrix can be used to intuitively represent the connection relationships between nodes; when the number of parts is large and the graph data scale is large, an adjacency list is preferred, recording the graph structure through a list of nodes and a list of adjacent nodes corresponding to each node, saving memory space. During the integration process, nodes and edges can also be numbered and indexed to establish a mapping relationship between geometric structure information and graph elements, facilitating quick lookup and retrieval during subsequent model training.

[0056] It should be noted that the integrated edge-face connection graph is non-directional and geometrically and topologically integrated. Non-directionality ensures that the relationships between surfaces are not misled by direction, while geometrically and topologically integrated graph data simultaneously carries the original geometric parameters of the parts and the design topological logic, avoiding the problem of incomplete feature extraction caused by the separation of geometric and topological information in traditional methods.

[0057] For example, an adjacency list is used for integration. First, all surface nodes are numbered in the order of 1, 2, 3...n to form a node list. For each node, its corresponding adjacent node number, connecting edge number, and the intersection curve parameter information of the edge are recorded. For example, the adjacency list of node 1 is "node 2-edge 3 (curve C parameter), node 5-edge 7 (curve F parameter)". The adjacency lists of all nodes are integrated to form a complete edge-surface connection graph. At the same time, a mapping table between node number and surface geometry information, and between edge number and curve geometry information is established to facilitate subsequent queries.

[0058] S104. Perform curvature clustering on the surface nodes of the surface-level graph to identify feature subgraphs that represent specific geometric functions and construct a feature-level graph.

[0059] Curvature clustering is a method that classifies surface nodes with similar curvature characteristics based on curvature parameters such as Gaussian curvature and average curvature. Its core is to distinguish geometric features with different functions through curvature differences. Feature subgraphs are local subgraphs that focus on specific geometric functions of parts, typically including holes, chamfers, bosses, etc. These subgraphs are key parts for realizing the function of parts. Feature-level graphs are the intermediate level of the three-layer hierarchical graph structure, which plays the role of a bridge connecting the bottom basic geometry and the upper global structure.

[0060] In some implementations, curvature clustering can employ clustering algorithms such as K-means and DBSCAN, with the specific choice depending on the distribution characteristics of the curvature data. The number of clusters and the clustering threshold can be determined by statistically analyzing the curvature range of common functional features in industrial parts. For example, the curvature range of surfaces corresponding to hole structures is relatively concentrated, and a threshold can be set to cluster the surface nodes within this range into hole feature sub-maps. Feature sub-map recognition can also be aided by geometric parameters. For instance, the surfaces of boss structures typically have specific size ratios and spatial distributions, and size filtering can further optimize the accuracy of feature sub-map recognition. It should be noted that the construction of feature-level maps is crucial for achieving multi-scale retrieval. By extracting local functional feature sub-maps, the model can accurately capture the core functional attributes of parts, avoiding functional feature matching biases caused by relying solely on the global structure, and providing support for subsequent refined retrieval.

[0061] For example, the Gaussian curvature of each surface node in the surface-level graph is calculated, and the curvature data is clustered using the K-means clustering algorithm. The number of clusters is set to 3, corresponding to three typical functional features: holes, chamfers, and bosses. By analyzing the surface distribution and geometric parameters of the clustering results, the local node clusters formed after clustering and their corresponding edges are integrated into hole feature subgraphs, chamfer feature subgraphs, and boss feature subgraphs. All feature subgraphs together constitute the feature-level graph.

[0062] S105. Combine all surface nodes of the aggregated surface-level graph with all feature subgraphs of the feature-level graph to construct a part-level graph, and realize bidirectional message passing of the three-layer graph structure of surface-level, feature-level, and part-level graphs through cross-layer connection edges.

[0063] Among them, the part-level diagram is the top layer of the three-layer hierarchical diagram structure. It is a centralized representation of the global structure and overall semantics of the part. By aggregating the basic geometry of the bottom layer and the functional features of the middle layer, a global diagram that can reflect the complete attributes of the part is formed. Cross-layer connecting edges are the links connecting different levels of diagram structures. They have no directional attributes and can realize information interaction between levels. Bidirectional message passing means that information can be passed from the surface-level diagram upward to the feature-level diagram and the part-level diagram, and can also be fed back from the part-level diagram downward to the feature-level diagram and the surface-level diagram, ensuring the full integration of information at each level.

[0064] In some implementations, the aggregation of part-level graphs can be achieved using global pooling, feature concatenation, etc., to fuse the node features of the surface-level graph with the subgraph features of the feature-level graph into a global feature vector; the construction of cross-layer connection edges can be based on the relationship between layers, establishing connections between nodes belonging to the same feature subgraph in the surface-level graph and the corresponding subgraph in the feature-level graph, and then establishing connections between all feature subgraphs and the part-level graph; bidirectional message passing can be achieved through the message passing mechanism of graph neural networks, for example, by using an attention mechanism to allocate the passing weight of cross-layer messages, thereby strengthening the interaction of key information.

[0065] It should be noted that the bidirectional message passing of the three-layer graph structure allows the model to simultaneously capture local geometric details (surface level), key functional features (feature level), and global structural constraints (part level), avoiding the limitations of a single-layer graph structure in information representation and providing multi-scale, comprehensive graph data support for subsequent self-supervised training.

[0066] For example, a global average pooling method is used to fuse all node features of the surface-level graph with the features of the three feature subgraphs of the feature-level graph to obtain a global feature vector. Based on this vector, a part-level graph containing a global node is constructed. Cross-layer connection edges are constructed: nodes belonging to the hole feature subgraph in the surface-level graph are connected to the hole feature subgraph in the feature-level graph. Similarly, chamfer and boss feature subgraphs are connected to the corresponding surface nodes. Then, the three feature subgraphs are connected to the global node of the part-level graph. Bidirectional message passing is achieved through a graph attention network. When passing upward, local features are aggregated to the global level, and when feeding back downward, global constraint information is passed to the local level, thus completing the construction of a three-layer hierarchical graph structure.

[0067] Based on the above technical solution, steps S101 to S105 involve parsing the original data, extracting topological relationships, constructing a low-level surface-level graph, identifying intermediate feature-level graphs, aggregating the top-level part-level graph, and establishing cross-layer message passing. This process fully constructs a three-layer hierarchical graph structure at the surface, feature, and part levels. This structure achieves bidirectional message passing through cross-layer connections, simultaneously capturing the local geometric details, key functional features, and global topological structure of 3D parts, avoiding the problem of insufficient representation capabilities of a single graph structure. Furthermore, by directly constructing the structure based on Brep format CAD data, it fully preserves the parametric geometric features and design semantics of the parts, providing multi-scale, high-quality input data for subsequent node-level and graph-level self-supervised training. This lays a solid foundation for achieving multi-granularity retrieval that balances accuracy and efficiency.

[0068] In one possible implementation of the embodiments of this application, combined with Figure 1 ,like Figure 3 As shown, the above S2 can be implemented through the following S201, S202, S203 and S204, which are explained in detail below: S201. Calculate the original features of nodes and edges in the edge-face connection graph.

[0069] In this system, nodes correspond to the surfaces of 3D parts, and the original features of nodes are quantified data characterizing the geometric properties of the surfaces (such as shape, curvature, and parameter range). Edges correspond to the intersecting curves of intersecting surfaces, and the original features of edges are quantified data reflecting the core features of the curves, such as their shape, parameter domain, and spatial position. The UV parameter space is the parametric representation of the surface. By mapping the 3D surface to the 2D UV plane, ordered and uniform sampling of the surface can be achieved. The curve parameter domain is the range of parameter values ​​that describe the shape of the curve and is the key basis for capturing the geometric features of the curve.

[0070] In some implementations, the sampling density of the UV parameter space of the surface is a preset parameter. The method for determining this parameter is as follows: select 50 sets of industrial part surface samples with different complexities, covering typical types such as plane, cylindrical surface and freeform surface, and test three sampling densities of 32×32, 64×64 and 128×128 respectively. Calculate the feature representation accuracy and sampling time under each density, select the sampling density with an accuracy of ≥96% and a single surface sampling time of ≤0.08 seconds, and finally determine 64×64 as the default sampling density. Similarly, the effects of sampling points of 20, 40, and 80 sampling points were tested for the curve parameter domain. Forty sampling points, with a feature restoration accuracy ≥ 94% and controllable computational cost, were selected as the preset parameter. The data vector representation after sampling can be adjusted according to the subsequent network input requirements. In addition to two-dimensional vectors, the original features of nodes can also be represented by three-dimensional vectors, provided that the feature dimensions are uniform. The same applies to the original features of edges.

[0071] For example, for two typical nodes, cylindrical surfaces and freeform surfaces, their UV parameter space is uniformly sampled at a density of 64×64 to obtain 4096 surface grid points. The three-dimensional coordinates of each grid point are mapped to two-dimensional vectors, and the resulting splices form the original feature of the node. For two typical edges, straight lines and arcs, their parameter domain is uniformly sampled at 40 sampling points to obtain 40 curve grid points. The coordinates of each grid point are represented as one-dimensional vectors, and the resulting splices form the original feature of the edge.

[0072] S202. Randomly select several nodes in the edge-face connection graph and mark them as invalid. Record the subscripts of the nodes marked as invalid to obtain the second edge-face connection graph. Input the second edge-face connection graph into the encoder for encoding to obtain the first output feature. According to the subscripts of the invalid nodes, mark the corresponding nodes in the first output feature as invalid to obtain the second output feature.

[0073] Here, "marking as invalid" means masking the original features of a node so that the model cannot directly obtain the original information of that part of the node during training, thus simulating a scenario of missing local features; the second edge-face connection graph is incomplete graph data containing some invalid nodes, used to train the model's feature extraction ability when local features are missing; the encoder is a neural network with the ability to fuse geometric features and topological information, used to encode the features of valid nodes and the topological structure of the graph, and output a feature vector containing global context information; the first output feature is the full set of node features obtained by the encoder after encoding the second edge-face connection graph, and the second output feature is the set of valid features after removing the encoded features corresponding to invalid nodes.

[0074] In some implementations, the proportion of invalid nodes selected is a preset parameter, determined by the following method: Five ratios of 30%, 40%, 50%, 60%, and 70% were selected and compared under the same training dataset and network architecture. The feature reconstruction accuracy and training convergence speed of each group were calculated. The ratio with the highest reconstruction accuracy (≥92%) and the number of convergence iterations ≤1200 was selected. Finally, 50% was determined as the optimal ratio for selecting invalid nodes. Invalid marking methods can include zero-value padding, feature masking, and random noise replacement. The core is to prevent the model from utilizing the original features of those nodes. The encoder's network structure can be adjusted according to the data complexity. In addition to a combination architecture of two-dimensional convolutional neural networks, one-dimensional convolutional neural networks, and graph attention networks, a combination architecture of graph convolutional neural networks and fully connected networks can also be used.

[0075] It should be noted that the two-step process of marking invalid nodes is crucial to ensuring that the decoder reconstructs the network based solely on the encoded features of valid nodes. This avoids interference from the original or encoded features of invalid nodes in the reconstruction process. This method forces the model to learn to infer the features of missing nodes by utilizing the topological relationships between nodes and the features of valid nodes, thereby improving the model's robustness to missing local features.

[0076] S203. Input the second output feature as the node feature of the second edge-face connection graph into the decoder, and use the decoder to reconstruct the node features marked as invalid.

[0077] The decoder is a neural network symmetrical to the encoder architecture, which has the ability to reconstruct and restore features. It is used to infer and reconstruct the original features of invalid nodes based on the encoded features of valid nodes, the connection relationships of edges, and local geometric information. The reconstruction process aggregates the context information of valid nodes through a message passing mechanism, gradually restores the geometric feature details of invalid nodes, and makes the output reconstructed features as close as possible to the original features.

[0078] In some implementations, the network structure of the decoder can be flexibly adjusted according to the encoder: if the encoder adopts a "2D convolution + 1D convolution + graph attention network" architecture, the decoder adopts a symmetrical architecture of "deconvolution network + graph attention network + fully connected layer"; the activation function of the decoder can be ReLU, LeakyReLU, GELU, etc., and the specific choice is determined through comparative experiments, selecting the GELU activation function with the smallest reconstruction error; the number of layers in the decoder is kept consistent with that of the encoder to ensure the matching of feature dimensions and reconstruction accuracy.

[0079] It should be noted that the core design of the decoder is to complement the encoder. By reconstructing the task, the encoder's parameters are optimized in reverse, enabling the encoder to learn more representative node features. Even when local features are missing, the decoder can accurately infer the missing features through effective information, providing a high-quality local feature foundation for subsequent graph-level training.

[0080] S204. Normalize the original features and the output features of the decoder, and iteratively train the encoder-decoder structure until the loss converges, with the goal of minimizing the mean square error of both.

[0081] The normalization process maps the original features and reconstructed features to the same numerical range ([0,1] in this embodiment) to avoid loss calculation bias caused by differences in feature numerical ranges, thus ensuring training stability. The mean squared error is a loss function that quantifies the difference between the original and reconstructed features, calculated using the following formula: ,in It is a one-dimensional vector after the original features are flattened. It is the reconstructed feature vector output by the decoder; loss convergence means that when the change in the loss value over 10 consecutive iterations is less than a preset threshold, the model training reaches a stable state, at which point the encoder parameters have been optimized to the optimal level.

[0082] In some implementations, normalization can be achieved using min-max normalization, Z-score normalization, etc. In this embodiment, min-max normalization is selected through comparative experiments because it can better preserve the distribution characteristics of features. The preset threshold for loss convergence is determined as follows: based on the feature variance of the training dataset, 1% of the variance is calculated as the initial threshold. Through multiple training verifications, it is adjusted to a threshold that can stabilize the model and prevent overfitting, and is finally determined to be 1e-5. The optimizer for iterative training can be Adam, SGD, RMSprop, etc. By comparing the training speed and convergence effect, the Adam optimizer is selected, and the learning rate is preset to 0.001.

[0083] It should be noted that the decoder only plays a role during the training phase and is discarded after training is completed. Only the optimized encoder is retained as the node feature extractor, which ensures the efficiency of subsequent feature extraction.

[0084] Based on the above technical solution, S201 to S204 constitute a complete node-level self-supervised training process. Through the extraction of original features, simulation of feature loss, feature encoding, reconstruction of missing features, and iterative optimization, the encoder can autonomously learn node features that effectively represent the local geometric details and topological relationships of the surface without manual annotation. In this step, uniform sampling ensures the integrity of the original features, random masking and reconstruction tasks improve the model's robustness to local feature loss, and normalization and mean squared error loss function ensure the stability and accuracy of training. The final retained encoder, as a node feature extractor, provides a high-quality local feature foundation for subsequent graph-level self-supervised training, enabling the entire retrieval model to simultaneously capture the local geometric details and global topological structure of parts, laying a solid foundation for improving retrieval accuracy.

[0085] In one possible implementation of the embodiments of this application, combined with Figure 1 ,like Figure 4 As shown, the above S3 can be implemented through the following S301, S302 and S303, which are explained in detail below: S301. Input the edge-face connection graph into the trained node feature extractor, and output node features containing geometric and topological information.

[0086] The node feature extractor is the encoder retained after training in step S2. It is used to encode the features of nodes in the edge-face connection graph, fusing the local geometric details of the nodes with the topological relationships of the graph, and outputting node-level feature vectors with strong representational capabilities. Geometric information includes quantitative data such as the shape parameters, curvature distribution, and size range of the surface, while topological information reflects the spatial relationship logic between nodes (surfaces) and edges (curves), such as adjacency and intersection. The fusion of the two enables the node features to comprehensively reflect the local structural characteristics of the part.

[0087] In some implementations, the node feature extractor can be flexibly selected based on the complexity of the edge-face connectivity graph and the data scale, including mainstream graph neural network architectures such as Graph Attention Network (GAT), Graph Convolutional Network (GCN), and GraphSage. If the geometry of the part is complex and the topological relationships are dense, Graph Attention Network can be preferred, which can adaptively allocate message passing weights between nodes through the attention mechanism to strengthen the representation of key features. If the data scale is large, GraphSage Network can be selected to reduce computational complexity by sampling neighboring nodes.

[0088] It should be noted that the node features output in this step are a deep extraction of local features from the edge-face connection graph, and their quality directly determines the effectiveness of subsequent global feature learning. Compared to traditional manually designed global features, these node features have autonomously learned the essential properties of the part through self-supervised training, providing high-quality basic data for global feature aggregation without manual intervention.

[0089] S302. Perform random data transformation on the edge-face connection graph, use the transformed graph as the positive sample of the current edge-face connection graph, and select other edge-face connection graphs in the same training batch as the negative samples of the current edge-face connection graph.

[0090] Each training batch contains N edge-face connectivity graphs and N corresponding positive samples. Random data transformation refers to slightly perturbing the graph data without altering its core semantics and main topological structure. The aim is to construct positive samples that are semantically consistent with the original edge-face connectivity graphs but slightly different in form, allowing the model to learn global features robust to slight structural perturbations. Positive samples represent different graph representations of the same part as the current edge-face connectivity graph, maintaining consistency in core geometric and topological semantics. Negative samples represent different parts of the current edge-face connectivity graph, exhibiting significant differences in core semantics, and are used to help the model learn to distinguish the global feature differences between different parts. The training batch size N is a key preset parameter controlling training efficiency and stability.

[0091] In some implementations, random data transformation methods include randomly deleting a small number of non-critical edges, randomly masking a small number of non-core nodes, and applying small Gaussian noise perturbations to node features. The specific method can be selected based on the stability of the part structure, ensuring that the topological similarity between the transformed positive sample and the original sample is ≥85%. In addition to other edge-face connection graphs in the same training batch, negative samples can also be randomly selected from the training set for edge-face connection graphs that are different from the current part category, further increasing the difference between positive and negative samples. The method for determining the training batch size N is as follows: four candidate values, 32, 64, 128, and 256, are selected. Under the same training dataset and network architecture, the training iteration speed, loss convergence stability, and final retrieval accuracy corresponding to each candidate value are tested respectively. The smallest candidate value with retrieval accuracy ≥95% and training time per batch ≤3 seconds is selected. In this embodiment, N=64 is finally determined.

[0092] S303. Input the node features into the graph neural network, and train the graph neural network to learn the global embedding representation of the edge-face connection graph with the contrastive learning loss function as the optimization objective. When the contrastive learning loss function converges, stop training and obtain the pre-trained parts retrieval model.

[0093] The graph neural network is used to globally aggregate the node features output by S301, fusing the scattered node-level features into a graph-level feature vector that can represent the entire part, thus obtaining a global embedding representation. The contrastive learning loss function is used to quantify the similarity difference between the current edge-face connection graph and positive and negative samples. It is used to minimize the similarity difference between the current edge-face connection graph and positive samples, and maximize the similarity difference between the current edge-face connection graph and negative samples, thereby forcing the model to learn global features with strong discriminative power.

[0094] The complete expression for the contrastive learning loss function is: Where L is the loss value, used to measure the current training effect of the model. The smaller the loss value, the stronger the model's ability to distinguish between positive and negative samples; N is the training batch size, which is consistent with the preset batch size in S302, used to unify the dimension of loss calculation. The similarity between the current edge-face connection graph i and the corresponding positive sample j is calculated using cosine similarity, with a value range of [-1, 1]. The closer the value is to 1, the more semantically consistent the two are. τ is the cosine similarity between the current edge-face connection graph i and each negative sample k, with a value range of [-1, 1]. The closer the value is to -1, the greater the semantic difference between the two. τ is a temperature hyperparameter used to adjust the smoothness of the similarity distribution. The smaller τ is, the steeper the similarity distribution, and the more sensitive the model is to distinguish the differences between samples. The larger τ is, the smoother the similarity distribution, and the more stable the model training. molecular This represents the similarity weight between the current image and the positive samples when magnified; the denominator... This represents the sum of similarity weights between the current graph and all negative samples. The entire formula converts the similarity weights into loss values ​​through logarithmic operations, and optimizes the parameters of the graph neural network through backpropagation, enabling the model to gradually learn global features that can accurately distinguish different parts.

[0095] In some implementations, the graph neural network can be selected based on an architecture that matches the node feature extractor, such as a three-layer graph attention network, a combination of a graph convolutional network and a fully connected layer, etc. The method for determining the temperature hyperparameter τ is as follows: select five candidate values ​​of 0.1, 0.5, 1.0, 2.0, and 5.0, and test the loss convergence speed and final retrieval accuracy corresponding to each candidate value under the same training conditions. Select the candidate value with the highest retrieval accuracy and the number of loss convergence iterations ≤ 1500. In this embodiment, τ = 0.5 is finally determined. The criterion for judging loss convergence is: the change range of the loss value in 10 consecutive iterations is ≤ 1e-5, and the loss value in the 10th iteration is ≤ 0.1. At this time, the model training is considered to have reached a stable state. The optimizer can be the Adam optimizer, and the learning rate is preset to 0.0005.

[0096] It should be noted that the global aggregation process of graph neural networks should make full use of the geometric and topological information in the node features, and avoid focusing only on local features while ignoring global structural constraints; the core of the contrastive learning loss function is that it does not require manual labeling of part categories, and can achieve model training only through the semantic differences of the data itself, which can greatly reduce the dependence on labeled data.

[0097] Based on the above technical solution, S301 to S303 constitute a complete graph-level self-supervised training process. Through steps such as extracting local node features, constructing positive and negative sample pairs, and global feature aggregation and comparative learning, the model can autonomously learn to effectively distinguish the global topological structure and overall semantic features of different 3D parts without manual annotation. In this process, the high-quality local features provided by the node feature extractor lay the foundation for global learning, the positive and negative sample pairs ensure the effectiveness of comparative learning, and the comparative learning loss function precisely guides the model's optimization direction. The resulting pre-trained part retrieval model can simultaneously capture the local geometric details and global topological structure of 3D parts. The extracted feature vectors have extremely strong discriminative power, providing core support for the high accuracy and efficiency of subsequent part retrieval, and effectively solving the technical problems of traditional methods' strong dependence on labeled data and insufficient global feature representation.

[0098] In one possible implementation of this application embodiment, the above-mentioned S4 specifically includes the following S401 to S403: S401. Construct a multi-granularity vector database as a part feature library, storing the global graph embedding vector and the embedding vector of each feature subgraph of each part in the 3D part dataset.

[0099] Among them, the multi-granularity vector database is a dedicated database with high-dimensional vector storage and fast retrieval capabilities. It is used to store the global embedding vector of the part and the embedding vector of each feature subgraph at the same time. The global graph embedding vector represents the overall topological structure and global design semantics of the 3D part and is a condensed expression of the overall features of the part. The feature subgraph embedding vector is a local representation of specific geometric functional features such as holes, chamfers, and bosses in the part. It is obtained by curvature clustering recognition of surface nodes and can accurately reflect the key functional attributes of the part.

[0100] In some implementations, the database selection can be flexibly chosen based on the size of the parts library. For small-scale parts libraries (≤100,000 pieces), the FAISS database can be used to reduce deployment costs, while for large-scale parts libraries (>100,000 pieces), the Milvus database is preferred to support distributed expansion and high-concurrency retrieval. When storing, each vector needs to be associated with basic metadata of the parts, including part number, design version, original CAD file path, applicable scenarios, etc., to facilitate quick location and application after the retrieval results are returned.

[0101] It should be noted that the construction of a multi-granularity vector database is a core prerequisite for realizing a progressive retrieval strategy that combines rapid coarse screening with fine screening. Compared to the traditional single global feature storage mode, it retains both global and local feature vectors, ensuring the efficiency of coarse screening and providing detailed support for subsequent accurate matching, thus solving the problems of low efficiency and insufficient accuracy in traditional parts retrieval.

[0102] For example, a pre-trained parts retrieval model is used to process an industrial parts dataset: For the bearing parts, firstly, a 256-dimensional global graph embedding vector representing the overall structure is extracted. Then, curvature clustering is used to identify three feature sub-graphs: the inner hole, the outer ring chamfer, and the mounting boss. The 256-dimensional embedding vectors of each feature sub-graph are extracted. These four vectors are associated with the bearing's metadata (number "B-2024-058", version "V2.1", file path " / CAD / mechanical / bearing / B-2024-058.step") and stored in the Milvus multi-granularity vector database to complete the storage operation for this part. This process is repeated to complete the feature storage of all parts, forming a complete parts feature library.

[0103] S402. Perform a two-level progressive search to obtain the first and second filtering results in sequence.

[0104] The first-level retrieval is a coarse screening based on the cosine similarity of the global graph embedding vector, used to quickly narrow down the retrieval range and filter out candidate parts that are significantly different from the global structure of the query part. The second-level retrieval is a fine screening based on the cosine similarity of the feature subgraph embedding vector, used to further filter out candidate parts with high functional fit with the query part from the coarse screening results through local functional feature matching.

[0105] In some implementations, the first threshold and the second threshold are the core preset parameters for controlling the search results, and the method for determining them is as follows: 500 sets of query parts samples of different types were selected, and four candidate thresholds of 0.6, 0.7, 0.8, and 0.85 were tested respectively. The retrieval recall (≥90% is acceptable) and precision (≥85% is acceptable) under each threshold were calculated: The first threshold needs to balance the efficiency of coarse screening and the recall rate. The threshold with a recall rate ≥92% and a reduction of more than 60% in the number of candidate parts after coarse screening was selected, and it was finally determined to be 0.7; The second threshold needs to balance the precision of fine screening and the false negative rate. The threshold with a precision rate ≥88% and a false negative rate ≤3% was selected, and it was finally determined to be 0.8. In addition to cosine similarity, Euclidean distance, Manhattan distance and other metrics can also be used. Through comparative experiments, it has been verified that cosine similarity is better at representing structural similarity in high-dimensional feature vector matching, so it is the preferred method in this embodiment.

[0106] It should be noted that the first-level search is based on global features for rapid coarse screening, which can quickly eliminate most irrelevant parts in the massive parts database and greatly reduce the computational load of subsequent fine-grained search; the second level is based on local functional features for fine screening, which can accurately capture the key design intent of parts (such as the diameter of holes, the height of bosses, etc.), making up for the deficiency of single global feature search in paying insufficient attention to local details. The two work together to achieve a balance between search efficiency and accuracy.

[0107] For example, given an existing multi-granularity vector database containing 150,000 parts, and the query part being a motor end cap with mounting holes: First, the 256-dimensional global graph embedding vector of the query part is extracted, and its cosine similarity with the global vectors of all parts in the database is calculated. 450 parts with a similarity ≥ 0.7 are selected as the first filtering result. Next, the mounting holes and edge chamfers of the query part are extracted as two feature sub-graph vectors. The cosine similarity of these two vectors with the corresponding feature sub-graph vectors of the 450 parts in the first filtering result is calculated. The average of the two similarities is taken as the comprehensive feature similarity, and 60 parts with a comprehensive similarity ≥ 0.8 are selected as the second filtering result.

[0108] S403. Perform parametric geometric equation comparison and tolerance mating surface analysis on the second screening results, generate an assembly compatibility report, and obtain the final list of retrieved parts based on the compatibility score.

[0109] Among them, parametric geometric equation comparison refers to extracting parametric equations of key functional surfaces of the query part and candidate parts, such as the radius and axis equation of a cylinder, and the normal vector and position equation of a plane, and verifying the degree of matching of geometric parameters by calculating parameter errors; tolerance mating surface analysis is based on industrial tolerance standards to evaluate whether the tolerance grade and dimensional deviation of the mating surfaces of the query part and candidate parts meet the assembly requirements; the assembly compatibility report is a comprehensive evaluation document that includes geometric parameter matching degree, tolerance fit qualification, and assembly feasibility suggestions; the compatibility score is a quantitative comprehensive index of geometric matching and tolerance fit, with a full score of 100 points. The higher the score, the better the assembly compatibility.

[0110] In some implementations, the object of parametric geometric equation comparison is the key functional surfaces of the part (such as assembly mating surfaces, positioning surfaces, mounting hole surfaces, etc.). The parametric equations of the surfaces are extracted through an open-source geometric kernel (such as Open CASCADE Technology). During the comparison, the relative error of the parameters is calculated. For example, a relative error of ≤5% for the radius of a cylindrical surface and ≤3° for the included angle of the plane normal vector are considered a match. The tolerance mating surface analysis refers to the GB / T 1800.2-2009 industrial tolerance standard. The tolerance grade requirements are determined according to the assembly scenario (such as tolerance grade ≥IT7 for precision assembly scenarios and ≥IT10 for ordinary assembly scenarios). The dimensional tolerances and geometric tolerances (parallelism, perpendicularity, etc.) of the mating surfaces are analyzed to see if they meet the requirements. The compatibility score is calculated as follows: the geometric parameter matching degree accounts for 60 points (number of matching key surfaces / total number of key surfaces × 60), and the tolerance fit qualification accounts for 40 points (number of qualified mating surfaces / total number of mating surfaces × 40).

[0111] It should be noted that this step is a crucial engineering practicality assurance step in the retrieval process. The first two levels of retrieval achieve preliminary matching of structures and features, but do not consider the critical geometric parameter consistency and tolerance requirements in industrial assembly scenarios. This step, through parametric geometric equation comparison and tolerance analysis, upgrades the retrieval results from structural similarity to functional compatibility and direct assembly capability, making it suitable for complex assembly scenarios requiring high-precision fit, thus improving the engineering practical value of the retrieval results.

[0112] Based on the above technical solutions, S401 to S403 constitute a complete part retrieval process encompassing multi-granularity storage, progressive retrieval, and assembly compatibility verification. The construction of the multi-granularity vector database provides a high-quality data foundation for efficient and accurate retrieval. The two-level progressive retrieval balances retrieval efficiency and accuracy through a "coarse-to-fine" logic, while parametric geometric equation comparison and tolerance analysis ensure the engineering practical value of the retrieval results. The entire process fully preserves the parametric geometric features and topological information of the original CAD format, while eliminating reliance on manually labeled data through self-supervised learning. It simultaneously considers retrieval efficiency, accuracy, and assembly compatibility, perfectly solving the need for efficient and accurate retrieval of complex 3D parts in industrial scenarios, and providing strong technical support for part reuse and assembly design optimization in intelligent manufacturing environments.

[0113] Working principle of the invention: First, a computer-aided design 3D part dataset in boundary representation format is obtained. The topological relationships between surfaces and curves in the part are extracted by parsing the format file. A three-level hierarchical edge-surface connection graph containing surface level, feature level and part level is constructed to fully preserve the original geometric structure and design semantics of the part.

[0114] Subsequently, a two-stage self-supervised training method was adopted to construct the parts retrieval model: In the first stage, node-level self-supervised training was performed through an encoder-decoder structure. By masking some node features and then reconstructing them by the decoder, the encoder learned robust local surface features. After training, the encoder was retained as a node feature extractor. In the second stage, the node features of the edge-face connection graph were obtained using this extractor. Positive samples were constructed by performing random data transformation on the original graph, and other graphs in the same batch were selected as negative samples. Graph-level self-supervised training was performed using contrastive learning, so that the model learned the global structural features that could distinguish different parts, thus forming a pre-trained parts retrieval model.

[0115] Finally, the model is used to extract the global graph embedding vector and feature subgraph embedding vector of all parts to construct a multi-granularity part feature library. During retrieval, the global vector cosine similarity is used for rapid coarse screening, and the feature subgraph vector similarity is used for fine screening. Finally, the parametric geometric equation comparison and tolerance mating surface analysis are combined to generate an assembly compatibility report. The final retrieval results are returned in order of matching degree, realizing a three-dimensional part retrieval that takes into account accuracy, efficiency and engineering practicality.

[0116] Although this application has been described herein in conjunction with various embodiments, those skilled in the art, by reviewing the accompanying drawings, disclosure, and appended claims, will understand and implement other variations of the disclosed embodiments in carrying out the claimed application. In the claims, the word "comprising" does not exclude other components or steps, and "a" or "an" does not exclude multiple instances. A single processor or other unit can implement several functions listed in the claims. While different dependent claims may recite certain measures, this does not mean that these measures cannot be combined to produce good results.

[0117] Although this application has been described in conjunction with specific features and embodiments, it is obvious that various modifications and combinations can be made thereto without departing from the spirit and scope of this application. Accordingly, this specification and drawings are merely exemplary illustrations of this application as defined by the appended claims, and are considered to cover any and all modifications, variations, combinations, or equivalents within the scope of this application. Clearly, those skilled in the art can make various alterations and modifications to this application without departing from the spirit and scope of this application. Thus, if such modifications and modifications of this application fall within the scope of the claims of this application and their equivalents, this application also intends to include such modifications and modifications.

Claims

1. A three-dimensional part retrieval method based on self-supervised graph representation learning, characterized in that, include: Obtain and parse the CAD 3D part dataset in boundary representation format, construct the edge-face connection graph based on the topological relationship between surfaces and curves in the 3D part, and obtain the undirected graph; The undirected graph is input into the encoder-decoder structure, and node-level self-supervised training is performed on the node information in the edge-face connection graph. The trained encoder is retained as a node feature extractor. A pre-trained parts retrieval model is obtained by using a node feature extractor to perform graph-level self-supervised training on the edge-face connection graph. The feature vectors of each part in the 3D parts dataset are extracted using a parts retrieval model and stored as a parts feature library. The parts feature library is used to calculate the cosine similarity with the feature vectors of the 3D parts to be retrieved, and the information of the parts is returned in order of cosine similarity.

2. The 3D part retrieval method based on self-supervised graph representation learning according to claim 1, characterized in that, The construction of the edge-face connection diagram based on the topological relationship between surfaces and curves in a three-dimensional part includes: An open-source geometric kernel is used to parse the CAD file in the boundary representation format to obtain the geometric structure information of the three-dimensional parts in the file; The topological relationships between surfaces and curves are extracted from the geometric structure information. Surfaces are defined as nodes of an undirected graph, and the intersecting curves of intersecting surfaces are defined as edges of the corresponding nodes. By integrating all nodes and edges, we obtain an edge-face connection graph.

3. The 3D part retrieval method based on self-supervised graph representation learning according to claim 1, characterized in that, The node-level self-supervised training of the node information in the edge-face connection graph includes: Calculate the original features of nodes and edges in the edge-face connected graph; Randomly select several nodes in the edge-face connection graph and mark them as invalid, and record the index of the marked invalid nodes to obtain the second edge-face connection graph; The second side-face connection map is input into the encoder for encoding to obtain the first output feature; Based on the index of the node marked as invalid, the corresponding node in the first output feature is marked as invalid, and the second output feature is obtained; The second output feature is used as the node feature of the second edge-face connection graph and input into the decoder. The decoder is then used to reconstruct the node features marked as invalid in the second output feature. The original features and the output features of the decoder are normalized, and the encoder-decoder structure is iteratively trained with the goal of minimizing the mean square error of both features until the loss converges.

4. The 3D part retrieval method based on self-supervised graph representation learning according to claim 3, characterized in that, The original features of nodes and edges in the calculated edge-face connection graph include: Uniform sampling is performed on the UV parameter space of the surface to form surface mesh points, and the surface mesh points are represented as two-dimensional vectors to obtain the original features of the nodes; Uniform sampling is performed on the parameter domain of the curve to form curve grid points, and the curve grid points are represented as one-dimensional vectors to obtain the original features of the edges.

5. The 3D part retrieval method based on self-supervised graph representation learning according to claim 1, characterized in that, The encoder in the encoder-decoder structure comprises a two-dimensional convolutional neural network, a one-dimensional convolutional neural network, and a graph attention network; wherein... The two-dimensional convolutional neural network is used to process the original features of the nodes and output the initial geometric embedding vector of the nodes. The one-dimensional convolutional neural network is used to process the original features of the edges and output the initial geometric embedding vector of the edges. The graph attention network is used to fuse the initial geometric embedding vectors of nodes and edges with the topology of the graph, calculate the message passing weights between nodes through the attention mechanism, and output node features containing global context information.

6. The 3D part retrieval method based on self-supervised graph representation learning according to claim 5, characterized in that, The graph attention network employs a dynamic graph attention mechanism, where the edge weights between node i and node j... The calculation formula is: ;in, , Let be the node features of nodes i and j, respectively; W be the learnable parameter matrix; d be the feature dimension; σ be the activation function; and λ be the balance coefficient. Let be the surface similarity between the surfaces containing node i and node j, calculated based on Gaussian curvature.

7. The 3D part retrieval method based on self-supervised graph representation learning according to claim 1, characterized in that, The step of using a node feature extractor to perform graph-level self-supervised training on the edge-face connectivity graph includes: Input the edge-face connection graph into the trained node feature extractor, and output node features containing set information and topological information; A random data transformation is performed on the edge-face connectivity graph, and the transformed graph is used as the positive sample of the current edge-face connectivity graph. Other edge-face connectivity graphs in the same training batch are selected as the negative samples of the current edge-face connectivity graph. A single training batch contains N edge-face connectivity graphs and N corresponding positive samples. The node features are input into the graph neural network, and the graph neural network is trained to learn the global trapped representation of the edge-face connectivity graph with the contrastive learning loss function as the optimization objective. The contrastive learning loss function is used to quantify the similarity difference between the current edge-face connectivity graph and positive and negative samples. By minimizing the similarity difference between the current edge-face connectivity graph and positive samples, the graph neural network is trained. Once the contrastive learning loss function converges, training stops, resulting in a pre-trained parts retrieval model.

8. A three-dimensional part retrieval method based on self-supervised graph representation learning according to claim 7, characterized in that, The loss function for the graph-level self-supervised training is: Where L represents the loss value, s ij s represents the similarity between the current edge-face connectivity graph i and the positive sample j. ik The cosine similarity between the current edge-face connectivity graph i and the negative sample k is represented by N, where N is the training batch size and τ is the temperature hyperparameter. The positive sample represents the graph generated by performing random data transformation on the current edge-face connectivity graph, and the negative sample represents other edge-face connectivity graphs in the same training batch besides the current edge-face connectivity graph.

9. A three-dimensional part retrieval method based on self-supervised graph representation learning according to claim 2, characterized in that, The construction of the edge-face connection diagram also includes: Construct a three-level hierarchical graph structure that includes surface-level graphs, feature-level graphs, and part-level graphs; The surface level diagram is the edge-face connection diagram; The feature-level map is a feature sub-map that identifies specific geometric functions by performing curvature clustering on surface nodes; the feature sub-map includes holes, chamfers, and bosses; The part-level drawing is a global drawing that aggregates all surfaces and features; The three-layer hierarchical graph structure enables bidirectional message passing between layers through cross-layer connection edges.

10. A three-dimensional part retrieval method based on self-supervised graph representation learning according to claim 9, characterized in that, The part feature library is a multi-granularity vector database used to store the global graph embedding vector and the embedding vector of each feature subgraph of the part; the process of returning part information sorted by cosine similarity includes a three-level retrieval process: First-level retrieval: Calculate the cosine similarity between the query part and the global image embedding vector of the part in the part feature library, and filter out the results with similarity higher than the first threshold to obtain the first filtering result; Second-level retrieval: In the first filtering results, calculate the cosine similarity between the query part and the embedding vector of the feature sub-image in the first filtering results, filter out the results with a cosine similarity higher than the second threshold, and obtain the second filtering results; Third-level screening: The results of the second-level screening are compared with parametric geometric equations and analyzed for tolerance mating surfaces to generate assembly compatibility. The parts are then sorted according to the compatibility score to obtain the final list of retrieved parts.