Production Scheduling Method and System Based on Simplified Particle Swarm Optimization Algorithm
By simplifying the setting of particle swarm algorithm and cost constraints, the problem of lack of rationality in the scheduling method is solved, ensuring rationality and production efficiency within the cost constraints.
Patent Information
- Application Number
- CN202210965092.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-12
- Publication Date
- 2025-07-22
- Estimated Expiration
- 2042-08-12
AI Technical Summary
The existing production scheduling methods lack rationality when considering the cost of machine usage, resulting in a difference between the output scheduling plan and the actual production situation of the enterprise, and cannot meet the rationality requirements of cost constraints.
The production scheduling method based on a simplified particle swarm algorithm is adopted, and the lower limit and upper limit of machine usage cost is set and repair operations are introduced in the optimization model to ensure that the output scheduling scheme is reasonable within the cost constraint.
Under cost constraints, the output scheduling plan is achieved more reasonable, meets the actual production needs of the enterprise, and improves production efficiency and customer satisfaction.
Smart Images

Figure CN115577898B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of production scheduling, and in particular to a production scheduling method and system based on a simplified particle swarm optimization algorithm. Background Art
[0002] Production scheduling is the work of organizing and executing the production schedule. At present, some research takes the machine usage cost as the optimization goal, but a more realistic situation is that the production arrangement of an enterprise needs to not exceed a certain cost, and then consider optimizing the scheduling goal. That is to say, the machine usage cost is taken as a constraint condition, and the production arrangement that does not meet the cost constraint cannot be used as the final plan. Very few studies take the machine usage cost as a constraint condition, but simply place all workpieces on the machine with the minimum cost and the machine with the maximum cost as the lower limit and upper limit of the cost, so the given cost constraint is too loose.
[0003] Whether taking the machine usage cost as the optimization goal or the cost constraint being too loose, there are differences from the actual production situation of enterprises, and the finally output scheduling plan lacks rationality. Summary of the Invention
[0004] (1) Technical Problems to be Solved
[0005] Aiming at the deficiencies of the prior art, the present invention provides a production scheduling method and system based on a simplified particle swarm optimization algorithm, and solves the technical problem that the existing production scheduling method lacks rationality.
[0006] (2) Technical Solutions
[0007] To achieve the above object, the present invention is realized through the following technical solutions:
[0008] In a first aspect, the present invention provides a production scheduling method based on a simplified particle swarm optimization algorithm, and the production scheduling method includes:
[0009] S1. Obtain job data and machine data, where the job data includes a set of n jobs and the processing duration of each workpiece; the machine data includes a set of m machines and the processing cost per unit time of each machine;
[0010] S2. Determine the lower cost bound and the upper cost bound based on the job data and the machine data, including:
[0011] Place all jobs on the machine with the minimum cost to obtain the lower cost bound U ;
[0012] The method for determining the upper cost bound includes:
[0013] c1. Given the machine set M = M1, M2,..., M m, set the sorting of the machines to be non - decreasing according to the unit processing cost, and arrange the n jobs in non - decreasing order of processing time to form an ordered list, that is, p1 ≤ p2 ≤ … ≤ p n ;
[0014] c2. Take the first job from the ordered list, assign it to the earliest available machine, and at the same time delete this job from the ordered list. Repeat this step until all jobs in the ordered list are assigned;
[0015] c3. By swapping the workpiece sets on the machines, make the machine with a smaller cost have a larger final completion time, and obtain the cost - upper - bound scheduling arrangement. At this time represents the final processing completion time of the i - th machine;
[0016] c4. Calculate the total cost of all machines in the cost - upper - bound scheduling arrangement, which is the cost upper bound
[0017] S3. Obtain the cost budget When , then all jobs are placed on the machine with the smallest cost. When , then take the cost - upper - bound scheduling arrangement as the scheduling plan. When , then execute step S4;
[0018] S4. Construct an optimization model with the goal of minimizing the total completion time of all jobs, and solve the optimization model through a simplified particle swarm algorithm with a repair operation to obtain the scheduling plan. Among them, the repair operation means that when the cost of the output solution of the simplified particle swarm algorithm is higher than the cost upper bound, adjust the output solution until the cost of the output solution is lower than the cost upper bound. The adjustment process includes: inserting the first processing job on the last machine used into an adjacent machine with a smaller cost.
[0019] The optimization model includes an objective function and constraint conditions:
[0020] Among them, the objective function is:
[0021]
[0022] The constraint conditions include:
[0023]
[0024]
[0025]
[0026]
[0027]
[0028]
[0029] Among them, Equation (1) is the objective function, that is, to minimize the total completion time of all jobs;
[0030] Equation (2) ensures that each job can only be processed once;
[0031] Equation (3) means that at most one job can be processed at a certain position on the machine;
[0032] Equation (4) means that the total usage cost of the machine cannot exceed the cost budget;
[0033] Equations (5) and (6) define the completion time of the job processed at the k-th position of the M i -th machine;
[0034] Equation (7) means that the decision variable is a binary 0-1 variable;
[0035] C ik represents the completion time of the workpiece processed at the k-th position of the i-th machine; p j represents the processing duration of job J j ; where i = 1, …, m, j = 1, …, n, k = 1, …, n.
[0036] Preferably, the S4 specifically includes:
[0037] S401. Initialize the population size N, the maximum number of iterations G, the penalty factor r, and the parameters C w 、C p 、C g , randomly generate N n-dimensional particles, each dimension represents the job numbered by this dimension, and the value on the dimension represents the processing machine number where the job of this dimension is located;
[0038] S402. Decode each particle in the initial population, and design a fitness function based on the optimization model. Calculate the fitness value of each decoded particle in the population, including:
[0039]
[0040] Among them, represents the fitness value; represents the total completion time of all jobs; r is the penalty factor, represents the particle The cost actually used in the scheduling scheme represented; when comparing two different particles, discard the solution with a larger fitness value and retain the solution with a smaller fitness value;
[0041] S403. Update the local optimal value of each particle;
[0042] S404. Update the global optimal value of all particles in each generation;
[0043] S405. Determine whether t < G holds. If so, execute step S406; otherwise, execute S408;
[0044] S406. Update the particle position;
[0045] S407. Update the local optimal solution and the global optimal solution of the population in the t-th generation according to the updated particle position, and return to S405;
[0046] S408. Perform a repair operation on gBest G for repair;
[0047] S409. Perform a local search on the repaired gBest G ;
[0048] S410. Output the gBest G after local search as the scheduling scheme.
[0049] Preferably, the repair operation specifically includes:
[0050] a1: Calculate the machine usage cost U(gBest G ) of the scheduling scheme gBest G ;
[0051] a2: If then go to a3; otherwise, go to a12;
[0052] a3: Let γ = 0, x = m;
[0053] a4: If then let γ = x and go to a6; otherwise, go to a5;
[0054] a5: Let x = x - 1 and go to a4;
[0055] a6: Let s = 1;
[0056] a7: If l γ = l γ-s and s < γ, then go to a8; otherwise, go to a9;
[0057] a8: Let s = s + 1 and go to a7;
[0058] a9: MJ γ = MJ γ {MJ γ [0]}, where MJ γ [0] represents the first job to be processed on the γ-th machine;
[0059] a10: MJ γ-s = MJ γ-s ∪{MJ γ [0]}, arrange the jobs in MJ γ-s according to the SPT rule to obtain the updated scheduling scheme gBest G′ ;
[0060] a11: Let gBest G = gBest G′ , go to a2;
[0061] a12: Output gBest G .
[0062] Preferably, in step S402, the decoding of each particle in the initial population includes:
[0063] Arrange the jobs on each machine according to the SPT rule;
[0064] Calculate the total processing duration of each machine
[0065] Exchange the workpiece sets on the machines until for any two machines, the total completion time of the machine with lower cost must be no less than that of the machine with higher cost, obtain the machine number where the job is currently located, and generate a new particle
[0066] According to the new particle Update the original particle
[0067] Preferably, the S403 specifically includes:
[0068] For the particle k in the t-th generation, its local optimal solution is updated according to the following formula:
[0069]
[0070] where, represents the fitness value of the local optimal solution of this particle in the (t - 1)-th generation;
[0071] The S404 specifically includes:
[0072] For all particles in the t-th generation, its global optimal solution gBestt It is updated according to the following formula:
[0073]
[0074] where, represents the fitness value of the global optimal solution of all particles in the (t - 1)-th generation population;
[0075] The fitness value of the local optimal solution of a certain particle in the t-th generation population.
[0076] Preferably, the S409 specifically includes:
[0077] b1: Let t = T0 and u = 0;
[0078] b2: If t > T min , go to b3; otherwise go to b16;
[0079] b3: Perform a movement operation on the repaired gBest G to obtain a new scheduling plan gBest G ;
[0080] b4: Calculate the machine cost U(gBest G′ ) and the fitness value F(gBest G′ ) used by the scheduling plan gBest G′ ;
[0081] b5: If it satisfies and F(gBest G′ ) ≤ F(gBest G ), go to b7; otherwise go to b6;
[0082] b6: Discard the generated scheduling plan gBest G′ , go to b8;
[0083] b7: Let gBest G = gBest G′ , and u = u + 1;
[0084] b8: Calculate the value of p N according to the sigmoid function;
[0085] b9: Generate a random number η ∈ (0, 1). If η ≤ p N , go to b10; otherwise go to b15;
[0086] b10: Perform a movement operation on gBest G to obtain a new scheduling plan gBest G ;
[0087] b11: Calculate the scheduling scheme gBest G′ The machine cost U(gBest G′ ) and fitness value F(gBest G′ ) used;
[0088] b12: If is satisfied and F(gBest G′ ) ≤ F(gBest G ), go to b14; otherwise go to b13;
[0089] b13: Discard the generated scheduling scheme gBest G′ , go to b15;
[0090] b14: Let gBest G = gBest G′ , u = u + 1;
[0091] b15: Let t = t * θ, go to b2;
[0092] b16: Output gBest G ;
[0093] Wherein, T0 represents the initial temperature, T min represents the termination temperature, and θ represents the temperature reduction rate.
[0094] In a second aspect, the present invention provides a production scheduling system based on a simplified particle swarm algorithm, including:
[0095] A data acquisition module for performing step S1 to acquire job data and machine data, where the job data includes a set J = J1, J2,..., J n of n jobs, the processing duration p j of job J j , and the machine data is a set M = M1, M2,..., M m of m machines. It is set that the machines are sorted in non-decreasing order according to the unit processing cost; the unit time processing cost l i of the i-th machine;
[0096] A cost boundary determination module for performing step S2 to determine a cost lower bound and a cost upper bound based on the job data and the machine data, including:
[0097] Placing all jobs on the machine with the minimum cost to obtain the cost lower bound;
[0098] Determine the cost upper bound The average method includes:
[0099] c1. Given the machine set M = M1, M2,..., Mm , set the sorting of the machines to be non-decreasing according to the unit processing cost, and arrange the n jobs in a non-decreasing order of processing time to form an ordered list, that is, p1 ≤ p2 ≤ … ≤ p n ;
[0100] c2. Take the first job from the ordered list, assign it to the earliest available machine, and at the same time delete this job from the ordered list. Repeat this step until all the jobs in the ordered list are assigned;
[0101] c3. By swapping the workpiece sets on the machines, make the machine with a smaller cost have a larger final completion time, and obtain the cost upper bound scheduling arrangement. At this time represents the final processing completion time of the i-th machine;
[0102] c4. Calculate the total cost of all machines in the cost upper bound scheduling arrangement, which is the cost upper bound
[0103] The first scheduling module is used to execute step S3 to obtain the cost budget When , then all jobs are placed on the machine with the smallest cost. When , then use the cost upper bound scheduling arrangement as the scheduling plan. When , then execute step S4;
[0104] The second scheduling module is used to execute step S4, construct an optimization model with the goal of minimizing the total completion time of all jobs, and solve the optimization model through a simplified particle swarm algorithm with a repair operation to obtain a scheduling plan. Among them, the repair operation means that when the cost of the output solution of the simplified particle swarm algorithm is higher than the cost upper bound, adjust the output solution until the cost of the output solution is lower than the cost upper bound. The adjustment process includes: inserting the first processing job on the last machine used into an adjacent machine with a smaller cost.
[0105] Thirdly, the present invention provides a computer-readable storage medium, which stores a computer program for production scheduling based on a simplified particle swarm algorithm. Among them, the computer program enables a computer to execute the production scheduling method based on a simplified particle swarm algorithm as described above.
[0106] Fourthly, the present invention provides an electronic device, including:
[0107] One or more processors;
[0108] A memory; and
[0109] One or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, and the program includes an operation for executing the production scheduling method based on a simplified particle swarm optimization algorithm as described above.
[0110] (III) Advantageous Effects
[0111] The present invention provides a production scheduling method, system, readable storage medium, and electronic device based on a simplified particle swarm optimization algorithm. Compared with the prior art, the following advantageous effects are achieved:
[0112] The present invention adds a constraint on the machine usage cost and reasonably sets the lower and upper limits of the cost. The given cost constraint is reasonable. At the same time, through the repair operation, it is ensured that the output scheduling plan is a feasible solution, overcoming the technical defect that the solution obtained by the current production scheduling method is different from the actual enterprise production situation, and the finally output scheduling plan lacks rationality. BRIEF DESCRIPTION OF THE DRAWINGS
[0113] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for the description of the embodiments or the prior art. Obviously, the following drawings are only some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0114] Figure 1 It is a block diagram of a production scheduling method based on a simplified particle swarm optimization algorithm according to an embodiment of the present invention;
[0115] Figure 2 It is a specific process of exchanging the workpiece sets on the machines in the C-SPT algorithm according to an embodiment of the present invention;
[0116] Figure 3 It is a specific optimization process of the improved simplified particle swarm optimization algorithm according to an embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0117] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention are clearly and completely described below. Obviously, the described embodiments are some, but not all, of the embodiments of the present invention. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.
[0118] Embodiments of the present application provide a production scheduling method, system, readable storage medium, and electronic device based on a simplified particle swarm algorithm, which solve the technical problem that existing production scheduling methods lack rationality. Taking the cost budget before the start of production of an enterprise as a prerequisite for the optimization problem, a scheduling plan that conforms to actual production scheduling is output.
[0119] The technical solutions in the embodiments of the present application for solving the above technical problems have the following general idea:
[0120] In an enterprise's production system, due to different purchase years of machines, although their functions (here mainly considering the processing speed of machines) are the same, compared with new machines, old machines consume more energy and produce more pollutants, that is, using old machines for production incurs greater costs. And when an enterprise conducts production, it usually sets a cost budget. How to improve production efficiency and enhance customer satisfaction as much as possible under cost constraints is a problem that needs to be solved in actual production. Currently, some research takes the machine usage cost as the optimization goal, but a more realistic situation is that the production arrangement of an enterprise needs to not exceed a certain cost, and then consider the optimization scheduling goal. That is to say, taking the machine usage cost as a constraint condition, a production arrangement that does not meet the cost constraint cannot be used as the final plan. Very few research takes the machine usage cost as a constraint condition, but simply places all workpieces on the machine with the lowest cost and the machine with the highest cost as the lower and upper limits of the cost, so the given cost constraint is too loose. The scheduling plans output by the above two methods both lack a certain degree of rationality.
[0121] To better understand the above technical solutions, the above technical solutions will be described in detail below in conjunction with the accompanying drawings of the specification and specific implementation manners.
[0122] Embodiments of the present invention provide a production scheduling method based on a simplified particle swarm algorithm, as Figure 1 shown, including:
[0123] S1. Obtain job data and machine data, where the job data includes a set J = {J1, J2,..., J n} of n jobs, and the processing duration p i of job J j ; the machine data includes a set M = {M1, M2,..., M m} of m machines, and the machines are sorted in non-decreasing order according to the unit processing cost; the unit time processing cost l i of the i-th machine;
[0124] S2. Determine the lower bound and upper bound of the cost based on the job data and machine data, including:
[0125] Placing all jobs on the machine with the minimum cost gives the lower bound of the cost;
[0126] The method for determining the upper bound of the cost includes: :
[0127] c1. Given a set of machines \(M = \{M_1, M_2, \ldots, M_n\}\), set the sorting of the machines in non - decreasing order according to the unit processing cost. Arrange the \(n\) jobs in non - decreasing order of processing time to form an ordered list, i.e., \(p_1\leq p_2\leq\cdots\leq p_n\); m ; n
[0128] c2. Take the first job from the ordered list, assign it to the earliest available machine, and at the same time, remove this job from the ordered list. Repeat this step until all jobs in the ordered list are assigned;
[0129] c3. By swapping the workpiece sets on the machines, make the machine with a smaller cost have a larger final completion time, and obtain the upper - bound scheduling arrangement. At this time, represents the final processing completion time of the \(i\) - th machine;
[0130] c4. Calculate the total cost of all machines in the upper - bound scheduling arrangement, which is the upper bound of the cost
[0131] S3. Obtain the cost budget When , then place all jobs on the machine with the minimum cost. When , then take the upper - bound scheduling arrangement as the scheduling plan. When , then execute step S4;
[0132] S4. Construct an optimization model with the goal of minimizing the total completion time of all jobs, and solve the optimization model through a simplified particle swarm algorithm with a repair operation to obtain a scheduling plan. Among them, the repair operation means that when the cost of the output solution of the simplified particle swarm algorithm is higher than the upper bound of the cost, adjust the output solution until the cost of the output solution is lower than the upper bound of the cost. The adjustment process includes: inserting the first processing job on the last machine used into an adjacent machine with a smaller cost.
[0133] In the embodiment of the present invention, the constraint of the machine usage cost is added, and the lower bound and upper bound of the cost are reasonably set. The given cost constraint is reasonable. At the same time, through the repair operation, it is ensured that the output scheduling plan is a feasible solution, overcoming the technical defect that the solution obtained by the current production scheduling method is different from the actual enterprise production situation, and the finally output scheduling plan lacks rationality.
[0134] The following describes each step in detail:
[0135] In step S1, job data and machine data are obtained. The specific implementation process is as follows:
[0136] The job data for production scheduling based on the simplified particle swarm optimization algorithm and the machine data available for production operations are obtained by means of manual input or the like.
[0137] The job data is, for example, a set J = J1, J2,..., J of n jobs n , job J j has a processing duration p j , and other relevant job data.
[0138] The machine data is, for example, a set M = M1, M2,..., M of m machines m , and the machines are sorted in non-decreasing order according to the unit processing cost; the unit time processing cost l of the i-th machine i and so on.
[0139] In step S2, a lower cost bound U and an upper cost bound are determined based on the job data and the machine data. The specific implementation process is as follows:
[0140] All jobs are placed on the machine with the minimum cost to obtain a lower cost limit, that is U = li * P.
[0141] Given P m ||∑C j For the problem (the identical machine scheduling problem with the optimization objective of minimizing the sum of completion times), the optimal solution can be obtained by the SPT rule, while (considering cost constraints, the identical machine scheduling problem with the optimization objective of minimizing the sum of completion times) is a relaxation problem. Therefore, in the embodiments of the present invention, the following C-SPT algorithm is proposed according to the limitation of cost constraints to obtain a corresponding upper cost bound scheduling permutation, and the cost spent in this sorting is used as the upper cost bound
[0142] The C-SPT algorithm is as follows:
[0143] c1. Given a set of machines M = M1, M2,..., M m , the machines are sorted in non-decreasing order according to the unit processing cost, and the n jobs are arranged in a non-decreasing order of processing time to form an ordered list, that is, p1 ≤ p2 ≤... ≤ p n ;
[0144] c2. Take the first job from the ordered list, assign it to the earliest available machine, and at the same time, remove this job from the ordered list. Repeat this step until all jobs in the ordered list are assigned;
[0145] c3. By swapping the workpiece sets on the machines, make the machine with the smaller cost have a larger final completion time, and obtain the cost upper bound scheduling permutation. At this time, arrange the schedule lengths of all machines in non-increasing order, that is The swapping process is as Figure 2 shown.
[0146] S3. Obtain the cost budget When then, place all jobs on the machine with the smallest cost. When then, use the cost upper bound scheduling permutation as the scheduling plan. When then, execute step S4. The specific implementation process is as follows:
[0147] Cost budget For a job processing problem with m machines and n jobs determined, the set cost constraint should neither be too tight, making the problem have no solution, nor be too loose, making this constraint meaningless. If α = 0, that is Obviously, placing all jobs on the machine with the smallest cost is a scheduling plan with the smallest cost. Denote the total cost of the machines used in this case as the cost lower bound, that is U = l i *P. When the problem has no feasible solution.
[0148] If then this problem has no meaning of optimization because an optimal solution can already be obtained through an algorithm C-SPT. Therefore, the given cost must satisfy that is, 0 ≤ α ≤ 1.
[0149] In the actual production process, obtain the cost budget through manual input and other means.
[0150] In step S4, construct an optimization model with minimizing the total completion time of all jobs as the optimization goal, and solve the optimization model through a simplified particle swarm algorithm with repair operations to obtain the scheduling plan. Among them, the repair operation means that when the cost of the output solution of the simplified particle swarm algorithm is higher than the cost upper bound, adjust the output solution until the cost of the output solution is lower than the cost upper bound. The adjustment process includes: inserting the first processing job on the last machine used to an adjacent machine with a smaller cost.
[0151] For the convenience of subsequent description, some parameters are defined as follows:
[0152] J: The set of n jobs, J = J1, J2, …, J n ;
[0153] M: The set of m machines, M = M1, M2, …, M m , and the machines are sorted in non - decreasing order according to the unit processing cost;
[0154] p j : The processing duration of job J j ;
[0155] The total processing duration of all jobs J1, J2, …, J n ;
[0156] R: An infinitely large number;
[0157] C j : The completion time of job J j ;
[0158] C ik : The completion time of the workpiece processed at the k - th position on the i - th machine;
[0159] The final processing completion time of the i - th machine;
[0160] l i : The unit - time processing cost of the i - th machine;
[0161] σ: A scheduling scheme;
[0162] F(σ): The total completion time of all jobs in the scheduling scheme σ;
[0163] The given cost budget;
[0164] Cost upper limit;
[0165] U : Cost lower limit;
[0166] U(σ): The total usage cost of machines in the scheduling scheme σ;
[0167] MJ i : The set of jobs processed on the i - th machine;
[0168]
[0169] where i = 1, …, m, j = 1, …, n, k = 1, …, n.
[0170] The optimized model includes:
[0171]
[0172] S.t.
[0173]
[0174]
[0175]
[0176]
[0177]
[0178]
[0179] Among them, equation (1) is the objective function, that is, to minimize the total completion time of all jobs;
[0180] Equation (2) ensures that each job can only be processed once;
[0181] Equation (3) means that at most one job can be processed at a certain position on the machine;
[0182] Equation (4) means that the total usage cost of the machine cannot exceed the cost budget;
[0183] Equations (5) and (6) define the completion time of the job processed at the k-th position of the M i -th machine;
[0184] Equation (7) means that the decision variable is a binary 0-1 variable.
[0185] It should be noted that a scheduling scheme can also be obtained through the existing ordinary simplified particle swarm algorithm, but the solving speed and the quality of the solution are not as good as those of the improved simplified particle swarm algorithm proposed in the embodiments of the present invention. The ordinary simplified particle swarm algorithm is a common optimization algorithm and will not be elaborated here.
[0186] As Figure 3 shown, the specific optimization process of the improved simplified particle swarm algorithm is as follows:
[0187] S401. Initialize the population size N, the maximum number of iterations G, the penalty factor r, and the parameters C w , C p , C g, randomly generate an initial population: randomly generate N n-dimensional particles, where each dimension represents the job numbered with that dimension, and the value on the dimension represents the processing machine number where the job of that dimension is located. Specifically, it includes:
[0188] Denote N as the population size of the algorithm, that is, the number of particles in each generation of the population, and G as the maximum number of iterations of the population, that is, the stopping criterion of the algorithm. A complete scheduling scheme needs to contain the following two pieces of information: the machine where each job is located and the sorting method of the jobs on the machine. For the problem studied in the embodiments of the present invention, it is known that the optimal solution can be obtained according to the SPT rule (i.e., the average flow rule, which means giving priority to selecting the job with the shortest processing time) for the sorting method of the jobs on each machine. Therefore, only the problem of the machine where the job is located needs to be considered. Since each particle in the population can represent a complete scheduling scheme, the embodiments of the present invention adopt an integer coding method. For the problem with m machines and n jobs, the k-th particle of the t-th (1 ≤ t ≤ G) generation of particles can be represented as where, is an integer from 1 to m, representing the machine number where job j is located. The embodiments of the present invention adopt a random generation initialization method for the N particles in the initial population, that is, randomly generate n integers in [1, m] for each particle k (1 ≤ k ≤ N).
[0189] S402. Decode each particle in the initial population, design a fitness function based on the optimization model, and calculate the fitness value of each decoded particle in the population according to the fitness function. The specific implementation process is as follows:
[0190] To accelerate the convergence speed and improve the quality of the solution, the embodiments of the present invention propose a new decoding method. Denote N as the population size of the algorithm, that is, the number of particles in each generation of the population, and G as the maximum number of iterations of the population, that is, the stopping criterion of the algorithm. For the k-th particle of the t-th (1 ≤ t ≤ G) generation of particles the following decoding method is proposed:
[0191] (1) Sort the jobs on each machine according to the SPT rule (i.e., the average flow rule, which means giving priority to selecting the job with the shortest processing time); (2) Calculate the total processing duration of each machine (3) Exchange the workpiece sets on the machines until for any two machines, the total completion time of the machine with a smaller cost must be no less than that of the machine with a higher cost, obtain the machine number where the job is currently located, and generate a new particle (4) Update the original particle according to the new particle
[0192] Decode the initial population by the above method, and then calculate the fitness value of each particle in the population. Specifically, it includes:
[0193] In order to improve the quality of the solution, based on the optimized model, the embodiment of the present invention proposes a fitness function introducing a penalty function. For the k-th particle of the t-th (1 ≤ t ≤ G) generation of particles The defined fitness function is as follows:
[0194]
[0195] where represents the total completion time of all jobs, r is the penalty factor, represents the cost actually used in the scheduling scheme represented by the particle When comparing two different particles, the one with a smaller fitness value is more advantageous than the other and closer to the optimal solution.
[0196] S403. Update the local optimal value of each particle: For the k-th particle of the t-th generation, its local optimal solution is updated according to the following formula, that is, if the fitness value of the current particle is smaller than the fitness value of the local optimal solution of this particle in the (t - 1)-th generation then update the local optimal solution of the k-th particle in the t-th generation, otherwise do not update.
[0197]
[0198] S404. Update the global optimal value of all particles in each generation: For all particles in the t-th generation, its global optimal solution gBest t is updated according to the following formula, that is, if the fitness value of the local optimal solution of a certain particle in the current population is smaller than the fitness value of the global optimal solution of all particles in the (t - 1)-th generation of the population then update the global optimal solution gBest t of all particles in the t-th generation, otherwise do not update.
[0199]
[0200] S405. Determine whether t < G holds. If so, execute step S406; otherwise, execute S408;
[0201] S406. Update the particle position: The j-th (1 ≤ j ≤ n) dimension position of the k-th particle in the t-th generation is updated according to the following formula.
[0202]
[0203] Among them, rnd is a random number between [0, 1]. represents the value of the j-th dimension position of particle k in the (t - 1)-th generation, represents the best value of the j-th dimension position of particle k from the 0-th generation to the (t - 1)-th generation, represents the best value of the j-th dimension position of all particles in the population from the 0-th generation to the (t - 1)-th generation, and x is a random integer between [1, m]. That is to say, each particle has a probability of C w to stay at the original position, and a probability of C p - C w to update to its current best position, and a probability of C g - C p to update to the current best position of the entire population, and there is still a probability of 1 - C g to move to any position.
[0204] S407. Update the local optimal solution and the global optimal solution of the t-th generation population according to the updated particle positions, and return to S405;
[0205] S408. Perform a repair operation on gBest G . Specifically, it includes:
[0206] Introducing a penalty function can make the particles move towards the optimal solution, but it cannot guarantee that the gBest G obtained after the loop ends, that is, the finally output scheduling scheme, is feasible. In order to ensure that the cost U(gBest G ) consumed by the finally output scheduling scheme is not higher than the cost limit This article adopts a repair operation to ensure that the output solutions are all feasible solutions. The basic idea is to insert the first processing operation on the last machine used into an adjacent machine with a slightly lower cost. The specific repair process is as follows:
[0207] a1: Calculate the machine usage cost U(gBest G ) of the scheduling scheme gBest G .
[0208] a2: If then go to a3; otherwise go to a12.
[0209] a3: Let γ = 0, x = m (where γ and s have no actual meaning and are variables introduced for convenient representation when writing the process).
[0210] a4: If then let γ = x and go to a6; otherwise go to a5.
[0211] a5: Let \(x = x - 1\), and go to a4.
[0212] a6: Let \(s = 1\).
[0213] a7: If \(l\) γ \(= l\) γ-s and \(s \lt \gamma\), then go to a8; otherwise go to a9.
[0214] a8: Let \(s = s + 1\), and go to a7.
[0215] a9: \(MJ\) γ \(= MJ\) γ \(\{MJ\) γ [0]\}, where \(MJ\) γ [0] represents the first job to be processed on the \(\gamma\)-th machine;
[0216] a10: \(MJ\) γ-s \(= MJ\) γ-s \(\cup \{MJ\) γ [0]\}, arrange the jobs in \(MJ\) γ-s according to the SPT rule to obtain the updated scheduling scheme \(gBest\) G′ .
[0217] a11: Let \(gBest\) G \(= gBest\) G′ , and go to a2.
[0218] a12: Output \(gBest\) G .
[0219] S409: Conduct a local search on the repaired \(gBest\) G . Specifically, it includes:
[0220] The repaired \(gBest\) G may lead to a large deviation between the output solution and the optimal solution. To improve the quality of the output solution, the present invention conducts a local search on the repaired \(gBest\) G .
[0221] Moving operation: Randomly select two jobs numbered \(x\) and \(y\), where \(x, y \in [1, N]\). Compare the processing durations of \(J\) x and \(J\) y . If \(p\) x \(> p\) y , then swap the values of \(x\) and \(y\), that is, \(x\) and \(y\) must satisfy that when \(1 \leq x \leq y \leq N\), \(p\) x \(\geq p\) y . Denote the processing machine numbers where the current jobs \(J\) x and \(J\) y are located as \(M\) x and \(M\)y respectively generate two random integers x' and y' in the intervals [M x , m] and [1, M y . Move the job numbered x to the machine numbered M x′ , and move the job numbered y to the machine numbered M y′ , while ensuring that the job sets on these two machines satisfy the SPT rule.
[0222] To avoid the possibility that a single move operation may lead to a local optimum in the existing solution, the present invention associates the number of move operations with the number of updates of the scheduling scheme in the local search, and uses the sigmoid function to represent the probability of needing to perform two move operations. Among them, u represents the number of updates of the scheduling scheme in the local search. Obviously, 1 - p N is the probability of performing only one move operation.
[0223] For ease of understanding, the specific details of the local search operation are as follows:
[0224] Among them, T0 represents the initial temperature, T min represents the termination temperature, and θ represents the cooling rate. When a new scheduling scheme gBest G′ is obtained after performing a move operation, the new scheme will be adopted and the original scheduling scheme gBest G will be updated only when the scheme not only satisfies the cost constraint but also is better than the current objective value, otherwise it will be discarded.
[0225] b1: Let t = T0 and u = 0.
[0226] b2: If t > T min , go to b3; otherwise go to b16;
[0227] b3: Perform a move operation on the repaired gBest G to obtain a new scheduling scheme gBest G′ .
[0228] b4: Calculate the machine cost U(gBest G′ ) and the objective function value F(gBest G′ ) used by the scheduling scheme gBest G′ .
[0229] b5: If is satisfied and F(gBest G′ ) ≤ F(gBest G ), go to b7; otherwise go to b6.
[0230] b6: Discard the generated scheduling scheme gBestG′ , go to b8.
[0231] b7: Let gBest G = gBest G′ , u = u + 1.
[0232] b8: Calculate the value of p N according to the sigmoid function.
[0233] b9: Generate a random number η ∈ (0, 1). If η ≤ p N , go to b10; otherwise go to b15.
[0234] b10: Perform a movement operation on gBest G to obtain a new scheduling plan gBest G′ .
[0235] b11: Calculate the machine cost U(gBest G′ ) and the objective function value F(gBest G′ ) used by the scheduling plan gBest G′ .
[0236] b12: If is satisfied and F(gBest G′ ) ≤ F(gBest G ), go to b14; otherwise go to b13.
[0237] b13: Discard the generated scheduling plan gBest G′ , go to b15.
[0238] b14: Let gBest G = gBest G′ , u = u + 1.
[0239] b15: Let t = t * θ, go to b2.
[0240] b16: Output gBest G .
[0241] S410. Output the gBest G after local search as the scheduling plan.
[0242] An embodiment of the present invention also provides a production scheduling system based on a simplified particle swarm algorithm, including:
[0243] A data acquisition module, configured to execute step S1 to obtain job data and machine data, where the job data includes a set J = J1, J2,..., J n of n jobs, and the processing duration p j of job Jj The set M of m machines of the machine data is M = M1, M2, …, M m , and it is set that the sorting of the machines is in non-decreasing order according to the unit processing cost; the unit time processing cost li of the i-th machine i ;
[0244] A cost boundary determination module, which is used to execute step S2 to determine a cost lower bound and a cost upper bound based on job data and machine data, including:
[0245] Placing all jobs on the machine with the minimum cost to obtain a cost lower bound;
[0246] Determining a cost upper bound The method includes:
[0247] c1. Given the machine set M = M1, M2, …, M m , and it is set that the sorting of the machines is in non-decreasing order according to the unit processing cost, and arranging the n jobs in non-decreasing order of processing time to form an ordered list, that is, p1 ≤ p2 ≤ … ≤ p n ;
[0248] c2. Taking out the first job from the ordered list, allocating it to the earliest available machine, and at the same time deleting this job from the ordered list, and repeating this step until all the jobs in the ordered list are allocated;
[0249] c3. By exchanging the workpiece sets on the machines, making the machines with smaller costs have larger final completion times, obtaining a cost upper bound scheduling arrangement, where represents the final processing completion time of the i-th machine;
[0250] c4. Calculating the total cost of all machines in the cost upper bound scheduling arrangement, which is the cost upper bound
[0251] A first scheduling module, which is used to execute step S3 to obtain a cost budget When , then all jobs are placed on the machine with the minimum cost, and when , then the cost upper bound scheduling arrangement is used as the scheduling plan, and when , then execute step S4;
[0252] The second scheduling module is used to execute step S4, construct an optimization model with the goal of minimizing the total completion time of all jobs, and solve the optimization model through a simplified particle swarm algorithm with a repair operation to obtain a scheduling plan. The repair operation means that when the cost of the output solution of the simplified particle swarm algorithm is higher than the cost upper limit, the output solution is adjusted until the cost of the output solution is lower than the cost upper limit. The adjustment process includes: inserting the first processing job on the last machine used into an adjacent machine with a lower cost.
[0253] It can be understood that the production scheduling system based on the simplified particle swarm algorithm provided by the embodiments of the present invention corresponds to the above-mentioned production scheduling method based on the simplified particle swarm algorithm. For the explanations, examples, beneficial effects, etc. of the relevant content, reference can be made to the corresponding content in the production scheduling method based on the simplified particle swarm algorithm, which will not be elaborated here.
[0254] The embodiments of the present invention also provide a computer-readable storage medium, which stores a computer program for production scheduling based on the simplified particle swarm algorithm. The computer program enables a computer to execute the production scheduling method based on the simplified particle swarm algorithm as described above.
[0255] The embodiments of the present invention also provide an electronic device, including:
[0256] One or more processors;
[0257] A memory; and
[0258] One or more programs, where the one or more programs are stored in the memory and configured to be executed by the one or more processors. The programs include those for executing the production scheduling method based on the simplified particle swarm algorithm as described above.
[0259] In summary, compared with the prior art, the following beneficial effects are achieved:
[0260] 1. The embodiments of the present invention add constraints on the machine usage cost, and reasonably set the cost lower limit and cost upper limit. The given cost constraints are reasonable. At the same time, through the repair operation, it is ensured that the output scheduling plan is a feasible solution, overcoming the technical defect that the solution obtained by the current production scheduling method is different from the actual enterprise production situation, and the finally output scheduling plan lacks rationality.
[0261] 2. The embodiments of the present invention design a new decoding method to make the solution more reasonable, accelerate the convergence speed of the particle swarm moving towards the optimal solution, reduce some invalid movements, and improve the quality of the solution.
[0262] 3. The design of the penalty function and penalty coefficient introduced in the embodiments of the present invention enables a large number of high-quality solutions to be retained, improving the quality of the solution.
[0263] 4. In the embodiment of the present invention, a local search operation is performed on the repaired result, so that the finally output solution is closer to the optimal solution while ensuring the feasibility of the result and without consuming too much time.
[0264] It should be noted that in this text, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the term "comprising", "including" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or device comprising a series of elements not only includes those elements, but also includes other elements not expressly listed, or further includes elements inherent to such process, method, article or device. Without further limitation, an element defined by the statement "comprising an..." does not exclude the presence of additional identical elements in the process, method, article or device comprising the element.
[0265] The above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions recorded in the foregoing embodiments, or perform equivalent replacements on some of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A production scheduling method based on a simplified particle swarm optimization algorithm, characterized in that, The production scheduling method includes: S1. Obtain job data and machine data. The job data includes a set of n jobs and the processing duration of each workpiece. The machine data includes a set of m machines and the processing cost per unit time of each machine. S2. Determine the lower cost bound and upper cost bound based on the job data and machine data, including: Placing all jobs on the machine with the minimum cost gives a lower bound on the cost U ; The method for determining the upper cost bound includes: c1. Given a set of machines \(M = M_1, M_2, \ldots, M\) m , assume that the machines are sorted in non - decreasing order according to the unit processing cost. Arrange the \(n\) jobs in a non - decreasing order of processing time to form an ordered list, i.e., \(p_1\leq p_2\leq\cdots\leq p\) n ; c2. Take out the first job from the ordered list, assign it to the earliest available machine, and at the same time, delete this job from the ordered list. Repeat this step until all jobs in the ordered list are assigned. c3. By swapping the workpiece sets on the machines so that the machine with the lower cost has a larger final completion time, a cost upper bound scheduling permutation is obtained. At this time represents the final processing completion time of the $i$-th machine; c4. Calculate the total cost of all machines in the scheduling permutation with the cost upper limit, which is the cost upper limit. S3. Obtain the cost budget When is correct, all jobs are placed on the machine with the lowest cost. When is the case, the cost ceiling scheduling arrangement is used as the scheduling plan. When is the case, then step S4 is executed; S4. Construct an optimization model with the objective of minimizing the total completion time of all jobs, and solve the optimization model through a simplified particle swarm algorithm with a repair operation to obtain a scheduling plan. Among them, the repair operation means that when the cost of the output solution of the simplified particle swarm algorithm is higher than the upper cost bound, adjust the output solution until the cost of the output solution is lower than the upper cost bound. The adjustment process includes: inserting the first processing job on the last machine used into an adjacent machine with a lower cost.
2. The production scheduling method based on the simplified particle swarm algorithm as claimed in claim 1, wherein The optimization model includes an objective function and constraint conditions: Among them, the objective function is: The constraint conditions include: Among them, equation (1) is the objective function, that is, to minimize the total completion time of all jobs. Equation (2) ensures that each job can only be processed once. Equation (3) means that at most one job can be processed at a certain position on the machine. Equation (4) means that the total usage cost of the machine cannot exceed the cost budget. Equations (5) and (6) define the completion time of the job processed at the k-th position of the M-th i machine; Equation (7) means that the decision variable is a binary 0-1 variable. C ik represents the completion time of the workpiece processed at the k-th position of the i-th machine; p j represents the processing duration of job J j ; where i = 1,..., m, j = 1,..., n, k = 1,..., n.
3. The production scheduling method based on the simplified particle swarm algorithm according to claim 1 or 2, characterized in that The specific content of S4 includes: S401. Initialize the population size N, the maximum number of iterations G, the penalty factor r, and the parameters C required for particle update w , C p , C g , randomly generate N n-dimensional particles, where each dimension represents the job numbered with that dimension, and the value on the dimension represents the processing machine number where the job of that dimension is located; S402. Decode each particle in the initial population, design a fitness function based on the optimization model, and calculate the fitness value of each decoded particle in the population according to the fitness function, including: Among them, represents the fitness value; represents the total completion time of all jobs; r is the penalty factor, represents the particle the actual cost used in the scheduling scheme represented; when comparing two different particles, discard the solution with a larger fitness value and retain the solution with a smaller fitness value; S403. Update the local optimal value of each particle. S404. Update the global optimal value of all particles in each generation. S405. Determine whether t < G holds. If so, execute step S406; otherwise, execute S408. S406. Update the particle position. S407. Update the local optimal solution and global optimal solution of the t-th generation population according to the updated particle position, and return to S405. S408. Repair gBest through a repair operation G Perform a repair process; S409. Perform local search on the repaired gBest G ; S410. Output the gBest after local search G As the scheduling solution.
4. The production scheduling based on the simplified particle swarm optimization algorithm according to claim 1 or 2, characterized in that, The specific content of the repair operation includes: a1: Calculate the machine usage cost U(gBest) of the scheduling scheme gBest G ; G ) a2: If then go to a3; otherwise go to a12; a3: Let γ = 0 and x = m. a4: If then set γ = x and go to a6; otherwise go to a5; a5: Let x = x - 1 and go to a4. a6: Let s = 1. a7: If l γ = l γ-s and s < γ, then go to a8; otherwise go to a9; a8: Let s = s + 1 and go to a7. a9: MJ γ = MJ γ {MJ γ [0]}, where MJ γ [0] represents the first job to be processed on the γ-th machine; a10: MJ γ-s = MJ γ-s ∪ {MJ γ [0]}, arrange the jobs in MJ γ-s according to the SPT rule to obtain the updated scheduling scheme gBest G′ ; a11: Let gBest G′ = gBest G′ , go to a2; a12: Output gBest G .
5. The production scheduling method based on the simplified particle swarm optimization algorithm according to claim 3, wherein In step S402, the decoding of each particle in the initial population includes: Sort the jobs on each machine according to the SPT rule. Calculate the total processing duration of each machine Exchange the workpiece sets on the machines until for any two machines, the total completion time of the machine with the lower cost is not less than that of the machine with the higher cost. Obtain the machine number where the job is currently located and generate a new particle According to the new particle Update the original particle 6. The production scheduling method based on the simplified particle swarm optimization algorithm according to claim 3, characterized in that The specific content of S403 includes: For the k-th particle in the t-th generation, its local optimal solution is updated according to the following formula: Among them, represents the fitness value of the local optimal solution of the particle in the (t - 1)-th generation; The specific content of S404 includes: For all particles in the t-th generation, their global best solution gBest t is updated according to the following formula: Among them, represents the fitness value of the global optimal solution of all particles in the (t - 1)-th generation population; The fitness value of the local optimal solution of a certain particle in the t-th generation population.
7. The production scheduling method based on the simplified particle swarm optimization algorithm according to claim 3, characterized in that The specific content of S409 includes: b1: Let t = T0 and u = 0. b2: If t > T min , go to b3; otherwise, go to b16; b3: The repaired gBest G Perform a movement operation to obtain a new scheduling scheme gBest G′ ; b4: Calculate the scheduling scheme gBest G′ The machine cost U(gBest G′ ) and fitness value F(gBest G′ ) used; b5: If satisfied and F(gBest G′ ) ≤ F(gBest G ), go to b7; otherwise go to b6; b6: Discard the generated scheduling solution gBest G′ , go to b8; b7: Set gBest G = gBest G′ , u = u + 1; b8: Calculate the value of p according to the sigmoid function N ; b9: Generate a random number η ∈ (0, 1). If η ≤ p N , go to b10; otherwise, go to b15; b10: For gBest G Perform a movement operation once to obtain a new scheduling scheme gBest G ; b11: Calculate the scheduling solution gBest G′ The machine cost U(gBest G′ ) and the fitness value F(gBest G′ ); b12: If the following conditions are met and F(gBest G′ ) ≤ F(gBest G ), go to b14; otherwise, go to b13; b13: Discard the generated scheduling solution gBest G′ , and go to b15; b14: Let gBest G = gBest G′ , u = u + 1; b15: Let t = t * θ and go to b2. b16: Output gBest G ; Among them, T0 represents the initial temperature, and T min represents the termination temperature, and θ represents the cooling rate.
8. A production scheduling system based on a simplified particle swarm optimization algorithm, characterized in that, Includes: A data acquisition module, which is used to execute step S1 to acquire job data and machine data. The job data includes a set J = J1, J2, …, J of n jobs n , job J j 's processing duration p j The machine data is a set M = M1, M2, …, M of m machines m , and it is set that the sorting of machines is in non-decreasing order according to the magnitude of the unit processing cost; the unit time processing cost l of the i-th machine i ; A cost bound determination module for executing step S2 to determine the lower cost bound and upper cost bound based on the job data and machine data, including: Placing all jobs on the machine with the lowest cost to obtain the lower cost bound. Determine the cost ceiling The method includes: c1. Given a set of machines \(M = M_1, M_2, \ldots, M\) m , assume that the machines are sorted in non - decreasing order according to the unit processing cost. Arrange the \(n\) jobs in a non - decreasing order of processing time to form an ordered list, i.e., \(p_1\leq p_2\leq\cdots\leq p\) n ; c2. Take the first job from the ordered list, assign it to the earliest available machine, and at the same time, delete this job from the ordered list. Repeat this step until all jobs in the ordered list are assigned. c3. By swapping the workpiece sets on the machines so that the machine with the lower cost has a larger final completion time, a cost upper bound scheduling permutation is obtained. At this time represents the final processing completion time of the i-th machine; c4. Calculate the total cost of all machines in the scheduling arrangement with the cost ceiling, which is the cost ceiling. The first scheduling module is used to execute step S3 to obtain the cost budget When is correct, all jobs are placed on the machine with the minimum cost. When it is the case, the cost ceiling scheduling arrangement is used as the scheduling plan. When it is the case, step S4 is executed; The second scheduling module is used to execute step S4, construct an optimization model with the goal of minimizing the total completion time of all jobs, solve the optimization model through a simplified particle swarm algorithm with a repair operation, and obtain a scheduling plan. Among them, the repair operation means that when the cost of the output solution of the simplified particle swarm algorithm is higher than the cost upper limit, adjust the output solution until the cost of the output solution is lower than the cost upper limit. The adjustment process includes: inserting the first processing job on the last used machine to an adjacent machine with a lower cost.
9. A computer-readable storage medium, characterized in that, It stores a computer program for production scheduling based on the simplified particle swarm algorithm, where the computer program enables the computer to execute the production scheduling method based on the simplified particle swarm algorithm as described in any one of claims 1 to 7.
10. An electronic device, characterized in that, It includes: One or more processors; A memory; And One or more programs, where the one or more programs are stored in the memory and are configured to be executed by the one or more processors. The programs include those for executing the production scheduling method based on the simplified particle swarm algorithm as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Production scheduling method and device based on particle swarm optimization algorithm
CN109507970A
Method and system for collaborative scheduling of production and transportation in supply chains based on improved particle swarm optimization
US20180357584A1