Workshop manufacturing system scheduling method based on place timing Petri network and Monte Carlo tree search
By using the scheduling method of searching the Petri net and Monte Carlo tree by library in the workshop manufacturing system, the problem that the existing technology is difficult to find effective solutions in large-scale system scheduling is solved, and efficient workshop manufacturing system scheduling is achieved.
Patent Information
- Application Number
- CN202411933831.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-26
- Publication Date
- 2025-04-15
AI Technical Summary
The existing workshop manufacturing system scheduling methods are difficult to find effective solutions within acceptable time when dealing with large-scale systems, and the mathematical planning methods describe the actual constraints of complex systems with limited descriptions.
The scheduling method based on the Petri Net and Monte Carlo tree search is adopted to describe the system activities, resources and constraints through Petri Net modeling, and the Monte Carlo tree search algorithm is combined with the Monte Carlo tree search algorithm to build the search tree from the initial state until the target state is found, and the scheduling of the workshop manufacturing system is completed.
This method can effectively reduce the search demand of state space, speed up the calculation and analysis speed, controllable algorithm time, and gradually approach the global optimal solution in theory, and is suitable for scheduling of large-scale workshop manufacturing systems.
Smart Images

Figure CN119831274A_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the field of workshop manufacturing system modeling and scheduling, and specifically relates to a workshop manufacturing system scheduling method based on library place timed Petri net and Monte Carlo tree search. Background Art
[0002] In a workshop manufacturing system, different products often need to go through the same process, which means that one type of equipment may be required to undertake the processing tasks of multiple products. In this case, problems such as equipment sharing, parallel operation of equipment, and process competition may arise. Unreasonable scheduling may lead to equipment shutdown and production interruption, resulting in economic losses to the enterprise, which makes scheduling a key issue that needs to be solved in the workshop manufacturing system. An effective scheduling solution can greatly leverage the advantages of the workshop manufacturing system, improve the production efficiency of the enterprise, reduce production costs, reduce equipment idle time, and improve the economic benefits of each equipment.
[0003] In solving the problem of scheduling such manufacturing systems, the article "Post-processing time-aware optimal scheduling of single robotic cluster tools" uses a mathematical programming method to schedule the system. Although mathematical programming methods can find the global optimal solution, they have certain limitations for complex systems because it is difficult to mathematically describe some practical constraints of complex scheduling systems related to material handling systems, resource sharing situations, and routing flexibility. Therefore, mathematical models often rely heavily on the assumptions and simplifications they are based on, such as infinite buffer sizes or ignoring material handling systems.
[0004] Petri net is a mathematical tool proposed by Dutch mathematician Carl Adam Petri in 1962 to describe the behavior of concurrent systems. In workshop manufacturing systems, there are a large number of concurrent and interactive actions between various machines, workstations, components and control systems. As a tool for formal description and analysis, Petri net has both mathematical expression and graphical representation, which can effectively describe the discrete, conflict, asynchronous, concurrent, deadlock and other phenomena in the processing of workshop manufacturing systems. Therefore, Petri net is widely used in the modeling and analysis of these complex systems. The article "Scheduling Robotic Cellular Manufacturing Systems With Timed Petri Net, A*Search, and Admissible Heuristic Function" proposes a strategy to combine the modeling ability of Petri net with A* search to schedule the cellular manufacturing system in the workshop manufacturing system, and uses an admissible heuristic function to ensure the optimal scheduling result. However, since the workshop manufacturing system is an NP-hard problem, as the problem size grows, the state space explodes exponentially. This method cannot handle large-scale workshop manufacturing systems within an acceptable time, which is also a problem faced by existing methods. Summary of the invention
[0005] In view of the above problems, the object of the present invention is to provide a workshop manufacturing system scheduling method based on place timed Petri net and Monte Carlo tree search, so as to improve the production efficiency of the workshop manufacturing system.
[0006] The specific technical solution for achieving the purpose of the present invention is:
[0007] A scheduling method for a workshop manufacturing system based on place timed Petri net and Monte Carlo tree search, comprising the following steps:
[0008] Step 1: Model the workshop manufacturing system based on Petri nets to obtain the corresponding workshop manufacturing system scheduling model of the library-timed Petri;
[0009] Step 2: Obtain the place parameters in the place-timed Petri scheduling model for the workshop manufacturing system, and construct the association matrix between the place and the transition in the scheduling model;
[0010] Step 3: Based on the association matrix and place parameters obtained in step 2, the Monte Carlo tree search algorithm is used to build a search tree from the initial state until the target state is found to complete the scheduling of the workshop manufacturing system.
[0011] Compared with the prior art, the present invention has the following beneficial effects:
[0012] This solution uses Petri nets to model the workshop manufacturing system, which can achieve a simple form to concisely represent the system's activities, resources and constraints, and further better and more clearly describe the system scheduling problem; the Monte Carlo tree search algorithm technology is used in scheduling, which can effectively reduce the search requirements for the state space, speed up the model calculation and analysis, and the algorithm time is controllable. The goal of the Monte Carlo tree search algorithm is not to find the global optimal solution, but to obtain the optimal solution based on the local. Even if it is terminated early, an ideal solution can be obtained. In theory, as time extends or even approaches infinite time, the algorithm can gradually approach the global optimal solution.
[0013] The present invention is further described below in conjunction with specific implementation modes. BRIEF DESCRIPTION OF THE DRAWINGS
[0014] Figure 1 The present invention is a flow chart of a workshop manufacturing system scheduling method based on place timed Petri net and Monte Carlo tree search.
[0015] Figure 2 Schematic diagram of a Petri net model of a workshop manufacturing system in an embodiment of the present invention.
[0016] Figure 3 It is a schematic diagram of an example of a workshop manufacturing system in an embodiment of the present invention.
[0017] Figure 4 for Figure 3 Schematic diagram of the Petri net model of the workshop manufacturing system. DETAILED DESCRIPTION
[0018] Example
[0019] The technical solutions in the embodiments of the present invention will be described clearly and completely below in conjunction with the accompanying drawings in the embodiments of the present invention. The described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0020] As shown in this application and claims, unless the context clearly indicates an exception, the words "a", "an", "an kind" and / or "the" do not refer to the singular and may also include the plural. Generally speaking, the terms "include" and "comprise" only indicate the inclusion of the steps and elements that have been clearly identified, and these steps and elements do not constitute an exclusive list. The method or device may also include other steps or elements.
[0021] Unless otherwise specifically stated, the relative arrangement, numerical expressions and numerical values of the parts and steps set forth in these embodiments do not limit the scope of the present application. At the same time, it should be understood that, for ease of description, the sizes of the various parts shown in the accompanying drawings are not drawn according to the actual proportional relationship. The technology, method and equipment known to those of ordinary skill in the relevant field may not be discussed in detail, but in appropriate cases, the technology, method and equipment should be considered as a part of the authorization specification. In all examples shown and discussed here, any specific value should be interpreted as being merely exemplary, rather than as a limitation. Therefore, other examples of exemplary embodiments may have different values. It should be noted that similar reference numerals and letters represent similar items in the following drawings, so that once a certain item is defined in an accompanying drawing, it does not need to be further discussed in subsequent drawings.
[0022] Combination Figure 1 A scheduling method for a workshop manufacturing system based on a place timed Petri net and a Monte Carlo tree search comprises the following steps:
[0023] Step 1: Model the workshop manufacturing system based on Petri nets to obtain the corresponding workshop manufacturing system scheduling model of the library-timed Petri;
[0024] In Petri nets, a transition t represents an event, and the enablement of the transition is used to represent that the prerequisites for the event to occur are met. The input place of t represents the local prerequisite state required for the event to occur, and the input function from the input place to t is used to define the number of times these local prerequisite states are required to be realized, and the realization of the local state is represented by the number of tokens contained in the place. Therefore, the enablement of t is not only related to its input function, but also to the number of tokens in all its input places. Therefore, the enabling condition of the transition is: if and only if:
[0025] The occurrence of an event in which all preconditions are met will "consume" these precondition states and change the local states related to the event. In Petri nets, the emission of enabled transitions is usually used to describe the occurrence of events. The consumed precondition states and their number are defined by the input function of the transition and are represented by removing the corresponding number of tokens from the input place; the resulting state and its number are determined by the output function and are represented by adding the corresponding tokens to the output place. The identification of the Petri net changes due to the reduction of tokens in the input place and the increase of tokens in the output place. For this reason, the following transition emission rule is introduced: the emission of transition t enabled under the identification M will generate a new identification:
[0026] M':
[0027] Table 1: Petri net dynamic operation algorithm
[0028]
[0029] In this embodiment, S 3 PN network is a common Petri network with arc weight of one, which is composed of multiple network structures sharing resources. 3 PN network models the workshop manufacturing system and constructs the workshop manufacturing system scheduling model with library-timed Petri: Current Status
[0030] Among them, P stands for places, which represent various resources and operations in the workshop manufacturing system, such as: the start place represents the material discharge area, the resource place represents various robots and processing centers, and the activity place represents various processing operations; T stands for transition, which represents the occurrence of events in the workshop manufacturing system, such as the completion of an operation; F stands for the directed arc between transition and place, which indicates which operations will be reached after an event occurs or which events will be triggered by the operation; W stands for the weight between the directed arcs; D stands for the time required for the operation place to complete the operation; M stands for the distribution of tokens in the Petri net diagram; R stands for the token remaining time matrix, that is, the time that the resources in an operation still need to occupy;
[0031] The places in the model are divided into resource places, active places and idle places;
[0032] The number of tokens in the free places represents the maximum number of concurrent operations in a production sequence. The resource places represent the resource components in the production sequence, including robots and production equipment. The active places represent the operations of processing parts in the production sequence. In the actual industrial production process, various operations of the production sequence are always carried out around the resource components. Therefore, in the corresponding Petri net model, the tokens also evolve around the resource places during the transfer process in the places.
[0033] The transitions in the model represent the end and start of operations in the workshop manufacturing system, and the relationship arcs between places and transitions represent the rules in the workshop manufacturing system. This modelizes the actual workshop manufacturing system, and then analyzes and processes the Petri net model to realize the research and control of the actual system.
[0034] Step 2: Obtain the place parameters in the place-timed Petri scheduling model for the workshop manufacturing system, and construct the association matrix between the place and the transition in the scheduling model:
[0035] Step 2-1, initialize the association matrix M, the element M in the matrix i,j Represents the library place p i and changesj The association relationship is set, and all elements in the matrix are set to 0;
[0036] Step 2-2, determine the correlation between the library and the transition, and update the correlation matrix M:
[0037] When the library i and changes j There exists a i to j , then M i,j Set to -1, when the library p i and changes j There exists a j to p i , then M i,j Set to 1, traverse all libraries and transitions, and complete the update of the association matrix M.
[0038] According to Figure 2 , Table 1 analysis, in actual operation, the program requires two input files, of which the matrix.txt file is used to store the transposed association matrix corresponding to the Petri net model (the association matrix of a simple net can be written directly, and the association matrix of a complex net is generated by INA software. Note that there is a transposition in the generation process, that is, rows represent transitions and columns represent places); the other init.txt file is used to store the initial identification of the corresponding model. By reading the information of the above two files, the program can obtain all the data information of the Petri net model;
[0039] The first line of the init file is the initial identifier of the Petri net. The number of tokens in each place in the initial state is the number in the corresponding position of the first line. Figure 2 There are 21 places in the init file, and in the initial state, the places numbered 1, 8, 14, 15, 16, 17, 18, and 19 each have a token, so the values of the corresponding positions of these places are 1, and the values of the corresponding positions of the remaining places without tokens are 0. Each value in the file is separated by a single space (Note: there can be more than one token in a place). The second line of the init file is the cost required for the operation of each place in the Petri net (that is, the shortest time required for the place to complete the corresponding operation process). Combined with the following Table 1, the data of place 2 p2 is 3, indicating that the cost of running the operation represented by this place is 3. Each operation place corresponds to an operation cost, and if there is no operation cost, it is 0. (The places representing buffers or resources have no operation costs). The third line of the init file is the target identifier of the Petri net, that is, the final state required to be reached, which is the same as the initial identifier. The number of tokens contained in each place in the target state is the number of the corresponding position. Figure 2In the target state, there is a token in the places numbered 1, 8, 14, 15, 16, 17, 18, 19, 20, and 21. The values of the corresponding positions of these places are 1, and the values of the corresponding positions of the remaining places are 0 because there is no token.
[0040]
[0041] The matrix file is used to store the transposed association matrix corresponding to the Petri net model. The number of rows is the number of transitions t, and the number of columns is the number of places p. Figure 2 There are 14 transitions from t1 to t 14 , 21 places are p1 to p 21 , so the matrix file has 14 rows and 21 columns. 1 indicates an arc from a transition to a place (i.e., the triggering of a transition will increase the number of tokens in a place, so its corresponding value is positive), and the arc weight is 1; -1 indicates an arc from a place to a transition (i.e., the triggering of a transition will reduce the number of tokens in a place, so its corresponding value is negative), and the arc weight is 1; a value of 0 indicates that there is no arc connecting the transition and the place.
[0042] Step 3: Based on the association matrix and place parameters obtained in step 2, the Monte Carlo tree search algorithm is used to build a search tree from the initial state until the target state is found to complete the scheduling of the workshop manufacturing system:
[0043] Step 3-1, initialize the Monte Carlo search tree, set the initial state S, and use S as the root state S of the Monte Carlo search tree root ;
[0044] Step 3-2: Determine the root status S root Is it the target state? If so, build a path from the initial state S0 to the target state and terminate. Otherwise, execute the next step.
[0045] Step 3-3: Determine whether the number of iterations is exhausted. If so, Update the root state, reset the number of iterations, and return to step 3-2. Otherwise, execute the next step. In the formula, N(S′) represents the number of visits to state S', S' is the subsequent state of the initial state S, and C(S root ) indicates S root The sub-state collection of
[0046] Step 3-4: According to the state transition equation of the Petri net assigned by the library, determine whether the current state is fully expanded. If so, Search down the search tree, and then go to the next step. Where Q(S') represents the reward value of state S', and c is the balance coefficient.
[0047] The reward function in this embodiment is:
[0048]
[0049] Step 3-5: Combine the association matrix obtained in step 2 with the state transition equation of the timed Petri net to obtain the state to be expanded of the current state, select one of the states, and add it to the search tree and the subset of the current state;
[0050] Step 3-6: Randomly expand the state to be expanded selected in step 3-5 until the termination state. If the termination state is a deadlock state, return a value of 0; otherwise, return the corresponding completion time.
[0051] Step 3-7: Update the state information selected in step 3-5 and its state to the root state S according to the value returned in step 3-6 root The information of all states on the path is obtained and returns to step 3-3.
[0052] Table 2: Example of code for generating the final Monte Carlo tree search method based on Petri net in the embodiment
[0053]
[0054]
[0055]
[0056] In this embodiment, a workshop manufacturing system is used as an example. Figure 3 As shown, it includes three robot arms (R1, R2, R3): each robot can hold one product at the same time and four processing centers (M1, M2, M3, M4): each machine can process two products at the same time), as well as three input buffers (I1, I2, I3) and three output buffers (O1, O2, O3). The system is mainly divided into three production lines with three robot arms as the core, and its operation process is as follows:
[0057] J1:I1→R1→M1→R2→M2→R3→O1
[0058] or I1→R1→M3→R2→M4→R3→O1
[0059] J2:I2→R2→M2→R2→O2
[0060] J3:I3→R3→M4→R2→M3→R1→O3
[0061] Using Petri nets Figure 3 The workshop manufacturing system shown in the figure is modeled to obtain the Petri net model as shown in Figure 4 As shown:
[0062] The total set of places P = {p1-p 26}, where the resource library P R ={p 20 , p 21 , p 22 , p 23 , p 26}, free place P I ={p1,p5,p 14}, activity place P A ={p2, p3, p4, p5, p6, p7, p8, p9, p 10 , p 11 , p 12 , p 13 , p 15 , p 16 , p 17 , p 18 , p 19}.
[0063] The attribute values corresponding to each place in the Petri net model established above are read, and the association matrix between the place and the transition in the Petri net model is obtained.
[0064] The attribute values obtained in this embodiment are:
[0065]
[0066] Then the correlation matrix is:
[0067]
[0068] Based on the above association matrix, the Monte Carlo tree search algorithm is used to run from the starting node S0 until the target node is found, thus completing the scheduling of the workshop manufacturing system.
[0069] Table 3: Figure 4 The scheduling scheme change trigger sequence and corresponding trigger time of the Petri net model shown in the figure
[0070]
[0071]
[0072] The present invention takes the timed Petri net model of the workshop manufacturing system as the object, adopts the Monte Carlo tree search method to schedule the system, and can obtain a system scheduling solution that meets the requirements without expanding all the nodes of the system.
[0073] The present invention also provides a workshop manufacturing system scheduling system based on place timed Petri net and Monte Carlo tree search, comprising the following modules:
[0074] Model building module: used to model the workshop manufacturing system based on Petri nets and obtain the corresponding workshop manufacturing system scheduling model of the library-timed Petri;
[0075] Association matrix determination module: used to obtain the place parameters in the place-timed Petri workshop manufacturing system scheduling model, and to construct the association matrix between the place and the transition in the scheduling model;
[0076] Scheduling module: It is used to build a search tree from the initial state based on the acquired association matrix and library parameters using the Monte Carlo tree search algorithm until the target state is found, thereby completing the scheduling of the workshop manufacturing system.
[0077] The present invention also provides a computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the following steps when executing the computer program:
[0078] Step 1: Model the workshop manufacturing system based on Petri nets to obtain the corresponding workshop manufacturing system scheduling model of the library-timed Petri;
[0079] Step 2: Obtain the place parameters in the place-timed Petri scheduling model for the workshop manufacturing system, and construct the association matrix between the place and the transition in the scheduling model;
[0080] Step 3: Based on the association matrix and place parameters obtained in step 2, the Monte Carlo tree search algorithm is used to build a search tree from the initial state until the target state is found to complete the scheduling of the workshop manufacturing system.
[0081] The present invention also provides a computer storable medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the following steps are implemented:
[0082] Step 1: Model the workshop manufacturing system based on Petri nets to obtain the corresponding workshop manufacturing system scheduling model of the library-timed Petri;
[0083] Step 2: Obtain the place parameters in the place-timed Petri scheduling model for the workshop manufacturing system, and construct the association matrix between the place and the transition in the scheduling model;
[0084] Step 3: Based on the association matrix and place parameters obtained in step 2, the Monte Carlo tree search algorithm is used to build a search tree from the initial state until the target state is found to complete the scheduling of the workshop manufacturing system.
[0085] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.
Claims
1. A workshop manufacturing system scheduling method based on place timed Petri net and Monte Carlo tree search, characterized in that: The following steps are involved: Step 1: Model the workshop manufacturing system based on Petri nets to obtain the corresponding workshop manufacturing system scheduling model of the library-timed Petri; Step 2: Obtain the place parameters in the place-timed Petri scheduling model for the workshop manufacturing system, and construct the association matrix between the place and the transition in the scheduling model; Step 3: Based on the association matrix and place parameters obtained in step 2, the Monte Carlo tree search algorithm is used to build a search tree from the initial state until the target state is found to complete the scheduling of the workshop manufacturing system.
2. The workshop manufacturing system scheduling method based on place timed Petri net and Monte Carlo tree search according to claim 1 is characterized in that: The scheduling model of the workshop manufacturing system with the timed Petri in step 1 is specifically: Using Petri net subclass S 3 PN network models the workshop manufacturing system and constructs the workshop manufacturing system scheduling model with library-timed Petri: Current Status Among them, P represents the place, which represents various resources and operations in the workshop manufacturing system, T represents the transition, which represents the occurrence of events in the workshop manufacturing system, F represents the directed arc between the transition and the place, W represents the weight between the directed arcs, D represents the time required for the operation place to complete the operation, M represents the distribution of tokens in the Petri net diagram, and R represents the token remaining time matrix; The places in the model are divided into resource places, active places and idle places; The number of tokens in the free place represents the maximum number of concurrent operations in a production sequence. The resource place represents the resource components in the production sequence, including robots and production tools. The active place represents the operations of processing parts in the production sequence. The transitions in the model represent the end and start of operations in the workshop manufacturing system, and the directed arcs between places and transitions represent the rules in the workshop manufacturing system.
3. The workshop manufacturing system scheduling method based on place timed Petri net and Monte Carlo tree search according to claim 2 is characterized in that: The association matrix between places and transitions in the scheduling model constructed in step 2 is specifically: Step 2-1, initialize the association matrix M, the element M in the matrix i,j Represents the library place p i and changes j The association relationship is set, and all elements in the matrix are set to 0; Step 2-2, determine the correlation between the library and the transition, and update the correlation matrix M: When the library i and changes j There exists a i to j , then M i,j Set to -1, when the library p i and changes j There exists a j to p i , then M i,j Set to 1, traverse all libraries and transitions, and complete the update of the association matrix M.
4. The workshop manufacturing system scheduling method based on place timed Petri net and Monte Carlo tree search according to claim 2 is characterized in that: In step 3, the Monte Carlo tree search algorithm is used to construct a search tree from the initial state until the target state is found to complete the scheduling of the workshop manufacturing system, specifically: Step 3-1, initialize the Monte Carlo search tree, set the initial state S, and use S as the root state S of the Monte Carlo search tree root ; Step 3-2: Determine the root status S root Is it the target state? If so, build a path from the initial state S0 to the target state and terminate. Otherwise, execute the next step. Step 3-3: Determine whether the number of iterations is exhausted. If so, Update the root state, reset the number of iterations, and return to step 3-2. Otherwise, execute the next step. In the formula, N(S′) represents the number of visits to state S', S' is the subsequent state of the initial state S, and C(S root ) indicates S root The sub-state collection of Step 3-4: According to the state transition equation of the Petri net assigned by the library, determine whether the current state is fully expanded. If so, Search down the search tree, and then go to the next step. Where Q(S') represents the reward value of state S', and c is the balance coefficient. Step 3-5: Combine the association matrix obtained in step 2 with the state transition equation of the timed Petri net to obtain the state to be expanded of the current state, select one of the states, and add it to the search tree and the subset of the current state; Step 3-6: Randomly expand the state to be expanded selected in step 3-5 until the termination state. If the termination state is a deadlock state, return a value of 0; otherwise, return the corresponding completion time. Step 3-7: Update the state information selected in step 3-5 and its state to the root state S according to the value returned in step 3-6 root The information of all states on the path is obtained and returns to step 3-3.
5. A workshop manufacturing system scheduling system based on place timed Petri net and Monte Carlo tree search, characterized in that: Includes the following modules: Model building module: used to model the workshop manufacturing system based on Petri nets and obtain the corresponding workshop manufacturing system scheduling model of the library-timed Petri; Association matrix determination module: used to obtain the place parameters in the place-timed Petri workshop manufacturing system scheduling model, and to construct the association matrix between the place and the transition in the scheduling model; Scheduling module: It is used to build a search tree from the initial state based on the acquired association matrix and library parameters using the Monte Carlo tree search algorithm until the target state is found, thereby completing the scheduling of the workshop manufacturing system.
6. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 4 are implemented.
7. A computer storable medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 4 are implemented.
Citation Information
Patent Citations
Method for representing component fault attributes based on Petri net
CN105488537A
Workshop manufacturing system multi-target scheduling method based on time-assigned Petri network
CN110046810A
Manufacturing enterprise workshop scheduling optimization method based on anytime A* heuristic search
CN110716522A
HTCPN-based airport tractor dynamic optimization scheduling method
CN111310383A
Safety-critical system reliability analysis method and system based on editable Petri network
CN116451391A