Flexible manufacturing system emergency order insertion rescheduling method based on Petri network

Through the rescheduling method based on Petri network model and genetic algorithm optimization, the scheduling problem of flexible manufacturing system under emergency orders is solved, and efficient production scheduling and resource utilization are achieved.

CN120430583AActive Publication Date: 2025-08-05NANTONG UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510604288.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-12
Publication Date
2025-08-05
Estimated Expiration
2045-05-12

AI Technical Summary

Technical Problem

The existing flexible manufacturing systems are difficult to reschedule quickly and effectively when facing emergency orders, resulting in reduced production efficiency and waste of resources.

Method used

Based on the Petri network model reconstruction scheduling method, combined with genetic algorithm optimization, through deadlock detection and repair, the reasonable insertion and process rearrangement of emergency orders are achieved, the initial population is generated by Tent chaotic mapping, and the genetic operation is performed using elite retention and POX cross-section methods to enhance search capabilities.

Benefits of technology

In the absence of deadlock, quickly find a scheduling sequence that meets the optimization goals, improve production efficiency and scheduling speed, and reduce resource waste.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120430583A_ABST
    Figure CN120430583A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of production scheduling of flexible manufacturing systems, and particularly relates to a Petri network-based flexible manufacturing system emergency order insertion rescheduling method. The invention provides a new rescheduling strategy based on a Petri net model of a flexible manufacturing system. When an emergency order arrives, a Petri net model reconstruction and processing sequence classification rearrangement method is provided. According to the method, a genetic algorithm is optimized and improved in the design process of a scheduling strategy, firstly, an initial population is generated by adopting a Tent chaotic mapping method, so that population distribution is more uniform; secondly, adopting an elitism strategy and a roulette method in the heritage operation selection operation, and selecting a better individual for operation according to the fitness value; a POX crossover method is adopted in the crossover operation, so that the range of a neighborhood solution can be effectively expanded; in the mutation operation, a non-uniform mutation rate is adopted to enhance the spatial search capability of the algorithm, so that more comprehensive spatial search can be carried out.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the technical field of production scheduling of flexible manufacturing systems, and in particular relates to an urgent order insertion and rescheduling method for flexible manufacturing systems based on Petri nets. Background Art

[0002] Flexible Manufacturing Systems (FMS) are advanced automated manufacturing systems centered around CNC machine tools, interconnected with resources via automated transport equipment, and centrally controlled by a central computer. These systems offer high flexibility and are capable of performing a variety of production tasks. Due to the unforeseen circumstances inherent in most flexible manufacturing systems, dynamic scheduling has become a new scheduling problem within FMSs. In practical FMSs, a variety of unexpected disruptions can occur, such as machine failures, job cancellations, changes in processing time, rush orders, and changes in delivery dates. Furthermore, with the advent of computational intelligence, dynamic scheduling techniques based on intelligent algorithms (such as genetic algorithms, simulated annealing, and tabu search) have been widely used to address dynamic scheduling issues.

[0003] In Reference 1 (Dynamic rescheduling in FMS that simultaneously considers energy consumption and schedule efficiency), Zhang et al. proposed a dynamic scheduling method for flexible job shops based on a genetic algorithm. Inspired by this method, the present invention improves upon it and proposes a Petri net-based rescheduling method for urgent order insertion in flexible manufacturing systems. This method reconstructs the Petri net model when urgent orders are inserted, and uses deadlock detection, repair, and an improved genetic algorithm to perform online, real-time scheduling of the remaining processes after the urgent order insertion, maximizing processing efficiency. Summary of the Invention

[0004] The purpose of the present invention is to overcome the shortcomings of the existing technology and propose a Petri net-based rescheduling method for urgent order insertion in a flexible manufacturing system. For the flexible manufacturing system when urgent orders are inserted, the method of the present invention can reasonably arrange the order insertion point position and reorder the remaining processes. At the same time, it uses an improved genetic algorithm to quickly find a scheduling sequence that meets the requirements and improve production efficiency.

[0005] To achieve the above-mentioned purpose, the present invention adopts the following technical solution: a method for inserting and rescheduling urgent orders in a flexible manufacturing system based on Petri nets, comprising the following steps:

[0006] Step 1) (Establishing a Petri net model of the flexible manufacturing system before the urgent order is inserted): Based on the processing procedures of the workpieces within the flexible manufacturing system and the machine occupancy between each workpiece, construct a Petri net model (N, M0) that can express the discrete parallel system and its association matrix A, and define the following symbols:

[0007] N: A Petri net N = (P, T, F) consisting of circular nodes, square nodes, and directed arcs, representing a flexible manufacturing system consisting of m machines capable of processing n types of workpieces;

[0008] P: Place set Among them, P i0 =P is ∪P if represents the set of idle places, P is is the upload buffer for the i-th type of artifact, P if is the corresponding offload buffer, p ij P represents the place corresponding to the jth operation of the i-th type of workpiece, r Represents the collection of resource libraries;

[0009] T: Transition set, consisting of all square nodes in N. Each transition t represents the end of the previous process and the beginning of the next process, and also represents the release of resources used by the previous process and the application of resources used by the next process;

[0010] F: A directed arc set representing the processing flow of each workpiece in the system and the resource demand and release of each processing step during the processing;

[0011] M:P→N is an identifier (N is a non-negative integer set) that represents the processing status of the system. Each number in the identifier represents the number of workpieces or resources contained in each location. M0 is the initial identifier, indicating that the system has not started processing, the workpiece is in the upload buffer, and the resources are not occupied.

[0012] A: incidence matrix, which represents the changing pattern of the number of tokens in each repository under each transition in N. It is a matrix with |T| rows and |P| columns.

[0013] Step 2) (Reconstructing the Petri net model after the urgent order is inserted): Combine the Petri net model of the urgent order with the original manufacturing system Petri net model to construct a new Petri net model and update the association matrix and identification. The specific steps are as follows:

[0014] Step 2-1): Record (N, M a ) is the Petri net model of the original system when the order is inserted, M a is the identifier of the Petri net model of the original manufacturing system when the urgent order is inserted, (N ad, M ad ) is the urgent order Petri net model, N ad =(P add ,T add ,F add ). Each resource required is a resource in the original manufacturing system, that is, P radd ∈P r .

[0015] Step 2-2): Set the emergency order model (N ad , M ad ) and the original Petri net model (N, M a ) through the shared resource library R add Combining, we get a new Petri net model, namely (N af , M af )=(P∪P s ∪P f ∪P r ∪P add ,T∪T add ,F∪F add ),M af (P∪P s ∪P f ∪P r )=M a (P∪P s ∪P f ∪P r ),M af (P add )=M ad (P add ).

[0016] This paper focuses on the flexible manufacturing system after the urgent order is inserted. Under the premise of satisfying the process constraints, resource constraints and control constraints (no deadlock), the objective function of the system scheduling is to minimize the maximum completion time, that is:

[0017] F=min{MakeSpan} (1)

[0018] MakeSpan=max{C k} (2)

[0019] Among them, C k is the completion time of the last process of the kth workpiece, k = 1, 2, ..., p (p is the total number of workpieces); MakeSpan is the maximum time for all workpieces to be processed.

[0020] Step 3) (Encoding and decoding): Number each workpiece and its process in the flexible manufacturing system to generate a processing sequence, and decode it into a transition sequence. The specific steps are as follows:

[0021] Step 3-1): Number all workpieces and processing paths to be processed (since the research object is a flexible manufacturing system, each type of workpiece can have multiple processing paths). Use the order in which the workpiece numbers appear to represent the processing sequence. Each workpiece must appear the same number of times in the code as the number of steps involved. The solution is encoded as a sequence of workpiece and path numbers, called a gene sequence. The gene sequence consists of an operator gene and a path gene, with the operator gene preceding the path gene. The operator gene represents the workpiece processing sequence, and its total length is the total number of steps required to complete all workpieces. The path gene represents the path selection, and its total length is the total number of workpieces.

[0022] Step 3-2): The above encoding scheme enables direct reverse decoding, that is, decoding the sequence directly into a scheduling sequence that satisfies the operation constraints. The nth occurrence of workpiece i in the process sequence represents the nth operation of workpiece i. Each number is decoded into the corresponding transition. For the same type of workpiece, different processing paths will result in different transitions when decoded.

[0023] Step 4) (Rearrangement of pre-scheduling sequence): Record the start time of each step in the pre-scheduling sequence chrom before the urgent order is inserted, and store it in the array optime. The array optime is the set of start times of all processes in the pre-scheduling sequence, and its length is the total number of processes required to process all workpieces. Arrange the elements in the array optime in ascending order, and update the position of the elements in the pre-scheduling sequence at the same time according to the change of the element position to obtain the new arrays optime* and chrom*. Due to the asynchronous concurrency of the flexible manufacturing system, the updated array has no effect on the original pre-scheduling sequence, and the two are equivalent process sequences.

[0024] Step 4-1): Set i=1; optimize * =optime;chrom * =chrom;

[0025] Step 4-2): Determine whether i is greater than |optime * |-1, if the conditions are met, the pre-scheduled sequence is rearranged, |optime * | for array optime * Output the length of the new array optime * and chrom * ; If not satisfied, execute step 4-3);

[0026] Step 4-3): Set j = 1;

[0027] Step 4-4): Determine whether j is greater than |optime *|-i-1, if the condition is met, complete one traversal, set i=i+1, and re-execute step 4-2); if not, execute step 4-5);

[0028] Step 4-5): Determine the optimal * Is [j] greater than optime? * [j+1], if the conditions are met, execute steps 4-6);

[0029] Steps 4-6): Exchange Optime * [j] and optime * [j+1] position, swap chrom * [j] and chrom * The position of [j+1];

[0030] Step 4-7): Let j = j + 1 and execute step 4-4 again;

[0031] Due to the asynchronous concurrency characteristics of the flexible manufacturing system, the updated array has no effect on the original pre-scheduling sequence, and the two are equivalent process sequences.

[0032] Step 5) (Determine the urgent order insertion point and classify the processes): Based on the comparison between the urgent order insertion time and the element size in optime*, all processes are divided into: completed processes, in-process processes, and unfinished processes. Completed processes: processes whose start time is before the urgent order arrival time and whose next process has started or completed. In-process processes: processes whose start time is before the urgent order arrival time and whose next process has not yet started. Unfinished processes: processes that have not yet started. The order insertion point is after the completed processes and in-process processes and before the unfinished processes.

[0033] The specific steps are as follows:

[0034] Step 5-1): Set i=1;

[0035] Step 5-2): Determine whether i is greater than |optime * |, if the conditions are met, the process classification is completed; otherwise, step 5-3 is executed;

[0036] Step 5-3): Determine whether t is greater than optime*[i]. If so, proceed to step 5-4). If not, the process corresponding to chrom*[i] is unfinished, and proceed to step 5-6.

[0037] Step 5-4): Set j to the index value of the next step of the workpiece corresponding to chrom*[i];

[0038] Step 5-5): Determine whether t is greater than optimal*[j]. If the condition is met, the process corresponding to chrom*[i] is a completed process; if not, it is a process in progress.

[0039] Step 5-6): Let i=i+1 and execute step 5-2) again.

[0040] Step 6) (Construct discrete mapping relationship): Construct the mapping relationship between individual positions and process codes. For the processes, the smallest position value is used for scheduling. The smaller the position value of the process, the higher the processing priority. The specific steps are as follows:

[0041] Step 6-1) (Generate continuous position sequence): In the process of continuous coding of the process, generate a position for each process. The position is a sequence of positions in [X min ,X max ] is a real number randomly generated within the range of , and the position value corresponding to each process represents the priority of the corresponding process.

[0042] Step 6-2) (Establish a mapping relationship between discrete and continuous sequences): Each element on the i-th segment in the continuous position sequence corresponds to a transition on the processing path of workpiece i, and its position value represents the priority of the transition. The principle of scheduling with the smallest position value first is adopted, where the element with the smallest position value corresponds to the first transition on the processing path of workpiece i, the element with the second smallest position value corresponds to the second transition on the processing path of workpiece i, and so on.

[0043] Step 7) (Determine genetic parameters): Determine the various parameters used by the algorithm, including population size Popsize, maximum number of iterations Maxgen, cross factor CrossFactor, and mutation factor P m , selection factor SelectFactor;

[0044] Step 8) (Generate Initial Population): The initial population consists of chromosomes of a fixed size, which is the population size determined in Step 7). Based on the process classification in Step 5), the initial population retains the completed processes and ongoing processes in the pre-scheduled sequence. The initial population is generated by different combinations of the remaining process codes.

[0045] The tent mapping rule is used to generate the initial population, improve the discreteness and uniformity of the sequence, and reduce the probability of duplicates, thereby improving the search efficiency and maintaining the diversity of the search process. The specific formula is as follows:

[0046]

[0047] X i =X min +z i ×(Xmax -X min ) (4)

[0048] Among them, Popsize is the population size, z i represents the chaotic sequence of the i-th mapping, z0∈[0,1] represents the initial chaotic sequence, β is the chaotic coefficient, X i is the individual position, X max and X min are the upper and lower limits of the search space. The specific steps are as follows:

[0049] Step 8-1): Set i=1, initial population PopChrom, initial chaotic sequence z0;

[0050] Step 8-2): Determine whether i is greater than Popsize. If so, output the initial population PopChrom; if not, execute step 8-3)

[0051] Step 8-3): Calculate the chaotic sequence z of the chromosome according to formula (3) i ;

[0052] Step 8-4): According to formula (4), in [X min ,X max ]Calculate the position X corresponding to the step in the chromosome i

[0053] Step 8-5): Pass each process position X i Adjust the priority of the process.

[0054] Step 8-6): i=i+1, re-execute step 8-2);

[0055] Check each randomly generated chromosome to see if it meets the coding requirements of step 3). If not, make corrections.

[0056] Step 9) (Deadlock detection and repair): Combine the reconstructed Petri net model's association matrix A' and the initial identifier M af , deadlock detection and repair are performed on the decoded sequence to ensure that the repaired gene sequence can meet resource constraints, processing order constraints and control constraints; the specific steps are as follows:

[0057] Step 9-1): Set u=1 and record the transition number of the current detection;

[0058] Step 9-2): Determine whether u is greater than the length of the transition sequence. If so, repair the gene sequence. Otherwise, set the uth transition in the transition sequence to t. α , execute step 9-3);

[0059] Step 9-3): Check the transition t α Is it enabled under the current flag? If it is enabled, go to step 9-4). Otherwise, select t α The next transition is placed before this transition and t is updated. α , re-execute this step;

[0060] Step 9-4): Use the one-step-ahead look method to determine the change t α Is it allowed to trigger? If not allowed, select t α The next transition is placed before this transition and t is updated. α , re-execute step 9-3); otherwise, execute step 9-5);

[0061] Step 9-5): Determine the transition t α Whether the corresponding processing steps meet the processing sequence constraints, that is, the transition t α Whether the corresponding processing step precedes the previous processing step of this step.

[0062] If not satisfied, select t α The next transition is placed before this transition and t is updated. α , re-execute step 9-3); otherwise, execute step 9-6);

[0063] Step 9-6): Trigger t α , update the current flag, set u = u + 1, and execute step 9-2)

[0064] Repeat the above steps to complete the chromosome detection and repair.

[0065] Step 10) (Calculate processing time and fitness value): (Calculate completion time MakeSpan): Calculate the processing time of the flexible manufacturing system using the time allocation principle of the Gantt chart, determine the idle time of the machine used in the current process, and compare it with the estimated completion time of the previous process of the workpiece corresponding to the process. The larger value of the two is the start time of the current process. This time is also the release time of the resources occupied by the previous process and the actual completion time of the previous process. The start time plus the operation time of the current process is the estimated completion time of the current process. After calculating all processes, the completion time of the last process in the system is the completion time MakeSpan of the entire process sequence.

[0066] The fitness value formula is as follows:

[0067]

[0068] Among them, MaxSpan is the maximum processing time of all individuals in the current population, MinSpan is the minimum processing time of all individuals, k1 and k2 are arbitrary constants, and Adapt is the fitness value of the individual.

[0069] Step 11) (termination rule judgment): determine whether the termination rule is met, that is, gen>Maxgen; if so, proceed to step 13) and the program ends; if not, proceed to step 12);

[0070] Step 12) (Genetic Operation): Perform the three genetic operations of selection, crossover, and mutation on the current population to obtain a new generation of population. Execute steps 12-1) to 12-4). The specific steps are as follows:

[0071] Step 12-1) (Selection operation): Introduce an elite storage strategy to store the top 10% of the best population individuals in terms of fitness. For the remaining population, a roulette wheel selection method is used for selection. The probability of each individual being selected is proportional to its fitness value. The formula for the probability of individual selection and the cumulative probability of chromosomes is as follows:

[0072]

[0073] Randomly generate a random number rand in [0,1]. If Q(x i )≤rand means that the i-th individual is selected, and the process is repeated to obtain a population containing Selectnum×Popsize individuals.

[0074] Step 12-2) (Crossover operation): Generate a random number rand between [0,1]. If rand is less than the crossover factor CrossFactor, use the POX (precedence operation crossover) method on every two chromosomes in the population. Chromosomes p1 and p2 are crossed to generate two offspring c1 and c2. The crossover process is as follows:

[0075] Step 12-2-1): Randomly divide the artifact set into two non-empty subsets J1 and J2;

[0076] Step 12-2-2): Copy the processes in p1 that belong to the workpieces in workpiece set J1 to c1, and copy the processes in p2 that belong to the workpieces in workpiece set J1 to c2, preserving their positions;

[0077] Step 12-2-3): Copy the processes in p1 that belong to the workpieces in workpiece set J2 to c2, and copy the processes in p2 that belong to the workpieces in workpiece set J2 to c1, preserving their order.

[0078] Step 12-3) (Mutation operation)): In order to avoid the excellent chromosome mutation leading to the decline of the overall quality of the population, a non-uniform mutation rate P is used. m Enhance the algorithm's spatial search capability, enabling it to conduct a more comprehensive spatial search. A high mutation rate in the initial iterations of the algorithm allows it to quickly cover the solution space. As the iterations progress, the mutation rate should be reduced to ensure that good chromosomes can be inherited to the next generation. The linear adaptive mutation rate expression is as follows:

[0079]

[0080] Among them, P m0 represents the initial mutation rate, and ρ is a constant in the interval (0,1).

[0081] For the process code, a mutation operator that simulates binary coding is used to change the position of the process. The specific formula is as follows:

[0082] X new =X i +(X imin +X imax )×δ i (9)

[0083]

[0084] For the path code, a chromosome is selected and a random number rand between [0,1] is generated. If rand is less than the mutation rate, the path mutation operation is performed on the individual. The operation is as follows:

[0085] Since the first type of workpiece has two processing paths to choose from, when the chromosome mutates, if the first type of workpiece has not undergone the second step, its processing path will be changed.

[0086] Step 12-4): After the genetic operation is complete, merge all parent individuals and their offspring into a new population, gen = gen + 1. Return to step 9 to decode each chromosome in the new population and perform feasibility checks and repair operations. Repeat step 10, sorting the population from highest to lowest fitness, and select the top Popsize individuals.

[0087] Step 13) (Output optimal solution): After satisfying the termination rule of step 11), output the chromosome sequence, transition sequence and corresponding processing time MakeSpan of the optimal individual in the population to complete the rescheduling of the flexible manufacturing system.

[0088] The Petri net-based flexible manufacturing system emergency order insertion and rescheduling method described in the present invention has the following technical effects compared with the prior art by using the above technical solution:

[0089] (1) Based on the Petri net model of flexible manufacturing system, this paper proposes a new rescheduling strategy; when urgent orders arrive, a method of reconstructing the Petri net model and classifying and rescheduling the processing sequence is proposed.

[0090] (2) The present invention adjusts all chromosomes into feasible chromosomes through the detection and repair algorithm, and decodes them into feasible scheduling sequences, ensuring that the flexible manufacturing system optimizes the production process without deadlock, quickly finds the scheduling sequence that meets the optimization target requirements, improves the scheduling speed, and increases the production quantity.

[0091] (3) The present invention optimizes and improves the genetic algorithm in the design process of the scheduling strategy. First, the Tent chaos mapping method is used to generate the initial population to make the population distribution more uniform; secondly, the elite retention strategy and roulette method are used in the selection operation of the legacy operation to select the better individuals for operation according to the size of the fitness value; the POX (precedence operation crossover) crossover method is used in the crossover operation to effectively expand the range of the neighborhood solution; the non-uniform mutation rate is used in the mutation operation to enhance the spatial search capability of the algorithm, so that it can perform a more comprehensive spatial search. BRIEF DESCRIPTION OF THE DRAWINGS

[0092] Figure 1 This is a flow chart of a method for inserting urgent orders into a flexible manufacturing system and rescheduling the method according to the present invention;

[0093] Figure 2 The Petri net model of the tool cutting production unit in Example 1 of the present invention;

[0094] Figure 3 A new system Petri net model for urgent order insertion;

[0095] Figure 4 Insert a time process classification diagram for urgent orders;

[0096] Figure 5 It is a schematic diagram of discrete mapping relationship;

[0097] Figure 6 This is a schematic diagram of POX cross operation;

[0098] Figure 7 Schematic diagram of path variation;

[0099] Figure 8 This is the Gantt chart corresponding to the optimal solution. DETAILED DESCRIPTION

[0100] In order to enable those skilled in the art to better understand the technical solutions in the embodiments of the present application, some symbols in the embodiments of the present application are first explained to facilitate understanding by those skilled in the art.

[0101] This example demonstrates the application of a method for rescheduling urgent orders in a flexible manufacturing system to a tool cutting production unit. This unit utilizes cutting machines, handling robots, and grinding machines to produce two types of tools. Different tool processing sequence codes correspond to different maximum completion times. The scheduling strategy optimizes the completion time, total energy consumption, and machine utilization using an improved genetic algorithm. The specific steps are as follows:

[0102] Step 1) (Establish a Petri net model of the flexible manufacturing system before the urgent order is inserted): Establish a Petri net model of the tool processing workshop: The tool processing workshop manufacturing system is composed of three machines - cutting machines, handling robots and grinding machines; the system can process two types of tools, of which the processing sequence of the first type of tools is handling, cutting, grinding, and handling, and the processing sequence of the second type of tools is handling, cutting, and handling. The first type of tools has two processing paths. For the same type of processing procedures, different machines can be selected for processing, and the two processing paths are distinguished by the following subscripts. The processing capacities of the five machines r1, r2, r3, r4, and r5 are 1, 2, 2, 2, and 1 respectively. The number of both types of tools required for processing is 5. Each type of tool blank enters the production line through the upload buffer for cutting and grinding, and leaves through the unloading buffer after processing. The corresponding Petri net model of the system is as follows: Figure 2 shown.

[0103] P i0 (i=1, 2) is the idle library set, which represents the buffer for storing the i-th type of tool. The tool blank is uploaded from the buffer P is Upload to the processing workshop for processing, and enter the unloading buffer after completing all processing sequences P if , P i0 The number of black dots in the middle indicates the number of blanks to be processed for this type of workpiece (when the number is large, the black dots are replaced by numbers);

[0104] P={p ij , i = 1, 2; j = 1, 2, 3, 4, 5} is the set of operation libraries, where p ij represents the jth operation process of the i-th type of tool, p ij The number of black dots in the middle indicates the number of tools currently in operation. ij The numbers outside indicate how long it takes the tool to complete the operation;

[0105] P r ={ri , i = 1, 2, 3, 4, 5} is the resource library, where r i represents the i-th machine, r i The number of black dots indicates the maximum capacity of the machine;

[0106] T={t ij , i=1,2,3;j=1,2,3,4,5} is the transition set, where t ij Indicates the start of the jth operation of the i-th type tool, t ij+1 Indicates the end of the jth operation and the beginning of the j+1th operation of the i-th tool.

[0107] Specifically, 11 Indicates that the first type of tool blank is uploaded from the buffer P 1s Entering the production line, p 11 The first operation process of the first type of tool - transport, which is completed by the transport robot r1 (from r1 to t 11 , t 11 to p 11 The two arcs indicate the start, and p 11 to t 12 , t 12 The two arcs to r1 indicate completion), p 11 The number 4 marked next to it means that the operation takes 4 time units; Figure 2 p in 1s 、p 2s The numbers in the table represent the number of blanks for the two types of tools, which is 5. The black dots in r1, r2, r3, r4, and r5 represent their processing capacities, which are 1, 2, 2, 2, and 1, respectively. There are no black dots in other operation libraries, indicating that other operations have not started in the initial state. These black dots constitute the initial identifier M0 = 5p 1s +5p 2s +r1+2r2+2r3+2r4+r5. Figure 2 The specific meaning of each symbol is shown in Table 1.

[0108] Table 1 Meaning of places and transitions in the Petri net model of tool processing workshop

[0109] warehouse meaning change meaning <![CDATA[p 1s ]]> Upload buffer for the first type of tool blanks <![CDATA[t 11 ]]> The first type of rough products are transported into the production line <![CDATA[p 11 ]]> Handling operations for the first type of tools <![CDATA[t 12 、t 22 ]]> After transporting, cutting operation is carried out <![CDATA[p 12 、p 22 ]]> Cutting operations with the first type of tool <![CDATA[t 13 、t 23 ]]> Cutting is completed and grinding is carried out <![CDATA[p 13 、p 23 ]]> Grinding operations for the first type of tools <![CDATA[t 14 、t 24 ]]> After grinding is completed, the handling operation is carried out <![CDATA[p 14 ]]> Handling operations for the first type of tools <![CDATA[t 15 ]]> After transporting, enter the unloading buffer zone <![CDATA[p 1f ]]> Unloading buffer for finished tooling of the first type <![CDATA[p 2s ]]> Upload buffer for the second type of tool blanks <![CDATA[t 31 ]]> The second type of rough products are transported into the production line <![CDATA[p 31 ]]> Handling operations for the second type of tools <![CDATA[t 32 ]]> After transporting, cutting operation is carried out <![CDATA[p 32 ]]> Cutting operations with the second type of tool <![CDATA[t 33 ]]> Cutting is completed and the transportation operation is carried out <![CDATA[p 33 ]]> Handling operations for the second type of tools <![CDATA[t 34 ]]> After the transport is completed, enter the unloading buffer <![CDATA[p 2f ]]> Unloading buffer for finished products of the second type of tool

[0110] Attachment Figure 2 The Petri net shown can also be represented by the incidence matrix A as shown below:

[0111]

[0112] Step 2) (Reconstructing the Petri net model after the urgent order is inserted): Combine the Petri net model of the urgent order with the original manufacturing system Petri net model to construct a new Petri net model and update the association matrix and identification. The specific steps are as follows:

[0113] Step 2-1): Record (N, M a ) is the Petri net model of the original system when the order is inserted, M a is the identifier of the Petri net model of the original manufacturing system when the urgent order is inserted, (N ad , M ad ) is the urgent order Petri net model, N ad =(P add ,T add ,F add ). Each resource required is a resource in the original manufacturing system, that is, P radd ∈P r .

[0114] Step 2-2): Set the emergency order model (N ad , M ad ) and the original Petri net model (N, M a ) through the shared resource library R add Combining, we get a new Petri net model, namely (N af , M af )=(P∪P s ∪P f ∪P r ∪P add ,T∪T add ,F∪F add ),M af (P∪P s ∪P f ∪P r )=M a (P∪P s ∪P f ∪P r ),M af (P add )=M ad (P add ).

[0115] Specifically, in this example, the processing sequence for urgent orders is transport, polishing, and transport. The machines used are r5, r3, and r1. The Petri net model of the new system is as follows: Figure 3 As shown, the incidence matrix A' is as follows:

[0116]

[0117] Original system identifier Ma =(2,0,1,1,0,0,0,0,1,1,2,1,0,0,1,0,0,0), the system identifier after compounding is M af =(2,0,1,1,0,0,0,0,1,1,2,1,0,0,1,0,0,0,1,0,0,0,0).

[0118] Step 3) (Encoding and decoding): Number each workpiece and its process in the flexible manufacturing system to generate a processing sequence, and decode it into a transition sequence. The specific steps are as follows:

[0119] Step 3-1): Number all workpieces and processing paths to be processed (since the research object is a flexible manufacturing system, each type of workpiece can have multiple processing paths). Use the order in which the workpiece numbers appear to represent the processing sequence. Each workpiece must appear the same number of times in the code as the number of steps involved. The solution is encoded as a sequence of workpiece and path numbers, called a gene sequence. The gene sequence consists of an operator gene and a path gene, with the operator gene preceding the path gene. The operator gene represents the workpiece processing sequence, and its total length is the total number of steps required to complete all workpieces. The path gene represents the path selection, and its total length is the total number of workpieces.

[0120] Step 3-2): The above encoding scheme enables direct reverse decoding, that is, decoding the sequence directly into a scheduling sequence that satisfies the operation constraints. The nth occurrence of workpiece i in the process sequence represents the nth operation of workpiece i. Each number is decoded into the corresponding transition. For the same type of workpiece, different processing paths will result in different transitions when decoded.

[0121] according to Figure 2 For the model shown, a possible code π = 7,5,5,3,5,3,1,1,1,4,4,2,7,9,2,7,9,1,1,10,7,9,10,8,9,10,8,6,10,2,8,6,2,8,6,2,3,3,6,3,5,5,4,4,4,1,1,1,2,2,1,1,1,1,1. The first 45 digits of the code are the process sequence. The digits in the process sequence represent the workpiece numbers, where 1 to 5 are the first type of workpieces and 6 to 10 are the second type of workpieces. The appearance of the first 7 in the process sequence means that the first operation of blank 7 has begun, that is, t 31 The appearance of the second 7 represents the second operation of the blank 7. 32 Triggering, and so on, π can be decoded into the following transition sequence: a=t 31 -t 11 -t 22 -t 11 -t 23 -t 12-t 11 -t 12 -t 13 -t 11 -t 22 -t 11 -t 32 -t 31 -t 12 -t 33 -t 32 -t 14 -t 15 -t 31 -t 34 -t 33 -t 32 -t 31 -t 34 -t 33 -t 32 -t 31 -t 34 -t 13 -t 33 -t 32 -t 14 -t 34 -t 33 -t 15 -t 13 -t 14 -t 34 -t 15 -t 24 -t 15 -t 23 -t 24 -t 15 The last 10 numbers are the path selection sequence, which represents the number of processing paths selected by the 10 tools, and then step 4 is executed;

[0122] Step 4) (Rearrangement of pre-scheduling sequence): Record the start time of each step in the pre-scheduling sequence chrom before the urgent order is inserted, and store it in the array optime. The array optime is the set of start times of all processes in the pre-scheduling sequence, and its length is the total number of processes required to process all workpieces. Arrange the elements in the array optime in ascending order, and update the position of the elements in the pre-scheduling sequence at the same time according to the change of the element position to obtain the new arrays optime* and chrom*. Due to the asynchronous concurrency of the flexible manufacturing system, the updated array has no effect on the original pre-scheduling sequence, and the two are equivalent process sequences.

[0123] Specifically, a deadlock-free pre-scheduling process sequence of this embodiment

[0124] chrom=3,9,3,4,9,7,3,7,6,4,4,5,5,7,7,9,6,8,9,2,8,10,2,6,6,1,1,8,8,10,4,4,5,3,3,2,5,5,1,2,10,2,1,10,1,2,1,2,1,1,1,1,1,1,1.

[0125] The corresponding transition sequence is:

[0126] t 11 -t 31 -t 22 -t 11 -t 32 -t 31 -t 23 -t 32 -t 31 -t 12 -t 13 -t 11 -t 12 -t 33 -t 34 -t 33 -t 32 -t 31 -t 34 -t 11 -t 32 -t 31 -t 12 -t 33 -t 34 -t 11 -t 22 -t 33 -t 34 -t 32 -t 14 -t 15 -t 13 -t 24 -t 15 -t 13 -t 14 -t 15 -t 23 -t 14 -t 33 -t 15 -t 24 -t 34 -t 15 .

[0127] Corresponding collection:

[0128] optime=[0,0,4,4,5,5,27,27,27,8,40,8,12,49,55,55,49,49,61,61,55,55,65,71, 77,77,81,81,87,81,81,86,81,86,91,97,119,124,119,135,103,140,140,109,145].

[0129] optime*=[0,0,4,4,5,5,8,8,12,27,27,27,40,49,49,49,55,55,55,55,61,61,65,71, 77,77,81,81,81,81,81,86,86,87,91,97,103,109,119,119,124,135,140,140,145].

[0130] The pre-scheduling sequence after rearrangement is:

[0131] chrom*=3,9,3,4,9,7,4,5,5,3,7,6,4,7,6,8,7,9,8,10,9,2,2,6,6,1,1,8,10,4,5,4,3,8,3,2,10,10,5,1,5,2,2,1,1,2,1,2,1,1,1,1,1,1,1.

[0132] Corresponding transition sequence:

[0133] t 11 -t 31 -t 22 -t 11 -t 32 -t 31 -t 12 -t 11 -t 12 -t 23 -t 32 -t 31 -t 13 -t 33 -t 32 -t 31 -t 34 -t 33 -t 32 -t 31 -t 34 -t 11 -t 12 -t 33 -t 34 -t 11 -t 22 -t 33 -t 32 -t14 -t 13 -t 15 -t 24 -t 34 -t 15 -t 13 -t 33 -t 34 -t 14 -t 23 -t 15 -t 14 -t 15 -t 24 -t 15 .

[0134] Step 5) (Determine the urgent order insertion point and classify the processes): Based on the comparison between the urgent order insertion time and the element size in optime*, all processes are divided into: completed processes, in-process processes, and unfinished processes. Completed processes: processes whose start time is before the urgent order arrival time and whose next process has started or completed. In-process processes: processes whose start time is before the urgent order arrival time and whose next process has not yet started. Unfinished processes: processes that have not yet started. The order insertion point is after the completed processes and in-process processes and before the unfinished processes.

[0135] Specifically, such as Figure 4 As shown, in this embodiment, an urgent order is inserted at 50 unit time, which is recorded as workpiece 11. The workpiece has three processing steps, namely, transporting, grinding, and transporting.

[0136] According to step 7), the process sequence is divided into three sections: completed processes (3, 9, 3, 4, 7, 4, 5, 7, 6, 4), interrupted processes (9, 5, 3, 7, 6, 8), and remaining processes (7, 9, 8, 10, 9, 2, 2, 6, 6, 1, 1, 8, 10, 4, 5, 4, 3, 8, 3, 2, 10, 10, 5, 1, 5, 2, 2, 1, 1).

[0137] Keep the completed and interrupted processes of the pre-scheduled sequence, i.e. (3,9,3,4,9,7,4,5,5,3,7,6,4,7,6,8). af As the initial identification, the remaining processes (7,9,8,10,9,2,2,6,6,1,1,8,10,4,5,4,3,8,3,2,10,10,5,1,5,2,2,1,1) and the emergency order process (11,11,11,11) are rescheduled.

[0138] Step 6) (Construct discrete mapping relationship): Construct the mapping relationship between individual positions and process codes. For the processes, the smallest position value is used for scheduling. The smaller the position value of the process, the higher the processing priority. The specific steps are as follows:

[0139] Step 6-1) (Generate continuous position sequence): In the process of continuous coding of the process, generate a position for each process. The position is a sequence of positions in [X min ,X max ] is a real number randomly generated within the range of , and the position value corresponding to each process represents the priority of the corresponding process.

[0140] Step 6-2) (Establish a mapping relationship between discrete and continuous sequences): Each element on the i-th segment in the continuous position sequence corresponds to a transition on the processing path of workpiece i, and its position value represents the priority of the transition. The principle of scheduling with the smallest position value first is adopted, where the element with the smallest position value corresponds to the first transition on the processing path of workpiece i, the element with the second smallest position value corresponds to the second transition on the processing path of workpiece i, and so on.

[0141] Specifically, the discrete mapping relationship of this embodiment is as follows: Figure 5 shown.

[0142] Step 7) (Determine genetic parameters): Determine the various parameters used by the algorithm, including population size Popsize, maximum number of iterations Maxgen, cross factor CrossFactor, and mutation factor P m , selection factor SelectFactor;

[0143] Step 8) (Generate Initial Population): The initial population consists of chromosomes of a fixed size, which is the population size determined in Step 7). Based on the process classification in Step 5), the initial population retains the completed processes and ongoing processes in the pre-scheduled sequence. The initial population is generated by different combinations of the remaining process codes.

[0144] The tent mapping rule is used to generate the initial population, improve the discreteness and uniformity of the sequence, and reduce the probability of duplicates, thereby improving the search efficiency and maintaining the diversity of the search process. The specific formula is as follows:

[0145]

[0146] X i =X min +z i ×(X max -X min )

[0147] Where T is the population size, z irepresents the chaotic sequence of the i-th mapping, z0∈[0,1] represents the initial chaotic sequence, β is the chaotic coefficient, X i is the individual position, X max and X min are the upper and lower limits of the search space. The specific steps are as follows:

[0148] Step 8-1): Set i=1, initial population PopChrom, initial chaotic sequence z0;

[0149] Step 8-2): Determine whether i is greater than Popsize. If so, output the initial population PopChrom; if not, execute step 8-3)

[0150] Step 8-3): Calculate the chaotic sequence z of the chromosome i ;

[0151] Step 8-4): In [X min ,X max ]Calculate the position X corresponding to the step in the chromosome i

[0152] Step 8-5): Pass each process position X i Adjust the priority of the process.

[0153] Step 8-6): i=i+1, re-execute step 8-2);

[0154] Check each randomly generated chromosome to see if it meets the coding requirements of step 3). If not, make corrections.

[0155] Step 9): Step 9) (Deadlock detection and repair): Combine the association matrix A' and the initial identifier M of the reconstructed Petri net model af , deadlock detection and repair are performed on the decoded sequence to ensure that the repaired gene sequence can meet resource constraints, processing order constraints and control constraints. The specific steps are as follows:

[0156] Step 9-1): Set u=1 and record the transition number of the current detection;

[0157] Step 9-2): Determine whether u is greater than the length of the transition sequence. If so, repair the gene sequence. Otherwise, set the uth transition in the transition sequence to t. α , execute step 9-3);

[0158] Step 9-3): Check the transition t α Is it enabled under the current flag? If it is enabled, go to step 9-4). Otherwise, select t α The next transition is placed before this transition and t is updated. α, re-execute this step;

[0159] Step 9-4): Use the one-step-ahead look method to determine the change t α Is it allowed to trigger? If not allowed, select t α The next transition is placed before this transition and t is updated. α , re-execute step 9-3); otherwise, execute step 9-5); the specific steps are as follows:

[0160] Specifically, select a chromosome

[0161] π=3,9,3,4,9,7,4,5,5,3,7,6,4,7,6,8,7,1,1,10,9,2,2,6,6,11,9,8,8,10, 11,4,5,4,11,3,8,3,2,10,10,11,5,1,5,2,2,1,1,2,1,2,1,1,1,1,1,1,1,1,

[0162] The corresponding transition sequence a=

[0163] t 11 -t 31 -t 22 -t 11 -t 32 -t 31 -t 12 -t 11 -t 12 -t 23 -t 32 -t 31 -t 13 -t 33 -t 32 -t 31 -t 34 -t 11 -t 12 -t 31 -t 34 -t 11 -t 12 -t 33 -t 34 -t ad1 -t 34 -t 32 -t 33 -t 32 -t ad2 -t 14 -t 13 -t 15 -t ad3 -t 24 -t 34 -t 15 -t 13 -t33 -t 34 -t ad4 -t 14 -t 23 -t 15 -t 14 -t 15 -t 24 -t 15 ,

[0164] Initial identifier M0 = (2, 0, 1, 1, 0, 1, 0, 1, 1, 2, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0),

[0165] After judging the transition 11 -t 31 -t 22 -t 11 -t 32 -t 31 -t 12 -t 11 -t 12 -t 23 -t 32 -t 31 -t 13 -t 33 -t 32 -t 31 -t 34 -t 11 back,

[0166] That is M a [t 11 -t 31 -t 22 -t 11 -t 32 -t 31 -t 12 -t 11 -t 12 -t 23 -t 32 -t 31 -t 13 -t 33 -t 32 -t 31 -t 34 -t 11 >M1,

[0167] Where M1=(1,0,2,1,0,0,0,0,1,1,2,0,1,1,0,0,0,0,1,0,0,0,0). Now determine the transition t 11 Is it allowed to trigger, change t 11 The pre-operation library p 1sand the previous resource library r1 both contain tokens, then transition t 11 Enable, trigger t 11 , that is, M1[t 11 >M2, M2=(0,1,2,1,0,0,0,0,1,1,2,0,1,0,0,0,0,0,1,0,0,0,0), M2 is the deadlock indicator, then transition t 11 It is not allowed to trigger under the identifier M1. You need to select the enabling transition from the following transitions and put it in t 11 Before that, determine whether the transition is allowed to be triggered.

[0168] Step 9-5): Determine the transition t α Whether the corresponding processing steps meet the processing sequence constraints, that is, the transition t α Whether the corresponding processing step precedes the previous processing step of this step.

[0169] If not satisfied, select t α The next transition is placed before this transition and t is updated. α , re-execute step 9-3), otherwise execute step 9-6);

[0170] The specific constraints on the workpiece processing sequence are as follows:

[0171] Assume that there is a mark M0, under which t 11 It cannot be triggered. From steps 9-4) to 9-6), we can get the transition that can be triggered under the current mark as t 22 , the workpiece whose index number in the encoding array corresponds to 3, which actually means the second process of the third workpiece. Insert this transition into the currently disabled transition t 11 Before, but now if the 16th index in the encoding array is also workpiece 3, the corresponding transition is t 11 , which actually means the first process of the third workpiece. At this time, after the repair, workpiece 3 first performs the second process and then the first process, which violates the processing order of the workpiece. Therefore, a workpiece processing order constraint is added during the repair transition to determine whether the workpiece corresponding to the selected transition meets the conditions:

[0172] Determine the index numbers corresponding to the currently disabled transition and the enabled transition selected in step 9-4). The workpiece number corresponding to the selected enabled transition cannot appear between the workpiece numbers corresponding to these two index numbers in the encoding array.

[0173] Step 9-6): Trigger t α , update the current flag, set u = u + 1, and execute step 9-2);

[0174] Repeat the above steps to complete the chromosome detection and repair.

[0175] Step 10) (Calculate the completion time MakeSpan and fitness value): Calculate the processing time of the flexible manufacturing system based on the time allocation principle of the Gantt chart, determine the idle time of the machine used in the current process, compare it with the estimated completion time of the previous process of the workpiece corresponding to the process, and take the larger value of the two as the start time of the current process. This time is also the release time of the resources occupied by the previous process and the actual completion time of the previous process. The start time plus the operation time of the current process is the estimated completion time of the current process. After calculating all processes, the completion time of the last process in the system is the completion time MakeSpan of the entire process sequence.

[0176] The fitness value formula is as follows:

[0177]

[0178] Where MaxSpan is the maximum processing time of all individuals in the current population, MinSpan is the minimum processing time of all individuals, k1 and k2 are arbitrary constants, and Adapt is the fitness value of the individual. In this example, k1 is 0.1 and k2 is 0.2.

[0179] Step 11) (Termination rule determination): 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, proceed to step 13); if not, proceed to step 12);

[0180] Step 12) (Genetic Operation): Perform the three genetic operations of selection, crossover, and mutation on the current population to obtain a new generation of population. Execute steps 12-1) to 12-4). The specific steps are as follows:

[0181] Step 12-1) (Selection operation): Introduce an elite storage strategy to store the top 10% of the best population individuals in terms of fitness. For the remaining population, a roulette wheel selection method is used for selection. The probability of each individual being selected is proportional to its fitness function value. The formula for the probability of individual selection and the cumulative probability of chromosomes is as follows:

[0182]

[0183] Randomly generate a random number rand in [0,1]. If Q(x i )≤rand means that the i-th individual is selected, and this is repeated to obtain a population containing Selectnum×Popsize individuals. Here Selectnum is the selection factor and Popsize is the population size. In this example, Selectnum is 0.3 and Popsize is 200.

[0184] Step 12-2): Crossover operation, generate a random number rand between [0,1]. If rand is less than the crossover factor CrossFactor, use the POX (precedence operation crossover) method for each two chromosomes in the population. Chromosomes p1 and p2 cross to generate two offspring c1 and c2. The crossover diagram is as follows Figure 6 As shown, the crossover process is as follows:

[0185] Step 12-2-1): Randomly divide the artifact set into two non-empty subsets J1 and J2;

[0186] Step 12-2-2): Copy the processes in p1 that belong to the workpieces in workpiece set J1 to c1, and copy the processes in p2 that belong to the workpieces in workpiece set J1 to c2, preserving their positions;

[0187] Step 12-2-3): Copy the processes in p1 that belong to the workpieces in workpiece set J2 to c2, and copy the processes in p2 that belong to the workpieces in workpiece set J2 to c1, preserving their order.

[0188] In this example, the cross factor CrossFactor is 0.7;

[0189] Step 12-3) (Mutation operation)): In order to avoid the excellent chromosome mutation leading to the decline of the overall quality of the population, a non-uniform mutation rate P is used. m Enhance the algorithm's spatial search capability, enabling it to conduct a more comprehensive spatial search. A high mutation rate in the initial iterations of the algorithm allows it to quickly cover the solution space. As the iterations progress, the mutation rate should be reduced to ensure that good chromosomes can be inherited to the next generation. The linear adaptive mutation rate expression is as follows:

[0190]

[0191] Among them, P m0 Indicates the initial mutation rate, ρ is a constant in the interval (0,1). In this example, the initial mutation rate P m0 is 0.3 and ρ is 0.5.

[0192] For the process code, a mutation operator that simulates binary coding is used to change the position of the process.

[0193] X new =X i +(X imin +X imax )×δ i

[0194]

[0195] For the path code, a chromosome is selected and a random number rand between [0,1] is generated. If rand is less than the mutation rate, a mutation operation is performed on the individual. The operation is as follows:

[0196] Since the first type of workpiece has two processing paths to choose from, when the chromosome mutates, if the first type of workpiece does not undergo the second step, its processing path will be changed. The path mutation is as follows: Figure 7 shown.

[0197] Step 12-4): After the genetic operation is complete, merge all parent individuals and their offspring into a new population, gen = gen + 1. Return to step 9 to decode each chromosome in the new population and perform feasibility checks and repair operations. Repeat step 10, sorting the population from highest to lowest fitness, and select the top Popsize individuals.

[0198] Step 13) (Output optimal solution): After satisfying the termination rule of step 11), output the chromosome sequence, transition sequence and corresponding processing time MakeSpan of the optimal individual in the population to complete the rescheduling of the flexible manufacturing system.

[0199] Specifically, the simulation parameters of this embodiment are set as follows: the maximum number of iterations Maxgen is 200, the population size Popsize is 200, and the optimal chromosome is output after iteration.

[0200] π=3,9,3,4,9,7,4,5,5,3,7,6,4,7,6,8,7,9,9,1,8,3,5,1,2,2,8,8,3,10,10 ,4,4,11,11,5,10,1,10,11,2,5,1,11,6,6,1,2,2,1,1,2,1,1,1,1,1,1,1,1.

[0201] Corresponding transition sequence

[0202] a=t 11 -t 31 -t 22 -t 11 -t 32 -t 31 -t 12 -t 11 -t 12 -t 23 -t 32 -t 31 -t 13 -t 33 -t 32 -t 31 -t 34 -t33 -t 34 -t 11 -t 32 -t 24 -t 13 -t 12 -t 11 -t 12 -t 33 -t 34 -t 15 -t 31 -t 32 -t 14 -t 15 -t ad1 -t ad2 -t 14 -t 33 -t 13 -t 34 -t ad3 -t 13 -t 15 -t 14 -t ad4 -t 33 -t 34 -t 15 -t 14 -t 15 .

[0203] The corresponding maximum completion time MakeSpan is 152. The Gantt chart corresponding to the optimal solution is as follows Figure 8 shown.

[0204] By comparing with the algorithm in Reference 1, the optimal solution obtained in this embodiment is shown in Table 2:

[0205] Table 2 Comparison of multiple optimization results of the algorithm

[0206]

[0207]

[0208] The analysis shows that the improved genetic algorithm used in the present invention has achieved a better value in the optimization target, which shows that the improvement strategy adopted by the present invention has a significant effect on improving the algorithm's search ability in the solution space and its ability to escape from the local optimal value.

[0209] The specific implementation scheme described above further illustrates in detail the purpose, technical solutions and beneficial effects of the present invention. It should be understood that the above is only a specific implementation scheme of the present invention and is not intended to limit the scope of the present invention. Any equivalent changes and modifications made by any technician in this field without departing from the concept and principle of the present invention should fall within the scope of protection of the present invention.

Claims

1. A method for inserting and rescheduling urgent orders in a flexible manufacturing system based on Petri nets, characterized in that: The following steps are involved: Step 1: Establish a Petri net model of the flexible manufacturing system before the urgent order is inserted: Based on the processing procedures of the workpieces within the flexible manufacturing system and the machine occupancy between each workpiece, construct a Petri net model (N, M0) that can express the discrete parallel system and its association matrix A, and define the following symbols: N: A Petri net N = (P, T, F) consisting of circular nodes, square nodes, and directed arcs, representing a flexible manufacturing system consisting of m machines capable of processing n types of workpieces; P: Place set Among them, P i0 =P is ∪P if represents the set of idle places, P is is the upload buffer for the i-th type of artifact, P if is the corresponding offload buffer, p ij P represents the place corresponding to the jth operation of the i-th type of workpiece, r Represents the collection of resource libraries; T: Transition set, consisting of all square nodes in N. Each transition t represents the end of the previous process and the beginning of the next process, and also represents the release of resources used by the previous process and the application of resources used by the next process; F: A directed arc set representing the processing flow of each workpiece in the system and the resource demand and release of each processing step during the processing; M:P→N is an identifier, where N is a set of non-negative integers, representing the processing status of the system. Each number in the identifier represents the number of workpieces or resources contained in each location. M0 is the initial identifier, indicating that the system has not started processing, the workpiece is in the upload buffer, and the resources are not occupied. A: incidence matrix, which represents the changing pattern of the number of tokens in each repository under each transition in N. It is a matrix with |T| rows and |P| columns. Step 2: Reconstruct the Petri net model after the urgent order is inserted: combine the Petri net model of the urgent order with the original manufacturing system Petri net model to construct a new Petri net model; For the flexible manufacturing system after the urgent order is inserted, under the premise of satisfying process constraints, resource constraints and control constraints and without deadlock, the objective function of system scheduling is to minimize the maximum completion time, that is: F = min{MakeSpan} NakeSpan=max{C k } Among them, C k is the completion time of the last process of the kth workpiece, k = 1, 2, ..., p, p is the total number of workpieces; MakeSpan is the maximum time to complete the processing of all workpieces; Step 3: Encoding and decoding: Number each workpiece and its process in the flexible manufacturing system to generate a processing sequence, and decode it into a transition sequence; Step 4. Rearrange the pre-scheduling sequence: Record the start time of each process in the pre-scheduling sequence chrom before the urgent order is inserted and store it in the array optime. The array optime is the set of start times of all processes in the pre-scheduling sequence, and its length is the total number of processes required to complete all workpieces. Arrange the elements in the array optime in ascending order, and update the positions of the elements in the pre-scheduling sequence simultaneously according to the changes in the element positions, to obtain the new arrays optime* and chrom*. Due to the asynchronous concurrency of the flexible manufacturing system, the updated arrays have no effect on the original pre-scheduling sequence, and the two are equivalent process sequences. Step 5. Determine the urgent order insertion point and classify the processes: Based on the comparison between the urgent order insertion time and the element size in optime*, all processes are divided into: completed processes, in-process processes, and unfinished processes. Completed processes: processes whose start time is before the urgent order arrival time and whose next process has started or completed; in-process processes: processes whose start time is before the urgent order arrival time and whose next process has not yet started; unfinished processes: processes that have not yet started. The urgent order insertion point is after the completed and in-process processes and before the unfinished processes. Step 6: Construct discrete mapping relationship: Construct the mapping relationship between individual positions and process codes. For processes, the smallest position value is used for scheduling. The smaller the position value of the process, the higher the processing priority. Step 7: Determine the genetic parameters: Determine the various parameters used in the algorithm, including the population size Popsize, the maximum number of iterations Maxgen, the cross factor CrossFactor, and the mutation factor P m , selection factor SelectFactor; Step 8. Generate an initial population: The initial population consists of chromosomes of a fixed size, the specific size being the population size determined in step 7. Based on the process classification in step 5, the initial population retains the completed processes and ongoing processes in the pre-scheduled sequence, and the initial population is generated by different combinations of the remaining process codes. Step 9, deadlock detection and repair: Combine the association matrix A' and the initial identifier M of the reconstructed Petri net model af ,deadlock detection and repair are performed on the decoded sequence to ensure that the repaired gene sequence can meet resource constraints, processing order constraints and control constraints; Step 10. Calculate the MakeSpan and fitness value: Calculate the processing time of the flexible manufacturing system using the Gantt chart's time allocation principle. Determine the idle time of the machine used in the current process and compare it with the estimated completion time of the previous process of the workpiece corresponding to the process. The larger of the two is taken as the start time of the current process. This time is also the release time of the resources occupied by the previous process and the actual completion time of the previous process. The start time plus the operation time of the current process is the estimated completion time of the current process. After calculating all processes, the completion time of the last process in the system is the MakeSpan of the entire process sequence. The fitness value formula is as follows: Among them, MaxSpan is the maximum processing time of all individuals in the current population, MinSpan is the minimum processing time of all individuals, k1 and k2 are arbitrary constants; Adapt is the fitness value of the individual; Step 11, termination condition judgment: judge whether the termination condition gen>Maxgen is met, gen is the number of iterations of the current population, and Maxgen is the maximum number of iterations; if the termination condition is met, execute step 13 and output the optimal individual; if not, execute step 12; Step 12: Genetic operation: Genetic operation includes selection, crossover and mutation. After the genetic operation is completed, all parent individuals and offspring obtained through genetic operation are merged into a new population, i.e., gen = gen + 1. Return to step 9 to perform deadlock detection and repair operations on each chromosome in the new population. Step 13: Output the optimal solution: After satisfying the termination rule of step 11, output the chromosome sequence, transition sequence and corresponding completion time MakeSpan of the optimal individual in the population to complete the rescheduling of the flexible manufacturing system.

2. The method for inserting and rescheduling urgent orders in a flexible manufacturing system based on Petri nets according to claim 1, characterized in that: In step 1, the Petri net model of the emergency order is combined with the original manufacturing system Petri net model to construct a new Petri net model. The specific steps are as follows: Step 2-1: Record (N, M a ) is the Petri net model of the original system when the urgent order is inserted, M a is the identifier of the Petri net model of the original manufacturing system when the urgent order is inserted, (N ad , M ad ) is the urgent order Petri net model, N ad =(P add ,T add ,F add ), where each resource required is a resource in the original manufacturing system, i.e., P radd ∈P r ; Step 2-2: Set the emergency order model (N ad , M ad ) and the original Petri net model (N, M a ) through the shared resource library P radd Combining, we get a new Petri net model, namely (N af , M af )=(P∪P s ∪P f ∪P r ∪P add ,T∪T add ,F∪F add ),M af (P∪P s ∪P f ∪P r )=M a (P∪P s ∪P f ∪P r ),M af (P add )=M ad (P add ).

3. The method for inserting and rescheduling urgent orders in a flexible manufacturing system based on Petri nets according to claim 2, characterized in that: In step 3, each workpiece and its process in the flexible manufacturing system is numbered to generate a processing sequence, and then decoded into a transition sequence. The specific steps are as follows: Step 3-1: Number all workpieces and processing paths to be processed. Use the order in which the workpiece numbers appear to represent the processing sequence. The number of times each workpiece appears in the code must be equal to the number of its processes. The code for the solution is the combined sequence of workpiece numbers and path numbers, called a gene sequence. The gene sequence is composed of an operator gene and a path gene, with the operator gene first and the path gene following in sequence. The operator gene represents the workpiece processing sequence, and its total length is the total number of processes required to process all workpieces. The path gene represents the path selection, and its total length is the total number of workpieces. Step 3-2: Through the above encoding scheme, direct reverse decoding can be performed, that is, the sequence is directly decoded into a scheduling sequence that satisfies the operation constraints. The nth appearance of workpiece i in the process sequence represents the nth operation of workpiece i. Each number is decoded into the corresponding transition in turn. For the same type of workpiece, if the processing path is different, the transition obtained during decoding will also be different.

4. The Petri net-based flexible manufacturing system emergency order insertion and rescheduling method according to claim 3 is characterized in that: In step 4, the pre-scheduled sequence is reordered, and the start time of each step in the pre-scheduled sequence is recorded and stored in the array optime. The array optime is the set of start times of all steps in the pre-scheduled sequence, and its length is the total number of steps required to complete all workpieces. The elements in the array optime are sorted in ascending order, and the positions of the elements in the pre-scheduled sequence are updated at the same time according to the changes in the element positions to obtain the new array optime. * and chrom * , the specific steps are as follows: Step 4-1: Set i = 1; optimize * =optime;chrom * =chrom; Step 4-2: Determine whether i is greater than |optime * |-1, if the conditions are met, the pre-scheduled sequence is rearranged, |optime * | for array optime * Output the length of the new array optime * and chrom * ; If not satisfied, execute step 4-3; Step 4-3: Set j = 1; Step 4-4: Determine whether j is greater than |optime * |-i-1, if the condition is met, complete one traversal, set i=i+1, and execute step 4-2 again; if not, execute step 4-5; Step 4-5: Determine Optime * Is [j] greater than optime? * [j+1], if the conditions are met, execute steps 4-6; Steps 4-6: Exchange Optime * [j] and optime * [j+1] position, swap chrom * [j] and chrom * The position of [j+1]; Step 4-7: Let j = j + 1 and re-execute step 4-4; due to the asynchronous concurrency characteristics of the flexible manufacturing system, the updated array has no effect on the original pre-scheduling sequence, and the two are equivalent process sequences.

5. The method for inserting and rescheduling urgent orders in a flexible manufacturing system based on Petri nets according to claim 4, characterized in that: In step 5, based on the comparison between the urgent order insertion time t and the element size in optime*, all processes are divided into: completed processes, in-process processes, and unfinished processes. The order insertion point is after the completed processes and in-process processes and before the unfinished processes. The specific steps are as follows: Step 5-1: Set i=1; Step 5-2: Determine whether i is greater than |optime * |, if the conditions are met, the process classification is completed; otherwise, step 5-3 is executed; Step 5-3: Determine whether t is greater than optime*[i]. If the condition is met, execute step 5-4. If not, the process corresponding to chrom*[i] is an unfinished process, and execute step 5-6. Step 5-4: Set j to the index value of the next step of the workpiece corresponding to chrom*[i]; Step 5-5: Determine whether t is greater than optimal*[j]. If the condition is met, the process corresponding to chrom*[i] is a completed process; if not, it is a process in progress. Step 5-6: Let i=i+1 and execute step 5-2 again.

6. The method for inserting and rescheduling urgent orders in a flexible manufacturing system based on Petri nets according to claim 5, characterized in that: In step 6, a mapping relationship between individual positions and process codes is constructed during coding. The specific steps are as follows: Step 6-1, generate continuous position sequence: in the process of continuous coding of the process, generate a position for each process, a position is a sequence of positions in [X min ,X max ] is a real number randomly generated within the range of , and the position value corresponding to each process represents the priority of the corresponding process; Step 6-2. Establish a mapping relationship between discrete and continuous sequences: Each element on the i-th segment in the continuous position sequence corresponds to a transition on the processing path of workpiece i, and its position value represents the priority of the transition. The principle of scheduling with the smallest position value first is adopted, where the element with the smallest position value corresponds to the first transition on the processing path of workpiece i, the element with the second smallest position value corresponds to the second transition on the processing path of workpiece i, and so on.

7. The method for inserting and rescheduling urgent orders in a flexible manufacturing system based on Petri nets according to claim 6, characterized in that: In step 8, an initial population is generated. The initial population consists of chromosomes of a fixed size. The specific size is the population size determined in step 7. According to the process classification in step 5, the initial population retains the completed processes and the processes being processed in the pre-scheduled sequence. The initial population is generated by different combinations of the remaining process codes. The specific steps are as follows: The tent mapping rule is used to generate the initial population, improve the discreteness and uniformity of the sequence, and reduce the probability of duplicates, thereby improving the search efficiency and maintaining the diversity of the search process. The specific formula is as follows: X i =X min +z i ×(X max -X min ) Among them, Popsize is the population size, z i represents the chaotic sequence of the i-th mapping, z0∈[0,1] represents the initial chaotic sequence, β is the chaotic coefficient, X i is the individual position, X max and X min is the upper and lower bound of the search space. The specific steps are as follows: Step 8-1: Set i=1, initial population PopChrom, initial chaotic sequence z0; Step 8-2: Determine whether i is greater than Popsize. If so, output the initial population PopChrom; if not, execute step 8-3; Step 8-3: Calculate the chaotic sequence z of the chromosome i ; Step 8-4: In [X min ,X max ]Calculate the position X corresponding to the step in the chromosome i ; Step 8-5: Pass each process position X i Adjust the priority of the process; Step 8-6: Let i=i+1 and re-execute step 8-2; check whether each randomly generated chromosome meets the encoding requirements of step 3. If not, make corrections.

8. The method for inserting and rescheduling urgent orders in a flexible manufacturing system based on Petri nets according to claim 7, characterized in that: In step 9, the reconstructed Petri net's incidence matrix A' and the initial identifier M are combined. af Deadlock detection and repair are performed on the decoded sequence to ensure that the repaired gene sequence can meet the control constraints and resource constraints. The specific steps are as follows: Step 9-1: Set u=1 and record the transition number of the current detection; Step 9-2: Determine whether u is greater than the length of the transition sequence. If so, repair the gene sequence. Otherwise, set the uth transition in the transition sequence to t. α , execute step 9-3; Step 9-3: Check the transition t α Is it enabled under the current flag? If it is enabled, execute step 9-4. Otherwise, select t α The next transition is placed before this transition and t is updated. α , re-execute this step; Step 9-4: Use the one-step-ahead method to determine the change t α Is it allowed to trigger? If not allowed, select t α The next transition is placed before this transition and t is updated. α , re-execute step 9-3; otherwise, execute step 9-5; Step 9-5: Determine the transition t α Whether the corresponding processing step meets the processing sequence constraint, if not, select t α The next transition is placed before this transition and t is updated. α , re-execute step 9-3); otherwise, execute step 9-6; Step 9-6): Trigger t α , update the current flag, set u = u + 1, and execute step 9-2; Repeat the above steps to complete chromosome deadlock detection and repair.

9. The method for inserting and rescheduling urgent orders in a flexible manufacturing system based on Petri nets according to claim 8, characterized in that: In step 12, genetic operations are performed on the chromosomes in the population to obtain a new generation of population. Genetic operations include selection, crossover, and mutation. The specific steps are as follows: Step 12-1, selection operation: Introduce the elite storage strategy to store the top 10% of the best population individuals in terms of fitness value. For the remaining population, the roulette wheel selection method is used for selection. The probability of each individual being selected is proportional to its fitness value. The formula for the probability of individual selection and the cumulative probability of chromosomes is as follows: Randomly generate a random number rand in [0,1]. If Q(x i )≤rand means that the i-th individual is selected, and the process is repeated to obtain a population containing Selectnum×Popsize individuals; Step 12-2, Crossover operation: Generate a random number rand between [0,1]. If rand is less than the crossover factor CrossFactor, use the POX (precedence operation crossover) method on every two chromosomes in the population; chromosomes p1 and p2 are crossed to generate two offspring c1 and c2. The crossover process is as follows: Step 12-2-1: Randomly divide the artifact set into two non-empty subsets J1 and J2; Step 12-2-2: Copy the processes in p1 that belong to the workpieces in workpiece set J1 to c1, and copy the processes in p2 that belong to the workpieces in workpiece set J1 to c2, preserving their positions; Step 12-2-3: Copy the processes in p1 that belong to the workpieces in workpiece set J2 to c2, and copy the processes in p2 that belong to the workpieces in workpiece set J2 to c1, preserving their order; Step 12-3, mutation operation: In order to avoid the excellent chromosome mutation leading to the decline of the overall quality of the population, a non-uniform mutation rate P is used. m Enhance the algorithm's spatial search capability so that it can perform a more comprehensive spatial search. The higher mutation rate in the initial iteration of the algorithm allows it to quickly cover the solution space. As the iteration process deepens, the mutation rate should be reduced to ensure that good chromosomes can be inherited to the next generation. The linear adaptive mutation rate expression is as follows: Among them, P m0 represents the initial mutation rate, ρ is a constant in the interval (0,1); For the process code, a mutation operator that simulates binary coding is used to change the position of the process. The specific formula is as follows: X new =X i +(X imin +X imax )×δ i For the path code, a chromosome is selected and a random number rand between [0,1] is generated. If rand is less than the mutation rate, a mutation operation is performed on the individual. The operation is as follows: Since the first type of workpiece has two processing path options, when the chromosome mutates, if the first type of workpiece has not undergone the second step, its processing path will be changed; Step 12-4: After the genetic operation is completed, all parent individuals and the offspring obtained through the genetic operation are merged into a new population, that is, gen = gen + 1; return to step 9 to decode each chromosome in the new population and perform feasibility detection and repair operations, and re-execute step 10, sorting from large to small according to fitness value, and selecting the first Popsize individuals.

Citation Information

Patent Citations

  • Mixed flow manufacturing workshop scheduling method based on improved genetic algorithm

    CN112966822A

  • Deadlock-free scheduling method of flexible manufacturing system based on Petri network and neural network

    CN117314078A