A solution method for scheduling problems in traditional Chinese medicine production workshops
Through improved heuristic algorithms and active scheduling strategies, the scheduling problem of the traditional Chinese medicine production workshop is optimized, the complexity of reentrable and jumpable processes is solved, and the production efficiency and stability is improved.
Patent Information
- Application Number
- CN202510819571.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-19
- Publication Date
- 2025-08-29
- Estimated Expiration
- 2045-06-19
AI Technical Summary
The prior art is difficult to effectively solve the problem of scheduling of mixed flow workshops that consider reenterable and jumpable processes in traditional Chinese medicine production workshops, resulting in increased production scheduling complexity and low production efficiency.
The improved heuristic algorithm is used to generate the initial solution. By destroying reconstruction and local search optimization, combining active scheduling strategies and critical path analysis, four neighborhood structures are used to optimize the scheduling scheme to generate high-quality scheduling schemes.
It effectively reduces the maximum completion time, improves production efficiency and production line stability, and optimizes the scheduling process of the Chinese patent medicine production workshop.
Smart Images

Figure CN120355180B_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of flow shop scheduling, and in particular to a method for solving scheduling problems in a Chinese patent medicine production workshop. Background Art
[0002] In the traditional Chinese medicine (TCM) manufacturing industry, TCM production workshops are typically arranged in a flow-line format, encompassing multiple processes, each involving one or more parallel machines. This layout is known as a hybrid flow-line workshop. In TCM production, the smallest production unit is the raw material (the workpiece) used to produce a batch of products. The production process can be divided into seven or eight steps: drying, crushing, mixing, granulation, re-drying, capsule filling (optional), polishing, and sterilization. Due to the varying drug types, the same machine requires cleaning after each step to ensure drug purity, incurring cleaning time. Drugs are also transferred between adjacent stages, incurring transfer time. During TCM production, drugs require repeated drying to prepare for the next stage of production. Furthermore, different drug types require different processing steps. For example, capsules require capsule filling, while granules do not. Taking these considerations into account, the TCM production process can be viewed as a hybrid flow-line workshop scheduling problem with both reentrant and skipping capabilities. A reentrant process means that after completing a process, some workpieces need to return to a previous process for reprocessing. A skippable process, on the other hand, means that some processes can be skipped. This means that not all workpieces must pass through all processes sequentially, but rather can be flexibly adjusted based on specific production needs. While this flexibility improves the adaptability of the production line, it also significantly increases the complexity of scheduling.
[0003] However, research has revealed that, unlike traditional hybrid flowshops that only consider dependencies between adjacent stages, hybrid flowshop scheduling problems that consider reentrant and skippable processes require additional processing of process dependencies across multiple stages, which undoubtedly exacerbates the difficulty of solving the problem. Despite significant research progress on hybrid flowshop scheduling, current research largely ignores the impact of reentrant and skippable processes on scheduling strategies, leaving a relatively unexplored area of research on this issue. Therefore, addressing the scheduling optimization challenges presented by these cross-stage process dependencies, determining the allocation of workpieces to machines at each stage and the execution order of workpieces on each machine, thereby minimizing the maximum completion time, has become a key research topic for improving pharmaceutical workshop production efficiency. Summary of the Invention
[0004] The purpose of the present invention is to provide a solution method for the scheduling problem of Chinese patent medicine production workshops, which solves the technical problem that the current research on the scheduling problem of mixed flow workshops considering reentry and jumpability does not conform to the actual Chinese patent medicine production scenario, so as to achieve the purpose of taking the actual production scenario as the research premise, making production scheduling more reasonable, and thus effectively improving production efficiency and the stability of the production line.
[0005] The present invention provides a method for solving the scheduling problem of a Chinese patent medicine production workshop, which is characterized by comprising the following steps:
[0006] S1. Analyze the characteristics of the mixed flow shop scheduling problem in the production of traditional Chinese medicine, determine the problem-solving goal to minimize the maximum completion time, and initialize the parameters, including the damage size of the initial solution. α , destroy the number of reconstruction iterations T ;
[0007] S2. Use the improved heuristic algorithm to construct an initial solution, and then destroy and reconstruct the initial solution. The destruction size is the length of the initial solution multiplied by α , reaching the number of iterations T , select the initial solution with the smallest target value as the optimal initial solution;
[0008] S3. Schedule the current optimal initial solution based on the active scheduling strategy to generate a complete scheduling plan;
[0009] S4. Based on the complete scheduling plan, find the critical path, determine the key blocks that affect the maximum completion time, and the key artifacts contained in the key blocks;
[0010] S5. Adjust the key artifacts in the identified key blocks, define four neighborhood structures based on the reentrant attribute, use the four neighborhood structures for searching, and perform neighborhood structure pruning to output an optimized scheduling solution with a maximum completion time less than the optimal initial solution.
[0011] Furthermore, the implementation process of the improved heuristic algorithm to generate the initial solution includes:
[0012] (a) Define the following parameters, Represents an artifact, Represents a collection of artifacts, , Represents the number of workpieces, Represents the number of times the workpiece appears, with a value of 0 or 1. A value of 0 represents the first appearance of the workpiece, and a value of 1 represents the second appearance of the workpiece. Representative stage, represents a collection of stages, Represents the reentrant phase, Represents the skippable stage, , represents the total number of stages, represents a sequence of artifacts, represents an artifact in a sequence of artifacts, Representative workpiece In the stage Processing time on
[0013] (b) Each workpiece appears twice in the initial solution. Two methods are used to calculate the indicators for each workpiece. For the first-appearing workpiece, the sum of the processing time from the first stage to the reentrant stage is calculated. For the second-appearing workpiece, the sum of the processing time from the reentrant stage to the last stage is calculated. Represents a computational artifact The indicator value is calculated as follows:
[0014] ;
[0015] (c) The indicator value Sort in ascending order, each indicator value corresponds to a workpiece, and thus the corresponding workpiece sequence is obtained ;
[0016] (d) Remove the first two workpieces in π , , then from or Select the smaller target value as the current partial sequence Z ;
[0017] (e) From Starting from the third workpiece in The workpieces, , inserted into the current partial sequence Z All positions in the partial sequences, evaluate each partial sequence obtained, and take the partial sequence with the smallest maximum completion time as Z ;
[0018] (f) Return to step (e) until The process continues until the last workpiece in is inserted and a complete initial solution is obtained.
[0019] Furthermore, the process of destroying and reconstructing the initial solution is as follows:
[0020] (1) The number of random deletions is the length of the initial solution multiplied by α The deleted artifacts are inserted one by one into the sequence of undeleted artifacts middle;
[0021] (2) Each time a workpiece is inserted, the workpiece sequence is The search is performed using a local search method, that is, two adjacent workpieces are swapped in sequence to obtain an improved sequence. The improved sequence with the smallest maximum completion time is used as the optimal partial sequence. The current optimal partial sequence is used when the next workpiece is inserted until all deleted workpieces are inserted, and the optimal initial solution is obtained.
[0022] (3) Steps (1) and (2) are repeated. T After a round of iteration, the optimal initial solution is output.
[0023] Furthermore, the implementation process of constructing a complete scheduling solution includes the following steps:
[0024] Define the following parameters, flag Indicates the number of times the workpiece is processed in the reentrant stage, flag=0 Indicates the first processing, flag=1 Indicates reentrant processing;
[0025] For the first processing, that is flag=0 The workpieces are processed in the order from the first stage to the stage before the reentrant stage. The earliest idle machine is selected for processing. The start time of the workpiece is determined by the larger value of the sum of the completion time of the previous process plus the transfer time and the machine idle time. The end time of the workpiece is the start time plus the processing time of the current stage. The calculation formula is:
[0026] ;
[0027] in, Represents workpiece In the stage The start time of the processing, Indicates workpiece In the stage The end time of the processing, Represents workpiece In the stage To stage The transfer time between Indicates the machine free time, Indicates workpiece In the stage The processing time of the workpiece is completed on the machine. flag Set to 1;
[0028] If the workpiece does not appear for the first time, flag=1, then directly select the idle machine for processing in the reentrant phase and update the start time and end time of the workpiece in the reentrant phase;
[0029] For the subsequent stages of the reentrant stage, a phased active scheduling strategy is used for scheduling. The operation process includes:
[0030] Step 1: Perform stage screening. If the current stage is not a skippable stage or the workpiece does not have the skippable attribute, add it to the candidate sequence. If the current stage is a skippable stage and the workpiece has the skippable attribute, the workpiece does not need to be processed in the current stage. At this time, the end time of the current workpiece in the previous stage is synchronized as the start time and end time of the current stage, and directly used as the start time of the next stage;
[0031] Step 2: Select the earliest idle machine ;
[0032] Step 3: Calculate the start time and end time of each workpiece processed on the selected machine, and update the earliest start time of the workpiece processed on the selected machine. and the latest end time ;
[0033] Step 4, pass 、 and the non-delay factor Determine the effective processing time window, and use the effective processing time window constraint to filter out qualified workpieces and add them to the collection , the formula for calculating the effective processing time window is:
[0034] ;
[0035] Step 5, from the collection Select the workpiece with the longest processing time in the current stage and assign it to the machine On the update artifact Start time and end time , the scheduled workpiece from Remove, clear ;
[0036] Step 6: Return to step 1 until all stages are traversed and a complete scheduling plan is obtained.
[0037] Furthermore, in the production scheduling problem, the critical path refers to the sequence of workpieces that determines the maximum completion time of the entire production process. A critical workpiece refers to a workpiece whose execution time delay will directly lead to an extension of the maximum completion time of the entire scheduling plan, and is located on the critical path; a non-critical workpiece refers to a workpiece whose execution time delay will not directly affect the maximum completion time, and is not on the critical path; a critical block is an indivisible sequence of workpieces consisting of continuous operations on the critical path in the scheduling problem. A critical block appears in a certain section of the critical path, not the entire critical path.
[0038] Furthermore, based on the complete scheduling solution, the implementation process of finding the critical path is as follows: first find the maximum completion time L , traverse each workpiece, if the completion time of the workpiece in the last stage is equal to L , then the workpiece and the stage the artifact is in Record it and search forward from the current workpiece in sequence; if a skippable process is encountered and the current workpiece has the skippable attribute, skip the current stage; if a reentrant process is encountered, search for the key workpiece in the reentrant stage, otherwise search in the previous process; find the processed workpiece Machine , recording machine Find the location of the key workpiece, search for the adjacent workpiece at the current position, and determine whether the following conditions are met:
[0039] Workpiece Start time of the immediately preceding workpiece End time = machine cleaning time
[0040] Artifacts that meet the conditions and the stage Record it, otherwise you need to search across stages to determine whether the following conditions are met:
[0041] Workpiece Start time of the previous stage artifact End time = transfer time
[0042] If the conditions are met, the artifact and the stage Record it until the workpiece that started processing the earliest in the first stage is found. After the above process is completed, the complete critical path is found, and all the key artifacts found and the stages they are in are recorded.
[0043] Furthermore, four neighborhood structures are used for searching, and the scheduling scheme is optimized by the four neighborhood structures. The four neighborhood structures include sequentially executing the destruction and reconstruction of key artifacts and non-key artifacts within the key block, internal exchange within the key block, internal exchange within the key block, and exchange between two points within and outside the key block. The current neighborhood structure is used for searching. If the target value of the new initial solution is smaller than the original optimal initial solution, then the original optimal initial solution is updated to the new initial solution. If after executing the current neighborhood structure, no new initial solution smaller than the original optimal initial solution is obtained, then the next neighborhood structure is sequentially used as the current neighborhood structure until all neighborhood structures cannot update the current optimal initial solution, and the optimal initial solution after the search is output, wherein,
[0044] Destructive reconstruction of key and non-key artifacts within the key block, extracting the key artifacts in the optimal initial solution, and then reinserting each key artifact into all positions in the sequence composed of the remaining non-key artifacts;
[0045] Internal exchange of key blocks: select a key artifact from the key block of the optimal initial solution, and then select another key artifact from the key block for exchange;
[0046] In-and-out exchange of key blocks, a key workpiece is selected from the key block of the optimal initial solution, and then a non-key workpiece is selected from outside the key block for exchange;
[0047] To exchange two points inside and outside the key block, first select a key workpiece inside the key block that appears for the first time in the optimal initial solution and a non-key workpiece outside the key block that appears for the first time in the optimal initial solution, exchange the two, and then locate the second appearance positions of the two in the optimal initial solution, and synchronously exchange the second appearance position of the key workpiece and the second appearance position of the non-key workpiece.
[0048] Furthermore, the neighborhood structure pruning process includes:
[0049] For the destruction and reconstruction of key and non-key workpieces in a key block, after each insertion operation, it is determined whether the inserted key workpiece and the workpiece at the adjacent position are the same workpiece. If they are the same workpiece, no subsequent operations are performed and the next position is searched for to perform the insertion operation. If the adjacent positions after insertion are not the same workpiece, the maximum completion time of the sequence of inserted workpieces is calculated and the insertion position that minimizes the maximum completion time is retained until all key workpieces are inserted. The scheduling plan that minimizes the target value is retained.
[0050] For internal exchange within a critical block, exchange between inside and outside a critical block, and exchange between two points inside and outside a critical block, traverse the initial solution to determine the location of the critical workpiece. In the same way, find the position of the next critical workpiece or non-critical workpiece in the initial solution and perform the exchange operation. If the workpieces in adjacent positions after the exchange are the same workpiece, it is an invalid exchange and no subsequent operation is required. If they are not the same workpiece, calculate the maximum completion time after the exchange, and retain the scheduling plan that minimizes the target value.
[0051] The present invention provides a solution method for the scheduling problem of a Chinese patent medicine production workshop. In order to cope with the cross-stage process dependency challenge of a pharmaceutical workshop, an optimization method based on a heuristic framework is innovatively proposed. An improved heuristic algorithm is designed to generate a high-quality initial solution, and a phased active scheduling strategy is used for scheduling to obtain a complete scheduling solution. In addition, by performing critical path search, the key workpieces in the identified key blocks are adjusted, and the scheduling solution is updated by searching and cutting four neighborhood structures to achieve local optimization. In summary, the application of the present invention can effectively solve the scheduling problem of a Chinese patent medicine production workshop. By optimizing the machine selection of workpieces at each stage and the sequence of workpieces on each machine during the scheduling process of Chinese patent medicine production, the target value can be continuously reduced, which has the positive effect of effectively improving production efficiency and the stability of the production line. BRIEF DESCRIPTION OF THE DRAWINGS
[0052] Figure 1 Flowchart for the implementation of the present invention;
[0053] Figure 2 This is a flow chart of the active scheduling strategy of the present invention;
[0054] Figure 3 A flowchart of the destruction and reconstruction of key workpieces and non-key workpieces in a key block of the present invention;
[0055] Figure 4 The single-factor variance analysis diagram of the present invention and the existing comparative algorithms under large-scale calculation examples;
[0056] Figure 5 Violin plots of the present invention and existing comparison algorithms under large-scale examples. DETAILED DESCRIPTION
[0057] like Figure 1-Figure 3 As shown, the method for solving the scheduling problem of a Chinese patent medicine production workshop provided by the present invention is mainly implemented through the following steps.
[0058] S1: Analyze the characteristics of the mixed flow shop scheduling problem in the production of traditional Chinese medicine, determine the problem solution objective to minimize the maximum completion time, and initialize the parameters, including the damage size of the initial solution α, destroy the number of reconstruction iterations T .
[0059] S2: Use the improved heuristic algorithm to construct an initial solution, which is achieved through the following process.
[0060] (a) Define the following parameters, Represents an artifact, Represents a collection of artifacts, , Represents the number of workpieces, Represents the number of times the workpiece appears, with a value of 0 or 1. A value of 0 represents the first appearance of the workpiece, and a value of 1 represents the second appearance of the workpiece. Representative stage, represents a collection of stages, Represents the reentrant phase, Represents the skippable stage, , represents the total number of stages, represents a sequence of artifacts, represents an artifact in a sequence of artifacts, Representative workpiece In the stage Processing time on
[0061] (b) Each workpiece appears twice in the initial solution. Two methods are used to calculate the indicators for each workpiece. For the first-appearing workpiece, the sum of the processing time from the first stage to the reentrant stage is calculated. For the second-appearing workpiece, the sum of the processing time from the reentrant stage to the last stage is calculated. Represents a computational artifact The indicator value is calculated as follows:
[0062] ;
[0063] (c) The indicator value Sort in ascending order, each indicator value corresponds to a workpiece, and thus the corresponding workpiece sequence is obtained ;
[0064] (d) Remove the first two workpieces in π , , then from or Select the smaller target value as the current partial sequence Z ;
[0065] (e) From Starting from the third workpiece, take out The workpieces, , inserted into the current partial sequence Z All positions in the partial sequences, evaluate each partial sequence obtained, and take the partial sequence with the smallest maximum completion time as Z ;
[0066] (f) Return to step (e) until The process continues until the last workpiece in is inserted and a complete initial solution is obtained.
[0067] Then the initial solution is destroyed and reconstructed, and the size of the destruction is the length of the initial solution multiplied by α , reaching the number of iterations T , select the initial solution with the smallest target value as the optimal initial solution. The process of destroying and reconstructing the initial solution is achieved through the following steps.
[0068] (1) The number of random deletions is the length of the initial solution multiplied by α The deleted artifacts are inserted one by one into the sequence of undeleted artifacts middle.
[0069] (2) Each time a workpiece is inserted, the workpiece sequence is The search is performed through a local search method, that is, two workpieces in adjacent positions are exchanged in turn to obtain an improved sequence. The improved sequence with the smallest maximum completion time is used as the optimal partial sequence, and the current optimal partial sequence is used when the next workpiece is inserted until all deleted workpieces are inserted and the optimal initial solution is obtained.
[0070] (3) Perform steps (1) and (2) T After a round of iteration, the optimal initial solution is output.
[0071] S3: Based on the active scheduling strategy, the current optimal initial solution is scheduled to generate a complete scheduling solution. The implementation process includes the following steps:
[0072] Define the following parameters, flag Indicates the number of times the workpiece is processed in the reentrant stage, flag=0 Indicates the first processing, flag=1 Indicates reentrant processing;
[0073] For the first processing, flag=0 The workpieces are processed in the order from the first stage to the stage before the reentrant stage. The earliest idle machine is selected for processing. The start time of the workpiece is determined by the larger value of the sum of the completion time of the previous process plus the transfer time and the machine idle time. The end time of the workpiece is the start time plus the processing time of the current stage. The calculation formula is:
[0074] ;
[0075] in, Indicates workpiece In the stage The start time of the processing, Indicates workpiece In the stage The end time of the processing, Indicates workpiece In the stage To stage The transfer time between Indicates the machine free time, Indicates workpiece In the stage The processing time of the workpiece is completed on the machine. flag Set to 1;
[0076] If the workpiece does not appear for the first time, flag= 1, then directly select the idle machine for processing in the reentrant phase and update the start time and end time of the workpiece in the reentrant phase;
[0077] For the subsequent stages of the reentrant stage, a phased active scheduling strategy is used for scheduling. The operation process includes:
[0078] Step 1: Perform stage screening. If the current stage is not a skippable stage or the workpiece does not have the skippable attribute, add it to the candidate sequence. If the current stage is a skippable stage and the workpiece has the skippable attribute, the workpiece does not need to be processed in the current stage. At this time, the end time of the current workpiece in the previous stage is synchronized as the start time and end time of the current stage, and directly used as the start time of the next stage.
[0079] Step 2: Select the earliest idle machine .
[0080] Step 3: Calculate the start time and end time of each workpiece processed on the selected machine, and update the earliest start time of the workpiece processed on the selected machine. and the latest end time .
[0081] Step 4, pass 、 and the non-delay factor Determine the effective processing time window, and use the effective processing time window constraint to filter out qualified workpieces and add them to the collection , the formula for calculating the effective processing time window is:
[0082] ;
[0083] Step 5, from the collection Select the workpiece with the longest processing time in the current stage and assign it to the machine On the update artifact Start time and end time , the scheduled workpiece from Remove, clear .
[0084] Step 6: Return to step 1 until all stages are traversed and a complete scheduling plan is obtained.
[0085] S4: Based on the complete scheduling plan, find the critical path and determine the key blocks that affect the maximum completion time and the key artifacts contained in the key blocks. The implementation process of finding the critical path is as follows: First, find the maximum completion time L , traverse each workpiece, if the completion time of the workpiece in the last stage is equal to L , then the workpiece and the stage the artifact is in Record it and search forward from the current workpiece in sequence; if a skippable process is encountered and the current workpiece has the skippable attribute, skip the current stage; if a reentrant process is encountered, search for the key workpiece in the reentrant stage, otherwise search in the previous process; find the processed workpiece Machine , recording machine Find the location of the key workpiece, search for the adjacent workpiece at the current position, and determine whether the following conditions are met:
[0086] Workpiece Start time of the immediately preceding workpiece End time = machine cleaning time
[0087] Artifacts that meet the conditions and the stage Record it, otherwise you need to search across stages to determine whether the following conditions are met:
[0088] Workpiece Start time of the previous stage artifact End time = transfer time
[0089] If the conditions are met, the artifact and the stage Record it until the workpiece that started processing the earliest in the first stage is found. After the above process is completed, the complete critical path is found, and all the key artifacts found and the stages they are in are recorded.
[0090] S5: Adjust the key artifacts in the identified key blocks, define four neighborhood structures based on the reentrant attribute, use the four neighborhood structures for searching, and optimize the scheduling scheme through the four neighborhood structures. The four neighborhood structures include the sequential execution of the destruction and reconstruction of key artifacts and non-key artifacts in the key block, the internal exchange of the key block, the internal and external exchange of the key block, and the exchange of two points inside and outside the key block. Use the current neighborhood structure for searching. If the target value of the new initial solution is smaller than the original optimal initial solution, then the original optimal initial solution is updated to the new initial solution. If after executing the current neighborhood structure, no new initial solution smaller than the original optimal initial solution is obtained, then the next neighborhood structure is sequentially used as the current neighborhood structure until all neighborhood structures cannot update the current optimal initial solution. The optimal initial solution after the search is output, where,
[0091] The first neighborhood structure is: destructive reconstruction of key artifacts and non-key artifacts within the key block, extracting the key artifacts in the optimal initial solution, and then reinserting each key artifact into all positions in the sequence composed of the remaining non-key artifacts.
[0092] The second neighborhood structure is: internal exchange within the key block, selecting a key artifact from the key block of the optimal initial solution, and then selecting another key artifact from the key block for exchange.
[0093] The third neighborhood structure is: exchanging inside and outside the key block. A key artifact is selected from the key block of the optimal initial solution, and then a non-key artifact is selected from outside the key block for exchange.
[0094] The fourth neighborhood structure is: exchanging two points inside and outside the key block. First, a key artifact inside the key block that appears for the first time in the optimal initial solution and a non-key artifact outside the key block that appears for the first time in the optimal initial solution are selected, and the two are exchanged. Then, the positions where the two appear for the second time in the optimal initial solution are located, and the second appearance position of the key artifact and the second appearance position of the non-key artifact are synchronously exchanged.
[0095] Then, neighborhood structure pruning is performed to output an optimized scheduling solution whose maximum completion time is less than the optimal initial solution. The process of neighborhood structure pruning is as follows:
[0096] For the destruction and reconstruction of key and non-key workpieces in the key block, after each insertion operation, determine whether the inserted key workpiece and the workpiece in the adjacent position are the same workpiece. If they are the same workpiece, no subsequent operations will be performed, and continue to look for the next position to perform the insertion operation. If the adjacent positions are not the same workpiece after insertion, calculate the maximum completion time of the sequence of inserted workpieces, and retain the insertion position that minimizes the maximum completion time until all key workpieces are inserted, and retain the scheduling plan that minimizes the target value.
[0097] For internal exchange within the key block, exchange between inside and outside the key block, and exchange between two points inside and outside the key block, traverse the initial solution to determine the location of the key workpiece. In the same way, find the position of the next key workpiece or non-key workpiece in the initial solution and perform the exchange operation. If the workpieces in adjacent positions after the exchange are the same workpiece, it is an invalid exchange and no subsequent operation is required; if they are not the same workpiece, calculate the maximum completion time after the exchange, and retain the scheduling plan that minimizes the target value.
[0098] In order to better demonstrate the effectiveness of the present invention, the present invention will be further described below through experimental analysis of a series of examples of the present invention.
[0099] The test data includes 400 large-scale instances based on the parameters 、 and machine layout. For large-scale instances, , The workpiece processing time is evenly distributed in the range of [50 ~ 200], the machine cleaning time is evenly distributed in the range of [10 ~ 20], and the workpiece transfer time is evenly distributed in the range of [5 ~ 15]. In order to simulate the actual workshop situation, four different types of machine layouts are considered, as shown below:
[0100] Type 1: In the production workshop, there are three machines in the first stage and two machines in the other stages.
[0101] Type 2: In the production workshop, there is one machine in the middle stage and three machines in the other stages.
[0102] Type 3: In the production workshop, there are two machines in the middle stage and three machines in the other stages.
[0103] Type 4: In the production workshop, there are three machines at each stage.
[0104] To evaluate the performance of the algorithm, each instance was run independently 10 times, and the overall average relative percentage growth (AVG) and running time (Time) were calculated as evaluation criteria.
[0105] In terms of parameter setting, in order to better solve and optimize the mixed flow workshop group scheduling problem based on Chinese patent medicine production, the current destruction size Set to 0.7 to destroy the number of reconstruction iterations Set to 4, no delay factor Set to 0.5.
[0106] The experimental results and analysis of this embodiment are as follows. After setting the parameters of the algorithm (CP-CPS) for solving the scheduling problem of a mixed flow shop based on the production of traditional Chinese medicine of the present invention, an experimental comparison was conducted with the existing improved genetic algorithm (CAGA), improved meme algorithm (IMA) and improved heuristic algorithm (NEH2E). In order to adapt these algorithms to the problems to be solved, necessary modifications need to be made, including the use of a unified instance and the adoption of the same target total processing time. During the adaptive process, the details of each original algorithm are followed. Finally, the comparison results of the overall average relative percentage growth value and the running time are recorded, as shown in Table 1:
[0107] Table 1 Average relative percentage growth (AVG) and running time of each algorithm under large-scale examples
[0108]
[0109] As can be seen from Table 1, in terms of solution quality, the CP-CPS algorithm of the present invention achieved the optimal AVG value in the vast majority of cases. CAGA achieved the optimal AVG value in the 40×12 and 80×5 cases, and IMA achieved the optimal AVG value in the 40×5, 40×10, and 100×8 cases. This shows that under certain conditions, the CAGA and IMA algorithms perform better, while NEH2E's solution effect is inferior to CP-CPS in every case. In terms of time efficiency, for each case, CAGA and IMA generally take longer than CP-CPS. Although NEH2E has a certain advantage in time, its solution effect is far inferior to CP-CPS. In summary, the CP-CPS of the present invention obtains higher-quality solutions at a controllable time cost.
[0110] Figure 4The figure is a one-way analysis of variance diagram of the present invention and the existing comparative algorithms under a large-scale example, which clearly shows the hierarchical differences in the performance of the present invention and the existing comparative algorithms. The CP-CPS of the present invention is in the best position with the lowest mean and the smallest error range, showing excellent stability and effectiveness. The means of CAGA and IMA are at a medium level, but the error bars of both are long, indicating that there are obvious abnormal extreme values in these two sets of data and the data are not stable enough. The mean of NEH2E is higher than that of CP-CPS, and the error range is larger, indicating that the results are more volatile. In summary, the CP-CPS of the present invention is superior to the comparative algorithms in terms of optimization effect and stability.
[0111] Figure 5 The following are violin plots of the present invention and existing comparison algorithms for a large-scale example. These plots demonstrate the performance distribution of each algorithm based on the AVG metric. CP-CPS has a clear advantage: it has the lowest median and the narrowest distribution range, with data highly concentrated in the median region, indicating low data volatility. Among the comparison algorithms, CAGA and IMA have lower medians but a wider distribution range, and the IMA algorithm has a more prominent neck, indicating the presence of some extreme values in the dataset. In summary, the CP-CPS algorithm outperforms other algorithms in terms of data concentration.
[0112] In summary, the CP-CPS algorithm of this invention performs exceptionally well, successfully solving complex scheduling problems involving reentrancy and jumpability in hybrid flow shops. Experiments demonstrate that CP-CPS's low volatility and rapid response precisely meet the pharmaceutical industry's core requirements for scheduling system stability and real-time performance. The application of this invention provides innovative solutions and practical support for solving cross-stage scheduling challenges. This application lays the foundation for future research and practical applications in the scheduling field, offering a viable approach to improving efficiency and reducing costs.
Claims
1. A method for solving the scheduling problem of a Chinese patent medicine production workshop, characterized in that: The following steps are included: S1. Analyze the characteristics of the mixed flow shop scheduling problem in the production of traditional Chinese medicine, determine the problem solution objective to be minimization of the maximum completion time, and initialize the parameters, including the destruction coefficient α for the initial solution and the number of destruction and reconstruction iterations T; S2. Use the improved heuristic algorithm to construct an initial solution, then destroy and reconstruct the initial solution. The destruction size is the length of the initial solution multiplied by α, and the number of iterations T is reached. The initial solution with the smallest target value is selected as the optimal initial solution; where, The implementation process of the improved heuristic algorithm to generate the initial solution includes: (a) Define the following parameters: i represents an artifact, I represents the set of artifacts, I = {1, 2, ..., i, ..., c}, c represents the number of artifacts, n represents the number of times an artifact appears, and takes the value 0 or 1. When the value is 0, it represents the first appearance of the artifact, and when the value is 1, it represents the second appearance of the artifact, s represents the stage, S represents the set of stages, r represents the reentrant stage, t represents the skippable stage, S = {1, 2, ..., s, ..., k}, k represents the total number of stages, Π represents the sequence of artifacts, π represents an artifact in the sequence of artifacts, and P s,i represents the processing time of workpiece i at stage s; (b) Each workpiece appears twice in the initial solution. Two methods are used to calculate the index for each workpiece. For the first-appearing workpiece, the sum of the processing time from the first stage to the reentrant stage is calculated. For the second-appearing workpiece, the sum of the processing time from the reentrant stage to the last stage is calculated. K i,n Represents the index value of the calculated workpiece i, and the calculation formula is, (c) The index value K i,n Sort by order from small to large, each indicator value corresponds to a workpiece, thus obtaining the corresponding workpiece sequence Π={π1,π2,…,π 2c }; (d) Take the first two artifacts π1, π2 in π, and then select the one with the smaller target value from {π1, π2} or {π2, π1} as the current partial sequence Z; (e) Starting from the third workpiece in Π, take the i-th workpiece in Π in sequence, where i > 3, and insert it into all positions in the current partial sequence Z, obtaining a total of i partial sequences. Evaluate each of the obtained partial sequences and take the partial sequence with the minimum maximum completion time as Z; (f) Return to step (e) until the last workpiece in Π is inserted and a complete initial solution is obtained; The process of destructive reconstruction of the initial solution is as follows: (1) Randomly delete the number of artifacts equal to the length of the initial solution multiplied by α, and insert the deleted artifacts one by one into the sequence Π' consisting of the undeleted artifacts; (2) Each time a workpiece is inserted, the workpiece sequence Π' is searched using a local search method, that is, two workpieces in adjacent positions are exchanged in sequence to obtain an improved sequence. The improved sequence with the smallest maximum completion time is used as the optimal partial sequence, and the current optimal partial sequence is used when the next workpiece is inserted until all deleted workpieces are inserted and the optimal initial solution is obtained; (3) Iterate steps (1) and (2) for T rounds and output the optimal initial solution; S3. Schedule the current optimal initial solution based on the active scheduling strategy to generate a complete scheduling plan; wherein, the implementation process of constructing a complete scheduling plan includes the following steps: Define the following parameters: flag indicates the number of times the workpiece is processed in the reentrant stage. flag = 0 indicates the first processing, and flag = 1 indicates reentrant processing. For the first processing, that is, flag = 0, the workpiece is processed in the order from the first stage to the stage before the reentrant stage. The earliest idle machine is selected for processing. The start time of the workpiece is determined by the larger value of the sum of the completion time of the previous process and the transfer time, and the idle time of the machine. The end time of the workpiece is the start time plus the processing time of the current stage. The calculation formula is: S s,i =max[(E s-1 ,i+f s-1,i )or(Idle m )] E s,i =S s,i +p s,i Among them, S s,i represents the start time of processing of workpiece i at stage s, E s-1 ,i represents the end time of workpiece i in stage s-1, f s-1,i represents the transfer time of workpiece i between stage s-1 and stage s, Idle m represents the idle time of machine m, p s,i It represents the processing time of workpiece i in stage s. After the workpiece is processed on the machine, the flag is set to 1; If the workpiece does not appear for the first time, that is, flag = 1, then the idle machine is directly selected for processing in the reentrant phase, and the start time and end time of the workpiece in the reentrant phase are updated; For the subsequent stages of the reentrant stage, a phased active scheduling strategy is used for scheduling. The operation process includes: Step 1: Perform stage screening. If the current stage is not a skippable stage or the workpiece does not have the skippable attribute, it is added to the candidate sequence π'. If the current stage is a skippable stage and the workpiece has the skippable attribute, the workpiece does not need to be processed in the current stage. At this time, the end time of the current workpiece in the previous stage is synchronized as the start and end time of the current stage, and directly used as the start time of the next stage; Step 2: Select the earliest idle machine m; Step 3, calculate the start time and end time of each workpiece processed on the selected machine, and update the earliest start time ESTime and the latest end time LETime of the workpiece processed on the selected machine; Step 4: Determine the effective processing time window using ESTime, LETime, and the non-delay factor θ. Use the effective processing time window constraint to select qualified workpieces and add them to the set ScheduleSet. The formula for calculating the effective processing time window is: ScheduledSet←θ·(LETime-ESTime)+ESTime; Step 5: Select the workpiece with the longest processing time in the current stage from the set ScheduleSet and assign it to machine M*, and update the start time S of workpiece i. s,i and end time E s,i , remove the scheduled workpiece i from π' and clear ScheduleSet; Step 6: Return to step 1 until all stages are traversed and a complete scheduling plan is obtained; S4. Based on the complete scheduling plan, find the critical path, determine the key blocks that affect the maximum completion time, and the key artifacts contained in the key blocks; S5. Adjust the key artifacts in the identified key blocks, define four neighborhood structures based on the reentrant attribute, use the four neighborhood structures for searching, and perform neighborhood structure pruning to output an optimized scheduling solution with a maximum completion time less than the optimal initial solution.
2. The method for solving the scheduling problem of a Chinese patent medicine production workshop according to claim 1, characterized in that: In production scheduling problems, the critical path refers to the sequence of workpieces that determines the maximum completion time of the entire production process. A critical workpiece is one whose execution time delay will directly extend the maximum completion time of the entire scheduling plan and is located on the critical path. A non-critical workpiece is one whose execution time delay will not directly affect the maximum completion time and is not on the critical path. A critical block is an indivisible sequence of workpieces consisting of continuous operations on the critical path in a scheduling problem. A critical block appears in a certain section of the critical path, not the entire critical path.
3. The method for solving the scheduling problem of a Chinese patent medicine production workshop according to claim 2, characterized in that: Based on the complete scheduling scheme, the implementation process of finding the critical path is as follows: first find the maximum completion time L, traverse each workpiece, if the completion time of the workpiece in the last stage is equal to L, then record the workpiece i and the stage s where the workpiece is located, and search from the current workpiece in sequence; if a skippable process is encountered and the current workpiece has the skippable attribute, skip the current stage; if a reentrant process is encountered, search for the key workpiece in the reentrant stage, otherwise search in the previous process; find the machine m that processes workpiece i, record the location of the key workpiece on machine m, search for the adjacent workpiece from the current position forward, and determine whether the following conditions are met, The start time of workpiece i - the end time of the immediately preceding workpiece i' = the machine cleaning time. Record the workpiece i' that meets the conditions and the stage s it is in. Otherwise, you need to search across stages to determine whether the following conditions are met: The start time of workpiece i - the end time of workpiece i' in the previous stage = transfer time. If the conditions are met, then record workpiece i' and the stage s it is in until the workpiece that started processing the earliest in the first stage is found. At this time, S s,i =0; After the above process is completed, the complete critical path is found, and all the key artifacts found and the stages they are in are recorded.
4. The method for solving the scheduling problem of a Chinese patent medicine production workshop according to claim 3, characterized in that: Four neighborhood structures are used for searching, and the scheduling scheme is optimized through the four neighborhood structures. The four neighborhood structures include the destruction and reconstruction of key artifacts and non-key artifacts in the key block, internal exchange of the key block, internal and external exchange of the key block, and exchange of two points inside and outside the key block. The current neighborhood structure is used for searching. If the target value of the new initial solution is smaller than the original optimal initial solution, then the original optimal initial solution is updated to the new initial solution. If the new initial solution smaller than the original optimal initial solution is not obtained after executing the current neighborhood structure, the next neighborhood structure is sequentially used as the current neighborhood structure until all neighborhood structures cannot update the current optimal initial solution. The optimal initial solution after the search is output, where Destructive reconstruction of key and non-key artifacts within the key block, extracting the key artifacts in the optimal initial solution, and then reinserting each key artifact into all positions in the sequence composed of the remaining non-key artifacts; Internal exchange of key blocks: select a key artifact from the key block of the optimal initial solution, and then select another key artifact from the key block for exchange; In-and-out exchange of key blocks, a key workpiece is selected from the key block of the optimal initial solution, and then a non-key workpiece is selected from outside the key block for exchange; To exchange two points inside and outside the key block, first select a key workpiece inside the key block that appears for the first time in the optimal initial solution and a non-key workpiece outside the key block that appears for the first time in the optimal initial solution, exchange the two, and then locate the second appearance positions of the two in the optimal initial solution, and synchronously exchange the second appearance position of the key workpiece and the second appearance position of the non-key workpiece.
5. The method for solving the scheduling problem of a Chinese patent medicine production workshop according to claim 4, characterized in that: The process of performing neighborhood structure pruning includes: For the destruction and reconstruction of key and non-key workpieces in a key block, after each insertion operation, it is determined whether the inserted key workpiece and the workpiece at the adjacent position are the same workpiece. If they are the same workpiece, no subsequent operations are performed and the next position is searched for to perform the insertion operation. If the adjacent positions after insertion are not the same workpiece, the maximum completion time of the sequence of inserted workpieces is calculated and the insertion position that minimizes the maximum completion time is retained until all key workpieces are inserted. The scheduling plan that minimizes the target value is retained. For internal exchange within a critical block, exchange between inside and outside a critical block, and exchange between two points inside and outside a critical block, traverse the initial solution to determine the location of the critical workpiece. In the same way, find the position of the next critical workpiece or non-critical workpiece in the initial solution and perform the exchange operation. If the workpieces in adjacent positions after the exchange are the same workpiece, it is an invalid exchange and no subsequent operation is required. If they are not the same workpiece, calculate the maximum completion time after the exchange, and retain the scheduling plan that minimizes the target value.
Citation Information
Patent Citations
Hybrid flow shop scheduling method and system based on neighborhood structure
CN116449780A
Method and device for scheduling job shop
JP1996315028A