Assembly sequence planning method based on improved Monte Carlo tree search
By constructing an assembly priority relationship and interference matrix through an improved Monte Carlo tree search algorithm, and combining it with a greedy algorithm to optimize the assembly sequence, the problem of long processing time and easy getting trapped in local optima of traditional algorithms is solved, and the effect of quickly finding the global optimum is achieved.
Patent Information
- Application Number
- CN202511661146.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-13
- Publication Date
- 2026-02-10
AI Technical Summary
When dealing with assembly sequence planning for complex products, existing technologies often rely on traditional heuristic algorithms, which are time-consuming and prone to getting stuck in local optima, making it difficult to quickly find the global optimum and affecting the overall performance of assembly planning.
An improved Monte Carlo tree search algorithm is adopted. By constructing an assembly priority relation matrix, an interference matrix, and a connection matrix, and combining a greedy algorithm and Monte Carlo tree search, the historical best performance index is recorded, and the assembly sequence is iteratively optimized.
It significantly shortens simulation time, improves optimization speed, breaks through the limitations of local optima, finds better assembly sequences, and improves the quality of solutions.
Smart Images

Figure CN121504029A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of assembly sequence planning technology, specifically relating to an assembly sequence planning method based on an improved Monte Carlo tree search. Background Technology
[0002] Virtual assembly technology can complete the assembly feasibility analysis and assembly sequence optimization of the assembly before parts are manufactured. Assembly sequence planning is a typical combinatorial optimization problem. Due to the complexity of constraints and performance indicators, it usually requires heuristic algorithms such as ant colony optimization (ACO), particle swarm optimization (PSO), and genetic algorithm (GA) to solve it.
[0003] However, existing technologies have the following shortcomings: when dealing with assembly sequence planning for complex products, the search and iteration process of traditional heuristic algorithms is time-consuming and it is difficult to quickly output feasible assembly sequences; due to the limitations of the search mechanism of the algorithm itself, traditional heuristic algorithms tend to stall after finding a relatively optimal solution in a local range, and cannot further explore the globally optimal assembly sequence, which affects the overall performance of assembly planning.
[0004] Therefore, a new method is urgently needed. Summary of the Invention
[0005] The purpose of this invention is to provide an assembly sequence planning method based on an improved Monte Carlo tree search. This method significantly shortens simulation time, improves optimization speed, overcomes the limitation of traditional algorithms that are prone to getting trapped in local optima, and effectively improves the quality of the solution.
[0006] To achieve the above objectives, this invention provides an assembly sequence planning method based on an improved Monte Carlo tree search, comprising the following steps: S1. Assembly planning problems include: constructing an assembly priority matrix. Assemble the interference matrix ,in, k Indicates assembly direction, assembly connection matrix Assembly support matrix Assembly tool table T for each part tool ; S2. Based on the assembly relationships of the parts in the assembly, establish the minimum number of times the assembly direction needs to be changed. Number of times assembly tools were changed Assembly stability To evaluate performance metrics, corresponding weighting coefficients are set, and a performance index for the assembly sequence optimization problem is constructed. S3. Iterate through the Monte Carlo tree search algorithm and record the best historical performance index during the random simulation process; S4, based on the assembly planning problem in S1, the assembly sequence optimization performance index in S2 and the historical optimal performance index in S3, repeatedly execute S3 to obtain the historical access sequence and the output of the Monte Carlo tree optimal sequence and the corresponding optimal performance index, the number of assembly direction changes of each part, the number of assembly tool changes.
[0007] Preferably, S1 comprises the following steps: S101, obtaining the assembly information of the assembly body, numbering the parts of the assembly body, obtaining the part number of each part , wherein, m is the number of parts of the assembly body, and a string composed of 1 m to is obtained as an assembly sequence ; S102, combining the assembly requirements and the three-dimensional model of the assembly body to construct the assembly priority relationship matrix of each part of the assembly body , the assembly interference matrix k , wherein, represents the assembly direction, the assembly connection matrix , the assembly support matrix ; According to the assembly requirements, the assembly priority relationship matrix , the formula is: ; wherein, The calculation formula of each element in ; ; According to the three-dimensional model of the assembly body, define the assembly interference matrix , the formula is: ; wherein, The calculation formula of each element in ; ; Define the assembly connection matrix , the formula is: ; wherein, The calculation formula of each element in ; ; Define the assembly connection matrix , the formula is: ; wherein, The calculation formula of each element The calculation formula is as follows: ; S103. Based on the assembly information of the parts, construct the assembly tool table T corresponding to each part. tool Each tool is used with 1~ n The strings are numbered, where, n The total number of tools used in the assembly.
[0008] Preferably, S2 includes the following steps: S201, Based on Assembly Priority Relationship Matrix and assembly interference matrix Determine the feasibility of the assembly sequence; S202, based on For matrices, a greedy algorithm is used, with the criterion of maximizing the number of parts assembled in the same direction, to calculate the minimum number of changes in assembly direction. ; S203, Based on Assembly Tool Table T tool Calculate the number of times the assembly tool is changed. The formula is as follows: ; in, The calculation method is as follows: ; S204, Based on Assembly Connection Matrix and assembly support matrix Calculate assembly stability index Specifically: Calculate the number of unstable connections. The formula is as follows: ; Calculate the number of times the support is unstable. The formula is as follows: ; Calculate assembly stability index The formula is as follows: ; S205, Based on weighting coefficients And the assembly sequence feasibility results obtained from S201, calculate performance indicators The formula is as follows: ; in, For performance indicators The weight coefficients, and satisfying .
[0009] Preferably, S3 comprises the following steps: S301, randomly generating an assembly sequence , and calculating the corresponding performance index ; S302, selecting a node to expand according to the confidence upper bound UCB of the search tree node; defining the UCB value of the search tree node, and calculating as follows: ; wherein, represents the confidence upper bound of the node; represents the performance index obtained after accessing the node ; represents the number of times the node is accessed; represents the balance parameter; represents the number of times the root node is accessed; The search tree starts from the root node, and then selects a target in each layer of the search tree according to the UCB value. The node selection process in each layer involves two cases: Case 1: there is an unvisited node in the current decision layer, then select the first unvisited node in the current decision layer; Case 2: all nodes in the current decision layer have been visited, then select the node with the maximum confidence upper bound (UCB) value in the current decision layer; S303, when all nodes in the decision layer have been visited, expanding the node determined in the selection process; the expansion process is to randomly generate a node from the unvisited nodes of the selected node and all its parent nodes, and then execute S302 again; S304, randomly generating a branch containing the root node to the node determined by selection and expansion, and the length is sequence , and calculating the corresponding performance index ; ; , ; S305, updating the total performance index and the number of visits of the nodes along the search tree back to the root node with the obtained performance index .
[0010] Preferably, S4 comprises the following steps: S401, repeatedly executing S302 to S305 until the number of iterations is greater than ; S402、From the leaf node of the search tree, select the average performance index The maximum is selected as the node, and backtracking is performed upwards to obtain the access sequence , and the corresponding performance index , and the historical optimal performance index , and the historical optimal sequence , and the optimal access sequence and the corresponding performance index are obtained by comparison.
[0011] The application also provides an assembly sequence planning system based on the improved Monte Carlo tree search, comprising: An assembly basic data construction module is used to define the assembly planning problem, comprising: constructing an assembly precedence relation matrix , an assembly interference matrix , wherein k represents the assembly direction, an assembly connection matrix , an assembly support matrix , and an assembly tool table T corresponding to each part tool ; A hybrid performance index construction module is connected with the assembly basic data construction module, and is used to establish the minimum number of assembly direction changes , the number of assembly tool changes , and the assembly body stability as evaluation indexes, set corresponding weight coefficients, and construct the performance index of the assembly sequence optimization problem; A Monte Carlo tree search iteration module is connected with the hybrid performance index construction module, iterates through the Monte Carlo tree search algorithm, and records the historical optimal performance index in the random simulation process; An optimal sequence solving output module is connected with the Monte Carlo tree search iteration module, repeatedly executes the Monte Carlo tree search iteration module based on the assembly planning problem, the assembly sequence optimization performance index, and the historical optimal performance index, obtains the historical access sequence, the optimal sequence output by the Monte Carlo tree, and the corresponding optimal performance index, and the number of assembly direction changes of each part, the number of assembly tool changes.
[0012] Therefore, the application adopts the above-mentioned assembly sequence planning method based on the improved Monte Carlo tree search, and compared with the prior art, the technical scheme of the application has the following beneficial effects: (1) The Monte Carlo tree search algorithm is adopted, the problem of long simulation time and slow convergence speed of the traditional heuristic algorithm is overcome, and the effects of shortening the simulation time and improving the optimization speed are realized; (2) The present invention adopts an improved Monte Carlo tree search algorithm, which overcomes the problem that traditional heuristic algorithms are prone to getting trapped in local optima and have difficulty finding a better global assembly sequence. It effectively breaks through the limitations of local optima, can find a better assembly sequence, and improves the quality of the solution.
[0013] The technical solution of the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. Attached Figure Description
[0014] Figure 1 This is a flowchart illustrating an embodiment of an assembly sequence planning method based on an improved Monte Carlo tree search according to the present invention. Figure 2 This is a schematic diagram illustrating the execution process of an embodiment of the assembly sequence planning method based on an improved Monte Carlo tree search according to the present invention. Figure 3 This is a comparison chart of assembly performance indicators for an embodiment of the assembly sequence planning method based on an improved Monte Carlo tree search according to the present invention. Detailed Implementation
[0015] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. All other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention. Unless otherwise defined, the technical or scientific terms used in the present invention should have the ordinary meaning understood by those skilled in the art.
[0016] Example 1 like Figures 1-2 As shown, an assembly sequence planning method based on an improved Monte Carlo tree search according to the present invention includes the following steps: S1. Assembly planning problems include: constructing an assembly priority matrix. Assemble the interference matrix ,in k Indicates assembly direction, assembly connection matrix Assembly support matrix Assembly tool table T for each part tool The steps include: S101. Obtain the assembly information of the assembly, number the parts of the assembly, and obtain the part numbers. ,in, m Given the number of parts in the assembly, and obtain a value from 1 to... m Assembly sequence composed of strings In this embodimentm =36; S102, combining the assembly requirement and the three-dimensional model of the assembly body, constructing the assembly priority relation matrix of each part of the assembly body , the assembly interference matrix , wherein k represents the assembly direction, the assembly connection matrix , the assembly support matrix ; According to the assembly requirement, the assembly priority relation matrix is obtained , the formula is: ; In this embodiment, according to the assembly requirement, ; The calculation formula of each element in the matrix is as follows: ; According to the three-dimensional model of the assembly body, the assembly interference matrix is defined, and the formula is: ; Take for example, and the definition form is represented as: ; According to the three-dimensional model of the assembly body, the five assembly directions defined by the assembly body and the corresponding assembly interference matrices are respectively , The calculation formula of each element in the matrix is as follows: ; The assembly connection matrix is defined, and the formula is: ; In this embodiment, according to the assembly requirement, ; The calculation formula of each element in the matrix is as follows: ; The assembly connection matrix is defined, and the formula is: ; In this embodiment, according to the assembly requirement, ; The calculation formula of each element in the matrix is as follows: ; S103. Based on the assembly information of the parts, construct the assembly tool table T corresponding to each part. tool Each tool is used with 1~ n The strings are numbered, where, n The total number of tools used in the assembly; S2. Establish performance indicators for the assembly problem. Based on the assembly relationships of the parts in the assembly, establish the minimum number of changes in the assembly direction. Number of times assembly tools were changed Assembly stability To evaluate the performance of the assembly sequence optimization problem, corresponding weighting coefficients are set; specifically: S201, Based on Assembly Priority Relationship Matrix and assembly interference matrix Determine the feasibility of the assembly sequence; S202, based on For matrices, a greedy algorithm is used, with the criterion of maximizing the number of parts assembled in the same direction, to calculate the minimum number of changes in assembly direction. ; S203, Based on Assembly Tool Table T tool Calculate the number of times the assembly tool is changed. The formula is as follows: ; in, The calculation method is as follows: ; S204, Based on Assembly Connection Matrix and assembly support matrix Calculate assembly stability index Specifically: Calculate the number of unstable connections. The formula is as follows: ; Calculate the number of times the support is unstable. The formula is as follows: ; Calculate assembly stability index The formula is as follows: ; S205, Based on weighting coefficients In this embodiment And the assembly sequence feasibility results obtained from S201, calculate performance indicators The formula is as follows: ; in, For performance indicators The weight coefficients, and satisfying ; S3. The algorithm iterates through selection, expansion, random simulation, and backpropagation steps using the traditional Monte Carlo tree search algorithm, recording historical best performance metrics during the random simulation process; specifically: S301. Randomly generate an assembly sequence of length 36. And calculate the corresponding performance indicators. ; S302. Based on the upper confidence bound (UCB) of the search tree nodes, select nodes for expansion; define the UCB value of the search tree nodes, calculated as follows: ; in, This sets the upper confidence limit for nodes, providing a basis for the selection and expansion of subsequent nodes; Indicates access node The performance metrics obtained subsequently; Indicates the number of times a node has been visited; Indicates the balance parameters; This represents the number of times the root node has been visited. The search tree starts from the root node (spacecraft), and then targets are selected at each level of the search tree based on UCB values. The node selection process at each level involves two cases: Case 1: If there are unvisited nodes in the current decision-making layer, then select the first unvisited node in the current decision-making layer; Scenario 2: If all nodes in the current decision-making layer have been visited, then select the node with the largest upper confidence limit (UCB) value in the current decision-making layer; S303. When all nodes in the decision layer have been visited, the nodes determined during the selection process are expanded. The expansion process involves randomly generating a node from the unvisited nodes among the selected node and all its parent nodes, and then executing S302 again. S304. Randomly generate a branch containing the root node and the node determined by selection and expansion, with a length of... sequence And calculate the corresponding performance indicators. Performance indicators Compared with historical best performance metrics If a comparison is made, Then let , ; S305, The backpropagation process involves applying the performance metrics obtained from this stochastic simulation. , backtrack to the root node along the search tree, update the node total performance index and the number of visits ; S4, based on the assembly planning problem definition in S1, the assembly sequence optimization performance index in S2 and the historical optimal performance index in S3, the assembly sequence planning method of improved Monte Carlo tree search is used to solve the assembly sequence planning problem, and the optimal assembly sequence is obtained, and the number of part assembly direction changes, the number of assembly tool changes and the optimal mixed performance index are output; specifically: S401, repeat S302 to S305 until the iteration number is greater than ; output the optimal assembly sequence, and output the number of part assembly direction changes, the number of assembly tool changes and the optimal mixed performance index; S402, select the average performance index of the leaf node of the search tree as the selected node, and backtrack upwards to obtain the visiting sequence , and the corresponding performance index , and compare the historical optimal performance index and the historical optimal sequence , and obtain the optimal visiting sequence and the corresponding performance index.
[0017] As shown in Figure 3 , compared with the genetic algorithm, the simulation time of the embodiment of the application is shorter, and as the simulation time increases, the optimal solution can be obtained faster.
[0018] Therefore, the improved Monte Carlo tree search-based assembly sequence planning method is adopted, which significantly shortens the simulation time, improves the optimization speed, breaks through the limitation of traditional algorithms that are easy to fall into local optimum, and effectively improves the solution quality.
[0019] Those skilled in the art should understand that the embodiments of the present application can be provided as a method, a system or a computer program product. Therefore, the present application can be in the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present application can be in the form of a computer program product implemented on one or more computer usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer usable program code.
[0020] It should be pointed out finally that the above examples are only used to illustrate the technical solutions of the present application but not to limit it, and although the present application has been described in detail with reference to the preferred embodiments, it should be understood by those skilled in the art that the technical solutions of the present application can still be modified or replaced equivalently, and these modifications or equivalent replacements should not make the modified technical solutions deviate from the spirit and scope of the technical solutions of the present application.
Claims
1. An assembly sequence planning method based on an improved Monte Carlo tree search, characterized in that, Includes the following steps: S1. Assembly planning problems include: constructing an assembly priority matrix. Assemble the interference matrix ,in, k Indicates assembly direction, assembly connection matrix Assembly support matrix Assembly tool table T for each part tool ; S2. Based on the assembly relationships of the parts in the assembly, establish the minimum number of times the assembly direction needs to be changed. Number of times assembly tools were changed Assembly stability To evaluate performance metrics, corresponding weighting coefficients are set, and a performance index for the assembly sequence optimization problem is constructed. S3. Iterate through the Monte Carlo tree search algorithm and record the best historical performance index during the random simulation process; S4. Based on the assembly planning problem in S1, the assembly sequence optimization performance index in S2, and the historical best performance index in S3, repeat S3 to obtain the historical access sequence and the optimal sequence and corresponding optimal performance index output by the Monte Carlo tree, as well as the number of times the assembly direction of each part is changed and the number of times the assembly tool is changed.
2. The assembly sequence planning method based on an improved Monte Carlo tree search according to claim 1, characterized in that, S1 includes the following steps: S101. Obtain the assembly information of the assembly, number the parts of the assembly, and obtain the part numbers. ,in, m The number of parts in the assembly is given, and a value ranging from 1 to... m Assembly sequence composed of strings ; S102. Combining the assembly requirements and the 3D model of the assembly, construct the assembly priority relationship matrix for each part of the assembly. Assemble the interference matrix ,in, k Indicates assembly direction, assembly connection matrix Assembly support matrix ; Based on the assembly requirements, the assembly priority relationship matrix is obtained. The formula is: ; in, Elements The calculation formula is as follows: ; Based on the 3D model of the assembly, define the assembly interference matrix. The formula is: ; in, Elements The calculation formula is as follows: ; Define assembly connection matrix The formula is: ; in, Elements The calculation formula is as follows: ; Define assembly connection matrix The formula is: ; in, Elements The calculation formula is as follows: ; S103. Based on the assembly information of the parts, construct the assembly tool table T corresponding to each part. tool Each tool is used with 1~ n The strings are numbered, where, n The total number of tools used in the assembly.
3. The assembly sequence planning method based on an improved Monte Carlo tree search according to claim 1, characterized in that, S2 includes the following steps: S201, Based on Assembly Priority Relationship Matrix and assembly interference matrix Determine the feasibility of the assembly sequence; S202, based on For matrices, a greedy algorithm is used, with the criterion of maximizing the number of parts assembled in the same direction, to calculate the minimum number of changes in assembly direction. ; S203, Based on Assembly Tool Table T tool Calculate the number of times the assembly tool is changed. The formula is as follows: ; in, The calculation method is as follows: ; S204, Based on Assembly Connection Matrix and assembly support matrix Calculate assembly stability index Specifically: Calculate the number of unstable connections. The formula is as follows: ; Calculate the number of times the support is unstable. The formula is as follows: ; Calculate assembly stability index The formula is as follows: ; S205, Based on weighting coefficients And the assembly sequence feasibility results obtained from S201, calculate performance indicators The formula is as follows: ; in, For performance indicators The weight coefficients, and satisfying .
4. The assembly sequence planning method based on an improved Monte Carlo tree search according to claim 1, characterized in that, S3 includes the following steps: S301, Randomly generate assembly sequence And calculate the corresponding performance indicators. ; S302. Based on the upper confidence bound (UCB) of the search tree nodes, select nodes for expansion; define the UCB value of the search tree nodes, calculated as follows: ; in, Indicates the upper confidence limit of the node; Indicates access node The performance metrics obtained subsequently; Indicates the number of times a node has been visited; Indicates the balance parameters; This represents the number of times the root node has been visited. The search tree starts from the root node, and then the target is selected based on the UCB value at each level of the search tree. The node selection process at each level involves two cases: Case 1: If there are unvisited nodes in the current decision-making layer, then select the first unvisited node in the current decision-making layer; Scenario 2: If all nodes in the current decision-making layer have been visited, then select the node with the largest upper confidence limit (UCB) value in the current decision-making layer; S303. When all nodes in the decision layer have been visited, the nodes determined during the selection process are expanded. The expansion process involves randomly generating a node from the unvisited nodes among the selected node and all its parent nodes, and then executing S302 again. S304. Randomly generate a branch containing the root node and the node determined by selection and expansion, with a length of... sequence And calculate the corresponding performance indicators. Performance indicators Compared with historical best performance metrics Compare; S305, the performance indicators to be obtained Backtrack up the search tree to the root node and update the node's total performance metrics. and number of visits .
5. The assembly sequence planning method based on an improved Monte Carlo tree search according to claim 1, characterized in that, S4 includes the following steps: S401. Repeat steps S302 to S305 until the number of iterations is greater than [number missing]. ; S402. Select the average performance metric from the leaf nodes of the search tree. The largest node is selected as the node to be visited, and backtracking is performed upwards to obtain the visit sequence. and corresponding performance indicators and compared with historical best performance metrics and historical best sequence The optimal access sequence and corresponding performance metrics are obtained through comparison.
6. An assembly sequence planning system based on an improved Monte Carlo tree search, applied to the assembly sequence planning method based on an improved Monte Carlo tree search as described in any one of claims 1-5, characterized in that, include: The assembly basic data construction module is used to define the assembly planning problem, including: constructing the assembly priority relationship matrix. Assemble the interference matrix ,in, k Indicates assembly direction, assembly connection matrix Assembly support matrix Assembly tool table T for each part tool ; The hybrid performance index construction module, connected to the assembly basic data construction module, establishes the minimum number of assembly direction changes based on the assembly relationships of the parts in the assembly. Number of times assembly tools were changed Assembly stability To evaluate performance metrics, corresponding weighting coefficients are set, and a performance index for the assembly sequence optimization problem is constructed. The Monte Carlo tree search iteration module is connected to the hybrid performance index construction module. It iterates through the Monte Carlo tree search algorithm and records the historical best performance index during the random simulation process. The optimal sequence solution output module is connected to the Monte Carlo tree search iteration module. Based on the assembly planning problem, the assembly sequence optimization performance index and the historical best performance index, the Monte Carlo tree search iteration module is repeatedly executed to obtain the historical access sequence and the optimal sequence output by the Monte Carlo tree and the corresponding optimal performance index, as well as the number of times the assembly direction of each part is changed and the number of times the assembly tool is changed.