Assembly sequence planning method based on priority graph
By constructing the assembly sequence information priority graph and using depth-first search and greedy selection strategies, the problem of long running time of the existing assembly sequence planning algorithm is solved, and an efficient assembly sequence planning method is realized.
Patent Information
- Application Number
- CN202311443107.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-31
- Publication Date
- 2025-05-02
AI Technical Summary
The existing assembly sequence planning algorithm has the problem of multiple solutions that are not unique and have a long run time, which is difficult to be widely used in engineering practice.
Using the assembly sequence planning method based on priority graphs, the assembly sequence information priority graph of the product is constructed, the ring is detected using the depth-first search algorithm and the ring is organized as a sub-level, and the assembly sequence planning is carried out in combination with the greedy selection strategy.
It improves the efficiency of assembly sequence planning, reduces the time complexity to O(n+m), and achieves a better assembly sequence through greedy selection strategies, which is suitable for practical engineering applications.
Smart Images

Figure CN119918824A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the field of assembly sequence planning, and in particular to an assembly sequence planning method based on a priority graph. Background Art
[0002] The assembly sequence is a description of the product assembly process and is the basis for process personnel to determine the parts assembly method and select assembly tooling and equipment. A good assembly sequence can effectively reduce the complexity of assembly, reduce the frequency of assembly resource replacement, improve the reliability of the assembly process, and ultimately shorten the assembly time and improve the efficiency of product assembly while ensuring the feasibility of the product parts assembly process.
[0003] However, the current research on assembly sequence planning algorithms is limited to considering product interference or process priority, and determining the assembly sequence of products with the optimization goal of reducing the complexity of the assembly process during the assembly process. Most algorithms are improvements on heuristic algorithms, and the multiple solutions are not unique and the running time is long, which leads to the fact that the algorithms are rarely used in engineering practice. Summary of the invention
[0004] The invention aims at solving the problems of non-unique multiple solutions and long running time in existing algorithms and provides an assembly sequence planning method based on a priority graph.
[0005] The technical solution adopted by the present invention to achieve the above-mentioned purpose is:
[0006] An assembly sequence planning method based on a precedence graph comprises the following steps:
[0007] 1) Obtain product assembly information and construct a product assembly sequence information priority graph;
[0008] 2) Use the depth-first search algorithm to detect whether the assembly sequence information priority graph contains a loop. If there is a loop, organize all loops into sub-level assemblies and execute step 3); otherwise, directly execute step 3);
[0009] 3) Perform assembly sequence planning for assemblies at each level in the assembly sequence information priority diagram respectively;
[0010] 4) Combine the assembly sequences of assemblies at each level to obtain the assembly sequence of the product.
[0011] The product assembly sequence information priority graph is a directed graph data structure, with the parts information in the product assembly information as nodes and the priority relationship of the product assembly as edges.
[0012] The method of using a depth-first search algorithm to detect whether a cycle is contained in the assembly sequence information priority graph comprises the following steps:
[0013] Select any vertex in the assembly sequence information priority graph as the initial vertex V;
[0014] Starting from the unvisited adjacent points of V, perform depth-first traversal of the priority graph level by level until all vertices in the priority graph that have paths connected to V are visited;
[0015] If there are still vertices in the priority graph that have not been visited at this time, start from this point and perform depth-first traversal again, repeating this step until all vertices in the priority graph have been visited. If a node has been visited twice during the visit process, there is a cycle in the priority graph.
[0016] The step 3) comprises the following steps:
[0017] 3.1) Traverse all nodes in the assembly sequence information priority graph and count the in-degree of each node, where the in-degree represents the number of direct predecessor nodes of a node;
[0018] 3.2) Add the nodes with zero in-degree to the array to be sorted;
[0019] 3.3) Select a part from the array to be sorted as the basic part and add it to the sequence queue;
[0020] 3.4) Use the greedy selection strategy to select the next best node from the array to be sorted, add it to the sequence queue, and delete the node from the array to be sorted. The in-degree of its successor node is reduced by one.
[0021] 3.5) If there is a node whose successor node has zero in-degree, add the node to the array to be sorted;
[0022] 3.6) If the array to be arranged is not empty, execute step 3.4), otherwise, output the nodes in the sequence queue as the assembly sequence of the assembly.
[0023] The method of selecting the next optimal node from the array to be sorted using a greedy selection strategy includes the following steps:
[0024] Determine whether the assembly direction of the next part to be arranged is consistent with the last part in the sequence queue. If they are consistent, the assembly direction coefficient D = 0, otherwise D = 1;
[0025] Determine whether the assembly tool of the next part to be arranged is consistent with the last part in the sequence queue. If it is consistent, the assembly tool coefficient T = 0, otherwise T = 1;
[0026] Calculate the local objective function g(i) of each part in the array to be sorted:
[0027] g(i)=w1D+w2T
[0028] Among them, w1 and w2 represent the assembly direction weight and assembly tool weight respectively;
[0029] The part with the smallest local objective function value is selected as the optimal node.
[0030] An assembly sequence planning system based on a precedence graph comprises:
[0031] An assembly sequence information priority graph construction module is used to obtain product assembly information and construct an assembly sequence information priority graph of the product;
[0032] The assembly sequence information priority graph detection module is used to detect whether the assembly sequence information priority graph contains a loop using a depth-first search algorithm. If there is a loop, all loops are organized into sub-level assemblies.
[0033] The product assembly sequence planning module is used to plan the assembly sequence of each level of the assembly in the assembly sequence information priority diagram, merge the assembly sequences of the assemblies at each level, and obtain the assembly sequence of the product.
[0034] The assembly sequence information priority graph detection module includes:
[0035] A vertex selection module is used to select any vertex in the assembly sequence information priority graph as the initial vertex V;
[0036] The depth-first traversal module is used to start from the unvisited adjacent points of V and perform depth-first traversal on the priority graph step by step until all vertices in the priority graph that have paths connected to V are visited. If there are still vertices in the priority graph that have not been visited at this time, start from this point and perform depth-first traversal again. Repeat this step until all vertices in the priority graph have been visited. If a node is visited twice during the visit process, there is a cycle in the priority graph.
[0037] The product assembly sequence planning module includes:
[0038] The module for constructing the array to be sorted is used to traverse all nodes in the assembly sequence information priority graph, count the in-degree of each node, where the in-degree represents the number of direct predecessor nodes of a node, and add nodes with zero in-degree to the array to be sorted;
[0039] The sequence queue construction module is used to select a part in the array to be arranged as the basic part, add it to the sequence queue, use the greedy selection strategy to select the next optimal node from the array to be arranged, add it to the sequence queue, and delete the node from the array to be arranged. The in-degree of its successor node is reduced by one. If there is a node whose successor node in-degree is zero, the node is added to the array to be arranged. If the array to be arranged is not empty, the optimal node is selected again. Otherwise, the nodes in the sequence queue are output as the assembly sequence of the assembly.
[0040] The present invention has the following beneficial effects and advantages:
[0041] In terms of time complexity, in the main method of the present invention, if there are n parts, n loops are required, so the time required to build the sequence queue is O(n). Each part enters the sequence queue and is scanned once, and then its subsequent driving parts are scanned, so each priority relationship is only scanned once. If there are m priority relationships, the time complexity is O(m). Finally, the total time complexity is O(n+m). While other heuristic algorithms require multiple solutions and a large number of iterations, the solution efficiency of this method is very high in comparison. In terms of the quality of the solution, the greedy selection strategy of the method can select the optimal parts in a targeted manner. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] Figure 1 A flowchart for implementing an assembly sequence planning method based on a priority graph provided by the present invention;
[0043] Figure 2 An assembly priority graph of an assembly sequence planning method embodiment 1 based on a priority graph provided by the present invention;
[0044] Figure 3 A subassembly identification diagram of an assembly sequence planning method embodiment 1 based on a priority diagram provided by the present invention;
[0045] Figure 4 An assembly hierarchy diagram of an assembly sequence planning method embodiment 1 based on a priority diagram provided by the present invention;
[0046] Figure 5 A sorting diagram illustrating an assembly sequence planning method embodiment 1 based on a priority graph provided by the present invention;
[0047] Figure 6 A simplified model diagram of an assembly sequence planning method embodiment 2 based on a priority graph provided by the present invention;
[0048] Figure 7 An assembly priority graph of embodiment 2 of an assembly sequence planning method based on a priority graph provided by the present invention. DETAILED DESCRIPTION
[0049] The present invention is further described in detail below in conjunction with the accompanying drawings and embodiments.
[0050] An assembly sequence planning method based on a priority graph, the method comprising:
[0051] Use a new data structure - product assembly priority graph to model the product; identify the subassemblies of the product to form the product assembly hierarchy; write a faster assembly sequence planning algorithm; set a greedy selection strategy in the algorithm to obtain a better assembly sequence.
[0052] The specific steps include:
[0053] Step 101, input assembly information of the product and model the assembly sequence information of the product;
[0054] Step 102, depth-first search whether the directed graph data structure contains a cycle. If the directed graph contains a cycle, all the cycles are organized into assembly levels, and then step 103 is entered. If there is no cycle in the directed graph, step 103 is entered.
[0055] Step 103 , performing assembly sequence planning on the directed graphs of (sub)assemblies at each level.
[0056] Step 104 , merging the assembly sequences of the subassemblies at each level, and outputting the assembly sequence of the product.
[0057] In step 101, the assembly information of the product is input and modeled. The parts are modeled as nodes in a directed graph data structure, the information of the parts is modeled as node information in the directed graph data structure, and the priority relationship is modeled as an edge in the directed graph data structure. The process includes:
[0058] Step 10101, input product part information. The input format is part number assembly tool assembly direction. For example, 1T1+X means that the first part is assembled using tool T1 along assembly direction +X.
[0059] Step 10102, input product part priority information. The input format is<p,q> (p and q represent part numbers), it means that the pth part is assembled before the qth part. For example, <1,2> means that the 1st part is assembled before the 2nd part.
[0060] Step 10103, using the linked list to create the assembly priority graph sub-function CreatePPGraph (PPGraph*G), can read the information of the above steps 10101 and 10102 into the memory to facilitate subsequent calculations.
[0061] In step 102, the directed graph data structure is deeply searched to see whether it contains a loop and constitutes an assembly level. Depth-first search is a classic algorithm in graph theory. The depth-first search algorithm can be used to generate a corresponding topological sorting table of the target graph and then find out whether there is a loop. The steps are as follows:
[0062] Step 10201, access the initial vertex v;
[0063] Step 10202, starting from the unvisited adjacent points of v, perform depth-first traversal of the graph until all vertices in the graph that have paths connecting to v are visited;
[0064] Step 10203: If there are still vertices in the graph that have not been visited, start from an unvisited vertex and re-perform depth-first traversal until all vertices in the graph have been visited. If a node is visited twice during the visit process, a cycle exists.
[0065] This method assists process personnel in finding the loop. The process information represented by the loop is the concept of sub-assembly, and the parts replaced by the loop are the parts of the sub-assembly.
[0066] In step 103, assembly sequence planning is performed on the directed graph of each (sub)assembly, and the process includes:
[0067] Step 10301, traverse each node in the assembly priority graph and count the in-degree of each node. The in-degree represents the number of direct predecessor nodes of the node. For example, <1,2> means that the first part is the direct predecessor of the second part.
[0068] Step 10302, add the nodes with in-degree 0 to the array to be sorted.
[0069] Step 10303, the process planner selects a part from the array to be arranged as a basic part and adds it to the queue sequence.
[0070] Step 10304: greedily select the next best node from the array to be sorted and add it to the queue sequence. The node is deleted from the array to be sorted, and the in-degree of its successor node is reduced by 1.
[0071] Step 10305: If there is a successor node with an in-degree of 0, add the node to the array to be sorted.
[0072] Step 10306, determine whether the array to be sorted is empty, if yes, execute step 10304; if no, execute step 10307.
[0073] Step 10307, the nodes in the output queue sequence are the assembly sequence of the assembly.
[0074] The greedy selection strategy in step 10304 is as follows:
[0075] Determine whether the assembly direction of the next part to be arranged is consistent with the last part in the sequence queue. If they are consistent, D=0; if they are inconsistent, D=1.
[0076] Determine whether the assembly tool of the next part to be arranged is consistent with the last part in the sequence queue. If they are consistent, T=0; if not, T=1.
[0077] Calculate the values of D and T for all the parts in the array to be arranged. Calculate g(i) = w1D + w2T, where w1 and w2 represent the weights of the assembly direction and assembly tool respectively. The determination of w1 and w2 needs to be considered based on the actual situation.
[0078] Select the part with the smallest local objective function value.
[0079] Example 1
[0080] Embodiment 1 provided by the present invention is an embodiment of an assembly sequence planning method based on a priority graph provided by the present invention. Specifically, a product assembly priority graph of an assembly is obtained, and assembly sequence planning is performed based on the priority graph.
[0081] like Figure 1 and Figure 2 Shown are respectively a flow chart of an assembly sequence planning algorithm based on a priority graph provided by the present invention and an assembly priority graph of Example 1 of an assembly sequence planning algorithm based on a priority graph.
[0082] Depend on Figure 1 It can be seen that in an embodiment of an assembly sequence planning algorithm based on a priority graph provided by the present invention, the process of planning the assembly sequence for a product includes:
[0083] Step 101, input assembly information of the product and model the assembly sequence information of the product;
[0084] Step 102, depth-first search whether the directed graph data structure contains a cycle. If the directed graph contains a cycle, all the cycles are organized into assembly levels, and then step 103 is entered. If there is no cycle in the directed graph, step 103 is entered.
[0085] Step 103 , performing assembly sequence planning on the directed graphs of (sub)assemblies at each level.
[0086] Step 104 , merging the assembly sequences of the subassemblies at each level, and outputting the assembly sequence of the product.
[0087] In step 101, the assembly information of the product is input and modeled. The parts are modeled as nodes in a directed graph data structure, the information of the parts is modeled as node information in the directed graph data structure, and the priority relationship is modeled as an edge in the directed graph data structure. The process includes:
[0088] Step 10101, input product part information. The input format is part number assembly tool assembly direction. For example, 1T1+X means that the first part is assembled using tool T1 along assembly direction +X.
[0089] Step 10102, input product part priority information. The input format is<p,q> (p and q represent part numbers), it means that the pth part is assembled before the qth part. For example, <1,2> means that the 1st part is assembled before the 2nd part.
[0090] Step 10103, using the linked list to create the assembly priority graph sub-function CreatePPGraph (PPGraph*G), can read the information of the above steps 10101 and 10102 into the memory to facilitate subsequent calculations.
[0091] In step 102, the directed graph data structure is deeply searched to see whether it contains a loop and constitutes an assembly level. Depth-first search is a classic algorithm in graph theory. The depth-first search algorithm can be used to generate a corresponding topological sorting table of the target graph and then find out whether there is a loop. The steps are as follows:
[0092] Step 10201, access the initial vertex v;
[0093] Step 10202, starting from the unvisited adjacent points of v, perform depth-first traversal of the graph until all vertices in the graph that have paths connecting to v are visited;
[0094] Step 10203: If there are still vertices in the graph that have not been visited, start from an unvisited vertex and re-perform depth-first traversal until all vertices in the graph have been visited. If a node is visited twice during the visit process, a cycle exists.
[0095] This method assists process personnel in finding the loop. The process information represented by the loop is the concept of subassembly, and the parts contained in the loop are the parts of the subassembly.
[0096] Specifically, Figure 3 If there is a loop in the priority diagram shown, then part 2.4.5 becomes a subassembly. Further, the assembly level formed by the product is as follows Figure 4 shown.
[0097] In step 103, assembly sequence planning is performed on the directed graph of each (sub)assembly, and the process includes:
[0098] Step 10301, traverse each node in the assembly priority graph and count the in-degree of each node. The in-degree represents the number of direct predecessor nodes of the node. For example, <1,2> means that the first part is the direct predecessor of the second part.
[0099] Step 10302, add the nodes with in-degree 0 to the array to be sorted.
[0100] Step 10303, the process planner selects a part from the array to be arranged as a basic part and adds it to the queue sequence.
[0101] Step 10304: greedily select the next best node from the array to be sorted and add it to the queue sequence. The node is deleted from the array to be sorted, and the in-degree of its successor node is reduced by 1.
[0102] Step 10305: If there is a successor node with an in-degree of 0, add the node to the array to be sorted.
[0103] Step 10306, determine whether the array to be sorted is empty, if yes, execute step 10304; if no, execute step 10307.
[0104] Step 10307, the nodes in the output queue sequence are the assembly sequence of the assembly.
[0105] The greedy selection strategy in step 10304 is as follows:
[0106] Determine whether the assembly direction of the next part to be arranged is consistent with the last part in the sequence queue. If they are consistent, D=0; if they are inconsistent, D=1.
[0107] Determine whether the assembly tool of the next part to be arranged is consistent with the last part in the sequence queue. If they are consistent, T=0; if not, T=1.
[0108] Calculate the D and T values of all the parts in the array to be arranged. Calculate, w1 and w2 represent the weights of the assembly direction and assembly tool respectively. The determination of w1 and w2 needs to be considered according to the actual situation.
[0109] Select the part with the smallest local objective function value.
[0110] Specifically, Figure 5As shown in the figure, the nodes with darker colors in the implementation are the parts in the array to be sorted. The darker color in (a) is part 1.3.6, and part 3 is selected as the base part; (b) Select part 1; (c) Select part 6; (d) Select subassembly 2.4.5; (e) Select part 7; (f) Select part 8; (g) Select part 9; (h) Select part 10; (i) The final output sequence is 3-1-6-(2.4.5)-7-8-9-10;
[0111] Example 2
[0112] Embodiment 2 provided by the present invention is a specific application embodiment of an assembly sequence planning method based on a priority graph provided by the present invention. In this specific application embodiment, the assembly is a certain model product, such as Figure 6 Its process directed graph is shown as Figure 7 shown.
[0113] Table 1 below shows the part numbers, assembly directions, and tools for this product.
[0114] Table 1 Product assembly information
[0115]
[0116]
[0117] According to the method of step 101 to step 104, the optimal assembly sequence of the assembly is obtained as follows: 16-5-3-4 -6-1-2-11-14-15-12-13-17-18-19-21-22-20.
[0118] Through the description of the above implementation modes, those skilled in the art can clearly understand that each implementation mode can be implemented with the help of programming software.
[0119] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. An assembly sequence planning method based on a precedence graph, characterized in that: The following steps are involved: 1) Obtain product assembly information and construct a product assembly sequence information priority graph; 2) Use the depth-first search algorithm to detect whether the assembly sequence information priority graph contains a loop. If there is a loop, organize all loops into sub-level assemblies and execute step 3); otherwise, directly execute step 3); 3) performing assembly sequence planning for assemblies at each level in the assembly sequence information priority diagram respectively; 4) Combine the assembly sequences of assemblies at each level to obtain the assembly sequence of the product.
2. The assembly sequence planning method based on a priority graph according to claim 1, characterized in that: The product assembly sequence information priority graph is a directed graph data structure, with the parts information in the product assembly information as nodes and the priority relationship of the product assembly as edges.
3. The assembly sequence planning method based on a priority graph according to claim 1, characterized in that: The method of using a depth-first search algorithm to detect whether a cycle is contained in the assembly sequence information priority graph comprises the following steps: Select any vertex in the assembly sequence information priority graph as the initial vertex V; Starting from the unvisited adjacent points of V, perform depth-first traversal of the priority graph level by level until all vertices in the priority graph that have paths connected to V are visited; If there are still vertices in the priority graph that have not been visited at this time, start from this point and perform depth-first traversal again, repeating this step until all vertices in the priority graph have been visited. If a node has been visited twice during the visit process, there is a cycle in the priority graph.
4. The assembly sequence planning method based on a priority graph according to claim 1 is characterized in that: The step 3) comprises the following steps: 3.1) Traverse all nodes in the assembly sequence information priority graph and count the in-degree of each node, where the in-degree represents the number of direct predecessor nodes of a node; 3.2) Add the nodes with zero in-degree to the array to be sorted; 3.3) Select a part from the array to be sorted as the basic part and add it to the sequence queue; 3.4) Use the greedy selection strategy to select the next best node from the array to be sorted, add it to the sequence queue, and delete the node from the array to be sorted. The in-degree of its successor node is reduced by one. 3.5) If there is a node whose successor node has zero in-degree, add the node to the array to be sorted; 3.6) If the array to be arranged is not empty, execute step 3.4), otherwise, output the nodes in the sequence queue as the assembly sequence of the assembly.
5. The assembly sequence planning method based on priority graph according to claim 4 is characterized in that: The method of selecting the next optimal node from the array to be sorted using a greedy selection strategy includes the following steps: Determine whether the assembly direction of the next part to be arranged is consistent with the last part in the sequence queue. If they are consistent, the assembly direction coefficient D = 0, otherwise D = 1; Determine whether the assembly tool of the next part to be arranged is consistent with the last part in the sequence queue. If it is consistent, the assembly tool coefficient T = 0, otherwise T = 1; Calculate the local objective function g(i) of each part in the array to be sorted: g(i)=w1D+w2T Among them, w1 and w2 represent the assembly direction weight and assembly tool weight respectively; The part with the smallest local objective function value is selected as the optimal node.
6. An assembly sequence planning system based on a precedence graph, characterized in that: include: An assembly sequence information priority graph construction module is used to obtain product assembly information and construct an assembly sequence information priority graph of the product; The assembly sequence information priority graph detection module is used to detect whether the assembly sequence information priority graph contains a loop using a depth-first search algorithm. If there is a loop, all loops are organized into sub-level assemblies. The product assembly sequence planning module is used to plan the assembly sequence of each level of the assembly in the assembly sequence information priority diagram, merge the assembly sequences of the assemblies at each level, and obtain the assembly sequence of the product.
7. The assembly sequence planning system based on the priority graph according to claim 6 is characterized in that: The assembly sequence information priority graph detection module includes: A vertex selection module is used to select any vertex in the assembly sequence information priority graph as the initial vertex V; The depth-first traversal module is used to start from the unvisited adjacent points of V and perform depth-first traversal on the priority graph step by step until all vertices in the priority graph that have paths connected to V are visited. If there are still vertices in the priority graph that have not been visited at this time, start from this point and perform depth-first traversal again. Repeat this step until all vertices in the priority graph have been visited. If a node is visited twice during the visit process, there is a cycle in the priority graph.
8. The assembly sequence planning system based on a precedence graph according to claim 6, characterized in that: The product assembly sequence planning module includes: The module for constructing the array to be sorted is used to traverse all nodes in the assembly sequence information priority graph, count the in-degree of each node, where the in-degree represents the number of direct predecessor nodes of a node, and add nodes with zero in-degree to the array to be sorted; The sequence queue construction module is used to select a part in the array to be arranged as the basic part, add it to the sequence queue, use the greedy selection strategy to select the next optimal node from the array to be arranged, add it to the sequence queue, and delete the node from the array to be arranged. The in-degree of its successor node is reduced by one. If there is a node whose successor node in-degree is zero, the node is added to the array to be arranged. If the array to be arranged is not empty, the optimal node is selected again. Otherwise, the nodes in the sequence queue are output as the assembly sequence of the assembly.