Flexible production workshop batch flow scheduling method, electronic equipment and storage medium
By combining the pointer calibration method and the improved discrete secretary bird algorithm with reinforcement learning, the optimization problem of sub-batch size and quantity in batch flow scheduling was solved, thus shortening the production cycle, reducing energy consumption and improving production efficiency.
Patent Information
- Application Number
- CN202510896444.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-01
- Publication Date
- 2025-09-09
- Estimated Expiration
- 2045-07-01
AI Technical Summary
Existing batch flow scheduling algorithms are unable to simultaneously optimize the size and number of sub-batches, resulting in low production efficiency, high energy consumption, complex management, and difficulty in reasonable batch splitting based on the process route characteristics of different workpieces.
The pointer calibration method is used to construct the sub-batch strategy encoding. Combined with the improved discrete secretary bird algorithm and reinforcement learning to dynamically adjust the neighborhood search strategy, a scheduling model with the maximum completion time and total production energy consumption as the goals is established, and a scheduling plan is generated through a four-layer encoding strategy.
It has achieved flexible adjustment of production scheduling, shortened the production cycle, reduced energy consumption, improved production efficiency, reduced environmental impact, and significantly improved production efficiency.
Smart Images

Figure CN120410137B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of workshop scheduling, and in particular to a flexible production workshop batch flow scheduling method, electronic equipment and storage medium. Background Art
[0002] As manufacturing companies' customer orders become more diverse, large-volume, and personalized, flexible production workshops using traditional batch production models face challenges such as long workpiece processing wait times and excessive machine idle time. This not only reduces production efficiency but also wastes production resources. Therefore, many manufacturers facing large-volume production orders adopt batch flow scheduling, splitting large batches of workpieces into smaller sub-batches for processing. Sub-batches can be categorized as equal batches, consistent batches, and variable batches, depending on whether the size and quantity of the sub-batches change during processing. Compared to batch production, batch flow scheduling can reduce machine idle time, improve manufacturing efficiency, and reduce energy consumption.
[0003] However, most of the existing algorithms for solving batch flow scheduling are unable to optimize the size and number of sub-batches at the same time. The batching method adopted by enterprises is single, and most of them are to split the production tasks into equal batches based on production experience or a simple equal sub-batch strategy. It is difficult to achieve reasonable batch splitting for each workpiece based on the characteristics of the process routes of different workpieces, which can easily lead to low production efficiency, high energy consumption, and complex management when scheduling the workpieces. The final sub-batch production plan has poor overall performance. Summary of the Invention
[0004] The present invention proposes a flexible production workshop batch flow scheduling method, electronic equipment and storage medium to solve the technical problem that the existing scheduling scheme is only for a single batch mode and is difficult to apply to dynamic batch modes.
[0005] To solve the above technical problems, the present invention provides a flexible production workshop batch flow scheduling method, comprising the following steps:
[0006] Step S1: Based on the production batch of each order product and the process route of each workpiece, the process sequence code, machine selection code and worker allocation code are constructed, and the pointer calibration method is used for calibration to construct the sub-batch strategy code;
[0007] Step S2: Establish a scheduling model with maximum completion time and total production energy consumption as the target;
[0008] Step S3: Optimize the hunting exploration phase and escape exploitation phase of the Secretary Bird algorithm through discretization operations, and dynamically adjust the neighborhood search strategy using reinforcement learning to obtain an improved discrete Secretary Bird algorithm;
[0009] Step S4: Based on the four-layer coding strategy of sub-batch strategy coding, process sequence coding, machine selection coding and worker allocation coding, the scheduling model is solved by the improved discrete secretary bird algorithm to generate a scheduling plan.
[0010] Preferably, the method for constructing the sub-batch strategy code in step S1 includes:
[0011] Step S11: Number the workpieces according to quantity, and set the number of pointers and minimum batch size required for each workpiece according to actual needs;
[0012] Step S12: According to the minimum batch requirement, the workpiece number is randomly assigned to each pointer of each workpiece to represent its coordinate position;
[0013] Step S13: Counting the coordinate positions of each pointer to form the sub-batch strategy code of the workpiece.
[0014] Preferably, the total energy consumption of production in step S2 is The expression is:
[0015] ;
[0016] Where, Represents a collection of artifacts; Indicates workpiece The sub-batch set of ; Indicates workpiece A set of processes; represents a collection of processing machines; Indicates the machine The location set of represents a collection of workers; Indicates workpiece No. s Batch No. j The processing time of each process; Indicates workers a Operational capability coefficient; represents the decision variable, if the worker a Assigned to the machine On operation, =1, otherwise =0; Indicates the machine Processing energy consumption per unit time; Indicates workpiece No. s Batch No. j process The start time of work; Indicates location p Machines on completion time; Indicates the machine Standby energy consumption per unit time; Indicates workpiece No. s The number of workpieces in a sub-batch; Indicates the energy consumption of transferring a single workpiece between different processing machines; Represents a decision variable, if the workpiece Process and Continuous in the machine If the workpiece is processed and no other workpiece process is inserted, the value is 1, otherwise it is 0; Represents the inherent energy consumption of the processing workshop.
[0017] Preferably, the constraints of the scheduling model in step S2 include:
[0018] 1) Each process of each batch of each workpiece can only be processed by one machine from the available processing machine set:
[0019] ;
[0020] 2) Each machine can only process one process at most each time it performs a processing task:
[0021] ;
[0022] 3) Each machine is assigned at most one worker:
[0023] ;
[0024] 4) When a process is scheduled to be processed at a certain position of the machine, it will be scheduled to be processed at the position in front of the machine only if the position is occupied by other processes:
[0025] ;
[0026] 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:
[0027] ;
[0028] 6) The basic processing time of each process of each sub-batch is expressed as:
[0029] ;
[0030] 7) The numerical relationship between the completion time, start time and processing time of each process in each sub-batch is expressed as:
[0031] ;
[0032] 8) The maximum completion time is greater than the completion time of the last process of all workpieces:
[0033] ;
[0034] 9) The start time of each process in each sub-batch is the maximum of the completion time of the previous process and the machine completion time:
[0035] ;
[0036] 10) The energy consumption relationship between two adjacent processing tasks of each machine is expressed as:
[0037] ;
[0038] 11) The relationship between machine start time and process start time is expressed as:
[0039] ;
[0040] ;
[0041] ;
[0042] ;
[0043] 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; Indicates 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; represents the maximum completion time; Indicates location Machines on completion time; Indicates the machine exist Standby energy consumption of the location; represents the decision variable, if the machine Processing location The above process, =1; otherwise =0; Represents a very large number; Indicates location Machines on The start time of work.
[0044] Preferably, the method for optimizing the hunting exploration phase and the escape development phase of the secretary bird algorithm by discretization operation in step S3 includes: the hunting exploration phase includes three states: searching for prey, consuming prey, and attacking prey, and entering the escape development phase after the hunting exploration phase;
[0045] 1) When When , it is in the stage of searching for prey, and the position is updated by the following discretization formula:
[0046] ;
[0047] 2) When , in the state of consuming prey, the position is updated through the following discretization formula:
[0048] ;
[0049] 3) When , in the attack prey state, the position is updated by the following discretization formula:
[0050] ;
[0051] 4) During the escape development phase, the position is updated using the following discretization formula:
[0052] ;
[0053] Where, Indicates the maximum number of iterations; Indicates the current iteration number; Indicates the number of the current iteration population i The updated location status of each secretary bird; Indicates the number of the current iteration population i a solution; 、 and represents the random solution in the current iteration population; Represents a random number in the interval [0,1]; Indicates crossover operation; Represents a multiplication operation; represents the historical optimal solution; =0.5, Represents a random number.
[0054] Preferably, the method of 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; and taking the combination of multiple crossover operations and mutation operations in the Secretary Bird algorithm as the action of reinforcement learning.
[0055] Preferably, the crossover operation includes: mapping crossover, two-point crossover and linear order crossover; the mutation operation includes: multi-point mutation, reverse mutation and insertion mutation.
[0056] Preferably, the method for solving the problem in step S4 includes:
[0057] Step S41: algorithm initialization;
[0058] Step S42: judging the state of the population based on the population state indicator and state set;
[0059] Step S43: Calculate the reward value of the population state change according to the population state change and the reward strategy, and update the Q table;
[0060] Step S44: sequentially executing the secretary bird hunting exploration phase, the secretary bird escape development phase, and the multi-neighborhood dynamic search phase based on reinforcement learning to update the population individuals;
[0061] Step S45: Calculate the fitness function value and state index of the population;
[0062] Step S46: Repeat steps S42 to S45 until the iteration ends and output the scheduling plan.
[0063] The present invention also provides an electronic device, comprising: a memory, a processor and a computer program, wherein the computer program is stored in the memory and configured to be executed by the processor to implement the above method.
[0064] The present invention also provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and the computer program is executed by a processor to implement the above method.
[0065] The beneficial effects of the present invention include at least: the present invention dynamically determines the size and quantity of sub-batches through the pointer calibration method, breaking the limitations of the existing splitting method, so that production scheduling can be flexibly adjusted according to the workpiece process characteristics and equipment status; then, by combining the improved discrete secretary bird algorithm based on reinforcement learning with the flexible production workshop batch flow scheduling problem, reinforcement learning is used to dynamically adjust the neighborhood search strategy in the algorithm solving process, ensuring the feasibility and efficiency of the algorithm, and effectively solving the premature convergence defects of traditional algorithms in solving such NP-hard problems. The combination of these technical features enables the present invention to form an overall advantage of synergistic efficiency in shortening the production cycle, reducing energy consumption, and improving scheduling flexibility, significantly improving production efficiency while reducing environmental impact. BRIEF DESCRIPTION OF THE DRAWINGS
[0066] Figure 1 Schematic diagram of a method flow in an embodiment of the present invention;
[0067] Figure 2 Schematic diagram of a pointer calibration method according to an embodiment of the present invention;
[0068] Figure 3 A schematic diagram of a multi-neighborhood dynamic search based on reinforcement learning according to an embodiment of the present invention;
[0069] Figure 4 Schematic diagram of three crossover methods used in multi-neighborhood dynamic search according to an embodiment of the present invention;
[0070] Figure 5 Schematic diagram of three variation methods used in multi-neighborhood dynamic search according to an embodiment of the present invention;
[0071] Figure 6Schematic diagram of four-layer coding according to an embodiment of the present invention;
[0072] Figure 7 Schematic diagram of a box comparison between the improved discrete secretary bird algorithm based on reinforcement learning and a comparison algorithm according to an embodiment of the present invention;
[0073] Figure 8 Schematic diagram of HV indicator iteration of the improved discrete secretary bird algorithm based on reinforcement learning and the comparison algorithm in an embodiment of the present invention;
[0074] Figure 9 This is a Pareto result diagram of the improved discrete secretary bird algorithm based on reinforcement learning and the comparison algorithm in an embodiment of the present invention. DETAILED DESCRIPTION
[0075] The following is a clear and complete description of the technical solutions in the embodiments of the present invention, in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present invention without making any creative efforts are within the scope of protection of the present invention.
[0076] Before describing the embodiments, batch flow scheduling is first described:
[0077] For high-volume, high-variety production orders, the large batch can be split into multiple sub-batches containing a certain number of workpieces, based on the process route characteristics of different workpiece types. Production can then be scheduled using these sub-batches as the minimum unit for processing and transfer within the workshop. Leveraging the flexibility of smaller sub-batches, workpieces can overlap their processing operations across different machines to improve production efficiency. This type of scheduling problem is known as the batch flow scheduling problem. Compared to full-batch production, a production plan using consistent sub-batches allows for a more compact arrangement of processing tasks, significantly shortening the maximum completion time. The challenge lies in determining a reasonable batch splitting plan for the order and generating an efficient scheduling solution that balances the economic benefits of batch flow production with the environmental impact of increased energy consumption.
[0078] Batch flow scheduling differs from general scheduling modes in that: ① Instead of using workpieces as processing units, workpiece sub-batches are used as the basic units of workshop processing and transportation; ② The batch splitting and scheduling of workpieces influence each other, and a reasonable batch splitting plan can maximize scheduling benefits.
[0079] In the flexible production workshop batch flow scheduling problem, it is necessary to rationally determine the size and number of workpiece sub-batches. Too few workpiece sub-batches underutilize workshop equipment resources. Excessive sub-batches not only increase the difficulty of production management but also increase the number of transfers, resulting in higher production energy consumption. Furthermore, in actual production, differences in worker processing capabilities also have a significant impact on scheduling. Especially when dealing with personalized production orders, it is necessary to modify machine tool auxiliary fixtures and adjust installation positions based on individual product characteristics. More skilled workers require less time to complete these tasks, while less skilled workers require more time. Therefore, the optimization objectives are completion time and total production energy consumption. The completion time is the maximum completion time of all workpieces. Different machines have different processing capabilities, resulting in different production energy consumption. Total production energy consumption includes machine processing energy, standby energy, workpiece transfer energy, and workshop fixed energy consumption.
[0080] Therefore, if Figure 1 As shown, an embodiment of the present invention provides a flexible production workshop batch flow scheduling method, including the following steps:
[0081] Step S1: Based on the production batch of each order product and the process route of each workpiece, the process sequence code, machine selection code and worker allocation code are constructed, and the pointer calibration method is used for calibration to construct the sub-batch strategy code.
[0082] Methods for constructing sub-batch strategy encodings include:
[0083] 1) Number the workpieces according to quantity, and set the number of pointers and minimum batch size required for each workpiece based on actual needs;
[0084] 2) Randomly assign workpiece numbers to each pointer of each workpiece to represent its coordinate position;
[0085] 3) Preliminary adjustment of the coordinate positions of each pointer according to the minimum batch requirements;
[0086] 4) Counting the coordinate positions of each pointer forms the sub-batch strategy encoding of the workpiece.
[0087] Specifically, the method for constructing sub-batch strategy encoding is as follows Figure 2 As shown in the figure, suppose that 6 workpieces of a type need to be processed and these 6 workpieces are numbered from 1 to 6. If a single workpiece is allowed to be a sub-batch, 5 calibration pointers are required to divide the 6 workpieces into 6 sub-batches. Figure 2As shown, its number is equal to the number of workpieces to be processed minus one. However, in the actual processing process, faced with a large number of workpieces, each sub-batch will have a minimum batch limit. Therefore, the number of sub-batches generated by a single workpiece as a sub-batch is the theoretical upper limit of the sub-batch, which is equal to the number of workpieces to be processed. Based on the upper limit of the sub-batch number, the number of calibration pointers is set, and then the workpiece numbers are randomly assigned to the calibration pointers to indicate their positions, such as "[1, 3, 2, 5, 3]" means that the first calibration pointer is located after workpiece No. 1, the second calibration pointer is located after workpiece No. 3, the third calibration pointer is located after workpiece No. 2, and so on. Then adjust the position of the calibration pointer according to the minimum batch requirement set for the actual problem, such as Figure 2 The minimum batch size is set to 2, that is, the calibration pointer needs to be separated by 2 workpieces for batch division, then the position of the calibration pointer is adjusted to "[2, 4, 2, 4, 4]" or "[3, 3, 3, 3, 3]", and finally the position of each calibration pointer is counted to form the sub-batch strategy code "[2, 4]" or "[3]" of the workpiece.
[0088] Step S2: Establish a scheduling model with maximum completion time and total production energy consumption as the target.
[0089] For the convenience of description, the symbols and decision variables used in the embodiments of the present invention are as follows:
[0090] : Artifact type index, artifact collection is , , the maximum number of workpiece types to be processed is |I|;
[0091] : Workpiece process index, workpiece The set of processes is , Workpiece The maximum number of processes is ; Let the set ;
[0092] : artifact subbatch index, artifact The sub-batch set is , ;
[0093] : Processing machine index, the processing machine set is , , the maximum number of machines is ;
[0094] : Worker index, worker set is , ;
[0095] : Machine location index, machine The location set is , the maximum position is ; Let the set ;
[0096] :Workpiece Quantity to be processed;
[0097] :Worker Operational capability coefficient;
[0098] : Energy consumption of transferring a single workpiece between different processing machines;
[0099] : Intrinsic energy consumption of the processing workshop;
[0100] :Process of a single workpiece In the machine The processing is time-consuming;
[0101] :Workpiece No. Batch No. The processing time of each process;
[0102] :Location Machines on The start time of work;
[0103] :Location Machines on completion time;
[0104] :machine Processing energy consumption per unit time;
[0105] :machine Standby energy consumption per unit time;
[0106] :machine exist Standby energy consumption of the location;
[0107] : Total processing energy consumption of the machine;
[0108] : The total standby energy consumption of the machine;
[0109] : Total energy consumption of workpiece transportation;
[0110] : total energy consumption cost;
[0111] : extremely large number;
[0112] : Decision variables, artifacts No. The number of workpieces in a sub-batch is a non-negative variable;
[0113] : Decision variables, artifacts No. Batch No. The start time of a process is a non-negative variable;
[0114] : Decision variables, artifacts No. Batch No. The completion time of a process is a non-negative variable;
[0115] : Decision variable, the maximum completion time of all machines, i.e. makespan, is a non-negative variable;
[0116] :If the process In the machine Upper processing, =1; otherwise =0;
[0117] :If the machine Processing location The above process, =1; otherwise =0.
[0118] : If the worker Assigned to the machine On operation, =1; otherwise =0.
[0119] :If the process In position Machine If the process is on, the value is 1; otherwise, it is 0. is a collection The values;
[0120] :If the process and Continuous in the machine If the workpiece is processed and no other workpiece process is inserted, the value is 1; otherwise, it is 0.
[0121] The constraints in the embodiment of the present invention include:
[0122] Constraint 1: Each operation of each batch of each workpiece can only be processed by one machine from the set of optional processing machines:
[0123] ;
[0124] Constraint 2: Each machine can only process at most one operation at a time when executing a processing task:
[0125] ;
[0126] Constraint 3: Each machine is assigned at most one worker:
[0127] ;
[0128] Constraint 4: When a process is scheduled to be processed at a certain position on the machine, it will be scheduled to be processed at the position in front of the machine only if the position is occupied by another process:
[0129] ;
[0130] Constraint 5: The sum of the quantities of all sub-batches of the same workpiece is equal to the total number of workpieces of that type:
[0131] ;
[0132] Constraint 6: The basic processing time of each process in each sub-batch is expressed as:
[0133] ;
[0134] Constraint 7: The numerical relationship between the completion time, start time, and processing time of each process in each sub-batch is expressed as:
[0135] ;
[0136] Constraint 8: The maximum completion time is greater than the completion time of the last process of all workpieces:
[0137] ;
[0138] Constraint 9: The start time of each process in each sub-batch is the maximum of the completion time of the previous process and the machine completion time:
[0139] ;
[0140] Constraint 10: The energy consumption relationship between two adjacent processing tasks of each machine is expressed as:
[0141] ;
[0142] Constraint 11: The relationship between machine start time and process start time is expressed as:
[0143] ;
[0144] ;
[0145] ;
[0146] ;
[0147] The mathematical model for consistent sub-batch scheduling of a multi-process route production workshop with the maximum completion time and total production energy consumption as the target is established as shown below.
[0148] Specifically, the maximum completion time and total production energy consumption are minimized, and the expression is:
[0149] ;
[0150] Sub-goal 1: The maximum completion time of all sub-batch processes, expressed as:
[0151] ;
[0152] Sub-goal 2: The total energy consumption during the production and processing process can be expressed as:
[0153] .
[0154] Step S3: The hunting exploration phase and the escape development phase of the secretary bird algorithm are optimized through discretization operations, and the neighborhood search strategy is dynamically adjusted using reinforcement learning to obtain an improved discrete secretary bird algorithm.
[0155] The Secretary Bird algorithm consists of a hunting exploration phase and an escape development phase. To increase the breadth and depth of the search, the present embodiment employs three different random numbers for discretization. The results from different crossover scenarios are then compared. Based on the greedy criterion, the optimal individual position is used as the new Secretary Bird position. If the fitness value of the new position does not improve, the original position remains unchanged. Specifically, the discretization method for the Secretary Bird algorithm in this embodiment includes:
[0156] when At , the secretary birds are in a state of searching for prey. They slowly sweep the ground with their long legs while paying attention to their surroundings, looking for signs of snakes. This situation occurs in the initial iterations of optimization, where exploration is crucial. At this time, the secretary bird's position is updated according to the following formula:
[0157] ;
[0158] Indicates the first i The updated location status of the Secretary Bird. and represents the random candidate solution at this stage, represents a random number in the interval [0,1], Indicates the maximum number of iterations; Represents the current iteration number. Through the above formula, Secretary Bird can explore different regions of the solution space, increasing the chance of finding the global optimal solution.
[0159] when When the Secretary Bird is in a state of consuming prey, it discovers the snake and begins a unique hunting method: standing on the ground, it observes the snake's every move from a high vantage point. Using its keen sense of the snake's movements, it gradually hovers, jumps, and provokes the snake, thus wearing down its stamina. At this point, the Secretary Bird's position is updated according to the following formula:
[0160] ;
[0161] Indicates the first i The updated location status of the Secretary Bird. Denotes the historical optimal solution. Through the above formula, Secretary Bird can perform a local search on the best position found previously, thereby better exploring the surrounding solution space.
[0162] when When the snake is exhausted, the secretary bird senses the opportunity and takes quick action, using its powerful leg muscles to attack, striking the snake's vital parts with its sharp claws, killing it. During this random search, the secretary bird's position is updated according to the following formula:
[0163] ;
[0164] The position update of the secretary bird in the above three states is based on the non-dominated sorting method, that is, if , then use the non-dominated solution Replace the original position of Secretary Bird Otherwise, no non-dominated solution is found, and the secretary bird maintains its original position. constant.
[0165] During the development phase of the Secretary Bird's escape, when the Secretary Bird encounters a natural enemy, it will choose to fly away quickly or camouflage. At this time, the Secretary Bird's position is updated according to the following formula:
[0166] ;
[0167] =0.5, This phase uses the same position update method as the Secretary Bird hunting exploration phase.
[0168] Then, the state and action mapping of 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 the different neighborhood search strategies adopted by the Secretary Bird algorithm, such as Figure 3 shown.
[0169] The design of the agent state in this embodiment is based on the convergence of the population and diversity indicators , whose expression is:
[0170] ;
[0171] ;
[0172] ;
[0173] ;
[0174] Where, It is the non-dominated solution set solved by the algorithm in each generation of population. is the reference Pareto frontier, and Represents the solution set Point in and reference set Point in The Euclidean distance between .
[0175] The state set of the agent is based on the non-dominated solution and There are four combinations: ① and ;② and ③ and ④ and According to these four and The state of the agent is defined as four types of and combination.
[0176] The reward strategy is that after the agent performs an action, the environment will give the agent a reward based on the change in state. The reward is defined as follows:
[0177] ;
[0178] The basis for updating the Q table is the following expression:
[0179] ;
[0180] Where, and Respectively represent the population Second and The state of the iteration, and Respectively represent Second and The action chosen by the agent after iteration, represents an action set consisting of 9 neighborhood search strategies, represents the learning rate of the agent, Indicates a bonus discount. and are all variables between [0,1] and can be adjusted according to the actual situation. In order to enable the agent to better select the domain search strategy according to the iterative process of the algorithm, the learning rate Improvements, new learning rate The calculation formula is as follows:
[0181] ;
[0182] By adjusting the learning rate α, the agent can quickly adjust the Q-value table in the early stage of learning, and stably converge the Q-value to the optimal value in the later stage.
[0183] In this embodiment, the three crossover methods based on process and machine selection coding include: ① Mapped crossover: randomly generate two crossover points within the chromosome length range and , two chromosomes at two crossover points The gene sequence outside the two crossover points remains unchanged. The gene sequences between them are mapped to the genes of another chromosome and then exchanged to obtain two new chromosomes. ② Two-point crossover: The two chromosomes exchange two crossover points. The gene sequences between them are exchanged on each chromosome In the gene sequence outside the two points, the duplicate genes generated by the exchange are removed, and the genes missing due to the exchange are supplemented to obtain two new chromosomes. The gene sequence between the two chromosomes is retained, and the corresponding deletion of the first chromosome is located at and The gene fragments between the two chromosomes are then located in the first gene position of the first chromosome. The remaining genes of the second chromosome are filled in outside the region to form a new solution. Repeating this process on the two chromosomes can produce two new chromosomes. The three crossover methods are as follows: Figure 4 shown.
[0184] Three mutation methods based on process and machine selection coding are designed: ① Multi-point mutation: mutation of process sequence coding, randomly generating two mutation points within the chromosome length range and , determine whether the genes of two points are the same, if they are the same, regenerate two mutation points. If they are not the same, swap the genes of the two mutation points; for the mutation of machine selection coding, randomly select a certain process of a certain sub-batch of a workpiece and reselect a machine number from its optional processing machine set. ② Reverse mutation: and The process sequence between the two points and the machine selection gene fragment are arranged in reverse order. ③ Insertion mutation: Position of gene insertion The genes at the position are placed in front of the gene at that position, and the genes at other positions are placed in the back of the gene. Figure 5 shown.
[0185] A total of 9 neighborhood search strategies, combining 3 crossover and mutation methods, are used as the optional action set of the intelligent agent. The intelligent agent uses the action selection strategy based on the change of state to select different neighborhood search strategies, realizing the multi-neighborhood dynamic search of the Secretary Bird algorithm.
[0186] In the multi-neighborhood dynamic search phase, for the ε-greedy action selection strategy adopted by reinforcement learning, a greed factor that changes dynamically with the algorithm iteration process is designed. , which is calculated as follows:
[0187] .
[0188] Step S4: Based on the four-layer coding strategy of sub-batch strategy coding, process sequence coding, machine selection coding and worker allocation coding, the scheduling model is solved by the improved discrete secretary bird algorithm to generate a scheduling plan.
[0189] Specifically, in the coding strategy, a complete chromosome contains four layers of coding: sub-batch strategy coding, process coding, machine selection coding, and worker allocation coding. The sub-batch strategy layer uses pointer coordinate coding, and determines the number of sub-batches for each type of workpiece and the batch size of each sub-batch based on the pointer calibration method. The process sequence layer uses integer coding based on the process, in which the elements are composed of the workpiece number and the sub-batch number. 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 order of processing different sub-batches of different workpieces. The machine selection layer uses integer coding, in which the elements are composed of the processing machine numbers corresponding to the sub-batch processes. The worker allocation coding uses direct coding of the worker capacity coefficient. An example of the four-layer coding is as follows. Figure 6 shown.
[0190] The coding process is as follows: ① Input the workpiece processing information, workpiece type and quantity , number of machines , worker ability coefficient , population size ② Individual coding in the population, determine the number of sub-batches and batch size for each workpiece according to the pointer calibration method, and generate the sub-batch strategy coding ; ③ Randomly encode the process sequence according to the number of sub-batches and the number of workpiece types ④ Randomly select the machine number from the set of optional processing machines for each workpiece according to the process processing sequence and generate a machine selection code ⑤ According to the number of machines, randomly assign a coefficient representing the worker's processing capacity to each machine to obtain the worker allocation code ⑥ Get a complete chromosome code ; ⑦ All individuals in the population complete the coding and output the coding sequence .
[0191] In the embodiment of the present invention, when performing a solution, the solution method includes the following steps:
[0192] Step S411: Initialize algorithm parameters and set the maximum number of iterations , initial population size , and reward discounting for reinforcement learning and learning rate ,initialization Value table;
[0193] Step S412: Initialize the population according to the encoding and decoding strategies, and calculate the fitness function and state index of the initial population;
[0194] Step S413: The algorithm iteration begins. When the number of iterations is =1, let the state of reinforcement learning be the first state in the state set =1;
[0195] Step S514: Status determination. Determine the status of the population based on the population status indicators and status set;
[0196] Step S415: Calculate rewards and update Value table. According to the change of population status and reward strategy, calculate the reward value of population status change and update surface;
[0197] Step S416: sequentially executing the secretary bird hunting exploration phase (searching for prey, consuming prey, and attacking prey), the secretary bird escape development phase, and the reinforcement learning-based multi-neighborhood dynamic search phase to update the individual;
[0198] Step S417: Calculate the fitness function value and state index of the population;
[0199] Step S418: Determine whether the termination condition is met. If the termination condition is met, execute step S419. Otherwise, the number of iterations is , execute step S414;
[0200] Step S419: Output the scheduling plan and the algorithm ends.
[0201] In this embodiment of the present invention, decoding requires determining the processing time window for each sub-batch process of each workpiece, assigning workers of different capabilities and each process of each sub-batch of each workpiece type to the corresponding machines, and determining the processing sequence and processing time of each sub-batch process on each machine. At the same time, it is necessary to minimize idle time between processing tasks, thereby ensuring the shortest completion time and the lowest energy consumption.
[0202] The specific decoding process is as follows:
[0203] Step S421: traverse the sub-batch strategy code from left to right, calculate and record the batch size of each sub-batch of various workpieces according to the pointer calibration method;
[0204] Step S422: Determine the sub-batch process currently being processed based on the process code, and obtain the processing machine and operator selected for the current process from the machine selection and worker allocation codes. Combined with the sub-batch size and the worker's capacity coefficient, calculate the worker's processing time on the selected machine for the process. Based on the cumulative processing time of the preceding process , calculate the allowed start time of the current sub-batch process ;
[0205] Step S423: Search the existing processing time period of the processing machine obtained in step S422, and calculate the processing time period according to the machine start time. Sort from small to large and go to step S424; if the machine does not have an existing processing time period, it means that the machine has not arranged any processing tasks, and go to step S425;
[0206] Step S424: Comparison and If the size Less than and Less than or equal to , go to step S425, otherwise go to step S426;
[0207] Step S425: The current sub-batch process start time is taken as , and according to the processing time , calculate the completion time of the sub-batch process, update the allowed start time of the next process of the current sub-batch and the existing processing time period of the machine;
[0208] Step S426: Starting from the second processing time period of the machine, determine the start time of each processing time period of the machine one by one and If the size Less than T2 and Less than or equal to , go to step S507, otherwise go to step S508;
[0209] Step S427: The current sub-batch process start time is obtained and the completion time of a processing time period on the machine The maximum value in the process time , calculate the completion time of the sub-batch process, update the allowed start time of the next process of the current sub-batch and the existing processing time period of the machine;
[0210] Step S428: The current sub-batch process start time is obtained and the completion time of the last processing period of the machine The maximum value in the process time , calculate the completion time of the sub-batch process, update the allowed start time of the next process of the current sub-batch and the existing processing time period of the machine;
[0211] Step S429: If it is the last sub-batch process in the process sequence code, go to step S4210, otherwise go to step S422;
[0212] Step S4210: After decoding is completed, the makespan and the total production energy consumption TEC of the machine are calculated and output.
[0213] Taking the production task of a medical infusion device in a certain period of time of a medical enterprise as an example, a batch flow scheduling problem of a multi-process route production workshop is constructed to analyze the application performance of the method of the present invention in actual engineering cases. This production task has a total of 10 types of workpieces to be produced, and the number of each workpiece to be produced is 300,000 pieces. The number of processes for each workpiece is 3 and has strict sequence constraints. The detailed information of the processing tasks is shown in Table 1, and the work 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-scale production, actual production is often carried out in the form of batch flow. The processing equipment in the production workshop and its related energy consumption information are shown in Table 2. The energy consumption parameters related to the workshop and transportation are set as follows: =10kW, =1kW.
[0214] Table 1
[0215]
[0216] Table 2
[0217]
[0218] The decomposition-based multi-objective evolutionary algorithm (MOEA / D), the Pareto envelope-based selection algorithm II (PESA-II), the intensity Pareto evolutionary algorithm 2 (SPEA2), and the improved decomposition-based evolutionary algorithm (I-DBEA) were introduced for comparison with the reinforcement learning-based improved discrete secretary bird algorithm (RLSBOA) provided by the present invention. The population size of all algorithms was set to 200, the maximum number of iterations was set to 250, and the number of vector neighbors in I-DBEA and MOEA / D was set to 199. Each algorithm was run independently 10 times, and all results were screened for non-dominated solutions, and their target values were used as the true Pareto frontier. The results were normalized, and the HV and IGD indicators were used to evaluate the non-dominated solution set of the algorithm. The box plots and normal distribution of the five algorithms on the two indicators are shown in the figure. Figure 7 shown.
[0219] Figure 7 The comparison shows that although RLSBOA has an outlier in the HV index, its average value is significantly greater than that of the four comparison algorithms; although RLSBOA also has an outlier in the IGD index, its average value is also significantly smaller than that of the four comparison algorithms, indicating that RLSBOA has better convergence than the comparison algorithms. The iterative data of each algorithm when it obtains the best HV index are plotted as follows: Figure 8 The iteration diagram shown.
[0220] The maximum HV values obtained by the five algorithms are 1.1493×10 9 , 1.1469×109 , 1.1440×10 9 , 1.1425×10 9 , 1.1406×10 9 , RLSBOA's final HV value outperformed those of the four compared algorithms. In the early stages of the algorithm iteration, SPEA2 provided superior initial solution quality, and RLSBOA's convergence speed was similar to that of MOEA / D and I-DBEA, but slower than SPEA2 and PESA-II. In the middle and late stages of the algorithm iteration, RLSBOA achieved the highest convergence HV value. After 100 iterations, all algorithms showed very little improvement. The performance of the four algorithms ranked from best to worst as RLSBOA > SPEA2 > PESA-II > MOEA / D > I-DBEA.
[0221] Draw the Pareto frontier of the results of the five algorithms, such as Figure 9 As shown in Figure 2, the Pareto frontier of RLSBOA is closer to the true Pareto frontier, and the number of Pareto solutions obtained by RLSBOA is the largest. The comparison shows that the Pareto solution set obtained by RLSBOA is more diverse and distributed. Figure 9 It can be seen that the four processing solutions obtained by RLSBOA are all optional high-quality solutions. Different solutions have different focuses on the two sub-goals, and no solution can minimize both sub-goals at the same time. Figure 8 The resulting algorithm sorting is identical.
[0222] The production of medical infusion devices in the injection and extrusion workshop of this medical enterprise belongs to large-scale production. In order to further compare the different effects of the scheduling schemes obtained by batch processing, equal sub-batch processing and consistent sub-batch processing when applied to the actual engineering problems of this medical enterprise, the three processing modes are solved by the proposed RLSBOA. When the batch processing mode is applied, the sub-batch strategy coding in the four-layer coding scheme is removed, and the three-layer coding of process sequence, machine selection and worker allocation is retained; when the equal sub-batch processing mode is applied, the sub-batch strategy coding is slightly modified so that the sub-batch strategy coding is coded in the equal sub-batch manner, and the other three-layer coding method remains unchanged. The scheme in the Pareto solution set is selected based on the minimum completion time. The target values of the three processing modes are compared as shown in Table 3 below.
[0223] Table 3
[0224]
[0225] From the perspective of the economic metric of maximum completion time, uniform sub-batches and consistent sub-batches achieved maximum improvements in production efficiency of 20.89% and 28.42%, respectively, compared to the entire batch process. From the perspective of the environmental metric of total production energy consumption, uniform sub-batches and consistent sub-batches achieved corresponding energy consumption optimization rates of 23.27% and 26.64%, respectively, compared to the entire batch process. The results indicate that batch flow processing is more suitable for large-scale production of products than the entire batch process. Furthermore, consistent sub-batches outperformed uniform sub-batches in terms of the optimization rates for both objectives.
[0226] The technical features of the above embodiments may be combined in any manner. To simplify the description, not all possible combinations of the technical features in the above embodiments are described. Only preferred embodiments of the present invention are presented. While the description is relatively specific and detailed, it should not be construed as limiting the scope of the present invention. As long as there are no conflicts in the combination of these technical features, they should be considered to be within the scope of this specification.
[0227] It should be noted that, for those skilled in the art, various modifications and improvements can be made without departing from the scope of the present invention, and these modifications and improvements fall within the scope of protection of the present invention. Therefore, the scope of protection of the present invention shall be determined by the appended claims.
Claims
1. A method for batch flow scheduling in a flexible production workshop, characterized by: The following steps are involved: Step S1: Based on the production batch of each order product and the process route of each workpiece, the process sequence code, machine selection code and worker allocation code are constructed, and the pointer calibration method is used for calibration to construct the sub-batch strategy code; Step S2: Establish a scheduling model with maximum completion time and total production energy consumption as the target; Step S3: Optimize the hunting exploration phase and escape exploitation phase of the Secretary Bird algorithm through discretization operations, and dynamically adjust the neighborhood search strategy using reinforcement learning to obtain an improved discrete Secretary Bird algorithm; Step S4: Based on the four-layer coding strategy of the sub-batch strategy coding, process sequence coding, machine selection coding, and worker allocation coding, the scheduling model is solved by the improved discrete secretary bird algorithm to generate a scheduling plan; The method for constructing the sub-batch strategy encoding in step S1 includes: Step S11: Number the workpieces according to quantity, and set the number of pointers and minimum batch size required for each workpiece according to actual needs; Step S12: According to the minimum batch requirement, the workpiece number is randomly assigned to each pointer of each workpiece to represent its coordinate position; Step S13: Counting the coordinate positions of each pointer to form the sub-batch strategy code of the workpiece; The total energy consumption of production in step S2 The expression is: ; Where, Represents a collection of artifacts; Indicates workpiece The sub-batch set of ; Indicates workpiece A set of processes; represents a collection of processing machines; Indicates the machine The location set of represents a collection of workers; Indicates workpiece No. s Batch No. j process processing time; Indicates workers a Operational capability coefficient; represents the decision variable, if the worker a Assigned to the machine On operation, =1, otherwise =0; Indicates the machine Processing energy consumption per unit time; Indicates workpiece No. s Batch No. j The start time of each process; Indicates location p Machines on completion time; Indicates the machine Standby energy consumption per unit time; Indicates workpiece No. s The number of workpieces in a sub-batch; Indicates the energy consumption of transferring a single workpiece between different processing machines; Represents a decision variable, if the workpiece Process and Continuous in the machine If the workpiece is processed and no other workpiece process is inserted, the value is 1, otherwise it is 0; Represents the inherent energy consumption of the processing workshop.
2. A flexible production workshop batch flow scheduling method according to claim 1, characterized in that: The constraints of the scheduling model in step S2 include: 1) Each process of each batch of each workpiece can only be processed by one machine from the available processing machine set: ; 2) Each machine can only process one process at most each time it performs a processing task: ; 3) Each machine is assigned at most one worker: ; 4) When a process is scheduled to be processed at a certain position of the machine, it will be scheduled to be processed at the position in front of the machine only if the 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 time of each process of each sub-batch is expressed as: ; 7) The numerical relationship between the completion time, start time and processing time of each process in 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 in each sub-batch is the maximum 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 machine start time and 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; Indicates workpiece No. Batch No. Completion time of each process; Indicates 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; represents the decision variable, if the machine Processing location The above process, =1; otherwise =0; Represents a very large number; Indicates location Machines on The start time of work.
3. A flexible production workshop batch flow scheduling method according to claim 1, characterized in that: The method for optimizing the hunting exploration phase and the escape development phase of the secretary bird algorithm through discretization operation in step S3 includes: the hunting exploration phase includes three states: searching for prey, consuming prey, and attacking prey, and entering the escape development phase after the hunting exploration phase; 1) When When , it is in the stage of searching for prey, and the position is updated by 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 attack prey state, the position is updated by the following discretization formula: ; 4) During the escape development phase, the position is updated using the following discretization formula: ; Where, Indicates the maximum number of iterations; Indicates the current iteration number; Indicates the updated position status of the i-th secretary bird in the current iterative population; Represents the i-th solution in the current iterative population; 、 and represents the random solution in the current iteration population; Represents a random number in the interval [0,1]; Indicates crossover operation; Represents a multiplication operation; represents the historical optimal solution; =0.5, Represents a random number.
4. A flexible production workshop batch flow scheduling method according to claim 3, characterized in that: The method of 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; and taking the combination of multiple crossover operations and mutation operations in the Secretary Bird algorithm as the action of reinforcement learning.
5. A flexible production workshop batch flow scheduling method according to claim 4, characterized in that: The crossover operations include: mapping crossover, two-point crossover and linear order crossover; the mutation operations include: multi-point mutation, reverse mutation and insertion mutation.
6. A flexible production workshop batch flow scheduling method according to claim 1, characterized in that: The method for solving the problem in step S4 includes: Step S41: algorithm initialization; Step S42: judging the state of the population based on the population state indicator and state set; Step S43: Calculate the reward value of the population state change according to the population state change and the reward strategy, and update the Q table; Step S44: sequentially executing the secretary bird hunting exploration phase, the secretary bird escape development phase, and the multi-neighborhood dynamic search phase based on reinforcement learning to update the population individuals; Step S45: Calculate the fitness function value and state index of the population; Step S46: Repeat steps S42 to S45 until the iteration ends and output the scheduling plan.
7. 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 6.
8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and the computer program is executed by a processor to implement the method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Flexible job shop scheduling method based on coevolution improved HHO
CN119937493A
Flexible job-shop production scheduling method and apparatus
WO2024022054A1