Automatic kinematic pair creating method and device and storage medium
By integrating hierarchical graph structures with expert knowledge, and utilizing neural network models to construct part-level and assembly-level graph structures, the framework and type prediction of kinematic pairs are optimized. This solves the problems of low efficiency and insufficient accuracy in existing technologies, and achieves efficient and accurate automatic creation of kinematic pairs.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SHENZHEN POISSON SOFTWARE TECH CO LTD
- Filing Date
- 2026-01-29
- Publication Date
- 2026-05-15
AI Technical Summary
Existing technologies are inefficient in creating kinematic pairs, rely on human experience and are prone to errors, and automatic identification methods based on geometric rules have insufficient generalization ability. Data-driven methods lack the integration of multibody dynamics, resulting in inaccurate prediction results and physical violations.
A hierarchical graph structure and expert knowledge fusion approach is adopted. Part-level and assembly-level graph structures are constructed through a neural network model. By combining graph neural networks and multibody dynamics expert knowledge, the frame and type prediction of kinematic pairs are optimized to avoid physical constraint conflicts.
It significantly improves the accuracy and generalization ability of motion pair creation, outputs automated results that conform to engineering specifications, and reduces the cost of manual verification and correction.
Smart Images

Figure CN122045929A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer-aided engineering, and in particular to a method, apparatus and storage medium for automatically creating motion pairs. Background Technology
[0002] Multibody dynamics simulation, as a core technology in computer-aided engineering (CAE), plays an irreplaceable role in evaluating the motion performance of mechanical systems and predicting their dynamic behavior. Constructing an accurate kinematic model is a prerequisite for simulation, and one of its core aspects is the correct definition of kinematic pairs between the various components of the assembly. Kinematic pairs, by constraining the relative degrees of freedom of motion between components, determine the kinematic behavior characteristics of the entire mechanical system.
[0003] Currently, creating kinematic pairs in industrial software primarily relies on two methods. The first is manual definition, where engineers manually select specific geometric features (e.g., faces, edges, points) of two components in a 3D interactive environment and specify the kinematic pair type and local coordinate system. For complex assemblies, this method is cumbersome, inefficient, highly dependent on human experience, and prone to oversights leading to constraint conflicts. The second method is automatic identification based on predefined geometric rules. For example, if two cylindrical surfaces satisfy the geometric condition of being coaxial and in contact, they are automatically identified as a revolute joint. However, this type of method relies on fixed, explicit geometric rules and has weak generalization ability and insufficient robustness for identifying complex combined features, implicit constraints, or non-standard geometric shapes.
[0004] With the development of artificial intelligence technology, some data-driven assembly relationship prediction schemes have emerged. However, these purely data-driven methods often simplify the problem to the matching and classification of geometric features, and their model training process lacks the integration and consideration of the basic principles of multibody dynamics. This leads to prediction results that may violate physical laws, producing invalid or conflicting constraints in motion, making them difficult to directly apply to engineering practices with extremely high requirements for accuracy and reliability. Summary of the Invention
[0005] This application provides a method, apparatus, and storage medium for automatically creating motion pairs. By integrating a hierarchical graph structure with expert knowledge, it achieves coordinated and automated prediction of motion pair frames and types, effectively improving identification accuracy, generalization ability, and engineering usability.
[0006] On the one hand, this application provides a method for automatically creating kinematic pairs, the method comprising: Acquire assembly data of the mechanical system, wherein the assembly data includes boundary representation data of each part; For each part, a part-level graph structure is constructed based on its boundary representation data. Features of each vertex in the part-level graph structure are extracted, and the embedding vector of the vertex is obtained through a neural network model. The vertices of the part-level graph structure represent the geometric faces and geometric edges of the part, and the edges represent the connection relationship between the geometric faces and geometric edges. Based on the assembly data, an assembly-level graph structure is constructed. The vertex embedding vectors of each part in the assembly-level graph structure are aggregated into the feature vectors of the parts, which serve as the initial features of the vertices of the assembly-level graph. The vertices of the assembly-level graph structure represent parts, and the edges represent potential kinematic pairs connecting the parts. The assembly-level graph structure is used to learn features and update the features of the vertices using a graph neural network. For each edge in the assembly-level graph structure, frame prediction of kinematic pairs is performed using part-level vertex features, and type prediction is performed using assembly-level vertex features; During model training, the model is trained by optimizing a loss function that incorporates expert knowledge, in order to simultaneously improve the accuracy of frame prediction and type prediction while avoiding physical constraint conflicts.
[0007] Optionally, for each edge in the assembly-level graph structure, performing frame prediction of the kinematic pair using part-level vertex features and type prediction using assembly-level vertex features includes: constructing a joint graph structure based on the part-level graph structures corresponding to the two parts connected by the edge; classifying and predicting the edges in the joint graph; determining the geometric element mating pair with the highest probability; and calculating the position and orientation of the local coordinate system frame of the kinematic pair based on the mating pair; and predicting the type of the kinematic pair corresponding to the edge based on the updated assembly-level graph vertex features.
[0008] Optionally, the extraction of features for each vertex includes extracting mesh features and extracting object features. The mesh features are obtained by sampling geometric faces or edges in the parameter space. For geometric faces, the sampling features include point coordinates, normal vectors, maximum curvature, minimum curvature, and trimming masks. For geometric edges, the sampling features include point coordinates, tangent vectors, and curvature. The object features are geometric attributes directly parsed from the boundary representation data. For geometric faces, these include area, face type, and orientation. For geometric edges, these include length, edge type, and orientation.
[0009] Optionally, the step of classifying and predicting edges in the joint graph to determine the geometric element pair with the highest probability includes: applying a graph attention mechanism to perform initial feature fusion and aggregating topological context information from the adjacent edges of the edge; splicing the updated vertex features and feeding them into a multilayer perceptron (MLP) to obtain a matching score; and determining the vertex pair associated with the edge with the highest matching score as the geometric element pair with the highest probability.
[0010] Optionally, obtaining the vertex embedding vector through the neural network model includes: performing layer normalization on the original feature vector of the vertex; inputting the normalized features into a gated linear unit to adaptively select the feature dimension important to the current prediction task; applying a Dropout operation to the output of the gated linear unit to randomly discard some features to prevent overfitting; and using the processed feature vector as the vertex embedding vector, inputting it into a subsequent graph neural network for feature aggregation.
[0011] Optionally, after all kinematic pairs are predicted, the following post-processing optimization steps are also included: traversing the predicted kinematic pairs, identifying and extracting potential kinematic chains in the assembly; for each kinematic chain, applying the Gribler-Kutta formula to calculate its total degrees of freedom, and detecting whether there are over-constraints or under-constraints; if constraint conflicts are detected, the prediction result with the lowest confidence among the conflicting kinematic chains is automatically corrected based on the prediction confidence of the kinematic pair type and the geometric fitting error.
[0012] Optionally, the step of training the model by optimizing the loss function that incorporates expert knowledge specifically involves: the optimized loss function includes frame prediction loss, type prediction loss, and redundant constraint loss. The redundant constraint loss is calculated based on the principles of multibody dynamics and is used to penalize constraint conflicts in the prediction of kinematic pairs. The calculation of the redundant constraint loss includes: calculating the total degrees of freedom of the mechanical system under the predicted kinematic pair constraints according to the Griebler-Kutta formula, and counting the number of redundant constraints for each part. The deviation between the total degrees of freedom of the system and the expected degrees of freedom is used as the loss value.
[0013] On the other hand, this application provides an automatic motion pair creation device, the device comprising: The acquisition module is used to acquire assembly data of the mechanical system, the assembly data including boundary representation data of each part; The first construction module is used to construct a part-level graph structure for each part based on its boundary representation data, extract the features of each vertex in the part-level graph structure, and obtain the embedding vector of the vertex through a neural network model. The vertices of the part-level graph structure represent the geometric faces and geometric edges of the part, and the edges represent the connection relationship between the geometric faces and geometric edges. The second construction module is used to construct an assembly-level graph structure based on the assembly data, and to aggregate the vertex embedding vectors of each part in the assembly-level graph structure into the feature vectors of the parts, which are used as the initial features of the vertices of the assembly-level graph. The vertices of the assembly-level graph structure represent parts, and the edges represent potential kinematic pairs between parts. The update module is used to perform feature learning on the assembly-level graph structure using a graph neural network and update the features of the vertices. The prediction module is used to perform frame prediction of kinematic pairs for each edge in the assembly-level graph structure using part-level vertex features, and to perform type prediction using assembly-level vertex features. The training module is used to train the model during the model training process by optimizing the loss function that incorporates expert knowledge, so as to simultaneously improve the accuracy of frame prediction and type prediction and avoid physical constraint conflicts.
[0014] Thirdly, this application provides an apparatus comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the technical solution of the above-described automatic motion pair creation method.
[0015] Fourthly, this application provides a storage medium storing a computer program, which, when executed by a processor, implements the steps of the above-described method for automatically creating motion pairs.
[0016] As can be seen from the technical solution provided in this application, on the one hand, by using a hierarchical graph structure (part-level graph and assembly-level graph) to represent the assembly, this method can naturally encode complex topological relationships within and between parts. Graph neural networks have a strong feature learning capability for unstructured graph data, and can capture deep features and implicit associations that are difficult to describe by traditional geometric rules, thereby enabling more accurate modeling and recognition of complex and diverse geometric shapes and assembly relationships, significantly improving the generalization ability of the method. On the other hand, by using a unified loss function for collaborative optimization of frame prediction and type prediction of kinematic pairs during model training, the two prediction tasks promote and constrain each other. This helps to avoid inconsistencies that may arise when frame and type are predicted as independent problems, thereby improving the internal consistency and accuracy of the kinematic pair creation results as a whole. Thirdly, by incorporating expert knowledge in the field of multibody dynamics into the loss function of model training in the form of redundant constraint loss, the optimization objective of the model not only pursues the numerical accuracy of the prediction, but also takes into account the physical rationality of the results. This method actively learns during training and avoids generating invalid constraint combinations that lead to over-constraint or motion lock-up of the mechanism. It directly outputs physically valid, interpretable, and engineering-compliant kinematic pair definitions, greatly improving the direct usability of the automated creation results and reducing the cost of subsequent manual verification and correction. In summary, the technical solution of this application, through the integration of hierarchical graph structures and expert knowledge, achieves coordinated and automated prediction of kinematic pair frames and types, effectively improving recognition accuracy, generalization ability, and engineering usability. Attached Figure Description
[0017] To more clearly illustrate the technical solutions in the embodiments of this application 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 this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0018] Figure 1 This is a flowchart of the automatic creation method for kinematic pairs provided in the embodiments of this application; Figure 2 This is a schematic diagram of the structure of the automatic motion pair creation device provided in the embodiments of this application; Figure 3 This is a schematic diagram of the device provided in the embodiments of this application. Detailed Implementation
[0019] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0020] In this specification, adjectives such as "first" and "second" are used only to distinguish one element or action from another, without necessarily requiring or implying any actual such relationship or order. Where circumstances permit, reference to an element or component or step (etc.) should not be construed as being limited to only one of the elements, components, or steps, but may be one or more of the elements, components, or steps, etc.
[0021] For ease of description, the dimensions of the various parts shown in the accompanying drawings are not drawn to actual scale.
[0022] Currently, creating kinematic pairs in industrial software primarily relies on two methods. The first is manual definition, where engineers manually select specific geometric features (e.g., faces, edges, points) of two components in a 3D interactive environment and specify the kinematic pair type and local coordinate system. For complex assemblies, this method is cumbersome, inefficient, and highly dependent on human experience, making it prone to oversights and constraint conflicts. The second method is automatic identification based on predefined geometric rules. For example, if two cylindrical surfaces satisfy the geometric condition of being coaxial and in contact, they are automatically identified as a revolute joint. However, this type of method relies on fixed, explicit geometric rules and has weak generalization ability and insufficient robustness for complex combinations of features, implicit constraints, or non-standard geometric shapes. With the development of artificial intelligence technology, some data-driven assembly relationship prediction schemes have emerged. However, these purely data-driven methods often simplify the problem to the matching and classification of geometric features, and their model training process lacks the integration and consideration of the basic principles of multibody dynamics. This leads to prediction results that may violate physical laws, producing invalid or conflicting constraints in motion, making them difficult to directly apply to engineering practices with extremely high requirements for accuracy and reliability.
[0023] To address the aforementioned problems in the prior art, this application proposes an automatic method for creating kinematic pairs, the flowchart of which is attached. Figure 1 As shown, the main steps include S101 to S106, which are detailed below: Step S101: Obtain the assembly data of the mechanical system, wherein the assembly data includes the boundary representation data of each part.
[0024] In mechanical CAD systems, assemblies typically consist of multiple parts, and the geometric information of each part needs to be stored in a machine-readable format. In existing technologies, assembly data often only contains basic triangular meshes or voxel representations, lacking sufficient semantic information (e.g., topological relationships of geometric faces and edges), making it difficult to accurately locate mating features during subsequent kinematic pair reasoning. To address this issue, this application employs the acquisition of assembly data from mechanical systems, where the assembly data includes boundary representation data for each part. Boundary representation (B-Rep) is a precise geometric representation that can completely describe the geometric faces, edges, and their connection relationships of parts, providing rich foundational data for subsequent graph structure construction. Specifically, during implementation, the B-Rep data of each part in the assembly can be exported through the API of CAD software (such as SolidWorks API or the OpenCASCADE library), including the parametric equations of faces, the curve equations of edges, and face-edge adjacency relationships. Through the above embodiments, the accuracy and completeness of the data source are ensured, laying the foundation for automated processing.
[0025] Step S102: For each part, construct a part-level graph structure based on its boundary representation data, extract the features of each vertex in the part-level graph structure, and obtain the vertex embedding vector through a neural network model. Here, the vertices of the part-level graph structure represent the geometric faces and geometric edges of the part, and the edges represent the connection relationship between the geometric faces and geometric edges.
[0026] If all the geometric faces or edges of the entire assembly are treated as a flat, large graph, the large number of parts in a complex assembly will cause the graph size to expand dramatically, resulting in high computational complexity and poor scalability. More importantly, it will mix in a large number of local geometric details that are unrelated to the definition of kinematic pairs, interfering with the model's focus on key assembly relationships. If the approach is to skip assembly-level relationship modeling and directly perform geometric feature matching between pairs of parts to predict kinematic pairs, the lack of assembly context information will make it impossible to distinguish connections that are geometrically similar but have different assembly roles. For example, the three ports of a tee fitting may have similar geometric features, but two of them may be fixed to other fittings, while the other may be connected to a movable part. Isolated matching cannot perceive this system-level functional difference, leading to misjudgment. Therefore, in order to solve the problem that the existing methods cannot effectively represent and utilize the system-level topological relationships between parts when dealing with complex assemblies, the technical solution adopted in this application is to construct a part-level graph structure based on its boundary expression data for each part, extract the features of each vertex in the part-level graph structure, and obtain the vertex embedding vector through a neural network model. Here, the vertices of the part-level graph structure represent the geometric faces and geometric edges of the part, and the edges represent the connection relationship between the geometric faces and geometric edges.
[0027] In the above embodiments, the extraction of features from each vertex in the part-level drawing structure mainly consists of two parts: extracting mesh features and extracting object features, as detailed below: 1) Extracting Mesh Features: Mesh features are obtained by sampling geometric faces or edges in the parameter space. For geometric faces, points are sampled uniformly in the parameter domain, and the coordinates, normal vector, maximum curvature, minimum curvature, and trim mask (used to identify whether the face has been trimmed) of each sampled point are calculated; for geometric edges, sampling is performed along the parameter lines to extract point coordinates, tangent vectors, and curvature.
[0028] 2) Extracting Object Features: Object features are geometric attributes directly parsed from boundary representation data. For geometric surfaces, these include area and surface type (e.g., plane, cylinder); for geometric edges, these include length and edge type (e.g., line, arc). These features are concatenated to form the original feature vector of the vertices.
[0029] The above embodiment obtains the vertex embedding vector through the neural network model, which can be achieved through the following steps S1021 to S1024: Step S1021: Perform layer normalization on the original feature vectors of the vertices to eliminate dimensional differences.
[0030] Step S1022: Input the normalized features into the gated linear unit (GLU), and its output is ,in, These are input features. It is the sigmoid function. This indicates element-wise multiplication, and GLU can adaptively select important feature dimensions.
[0031] Step S1023: Apply Dropout operation (where the dropout rate can be set to 0.1) to prevent overfitting.
[0032] Step S1024: Output vertex embedding vectors for subsequent aggregation.
[0033] Furthermore, the aggregation of the vertex embedding vectors of each part into the feature vector of that part is achieved through max pooling, that is, taking the maximum value of all vertex embedding vectors across all feature dimensions as the part feature vector. The max pooling formula is as follows: ,in, It is a vertex embedding vector. It is the set of all vertices of the part. This aggregation method can preserve the most significant geometric features of the part and enhance robustness.
[0034] As can be seen from step S102 of the above embodiment, by introducing hierarchical modeling from part level to assembly level, it is possible to achieve the desired results. Figure 1 The example method naturally encodes the compositional logic of mechanical systems. Assembly-level diagrams shift the focus of analysis from massive amounts of low-level geometric elements to the entities of parts and their connections, enabling the model to efficiently learn and infer system-level topological context information. This lays the foundation for accurately distinguishing functions and understanding kinematic chain relationships, significantly enhancing the method's ability to understand and generalize to complex assemblies.
[0035] Step S103: Based on the assembly data, construct an assembly-level graph structure, and aggregate the vertex embedding vectors of each part in the assembly-level graph structure into feature vectors of the parts, which serve as the initial features of the vertices of the assembly-level graph. Here, the vertices of the assembly-level graph structure represent parts, and the edges represent potential kinematic pairs connecting the parts.
[0036] At the assembly level, identifying kinematic pairs between parts is a key challenge. Existing methods often employ a global search of all part pairs, resulting in high computational overhead and susceptibility to interference from irrelevant parts. Therefore, this application first screens potential kinematic pairs; that is, before constructing the assembly-level graph structure, it also includes screening potential kinematic pairs, as detailed in steps S1031 to S1034, which are explained in detail below: Step S1031: Calculate the intersection of bounding boxes (e.g., oriented bounding boxes OBB) between any two parts. If the distance between the bounding boxes is less than a threshold, then filter out the pairs of parts that have a spatial proximity relationship.
[0037] Step S1032: For the selected part pairs, extract the point cloud data of their adjacent surface areas.
[0038] Step S1033: Using a lightweight point cloud attention network (based on the PointNet++ architecture), calculate the initial probability that there are effective kinematic pairs between the part pairs. The network outputs a scalar score, which is normalized to a probability using the sigmoid function.
[0039] Step S1034: Only for part pairs with an initial probability higher than a set threshold, establish corresponding edges in the assembly-level graph structure. This filtering significantly reduces the graph size and improves efficiency.
[0040] In the above embodiments, constructing the assembly-level graph structure can specifically involve using parts as vertices and filtered potential connections as edges. The vertex embedding vectors of each part are aggregated into the feature vector of that part, serving as the initial features of the vertices in the assembly-level graph (achieved through max pooling as described in step S102). This design ensures that the initial features of the assembly graph vertices already contain the geometric semantics of the parts, providing high-quality input for subsequent graph learning.
[0041] Step S104: Use a graph neural network to learn features of the assembly-level graph structure and update the features of the vertices.
[0042] Graph Neural Networks (GNNs) can aggregate neighborhood information, but traditional GNNs tend to oversmooth in motion pair prediction, losing local geometric details. This application employs a graph neural network to learn features from the assembly-level graph structure and update vertex features. Specifically, a Graph Attention Network (GAT) is used as the core model, and the update formula for each GAT layer is as follows: , in, It is the vertex i In the l Features of the layer It is attention weight, calculated by vertex i and vertex j Feature similarity is obtained. GAT can adaptively weight important neighbors and retain key information. Stack two layers of GAT with a hidden layer dimension of 64, and output the updated vertex features.
[0043] Step S104 combines part features with assembly topology through feature propagation of GNN, providing a context-aware representation for motion pair prediction.
[0044] Step S105: For each edge in the assembly-level graph structure, perform frame prediction of the kinematic pair using part-level vertex features, and perform type prediction using assembly-level vertex features.
[0045] For frame and type prediction of kinematic pairs, if the type is predicted first and then the frame is searched based on the type; or if the geometric mating pair (frame) is found first and then its type is determined, there is a risk of error accumulation. That is, errors in the preceding steps will directly lead to subsequent failures. For example, if the type is predicted incorrectly, the subsequent frame search based on the incorrect type will inevitably fail. Even if two independent models are used to predict separately and the results are simply combined, the drawback of this approach is that there is a lack of information interaction and constraints between the two tasks. The model cannot learn the inherent strong correlation of "what kind of kinematic pair type should be defined by what geometric features", which may lead to a mismatch between the predicted type and the degrees of freedom that the frame can achieve, resulting in invalid results that are physically and logically disconnected. To address the inconsistency and incompatibility in prediction results caused by treating kinematic pair frame (geometric implementation) prediction and type (functional definition) prediction as two isolated tasks, this application adopts a solution whereby, for each edge in the assembly-level graph structure, kinematic pair frame prediction is performed using part-level vertex features, and type prediction is performed using assembly-level vertex features. A unified optimization objective is used during model training to encourage the model to learn the deep correlation between these two tasks. This collaborative mechanism is equivalent to allowing the model to self-verify, ensuring that the geometric mating pairs found for the predicted kinematic pair types are reasonable and consistent, thereby significantly improving the internal consistency and physical reliability of the prediction results.
[0046] Specifically, as an embodiment of this application, for each edge in the assembly-level graph structure, the frame prediction of the kinematic pair is performed through the part-level vertex features, and the type prediction is performed through the assembly-level vertex features. This can be achieved through steps S1051 and S1052, as detailed below: Step S1051: Frame prediction: Based on the part-level drawing structure corresponding to the two parts connected by the edge, construct the joint drawing structure, perform fraction prediction on the edges in the joint drawing, determine the geometric element mating pair with the highest probability, and calculate the position and orientation of the local coordinate system frame of the kinematic pair based on the mating pair.
[0047] The core of frame prediction is to find the specific geometric element (e.g., face-to-face, edge-to-edge) mating relationships between two parts. Existing methods often traverse all possible mating pairs, resulting in high computational costs and susceptibility to noise. This sub-step improves efficiency by constructing a union graph structure, transforming the mating search into a graph-edge binary classification problem. The specific implementation includes constructing the union graph structure, classifying and predicting the edges in the union graph, determining the geometric element mating pair with the highest probability, and calculating the position and orientation of the local coordinate system frame of the kinematic pair based on this mating pair. A detailed explanation follows: 1. Construct the union graph structure: For an edge in the assembly-level drawing (representing a potential connection between two parts A and B), obtain its part-level graph structure. Merge the two part-level graphs into a union graph, where the vertices include all geometric faces and edge vertices of A and B, but initially, no cross-part edges are added. Then, add fully connected cross-part edges between the two parts in the union graph, connecting all pairs of geometric elements.
[0048] 2. Classify and predict the edges in the joint graph to determine the geometric element pair with the highest probability, including the following steps S1051a to S1051c: Step S1051a: Concatenate the two vertex features associated with each edge in the joint graph. For an edge spanning two parts, its connecting vertex features come from two parts, such as a face feature of part A and a face feature of part B.
[0049] Among them, cosine similarity captures feature directional similarity, and the formula is: Euclidean distance captures the feature space distance, and the formula is: .in, and It is a vertex embedding vector.
[0050] Step S1051b: Feed the cross-part edge features into a multilayer perceptron (MLP) for score prediction.
[0051] Step S1051c: Determine the vertex pair associated with the edge with the highest matching score as the geometric element pair with the highest probability, i.e., select... The corresponding geometric element pair (e.g., cylinder-cylinder) is the geometric element mating pair with the highest probability.
[0052] Specifically, steps S1051b and S1051c can be implemented by weighting and fusing the cosine similarity and Euclidean distance to obtain a preliminary matching score, using the following formula: Among them, weight and Based on empirical settings, for example, , , where is a normalization factor, and the initial score reflects geometric similarity. Based on the initial matching score, a graph attention mechanism is applied to aggregate topological context information from the adjacent edges of that edge to correct the initial matching score. This is to resolve local ambiguities: for example, a face may be adjacent to multiple faces simultaneously, but only a specific pair of matches is topologically valid. The graph attention mechanism calculates the attention weights of the current edge and its neighboring edges (edges that share vertices in the joint graph), using the formula: ,in, , and It is an edge feature. These are learnable vectors, and || denotes concatenation. The aggregated contextual features are used to refine the score. ,in, It is a weight matrix, which allows the prediction to take into account local topological consistency. Finally, choose... The corresponding geometric element pair (e.g., cylinder-cylinder) is the geometric element mating pair with the highest probability.
[0053] 3. Calculate the position and orientation of the local coordinate system frame of the kinematic pair based on the mating pair: extract the B-Rep objects of the two geometric elements in the mating pair, and resolve the origin and coordinate axis orientation of the frame.
[0054] In step S1051 of the above embodiment, the cooperation search is formalized into edge classification through a joint graph structure, and the topological context is introduced by using graph attention, which effectively reduces the mismatch rate and ensures the robustness of the frame prediction.
[0055] Step S1052: Type prediction: Based on the updated assembly-level graph vertex features, predict the type of the kinematic pair corresponding to the edge.
[0056] The classification of kinematic pairs directly affects the accuracy of multibody dynamics simulations. Traditional methods rely on manual rules or simple features, making it difficult to distinguish fine-grained types (such as revolute joints and cylindrical joints). This sub-step utilizes vertex features updated by a GNN, which encode part-level geometry and assembly-level topology information. Specifically, when predicting the type of kinematic pairs, a softmax function is used to perform multi-classification on the concatenated vertex features, outputting the probability distribution of the kinematic pair types, including revolute joints, prismatic joints, cylindrical joints, ball joints, planar joints, and fixed joints. The implementation process includes: For an edge in the assembly-level diagram, obtain the updated features of the two vertices (parts) it connects to. and .
[0057] Concatenate the features as Then input the fully connected layer and output the unnormalized score. .
[0058] Applying the softmax function: Where K=6 corresponds to six types of kinematic pairs. The type with the highest probability is the prediction result.
[0059] Step S106: During model training, the model is trained by optimizing the loss function that incorporates expert knowledge, so as to simultaneously optimize the accuracy of frame prediction and type prediction and avoid physical constraint conflicts.
[0060] To address the issue of purely data-driven models potentially producing predictions that violate fundamental principles of multibody dynamics (such as degrees of freedom and constraint non-conflict), i.e., the "physical irrationality" of the model, existing solutions rely solely on loss functions based on data fitting. This involves training the model using only frame prediction loss and type prediction loss (e.g., cross-entropy). However, such purely AI-driven methods lack physical logic verification and engineering physical constraints. The model only fits the geometric statistical regularities in the training data, failing to "understand" that the combination of kinematic pairs should constitute a movable mechanism. It may predict a geometrically matching set of results that could lead to mechanism jamming (over-constraint) or disintegration (under-constraint), resulting in poor engineering usability and requiring extensive manual post-processing. Therefore, this application trains the model by optimizing a loss function that incorporates expert knowledge during training, simultaneously improving the accuracy of frame and type predictions while avoiding physical constraint conflicts. By including expert knowledge reflecting multibody dynamics principles (such as redundant constraint loss) as part of the loss function, the constraints of physical laws are directly embedded into the model's optimization objective. This is equivalent to implanting a physics validator into the model learning process, guiding it not only to learn geometric matching but also to learn motion laws. This method can fundamentally improve the physical rationality and engineering usability of the model's predictions, making the output more likely to directly form an effective motion system. This reduces the cost of later manual corrections and achieves interpretable and engineering-compliant automatic creation.
[0061] In the above embodiments, the "model" in the model training process refers to the model that performs frame prediction and type prediction for kinematic pairs. The optimized loss function includes frame prediction loss, type prediction loss, and redundant constraint loss. The redundant constraint loss is calculated based on multibody dynamics principles and is used to penalize constraint conflicts in kinematic pair prediction. The total loss function is:
[0062] in, , and These are weighting coefficients, whose initial values can be set to 1.0, 1.0, and 0.5 based on experience, to balance different tasks.
[0063] Type Prediction Loss : Use multi-class cross-entropy loss, the formula is as follows ,in, It's a one-hot real label. It is a predicted probability.
[0064] Frame Predicted Loss For frame prediction, a binary classification cross-entropy loss is used. Cross-part edges that do not produce a fit are marked as 0, and those that do are marked as 1. Frame prediction loss. The calculation formula is: ,in, Indicates the first i The labels for each sample (i.e., across the edge of the part) are 1 for positive and 0 for negative. Indicates the first i The probability that a sample is predicted to be the negative class.
[0065] Redundancy constraint loss This is the core of incorporating expert knowledge, and it can be calculated based on the principles of multibody dynamics. Specifically, it calculates the total degrees of freedom of the mechanical system under predicted kinematic pair constraints using the Grübler-Kutzbach criterion, and counts the number of redundant constraints for each part. The deviation between the total degrees of freedom and the expected degrees of freedom is used as the loss value. Here, the Grübler-Kutzbach criterion is... ,in, F It is the total degrees of freedom of the system. N It is the number of parts. J It is the number of kinematic pairs. It is the first i The number of constraints on a kinematic pair; for example, a revolute joint has 5 degrees of freedom. Desired degrees of freedom. Determined by design intent, for example, a robotic arm should have 6 degrees of freedom. The loss is calculated as follows: ,in, It is a part i The number of redundant constraints, for example, a part being over-constrained by multiple kinematic pairs. It is the weight (e.g., =0.1). This loss penalizes physically unreasonable predictions and guides the model to converge toward a feasible solution.
[0066] In addition, the redundant constraint loss is dynamically weighted during training to avoid training instability as follows: In the early stages of training, a small initial weight is set for the redundant constraint loss (e.g., ...). =0.1), allowing the model to initially focus on accuracy; as training progresses, dynamically monitor the occurrence rate of constraint conflicts in the prediction results on the validation set, for example, calculating the conflict ratio every 5 epochs; when the constraint conflict occurrence rate does not decrease over multiple consecutive training epochs, gradually increase the weight of the redundant constraint loss (e.g., increase by 0.1 each time) to strengthen the physical constraints; in the later stages of training, when prediction accuracy and physical plausibility reach a balance, fix the weight of the redundant constraint loss, for example, finally =0.5. This dynamic adjustment ensures training smoothness and final performance.
[0067] After completing the prediction of all kinematic pairs, post-processing optimization of the prediction results is also included. This is because, although the training loss incorporates physical knowledge, local conflicts may still exist in a single prediction, requiring post-processing optimization. Traditional methods rely on manual correction, which is inefficient. This application improves reliability through automated post-processing, specifically including: The predicted kinematic pairs are traversed to identify and extract potential kinematic chains in the assembly: graph traversal algorithms, such as depth-first search, are used to extract connected subgraphs from the assembly-level graph structure as kinematic chains. For example, a robotic arm can be extracted as a kinematic chain from the base to the end effector.
[0068] For each kinematic chain, the Gribler-Kutta formula is applied to calculate its total degrees of freedom, and the existence of over-constraints or under-constraints is checked: over-constraints refer to... This could lead to institutional stagnation; under-constraint refers to... This leads to uncertainty, so the detection threshold is set to a degree of freedom deviation greater than 0.5.
[0069] If a constraint conflict is detected, the prediction with the lowest confidence in the conflicting kinematic chain is automatically corrected based on the prediction confidence of the kinematic pair type and the geometric fitting error. For example, for over-constrained chains, the confidence score of each kinematic pair is calculated. ,in, It is the type prediction probability. This refers to the frame fitting error. The kinematic pairs with the lowest confidence are selected, their type is corrected to fixed pairs (reducing degrees of freedom) or they are deleted, and then the degrees of freedom are recalculated, iterating until the conflict is resolved. This post-processing ensures the physical plausibility of the final output.
[0070] From the above appendix Figure 1The example of the automatic kinematic pair creation method demonstrates several advantages. First, by employing a hierarchical graph structure (part-level and assembly-level graphs) to represent assemblies, this method naturally encodes complex topological relationships within and between parts. Graph neural networks possess powerful feature learning capabilities for unstructured graph data, capturing deep features and implicit associations that are difficult to describe using traditional geometric rules. This allows for more accurate modeling and identification of complex and diverse geometric shapes and assembly relationships, significantly improving the method's generalization ability. Second, by using a unified loss function for collaborative optimization of frame and type prediction of kinematic pairs during model training, the two prediction tasks mutually promote and constrain each other. This helps avoid inconsistencies that may arise when predicting frame and type as independent problems, thereby improving the overall internal consistency and accuracy of the kinematic pair creation results. Third, by incorporating expert knowledge from the field of multibody dynamics into the model training loss function in the form of redundant constraint loss, the model's optimization objective not only pursues numerical accuracy but also considers the physical rationality of the results. This method actively learns during training and avoids generating invalid constraint combinations that lead to over-constraint or motion lock-up of the mechanism. It directly outputs physically valid, interpretable, and engineering-compliant kinematic pair definitions, greatly improving the direct usability of the automated creation results and reducing the cost of subsequent manual verification and correction. In summary, the technical solution of this application, through the integration of hierarchical graph structures and expert knowledge, achieves coordinated and automated prediction of kinematic pair frames and types, effectively improving recognition accuracy, generalization ability, and engineering usability.
[0071] Please see the appendix Figure 2 This application provides an automatic motion pair creation device, which may include an acquisition module 201, a first construction module 202, a second construction module 203, an update module 204, a prediction module 205, and a training module 206, as detailed below: The acquisition module 201 is used to acquire assembly data of the mechanical system, wherein the assembly data includes boundary representation data of each part; The first construction module 202 is used to construct a part-level graph structure based on its boundary expression data for each part, extract the features of each vertex in the part-level graph structure, and obtain the embedding vector of the vertex through a neural network model. The vertices of the part-level graph structure represent the geometric faces and geometric edges of the part, and the edges represent the connection relationship between the geometric faces and geometric edges. The second construction module 203 is used to construct an assembly-level graph structure based on assembly data, and to aggregate the vertex embedding vectors of each part in the assembly-level graph structure into feature vectors of the parts, which are used as the initial features of the vertices of the assembly-level graph. Here, the vertices of the assembly-level graph structure represent parts, and the edges represent potential kinematic pairs between parts. Update module 204 is used to perform feature learning on the assembly-level graph structure using a graph neural network and update the features of the vertices. Prediction module 205 is used to perform frame prediction of kinematic pairs for each edge in the assembly-level graph structure using part-level vertex features, and to perform type prediction using assembly-level vertex features. Training module 206 is used to train the model during the model training process by optimizing the loss function that incorporates expert knowledge, so as to simultaneously optimize the accuracy of frame prediction and type prediction and avoid physical constraint conflicts.
[0072] From the above appendix Figure 2 As demonstrated by the example of the automatic kinematic pair creation device, on the one hand, by employing a hierarchical graph structure (part-level and assembly-level graphs) to represent assemblies, this method can naturally encode complex topological relationships within and between parts. Graph neural networks possess powerful feature learning capabilities for unstructured graph data, capturing deep features and implicit associations that are difficult to describe using traditional geometric rules. This allows for more accurate modeling and identification of complex and diverse geometric shapes and assembly relationships, significantly improving the method's generalization ability. On the other hand, by using a unified loss function for collaborative optimization of frame prediction and type prediction of kinematic pairs during model training, the two prediction tasks mutually promote and constrain each other. This helps avoid inconsistencies that may arise when predicting frame and type as independent problems, thereby improving the overall internal consistency and accuracy of the kinematic pair creation results. Thirdly, by incorporating expert knowledge from the field of multibody dynamics into the model training loss function in the form of redundant constraint loss, the model's optimization objective not only pursues numerical accuracy of predictions but also considers the physical rationality of the results. This method actively learns during training and avoids generating invalid constraint combinations that lead to over-constraint or motion lock-up of the mechanism. It directly outputs physically valid, interpretable, and engineering-compliant kinematic pair definitions, greatly improving the direct usability of the automated creation results and reducing the cost of subsequent manual verification and correction. In summary, the technical solution of this application, through the integration of hierarchical graph structures and expert knowledge, achieves coordinated and automated prediction of kinematic pair frames and types, effectively improving recognition accuracy, generalization ability, and engineering usability.
[0073] Figure 3 This is a schematic diagram of the structure of a device provided in one embodiment of this application. For example... Figure 3 As shown, the device 3 in this embodiment mainly includes: a processor 30, a memory 31, and a computer program 32 stored in the memory 31 and executable on the processor 30, such as a program for an automatic motion pair creation method. When the processor 30 executes the computer program 32, it implements the steps in the above-described automatic motion pair creation method embodiment, for example... Figure 1The steps S101 to S106 are shown. Alternatively, when the processor 30 executes the computer program 32, it implements the functions of each module / unit in the above-described device embodiments, for example... Figure 2 The functions of the acquisition module 201, the first construction module 202, the second construction module 203, the update module 204, the prediction module 205, and the training module 206 are shown.
[0074] For example, the computer program 32 of the automatic kinematic pair creation method mainly includes: acquiring assembly data of a mechanical system, wherein the assembly data includes boundary representation data of each part; for each part, constructing a part-level graph structure based on its boundary representation data, extracting features of each vertex in the part-level graph structure, and obtaining the vertex embedding vector through a neural network model, wherein the vertices of the part-level graph structure represent the geometric faces and edges of the part, and the edges represent the connection relationship between the geometric faces and the geometric edges; based on the assembly data, constructing an assembly-level graph structure, aggregating the vertex embedding vectors of each part in the assembly-level graph structure into feature vectors of the part, as the initial features of the vertices of the assembly-level graph, wherein the vertices of the assembly-level graph structure represent parts, and the edges represent potential kinematic pair connections between parts; using a graph neural network to perform feature learning on the assembly-level graph structure and update the vertex features; for each edge in the assembly-level graph structure, performing frame prediction of the kinematic pair through the part-level vertex features, and performing type prediction through the assembly-level vertex features; during model training, training the model by optimizing a loss function that incorporates expert knowledge, so as to simultaneously optimize the accuracy of frame prediction and type prediction and avoid physical constraint conflicts. The computer program 32 can be divided into one or more modules / units, which are stored in the memory 31 and executed by the processor 30 to complete this application. The one or more modules / units can be a series of computer program instruction segments capable of performing a specific function, which describe the execution process of the computer program 32 in the device 3.For example, computer program 32 can be divided into the functions of an acquisition module 201, a first construction module 202, a second construction module 203, an update module 204, a prediction module 205, and a training module 206 (a module in the virtual device). The specific functions of each module are as follows: the acquisition module 201 is used to acquire assembly data of the mechanical system, wherein the assembly data includes boundary representation data of each part; the first construction module 202 is used to construct a part-level graph structure based on its boundary representation data for each part, extract the features of each vertex in the part-level graph structure, and obtain the vertex embedding vector through a neural network model, wherein the vertices of the part-level graph structure represent the geometric faces and geometric edges of the part, and the edges represent the connection relationship between the geometric faces and geometric edges; the second construction module 203 is used to... The assembly-level graph structure is constructed using ligand data. The vertex embedding vectors of each part in the assembly-level graph structure are aggregated into feature vectors of the parts, serving as the initial features of the vertices in the assembly-level graph. Here, vertices in the assembly-level graph structure represent parts, and edges represent potential kinematic pairs connecting parts. The update module 204 is used to learn features from the assembly-level graph structure using a graph neural network to update the vertex features. The prediction module 205 is used to perform frame prediction of kinematic pairs for each edge in the assembly-level graph structure using part-level vertex features, and type prediction using assembly-level vertex features. The training module 206 is used to train the model during model training by optimizing a loss function that incorporates expert knowledge, so as to simultaneously optimize the accuracy of frame prediction and type prediction and avoid physical constraint conflicts.
[0075] Device 3 may include, but is not limited to, processor 30 and memory 31. Those skilled in the art will understand that... Figure 3 This is merely an example of device 3 and does not constitute a limitation on device 3. It may include more or fewer components than shown, or combine certain components, or different components. For example, the device may also include input / output devices, network access devices, buses, etc.
[0076] The processor 30 may be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor.
[0077] The memory 31 can be an internal storage unit of the device 3, such as a hard disk or RAM of the device 3. The memory 31 can also be an external storage device of the device 3, such as a plug-in hard disk, Smart MediaCard (SMC), Secure Digital (SD) card, or Flash Card equipped on the device 3. Furthermore, the memory 31 can include both internal and external storage units of the device 3. The memory 31 is used to store computer programs and other programs and data required by the device. The memory 31 can also be used to temporarily store data that has been output or will be output.
[0078] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is merely an example. In practical applications, the above functions can be assigned to different functional units and modules as needed. That is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit. Furthermore, the specific names of the functional units and modules are only for easy differentiation and are not intended to limit the scope of protection of this application. The specific working process of the units and modules in the above-described device can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0079] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail or recorded in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0080] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0081] In the embodiments provided in this application, it should be understood that the disclosed apparatus / device and method can be implemented in other ways. For example, the apparatus / device embodiments described above are merely illustrative. For instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another device, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.
[0082] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0083] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0084] If integrated modules / units are implemented as software functional units and sold or used as independent products, they can be stored in a storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments of this application can also be implemented by a computer program instructing related hardware. The computer program for the automatic creation method of kinematic pairs can be stored in a storage medium. When the computer program is executed by a processor, it can implement the steps of the above method embodiments, namely, acquiring assembly data of the mechanical system, wherein the assembly data includes boundary expression data of each part; for each part, constructing a part-level graph structure based on its boundary expression data, extracting the features of each vertex in the part-level graph structure, and obtaining the vertex embedding vector through a neural network model, wherein the vertices of the part-level graph structure represent the geometric surfaces and geometric edges of the part, and the edges represent the distance between the geometric surfaces and geometric edges. Connection relationships; based on assembly data, an assembly-level graph structure is constructed. The vertex embedding vectors of each part in the assembly-level graph structure are aggregated into feature vectors of the parts, serving as the initial features of the vertices in the assembly-level graph. Vertices in the assembly-level graph structure represent parts, and edges represent potential kinematic pairs connecting parts. A graph neural network is used to learn features from the assembly-level graph structure and update the vertex features. For each edge in the assembly-level graph structure, frame prediction of kinematic pairs is performed using part-level vertex features, and type prediction is performed using assembly-level vertex features. During model training, the model is trained by optimizing a loss function that incorporates expert knowledge to simultaneously optimize the accuracy of frame prediction and type prediction while avoiding physical constraint conflicts. The computer program includes computer program code, which can be in source code form, object code form, executable files, or some intermediate form. Storage media can include: any entity or device capable of carrying computer program code, recording media, USB flash drives, portable hard drives, magnetic disks, optical disks, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media, etc. It should be noted that the contents of storage media can be appropriately added to or removed according to the requirements of legislation and patent practice in a jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, storage media may not include electrical carrier signals and telecommunication signals.
[0085] The above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. These modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be included within the protection scope of this application. The specific embodiments described above further illustrate the purpose, technical solutions, and beneficial effects of this application. It should be understood that the above descriptions are merely specific embodiments of this application and are not intended to limit the protection scope of this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.
Claims
1. A method for automatically creating kinematic pairs, characterized in that, The method includes: Acquire assembly data of the mechanical system, wherein the assembly data includes boundary representation data of each part; For each part, a part-level graph structure is constructed based on its boundary representation data. Features of each vertex in the part-level graph structure are extracted, and the embedding vector of the vertex is obtained through a neural network model. The vertices of the part-level graph structure represent the geometric faces and geometric edges of the part, and the edges represent the connection relationship between the geometric faces and geometric edges. Based on the assembly data, an assembly-level graph structure is constructed. The vertex embedding vectors of each part in the assembly-level graph structure are aggregated into the feature vectors of the parts, which serve as the initial features of the vertices of the assembly-level graph. The vertices of the assembly-level graph structure represent parts, and the edges represent potential kinematic pairs connecting the parts. The assembly-level graph structure is used to learn features and update the features of the vertices using a graph neural network. For each edge in the assembly-level graph structure, frame prediction of kinematic pairs is performed using part-level vertex features, and type prediction is performed using assembly-level vertex features; During model training, the model is trained by optimizing a loss function that incorporates expert knowledge, in order to simultaneously improve the accuracy of frame prediction and type prediction while avoiding physical constraint conflicts.
2. The method for automatically creating kinematic pairs according to claim 1, characterized in that, For each edge in the assembly-level graph structure, the process of performing frame prediction of kinematic pairs using part-level vertex features and type prediction using assembly-level vertex features includes: Based on the part-level diagram structure corresponding to the two parts connected by the edge, a joint diagram structure is constructed. The edges in the joint diagram are classified and predicted to determine the geometric element mating pair with the highest probability. The position and orientation of the local coordinate system frame of the kinematic pair are calculated based on the mating pair. Based on the updated assembly-level graph vertex features, predict the type of kinematic pair corresponding to the edge.
3. The method for automatically creating kinematic pairs according to claim 1, characterized in that, The extraction of features for each vertex includes extracting mesh features and extracting object features. The mesh features are obtained by sampling geometric faces or edges in the parameter space. For geometric faces, the sampling features include point coordinates, normal vectors, maximum curvature, minimum curvature, and trimming masks. For geometric edges, the sampling features include point coordinates, tangent vectors, and curvature. The object features are geometric attributes directly parsed from the boundary representation data. For geometric faces, these include area, face type, and orientation. For geometric edges, these include length, edge type, and orientation.
4. The method for automatically creating kinematic pairs according to claim 2, characterized in that, The process of classifying and predicting edges in the joint graph to determine the geometric element pair with the highest probability includes: The graph attention mechanism is applied to perform initial feature fusion, aggregating topological context information from the adjacent edges of the edge; The updated vertex features are concatenated and fed into a multilayer perceptron (MLP) to obtain a matching score. The vertex pair associated with the edge with the highest matching score is determined as the geometric element pair with the highest probability.
5. The method for automatically creating kinematic pairs according to claim 1, characterized in that, The embedding vectors of the vertices obtained through the neural network model include: The original feature vectors of the vertices are subjected to layer normalization. The normalized features are input into a gated linear unit to adaptively select the feature dimensions that are important to the current prediction task. The output of the gated linear unit is subjected to a Dropout operation to randomly discard some features to prevent overfitting; The processed feature vectors are used as vertex embedding vectors and input into the subsequent graph neural network for feature aggregation.
6. The method for automatically creating kinematic pairs according to claim 1, characterized in that, After all kinematic pairs are predicted, the following post-processing optimization steps are also included to improve the prediction results: Traverse the predicted kinematic pairs and identify and extract potential kinematic chains in the assembly; For each kinematic chain, the Gribler-Kutta formula is applied to calculate its total degrees of freedom, and the presence of over-constraints or under-constraints is detected. If a constraint conflict is detected, the prediction result with the lowest confidence in the conflicting kinematic chain is automatically corrected based on the prediction confidence of the kinematic pair type and the geometric fitting error.
7. The method for automatically creating kinematic pairs according to claim 1, characterized in that, The method of training the model by optimizing the loss function that incorporates expert knowledge specifically involves the following: the optimized loss function includes frame prediction loss, type prediction loss, and redundant constraint loss. The redundant constraint loss is calculated based on the principle of multibody dynamics and is used to penalize constraint conflicts in the prediction of kinematic pairs. The calculation of the redundant constraint loss includes: calculating the total degree of freedom of the mechanical system under the predicted kinematic pair constraints according to the Gribler-Kutta formula, counting the number of redundant constraints for each part, and taking the deviation between the total degree of freedom of the system and the expected degree of freedom as the loss value.
8. An automatic motion pair creation device, characterized in that, The device includes: The acquisition module is used to acquire assembly data of the mechanical system, the assembly data including boundary representation data of each part; The first construction module is used to construct a part-level graph structure for each part based on its boundary representation data, extract the features of each vertex in the part-level graph structure, and obtain the embedding vector of the vertex through a neural network model. The vertices of the part-level graph structure represent the geometric faces and geometric edges of the part, and the edges represent the connection relationship between the geometric faces and geometric edges. The second construction module is used to construct an assembly-level graph structure based on the assembly data, and to aggregate the vertex embedding vectors of each part in the assembly-level graph structure into the feature vectors of the parts, which are used as the initial features of the vertices of the assembly-level graph. The vertices of the assembly-level graph structure represent parts, and the edges represent potential kinematic pairs between parts. The update module is used to perform feature learning on the assembly-level graph structure using a graph neural network and update the features of the vertices. The prediction module is used to perform frame prediction of kinematic pairs for each edge in the assembly-level graph structure using part-level vertex features, and to perform type prediction using assembly-level vertex features. The training module is used to train the model during the model training process by optimizing the loss function that incorporates expert knowledge, so as to simultaneously improve the accuracy of frame prediction and type prediction and avoid physical constraint conflicts.
9. An apparatus comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the method as described in any one of claims 1 to 7.
10. A storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method as described in any one of claims 1 to 7.