Flexible production workshop batch flow scheduling method, electronic equipment and storage medium
Through the combination of pointer calibration method and the improved discrete secretary bird algorithm, the optimization of sub-batch size and quantity in batch flow scheduling is solved, the production efficiency and energy consumption are reduced, and the scheduling effect of flexible production workshops is improved.
Patent Information
- Application Number
- CN202510896444.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-01
- Publication Date
- 2025-08-01
- Estimated Expiration
- 2045-07-01
AI Technical Summary
The existing batch flow scheduling algorithm cannot optimize the size and quantity of sub-batches at the same time, resulting in low production efficiency, high energy consumption, complex management, and difficulty in rationally splitting according to the process route characteristics of different workpieces.
Sub-batch strategy coding is constructed using pointer calibration method, combined with the improved discrete secretary bird algorithm and reinforcement learning dynamically adjusting neighborhood search strategy, establish a scheduling model with the goal of maximum completion time and total production energy consumption, and generate a scheduling plan through multi-layer coding strategies.
It has achieved shortening of production cycle, reduced energy consumption, and improved scheduling flexibility, significantly improving production efficiency and reducing environmental impact.
Smart Images

Figure CN120410137A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of workshop scheduling, and particularly relates to a flexible production workshop batch flow scheduling method, an electronic device and a storage medium. Background Art
[0002] With the characteristics of multi-variety, large-batch and personalization in the customer orders of manufacturing enterprises, there are problems such as too long waiting time for workpiece processing and machine idle time in the flexible production workshop adopting the traditional batch production mode, which not only reduces the production efficiency of the enterprise, but also wastes production resources. Therefore, many manufacturing enterprises adopt batch flow scheduling when facing large-batch production orders, and split a large number of workpieces into many smaller batch sub-batches for processing. According to whether the size and quantity of the sub-batches change during the processing, the sub-batch types can be divided into equal batches, consistent batches and variable batches. Compared with batch processing production, the production scheme adopting batch flow processing can reduce the machine idle time, improve the production efficiency of manufacturing enterprises, and at the same time reduce production energy consumption.
[0003] However, most of the existing algorithms for solving batch flow scheduling cannot optimize the size and quantity of sub-batches at the same time. The batching methods adopted by enterprises are single, and mostly the production tasks are evenly split into batches according to production experience or simple equal sub-batch strategies. It is difficult to reasonably split each workpiece into batches according to the characteristics of the process routes of different workpieces, which is likely to lead to problems such as low production efficiency, high energy consumption and complex management when scheduling the production of workpieces, and the comprehensive performance of the final sub-batch production scheme is poor. Summary of the Invention
[0004] The present invention proposes a flexible production workshop batch flow scheduling method, an electronic device and a storage medium to solve the technical problems that the existing scheduling schemes only target a single batching method and are difficult to apply to the solution of dynamic batching methods.
[0005] To solve the above technical problems, the present invention provides a flexible production workshop batch flow scheduling method, including the following steps: Step S1: Based on the production batch of each order product and the process route of each workpiece, construct operation sequence coding, machine selection coding and worker assignment coding, and use the pointer calibration method for calibration to construct sub-batch strategy coding; Step S2: Establish a scheduling model with the makespan and total production energy consumption as the objectives; Step S3: Optimize the hunting exploration stage and escape development stage of the secretary bird algorithm through discretization operations, and use reinforcement learning to dynamically adjust the neighborhood search strategy to obtain an improved discrete secretary bird algorithm; Step S4: Based on the four-layer coding strategy of the sub-batch strategy coding, the process sequence coding, the machine selection coding, and the worker assignment coding, the improved Secretary Bird algorithm is used to solve the scheduling model to generate a scheduling plan.
[0006] Preferably, the method for constructing the sub-batch strategy coding in step S1 includes: Step S11: Number the workpieces according to the quantity, and set the number of pointers and the minimum batch size to be calibrated for each type of workpiece according to the actual requirements; Step S12: According to the minimum batch size requirement, randomly assign the numbers of the workpieces to each pointer of each type of workpiece to represent its coordinate position; Step S13: Statistically calculate the coordinate positions of each pointer to form the sub-batch strategy coding of the workpiece.
[0007] Preferably, the total production energy consumption in step S2 has the following expression: ; In the formula, represents the workpiece set; represents the sub-batch set of workpiece ; represents the process set of workpiece ; represents the processing machine set; represents the position set of machine ; represents the worker set; represents workpiece the s th j batch of the th a worker's operation ability coefficient; represents a decision variable. If worker a is assigned to operate on machine , = 1, otherwise = 0; represents the processing energy consumption per unit time of machine ; represents workpiece the s th j batch of the start time of the th p process of workpiece ; represents the completion time of machine at position represents workpiece The number of workpieces in the s th sub-batch; represents the energy consumption for transferring a single workpiece between different processing machines; represents a decision variable. If the process and of the workpiece are continuously processed on the machine without the insertion of other workpiece processes, the value is 1; otherwise, it is 0; represents the inherent energy consumption of the processing workshop.
[0008] Preferably, the constraint conditions of the scheduling model in step S2 include: 1) Each process of each batch of each type of workpiece can only select one machine from the set of optional processing machines for processing: ; 2) Each machine can process at most one process each time it executes a processing task: ; 3) Each machine is assigned at most one worker: ; 4) When a process is arranged to be processed at a certain position on a machine, it is only arranged to a position in front of the machine when that position is occupied by other processes: ; 5) The sum of the quantities of all sub-batches of the same workpiece is equal to the total number of that type of workpiece: ; 6) The basic processing duration of each process of each sub-batch is expressed as: ; 7) The numerical relationship between the completion time, start time, and processing duration of each process of each sub-batch is expressed as: ; 8) The maximum completion time is greater than the completion time of the last process of all workpieces: ; 9) The start time of each process of each sub-batch takes the maximum value of the completion time of the previous process and the machine completion time: ; 10) The energy consumption relationship between two adjacent processing tasks of each machine is expressed as: ; 11) The relationship between the machine start time and the process start time is expressed as: ; ; ; ; Where, represents a collection of processing machines; Indicates the machine The position set of , the maximum position is , ; Represents a collection of artifacts; Indicates workpiece The sub-batch set of ; Indicates workpiece Process set, workpiece The maximum number of processes is ,gather ; Represents a decision variable, if the process In position Machine If it is processed, the value is 1, otherwise it is 0. is a collection The values; represents a collection of workers; represents the decision variable, if the worker Assigned to the machine On operation, =1, otherwise =0; Indicates workpiece Quantity to be processed; Indicates workpiece No. The number of workpieces in a sub-batch; Indicates workpiece No. Batch No. The processing time of each process; Represents a single artifact Process In the machine The processing is time-consuming; Represents workpiece No. Batch No. Completion time of each process; Indicates workpiece No. Batch No. The start time of each process; Indicates the completion time of the last process of all workpieces; denotes the makespan; denotes the position of the machine at the completion time; denotes the machine at the standby energy consumption at the position; denotes the decision variable. If the machine is processing the operation at the position , = 1; otherwise = 0; denotes a very large number; denotes the position of the machine at the start time.
[0009] Preferably, the method for optimizing the hunting exploration stage and the escape development stage of the secretary bird algorithm through discretization operations in step S3 includes: The hunting exploration stage includes three states: searching for prey, consuming prey, and attacking prey. After passing through the hunting exploration stage, it enters the escape development stage; 1) When , it is in the stage of searching for prey, and the position is updated through the following discretization formula: ; 2) When , it is in the state of consuming prey, and the position is updated through the following discretization formula: ; 3) When , it is in the state of attacking prey, and the position is updated through the following discretization formula: ; 4) In the escape development stage, the position is updated through the following discretization formula: ; In the formula, denotes the maximum number of iterations; denotes the current number of iterations; denotes the position state of the i th secretary bird updated in the current iteration population; denotes the i th solution in the current iteration population; , and denote the random solutions in the current iteration population; denotes a random number in the interval [0, 1]; denotes the crossover operation; denotes the multiplication operation; represents the historical optimal solution; = 0.5, represents a random number.
[0010] Preferably, the method for dynamically adjusting the neighborhood search strategy using reinforcement learning in step S3 includes: taking the diversity and convergence of the population in the secretary bird algorithm as the state of reinforcement learning; taking the combination of various crossover operations and mutation operations in the secretary bird algorithm as the action of reinforcement learning.
[0011] Preferably, the crossover operations include: mapping crossover, two-point crossover, and linear order crossover; the mutation operations include: multi-point mutation, reverse order mutation, and insertion mutation.
[0012] Preferably, the method for solving in step S4 includes: Step S41: Algorithm initialization; Step S42: According to the state indicators and state set of the population, determine what state the population is in; Step S43: According to the change of the population state and the reward strategy, calculate the reward value of the population state change and update the Q-table; Step S44: Sequentially execute the secretary bird hunting exploration stage, the secretary bird escape development stage, and the multi-neighborhood dynamic search stage based on reinforcement learning to update the population individuals; Step S45: Calculate the fitness function value and state indicators of the population; Step S46: Repeat steps S42 to S45 until the iteration ends, and output the scheduling scheme.
[0013] The present invention also provides an electronic device, including: a memory, a processor, and a computer program, where the computer program is stored in the memory and is configured to be executed by the processor to implement the above method.
[0014] The present invention also provides a computer-readable storage medium, in which a computer program is stored, and the computer program is executed by a processor to implement the above method.
[0015] The beneficial effects of the present invention at least include: The present invention dynamically determines the sub-batch size and quantity through the pointer calibration method, breaking the limitations of existing splitting methods, enabling production scheduling to be flexibly adjusted according to the process characteristics of workpieces and the equipment status; then, by combining the improved Secretary Bird algorithm based on reinforcement learning with the batch flow scheduling problem in a flexible manufacturing shop, reinforcement learning is used to dynamically adjust the neighborhood search strategy during the algorithm solving process, ensuring the feasibility and efficiency of the algorithm, effectively solving the premature convergence defect of traditional algorithms when solving such NP-hard problems. The cooperation of these technical features enables the present invention to form an overall synergistic advantage in shortening the production cycle, reducing energy consumption, and enhancing scheduling flexibility, significantly improving production efficiency while reducing the environmental impact. Brief Description of the Drawings
[0016] Figure 1 It is a schematic flowchart of the method in an embodiment of the present invention; Figure 2 It is a schematic diagram of the pointer calibration method in an embodiment of the present invention; Figure 3 It is a schematic diagram of multi-neighborhood dynamic search based on reinforcement learning in an embodiment of the present invention; Figure 4 It is a schematic diagram of three crossover methods adopted by the multi-neighborhood dynamic search in an embodiment of the present invention; Figure 5 It is a schematic diagram of three mutation methods adopted by the multi-neighborhood dynamic search in an embodiment of the present invention; Figure 6 It is a schematic diagram of four-layer coding in an embodiment of the present invention; Figure 7 It is a box comparison diagram of the improved Secretary Bird algorithm based on reinforcement learning and a comparison algorithm in an embodiment of the present invention; Figure 8 It is an iterative diagram of the HV index of the improved Secretary Bird algorithm based on reinforcement learning and a comparison algorithm in an embodiment of the present invention; Figure 9 It is a Pareto result graph solved by the improved Secretary Bird algorithm based on reinforcement learning and a comparison algorithm in an embodiment of the present invention. Detailed Embodiment
[0017] Next, in combination with the drawings in the embodiments of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all of the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.
[0018] Before presenting the embodiments, the batch flow scheduling will be elaborated: For production orders with multiple varieties and large quantities, according to the process route characteristics of different types of workpieces, the large quantities of workpieces can be split into multiple sub-batches containing a certain number of workpieces. Then, taking the sub-batch as the minimum unit for workshop processing and transportation, scheduling production is carried out. By utilizing the flexibility of processing with smaller sub-batches, the processing operations of workpieces are overlapped among different processing machines to improve production efficiency. This type of scheduling problem is called the batch flow scheduling problem. Compared with batch processing production, adopting a production plan with consistent sub-batches arranges the processing tasks more compactly, thus greatly shortening the makespan. The difficulty of this problem lies in how to determine a reasonable batch splitting plan for the order and how to generate an efficient scheduling plan to balance the economic benefits brought by batch flow production and the impact on the environment caused by the increase in production energy consumption.
[0019] The differences between batch flow scheduling and general scheduling modes are as follows: ① Instead of taking workpieces as the processing unit, the workpiece sub-batch is used as the basic unit for workshop processing and transportation; ② The batch splitting and scheduling of workpieces affect each other, and a reasonable batch splitting plan can maximize the scheduling benefits.
[0020] In the batch flow scheduling problem of a flexible production workshop, it is necessary to reasonably determine the size and quantity of workpiece sub-batches. If the number of workpiece sub-batches is too small, the workshop equipment resources cannot be fully utilized. If the number of sub-batches is too large, it will not only increase the production management difficulty of the workshop, but also increase the number of transfers, resulting in greater production energy consumption. At the same time, in actual production, the differences in workers' processing capabilities also have an inestimable impact on the scheduling plan. Especially when facing personalized production orders, it is necessary to change the machine tool auxiliary fixtures and adjust the installation positions according to the personalized product characteristics. The stronger the ability of the worker, the less time required to complete these tasks, and vice versa. Therefore, the makespan and total production energy consumption are taken as the optimization objectives. The makespan takes the maximum makespan of all workpieces. Different machines have different processing capabilities, and the corresponding production energy consumption is also different. The total production energy consumption includes machine processing energy consumption, standby energy consumption, workpiece transfer energy consumption, and the fixed energy consumption of the workshop.
[0021] Therefore, as Figure 1 shown, the embodiment of the present invention provides a batch flow scheduling method for a flexible production workshop, including the following steps: Step S1: Based on the production batch of each order product and the process route of each workpiece, construct operation sequence coding, machine selection coding, and worker assignment coding, and use the pointer calibration method for calibration to construct sub-batch strategy coding.
[0022] The method for constructing sub-batch strategy coding includes: 1) Number the workpieces according to the quantity, and set the number of pointers and the minimum batch size to be calibrated for each workpiece according to the actual requirements. 2) Randomly assign the numbers of the workpieces to each pointer representing their coordinate positions for each type of workpiece; 3) Initially adjust the coordinate positions of each pointer according to the minimum batch requirement; 4) Count the coordinate positions of each pointer to form the sub-batch strategy encoding of the workpiece.
[0023] Specifically, the method for constructing the sub-batch strategy encoding is as Figure 2 shown. Assume that there are 6 workpieces of a certain type, and these 6 workpieces are numbered from 1 to 6 in sequence. If a single workpiece is allowed to be used as a sub-batch, then 5 calibration pointers are needed to divide the 6 workpieces into 6 sub-batches. At this time, the calibration pointers are as Figure 2 shown, and the number of them is equal to the number of workpieces to be processed minus one. However, in the actual processing process, in the face of a large number of workpieces, there will be a minimum batch limit for each sub-batch. Therefore, the number of sub-batches generated by a single workpiece as a sub-batch is the upper limit of the theoretical number of sub-batches, which is equal to the number of workpieces to be processed. Based on the upper limit of the number of sub-batches, set the number of calibration pointers, and then randomly assign the numbers of the workpieces to the calibration pointers to represent their positions. For example, "[1, 3, 2, 5, 3]" means that the first calibration pointer is located after the 1st workpiece, the second calibration pointer is located after the 3rd workpiece, the third calibration pointer is located after the 2nd workpiece, and so on. Then, adjust the positions of the calibration pointers according to the minimum batch requirement set for the actual problem. For example, Figure 2 in which the minimum batch is set to 2, that is, the calibration pointers need to divide the batches at an interval of 2 workpieces. Then adjust the positions of the calibration pointers to "[2, 4, 2, 4, 4]" or "[3, 3, 3, 3, 3]". Finally, count the positions of each calibration pointer to form the sub-batch strategy encoding "[2, 4]" or "[3]" of the workpiece.
[0024] Step S2: Establish a scheduling model with the makespan and total production energy consumption as the objectives.
[0025] For the convenience of description, the symbols and decision variables used in the embodiments of the present invention are as follows: : Index of workpiece types, the workpiece set is , , and the maximum number of workpiece types to be processed is |I|; : Index of workpiece processes, the process set of workpiece is , ; the maximum number of processes of workpiece is ; let the set ; : Index of workpiece sub-batches, the sub-batch set of workpiece is , ; : Processing machine index, the set of processing machines is , , the maximum number of machines is ; : Worker index, the set of workers is , ; : Machine position index, the position set of machine is , the maximum position is ; Let the set be ; : The number of workpieces to be processed; : The operation ability coefficient of worker ; : The transfer energy consumption of a single workpiece between different processing machines; : The inherent energy consumption of the processing workshop; : The processing time of the th process of a single workpiece on machine ; : The processing time of the th batch and th th process of the workpiece; : The start time of machine at position ; : The completion time of machine at position ; : The processing energy consumption per unit time of machine ; : The standby energy consumption per unit time of machine ; : The standby energy consumption of machine at position; : The total processing energy consumption of the machine; : The total standby energy consumption of the machine; : Total transfer energy consumption of workpieces; : Total energy consumption cost; : Maximum number; : Decision variable, the number of workpieces in the th sub - lot of workpiece, a non - negative variable; : Decision variable, the starting time of the th batch of the th process of workpiece, a non - negative variable; : Decision variable, the completion time of the th batch of the th process of workpiece, a non - negative variable; : Decision variable, the maximum completion time of all machines, i.e., makespan, a non - negative variable; : If process is processed on machine , = 1; otherwise = 0; : If machine is processing the process at position , = 1; otherwise = 0.
[0026] : If worker is assigned to operate on machine , = 1; otherwise = 0.
[0027] : If process is processed on the machine at position , the value is 1; otherwise it is 0, is the rd value in the set; : If processes and are continuously processed on machine without the insertion of other workpiece processes, the value is 1; otherwise it is 0.
[0028] In the embodiments of the present invention, the constraints include: Constraint 1: For each process of each batch of each type of workpiece, only one machine can be selected from the set of optional processing machines for processing: ; Constraint 2: Each machine can process at most one process each time it executes a processing task: ; Constraint 3: Each machine is assigned at most one worker: ; Constraint 4: When a process is arranged to be processed at a certain position of a machine, it is arranged to be processed at the position in front of the machine only when that position is occupied by other processes: ; Constraint 5: The sum of the quantities of all sub - batches of the same workpiece is equal to the total number of that type of workpiece: ; Constraint 6: The basic processing duration of each process of each sub - batch is expressed as: ; Constraint 7: The numerical relationship between the completion time, start time, and processing duration of each process of each sub - batch is expressed as: ; Constraint 8: The maximum completion time is greater than the completion time of the last process of all workpieces: ; Constraint 9: The start time of each process of each sub - batch takes the maximum value of the completion time of the previous process and the completion time of the machine: ; Constraint 10: The energy consumption relationship between two adjacent processing tasks of each machine is expressed as: ; Constraint 11: The relationship between the start time of the machine and the start time of the process is expressed as: ; ; ; ; The established multi - process - route production workshop consistent sub - batch scheduling mathematical model with the maximum completion time and total production energy consumption as the objectives is as follows.
[0029] Specifically, minimizing the maximum completion time and total production energy consumption, its expression is: ; Sub - goal 1: The maximum completion time of all sub - batch processes, denoted as: ; Sub - goal 2: The total energy consumption during the production process, which can be expressed as: .
[0030] Step S3: Optimize the hunting exploration stage and the escape development stage of the secretary bird algorithm through discretization operations, and use reinforcement learning to dynamically adjust the neighborhood search strategy to obtain an improved discrete secretary bird algorithm.
[0031] The secretary bird algorithm includes a hunting exploration stage and an escape development stage. In the hunting exploration stage of the secretary bird, in order to increase the breadth and depth of the search, the present invention embodiment uses three different random numbers for discretization operations, and then compares the advantages and disadvantages of the results under different crossover situations. According to the greedy criterion, the position of the better individual is used as the position of the new secretary bird. If the fitness value of the new position is not improved, the original position remains unchanged. Specifically, the method for discretizing the secretary bird algorithm in this embodiment includes: When , the secretary birds are in the state of searching for prey. They slowly sweep the ground with their long legs while paying attention to the surrounding environment to look for signs of snakes. This situation appears in the initial iteration of the optimization, where exploration is crucial. At this time, the position of the secretary bird is updated according to the following formula: ; represents the updated position state of the i th secretary bird in the population, and represent the random candidate solutions in this stage, represents a random number in the interval [0, 1], represents the maximum number of iterations; represents the current number of iterations. Through the above formula, the secretary bird can explore different regions of the solution space, increasing the chance of finding the global optimal solution.
[0032] When , the secretary birds are in the state of consuming prey. After the secretary bird discovers the snake, it starts a unique hunting method, standing on the ground and observing the snake's every move from a high place. Using its sharp judgment of the snake's movements, it gradually hovers, jumps, and provokes the snake, thus wearing down the snake's endurance. At this time, the position of the secretary bird is updated according to the following formula: ; represents the [[ID=! iThe updated position status of the secretary bird represents the historical optimal solution. Through the above formula, the secretary bird can perform a local search on the previously found best position, thus better exploring the surrounding solution space.
[0033] When the secretary bird is in the state of attacking prey. When the snake is exhausted, the secretary bird perceives the opportunity and quickly takes action, using its powerful leg muscles to launch an attack and hitting the vital part of the snake with its sharp claws, resulting in the death of the snake. During this random search process, the position of the secretary bird is updated according to the following formula: ; The position update of the secretary bird in the above three states all adopts the non-dominated sorting method, that is, if , then the non-dominated solution is used to replace the original position of the secretary bird ; otherwise, no non-dominated solution is found, and the original position of the secretary bird remains unchanged.
[0034] During the escape and exploration stage of the secretary bird, when the secretary bird encounters a natural enemy, it will choose to fly away quickly or choose to camouflage. At this time, the position of the secretary bird is updated according to the following formula: ; = 0.5, represents a random number. The same position update method as in the hunting and exploration stage of the secretary bird is adopted in this stage.
[0035] After that, the state and action mapping of the reinforcement learning and the secretary bird algorithm is established: the state of the agent represents the diversity and convergence of the secretary bird algorithm population; the action of the agent represents different neighborhood search strategies adopted by the secretary bird algorithm, as shown in Figure 3 .
[0036] In this embodiment, the design of the agent state is based on the convergence and diversity index of the population, and its expression is: ; ; ; ; In the formula, is the non-dominated solution set solved by the algorithm in each generation of the population, is the reference Pareto front, and represents the point in the solution set and the reference set The points in the Euclidean distance between
[0037] The state set of the agent is based on the non-dominated solutions sought and There are four combinations: ① and ; ② and ; ③ and ; ④ and . According to these four and combinations, the states of the agent are defined as four and combinations.
[0038] The reward strategy is that after the agent executes an action, the environment gives the agent a reward according to the change of state. The definition of the reward is as follows: ; The basis for updating the Q-table is the following expression: ; In the formula, and respectively represent the states of the population at the th and th iterations, and respectively represent the actions selected by the agent after the th and th iterations, represents the action set composed of 9 neighborhood search strategies, represents the learning rate of the agent, represents the reward discount. and are both variables between [0, 1] and can be adjusted according to the actual situation. To enable the agent to better select the neighborhood search strategy according to the iterative process of the algorithm, the learning rate is improved. The calculation formula of the new learning rate is as follows: ; By adjusting the learning rate α, the agent can quickly adjust the Q-value table in the initial stage of learning and converge the Q-value stably to the optimal value in the later stage.
[0039] In this embodiment, the 3 crossover methods based on the encoding of processes and machine selection include: ① Mapping crossover: Randomly generate two crossover points within the chromosome length and , the gene sequences outside the two crossover points remain unchanged, and the gene sequences between the two crossover points are mapped to each other relative to the genes of the other chromosome and then exchanged, and two new chromosomes can be obtained. ② Two-point crossover: Two chromosomes exchange the gene sequences between the two crossover points . After the exchange, the duplicate genes generated due to the exchange are removed from the gene sequences outside the two points of each chromosome , and the genes missing due to the exchange are supplemented, and two new chromosomes can be obtained. ③ Linear order crossover: The gene sequence of the first chromosome between is retained, and the gene fragment of the first chromosome located between and is correspondingly deleted in the second chromosome, and then starting from the first gene position of the first chromosome, the remaining genes of the second chromosome are filled in turn outside the region to form a new solution. The two chromosomes repeat this process respectively to obtain two new chromosomes. The specific forms of the three crossover methods are as Figure 4 shown.
[0040] Design 3 mutation methods based on the coding of process and machine selection: ① Multi-point mutation: For the mutation of the process sequence coding, two mutation points are randomly generated within the chromosome length range and . It is judged whether the genes at the two points are the same. If they are the same, two new mutation points are regenerated. If they are not the same, the genes at the two mutation points are exchanged; for the mutation of the machine selection coding, a certain operation of a certain sub-batch of a certain workpiece is randomly selected, and a new machine number is reselected from its set of optional processing machines. ② Reverse order mutation: Reverse the process sequence and the gene fragment of machine selection between and . ③ Insertion mutation: Insert the gene at the position in front of the gene at the position, and the genes at the remaining positions are postponed in turn. The specific forms of the three mutation methods are as Figure 5 shown.
[0041] A total of 9 neighborhood search strategies combined by 3 crossover and mutation methods are used as the action set that the agent can choose. Using the change of the agent based on the state, the action selection strategy is used to select different neighborhood search strategies to realize the multi-neighborhood dynamic search of the secretary bird algorithm.
[0042] In the multi-neighborhood dynamic search stage, for the ε-greedy action selection strategy adopted by reinforcement learning, a greedy factor that changes dynamically with the algorithm iteration process is designed, and its calculation formula is as follows: .
[0043] Step S4: Based on the four - layer coding strategy of sub - batch strategy coding, process sequence coding, machine selection coding, and worker assignment coding, the scheduling model is solved by an improved secretary bird algorithm to generate a scheduling plan.
[0044] Specifically, in the coding strategy, a complete chromosome contains four - layer coding: sub - batch strategy coding, process coding, machine selection coding, and worker assignment coding. The sub - batch strategy layer uses coordinate coding of pointers. Based on the pointer calibration method, the number of sub - batches into which each type of workpiece is split and the batch size of each sub - batch are determined. The process sequence layer uses integer coding based on processes, where the elements are composed of workpiece numbers and sub - batch numbers. The number of times the same number appears is determined by the number of processes contained in this type of workpiece, and the order of arrangement of different numbers determines the processing order of different workpieces in different sub - batches. The machine selection layer uses integer coding, where the elements are composed of the processing machine numbers corresponding to sub - batch processes. The worker assignment coding uses direct coding of worker ability coefficients. An example of the four - layer coding is as Figure 6 shown.
[0045] The coding process is as follows: ① Input workpiece processing information, the number of workpiece types , the number of machines , worker ability coefficients , population size ; ② Encode individuals in the population. Determine the number of sub - batches and batch size of each workpiece according to the pointer calibration method to generate sub - batch strategy coding ; ③ Randomly encode the process processing sequence according to the number of sub - batches and the number of workpiece types ; ④ Randomly select the machine numbers in the set of optional processing machines for each workpiece according to the process processing sequence to generate machine selection coding ; ⑤ Randomly assign a coefficient representing the worker's processing ability to each machine according to the number of machines to obtain worker assignment coding ; ⑥ Obtain a complete chromosome coding ; ⑦ Complete the encoding of all individuals in the population and output the encoding sequence .
[0046] In the embodiment of the present invention, when solving, the solving method includes the following steps: Step S411: Initialize algorithm parameters, set the maximum number of iterations , the initial population size , and the reward discount and learning rate of reinforcement learning, and initialize the value table; ]]Step S412: Initialize the population according to the encoding and decoding strategies, and calculate the fitness function and state indicators of the initial population; Step S413: The algorithm iteration starts. When the iteration number = 1, set the state of the reinforcement learning to the first state in the state set = 1; Step S514: State judgment. Determine what state the population is in according to the state indicators of the population and the state set; Step S4???5: Calculate the reward and update the value table. Calculate the reward value of the population state change according to the change of the population state and the reward strategy, and update the table; Step S416: Sequentially execute the secretary bird hunting exploration stage (search for prey, consume prey, attack prey), the secretary bird escape development stage, and the multi-neighborhood dynamic search stage based on reinforcement learning to update the individuals; Step S417: Calculate the fitness function value and state indicators of the population; Step S418: Determine whether the termination condition is met. If the termination condition is met, execute Step S419; otherwise, the iteration number , and execute Step S414; Step S419: Output the scheduling plan and the algorithm ends.
[0047] In the embodiment of the present invention, when decoding, it is necessary to determine the operation time window for processing each sub-batch process of each workpiece, arrange workers with different capabilities and each process of each sub-batch of each workpiece to the corresponding machine, and determine the processing sequence and processing time of each sub-batch process on each machine. At the same time, try to make there be no idle time between processing tasks as much as possible, so as to ensure the shortest completion time and the minimum energy consumption.
[0048] The specific decoding process is as follows: Step S421: Traverse the sub-batch strategy encoding from left to right, and calculate and record the batch sizes of each sub-batch of various workpieces according to the pointer calibration method; Step S422: Determine the current sub-batch process according to the process encoding, obtain the processing machine and the operating worker selected for the current process from the machine selection and worker assignment encoding, and calculate the time for the worker to process this process on the selected machine in combination with the sub-batch size and the ability coefficient of the worker . According to the cumulative processing time of the previous process , calculate the allowable start time of the current sub-batch process ; Step S423: Search for the existing processing time periods of the processing machine obtained in Step S422, and sort each processing time period according to the machine start time Sort in ascending order and proceed to step S424; if the machine has no existing processing time slots, it means that no processing tasks are arranged for the machine, and proceed to step S425; Step S424: Compare with in terms of magnitude. If is less than and is less than or equal to , proceed to step S425; otherwise, proceed to step S426; Step S425: Set the start time of the current sub-batch operation to be , and based on the processing time , calculate the completion time of this sub-batch operation, and update the allowable start time of the next operation of the current sub-batch and the existing processing time slots of the machine; Step S426: Starting from the second processing time slot of the machine, successively judge the start times and of each processing time slot of the machine in terms of magnitude. If is less than T2 and is less than or equal to , proceed to step S507; otherwise, proceed to step S508; Step S427: Set the start time of the current sub-batch operation to be the maximum value of and the completion time of the previous processing time slot of the machine, and based on the processing time , calculate the completion time of this sub-batch operation, and update the allowable start time of the next operation of the current sub-batch and the existing processing time slots of the machine; Step S428: Set the start time of the current sub-batch operation to be the maximum value of and the completion time of the last processing time slot of the machine, and based on the processing time , calculate the completion time of this sub-batch operation, and update the allowable start time of the next operation of the current sub-batch and the existing processing time slots of the machine; Step S429: If it is the last sub-batch operation in the operation sequence code, proceed to step S4210; otherwise, proceed to step S422; Step S4210: Decoding is completed. Calculate the makespan and the total production energy consumption TEC of the machine and output them.
[0049] Taking the production task of a certain medical infusion device of a medical enterprise during a certain period as an example, a batch flow scheduling problem for a multi-process route production workshop is constructed, and the application performance of the method of the present invention in an actual engineering case is analyzed. There are a total of 10 workpieces to be produced in this production task, and the quantity of each workpiece to be produced is 300,000 pieces. Each workpiece has 3 processes and has strict precedence constraints. The detailed information of the processing tasks is shown in Table 1, and the process sequence is sorted from top to bottom according to the processing order. Since the production of medical infusion devices has the characteristics of multi-variety and large-batch production, actual production often adopts the form of batch flow for production. The processing equipment and its related energy consumption information in the production workshop are shown in Table 2. The energy consumption parameters related to the workshop and transportation are respectively set as = 10 kW, = 1 kW.
[0050] Table 1
[0051] Table 2
[0052] The multi-objective evolutionary algorithm based on decomposition (MOEA / D), the Pareto envelope-based selection algorithm II (PESA-II), the strength Pareto evolutionary algorithm 2 (SPEA2), the improved decomposition-based evolutionary algorithm (I-DBEA) and the improved discrete secretary bird algorithm based on reinforcement learning (RLSBOA) provided by the present invention are introduced for comparison. The population size of all algorithms is set to 200, the maximum number of iterations is set to 250, and the number of vector neighbors in I-DBEA and MOEA / D is set to 199. Each algorithm runs independently 10 times, and all the results are screened for non-dominated solutions, and their objective values are used as the true Pareto front. The results are normalized, and the HV and IGD metrics are used to evaluate the non-dominated solution sets of the algorithms. The box plots and normal distributions of the 5 algorithms on 2 metrics are as Figure 7 shown.
[0053] Figure 7 It can be seen from the comparison that although RLSBOA has an outlier on the HV metric, its average value is significantly greater than the 4 comparison algorithms; although RLSBOA also has an outlier on the IGD metric, its average value is also significantly less than the 4 comparison algorithms, indicating that the convergence of RLSBOA is better than the comparison algorithms. Take the iteration data of the algorithm when each algorithm obtains the best HV metric, and draw an iteration graph as Figure 8 shown.
[0054] The maximum HV values obtained by the 5 algorithms are 1.1493×10 9 , 1.1469×10 9 , 1.1440×109 , 1.1425×10 9 , 1.1406×10 9 , the final HV value of RLSBOA is better than that of the four comparison algorithms. In the initial stage of algorithm iteration, the initial solution quality of SPEA2 is relatively good. The convergence speed of RLSBOA is similar to that of MOEA / D and I-DBEA, but slower than that of SPEA2 and PESA-II. In the middle and late stages of algorithm iteration, the HV value converged by RLSBOA is the largest. The improvement rate of the results of all algorithms is very small after 100 iterations. The performance ranking of the four algorithms from best to worst is RLSBOA > SPEA2 > PESA-II > MOEA / D > I-DBEA.
[0055] Plot the Pareto fronts of the results of the five algorithms, as Figure 9 shown. The Pareto front of RLSBOA is closer to the true Pareto front, and the number of Pareto solutions obtained by RLSBOA is the largest, indicating that the diversity and distribution of the Pareto solution set obtained by RLSBOA are better. Observation Figure 9 shows that all four processing plans obtained by RLSBOA are optional high-quality plans. Different plans have different emphases on the two sub-goals, and no single plan can minimize both sub-goals simultaneously. The ranking of the algorithms from best to worst is the same as Figure 8 the algorithm ranking obtained.
[0056] The production of medical infusion devices in the injection workshop of this medical enterprise belongs to mass production. To further compare the different effects of the scheduling plans obtained by whole-batch processing, equal sub-batch processing, and consistent sub-batch processing when applied to the actual engineering problems of this medical enterprise, the proposed RLSBOA is applied to solve these three processing modes respectively. When applying the whole-batch processing mode, remove the sub-batch strategy coding in the four-layer coding scheme and retain the three-layer coding of the operation sequence, machine selection, and worker assignment. When applying the equal sub-batch processing mode, slightly modify the sub-batch strategy coding so that the sub-batch strategy coding is encoded in the way of equal sub-batches, and the other three-layer coding methods remain unchanged. Select the plan in the Pareto solution set based on the minimum makespan. The target value comparisons of the three processing modes are shown in Table 3 below.
[0057] Table 3
[0058] From the perspective of the maximum completion time of economic indicators, for the whole batch processing, the production efficiency of equal sub-batches and consistent sub-batches is increased by 20.89% and 28.42% respectively; from the perspective of the total production energy consumption of environmental protection indicators, for the whole batch processing, the corresponding energy consumption optimization rates of equal sub-batches and consistent sub-batches are increased by 23.27% and 26.64% respectively. The results show that the batch flow processing mode is more suitable for the mass production of products than the whole batch processing mode. Moreover, from the perspective of the optimization rate of the two goals, the effect of consistent sub-batches is better than that of equal sub-batches.
[0059] The technical features of the above embodiments can be combined arbitrarily. For the sake of brevity of description, not all possible combinations of the technical features in the above embodiments are described. Only the preferred embodiments of the present invention are expressed. The description is relatively specific and detailed, but it should not be construed as a limitation to the scope of the present invention. As long as there is no contradiction in the combination of these technical features, it should be considered as the scope recorded in this specification.
[0060] It should be noted that for those of ordinary skill in the art, without departing from the concept of the present invention, several deformations and improvements can be made, and these all belong to the protection scope of the present invention. Therefore, the protection scope of the present invention should be subject to the appended claims.
Claims
1. A batch flow scheduling method for a flexible production workshop, characterized in that: It includes the following steps: Step S1: Based on the production batch of each order product and the process route of each workpiece, construct the operation sequence code, machine selection code, and worker assignment code, and use the pointer calibration method for calibration to construct the sub-batch strategy code; Step S2: Establish a scheduling model with the makespan and total production energy consumption as the objectives; Step S3: Optimize the hunting exploration stage and escape development stage of the secretary bird algorithm through discretization operations, and use reinforcement learning to dynamically adjust the neighborhood search strategy to obtain an improved discrete secretary bird algorithm; Step S4: Based on the four-layer coding strategy of the sub-batch strategy code, operation sequence code, machine selection code, and worker assignment code, solve the scheduling model through the improved discrete secretary bird algorithm to generate a scheduling plan.
2. A flexible production workshop batch flow scheduling method according to claim 1, characterized in that: The method for constructing the sub-batch strategy code in Step S1 includes: Step S11: Number the workpieces according to the quantity, and set the number of pointers and the minimum batch size to be calibrated for each workpiece according to the actual requirements; Step S12: According to the minimum batch size requirement, randomly assign the workpiece numbers to each pointer of each workpiece to represent its coordinate position; Step S13: Count the coordinate positions of each pointer to form the sub-batch strategy code of the workpiece.
3. A flexible production workshop batch flow scheduling method according to claim 1, characterized in that: The total production energy consumption described in step S2 has the following expression: ; Wherein, represents the workpiece set; represents a workpiece of the sub - batch set; represents a workpiece of the process set; represents the machining machine set; represents a machine of the position set; represents the worker set; represents a workpiece of the s batch of the j nth process processing time; represents a worker a of the operation ability coefficient; represents a decision variable. If worker a is assigned to machine for operation, = 1, otherwise = 0; represents a machine per - unit - time processing energy consumption; represents a workpiece of the s batch of the j nth process start time; represents the completion time of machine p at position ; represents a machine per - unit - time standby energy consumption; represents a workpiece of the s nth sub - batch of the workpiece quantity; represents the transfer energy consumption of a single workpiece between different machining machines; represents a decision variable. If the processes of workpiece and are continuously processed on machine without other workpiece processes inserted, the value is 1, otherwise it is 0; represents the inherent energy consumption of the machining workshop.
4. A flexible production workshop batch flow scheduling method according to claim 1, characterized in that: The constraint conditions of the scheduling model in Step S2 include: 1) Each operation of each batch of each workpiece can only select one machine from the set of optional processing machines for processing: ; 2) Each machine can process at most one operation each time it executes a processing task: ; 3) At most one worker is assigned to each machine: ; 4) When an operation is arranged to be processed at a certain position of a machine, it is only arranged to the position in front of the machine when that position is occupied by other operations: ; 5) The sum of the quantities of all sub-batches of the same workpiece is equal to the total number of that kind of workpiece: ; 6) The basic processing duration of each operation of each sub-batch is expressed as: ; 7) The numerical relationship between the completion time, start time, and processing duration of each operation of each sub-batch is expressed as: ; 8) The makespan is greater than the completion time of the last operation of all workpieces: ; 9) The start time of each operation of each sub-batch takes the maximum value of the completion time of the previous operation and the machine completion time: ; 10) The energy consumption relationship between two adjacent processing tasks of each machine is expressed as: ; 11) The relationship between the machine start time and the operation start time is expressed as: ; ; ; ; Where, represents a collection of processing machines; Indicates the machine The position set of , the maximum position is , ; Represents a collection of artifacts; Represents workpiece The sub-batch set of ; Represents workpiece Process set, workpiece The maximum number of processes is ,gather ; Represents a decision variable, if the process In position Machine If it is processed, the value is 1, otherwise it is 0. is a collection The values; represents a collection of workers; represents the decision variable, if the worker Assigned to the machine On operation, =1, otherwise =0; Represents workpiece Quantity to be processed; Represents workpiece No. The number of workpieces in a sub-batch; Represents workpiece No. Batch No. The processing time of each process; Represents a single artifact Process In the machine The processing is time-consuming; Represents workpiece No. Batch No. Completion time of each process; Represents workpiece No. Batch No. The start time of each process; express; represents the maximum completion time; Indicates location Machines on completion time; Indicates the machine exist Standby energy consumption of the location; Indicates a decision variable. If the machine is processing the operation at position , then = 1; otherwise = 0; represents a very large number; Indicates the starting time of the machine at position . of the operation 5. A flexible production workshop batch flow scheduling method according to claim 1, characterized in that: The method for optimizing the hunting exploration stage and escape development stage of the secretary bird algorithm through discretization operations in Step S3 includes: The hunting exploration stage includes three states: searching for prey, consuming prey, and attacking prey. After passing through the hunting exploration stage, it enters the escape development stage; 1) When , it is in the stage of hunting for prey, and the position is updated through the following discretization formula: ; 2) When , in the state of consuming prey, the position is updated through the following discretization formula: ; 3) When , in the state of attacking prey, the position is updated through the following discretization formula: ; 4) In the escape development stage, the position is updated through the following discretization formula: ; In the formula, represents the maximum number of iterations; represents the current iteration number; represents the updated position state of the i-th secretary bird in the current iteration population; represents the i-th solution in the current iteration population; 、 and represent the random solutions in the current iteration population; represents a random number in the interval [0, 1]; represents the crossover operation; represents the multiplication operation; represents the historical optimal solution; = 0.5, represents a random number.
6. A flexible production workshop batch flow scheduling method according to claim 5, characterized in that: The method for dynamically adjusting the neighborhood search strategy using reinforcement learning in Step S3 includes: Regarding the diversity and convergence of the population in the secretary bird algorithm as the state of reinforcement learning; Regarding the combination of various crossover operations and mutation operations in the secretary bird algorithm as the action of reinforcement learning.
7. A flexible production workshop batch flow scheduling method according to claim 6, characterized in that: The crossover operations include: mapping crossover, two-point crossover, and linear order crossover; The mutation operations include: multi-point mutation, reverse order mutation, and insertion mutation.
8. A flexible production workshop batch flow scheduling method according to claim 1, characterized in that: The method for solving in step S4 includes: Step S41: Algorithm initialization; Step S42: Determine the state of the population according to the state indicators and state set of the population; Step S43: Calculate the reward value of the population state change according to the change of the population state and the reward strategy, and update the Q table; Step S44: Sequentially execute the secretary bird hunting exploration stage, the secretary bird escape development stage, and the multi-neighborhood dynamic search stage based on reinforcement learning to update the population individuals; Step S45: Calculate the fitness function value and state indicators of the population; Step S46: Repeat steps S42 to S45 until the iteration ends, and output the scheduling scheme.
9. An electronic device, comprising: A memory, a processor, and a computer program, characterized in that: the computer program is stored in the memory and is configured to be executed by the processor to implement the method according to any one of claims 1 to 8.
10. A computer-readable storage medium, characterized in that: A computer program is stored in the computer-readable storage medium, and the computer program is executed by the processor to implement the method according to any one of claims 1 to 8.
Citation Information
Patent Citations
Flexible job shop scheduling method based on coevolution improved HHO
CN119937493A
Production task scheduling method, system and device for flexible assembly job shop
US20240177251A1
Flexible job-shop scheduling method and system and electronic device
US20240288855A1
Flexible job-shop production scheduling method and apparatus
WO2024022054A1