A method for optimizing the scheduling of hybrid flow workshops considering periodic preventive maintenance.

By combining the dual-population cooperative artificial bee colony algorithm (DCABC) with the constrained programming (CP) model, the problem of low solution efficiency and easy getting trapped in local optima in the periodic preventive maintenance in the mixed flow shop scheduling problem is solved, and efficient and high-quality scheduling schemes are generated.

CN122134060BActive Publication Date: 2026-07-03LIAOCHENG UNIV

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
LIAOCHENG UNIV
Filing Date
2026-05-06
Publication Date
2026-07-03

Smart Images

  • Figure CN122134060B_ABST
    Figure CN122134060B_ABST
Patent Text Reader

Abstract

This invention belongs to the field of hybrid flow shop scheduling technology in intelligent manufacturing, and particularly relates to a hybrid flow shop scheduling optimization method considering periodic preventive maintenance. The method constructs a DCABC-CP hybrid algorithm that integrates dual-population cooperative artificial bee colony and constraint programming. Through parameter initialization, dual-population hybrid encoding initialization, iterative optimization using hired bees, observer bees, and scout bees, adaptive population cooperation based on Thompson sampling multi-armed slot machine, forward and reverse decoding re-evaluation, and problem-specific local search, when the algorithm reaches 40% of its total execution time, the current optimal solution is imported into the CP model for precise optimization. Finally, it outputs a scheduling scheme that minimizes the maximum completion time while satisfying the periodic preventive maintenance constraint. This invention effectively balances global search and local optimization, enhances the ability to handle maintenance constraints, and significantly outperforms traditional algorithms in terms of solution efficiency and quality, making it suitable for large-scale hybrid flow shop scheduling scenarios.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of hybrid assembly line scheduling technology in intelligent manufacturing, and particularly relates to a hybrid assembly line scheduling optimization method that considers periodic preventive maintenance. Background Technology

[0002] In modern intelligent manufacturing systems, ensuring reliable equipment operation is crucial for maintaining stable production. Integrating preventive maintenance (PM) into production scheduling has become an important means of maintaining equipment availability. The Hybrid Flow Shop Scheduling Problem (HFSP) is a core scheduling problem in intelligent manufacturing systems. The HFSP with Periodic Preventive Maintenance (HFSP-PPM) problem requires inserting periodic preventive maintenance after the equipment's cumulative processing time reaches a fixed threshold. This problem not only needs to consider traditional process sequencing and machine allocation but also maintenance constraints. Among existing methods, Mixed Integer Linear Programming (MILP) and Constraint Programming (CP) models can obtain optimal solutions for small-scale problems through exact search, but their solution efficiency decreases as the problem size increases. While metaheuristic algorithms such as Artificial Bee Colony (ABC) are highly efficient in solving large-scale instances, they are prone to getting trapped in local optima when faced with complex maintenance constraints in HFSP-PPM and lack effective utilization of historical information. In recent years, Deep Reinforcement Learning (DRL) has received widespread attention in the scheduling field. However, DRL typically requires large amounts of training data, complex network structure parameter tuning, and expensive computational resources. Compared to DRL, Multi-Armed Bandit (MAB), as a classic lightweight sequential decision model, achieves a balance between exploration and exploitation, and has advantages such as fewer parameters, lower computational overhead, and ease of ensemble. In the MAB framework, each selectable operator is considered an "arm," and the improvement effect of each arm on the solution quality is dynamically changing. The MAB selector chooses one arm to operate on in each round and observes the feedback of that selection. Common strategies for solving MAB (Multi-Arm Optimization) problems include greedy algorithms, Upper Confidence Bound (UCB), and Thompson Sampling (TS). TS maintains a prior distribution for each arm, typically a Beta distribution. At each decision stage, it samples from the distributions of each arm, selecting the arm with the largest sample value for execution, and updates the distribution parameters based on feedback. This method is widely used in decision and adaptive optimization problems. However, existing research has not fully integrated the global search capability of CP (Combined Optimization), the population collaboration efficiency of ABC (Analog-Based Optimization), and the adaptive learning capability of MAB in the decision-making process.Therefore, there is an urgent need to construct a hybrid intelligent optimization algorithm that can integrate CP, ABC and MAB to efficiently solve the hybrid flow shop scheduling problem with periodic preventive maintenance constraints, thereby improving the quality and efficiency of the solution. Summary of the Invention

[0003] In view of the technical problems existing in the background art, the present invention proposes a method for optimizing the scheduling of a hybrid flow workshop that considers periodic preventive maintenance.

[0004] To achieve the above objectives, the technical solution adopted by the present invention is as follows:

[0005] Step 1: Initialize parameters, set the total population size PS and the number of times the hired bee phase is repeated. Maximum Stagnation Algebra Number of candidate solutions Attenuation rate The total running time t and the maximum number of iterations T;

[0006] Step 2: Population initialization. Initialize two subpopulations, subpopulation 1 and subpopulation 2, with a total population size of PS. Each individual is arranged according to the process. It consists of the flag bit d;

[0007] Step 3, the mercenary bee phase: Each mercenary bee uses the insertion operation to generate a neighborhood solution for the current individual, and then executes... Next, if the completion time of the neighboring solution is smaller, then replace the current individual;

[0008] Step 4, observe the bee stage, select individuals through the tournament, perform the insertion operation to generate a new solution, if the new solution is better than the worst individual at the same flag position in the current population and is not repeated, then replace the worst individual;

[0009] Step 5, scout bee phase, if individuals continuously... If the solution is not improved, it is considered an obsolete solution, and at least two random insertions are performed on that solution. Among the candidate solutions, the best one is selected to replace the original individual;

[0010] Step 6, population cooperation: Every three generations, a cooperation operation based on the Thompson sampling multi-armed slot machine TS-MAB is performed to dynamically select the crossover operator and exchange information between the two subpopulations to generate new individuals.

[0011] Step 7: Re-evaluate. Every three generations, calculate the completion time for each individual in the population using both forward and reverse decoding. Select the better individual, update its flag and fitness, and re-incorporate it into the corresponding subpopulation.

[0012] Step 8, Local Search: Execute a problem-specific local search strategy for each individual task to optimize the processing order when multiple jobs are waiting simultaneously at machine readiness time, thereby improving the quality of the solution.

[0013] Step 9, CP-assisted optimization: When the DCABC running time reaches 40% of the preset total time t, the current optimal solution is used as the initial solution and input into the CP model. The CP model is then used for further optimization until the remaining time is up.

[0014] Step 10: Termination condition check. When the total running time reaches t, output the final solution after CP optimization.

[0015] Preferably, in step 2, the population initialization process is as follows:

[0016] Each individual uses a hybrid representation code, arranged by process steps. The system consists of a flag bit d, where flag bit d indicates the decoding mode: d=0 represents forward decoding, and d=1 represents reverse decoding. A global counter is used. ;

[0017] Generate two high-quality individuals for subpopulation 1: one using the best simple heuristic generation process, with flag d=0; and one using the best NEH heuristic generation process, with flag d=0.

[0018] Generate two high-quality individuals for subpopulation 2: one generated using the best simple heuristic, with flag d=1; and one generated using the best NEH heuristic, with flag d=1.

[0019] Then, if If the value is less than PS, then execute the process in a loop: randomly generate a process sequence. And randomly generate a flag bit. If d=0, then the individual If an individual is placed into subpopulation 1, its process sequence must be different from that of any existing individual in subpopulation 1. If d=1, then it is placed into subpopulation 2, again requiring no repetition. After successful placement... Repeat until .

[0020] Preferably, the specific process of the insertion operation in step 3 is as follows:

[0021] For the current individual's work process arrangement Randomly select two different locations and ,and , will be located in The process is removed, and then it is inserted into the position. At this point, the remaining processes are moved sequentially to maintain their relative order, resulting in a new process arrangement. ;

[0022] Keeping the original individual's flag bit d unchanged, d is calculated using the decoding method. Maximum completion time ,like Then use replace Otherwise, the original individual is retained, and this process is performed sequentially for each individual in the population.

[0023] Preferably, in step 4, during the bee observation phase, the selection of individuals through a tournament uses a binary tournament selection mechanism:

[0024] Two individuals are randomly selected from the current population, their maximum completion time is compared, and the one with the better time is selected as the individual to be operated on.

[0025] Perform the same insertion operation as step 3 on the process arrangement of the individual to be operated on, and generate a new solution. The new solution retains the original individual's flag bit d;

[0026] In the current population, find all individuals with the same flag d, and denote the individual with the longest completion time as d. ;

[0027] like and If the process arrangement is unique to all individuals with the same marker, then use... replace Otherwise, abandon the new solution;

[0028] Repeat this process until all observation bees have completed their operations.

[0029] Preferably, the implementation process of step 5, the scout bee stage, is as follows: the scout bee stage maintains a counter for each individual. Record its continuous unimproved algebra; if a certain entity of Reaching the threshold If it is not a valid solution, then it is considered a discarded solution; the process arrangement for this individual. implement Random insertion operations are performed to generate One candidate solution: Each operation performs at least two consecutive random insertions to obtain a new sequence of steps. Keep the original flag bit d unchanged.

[0030] Preferably, the implementation process of step 6, the population cooperation operation, is as follows:

[0031] Execution is performed every three generations. The Thomson sampling-based multi-armed slot machine TS-MAB dynamically selects the crossover operator. TS-MAB maintains four crossover operators as arms: single-point crossover, two-point crossover, partial mapping crossover PMX, and partial sequential crossover POX.

[0032] Each arm Corresponding to one distributed ,in Recording the history of this operator produces an improved cumulative weighted sum. Record the unimproved cumulative weighted sum;

[0033] In the current generation, for each arm from Sample a value ,choose The largest operator is used as the crossover operator for this generation;

[0034] Randomly select an individual from each of subpopulation 1 and subpopulation 2, denoted as parent1 and parent2, and apply the selected crossover operator to their process arrangement to generate two offspring, child1 and child2;

[0035] The offspring inherit the flag bit of their corresponding parent, that is, child1 inherits the flag bit of parent1, and child2 inherits the flag bit of parent2. The maximum completion time is calculated using the decoding method corresponding to their respective flag bits. If child1 is better than parent1 and does not overlap with an individual in subpopulation 1, then child1 replaces parent1. The same applies to child2 and parent2.

[0036] After each collaboration, a reward value is calculated based on the improvement of the offspring relative to the parent: Introduce attenuation weights: The rewards are weighted by time sequence, giving higher weight to recent rewards. The current iteration number recorded during algorithm runtime. ;

[0037] Update the selected operator Parameters: , .

[0038] As a preferred option, the specific operation steps of each crossover operator are as follows:

[0039] Single-point intersection: Obtain the sequence arrangement of parent1 and parent2, denoted as sequence P1 and P2, and randomly generate an intersection point. The value range is 1≤ ≤ Sequence length - 1; the first generation of child1 Each process is inherited from the previous P1. For each process, the remaining positions are filled according to the relative order of P2 after excluding the selected processes; the child generation child2's preceding... Each process is inherited from P2. For each process, the remaining positions are filled according to the relative order of P1 after removing the selected processes;

[0040] Two-point intersection: Randomly generate two intersection points. and The value range is 1 ≤ < ≤ Sequence length, child1 is located in The operations within a given interval are inherited from the corresponding operations in P2, while the operations at other positions are inherited from the corresponding operations in P1. However, it must be ensured that each operation appears only once in the child generation; if a conflict occurs, it is replaced by an operation not present in P1 in sequence. The operations in child2 are located at... The operations within a range are inherited from the operations at the corresponding positions in P1, and the operations at other positions are inherited from the operations at the corresponding positions in P2, with conflict handling performed in the same way.

[0041] Partial Mapping Cross PMX: Randomly generates two intersection points and Define the middle segment as the exchange region, copy the middle segment of P1 to the corresponding position of child1, and copy the middle segment of P2 to the corresponding position of child2; then for the non-middle segment position in child1, inherit the process from the corresponding position of P1. If the process has already appeared in the middle segment, find the corresponding process according to the mapping relationship between the middle segments of P1 and P2, until the process that has not appeared is mapped; the same applies to child2, and finally two valid children are obtained.

[0042] Partial Sequential Cross-POX: The workpiece set is randomly divided into two non-empty subsets J1 and J2. In child1, the operations belonging to J1 are retained according to their order in P1, and the operations belonging to J2 are filled into the remaining positions according to their order in P2. In child2, the operations belonging to J2 are retained according to their order in P2, and the operations belonging to J1 are filled into the remaining positions according to their order in P1.

[0043] Preferably, the re-evaluation operation in step 7 is implemented as follows:

[0044] The re-evaluation operation is performed every three generations, taking the sequence of steps for each individual in the population. Each uses forward decoding and reverse decoding Calculate the maximum completion time and obtain and ;

[0045] The better one is selected as the new fitness of this individual: And update its flag: Then, based on the updated flag, the individual is reassigned to the corresponding subpopulation: if the flag... If so, then put it into subpopulation 1; if If so, then place it in subpopulation 2.

[0046] Preferably, in step 8, the local search strategy performs the following operations for each individual:

[0047] A complete schedule is generated based on the individual's flag bit d using the corresponding decoding method; according to the processing stage Process them sequentially;

[0048] For the current stage Get the release time of all jobs, i.e. the completion time of the previous stage, and sort them in ascending order by release time;

[0049] For each machine in this phase At each ready time, identify all released and processable job sets. This refers to jobs whose release time is less than or equal to the machine's current ready time.

[0050] Exchange in turn The processing sequence of the tasks is determined, and the current stage and subsequent stages are rescheduled after each exchange. The maximum completion time of the entire scheduling is calculated.

[0051] The current stage's scheduling is updated by selecting the job sequence that minimizes the completion time. This process must ensure that the periodic preventive maintenance constraint is always met. The cumulative processing time of the machine is dynamically checked when scheduling jobs. If the cumulative time exceeds PMTime after adding a job, a periodic preventive maintenance with a duration of PM must be inserted first. The cumulative time is reset after maintenance.

[0052] After performing the above optimization on all stages in sequence, the optimized complete schedule is obtained. If the maximum completion time of an individual after the local search is better than that of the original individual, then the individual is replaced; otherwise, the original individual is retained.

[0053] Preferably, in step 9, the CP model includes constraints on the sequence of work processes, the span of maintenance groups, the sequence of machine maintenance groups, the processing sequence within a group, the cumulative time of maintenance groups, and the allocation of processing activities.

[0054] Compared with the prior art, the advantages and positive effects of the present invention are as follows:

[0055] 1. This invention proposes a novel hybrid algorithm, DCABC-CP, which combines the dual-population cooperative artificial bee colony algorithm (DCABC) and the constraint programming (CP) model. First, DCABC's efficient global search capability is used to quickly obtain a high-quality initial solution. Then, the precise constraint reasoning capability of the CP model is used for further optimization, effectively expanding the solution space and improving the quality of the solution, thereby obtaining a scheduling scheme with a smaller maximum completion time.

[0056] 2. In this invention, the DCABC algorithm adopts a dual-population structure. By using the Thompson Sampling Multi-Armed Slot Machine (TS-MAB) strategy, it adaptively selects the crossover operator to achieve information interaction between the populations, thus avoiding the complex training and parameter tuning process required by deep reinforcement learning methods. At the same time, a problem-specific local search mechanism is designed to optimize the processing order when multiple jobs are waiting at the machine ready time, which significantly enhances the algorithm's local search capability and convergence speed.

[0057] 3. This invention constructs a CP model suitable for the periodic preventive maintenance hybrid flow shop scheduling problem (HFSP-PPM). Through dynamic maintenance group division mechanism and interval variable modeling, it can intuitively express the relationship between maintenance constraints and production scheduling. Compared with the MILP model, the CP model has higher solution efficiency and stronger constraint handling capability when solving problems of the same scale. Attached Figure Description

[0058] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the following description of the embodiments will be briefly introduced. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0059] Figure 1 This is a flowchart illustrating the implementation of the DCABC-CP algorithm of the present invention. Figure 2 This is an individual coding diagram of the present invention; Figure 3 This is a decoding diagram of the present invention; Figure 4 This is a flowchart illustrating the implementation of the Thompson sampling multi-arm slot machine (TS-MAB) of the present invention. Figure 5 This is a partial search example diagram of the present invention; Figure 6 This is an example diagram illustrating the conversion of the DCABC solution of the present invention into the initial solution of the CP model; Figure 7 This is a trend graph of the parameter levels of the present invention; Figure 8 Box plot comparing the DCABC algorithm of this invention with seven other variant algorithms using AV_RPI; Figure 9Box plot comparing the AV_RPI of the proposed DCABC-CP algorithm with the CP model, DCABC algorithm, MPMA-QL algorithm and TLSS algorithm on Cmax; Figure 10 Box plot showing the AV_RPI comparison of the proposed DCABC-CP algorithm with the DCABC algorithm, MPMA-QL algorithm and TLSS algorithm on AV. Detailed Implementation

[0060] To better understand the above-mentioned objectives, features, and advantages of the present invention, the present invention will be further described below in conjunction with the accompanying drawings and embodiments. It should be noted that, unless otherwise specified, the embodiments and features described in these embodiments can be combined with each other.

[0061] Numerous specific details are set forth in the following description in order to provide a full understanding of the invention. However, the invention may also be practiced in other ways than those described herein, and therefore the invention is not limited to the specific embodiments disclosed in the following specification.

[0062] Examples, such as Figure 1 As shown, this embodiment of the invention provides an optimization method for scheduling of a hybrid flow workshop that considers periodic preventive maintenance, which is mainly achieved through the following process.

[0063] Step 1: Initialize parameters, set the total population size PS and the number of times the hired bee phase is repeated. Maximum Stagnation Algebra Number of candidate solutions Attenuation rate The total running time t and the maximum number of iterations T.

[0064] Step 2, Population Initialization: Initialize two subpopulations, namely subpopulation 1 and subpopulation 2, according to the mixed representation encoding method. The total population size is PS. Each individual is arranged according to the process. The flag bit d is denoted as Individual codes such as Figure 2 As shown. The process arrangement is as follows. This represents a full permutation of all tasks, indicating the processing sequence of tasks at each stage. The flag 'd' indicates the decoding method: d=0 represents forward decoding, and d=1 represents reverse decoding. During decoding, regardless of whether forward or reverse decoding is used, periodic preventative maintenance constraints must be considered at each stage: when the machine's cumulative processing time reaches the PMTime threshold, a periodic preventative maintenance period of PM duration must be inserted. Forward decoding arranges processing from front to back according to the process sequence, while reverse decoding arranges processing from the last stage forward to seek better machine utilization. The decoding diagram is shown below. Figure 3As shown in the diagram, this example illustrates a processing procedure with two stages and four operations. Each stage has two machines, and the initial sequence is... PMTime is 8, PM is 1, the processing times for Stage 0 are 4, 5, 5, 6 respectively, and the processing times for Stage 1 are 5, 6, 4, 5 respectively.

[0065] Specifically, the population initialization process is as follows: Let a global counter be used. First, generate two high-quality individuals for subpopulation 1: one generated using the optimal simple heuristic with flag d=0; the other generated using the optimal NEH heuristic with flag d=0. Similarly, generate two high-quality individuals for subpopulation 2: one generated using the optimal simple heuristic with flag d=1; the other generated using the optimal NEH heuristic with flag d=1. Then, if... Less than Then, the process is executed in a loop: a randomized process arrangement is generated. And randomly generate a flag bit. If d=0, then the individual If an individual is added to subpopulation 1, its process sequence must be distinct from that of any existing individual in subpopulation 1. If d=1, then it is added to subpopulation 2, again requiring no repetition. After successful addition... Repeat until .

[0066] Step 3, the bee-hiring stage, involves arranging the work processes for the current individual. Randomly select two different locations and ,and , will be located in The process is removed, and then it is inserted into the position. At this point, the remaining processes are moved sequentially to maintain their relative order, resulting in a new process arrangement. Keeping the original individual's flag bit d unchanged, d is calculated using the decoding method. Maximum completion time ,like Then use replace Otherwise, the original individual is retained, and this process is performed sequentially for each individual in the population.

[0067] Step 4, Observe the bees during the bee observation phase, and use a binary tournament selection mechanism: randomly select two individuals from the current population, compare their maximum completion time, and select the one with the better time as the individual to be operated on; perform the same insertion operation as in Step 3 on the process arrangement of the individual to be operated on, generating a new solution. The new solution retains the original individual's flag bit d; in the current population, find all individuals with the same flag bit d, and denote the individual with the largest maximum completion time as... ;like and If the process arrangement is unique to all individuals with the same marker, then use... replace Otherwise, abandon the new solution; repeat the process until all observation bees have completed their operations.

[0068] Step 5, scout bee phase, if individuals continuously... If the solution is not improved, it is considered an obsolete solution, and at least two random insertions are performed on that solution. Among several candidate solutions, the best one is selected to replace the original individual. Specifically, during the scout bee phase, a counter is maintained for each individual. Record its continuous unimproved algebra; if a certain entity of Reaching the threshold If it is not a valid solution, then it is considered a discarded solution; the process arrangement for this individual. implement Random insertion operations are performed to generate One candidate solution: Each operation performs at least two consecutive random insertions to obtain a new sequence of steps. Keep the original flag d unchanged. Calculate the maximum completion time of all candidate solutions and select the optimal one. .like Then use Replace the original individual, and Reset to 0; otherwise, retain the original individual. Continue to accumulate.

[0069] Step 6, Population Cooperation: Every three generations, a cooperation operation based on Thompson's Multi-Armed Sampling Machine (TS-MAB) is performed to dynamically select a crossover operator to exchange information between two subpopulations to generate new individuals. For example... Figure 4 As shown, this invention employs TS-MAB to achieve adaptive cooperation between two populations. TS-MAB maintains four crossover operators as arms: single-point crossover, two-point crossover, partial mapping crossover (PMX), and partial sequential crossover (POX); each arm... Corresponding to one distributed ,in Recording the history of this operator produces an improved cumulative weighted sum. Record the unimproved cumulative weighted sum. In the current generation, for each arm... from Sample a value ,choose The largest operator is used as the crossover operator for this generation. Then, an individual is randomly selected from subpopulation 1 and subpopulation 2, denoted as parent1 and parent2. The selected crossover operator is applied to their process arrangement to generate two offspring, child1 and child2. Each offspring inherits the flag bit of its corresponding parent; that is, child1 inherits the flag bit of parent1, and child2 inherits the flag bit of parent2. The maximum completion time is calculated using the decoding method corresponding to their respective flag bits. If child1 is better than parent1 and does not overlap with an individual in subpopulation 1, then child1 replaces parent1. The same applies to child2 and parent2. After each collaboration, the reward value is calculated based on the improvement of the offspring relative to the parent. Introduce attenuation weights: The rewards are weighted by time sequence, giving higher weight to recent rewards. The current iteration number recorded during algorithm runtime. Update the selected operator Parameters: , .

[0070] Specifically, the specific operation steps of each crossover operator are as follows: Single-point crossover: Obtain the process arrangement of parent1 and parent2, denoted as sequence P1 and P2, and randomly generate a crossover point position. The value range is 1≤ ≤ Sequence length - 1; the first generation of child1 Each process is inherited from the previous P1. For each process, the remaining positions are filled according to the relative order of P2 after excluding the selected processes; the child generation child2's preceding... Each process is inherited from P2. For each process, the remaining positions are filled in the relative order after removing the selected processes in P1.

[0071] Two-point intersection: Randomly generate two intersection points. and The value range is 1 ≤ < ≤ Sequence length, child1 is located in The operations within a given interval are inherited from the corresponding operations in P2, while the operations at other positions are inherited from the corresponding operations in P1. However, it must be ensured that each operation appears only once in the child generation; if a conflict occurs, it is replaced by an operation not present in P1 in sequence. The operations in child2 are located at... The operations within a range are inherited from the corresponding operations in P1, and the operations in other positions are inherited from the corresponding operations in P2, with conflict handling performed in the same way.

[0072] Partial Mapping Cross PMX: Randomly generates two intersection points and Define the middle segment as the exchange region, copy the middle segment of P1 to the corresponding position of child1, and copy the middle segment of P2 to the corresponding position of child2; then for the non-middle segment position in child1, inherit the process from the corresponding position of P1. If the process has already appeared in the middle segment, find the corresponding process according to the mapping relationship between the middle segments of P1 and P2, until the process that has not appeared is mapped; the same applies to child2, and finally two valid children are obtained.

[0073] Partial Sequential Cross-POX: The workpiece set is randomly divided into two non-empty subsets J1 and J2. In child1, the operations belonging to J1 are retained according to their order in P1, and the operations belonging to J2 are filled into the remaining positions according to their order in P2. In child2, the operations belonging to J2 are retained according to their order in P2, and the operations belonging to J1 are filled into the remaining positions according to their order in P1.

[0074] Step 7: Re-evaluate. Every three generations, calculate the completion time for each individual in the population using both forward and backward decoding. Select the individual with the better completion time, update its flag and fitness, and re-incorporate it into the corresponding subpopulation. Specifically, the re-evaluation operation is performed every three generations. For each individual in the population, its completion time is calculated in sequence. Each uses forward decoding and reverse decoding Calculate the maximum completion time and obtain and The better candidate is selected as the new fitness level for that individual. And update its flag: Then, based on the updated flag, the individual is reassigned to the corresponding subpopulation: if the flag... If so, then put it into subpopulation 1; if If so, then place it in subpopulation 2.

[0075] Step 8, Local Search: For each individual task, a problem-specific local search strategy is executed to optimize the processing order when multiple jobs are waiting simultaneously at machine readiness time, further improving the quality of the solution. For example... Figure 5 The example described uses two phases and five jobs, with two machines in each phase, and the initial sequence is as follows. With PMTime set to 8 and PM set to 1, the processing times for Stage 0 are 5, 4, 7, 3, and 1, respectively, while those for Stage 1 are 7, 6, 2, 1, and 5. As shown in the diagram, when machine M0 in Stage 1 finishes processing job 1, jobs 3 and 4 are already ready. Therefore, swapping their processing order can improve the overall scheduling. Specifically, this is done first based on the individual flag bits... A complete schedule is generated using the corresponding decoding method. Then, it is processed according to the following stages: Process sequentially. For the current stage s, obtain the release time of all jobs, i.e., the completion time of the previous stage, and sort them in ascending order of release time. For each machine m in this stage, at each of its ready times, identify the set of all released and processable jobs. This refers to jobs whose release time is less than or equal to the machine's current ready time. Generating neighborhood solutions: sequentially swap... The processing sequence of tasks is determined, and the current stage and subsequent stages are rescheduled after each swap. The maximum completion time of the entire schedule is calculated. The task sequence that minimizes the completion time is selected to update the current stage's schedule. This process must ensure that the periodic preventive maintenance constraint is always satisfied. When scheduling tasks, the cumulative processing time of the machine is dynamically checked. If the cumulative time exceeds PMTime after adding a task, a periodic preventive maintenance with a duration of PM must be inserted first, and the cumulative time is reset after maintenance. After performing the above optimization on all stages in sequence, the optimized complete schedule is obtained. If the maximum completion time of an individual after the local search is better than that of the original individual, it is replaced; otherwise, the original individual is retained.

[0076] Step 9, CP-assisted optimization: When the DCABC runtime reaches 40% of the preset total time t, the current optimal solution is used as the initial solution and input into the CP model for further optimization until the remaining time runs out. The process of converting the DCABC solution into the CP model initial solution is as follows: Figure 6 As shown. Figure 6 The left side shows the optimal scheduling Gantt chart obtained from DCABC, and the right side shows an example of variable assignment in the corresponding CP model: process start time via... Settings, maintenance group start time via The settings and mapping between jobs and machine groups are configured through... Settings, final call The complete solution is passed into the CP model. The CP model contains the following set of constraints:

[0077] (1)

[0078] (2)

[0079] (3)

[0080] (4)

[0081] (5)

[0082] (6)

[0083] The variables in the CP model include, Indicates the job index; Indicates the total number of assignments; Represents a set of jobs. ; Indicates the stage index; Indicates the total number of stages; Represents a set of stages. ; This represents the set of stages excluding the final stage. ; Indicates machine index; Indicates the total number of machines; Represents a set of machines. ; For the maintenance group index; Maximum number of repair groups: ; Assemble the repair team. ; This represents the processing time of task j in stage s; PM represents the duration of periodic preventive maintenance; PMTime represents the cumulative processing time threshold for triggering periodic preventive maintenance. The number of maintenance teams required for stage s is dynamically calculated as follows: ; Let be an interval variable, representing the processing activities of job j in stage s; This is an optional interval variable. If job j is processed on maintenance g of machine m in stage s, then this variable exists. is an optional interval variable, representing the time span of maintenance group g on machine m, which is aggregated from all processing activities within the group; This is a sequence variable used to represent the order of all processing activities within stage s, machine m, and maintenance group g; This is a sequence variable used to represent the order of all maintenance groups on machine m, and to force the insertion of maintenance intervals between groups.

[0084] Constraint set (1) is the work process sequence constraint, function: Ensure that the start time of the next processing activity is no earlier than the end time of the previous processing activity in each adjacent stage, thereby guaranteeing the process route of the operation.

[0085] Constraint set (2) is the maintenance group span constraint, function: Aggregate all processing activities within the same machine and the same maintenance group into a continuous interval variable. This interval covers the time period from the start of the first activity in the group to the end of the last activity, representing the work blocks that are performed consecutively between two periodic preventive maintenance operations.

[0086] Constraint set (3) is the sequence constraint for the machine repair group, function: Ensure that different maintenance groups on the same machine are executed sequentially, and force maintenance intervals of PM between adjacent maintenance groups to simulate machine unavailability during periodic preventative maintenance.

[0087] Constraint set (4) is the intra-group processing sequence constraint, function: Ensure that all processing activities within the same stage, on the same machine, and in the same maintenance group do not overlap; that is, at any given time, a machine can only process one job.

[0088] Constraint set (5) is the cumulative time constraint for the maintenance group, function: The total processing time of all operations within each maintenance group is limited to a preset threshold PMTime. Once the accumulated processing time reaches this threshold, a periodic preventive maintenance must be inserted after the group, and the accumulated time is reset after the maintenance.

[0089] Constraint set (6) assigns constraints to processing activities, function: Each stage of each task requires processing activities. It must be executed on a maintenance group g assigned to a machine m, i.e., from all available options. One of them is selected, thus establishing a logical connection between job-level operations and machine-maintenance group-level operations.

[0090] Step 10: Termination condition check. When the total running time reaches t, output the final solution after CP model optimization, including process sequencing, machine allocation, periodic preventive maintenance arrangement and corresponding maximum completion time.

[0091] The present invention will be further described and illustrated below through specific examples.

[0092] This invention runs on a computer equipped with an Intel® Core™ i7-10th Gen CPU (2.10 GHz) and 16 GB of RAM. The DCABC algorithm is implemented in C++ using Visual Studio 2022, and the CP model is supported by the IBM CPLEX StudioIDE 22.1.1 solver. The total runtime t is set to... seconds, of which The total number of machines. This represents the total number of jobs. The DCABC runtime in the DCABC-CP algorithm is: seconds, CP runtime is Seconds. All comparison algorithms are executed independently 10 times on each instance to ensure the robustness of the results.

[0093] This invention constructs 74 HFSP-PPM test instances of different scales and characteristics, numbered 0-73, following the test instance generation method proposed by Fernandez-Viagas and Framinan. Each instance includes a number of jobs, stages, and machine configurations covering different scenarios from small to large scale, to comprehensively verify the effectiveness of the algorithm. For each parameter in the DCABC-CP algorithm, candidate values ​​are: , , , , The optimal parameters are determined by using a parameter horizontal trend graph, as shown in the figure. Figure 7 As shown, each parameter is evaluated based on the average maximum completion time, and the optimal parameter configuration is ultimately determined as follows: , =20、 =50、 =30、 =0.1. Total running time The maximum number of iterations, T, is dynamically estimated based on the initial running speed of the algorithm. The specific method is as follows: After the algorithm starts, the first three generations are executed first, and the total running time of these three generations is recorded. and the number of iterations completed =3. Therefore, the estimated average running time per generation is: Then, the number of iterations that can be completed in the remaining time is estimated to obtain an approximate value for the maximum number of iterations T: .in This indicates rounding down to the nearest integer.

[0094] First, the effectiveness of the CP model was verified. The comparison results of the existing mixed integer linear programming model (MILP model) and constrained programming model (CP model) are shown in Table 1.

[0095] Table 1: Comparison Results of MILP Model and CP Model

[0096]

[0097] In Table 1, “NB,” “NC,” and “NCT” represent the number of binary decision variables, continuous decision variables, and constraints, respectively; “NV” represents the number of interval decision variables in the CP model; “Gap” represents the deviation from the optimal solution, with a value of 0 indicating that the optimal solution has been found; “Cmax” represents the solution found within the time limit; and “Time” represents the CPU time, which does not exceed the time limit if the optimal solution is found, otherwise it equals the time limit. Table 1 shows that as the instance size increases, NB, NC, and NCT in the MILP model and NV and NCT in the CP model all increase significantly. The MILP model obtained the optimal solution for instances 0-3, but failed to find a feasible solution within the time limit for instances 28 and 30. In contrast, the CP model obtained feasible solutions for all instances and also obtained the optimal solution for instances 0-3, with a faster solution speed than the MILP model. For the remaining instances, the CP model achieved a better maximum completion time than the MILP model. In conclusion, the CP model outperforms the MILP model in solving the HFSP-PPM problem.

[0098] To verify the effectiveness of the improved strategy in the DCABC algorithm, ablation experiments were conducted. Table 2 shows the DCABC algorithm compared with seven other algorithm variants, with the checkmark indicating ( The ) indicates that this strategy is included, and the cross () () indicates that it is not included. The DCABC algorithm is compared with seven other algorithm variants, and the results are shown in Table 3.

[0099] Table 2: Detailed description of the DCABC algorithm and seven other algorithm variants

[0100]

[0101] Table 3: Comparison results of DCABC algorithm with seven other algorithm variants

[0102]

[0103]

[0104] In Table 3, AV_RPI represents the average relative percentage increment; a lower value indicates better algorithm performance. Table 3 shows that compared to the baseline ABC-N algorithm, all single-strategy variants (ABC-D, ABC-P, ABC-L) achieved better or equal solutions on most instances, validating the effectiveness of the dual-population, population cooperation, and local search strategies. Variants combining two strategies (ABC-DP, ABC-DL, ABC-PL) further improved performance. Finally, the DCABC algorithm integrating three strategies achieved the lowest AV_RPI value of 0.16 and obtained optimal solutions on multiple instances, including instances 37, 42, 57, and 68. The box plot comparing the AV_RPI of the DCABC algorithm of this invention with seven other variant algorithms is shown below. Figure 8 As shown in the box plot, the upper boundary line of the data distribution range represents the maximum value (upper band), the lower boundary line represents the minimum value (lower band), the horizontal line inside the box represents the median, and "+" indicates outliers. The box plot clearly shows that the DCABC algorithm corresponds to the most compact box and the most concentrated data distribution, indicating that the DCABC algorithm, which integrates three strategies, outperforms other variants in both robustness and effectiveness. To demonstrate the effectiveness of the CP-assisted optimization method of this invention, the CP model-assisted DCABC algorithm (DCABC-CP) and the DCABC algorithm were compared. Furthermore, to verify the effectiveness of the DCABC-CP algorithm, two relatively new methods were compared: a multi-population meme algorithm based on Q-learning (MPMA-QL) and a two-stage learning distributed search algorithm (TLSS). The comparison results are shown in Table 4.

[0105] Table 4: Comparison results of CP, DCABC-CP, DCABC, MPMA-QL and TLSS in HFSP-PPM

[0106]

[0107]

[0108] For MPMA-QL, the population size is set to 100, the learning rate of the Q-learning agent is set to 0.3, the discount factor is set to 0.8, and the initial exploration rate is set to 0.2, which gradually decreases during the search process. For TLSS, the reference set size, global search probability, weight values, and number of breaches are set to 20, 0.8, 0.7, and 5, respectively.

[0109] In Table 4, "Cmax" represents the optimal solution across 10 independent runs, and "AV" represents the average value across the 10 runs. AV_RPI represents the average relative percentage increment. Table 4 shows that the DCABC-CP algorithm achieves the optimal Cmax value on 70 instances and the optimal AV value on 63 instances, significantly outperforming other compared algorithms. The DCABC-CP algorithm outperforms the DCABC algorithm on 37 instances and the CP model on 61 instances. Figure 9 and Figure 10 Box plots comparing the AV_RPI of the DCABC-CP algorithm with the CP model, DCABC algorithm, MPMA-QL algorithm, and TLSS algorithm in Cmax and AV are presented. The figures show that the DCABC-CP algorithm performs best in AV_RPI for both Cmax and AV, with lower median and variance values ​​than the other algorithms. This indicates that its generated solutions are of high quality and reliable. Other algorithms, including DCABC, MPMA-QL, and TLSS, show relatively weaker performance.

[0110] In summary, the CP model, DCABC algorithm, and DCABC-CP algorithm are effective methods for solving HFSP-PPM. The CP model, through interval variables and a dynamic maintenance group partitioning mechanism, can accurately express the relationship between maintenance constraints and production scheduling. The DCABC algorithm adopts a dual-population structure and achieves efficient global and local search through a population cooperation strategy based on Thompson's Sampled Multi-Armed Machine (TS-MAB) and a problem-specific local search mechanism. The DCABC-CP hybrid algorithm combines the efficient solution capability of DCABC with the precise constraint optimization capability of the CP model, further improving the quality of the solution.

[0111] The above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention in any other way. Any person skilled in the art may make changes or modifications to the above-disclosed technical content to create equivalent embodiments for application in other fields. However, any simple modifications, equivalent changes, and modifications made to the above embodiments based on the technical essence of the present invention without departing from the scope of the present invention shall still fall within the protection scope of the present invention.

Claims

1. A method for optimizing the scheduling of a hybrid flow shop considering periodic preventive maintenance, characterized in that, Includes the following steps: Step 1: Initialize parameters, set the total population size PS and the number of times the hired bee phase is repeated. Maximum stagnation algebra Number of candidate solutions Attenuation rate The total running time t and the maximum number of iterations T; Step 2: Population initialization. Initialize two subpopulations, subpopulation 1 and subpopulation 2, with a total population size of PS. Each individual is arranged according to the process. It consists of the flag bit d; Step 3, the mercenary bee phase: Each mercenary bee uses the insertion operation to generate a neighborhood solution for the current individual, and then executes... Next, if the completion time of the neighboring solution is smaller, then replace the current individual; Step 4, observe the bee stage, select individuals through the tournament, perform the insertion operation to generate a new solution, if the new solution is better than the worst individual at the same flag position in the current population and is not repeated, then replace the worst individual; Step 5, scout bee phase, if individuals continuously... If the solution is not improved, it is considered an obsolete solution, and at least two random insertions are performed on that solution. Among the candidate solutions, the best one is selected to replace the original individual; Step 6, population cooperation: Every three generations, a cooperation operation based on the Thompson sampling multi-armed slot machine TS-MAB is performed to dynamically select the crossover operator and exchange information between the two subpopulations to generate new individuals. Step 7: Re-evaluate. Every three generations, calculate the completion time for each individual in the population using both forward and reverse decoding. Select the better individual, update its flag and fitness, and re-incorporate it into the corresponding subpopulation. Step 8, Local Search: Execute a problem-specific local search strategy for each individual task to optimize the processing order when multiple jobs are waiting simultaneously at machine readiness time, thereby improving the quality of the solution. Step 9, CP-assisted optimization: When the DCABC running time reaches 40% of the preset total time t, the current optimal solution is used as the initial solution and input into the CP model. The CP model is then used for further optimization until the remaining time is up. Step 10: Termination condition check. When the total running time reaches t, output the final solution after CP optimization.

2. The method for optimizing the scheduling of a hybrid flow workshop considering periodic preventive maintenance as described in claim 1, characterized in that, In step 2, the population initialization process is as follows: Each individual uses a hybrid representation code, arranged by process steps. The system consists of a flag bit d, where flag bit d indicates the decoding mode: d=0 represents forward decoding, and d=1 represents reverse decoding. A global counter is used. ; Generate two high-quality individuals for subpopulation 1: one using the best simple heuristic generation process, with flag d=0; and one using the best NEH heuristic generation process, with flag d=0. Generate two high-quality individuals for subpopulation 2: one generated using the best simple heuristic, with flag d=1; and one generated using the best NEH heuristic, with flag d=1. Then, if If the value is less than PS, then execute the process in a loop: randomly generate a process sequence. And randomly generate a flag bit. ; If d=0, then the individual If an individual is placed into subpopulation 1, its process sequence must be different from that of any existing individual in subpopulation 1. If d=1, then it is placed into subpopulation 2, again requiring no repetition. After successful placement... Repeat until .

3. The method for optimizing the scheduling of a hybrid flow workshop considering periodic preventive maintenance as described in claim 1, characterized in that, The specific process of the insertion operation in step 3 is as follows: For the current individual's work process arrangement Randomly select two different locations and ,and , will be located in Remove the process and then insert it into the position. At this point, the remaining processes are moved sequentially to maintain their relative order, resulting in a new process arrangement. ; Keeping the original individual's flag bit d unchanged, d is calculated using the decoding method. Maximum completion time ,like Then use replace ; Otherwise, the original individual is retained, and this process is performed sequentially for each individual in the population.

4. The method for optimizing the scheduling of a hybrid flow workshop considering periodic preventive maintenance as described in claim 1, characterized in that, In step 4, during the bee observation phase, the selection of individuals through a tournament uses a binary tournament selection mechanism: Two individuals are randomly selected from the current population, their maximum completion time is compared, and the one with the better time is selected as the individual to be operated on. Perform the same insertion operation as step 3 on the process arrangement of the individual to be operated on, and generate a new solution. The new solution retains the original individual's flag bit d; In the current population, find all individuals with the same flag d, and denote the individual with the longest completion time as d. ; like and If the process arrangement is unique to all individuals with the same marker, then use... replace Otherwise, abandon the new solution; Repeat this process until all observation bees have completed their operations.

5. The method for optimizing the scheduling of a hybrid flow workshop considering periodic preventive maintenance according to claim 1, characterized in that, The implementation process of step 5, the scout bee phase, is as follows: the scout bee phase maintains a counter for each individual. Record its continuous unimproved algebra; if a certain entity of Reaching the threshold If it is not a valid solution, then it is considered a discarded solution; the process arrangement for this individual. implement Random insertion operations are performed to generate One candidate solution: Each operation performs at least two consecutive random insertions to obtain a new sequence of steps. Keep the original flag bit d unchanged.

6. The method for optimizing the scheduling of a hybrid flow workshop considering periodic preventive maintenance according to claim 1, characterized in that, The implementation process of the population cooperation operation in step 6 is as follows: Execution is performed every three generations. The Thomson sampling-based multi-armed slot machine TS-MAB dynamically selects the crossover operator. TS-MAB maintains four crossover operators as arms: single-point crossover, two-point crossover, partial mapping crossover PMX, and partial sequential crossover POX. Each arm Corresponding to one distributed ,in Recording the history of this operator produces an improved cumulative weighted sum. Record the unimproved cumulative weighted sum; In the current generation, for each arm from Sample a value ,choose The largest operator is used as the crossover operator for this generation; Randomly select an individual from each of subpopulation 1 and subpopulation 2, denoted as parent1 and parent2, and apply the selected crossover operator to their process arrangement to generate two offspring, child1 and child2; The offspring inherit the flag bit of their corresponding parent, that is, child1 inherits the flag bit of parent1, and child2 inherits the flag bit of parent2. The maximum completion time is calculated using the decoding method corresponding to their respective flag bits. If child1 is better than parent1 and does not overlap with an individual in subpopulation 1, then child1 replaces parent1. The same applies to child2 and parent2. After each collaboration, a reward value is calculated based on the improvement of the offspring relative to the parent: Introduce attenuation weights: The rewards are weighted by time sequence, giving higher weight to recent rewards. The current iteration number recorded during algorithm runtime. ; Update the selected operator Parameters: , .

7. The method for optimizing the scheduling of a hybrid flow workshop considering periodic preventive maintenance according to claim 6, characterized in that, The specific operation steps of each crossover operator are as follows: Single-point intersection: Obtain the sequence arrangement of parent1 and parent2, denoted as sequence P1 and P2, and randomly generate an intersection point. The value range is 1≤ ≤ Sequence length - 1; the first generation of child1 Each process is inherited from the previous P1. For each process, the remaining positions are filled according to the relative order of P2 after excluding the selected processes; the child generation child2's preceding... Each process is inherited from P2. For each process, the remaining positions are filled according to the relative order of P1 after removing the selected processes; Two-point intersection: Randomly generate two intersection points. and The value range is 1 ≤ < ≤ Sequence length, child1 is located in The operations within a given interval are inherited from the corresponding operations in P2, while the operations at other positions are inherited from the corresponding operations in P1. However, it must be ensured that each operation appears only once in the child generation; if a conflict occurs, it is replaced by an operation not present in P1 in sequence. The operations in child2 are located at... The operations within a range are inherited from the operations at the corresponding positions in P1, and the operations at other positions are inherited from the operations at the corresponding positions in P2, with conflict handling performed in the same way. Partial Mapping Cross PMX: Randomly generates two intersection points and Define the middle segment as the exchange region, copy the middle segment of P1 to the corresponding position of child1, and copy the middle segment of P2 to the corresponding position of child2; then for the non-middle segment position in child1, inherit the process from the corresponding position of P1. If the process has already appeared in the middle segment, find the corresponding process according to the mapping relationship between the middle segments of P1 and P2, until the process that has not appeared is mapped; the same applies to child2, and finally two valid children are obtained. Partial Sequential Cross-POX: The workpiece set is randomly divided into two non-empty subsets J1 and J2. In child1, the operations belonging to J1 are retained according to their order in P1, and the operations belonging to J2 are filled into the remaining positions according to their order in P2. In child2, the operations belonging to J2 are retained according to their order in P2, and the operations belonging to J1 are filled into the remaining positions according to their order in P1.

8. The method for optimizing the scheduling of a hybrid flow workshop considering periodic preventive maintenance according to claim 1, characterized in that, The process of re-evaluating the operation in step 7 is as follows: The re-evaluation operation is performed every three generations, taking the sequence of steps for each individual in the population. Each uses forward decoding and reverse decoding Calculate the maximum completion time and obtain and ; The better one is selected as the new fitness of this individual: And update its flag: Then, based on the updated flag, the individual is reassigned to the corresponding subpopulation: if the flag... If so, then put it into subpopulation 1; if If so, then place it in subpopulation 2.

9. The method for optimizing the scheduling of a hybrid flow workshop considering periodic preventive maintenance as described in claim 1, characterized in that, In step 8, the local search strategy performs the following operations for each individual: A complete schedule is generated based on the individual's flag bit d using the corresponding decoding method; according to the processing stage Process them sequentially; For the current stage Get the release time of all jobs, i.e. the completion time of the previous stage, and sort them in ascending order by release time; For each machine in this phase At each ready time, identify all released and processable job sets. This refers to jobs whose release time is less than or equal to the machine's current ready time. Exchange in turn The processing sequence of the tasks is determined, and the current stage and subsequent stages are rescheduled after each exchange. The maximum completion time of the entire scheduling is calculated. The current stage's scheduling is updated by selecting the job sequence that minimizes the completion time. This process must ensure that the periodic preventive maintenance constraint is always met. The cumulative processing time of the machine is dynamically checked when scheduling jobs. If the cumulative time exceeds PMTime after adding a job, a periodic preventive maintenance with a duration of PM must be inserted first. The cumulative time is reset after maintenance. After performing the above optimization on all stages in sequence, the optimized complete schedule is obtained. If the maximum completion time of an individual after the local search is better than that of the original individual, then the individual is replaced; otherwise, the original individual is retained.

10. The method for optimizing the scheduling of a hybrid flow workshop considering periodic preventive maintenance according to claim 1, characterized in that, In step 9, the CP model includes work process sequence constraints, maintenance group span constraints, machine maintenance group sequence constraints, intra-group processing sequence constraints, maintenance group cumulative time constraints, and processing activity allocation constraints.