Deadlock-free scheduling method for flexible manufacturing system with central resources based on deep learning

By using deep learning methods in flexible manufacturing systems, establishing Petri net models and forward neural networks, combined with genetic algorithms and improved Dijkstra algorithms, the deadlock problem in flexible manufacturing systems is solved, and production efficiency and scheduling speed are improved.

CN117852825BActive Publication Date: 2024-09-03NANTONG UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410034945.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-01-10
Publication Date
2024-09-03
Estimated Expiration
2044-01-10

AI Technical Summary

Technical Problem

Existing technologies are difficult to effectively avoid deadlocks in flexible manufacturing systems, resulting in slow scheduling and low production efficiency, especially in scenarios involving central resources.

Method used

Using a method based on deep learning, we established a Petri net model and a forward neural network, combined with a genetic algorithm and an improved Dijkstra algorithm, and used a two-step forward deadlock avoidance strategy and a neural network fitting function to find deadlock-free scheduling. sequence to improve production efficiency.

Benefits of technology

It effectively avoids the deadlock state in the scheduling process, significantly improves the scheduling speed and production efficiency, and can quickly find a scheduling sequence that meets the requirements.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117852825B
    Figure CN117852825B
Patent Text Reader

Abstract

The present invention relates to the technical field of intelligent manufacturing production scheduling, and in particular to a deadlock-free scheduling method for a flexible manufacturing system containing central resources based on deep learning. The method of the present invention comprises: establishing a Petri net model for the production process of a flexible manufacturing system containing key resources; minimizing the maximum completion time as the objective function of system scheduling; obtaining a set of relatively good scheduling sequences as a training set and a test set of a forward neural network through global optimization by a genetic algorithm; establishing a forward neural network model, training and testing the network fitting accuracy, and obtaining a fitting function; iteratively generating partial reachable identifiers of the Petri net based on an improved Dijkstra algorithm of a neural network, fitting the expected completion time for each child node through a neural network, constraining the reachable tree to expand to a more optimal path, until the target identifier is found, and outputting the shortest path that meets the objective function as the scheduling sequence of the flexible manufacturing system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of intelligent manufacturing production scheduling technology, and in particular to a deadlock-free scheduling method for flexible manufacturing systems with central resources based on deep learning. Background Technology

[0002] Flexible manufacturing plays a crucial role in today's pursuit of high-variety, low-batch production. For survival and development, an increasing number of modern enterprises are adopting flexible manufacturing as an effective means to enhance their competitiveness. A flexible manufacturing system (FMS) consists of a unified information control system, a material handling system, and a set of digitally controlled processing equipment. It is an automated manufacturing system capable of adapting to constantly changing processing objects. A FMS comprises a set of sequentially arranged machines, which are connected and integrated with loading and unloading machines via a computer system. Parts to be processed are transported on the conveyor system; after processing on one machine, a part is transferred to the next. Each machine receives operating instructions and automatically processes the corresponding part without human intervention. Flexible manufacturing systems offer high equipment utilization, high operational flexibility, and reduced equipment investment. They have wide applications in parts processing and related fields such as machining and assembly.

[0003] Petri nets are graphical mathematical modeling tools used to describe system state changes. Through Petri net models, the structure and behavioral characteristics of the described system can be revealed. Dijkstra's algorithm is a shortest path algorithm from one vertex to all other vertices, solving the shortest path problem in a weighted directed graph. An improved Dijkstra's algorithm based on a feedforward neural network determines the next triggering transition at each reachable marker, continuously expanding until the target marker is found, thus finding a good scheduling scheme in a very short time.

[0004] In Reference 1 (Iterative Widen Heuristic Beam Search Algorithm for Scheduling Problem of Flexible Assembly), Li et al. proposed a heuristic evaluation function based on estimating the average processing time of resources to evaluate the states generated at each layer, thereby reducing the size of the reachability tree. Although a time averaging method is used to estimate the expected completion time of the state, this method is inferior to neural network methods in both flexibility and accuracy. Reference 2 (A Robotic Arm Scheduling Method Based on Petri Nets and Neural Networks) uses a reachability tree search to create a small-scale Petri net, obtains a dataset to train the neural network, and then uses the trained neural network for large-scale instance prediction. However, the accuracy of using a neural network trained on a small-scale dataset to predict a large-scale network model remains to be verified. Summary of the Invention

[0005] The purpose of this invention is to overcome the shortcomings of the prior art and provide an optimized scheduling method for flexible manufacturing systems with central resources that can effectively avoid deadlock during the production process. This method can quickly find a scheduling sequence that meets the requirements, improve scheduling speed, and increase production volume.

[0006] To achieve the above-mentioned objectives, the present invention adopts the following technical solution:

[0007] A deadlock-free scheduling method for a deep learning-based flexible manufacturing system with central resources includes the following steps:

[0008] S1. Modeling: Establish a Petri net model (N, M0) and its correlation matrix A for a flexible manufacturing system containing central resources, where the Petri net N = (P U ,T,F),P U T is the set of places, F is the set of transitions, and M0 is the initial identifier, indicating that the system has not started processing, the workpiece is located in the upload buffer, and the resources are not occupied.

[0009] S2. Generating the Neural Network Dataset: The genetic algorithm globally optimizes to obtain a set of scheduling sequences for the manufacturing system. While searching for suboptimal solutions, it also provides a dataset for the subsequent training of the neural network. The specific steps are as follows:

[0010] S2-1. Randomly generate the initial population: Encoding uses numbers to number each workpiece and process, obtaining the number string corresponding to the chromosome, which consists of path sequence and process sequence; Decoding uses the Petri net model to transform the number string corresponding to the chromosome into a transition sequence; Through encoding and decoding, a certain number of chromosomes are randomly generated to form the initial population.

[0011] S2-2, Detection and Repair: For flexible manufacturing systems containing central resources, a two-step forward-looking deadlock avoidance strategy is adopted to detect and repair each chromosome, ensuring that the final output process sequence is deadlock-free.

[0012] S2-3, Output the best individual in the population: Calculate the maximum completion time Makespan for the process sequence corresponding to each chromosome in the population and its fitness value, and output the chromosome with the highest fitness value in the population and its Makespan. The fitness value is calculated as follows:

[0013]

[0014] Where Maxspan is the maximum completion time among the chromosomes in the current population, Minspan is the minimum completion time among the chromosomes in the current population, Makespan is the maximum completion time of the current chromosome, and k is a constant.

[0015] S2-4. Determine if the termination condition gen > Maxgen is met, where gen is the number of iterations in the current population and Maxgen is the maximum number of iterations. If the termination condition is met, output the optimal individual; otherwise, perform genetic operations.

[0016] S2-5, Genetic Operations: Perform three genetic operations on the current population: selection, crossover, and mutation, to obtain a new generation of population. Execute S2-3 to S2-4.

[0017] S2-6, Data Processing: Calculate the identifier M, the processed time g, and the estimated remaining time h corresponding to each transition in the optimal transition sequence of each generation as the dataset. The estimated remaining time h is obtained by subtracting the processed time g from Makespan, and the dataset is used as the training set and the test set in an 8:2 ratio.

[0018] S3. Obtain the neural network fitting function: Construct a feedforward neural network, determine the network structure, set relevant parameters, train the feedforward neural network using the dataset obtained by the genetic algorithm in S2, and test its training completion rate to obtain the functional relationship between the Petri net identifier M, the processed time g, and the expected completion time h. The specific steps are as follows:

[0019] S3-1. Determine the number of neurons in the input and output layers: Use a neural network to fit the functional relationship between the label M, the processed time g, and the estimated remaining time h. The number of neurons in the input layer of the neural network is the total number of Petri net sites plus 1. The input is the number of tokens in each Petri net site and the processed time g. The number of neurons in the output layer is 1, and the output is the estimated remaining time h.

[0020] S3-2. Determine the number of hidden layers and the number of neurons in each layer: Using a constructive method, the number of hidden layers increases from one to eight. Neural networks with different numbers of hidden layers are trained on the same dataset. The mean squared error of neural networks with different numbers of hidden layers is compared, and the number of hidden layers with the smallest error is selected. The number of neurons in each hidden layer decreases layer by layer. The formula for the difference in the number of neurons between two adjacent layers is:

[0021]

[0022] Where, n d This represents the difference in the number of neurons between two adjacent layers, where n is the number of neurons in the previous layer. o α represents the number of neurons in the output layer, and α is an empirical constant in the interval [1, 6].

[0023] S3-3. Define the neural network structure. Build the network structure in Sequential(), describing the input layer, hidden layer, and output layer layer by layer. Select the ReLU function as the activation function; select the Adam algorithm as the optimizer, with default values ​​for weights, learning rate, and other related parameters, and calculate the loss function as MSE.

[0024] S3-4. Train the neural network using the training set for 1000 training iterations, and then test the trained neural network using the test set.

[0025] S4. Search for the optimal scheduling sequence: After obtaining the trained feedforward neural network, the improved Dijkstra algorithm is used to iteratively generate the partial reachability markers of the Petri net until it is extended to the target marker, and the shortest path that satisfies the objective function is found as the optimal scheduling sequence of the system.

[0026] As a preferred embodiment of the present invention, a two-step forward-looking deadlock avoidance strategy is adopted in S2-2, and the specific steps are as follows: S2-2-1, set u = 1 and record the currently detected transition number; S2-2-2, determine whether u is greater than the transition sequence length. If the condition is met, the repair of the transition sequence is completed; otherwise, set the u-th transition in the transition sequence to t. α Execute S2-2-3; S2-2-3, determine transition t α Under the current flag, determine whether to enable it. If enabled, execute S2-2-4; otherwise, start from t. α Then, randomly select an enabling transition and place it before it, and update t. α S2-2-4. Employ a two-step look-ahead deadlock avoidance strategy to determine t. α Is triggering allowed under the current identifier? First, trigger transition t under the current identifier M. α That is, M[t α >M1, determine if M1 is a deadlock indicator; if so, then t α Not allowed to trigger, from the t-order α In the subsequent transitions, find a new enabling transition and place it in t. α Previously, and updated t α If S2-2-4 is executed again, then S2-2-4 is re-executed; otherwise, any enabling transition under M1 is triggered, resulting in a new identifier M2; if M2 is a deadlock identifier, then triggering t is not allowed. α From the t α In the subsequent transitions, find a new enabling transition and place it in t. α Previously, and updated t α Re-execute S2-2-4; otherwise, trigger t. α Update the current identifier to M, set u = u + 1, and execute S2-2-2.

[0027] As a preferred embodiment of the present invention, step S4 utilizes an improved Dijkstra algorithm based on a feedforward neural network for path planning to find the shortest sequence of operations. The specific steps are as follows:

[0028] S4-1. Initialize the state list X0 = (M0, g0, h0, f0), where M0 represents the initial identifier, the processed time g0 = 0, the estimated remaining time h0 = +∞, and the estimated completion time f0 = g0 + h0.

[0029] S4-2. Create a NEW table and store the initial state X0 in the NEW table; create an OLD table to store the states that have been recorded; create a TL table to store the transition sequence from the initial state to the new state.

[0030] S4-3. For all states in the NEW table, calculate the state identifier M and the processed time g. Train the neural network to calculate the estimated remaining time h for each state, and then calculate the estimated completion time f. Select the state with the smallest f in the table and denote it as X. k Store it in the OLD table, and store X in the TL table. k-1 The transition sequence plus e k Stored in the TL table as the transition from initial state X0 to state X k The transition sequence is then cleared, and the NEW table is emptied.

[0031] S4-4. Calculate X by looking forward in two steps. k The set of enableable transitions E in a state k+1 ={e k+1 ∈T}, and trigger set E one by one. k+1 The transitions in the process generate new states X corresponding to each transition. k+1 And store all new states in the NEW table;

[0032] S4-5. If the target state exists in the NEW table, calculate the processing time of the corresponding transition sequence in the TL table. This transition sequence is the one with the shortest processing time. Otherwise, execute S4-3.

[0033] The deadlock-free scheduling method for a flexible manufacturing system with central resources based on deep learning described in this invention has the following technical advantages compared with existing technologies:

[0034] (1) This invention provides a two-step forward-looking deadlock avoidance strategy for flexible manufacturing systems containing central resources, which effectively avoids deadlock states that occur during scheduling.

[0035] (2) The present invention uses an improved Dijkstra algorithm based on a feedforward neural network to determine the processing time of the production state, selects the optimal production state for expansion, and can quickly find a scheduling sequence that meets the requirements, thereby improving production efficiency. Attached Figure Description

[0036] Figure 1 The flowchart is a process for a deadlock-free scheduling method for a flexible manufacturing system with central resources based on deep learning, which is involved in this invention.

[0037] Figure 2 This is a Petri net model of the tool processing workshop in an embodiment of the present invention;

[0038] Figure 3 This is a schematic diagram of the crossover operation in the genetic operations of this invention;

[0039] Figure 4 This is a schematic diagram of the process variation operation in the genetic operation of this invention;

[0040] Figure 5 This is a schematic diagram of path mutation operation in the genetic operations of this invention. Detailed Implementation

[0041] To enable those skilled in the art to better understand the technical solutions in the embodiments of this application, some symbols in the embodiments of this application will be explained first, so that those skilled in the art can understand them.

[0042] like Figure 1 As shown, this embodiment of the invention illustrates the application of a deadlock-free scheduling method for a flexible manufacturing system with central resources based on deep learning in a tooling workshop. The tooling workshop utilizes cutting machines, handling robots, and grinding machines to produce three types of tools. Different tooling processing sequence codes correspond to different maximum completion times. The optimization objective of the scheduling strategy is to quickly find the maximum completion time of the scheduling sequence and minimize the maximum completion time. The specific steps are as follows:

[0043] Step 1 (Modeling): Establish the Petri net model of the tool processing workshop: The tool processing workshop manufacturing system consists of three types of machines—cutting machines, handling robots, and grinding machines. The system can process three types of tools. The processing sequence for the first type of tool is handling, grinding, handling; the processing sequence for the second type of tool is handling, cutting, handling, grinding, handling; and the processing sequence for the third type of tool is handling, grinding, handling, cutting, handling. The second type of tool has two processing paths. For the same type of processing operation, different machines can be selected for processing. The two processing paths are distinguished by subscripts. The processing capacities of the seven machines r1, r2, r3, r4, r5, r6, and r7 are 1, 1, 1, 1, 1, 1, 1, respectively. The number of tools of the three types to be processed is 3, 3, 3, respectively. Each type of tool blank enters the production line through the upload buffer, is cut and ground, and leaves through the unloading buffer after processing. Machine r3 serves as a handling resource, used by all three types of tools, and is therefore the central resource of the manufacturing system. The corresponding Petri net model of this system is as follows: Figure 2 As shown,

[0044] P i0 (i = 1, 2, 3) is the idle library set, representing the buffer that stores the i-th type of tool. Tool blanks are uploaded from the buffer P. is Uploaded to the processing workshop for processing, and after all processing sequences are completed, it enters the unloading buffer P. if P i0 The number of black dots indicates the number of blanks to be processed for this type of workpiece (when the number is large, the black dots are replaced with numbers);

[0045] P = {p ij The set of operations is defined as {i = 1, 2, 3; j = 1, 2, 3, 4, 5}, where p ij p represents the j-th operation of the i-th type of tool. ij The number of black dots indicates the number of tools currently performing this operation, p ij The numbers on the outside indicate the time required for the tool to complete the operation;

[0046] P r ={r k Let k = 1, 2, 3, 4, 5, 6, 7 be the set of resources, where r k Let r represent the k-th machine. k The number of black dots indicates the machine's maximum capacity;

[0047] T={t ij Let {i = 1, 2, 3; j = 1, 2, 3, 4, 5, 6} be the transition set, where t ij t represents the start of the j-th operation for the i-th type of tool. ij+1This indicates the end of the j-th operation and the beginning of the (j+1)-th operation for the i-th type of tool.

[0048] Specifically, t 11 This indicates that the first type of tool blank is uploaded from the buffer P. 1s Entering the production line, p 11 This represents the first operation of the first type of tool—transfer, which is completed by the transfer robot r3 (from r3 to t). 11 t 11 to p 11 The two arcs indicate the start, starting from p. 11 to t 12 t 12 The two arcs to r3 indicate completion), p 11 The number 8 next to it indicates that the operation requires 8 time units; Figure 2 p in 1s p 2s p 3s The numbers in the table represent the number of blanks for the three types of tools as 3, 3, 3 respectively. The black dots in r1, r2, r3, r4, r5, r6, r7 represent their processing capacities as 1, 1, 1, 1, 1, 1 respectively. The absence of black dots in the other operation library indicates that no other operations have started in the initial state. These black dots constitute the initial identifier M0 = 3p. 1s +3p 2s +3p 3s +r1+r2+r3+r4+r5+r6+r7. Figure 2 The specific meaning of each symbol is shown in Table 1.

[0049] Table 1. Meaning of locations and transitions in the Petri net model of the tool processing workshop.

[0050]

[0051]

[0052] Appendix Figure 2 The Petri net shown can also be represented by the following correlation matrix A:

[0053]

[0054] Step 2) (Generating scheduling sequences using a genetic algorithm): The genetic algorithm globally optimizes to obtain a set of scheduling sequences for the manufacturing system. While searching for suboptimal solutions, it also provides a dataset for the subsequent training of the neural network. The specific steps are as follows:

[0055] Step 2-1 (Encoding and Decoding): Encoding expresses the processing sequence in the form of a chromosome. The chromosome consists of a path sequence and a process sequence. The path sequence represents the path chosen by each workpiece, with a length of p (where p is the total number of workpieces). The number l at the i-th gene position in the path sequence indicates that the i-th workpiece selects the l-th processing path. The process sequence represents the processing order of all workpieces. The number i corresponds to the i-th workpiece, and the x-th occurrence of the number i represents the x-th operation of the i-th workpiece. The sequence length is the total number of processing operations for all workpieces. Decoding transforms the encoded chromosome into a transition sequence. The x-th occurrence of the number i in the process sequence corresponds to the x-th transition on the processing path of the i-th workpiece.

[0056] according to Figure 2 The model shown has a possible encoding as π = (1,1,1,1,1,2,1,1,1,6,3,3,6,6,6,6,5,3,5,4,6,9,9,8,3,2,2,9,9,8,2,2,1,1,1,1,5,4,9,7,5,8,7,8,4,9,5,8,4,7,7,8,7,7,5,4,4);

[0057] The first nine digits of the code form a path selection sequence, representing which machining path the nine tools have selected. This is followed by a process sequence, where the numbers represent the workpiece number. Numbers 1, 2, and 3 represent the first type of workpiece; numbers 4, 5, and 6 represent the second type; and numbers 7, 8, and 9 represent the third type. Number 6 represents the second type of workpiece.

[0058] The appearance of the first 6 in the process sequence signifies the start of the first operation on the raw product 6, i.e., t. 21 The appearance of the second 6 indicates the second operation triggered by blank product 6. According to the 6th sequence number of the path selection sequence, blank product 6 selects the second processing path, which corresponds to the transition t. 23 Similarly, π can be decoded into the following transition sequence: a = t 21 -t 11 -t 12 -t 23 -t 25 -t 27 -t 29 -t 21 -t 13 -t 22 -t 21 -t 20 -t 31 -t 32 -t 31 -t 14 -t 11 -t 12 -t 33 -t34 -t 32 -t 13 -t 14 -t 11 -t 12 -t 13 -t 14 -t 24 -t 22 -t 35 -t 31 -t 26 -t 33 -t 32 -t 34 -t 24 -t 36 -t 28 -t 35 -t 26 -t 33 -t 34 -t 36 -t 35 -t 36 -t 20 -t 28 -t 20 .

[0059] Step 2-2) (Randomly generate the initial population): According to the encoding and decoding requirements of Step 2-1), 100 chromosomes are randomly generated to form the initial population.

[0060] Steps 2-3 (Detection and Repair): For flexible manufacturing systems containing central resources, a two-step forward-looking deadlock avoidance strategy is used to detect and repair each chromosome, ensuring that the final output processing sequence is deadlock-free. The specific steps are as follows:

[0061] Step 2-3-1): Set u = 1 and record the current detected transition number;

[0062] Step 2-3-2): Determine if u is greater than the length of the transition sequence. If the condition is met, complete the repair of the gene sequence; otherwise, set the u-th transition in the transition sequence to t. α Execute steps 2-3-3);

[0063] Step 2-3-3): Determine the transition t α Under the current flag, determine whether to enable it. If enabled, proceed to steps 2-3-4; otherwise, start from t. α Then, randomly select an enabling transition and place it before it, and update t. α ;

[0064] Steps 2-3-4): Employ a two-step look-ahead deadlock avoidance strategy to determine t. αIs triggering allowed under the current identifier? First, trigger transition t under the current identifier M. α That is, M[t α >M1, determine if M1 is a deadlock indicator; if so, then t α Not allowed to trigger, from the t-order α In the subsequent transitions, find a new enabling transition and place it in t. α Previously, and updated t α Repeat steps 2-3-4); otherwise, trigger any enabling transition under M1 to obtain a new identifier M2; if M2 is a deadlock identifier, triggering t is not allowed. α From the t α In the subsequent transitions, find a new enabling transition and place it in t. α Previously, and updated t α Repeat steps 2-3-4); otherwise, it will trigger t. α Update the current identifier to M;

[0065] Let u = u+1, and execute step 2-3-2). The specific process is as follows: Select a transition sequence π = t corresponding to a chromosome. 21 -t 31 -t 32 -t 33 -t 11 -t 12 -t 23 -t 25 -t 27 -t 29 -t 21 -t 13 -t 22 -t 21 -t 20 -t 31 -t 14 -t 11 -t 12 -t 34 -t 32 -t 13 -t 14 -t 11 -t 12 -t 13 -t 14 -t 24 -t 22 -t 35 -t 31 -t 26 -t 33 -t 32 -t 34 -t 24 -t 36 -t 28 -t 35 -t26 -t 33 -t 34 -t 36 -t 35 -t 36 -t 20 -t 28 -t 20 .

[0066] Initial identifier M0 = 3p 10 +3p 20 +3p 30 +r1+r2+r3+r4+r5+r6+r7, after determining the transition t 21 -t 31 -t 32 After that, that is, M0[t 21 t 31 t 32 >M1, where M1=3p 10 +2p 20 +p 21 +2p 30 +p 32 +r1+r2+r3+r5+r7. Now determine the transition t. 33 Whether to allow triggering, change t 33 Pre-operation library p 32 If there is a token in the source library r3, and the preceding resource library r3 also contains a token, then the transition t 33 Enabled, triggering t under M1 33 That is, M1[t 33 >M2, determine if M2 = 3p 10 +2p 20 +p 21 +2p 30 +p 33 If +r1+r2+r5+r6+r7 is not a deadlock indicator, then compute the set of enabling transitions E under M2. k ={t 22 , t 23 , t 34 , t 31}, respectively triggering E k The transitions in the middle yielded the identifier M3 = 3p. 10 +2p 20 +p 22 +2p 30 +p 33 +r2+r4+r5+r6+r7,M4=3p 10 +2p 20 +p 23 +2p 30 +p 33 +r1+r2+r4+r6+r7,M5=3p10 +2p 20 +p 21 +2p 30 +p 34 +r1+r2+r3+r6+r7,M6=3p 10 +2p 20 +p 21 +p 30 +p 31 +p 33 +r1+r2+r5+r6, where M4=3p 10 +2p 20 +p 23 +2p 30 +p 33 If +r1+r2+r4+r6+r7 is the deadlock indicator, then transition t 33 Transitions cannot be triggered under identifier M1; instead, a transition that can be triggered must be selected from subsequent transitions and placed in t. 33 Previously, it was determined whether the transition was permissible. Repeating the above steps completes the chromosome detection and repair process.

[0067] Steps 2-4): Calculate the completion time and fitness value.

[0068] The algorithm calculates the processing time of the flexible manufacturing system using the time allocation principle of a Gantt chart. It determines the idle time of the machines used in the current process and compares it with the estimated completion time of the previous process for the corresponding workpiece. The larger of these two values ​​is taken as the start time of the current process, which also represents the release time of resources used by the previous process and its actual completion time. The start time plus the operation time of the current process equals its estimated completion time. After calculating all processes, the completion time of the last process in the system is the maximum completion time (Makespan) of the entire process sequence.

[0069] The formula for calculating the fitness value Adapt is as follows:

[0070]

[0071] Where Maxspan is the maximum completion time among the chromosomes of the current population, Minspan is the minimum completion time among the chromosomes of the current population, Makespan is the maximum completion time of the process sequence corresponding to the current chromosome, and k is a constant.

[0072] Steps 2-5) (Output the best individual): Output the transition sequence of the best chromosome in the current population and the maximum completion time of its process sequence (Makespan);

[0073] Steps 2-6): Determine if the termination condition gen > Maxgen is met, where gen is the current iteration count of the population and Maxgen is the maximum iteration count. If the termination condition is met, output the optimal individual; otherwise, perform genetic operations.

[0074] Steps 2-7 (Genetic Operations): Perform three genetic operations—selection, crossover, and mutation—on the current population to obtain a new generation. Execute steps 2-3) through 2-6. The specific steps are as follows:

[0075] Step 2-7-1): The selection operation arranges the chromosomes in the population in descending order of fitness value. Chromosomes with a value of Selectnum × Popsize before selection are directly added to the next generation. Here, Selectnum is the selection factor and Popsize is the population size. In this example, Selectnum is 0.05 and Popsize is 100.

[0076] Step 2-7-2): Crossover operation. First, randomly select one chromosome from the selected individuals. Then, randomly select another chromosome from the remaining chromosomes. Randomly select two insertion points and exchange segments of the two chromosomes between the insertion points. Move the segments between the insertion points in the original chromosomes to the beginning of the process sequence. Then, delete genes that are identical to the inserted segments sequentially from front to back. The specific process is as follows: Figure 3 As shown. Repeat the crossover operation until a complete new generation of population is produced;

[0077] Step 2-7-3): Mutation operation. To avoid the overall population quality declining due to the mutation of superior chromosomes, an adaptive mutation operator is used. By setting the mutation rate to be inversely proportional to the fitness value, the different contributions of different chromosomes to the algorithm's evolution are determined, ensuring that superior chromosomes can be inherited by the next generation. The mutation rate expression is as follows:

[0078]

[0079] Among them, f d α represents the corresponding normalized fitness value, and α is the proportionality coefficient of the mutation rate.

[0080] Randomly select a parent chromosome and generate a random number between (0, 1). If the number is less than the adaptive mutation rate, perform a mutation operation on the individual. The operation is as follows: randomly select a mutation point in the chromosome, then randomly determine a mutation length. If the mutation location is in the sequence, swap the genes with the mutation length before and after the mutation point. The specific process is as follows: Figure 4 As shown, the mutation length is 2; if the mutation location is in the path selection sequence, then the path gene segment of the mutation length after the mutation point is changed to another modifiable path, as detailed below. Figure 5 As shown, the mutation length is 2.

[0081] For step 2), set 100 iterations, output the current optimal chromosome once in each iteration, forming 100 datasets. Calculate the identifier M, the processed time g, and the estimated remaining time h corresponding to each transition in the transition sequence of each chromosome as the dataset. The estimated remaining time h is obtained by subtracting the processed time g from Makespan. The dataset is used as the training set and test set in an 8:2 ratio as the dataset for the feedforward neural network.

[0082] Step 3): Obtain the neural network fitting function. The specific steps are as follows:

[0083] Step 3-1): Import relevant modules, such as torch, numpy, etc., and import the dataset obtained in step 2), using an 8:2 ratio as the training set and test set;

[0084] Step 3-2): According to the objective function, the neural network needs to fit the functional relationship between the Petri net identifier M, the processed time g, and the expected remaining time h. Therefore, the number of neurons in the input layer of the neural network is the total number of Petri net locations plus 1. The input is the number of tokens in each Petri net location and the processed time g. The expected output value is the expected remaining time h, where h is the difference between Makespan and g.

[0085] Step 3-3): Determine the number of hidden layers in the neural network. Using a constructive method, train neural networks with different hidden layers on the same experimental data, compare the output of the neural network with the time taken to go from the current state to the target state, and calculate the fitting error of neural networks with different depths. It can be seen that for the Petri net in this example, a neural network with 8 hidden layers can learn more features, so the number of hidden layers in the neural network is determined to be 8.

[0086] Step 3-3): Define the neural network structure. Build the network structure in `Sequential()`, describing the input layer, hidden layers, and output layer layer by layer. Choose the ReLU activation function. Select the Adam algorithm as the optimizer, with default values ​​for weights, learning rate, and other related parameters. Calculate the loss function as MSE.

[0087] Steps 3-4): Train the neural network using the training set, performing 1000 training iterations, and then test the trained neural network using the test set.

[0088] Step 4): Based on the trained feedforward neural network, the Dijkstra algorithm is improved to iteratively generate partially reachable identifiers for the Petri net until the target identifier is reached. The shortest path that satisfies the objective function is then identified as the optimal scheduling sequence for the Petri net. The specific steps are as follows:

[0089] Step 4-1): Initialize the state list X0 = (M0, g0, h0, f0), where M0 represents the initial identifier, the processed time g0 = 0, the estimated remaining time h0 = +∞, and the estimated completion time f0 = g0 + h0;

[0090] Step 4-2): Create a NEW table and store the initial state X0 in the NEW table; create an OLD table to store the states that have been recorded; create a TL table to store the transition sequence from the initial state to the new state.

[0091] Step 4-3): For all states in the NEW table, calculate the state identifier M and the processed time g. Train a neural network to calculate the estimated remaining time h for each state, and then calculate the estimated completion time f. Select the state with the smallest f in the table and denote it as X. k Store it in the OLD table, and store X in the TL table. k-1 The transition sequence plus e k Stored in the TL table as the transition from initial state X0 to state X k The transition sequence is then cleared, and the NEW table is emptied.

[0092] Step 4-4): Calculate X by looking forward in two steps. k The set of enableable transitions E in a state k+1 ={e k+1 ∈T}, and trigger set E one by one. k+1 The transitions in the process generate new states X corresponding to each transition. k+1 And store all new states in the NEW table;

[0093] Step 4-5): If the target state exists in the NEW table, calculate the processing time of the corresponding transition sequence in the TL table. This transition sequence is the one with the shortest processing time. Otherwise, proceed to step 4-3.

[0094] The specific process is as follows: The current NEW table contains a state X0 = (M0, g0, h0, f0). Calculate its identifier M0 = 3p. 10 +3p 20 +3p 30+r1+r2+r3+r4+r5+r6+r7 and the processed time g(0)=0, and fit the expected remaining time h0=+∞ through a neural network, and then calculate the expected completion time f0=+∞. Since there is only one state in the NEW table, it is selected for expansion, stored in the OLD table and the NEW table is cleared. The two-step look-ahead method is used to determine that there are 3 transitions that can be triggered in this state, namely t 11 t 21 t 31 Each of these three transitions triggers a new state X1, X2, and X3, which are then stored in the NEW table.

[0095] For the three new states in the NEW table, calculate their identifiers as M1 = 2p. 10 +p 11 +3p 20 +3p 30 +r1+r2+r4+r5+r6+r7,M2=3p 10 +2p 20 +p 21 +3p 30 +r1+r2+r3+r5+r6+r7,M3=3p 10 +3p 20 +2p 30 +p 31 +r1+r2+r3+r4+r5+r6, processed time g(1)=8, g(2)=4, g(3)=5, then each reachable identifier M and its processed time g are input into the neural network to obtain the estimated remaining time h(1)=236, h(2)=250, h(3)=245, and calculate f(1)=244, f(2)=254, f(3)=250. Select M1 as the node to be expanded and put it into the OLD table, and adjust the transition t accordingly. 11 Add the target state to the TL table and clear the NEW table. Using a two-step look-forward process, find the set of possible transitions for state X1 and add a new identifier to the NEW table. Repeat these steps until the target state appears in the NEW table, thus completing the search for the optimal scheduling sequence.

[0096] Output the optimal process sequence: π=(1,1,1,2,1,1,1,1,1,3,4,3,4,4,5,4,4,3,5,6,4,8,8,7,3,2,2,8,7,8,2,2,1,1,1,1,5,9,5,7,6,8,7,9,6,8,7,5,6,9,9,5,6,7,9,9,6), transition sequence: a=t 11 -t 21 -t 12 -t 23 -t 25 -t21 -t 27 -t 29 -t 13 -t 22 -t 21 -t 20 -t 31 -t 32 -t 31 -t 14 -t 11 -t 12 -t 33 -t 32 -t 34 -t 13 -t 14 -t 11 -t 12 -t 13 -t 14 -t 24 -t 31 -t 26 -t 33 -t 22 -t 35 -t 34 -t 32 -t 24 -t 36 -t 35 -t 28 -t 26 -t 33 -t 34 -t 20 -t 28 -t 36 -t 35 -t 36 -t 20 The corresponding Makespan = 230.

[0097] The method of this invention includes: establishing a Petri net model for the production process of a flexible manufacturing system containing critical resources; using minimizing the maximum completion time as the objective function for system scheduling; obtaining a set of relatively good scheduling sequences through global optimization using a genetic algorithm, which serves as the training and testing set for a feedforward neural network; establishing a feedforward neural network model, training and testing the network fitting accuracy to obtain a fitting function; iteratively generating partially reachable identifiers of the Petri net based on an improved Dijkstra algorithm for neural networks; fitting the expected completion time to each child node through the neural network; constraining the reachability tree to expand towards a better path until the target identifier is found; and outputting the shortest path that satisfies the objective function as the scheduling sequence for the flexible manufacturing system.

[0098] The specific implementation schemes described above further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above descriptions are merely specific implementation schemes of the present invention and are not intended to limit the scope of the present invention. Any equivalent changes and modifications made by those skilled in the art without departing from the concept and principles of the present invention should fall within the scope of protection of the present invention.

Claims

1. A deadlock-free scheduling method for flexible manufacturing systems with central resources based on deep learning, It is characterized in that The following steps are involved: S1. Modeling: Establish a Petri net model of a flexible manufacturing system with central resources (N, M 0 ) and its association matrix A, N = (P U ,T,F),P U is the place set, T is the transition set, F is the directed arc set; M 0 It is the initial mark, indicating that the system has not started processing, the workpiece is in the upload buffer, and the resources are not occupied; S2. Generate neural network data set: Genetic algorithm global optimization obtains the scheduling sequence set of the manufacturing system, searches for suboptimal solutions, and provides data sets for subsequent neural network training. The specific steps are as follows: S2-1. Randomly generate the initial population: Encoding is to number each workpiece and process with a number to obtain the digital string corresponding to the chromosome, which is composed of a path sequence and a process sequence; decoding is to convert the digital string corresponding to the chromosome into a transition sequence according to the Petri net model; through encoding and decoding, a certain number of chromosomes are randomly generated to form the initial population; S2-2, Detection and repair: For flexible manufacturing systems with central resources, a two-step forward-looking deadlock avoidance strategy is used to detect and repair each chromosome to ensure that the final output process sequence is deadlock-free; S2-3. Output the optimal individual in the population: Calculate the maximum completion time Makespan and its fitness value of the process sequence corresponding to each chromosome in the population, and output the chromosome with the highest fitness value and its Makespan in the population. The fitness value calculation formula is as follows: Among them, Maxspan is the maximum completion time in the chromosome of the current population, Minspan is the minimum completion time in the chromosome of the current population, Makespan is the maximum completion time of the current chromosome, and k is a constant; S2-4, determine whether the termination condition gen>Maxgen is met, where gen is the number of iterations of the current population and Maxgen is the maximum number of iterations; if the termination condition is met, the optimal individual is output, if not, the genetic operation is performed; S2-5, genetic operation: perform three genetic operations of selection, crossover and mutation on the current population to obtain a new generation of population, and execute S2-2 to S2-4; S2-6, data processing: Calculate the identifier M corresponding to each transition in each generation of the optimal transition sequence, the processed time g corresponding to the identifier, and the estimated remaining time h as the data set, where the estimated remaining time h is obtained by subtracting the processed time g from Makespan, and use the ratio of 8:2 as the training set and test set; S3, obtain the neural network fitting function: build a forward neural network, determine the network structure, set relevant parameters, train the forward neural network with the data set obtained by the S2 genetic algorithm, and test its training completion, obtain the functional relationship between the Petri net identifier M and the processed time g and the expected completion time h. The specific steps are as follows: S3-1. Determine the number of neurons in the input layer and the output layer: Use a neural network to fit the functional relationship between the identifier M, the processed time g, and the estimated remaining time h. The number of neurons in the input layer of the neural network is the total number of Petri net places plus 1. The input quantity is the number of tokens in each Petri net place and the processed time g. The number of neurons in the output layer is 1, and the output quantity is the estimated remaining time h. S3-2. Determine the number of hidden layers and the number of neurons in each layer: Use the construction method, with the number of hidden layers increasing from one to eight. Use the same data set to train neural networks with different numbers of hidden layers, compare the mean square errors of neural networks with different numbers of hidden layers, and select the number of hidden layers with the smallest error. The number of neurons in the hidden layer decreases layer by layer, and the difference formula between the number of neurons in two adjacent layers is: Among them, n d is the difference between the number of neurons in two adjacent layers, n is the number of neurons in the previous layer, and n o is the number of neurons in the output layer, and α is an empirical constant in the interval [1, 6]; S3-3. Define the neural network structure, build the network structure in Sequential(), describe the input layer, hidden layer and output layer layer by layer, select the ReLU function as the activation function; select the Adam algorithm as the optimizer, select the default values ​​for the relevant parameters such as weights and learning rates, and calculate the loss function as MSE; S3-4, use the training set to train the neural network for 1000 times, and use the test set to test the trained neural network; S4, search for the optimal scheduling sequence: after obtaining the trained forward neural network, the improved Dijkstra algorithm is used to iteratively generate partial reachable identifiers of the Petri net until the target identifier is expanded, and the shortest path that satisfies the objective function is found as the optimal scheduling sequence of the system; The two-step forward-looking deadlock avoidance strategy is adopted in S2-2, and the specific steps are as follows: S2-2-1, set u=1, record the transition number of the current detection; S2-2-2. Determine whether u is greater than the length of the transition sequence. If so, repair the transition sequence. Otherwise, set the uth transition in the transition sequence to t. α , execute S2-2-3; S2-2-3. Determine the change t α Is it enabled under the current flag? If it is enabled, execute S2-2-4. Otherwise, execute from t α Then randomly select an enabling transition before it and update t α ; S2-2-4, using a two-step forward deadlock avoidance strategy, determine t α Is it allowed to trigger under the current mark? First, trigger the transition t under the current mark M α , that is, M[t α >M 1 , judge M 1 Is it a deadlock indicator? If M 1 is a deadlock indicator, then t α Not allowed to trigger, from the row in t α Find a new enabling transition from the subsequent transitions and put it in t α Before, and update t α , re-execute S2-2-4; if M 1 If it is not a deadlock indicator, M 1 Next, make an enabling transition and get a new identifier M 2 ; if M 2 If it is a deadlock indicator, it is not allowed to trigger t α , from the row in t α Find a new enabling transition from the subsequent transitions and put it in t α Before, and update t α , re-execute S2-2-4; if M 2 If it is not a deadlock indicator, t is triggered. α , update the current identifier to M, set u=u+1, and re-execute S2-2-2 to S2-2-4; In S4, the improved Dijkstra algorithm based on the forward neural network is used for path planning to find the shortest process sequence. The specific steps are as follows: S4-1. Initialization status list X 0 =(M 0 , g 0 ,h 0 , f 0 ), where M 0 Indicates the initial mark, the processing time g 0 =0, estimated remaining time h 0 = +∞, estimated completion time f 0 =g 0 +h 0 ; S4-2, create the NEW table, and set the initial state X 0 Store in the NEW table; create an OLD table to store the recorded states; create a TL table to store the transition sequence from the initial state to the new state; S4-3. For all states in the NEW table, calculate the state identifier M and the processed time g, train the estimated remaining time h of each state through the neural network, and then calculate the estimated completion time f; select the state with the smallest f in the table and record it as X k Store it in the OLD table and replace X in the TL table k-1 The transition sequence plus e k , stored in the TL table as the initial state X 0 To state X k The transition sequence and clear the NEW table; S4-4. Calculate X by looking ahead two steps k The set of transitions that can be enabled in the state E k+1 ={e k+1 ∈T}, and one by one induces the set E k+1 The transitions in the above example generate new states X corresponding to each transition. k+1 , and store all new states in the NEW table; S4-5. If the target state exists in the NEW table, the processing time of the corresponding transition sequence in the TL table is calculated. The corresponding transition sequence is the transition sequence with the minimum processing time. Otherwise, S4-3 is executed.