Matrix type workshop scheduling method based on genetic algorithm
Through the matrix workshop scheduling method based on genetic algorithm, the optimal chromosome is generated and decoded, which solves the problem of matrix workshop scheduling flexibility and adaptability, and realizes efficient utilization of resources.
Patent Information
- Application Number
- CN202411746798.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-02
- Publication Date
- 2025-01-03
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
How to achieve high flexibility and strong adaptive scheduling in matrix workshops, quickly respond to market changes and order demands, and improve resource utilization.
Using a matrix workshop scheduling method based on genetic algorithm, data use cases are generated through the use case generator, MSOSAS codes generate chromosomes, global selection, local selection and random selection, calculation of fitness, machine crossing and process crossing, and generating the optimal chromosomes. And decode the machine selection, process sorting and processing time of the workpiece during processing.
It realizes rapid response and high flexibility in the matrix workshop, rational allocation of resources, and improves resource utilization.
Smart Images

Figure CN119247908A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of workshop scheduling, and in particular to a matrix workshop scheduling method based on genetic algorithm. Background Art
[0002] With the continuous improvement of industrial level, the traditional manufacturing model can no longer meet the changing needs of the market. At the same time, factors such as dynamic market demand, large-scale batch customization, high performance and quality are driving enterprises to transition from traditional manufacturing systems to next-generation manufacturing systems. Flexible and reconfigurable manufacturing systems have become one of the important ways to meet current needs, such as the RMS (Reconfigurable Manufacturing Systems, RMS) system of the BMW Munich plant in Germany and the RMS workshop of Festo.
[0003] Matrix production has the characteristics of high flexibility and strong adaptability. It can respond quickly to changes in orders, reasonably allocate resources, and improve resource utilization. In recent years, with the development of information technology, this concept has been constantly updated. How to conduct matrix workshop scheduling is an urgent problem that needs to be solved. Summary of the invention
[0004] To solve the above problems, the present invention provides a matrix shop scheduling method based on genetic algorithm, and the specific technical solution is as follows: S1: Generate relevant data use cases through the use case generator according to the characteristics of the matrix workshop; S2: Generate chromosomes through MSOSAS coding, and the chromosomes include machine selection, process sorting and capacity presetting; S3: Initialize the population, perform global selection, local selection and random selection according to the preset ratio, and obtain the initial solution after selection; The specific process of global selection, local selection and random selection is as follows: First, in the MS segment, the global selection is performed with random workpiece order, and the machine with the smallest sum of the cumulative processing time in the optional machine set and the processing time of the corresponding machine processing the process is selected to generate the population; Secondly, in the MS segment, the local selection is carried out in units of workpieces, from the first workpiece to the last workpiece, and the machine with the smallest sum of the accumulated processing time of the optional machine set and the processing time of the corresponding machine processing the process is selected to generate the population; In the final MS segment, the population is randomly selected based on the preset ratio; S4: Calculate the fitness of multiple chromosomes; S5: According to the fitness and crossover probability, a preset number of populations are selected for machine crossover and process crossover; According to the fitness value and mutation probability, a preset number of populations are selected for machine mutation and process mutation to generate the optimal chromosome; S6: Decode the optimal chromosome to generate machine selection, process sequencing, preset capacity and processing time for the workpiece during processing.
[0005] Furthermore, the relevant data use cases include machines and their preset capabilities, processes and their required capabilities, processing time, and preset capacity configuration time.
[0006] Furthermore, when generating a use case, the use case generator sets the hyper parameters including: the number of workpieces, the number of machines, the number of processes, the machine preset capacity, the workpiece process requirement capacity, and the machine processing time.
[0007] Furthermore, in step S2, the chromosome is generated by coding, as follows: The MS segment is arranged in order according to the workpiece and the process of the workpiece, and each integer represents the order of the processing machine selected in the current process in the optional machine set; Each gene in the OS segment is directly encoded with a workpiece number. The order in which the workpiece number appears indicates the order of processing between the workpiece processes. The total number of times the workpiece number appears is equal to the total number of processes of the workpiece. Each gene in the AS segment is determined by matching the preset capabilities provided by the machine on the MS with the capabilities required by the process on the OS.
[0008] Furthermore, in step S4, the maximum completion time is used as a fitness function to calculate the fitness of multiple chromosomes.
[0009] Furthermore, in step S5, the optimal chromosome is generated, and the specific process is as follows: Randomly generate a number to determine whether crossover or mutation is needed; If so, a preset number of populations are randomly selected and a number is generated to determine whether to perform machine crossover / mutation or process crossover mutation; Based on the judgment results, fitness calculation is performed, and according to the fitness value and crossover probability or mutation probability, excellent populations are screened and retained to obtain the optimal chromosome.
[0010] Further, in step S7, decoding the optimal chromosome includes reading the machine, configuration capability, and process from the MSOSAS code, and reading the current state of the machine from the machine and process matrix; The current state of the machine includes the end time of the previous process of a given job T_last0_end, the end time T_M_end when the machine completes the previous process, the processing time PT of the current process, and the current machine reconfiguration capability time AST.
[0011] Furthermore, the current status of the machine is read from the machine and process matrix. The specific process is as follows: M1: Determine whether the current machine needs to be reconfigured. If so, update the processing time PT = PT + AST and execute M2, otherwise execute M6; M2: Determine whether the current machine has an idle time window and whether it is not less than the updated processing time PT. If so, execute M3, otherwise execute M5; M3: Determine whether the start time of the time slot is greater than T_last0_end+AST. If so, set the current process start time T_start to T_last0_end and execute M4. Otherwise, execute M5. M4: Determine whether the end time of the time slot minus T_last_end is not less than PT-AST. If so, set T_start=Max(time slot start time, T_last0_end - AST) and execute M6. Otherwise, execute M5. M5: Set the current process start time T_start = Max (T_lastO_end – AST, T_M_end), and execute M6; M6: Determine whether the current machine has an idle time window and whether it is greater than PT. If so, execute M7; otherwise, execute M8; M7: Determine whether the start time of the time slot is greater than T_las0_end. If so, set the current process start time T_start to T_lastO_end and execute M8. Otherwise, execute M9. M8: Determine whether the end time of the time slot minus T_last0_end is not less than PT. If so, set T_start = Max (time slot start time, T_last0_end) and execute M10; otherwise, execute M9; M9: Set the current process start time T_start = Max (T_last0_end, T_M_end), and execute M10; M10: Update T_end = T_start+PT, and update the machine status; M11: Enter the next process until all processes are decoded; M12: Calculate the maximum completion time and draw a Gantt chart.
[0012] The beneficial effects of the present invention are as follows: The present invention generates chromosomes by segmented encoding of workshop data, initializes the population, performs global selection, local selection and random selection at a preset ratio to obtain an excellent initial solution, then calculates the fitness of multiple chromosomes, selects a preset number of populations for machine crossover and process crossover according to the fitness value and crossover probability, selects a preset number of populations for machine mutation and process mutation according to the fitness value and mutation probability to generate the optimal chromosome, and finally decodes the optimal chromosome to generate machine selection, process sorting, capacity preset and processing time for workpieces during processing, can respond quickly according to changes in orders, solves the scheduling problem of matrix workshops, realizes production scheduling of highly flexible and adaptable matrix workshops, realizes reasonable allocation of resources, and improves resource utilization. BRIEF DESCRIPTION OF THE DRAWINGS
[0013] Figure 1 It is a schematic flow chart of the method of the present invention.
[0014] Figure 2 It is the matrix type workshop Gantt chart of the present invention.
[0015] Figure 3 It is the genetic algorithm convergence diagram of the present invention. DETAILED DESCRIPTION
[0016] The following description clearly and completely describes the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0017] In the description of the embodiments of the present invention, it should be noted that the indicated orientation or positional relationship is based on the orientation or positional relationship shown in the accompanying drawings, or the orientation or positional relationship in which the invention product is usually placed when in use, or the orientation or positional relationship commonly understood by those skilled in the art, or the orientation or positional relationship in which the invention product is usually placed when in use, which is only for the convenience of describing the present invention and simplifying the description, and does not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation on the present invention. In addition, the terms "first" and "second" are only used to distinguish the description, and cannot be understood as indicating or implying relative importance.
[0018] In the description of the embodiments of the present invention, it is also necessary to explain that, unless otherwise clearly specified and limited, the terms "set" and "connection" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a direct connection, or an indirect connection through an intermediate medium. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0019] Example 1 Embodiment 1 of the present invention discloses a matrix-type workshop scheduling method based on genetic algorithm, such as Figure 1 As shown, the specific process is as follows: S1: Generate relevant data use cases through the use case generator according to the characteristics of the matrix workshop; Specifically, the relevant data use cases include machines and their preset capabilities, processes and their required capabilities, processing time, and preset capacity configuration time.
[0020] When the use case generator generates a use case, the hyper parameters set include: the number of workpieces, the number of machines, the number of processes, the machine preset capacity, the workpiece process demand capacity, and the machine processing time.
[0021] The generated relevant data use cases are shown in Table 1 and Table 2 below: Table 1: Workpiece data table
[0022] Table 2: Machine data sheet
[0023] S2: Generate chromosomes through MSOSAS coding, and the chromosomes include machine selection, process sorting and capacity presetting; As a preferred embodiment, the encoding generates chromosomes as follows: The MS segment is arranged in order according to the workpiece and the process of the workpiece. Each integer represents the order of the processing machine selected in the current process in the optional machine set, not the corresponding machine number, that is, the number of the optional machine in the process; Each gene in the OS segment is directly encoded with a workpiece number. The order in which the workpiece number appears indicates the order of processing between the workpiece processes, that is, the chromosome is compiled from left to right. For the i-th appearance of workpiece number j, it indicates the i-th process of workpiece j, and the total number of appearances of the workpiece number is equal to the total number of processes of the workpiece; Each gene in the AS segment is determined by matching the preset capabilities provided by the machine on the MS with the capabilities required by the process on the OS.
[0024] S3: Initialize the population, perform global selection, local selection and random selection according to the preset ratio, and obtain the initial solution after selection; As a preferred embodiment, the specific process is as follows: First, in the MS segment, the global selection is performed with random workpiece order, and the machine with the smallest sum of the cumulative processing time in the optional machine set and the processing time of the corresponding machine processing the process is selected to generate the population; Secondly, in the MS segment, the local selection is carried out in units of workpieces, from the first workpiece to the last workpiece, and the machine with the smallest sum of the accumulated processing time of the optional machine set and the processing time of the corresponding machine processing the process is selected to generate the population; In the last MS segment, the population is randomly selected based on the preset ratio.
[0025] The above three populations are merged into an initial population. The initial solution selected as above is closer to the solution target, that is, an excellent initial solution is obtained through the above selection.
[0026] S4: Taking the maximum completion time as the fitness function, the fitness of multiple chromosomes is calculated; S5: According to the fitness and crossover probability, a preset number of populations are selected for machine crossover and process crossover; According to the fitness value and mutation probability, a preset number of populations are selected for machine mutation and process mutation to generate the optimal chromosome; Specifically, a number is randomly generated to determine whether crossover or mutation is needed; If so, a preset number of populations are randomly selected and a number is generated to determine whether to perform machine crossover / mutation or process crossover mutation; Based on the judgment results, fitness calculation is performed, and according to the fitness value and crossover probability or mutation probability, excellent populations are screened and retained to obtain the optimal chromosome.
[0027] S6: Decode the optimal chromosome to generate machine selection, process sequencing, preset capacity and processing time for the workpiece during processing.
[0028] As a preferred embodiment, decoding the optimal chromosome includes reading the machine, configuration capability, and process from the MSOSAS code, and reading the current state of the machine from the machine and process matrix, including the end time T_last0_end of the previous process of a given job, the end time T_M_end when the machine completes the previous process, the current process processing time PT, and the current machine reconfiguration capability time AST.
[0029] Read the current status of the machine from the machine and process matrix. The specific process is as follows: M1: Determine whether the current machine needs to be reconfigured. If so, update the processing time PT = PT + AST and execute M2, otherwise execute M6; M2: Determine whether the current machine has an idle time window and whether it is not less than the updated processing time PT. If so, execute M3, otherwise execute M5; M3: Determine whether the start time of the time slot is greater than T_last0_end+AST. If so, set the current process start time T_start to T_last0_end and execute M4. Otherwise, execute M5. M4: Determine whether the end time of the time slot minus T_last_end is not less than PT-AST. If so, set T_start=Max(time slot start time, T_last0_end - AST) and execute M6. Otherwise, execute M5. M5: Set the current process start time T_start = Max (T_lastO_end – AST, T_M_end), and execute M6; M6: Determine whether the current machine has an idle time window and whether it is greater than PT. If so, execute M7; otherwise, execute M8; M7: Determine whether the start time of the time slot is greater than T_las0_end. If so, set the current process start time T_start to T_lastO_end and execute M8. Otherwise, execute M9. M8: Determine whether the end time of the time slot minus T_last0_end is not less than PT. If so, set T_start = Max (time slot start time, T_last0_end) and execute M10; otherwise, execute M9; M9: Set the current process start time T_start = Max (T_last0_end, T_M_end), and execute M10; M10: Update T_end = T_start+PT, and update the machine status; M11: Enter the next process until all processes are decoded; M12: Calculate the maximum completion time and draw a Gantt chart, such as Figure 2 shown.
[0030] Based on the above iterative update method, the relationship between the maximum completion time and the number of iterations is as follows: Figure 3 shown.
[0031] The present invention is not limited to the above-mentioned specific embodiments, but extends to any new features or any new combination disclosed in this specification, as well as any new method or process steps or any new combination disclosed.
Claims
1. A matrix shop scheduling method based on genetic algorithm, characterized in that: include: S1: Generate relevant data use cases through the use case generator according to the characteristics of the matrix workshop; S2: Generate chromosomes through MSOSAS coding, and the chromosomes include machine selection, process sorting and capacity presetting; S3: Initialize the population, perform global selection, local selection and random selection according to the preset ratio, and obtain the initial solution after selection; Perform global selection, local selection and random selection. The specific process is as follows: First, in the MS segment, the global selection is performed with random workpiece order, and the machine with the smallest sum of the cumulative processing time in the optional machine set and the processing time of the corresponding machine processing the process is selected to generate the population; Secondly, in the MS segment, the local selection is carried out in units of workpieces, from the first workpiece to the last workpiece, and the machine with the smallest sum of the accumulated processing time of the optional machine set and the processing time of the corresponding machine processing the process is selected to generate the population; In the final MS segment, the population is randomly selected based on the preset ratio; S4: Calculate the fitness of multiple chromosomes; S5: According to the fitness and crossover probability, a preset number of populations are selected for machine crossover and process crossover; According to the fitness value and mutation probability, a preset number of populations are selected for machine mutation and process mutation to generate the optimal chromosome; S6: Decode the optimal chromosome to generate machine selection, process sequencing, preset capacity and processing time for the workpiece during processing.
2. The matrix shop scheduling method based on genetic algorithm according to claim 1 is characterized in that: The relevant data use cases include machines and their preset capabilities, processes and their required capabilities, processing time, and preset capacity configuration time.
3. The matrix shop scheduling method based on genetic algorithm according to claim 2 is characterized in that: When the use case generator generates a use case, the hyper parameters set include: the number of workpieces, the number of machines, the number of processes, the machine preset capacity, the workpiece process demand capacity, and the machine processing time.
4. The matrix shop scheduling method based on genetic algorithm according to claim 1 is characterized in that: In step S2, the chromosome is generated by coding as follows: The MS segment is arranged in order according to the workpiece and the process of the workpiece, and each integer represents the order of the processing machine selected in the current process in the optional machine set; Each gene in the OS segment is directly encoded with a workpiece number. The order in which the workpiece number appears indicates the order of processing between the workpiece processes. The total number of times the workpiece number appears is equal to the total number of processes of the workpiece. Each gene in the AS segment is determined by matching the preset capabilities provided by the machine on the MS with the capabilities required by the process on the OS.
5. The matrix shop scheduling method based on genetic algorithm according to claim 1 is characterized in that: In step S4, the maximum completion time is used as a fitness function to calculate the fitness of multiple chromosomes.
6. The matrix shop scheduling method based on genetic algorithm according to claim 1 is characterized in that: In step S5, the optimal chromosome is generated, and the specific process is as follows: Randomly generate a number to determine whether crossover or mutation is needed; If so, a preset number of populations are randomly selected and a number is generated to determine whether to perform machine crossover / mutation or process crossover mutation; Based on the judgment results, fitness calculation is performed, and according to the fitness value and crossover probability or mutation probability, excellent populations are screened and retained to obtain the optimal chromosome.
7. The matrix shop scheduling method based on genetic algorithm according to claim 1 is characterized in that: In step S7, decoding the optimal chromosome includes reading the machine, configuration capability, and process from the MSOSAS code, and reading the current state of the machine from the machine and process matrix; The current state of the machine includes the end time of the previous process of a given job T_last0_end, the end time T_M_end when the machine completes the previous process, the processing time PT of the current process, and the current machine reconfiguration capability time AST.
8. The matrix shop scheduling method based on genetic algorithm according to claim 7 is characterized in that: Read the current status of the machine from the machine and process matrix. The specific process is as follows: M1: Determine whether the current machine needs to be reconfigured. If so, update the processing time PT = PT + AST and execute M2, otherwise execute M6; M2: Determine whether the current machine has an idle time window and whether it is not less than the updated processing time PT. If so, execute M3, otherwise execute M5; M3: Determine whether the start time of the time slot is greater than T_last0_end+AST. If so, set the current process start time T_start to T_last0_end and execute M4. Otherwise, execute M5. M4: Determine whether the end time of the time slot minus T_last_end is not less than PT-AST. If so, set T_start=Max(time slot start time, T_last0_end - AST) and execute M6. Otherwise, execute M5. M5: Set the current process start time T_start = Max (T_lastO_end – AST, T_M_end), and execute M6; M6: Determine whether the current machine has an idle time window and whether it is greater than PT. If so, execute M7; otherwise, execute M8; M7: Determine whether the start time of the time slot is greater than T_las0_end. If so, set the current process start time T_start to T_lastO_end and execute M8. Otherwise, execute M9. M8: Determine whether the end time of the time slot minus T_last0_end is not less than PT. If so, set T_start = Max (time slot start time, T_last0_end) and execute M10; otherwise, execute M9; M9: Set the current process start time T_start = Max (T_last0_end, T_M_end), and execute M10; M10: Update T_end = T_start+PT, and update the machine status; M11: Enter the next process until all processes are decoded; M12: Calculate the maximum completion time and draw a Gantt chart.
Citation Information
Patent Citations
Adaptive coefficient genetic algorithm-based cloud manufacturing service resource matching method
CN107679750A
An optimization method of objective assignment based on multi-strand chromosome genetic algorithm
CN109102203A
Q-learning and GA-based multi-target flexible job shop scheduling self-learning method
CN113034026A
Intelligent vehicle scheduling method and device, electronic equipment and storage medium
CN114022014A
Flexible job shop scheduling method and device based on genetic algorithm
CN116227874A