Efficient NC process scheme generation method based on reusable macro and micro process fusion

Process reuse technology has been widely studied and applied in the manufacturing industry. However, the current NC machining process reuse generally assumes that the micro process is compatible with the macro process but, in fact, reusable processes from similar local structures from multiple parts are usually incompatible with each other when under the overall manufacturing requirements of the target parts. As a result, a large number of user interactions are still required for modification and adjustment in practical engineering applications and process reuse do not provide a significant improvement to the design efficiency. Therefore, an efficient NC process scheme generation method based on reusable macro and micro process fusion is proposed in this paper. Firstly, according to the calculation of semantic distance of process design intention, the micro process is mapped to the macro process to realize fusion of the two processes, and a compatibility credibility evaluation model is established to evaluate the fusion results. Then, when the fusion result is credible, the machining areas corresponding to the process scheme are adjusted and optimized at the geometric level. The adjustment and optimization of machining areas provides the integration of machining areas and the optimization of the machining sequence. Finally, the effectiveness and feasibility of the proposed method are verified through a test of example parts.


Introduction
In recent years, driven by the emergence of cloud computing, big data, the development of the Internet of things and other new generation artificial intelligence technologies, and the deep integration with advanced manufacturing technology, a new generation of intelligent manufacturing technology has been derived, which has triggered major and profound changes in the production mode, manufacturing mode, design mode, and other aspects of the manufacturing industry [1,2]. So far, the new generation of intelligent manufacturing, which is mainly characterized by the new generation of artificial intelligence technology, has been widely researched and applied in academia and industry, and a number of new research and application hotspots, such as Internet of things, cloud manufacturing, and digital twin, have emerged [3]. Process design is a key component of product manufacturing. Similarly, intelligent process design systems are also one of the core research areas in intelligent manufacturing. At the same time, a large number of 3D CAD models and their associated NC process data are constantly generated and accumulated in enterprises. This data serves as vast source of experience and knowledge for process designers [4]. There are several known methods of process design and among them, the most effective utilization method is process reuse. A variety of process reuse technologies have been adopted in the manufacturing sector to support the improvement of process design efficiency, such as group technology-based process reuse [5], template-based process reuse [6][7][8], and case-based process reuse [9].
However, in current process design methods, the application of NC process reuse mainly focuses on the micro process level, while human interactive design pays more attention to the macro process level. The existing bottomup process design methods usually imply the assumption that the micro process is compatible with the macro process. However, because reusable processes have the characteristics of being multi-source (from multiple parts), heterogeneous (heterogeneity of manufacturing resources, difference of process parameters, etc.), and local (feature level or local structure level), it is usually difficult to accommodate reusable micro and macro processes, resulting in many breakpoints and adjustment/integration requirements. Therefore, user interaction is usually required to eliminate possible heterogeneity and incompatibility, resulting in an NC process reuse that does not significantly improve the efficiency of the overall process design. Therefore, it is important to study the effective fusion and compatibility evaluation of NC processes of similar local structures.
Conversely, through the continuous iterative integration and evaluation of multi-source macro and micro process, the initial NC process scheme can be generated quickly. However, at the semantic and parameter levels, there are still problems of non-optimization of the machining area and machining sequence. Generally, the machining scheme needs to follow the principle of making full use of the machining capacity of the cutting tool, that is, a cutting tool should process all the areas that can be machined as completely as possible. In addition, the machining area of the cutting tool also needs to be "one size fits all" as far as possible to reduce cutting lifting. Therefore, it is necessary to study the process optimization and adjustment of machining area fusion and machining sequence optimization.
Based on the above background and requirements, an efficient NC process scheme generation method based on reusable macro and micro process fusion is proposed in this paper. Firstly, according to the principle of NC process reuse and the process decision-making behavior of designers, the principle of similar NC process fusion of multi-source and local structure is analyzed. Then, the compatibility evaluation method of micro and macro process fusion is proposed to realize the reusable NC process fusion, so as to quickly generate the initial NC process scheme and evaluate its compatibility. Finally, under the guidance of the macro process, the machining effectiveness of each manufacturing feature within the macro process is analyzed. In order to make full use of cutting tool's machining ability, the machining areas are integrated, the machining sequence is adjusted, and a "one size fits all" approach is used to realize the fusion and optimization of the NC process.

Related work
The proposed method belongs to a process reuse method, and process adjustment and optimization are the key issues. Therefore, we review three parts: process reuse, process adaptation or adjustment, and process optimization.

NC process reuse
Many research results on process reuse have been widely used by the manufacturing industry. Jong et al. [10] proposed an automatic process planning method based on machining feature recognition and group technology. First, the manufacturing features of parts are recognized, and then according to the basic attributes of parts (part type, material, etc.) and the recognized machining features, the parts are coded by group technology, and the corresponding process procedures are found in a typical process library. However, this method is grouped by part code, and the granularity of process reuse is relatively extensive. Recognizing the above problems, Zheng et al. [11] proposed a process design method based on multi-granularity process knowledge. First, the process knowledge is divided into four levels, typical process route, typical feature process chain, typical working procedure, and typical working step, and then multi-level process knowledge reuse is realized by group technology. However, because group technology coding cannot completely describe the information and process knowledge of parts, has strong subjectivity, and is difficult to expand, the retrieved information is extensive and usually only suitable for reference reuse. Chen et al. [12] first interactively selected and adjusted the predefined macro process scheme template, and then guided by the macro process scheme, applied reasoning knowledge to determine the machining methods, cutting tools, and cutting parameters of features to build a NC machining unit. Finally, the serialized machining units are mapped onto the NC process chain to realize the NC process design driven by the macro process scheme. Li et al. [13] proposed a dynamic feature information model for the NC process design of aircraft structural parts. The method adaptively establishes the evolution state of each feature according to the typical macro process scheme template selected interactively, and then makes decisions on the machining parameters involved. Although the above methods have improved the efficiency and quality of process planning, they still remain "strongly dependent" on expert knowledge and experience; in addition, its core is a structured process knowledge base (including heuristic rule base, process scheme template base, feature base), which needs to be constructed interactively by experienced process designers, so its degree of automation is low, and its flexibility, scalability, and optimization are poor. Huang et al. [14,15] proposed a multi-granularity retrieval method of 3D CAD model for NC process reuse, which provides a new means of support for the fine reuse of NC process with similar parts/features. However, most of the current process reuse methods follow the "1-nearest neighbor criterion," that is, only the process instances with the highest similarity in the retrieval results are used, and the process scheme is changed to meet the machining requirements of the target geometry, which leads to the ineffective utilization of multi-source process schemes. Considering these, Xu et al. [16] used the gray correlation analysis method to obtain the adaptability of NC process values of similar instances relative to target features, so as to support the fusion of NC process elements of similar instances to generate NC process schemes with target features. However, this method does not integrate the macro process, and is easy to fall into local optimization, so the practicability of the generated process scheme is still not adequate.

Automatic process adaptation
In recent years, with the emergence of multi-variety and small-batch production modes in various industries, design changes are becoming more frequent, which puts forward new requirements for adaptive changes. On the other hand, in the common case-based design method, designers first retrieve the appropriate existing design instance in the instance library according to the current design requirements, and then modify the instance to meet the new design requirements [17]. With the continuous breakthrough of research results related to design reuse, the attention on adaptive change is also growing. Due to the distributed and event-driven characteristics of function blocks, Wang et al. [18][19][20] applied a function block to distributed process design for the first time. Function block data and time-driven trigger mechanism are used to sense changes in the machine tool and production status through its monitoring function to support the adjustment of the NC process by triggering the function block. Wang et al. [21] proposed a NC tool path generation method based on feature and agent drive to respond quickly to the dynamic changes of parts and the NC process. In this work, when the feature changes, it is activated by agents to create an appropriate response to change the machining parameters and then automatically updates the NC tool path in the CAM system. Therefore, this method has certain "autonomy" and "intelligence." Liu et al. [22] proposed a feature-based adaptive NC programming method for the uncertain demand of manufacturing resources. A total of 75% of the programming work unrelated to manufacturing resources is completed by the preprocessing module, and the remaining 25% is completed by the post-processing module.
The programming flexibility is realized by dividing the NC programming process into two modules: preprocessing and post-processing. Aiming at the problems of high planning complexity and low efficiency in the process planning of part variants, Xia et al. [23] proposed a configurable machining process planning method for the part family, which comprehensively applies the feature-based part variant model and process configuration mechanism. The traditional process design system for a single model is upgraded to a design system that can process a group of parts (i.e., part family), which effectively improves the flexibility and adaptability of the process design system. In general, the above method improves the adaptability of the process design system from the macro level (response mechanism, design mode, etc.). Although they can improve the efficiency of NC process changes when manufacturing resources are uncertain, they cannot provide support for process reuse-oriented adaptation, mainly because process reuse adaptation needs to solve the multi-source and heterogeneous problems of reusable processes, which are mainly adjusted and optimized for local, micro, and specific NC processes.

Machining process optimization
With the continuous development of intelligent NC process planning, the machining process optimization method has been further studied in feature-based NC programming. Xu et al. [24] proposed a tool path optimization method for aircraft structural parts. Based on modeling the tool path for aircraft structural parts, the simulated annealing algorithm is used to solve the optimization model for obtaining the shortest tool path. Zhang et al. [25] optimized the cutting sequence of NC machining for casing parts. A cutting sequence optimization mathematical model is first established, which relates to the shortest total length of the tool path. Then, the optimization model is solved by dealing with an open and constrained traveling salesman problem using the tabu search algorithm. Liu et al. [26] used configuration spaces to represent and analyze the machining effect (undercut or overcut), and through the iterative adjustment of the process scheme to update and optimize the overall machining process. The method effectively improves the process design efficiency, but the optimization of machining parameters on the tool axis has not been fully considered. The above methods have achieved certain results in improving the processing efficiency, but these methods mainly consider the process optimization of the feature layer, and do not incorporate the correlation relationship. In this way, these existing optimization methods cannot be directly applied to the topdown process design method. Therefore, in order to ensure the effectiveness and rationality of the generated process scheme, further considerations are needed: (1) the relationship between the machining areas needs to be retained during process adjustment; (2) optimization is performed only for the sequence of the machining areas under the same step.

Basic concepts
Definition 1: Multi-source, heterogeneous, fragmented Multi-source refers to the reusable processes from multiple parts, heterogeneous refers to the difference in manufacturing resources, machining parameters, etc., and fragmented refers to the part (feature level/subpart level) from the process instance.

Definition 2: Compatible
Macro or micro process compatibility means that process information such as the machining stage, manufacturing resources, and machining parameters of the corresponding nodes of the macro and micro processes are matched for the new part; That is, the machining parameters of the micro process meet the machining stage requirements of the macro process. Among them, the main determination is that the machining stage of the macro and micro processes is the same and the cutting tool is compatible. Cutting tool compatibility is determined by judging if the cutting tool can process the same machining area according to the cutting tool feasibility. The specific judgment conditions are based on our preliminary research [27]. The degree of compatibility is related to the degree of similarity, which will be explained in detail later in the article. From the above analysis, the compatibility judgment conditions of macro and micro processes can be written as the following: where M SI and M SA represent the machining stage of the micro and the macro processes, respectively; G T (PI, PA) = 1 means that the machining tools of the micro and macro processes are compatible; and f () = 1 means that the micro and macro processes are compatible.

Overview of the approach
In general, interactive NC programming begins with the macro process scheme of a part, which is formulated through process analysis. The micro processes are then considered, including machining methods, cutting tools, and machining strategies, all with respect to the macro process. Since the random combination of process segments is prone to local convergence, it is necessary to introduce a macro process. At the same time, because similar processes come from crowd intelligence, NC programming based on process reuse mainly needs to deal with the compatibility of fusion and process adaptive adjustment issues. Therefore, referring to the interactive programming, the idea of NC programming based on process reuse is a four-step process. First, the similar reusable macro and micro processes in the process instance data are obtained through the 3D CAD model global/subpart retrieval. Then the initial process scheme is quickly obtained by using the fusion of the two. Next, the compatibility evaluation is carried out. Finally, the process is adjusted adaptively according to the evaluation results. The machining process adjustment realizes the integration of machining areas and optimization of the machining sequence. Figure 1 shows the general framework of our approach, which contains two main parts as follows: 1. Fusion and compatibility evaluation of micro and macro processes First, the micro processes need to be mapped to the macro process in order to quickly generate the initial process scheme. The basic idea is to transform the problem into the similarity evaluation of process design intent and the overall matching between macro and micro processes. Then, according to the matching results of the whole NC process scheme and the semantic similarity of design intent, a compatibility credibility evaluation model is constructed.

Adjustment and optimization of the machining process
According to the compatibility evaluation results, the similar NC process fusion results are divided into credible and incredible. When it is incredible, it indicates that the micro processes are incompatible with the macro process, and it needs to be re-decision and iterative fusion; on the contrary, based on the initial NC process scheme generated by fusion, the machining geometry, such as machining area and residual area, is calculated, so as to support the subsequent adaptive adjustment of machining geometry, machining tools, and machining parameters of isomorphic working steps from different features in the same working step. The machining process adjustment mainly includes two parts: the machining areas adjustment and the machining sequence optimization. This is done to ensure that the multi-source, heterogeneous, and fragmented micro and macro processes are integrated into a complete process situation.

Principle of reusable process fusion of multi-source similar parts
The fusion principle of reusable process fusion of multisource similar parts is analyzed from two aspects: the fragmentation and heterogeneous characteristics of a reusable NC process, and the comprehensive behavior and solution mechanism of designers in process decision-making. For reusable NC processes fusion of multi-source similar parts, the fragmentation characteristics of the reusable processes derived from content-based retrieval technology are often multi-source, heterogeneous, and partial. Although they can be refined, they lack consideration of the compatibility between multi-source, heterogeneous, local reusable process segments, and the process context (process elements related to the current process). On the contrary, the ability of global control and associative memory reasoning possessed by experienced process designers is lacking in computers at present. In fact, according to the theory of cognitive science, process designers also use rule reasoning (semantic memory reasoning) and case reuse (situational memory reasoning), which also have the characteristics of fragmentation, but people can often find the semantic association and breakpoint connection path between fragmented process knowledge at a higher level. The means used in the process include semantic association analysis, such as context awareness and importance analysis, and the effective integration of multisource, heterogeneous, and fragmented processes is realized through the iterative process of top-down and bottom-up approaches.
Specifically, reusable process fusion of multi-source similar parts mainly deals with two components. The first is aiming at the semantic gap (heterogeneity) between macro and micro processes, that is, there are non-isomorphic working steps between macro and micro processes (such as working steps WS 1 and WS 2 in Fig. 2), According to the semantic association analysis of process design intent, it is necessary to establish the association relationship of isomorphic working steps (with the same process design intent) between macro and micro processes to evaluate their compatibility (such as isomorphic working steps WS 3 , WS 4 , WS 5 , and WS 6 identified with the same color circle in Fig. 2). Second, in view of the heterogeneity between micro processes, such as the inconsistency of process parameters associated with isomorphic working steps (such as machining resources, machining allowance, cutting parameters), its compatibility needs to be evaluated according to the process context and machining geometry of the features. For the isomorphic working steps WS 3 , WS 4 , and WS 5 in Fig. 2, if the machining allowance is inconsistent, but they are mapped to the same working step (WS 6 ) of the macro process, they need to be set uniformly.

NC process scheme generation based on reusable process fusion
Based on the analysis of the above principles, the generation of NC process scheme based on reusable process fusion mainly needs to deal with two parts: compatibility evaluation of process fusion and process adaptive adjustment. Among them, the process adaptive adjustment mainly realizes the adjustment of the machining areas and the optimization of the machining sequence.

Compatibility evaluation of fusion result of micro process and macro process
Mapping from micro processes to macro processes is conducted in order to calculate the semantic distance of process design intent between macro and micro processes, and to realize the overall matching process between macro and micro processes. In this way, the general idea of mapping from micro process to macro process is rather straight-forward. First, the macro and micro processes are expressed as a set of working steps and machining operations, respectively, and described by semantics. Then, the machining operation/working step based on semantic representation is regarded as a node endowed with attributes that indicate the design intent of the element. In this way, a macro or micro process can be represented by a group of attribute nodes, and the fusion of micro and macro processes can be realized by finding the optimal matching between the two groups of nodes. Finally, the Kuhn-Munkres algorithm of the complete bipartite graph is used to achieve optimal matching between the two groups of nodes, so as to realize the mapping from micro process to macro process. Therefore, the mapping from micro process to macro process is divided into three parts: (1) process information representation based on semantics; (2) similarity evaluation of process design intent; and (3) overall matching of macro and micro processes. According to the matching results, a compatibility credibility evaluation model can then be established.

Process information representation based on semantics
In order to facilitate the application of the macro process, the reusable macro process (MAP) of target parts is composed of a working step (WS i ) with a temporal relationship as well as the working procedures and working orientations regarded as attributes of the working step. The reusable micro process (MIP(F)) of target parts is composed of the machining operation sequence (op kj ) of features. It can be expressed as follows: where working step (WS i ) includes the working step name, machining allowance, cutting tool, working orientation, and other information. In order to match the micro to the macro process, the related features, cutting tools, driving geometric offset, and machining coordinate system are applied in the machining operation op kj . It can be seen that the matching process between the machining operations in the reusable micro process and the working steps in the reusable macro process is actually the analysis of the process design intent of the machining operation. Since the macro process information is expressed by semantics, in order to analyze the design intent of machining operations based on semantics, the information used for matching machining operations or working steps is first organized through a semantic expression, and then the instantiated semantic fragments are constructed by concepts and attributes to describe the process information to be matched.
The semantic information of one machining operation or working step to be matched includes concepts, attributes, relationships, and instantiation information. The above organizational structure can be stored in the form of a semantic graph, which is formally expressed as KEO = (KE_ID, CT, AT, RT), where KE_ID represents the unique identifier of the machining operation or working step to be matched; CT is the concept table, which stores the concept node and its instantiation information in the machining operation or working step semantic graph; AT is the attribute table, which stores the attribute node and its instantiation information in the machining operation or working step semantic graph, as well as the associated concept node; and RT is the relation table, which stores the relation information between concepts in the machining operation or working step semantic graph.

Fusion strategy
The storage structure diagram of the semantic information description of the specific machining operation or working step is shown in Fig. 3.
Take two machining operations in an aircraft structure as an example, one rough machining operation and one finish machining operation. The instantiated storage fragments describing these two machining operations are shown in Fig. 4. The terms CID1 and CID2 respectively represent the concept segments of the two operations stored in CT; AID1 is the tool diameter attribute segment stored in AT, which belongs to CID1; and RID1 is the priority relationship segment between CID1 and CID2 stored in RT.
Through the semantic description of machining operations or working steps and other information, the semantics and attributes of the NC process information can be clearly described, thereby establishing a connection between lowlevel machining operation information and high-level process design intent.

Similarity evaluation of process design intention
After the process information is represented by the semantic graph, the similarity calculation of the semantic graph can be used to evaluate the similarity of the process design intent. Semantic graph similarity calculation includes concept similarity, concept relationship similarity, and attribute similarity.

Concept similarity
In concept matching, it is possible that the semantically matched concepts in the macro and micro processes use different semantic descriptions, such as the concept of "machining allowance" in the macro process, and the concepts such as "bottom offset" and "profile offset" in the micro process all satisfy its semantics. Therefore, in addition to the direct semantic representation of the process information, the concept set needs to be semantically extended, and the similarity between the calculated concepts C Ai and C Ij is converted into the similarity between each element in the extended word set CS Ai of the calculated concept C Ai and C Ij , and then the maximum value is taken as the semantic similarity of C Ai and C Ij , that is, for any two concepts C Ai and C Ij taken from C A and C I , respectively, the similarity of the concept names is: where c k is the number of characters contained in the common substring of two concepts.
Thus, the average name similarity between the concept sets C A = {C A1 , C A2 , …, C Am } and C I = {C I1 , C I2 , …, C In } in machining operations and the working steps is:

Concept relationship similarity
The calculation of the previous formula only calculates the similarity of concepts without considering the relationship between these concepts. In fact, the relationship between concepts can reflect the process context well. For example, WS a and WS b are at the same working orientation and WS a takes precedence over WS b . Therefore, the conceptual relationship must be considered in the matching process.
Assuming that the concept relation set starting from the concept C Ai is R Ai = {R Ai1 , R Ai2 , …, R Aip } and the concept relation set starting from the concept C Ij is R Ij = {R Ij1 , R Ij2 , …, R Ijq }, then for any two association relations R Aix and R Ijy , the similarity calculation formula is: Likewise, the relationship similarity between concept C Ai and concept C Ij is calculated as follows: Thus, the overall similarity of the relationship between machining operations and working steps is:

Attribute similarity
The attribute similarity is calculated by the following equation: where Sim n (A A , A I ) represents the name similarity between attribute A A and attribute A I , Sim v (A A , A I ) represents the numerical similarity between attribute A A and attribute A I , and type represents the data type of the attribute.
Similar to the above concept name similarity calculation, the concept attribute name similarity is calculated by using the concept attribute set Similarly, the overall attribute name similarity is: The numerical similarity of attributes is calculated as follows: The similarity between working step A of the macro process and machining operation I of the micro process can be obtained by comprehensively weighting its conceptual similarity, conceptual relationship similarity, and attribute similarity, expressed by δ, then:

Overall matching of macro process and micro process
Consider each working step in the macro process and each machining operation in the micro process as a node, the process information describing the working step/machining operation as the attribute of the node, and the fusion between the macro and micro processes can be seen as the optimal matching process of a complete bipartite graph composed of two node sets.
Let M 1 and M 2 denote the fused micro and macro processes, respectively, u i is the node of M 1 , and v j is the node of M 2 . The node u i in M 1 is paired with the node v j in M 2 . The similarity δ ij of each pair of nodes is calculated according to Eq. (11), and δ ij is used as the weight of the bipartite graph. Then, the weight matrix of the bipartite graph is the fusion matrix M between M 1 and M 2 , as shown in Fig. 5. When the number of nodes in the two groups is different, the matrix is supplemented with 0 to make the fusion matrix into a square matrix.
In order to obtain the best fusion results between the reusable macro and the reusable micro processes, the Kuhn-Munkres algorithm [28], which calculates the optimal matching of the weighted bipartite graph in graph theory, is used to calculate the optimal matching scheme of the fusion matrix. The Kuhn-Munkres algorithm is a classic algorithm for solving the optimal matching of bipartite graphs in graph theory. This algorithm transforms the maximum full matching problem by constantly finding the augmented path and giving a label to each vertex, so that matching of the bipartite graph can achieve the optimal matching.

Compatibility credibility evaluation model construction
According to the above optimal matching scheme, the similarity S of the fusion of a macro and a micro process is defined as the sum of the similarity of the optimal matching process nodes. The specific calculation is as follows: where δ m(j)j represents the similarity between the m(j)-th working step of macro process M 1 and the j-th machining operation of micro process M 2 , m(j) represents the number of rows optimally matched with the j-th column in Eq. (12), and n is the number of matching nodes. The NC process scheme of the target part is quickly generated by a macro process driven similar NC process fusion of multi-source and local structure, that is, it is obtained by the fusion of one macro process and multiple micro processes. In this way, the compatibility credibility evaluation model of the fusion results can be constructed by the similarity of the fusion results between multiple micro processes and one macro process. In addition, the more nodes included in the micro process, the greater the impact on the similarity of the fusion results. Therefore, considering the influence of nodes contained in different similar NC processes on the similarity of the fusion results, the specific calculation of compatibility credibility evaluation model C for the NC process scheme obtained by the fusion of the target part is as follows: where S k represents the similarity between the fusion results of the macro process and the k-th micro process of local structure, and n k represents the number of machining operations contained in the k-th micro process of local structure.

Optimization and adjustment of machining area
According to the calculation results of the compatibility credibility evaluation model, the fusion results of the macro and micro processes are divided into credible and incredible. When it is not credible, it indicates that the micro processes are incompatible with the macro process. It is necessary to reselect the macro or micro process and iterate the evaluation again until a compatible process scheme is obtained. When the fusion results are credible, the machining area corresponding to the process scheme needs to be optimized and adjusted from the geometric level.
The optimization and adjustment of the machining area produces an integration of the machining areas and optimizes the machining sequence. Due to the interaction between machining features, an efficient process scheme cannot be obtained only through the fusion of process semantics in the previous section. Therefore, under the guidance of a macro process, it is necessary to integrate the machining areas by fully utilizing the cutting tool's machining ability and obtain "one size fits all" result to the greatest possible extent. It is necessary to analyze the machining areas that may participate in the fusion by constructing the interaction relationship between features, combine machining areas calculated by their working step, and use a swarm

Fig. 5 Complete bipartite graph formed by process nodes
intelligence algorithm to optimize the machining sequence of the fused machining areas.

Interaction between features and calculation of machining area
The constraint relationship between machining areas is one of the most factors to be considered in the process of machining area fusion. According to the needs of machining region fusion, this paper establishes the constraint relationship between machining areas based on the interaction between features. Machining feature interaction can be divided into two types, design-coupled relation (R D ) and manufacturing-coupled relation (R M ), as shown in Fig. 6. The former associates manufacturing features through tolerance annotation, and the latter includes dependent relation and adjacent relation, which can reflect the machining sequence among machining features. The transformation of the abovementioned interaction relationship between features into the constraint relationship between machining areas needs to be established on the premise of the same tool axis direction, which is also related to the process intent, that is, different working steps show different machining areas, such as roughing and re-roughing, which are related to the cutting volume, while the profile finishing usually only considers the profile surface due to the small amount of radial machining. These calculations are related to the machining area.
The medial axis (MA) of the pocket is defined as the center track that can cover the whole region moving along the pocket contour. This track geometrically divides the pocket area and can represent the largest feasible cutting tool. Therefore, this paper uses the method of medial axis transformation to calculate the machining area. First, the original contour is obtained by offsetting the contour of the area to be machined according to the allowance. Then, the medial axis of the pocket is calculated, and the supplementary contour is obtained by making an arc based on the vertex of the medial axis. Finally, the machining area of the cutting tool is constructed by combining the original contour and the supplementary contour. Specifically, the method proposed in reference [29] is adopted. Figure 7 shows an example of calculating the machining area of a pocket. In Fig. 7a, the area C 3 needs to be processed, and the white line segment is its contour line L 1 . Figure 7b shows the medial axis MA calculated by the cutting tool R and its corresponding supplementary contour line L 2 . Then the machining areas C 1 and C 2 corresponding to the cutting tool R are calculated in combination with L 1 and L 2 , as shown in Fig. 7c.

Machining area fusion analysis based on design structure matrix
In NC process design based on machining features, the machining areas under different working steps are attached to machining features, which are related to the process information such as the working procedure and the working step. After planning the macro process, the information granularity of machining features is too The International Journal of Advanced Manufacturing Technology (2022) 120:2517-2535 coarse for process planning at the micro level. Therefore, in the process planning of the micro layer, the relationship between machining areas needs to be considered. In the current process planning system, this analysis is usually obtained by an experienced process designer. However, when the part structure is complex, the number of machining areas involved in the process is large, and the process designer cannot accurately obtain the constraint relationship between machining elements, that is, they cannot make an effective judgment on cutting tool adoption and machining sequence. The design structure matrix (DSM) [30] is a matrix representation method of object dependency proposed by Steward. In our study, the DSM is used to analyze the machining area, which is then divided into different modules according to the constraint relationship. Each module is independent from other modules, that is, the machining areas between modules do not affect each other. When one cutting tool is used for machining, the same module shall be processed together, when feasible. Therefore, the process designer only needs to consider the machining sequence of the machining areas between different modules, which will simplify the workload and improve the optimization efficiency and quality. Based on the existing algorithms and according to the constraint relationship of machining area, this paper proposes a machining area fusion analysis method based on DSM.
Assuming that there are n machining areas in the part process scheme fused according to the method in the previous section, the machining area sequence MR i = (i = 1, 2, …, n) is constructed according to the sequence in the process scheme, and the method shown in Fig. 8 is used to construct n × n-order square matrix A, where the main diagonal elements represent the machining region itself and the adjacent diagonal elements represent the constraint relationship with other machining regions. If the machining area MR i is processed before the machining area MR j , the element a ij = 1, otherwise a ij = 0, where i ≠ j. Figure 9 shows the initial DSM matrix constructed with 10 machining areas. The elements below the diagonal line indicate a positive relationship, and the elements above the diagonal line indicate a reverse relationship. If there are elements above and below the diagonal, it indicates that there is an association relationship between machining areas, but there is no machining sequence relationship.
After the initial matrix construction is completed, the machining area clustering and fusion analysis are required. This paper uses the algorithm in Table 1 to obtain the clustering matrix M, and conducts the fusion analysis based on the matrix M.
If P ij = 1 in the reachable matrix P, it means that there is a non-zero length path from element i to element j. If the j-th column of the matrix P is a non-zero element at the i 1 -th, i 2 -th, …, i l -th row, then element j is reachable to elements i 1 , i 2 , …, i l , that is, in the process of using the same cutting tool, the machining of the element j can pass through at most l steps in the machining of element i. The clustering matrix  Table 1, as shown in Fig. 10. It can be seen from the above that after clustering, the machining areas in the process can be divided into several sub-blocks. The machining areas in the same sub-block have a constraint relationship, and can be processed by the same cutting tool simultaneously. The machining areas in different sub-blocks do not have a constraint relationship, so processing can be arranged separately. Therefore, in the subsequent process optimization, the process designer only needs to consider the machining sequence between the sub-blocks, which greatly simplifies the complexity of the modification.

Machining sequence optimization based on swarm intelligence
After the fusion of the NC processes is completed, the machining sequence of the machining areas under each working step is less related to the process scheme. Thus, the swarm intelligence algorithm can be used to optimize the geometric path between the machining areas. At the same time, through the aforementioned analysis, the machining priority relationship and the internal constraint relationship can be obtained and used as the initial value to effectively reduce the complexity of the optimization process.

The machining sequence representation and optimization goal
Given a machining area group of working step S = {c 1 , c 2 , …, c n }, S is a set of machining areas belonging to the working step in all feature of the part in the NC process chains. After sorting the machining areas in a certain order, a group of machining area sequences q(c 1´, c 2´, …, c n´) , where c i´ ∈ S and 1 ≤ i ≤ n, is obtained. The sequence represents a machining path between machining areas. The positions between machining areas can be arranged randomly.
In theory, there are n! kinds of machining area sequences, and the machining areas need to meet the constraint relationship. Therefore, the actual number of machining area sequences should be less than n!. Since each machining area has its own code, in order to simplify the problem description, the path sequencing problem of the machining area is transformed into n positive integer sequencing problems. In this way, q(1, 2, …, n) can be used to represent q(c 1´, c 2´, …, c n´) . The solution space of the machining area sequence is expressed as: D = {(i 1 , i 2 , …, i n )|i j represents the j-th element number of the machining operation sequence (c 1´, c 2´, …, c n´) , and i j ≠ i m , j ≠ m, 1 ≤ j ≤ n, and 1 ≤ m ≤ n}. Then, the initial solution is set as (1, 2, …, n), representing the initial machining region sequence of c 1 , c 2 , …, c n .
Given a machining area group, a set of machining area sequences is solved under the condition of meeting machining constraints, and following the shortest machining path of the machining area sequence. In mathematical, the model is described as follows: where d(c ij , c i(j+1) ) represents the distance between the machining operation c ij and c i(j+1) .

Acceptance criteria
In order to evaluate the pros and cons of the new solution generated in the i-th path optimization iteration compared with the initial solution, the cost difference between the new solution and the initial solution is calculated by the following equation: where S i´ and S i are the new solution and initial solution produced by the i-th iteration, respectively, and its acceptance function is constructed using Metropolis probability acceptance criteria.
where t k is the annealing temperature, and random(0, 1) can produce decimals in the interval [0,1].

Machining area sequence optimization based on chaos-simulated annealing
The inherent ability of the simulated annealing (SA) algorithm to avoid falling into local optimization makes it one of the most prominent algorithms for solving complex nonlinear problems. In a traditional SA, the most important step is generation of the random initial solutions. Most studies have shown that random sequences can affect the convergence speed of the SA algorithm. Chaos is a motion similar to random motion. It can traverse all possible states according to its own laws without repeating. It has the characteristics of randomness, ergodicity, and regularity. It uses chaotic variables for an optimized search and has good global search capabilities. By introducing chaotic variables into the SA algorithm and using the chaotic system to construct a chaotic sequence, the problem to be solved is transferred to the chaotic space, which can improve the convergence speed and global search performance of the SA algorithm. Therefore, this paper introduces chaotic variables into the SA algorithm and replaces the Gaussian distribution with chaotic random sequence numbers to expand the random search space. The chaotic random sequence function is generated by using Logistic mapping, in which the Logistic equation is a simple nonlinear parabolic equation, expressed as: where λ represents the control parameter and λ ∈ (0, 4], when 3.57 < λ ≤ 4, the random sequence generated by Logistic equation is in a chaotic state, and λ = 4 is used to ensure that the random sequence generated by the Logistic equation is in a completely chaotic state.
The chaotic SA algorithm is described in detail below, and the steps are as follows: Step 1. Initialize cooling progress parameters (including initial cooling temperature t s , termination temperature t e , Markov chain length L k , and attenuation coefficient σ), and generate random initialization machining operation sequence q 0 .
Step 2. Under the control of the current cooling temperature t s and the number of iterations i = 1,2,…, L k , repeat steps 3 to 5 for each cooling temperature t s .
Step 3. For the initial machining operation sequence q i under the current iteration, a new machining operation sequence q i ' is generated by referring to the chaotic random sequence generation function; to ensure the effectiveness of each newly generated solution, q i ' is further checked and screened according to the DSM matrix (constraint relationship between machining regions).
Step 4. Calculate the functional cost difference Δg i between the new machining operation sequence q i ' and the initial machining operation sequence q i according to Eq. (16).
Step 5. According to Eq. (17), judge whether to accept the new machining operation sequence q i ', if accepted, then q i+1 = q i '. Otherwise, q i+1 = q i .
Step 6. After L k iterations, use the attenuation function to perform annealing to cool down.
Step 7. Judge whether the iterative termination condition is satisfied. If it is satisfied, then the current solution is the optimal solution, the optimal solution is output, and the program ends. Otherwise, the program returns to step 2 and continues the iterative calculation. When there is no change in the length of several adjacent Markov chains, the iteration is exited.
In the chaotic SA algorithm, the cooling schedule is a set of parameters used to control the process. A reasonable selection of the cooling schedule parameters can improve the performance of the algorithm and reduce the CPU running time. Its parameters mainly include an initial temperature t s , an attenuation function, Markov chain length L k , and a stopping criteria. These criteria are determined as follows: 1. Initial temperature In the traditional SA algorithm, in order to make the initial random search productive, a higher initial temperature is usually selected, although this can create the need for numerous redundant iterations. First, assume the probability of accepting the deteriorating solution is p r0 , according to the Metropolis probability acceptance criterion p r0 = exp(-Δg i /t k ), so it can be deduced that t k = -Δg i / lnp r0 , and since the greater the acceptance probability of the deteriorating solution, the easier it is to reach the quasi-equilibrium. Therefore, a value of p r0 = 0.8 is selected.

Attenuation function
Selecting a smaller temperature attenuation coefficient can ensure the quality of the final solution, but it will increase the CPU running time. For the NC process design, the amount of calculations is not large, which ensures the quality of the solution and less considerate of the calculation burden. Therefore, a smaller temperature attenuation coefficient is selected, and the attenuation function is expressed as: where t k+1 and t k represent the k + 1-th iteration temperature and the k-th iteration temperature, respectively, σ represents the attenuation coefficient, and the selection range of σ is usually 0.6-0.95. In order to not only ensure the quality of the final solution but also to reduce the CPU running time, a value of σ = 0.7 is selected.

Markov chain length L k
Since there is an exponential growth relationship between the solution scale n and the solution space, and in the field of machining process, the existence of process constraints will limit the solution space, a value of L k = 50n is selected.

Stopping criteria
The stopping criterion refers to the rule used to control the final stop of the algorithm. If there is no change in the length of several adjacent Markov chains, the algorithm terminates. Under a reasonable initial temperature and Markov chain length parameters, this method can guarantee both the quality of the optimal solution and the efficiency of CPU operation, but it is not suitable for largescale combinatorial optimization problems. The number of machining operations included in each working step of conventional parts is in the range of tens to hundreds, and the scale is not large. Therefore, when the solution does not change in the length of m = 1 successive Markov chain, the algorithm is terminated, and m represents the number of times that the solution produces no change in the length of the Markov chain. (19) t k+1 = t k , k = 0, 1, 2, ...

Case study
To verify the feasibility and effectiveness of our approach, the similar NC process fusion algorithm of multi-source local structure is implemented on the platforms of Microsoft Visual Studio 2008 and CATIA V5 R21 component application architecture (CAA). The test is executed on a PC with Intel Core i3 CPU 3.40 GHz and 4 GB memory. The reusable NC processes in the process instances are applied to the target part through the inheritance mechanism. The specific inheritance mechanism adopts the previous research work of our team [27]. On this basis, the following is the experimental introduction of NC process fusion, adjustment, and optimization. Figure 11 shows a target plate part CP, a reusable macro process, and a reusable micro process from the search results selected. The effectiveness of the algorithm is verified through the fusion process and results. Table 2 shows the reusable macro process information of the similar part SP, including five working steps of rough milling pocket, semi-finish milling pocket contour, and finish milling pocket. Tables 3 and 4 are the reusable micro process information of similar feature SF, including four machining operations such as pocketing and contouring.

Compatibility evaluation case
The similarity value of macro and micro process fusion is calculated (as shown in Table 5), and the fusion matrix M is as follows: Using the Kuhn-Munkres algorithm, an optimal matching solution M between the macro and micro processes is obtained, and then matches corresponding to a low similarity value are removed. Finally, M = {(op 1 , WS 2 ), (op 3 , WS 5 )} is determined. According to the optimal matching weight, the similarity value S = 0.620 of the fusion of the two processes is calculated by Eq. (13), and it can be judged that the two processes are compatible. In addition, it can be seen that op 2 and op 4 are not matched by the macro process, so it is necessary to adjust the macro process and add the additional working steps. In this example, the working steps of D10 and D3 cutting tools are added for supplementary machining. Figure 13 shows an example of machining area fusion of parts-Part1 and Part2-in Fig. 12. Part1 contains 15 submachining areas SMR in a certain working step roughing, as shown in Fig. 12a. Through the analysis of the interaction relationship between features, the DSM matrix is constructed as shown in Fig. 13a. It can be seen that 15 submachining areas can be combined into one machining area MR to support more efficient machining. Compared with  In the same way, it is also possible to analyze other machining stages, such as the finish milling inner shape stage. Thus, the sub-machining area of each stage under the macro process can be fused and analyzed, and the machining area can be dynamically combined according to the process intent and manufacturing resources. The combined sub-machining areas can inherit the interaction relationship of its features, and its machining method (such as depth-first or layered machining) is related to the geometric characteristics of the sub-machining area. Figure 14 shows a more complex example part, Part3, to describe the feasibility and effectiveness of the machining sequence optimization method. Part3 is an aircraft structural part, which is mainly based on pocket machining. There will be sub-features in the pocket features, such as sags and bosses, which are processed in the form of multilayer pockets after the machining areas are merged. In addition, the macro process is relatively standardized, mainly using the working steps of roughing, finish milling bottom, finish milling corner, and finish milling contour. Therefore, the machining sequence has a greater impact on its process scheme. Optimization tests are performed on the machining area sequence in three of the working steps. Figure 14b shows the optimized tool path (red line) of the machining areas under roughing, which contains 69 machining areas. The pink line in Fig. 14c is the optimized result of the machining areas under the finish milling bottom. After the roughing and finish milling bottom stages, the residual material at the 263 corners is processed, as shown by the green line in Fig. 14d. Table 6 shows the comparison of the results for the tool paths of machining areas in the roughing, finish milling bottom, and finish milling corner stages when they are not optimized and optimized by the machining sequence optimization method. Compared with the non-optimized method, the total tool path length of the roughing and finish milling bottom stages is reduced by 2877.1 mm and 2448.1 mm, respectively, and the efficiency has increased by 21.3% and 17.1%, respectively. After the machining areas are optimized under the finish milling contour stage, the tool path length is greatly reduced, and the machining efficiency is improved significantly. In general, the machining efficiency of the machining area under each working step has been improved to a certain extent after the machining sequence is optimized. Therefore, the machining sequence optimization method can effectively shorten the tool path length, thereby reducing machining time and improving machining efficiency.

Design efficiency analysis
The same designer carries out the NC programming test on the example part shown in Fig. 14 via manual programming and programming with our approach respectively, and the results are shown in Table 7. The NC process design of the  Each user interaction takes about 1.5 s on average, and it takes approximately 235 min to complete the part. Among them, the user interaction time is mainly used to drive geometric construction and process parameter setting, without considering the time required for process analysis. When our method is adopted, 91 user interactions are required for system operation and process fine-tuning, and approximately 30 min of system running time is required. Therefore, it takes approximately 32 min to complete the NC process design of the part. Therefore, compared with the interactive programming method, the programming efficiency can be improved nearly sixfold by employing our method. In this paper, the frame part is tested. It can also be seen that the more complex the parts are, the more significant the improvement of programming efficiency.

Conclusion and future work
This paper proposes an efficient NC process scheme generation method based on reusable macro and micro process fusion. First, according to the calculation of the semantic distance of the process design intent, the micro processes are mapped to the macro process to realize the fusion of the macro and micro processes, and the compatibility credible evaluation model is established to evaluate the compatibility of the fusion result. Then, when the fusion result is credible, the machining area corresponding to the process scheme is optimized and adjusted at the geometrical level. The optimization adjustment of the machining area mainly realizes the merging of the machining area and the optimization of the machining sequence. Finally, example parts are used for performance testing. The experimental results show that this method improves the design efficiency by quickly generating the process scheme, and optimizes the machining path to improve the machining efficiency.
The next step of the research work includes the following: (1) at present, the machining areas are mainly optimized and adjusted by the method; for other attributes (cutting tools, cutting parameters, etc.), further optimization algorithms need to be designed, such as considering the depth of cut to optimize the number of machining layers; (2) the current optimization goal is machining time, and other optimization goals, such as energy consumption, can be considered in the future; this becomes a multi-objective optimization problem to obtain a high-efficiency and low-energy NC process scheme.