Flexible workshop scheduling method based on sparrow algorithm
By improving the mathematical model of the sparrow algorithm, the scheduling problem of flexible workshops in resource balance scenarios is solved, and the efficiency of process allocation and equipment utilization is improved, avoiding the transportation time conflict.
Patent Information
- Application Number
- CN202411190942.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-28
- Publication Date
- 2024-11-12
AI Technical Summary
There is little research on the energy-saving scheduling of flexible workshops in the prior art, especially in the resource balance scenario, the problem of how to reasonably allocate processes and avoid transport time conflicts has not been effectively resolved.
The mathematical model based on the improved sparrow algorithm is adopted to obtain work target data and constraints, generate optimal process allocation results, solve the scheduling problems in the flexible workshop, and ensure the balanced utilization of resources and the efficient utilization of handling equipment.
In the resource balance scenario, by improving the sparrow algorithm to generate the optimal solution, the scheduling problem of flexible workshops is solved, the process allocation efficiency and utilization rate of handling equipment are improved, time conflicts are avoided, and the reasonable allocation of resources is achieved.
Smart Images

Figure CN118938840A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of job shop scheduling, and in particular to a flexible job shop scheduling method based on a sparrow algorithm. Background Art
[0002] With the development of society, manufacturing companies are facing dual pressures of economy and environment. Based on the requirements of sustainable development, reducing equipment costs is also one of the important goals of enterprises. To achieve this goal, it is very important to coordinate time and equipment costs in many aspects when solving practical problems. In recent years, the production scheduling problem considering carbon emission consumption costs has received more and more attention.
[0003] In the related technologies, most of the research in this aspect focuses on single-machine systems or assembly line systems.
[0004] A flexible production line is a production line that connects multiple adjustable machine tools (mostly special machine tools) and is equipped with automatic conveying devices. In contrast, there is relatively little research on energy-saving scheduling in flexible workshops. Therefore, when the company's handling equipment is limited, we must consider how to reasonably allocate processes under limited handling equipment, avoid handling time conflicts, and solve the flexible workshop scheduling problem in a resource-balanced scenario. Summary of the invention
[0005] The present invention relates to a flexible workshop scheduling method based on a sparrow algorithm, which can solve the scheduling problem of a flexible workshop in a resource balancing scenario. The method is applied in a computer device, and the method includes:
[0006] Acquire work target data and work parameters corresponding to the target flexible workshop, where the work target data is used to indicate the work target of the target flexible workshop, and the work target data and work parameters are associated with the target workpiece and processing machine of the target flexible workshop;
[0007] Generate at least two work constraints corresponding to the target flexible workshop based on the work parameters;
[0008] The work target data and work constraint conditions are input into the workshop production scheduling model, and the process allocation result is output; the workshop production scheduling model is a mathematical model based on the improved sparrow algorithm;
[0009] Based on the process allocation results, the allocation processing results corresponding to the workpieces to be processed and the processing machines in the flexible workshop are generated.
[0010] In an optional embodiment, the work target data includes workpiece target number data and workpiece processing procedure data;
[0011] The workpiece processing procedure data is used to indicate the processing procedure sequence and the processing machine corresponding to the processing procedure sequence.
[0012] In an optional embodiment, the constraint condition includes at least one of a processing tool constraint condition, a process constraint condition, a processing priority condition, a processing start time condition, a handling equipment condition, and a processing continuity condition.
[0013] In an optional embodiment, the workshop production scheduling model is a mathematical model based on an improved sparrow algorithm in a resource balancing scenario.
[0014] In an optional embodiment, the method further comprises:
[0015] Preset model parameters, where the model parameters include at least one of a population number parameter, an iteration number parameter, a subpopulation ratio parameter, and a safety threshold parameter;
[0016] Construct a workshop production scheduling model based on model parameters.
[0017] In an optional embodiment, the work target data and the work constraint conditions are input into the workshop production scheduling model, and the process allocation result is output, including:
[0018] Input the target work data and work constraints into the workshop production scheduling model;
[0019] Through the workshop production scheduling model, combined with the sparrow algorithm, candidate individuals corresponding to the model parameters are generated, each candidate individual includes machine selection coding information and process sorting coding information;
[0020] Determine the fitness value corresponding to the candidate individual;
[0021] Based on the fitness value, the candidate individuals are assigned to populations. The populations corresponding to the candidate individuals include the optimal sub-population, the initial discoverer sub-population, and the initial joiner sub-population. The population assignment standard of the optimal sub-population, the initial discoverer sub-population, and the initial joiner sub-population is the fitness of the candidate individuals.
[0022] Determine the individual position vector of the sparrow corresponding to the candidate individual;
[0023] Based on the individual position vectors of sparrows, the initial discoverer subpopulation and the initial joiner subpopulation are updated to obtain the discoverer population, the joiner population and the vigilant subpopulation;
[0024] Determine the scheduling solutions corresponding to the candidate individuals in the discoverer population, joiner population, and vigilant sub-population;
[0025] In response to determining the scheduling solution, determining a number of iterations;
[0026] In response to the number of iterations reaching an iteration number threshold, determining fitness values of candidate individuals in the discoverer population, the joiner population, and the vigilant sub-population;
[0027] Determine the optimal scheduling solution corresponding to the target work data and work constraints based on the minimum value of the fitness value;
[0028] Generate and output process allocation results based on the optimal scheduling solution.
[0029] In an optional embodiment, determining a fitness value corresponding to a candidate individual includes:
[0030] Decode the machine selection coding information of the candidate individuals to obtain the machine sequence matrix and the time sequence matrix;
[0031] Decoding the process sequence coding information to obtain the process decoding result;
[0032] Determine the start time and end time of the preliminary selection process corresponding to the candidate individual based on the machine sequence matrix, the time sequence matrix and the process decoding result;
[0033] Carry out handling conflict inspection at the start and end time of the preliminary selection process;
[0034] Based on the inspection results of the handling conflict inspection, the start time and the end time of the preliminary selection process are updated to obtain the processing start time, processing end time, machine completion time and maximum completion time;
[0035] The fitness value corresponding to the candidate individual is determined based on the processing start time, processing end time, machine completion time and maximum completion time.
[0036] In an optional embodiment, the start time and the end time of the preliminary process are updated based on the inspection result of the transport conflict inspection to obtain the processing start time, processing end time, machine completion time and maximum completion time, including:
[0037] Determine the handling process based on the handling equipment conditions;
[0038] Generate a transport start time matrix based on the transport process and the processing process constraints, wherein the transport start time matrix includes at least two intervals for indicating the transport start time;
[0039] Arrange the intervals in ascending order based on the transport start time to obtain an ascending matrix;
[0040] The ascending matrix is combined with the process loading start time and the process loading end time to sort the transportation start time, so as to update the preliminary process start time and the preliminary process end time, and obtain the processing start time, processing end time, machine completion time and maximum completion time.
[0041] In an optional embodiment, based on the individual sparrow position vectors, the initial discoverer subpopulation and the initial joiner subpopulation are updated to obtain the discoverer population, the joiner population and the alerter subpopulation;
[0042] Determine the optimal subpopulation, the initial discoverer subpopulation, and the initial joiner subpopulation based on the individual fitness values;
[0043] Generate random warning values for population individuals in the initial discoverer subpopulation;
[0044] Generate a population of discoverers based on random warning values;
[0045] Based on the initial joiner subpopulation, the joiner population is updated;
[0046] The initial vigilant sub-population is obtained by selecting and updating from the discoverer population and the joiner population.
[0047] In an optional embodiment, an initial vigilant subpopulation is obtained by selecting and updating from the discoverer population and the joiner population, including:
[0048] Individuals are randomly selected from the discoverer population and the joiner population to form a primary vigilant sub-population;
[0049] The initial vigilant subpopulation is updated based on the update formula to obtain the vigilant subpopulation, where the update formula is associated with the fitness value, the global optimal position and the individual position
[0050] The beneficial effects of the technical solution provided by this application include at least:
[0051] In the process of solving the scheduling problem in the flexible workshop, after obtaining the work parameters and work objectives, by taking the target processing data and the corresponding work constraints as reference objects, based on the improved sparrow algorithm, the optimal solution corresponding to the processing process is generated, which can solve the scheduling problem of the flexible workshop in the resource balancing scenario. BRIEF DESCRIPTION OF THE DRAWINGS
[0052] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0053] Figure 1 A flow chart of a flexible workshop scheduling method based on a sparrow algorithm provided by an exemplary embodiment of the present application is shown.
[0054] Figure 2 A schematic diagram of an output process of a process allocation result provided by an exemplary embodiment of the present application is shown.
[0055] Figure 3 A schematic diagram of a process for determining a fitness value corresponding to a candidate individual provided by an exemplary embodiment of the present application is shown.
[0056] Figure 4 A schematic flow chart of a fitness value update process corresponding to an individual provided by an exemplary embodiment of the present application is shown. DETAILED DESCRIPTION
[0057] In order to make the objectives, technical solutions and advantages of the present application more clear, the embodiments of the present invention will be further described in detail below with reference to the accompanying drawings.
[0058] Figure 1 A flow chart of a flexible workshop scheduling method based on a sparrow algorithm provided by an exemplary embodiment of the present application is shown. The method is described by taking the application of the method in a computer device as an example. The method includes:
[0059] Step 101, obtaining work target data and work parameters corresponding to a target flexible workshop.
[0060] In the embodiment of the present application, the work target data is used to indicate the work target of the target flexible workshop, and the work target data and work parameters are associated with the target workpiece and processing machine of the target flexible workshop.
[0061] In the embodiment of the present application, the target flexible workshop is a workshop for producing work targets, and the embodiment of the present application does not limit the specific work tasks of the target flexible workshop. The target flexible workshop includes processing equipment corresponding to at least two processes and work equipment for transporting work targets. The embodiment of the present application does not limit the specific structure in the target flexible workshop.
[0062] It should be noted that the computer device executing the method in the embodiment of the present application can be implemented as a device connected to the flexible workshop, or can be implemented as an independent computer device with data communication function or storage function. The present application does not limit the specific implementation form of the computer device.
[0063] Step 102: Generate at least two working constraints corresponding to the target flexible workshop based on the working parameters.
[0064] Optionally, the constraint condition is determined by the actual working requirements of the flexible workshop. In one example, the constraint condition can be implemented as a constraint condition on the working hours of the flexible workshop, or a constraint condition on the number of devices working simultaneously in the flexible workshop. The present application does not limit the specific content of the constraint condition.
[0065] Step 103, input the work target data and work constraint conditions into the workshop production scheduling model, and output the process allocation result.
[0066] It should be noted that, in the embodiment of the present application, the workshop production scheduling model is a mathematical model based on the improved sparrow algorithm.
[0067] Optionally, the process allocation result is used to indicate the work process and working time allocated to each work equipment in the flexible workshop, wherein the working time includes the start time and the end time of the work.
[0068] Step 104 , generating a distribution processing result corresponding to the workpiece to be processed and the processing machine in the flexible workshop based on the process distribution result.
[0069] To summarize, the method provided in the embodiment of the present application, in the process of solving the scheduling problem in the flexible workshop, after obtaining the working parameters and working objectives, by taking the target processing data and the corresponding working constraints as reference objects, based on the improved sparrow algorithm, an optimal solution corresponding to the processing process is generated, which can solve the scheduling problem of the flexible workshop in the resource balancing scenario.
[0070] Figure 2 The following is a schematic diagram showing an output process of a process allocation result provided by an exemplary embodiment of the present application, and the method is applied to a computer device as an example for explanation. Figure 2 , the process includes:
[0071] Step 201: input target work data and work constraints into a workshop production scheduling model.
[0072] In an embodiment of the present application, the workshop production scheduling model is a mathematical model based on the improved sparrow algorithm in a resource balancing scenario. That is, this model is used to solve the Flexible Job-shop Scheduling Problem (FJSP). The goal of FJSP usually includes minimizing the maximum completion time (Makespan), that is, the total time for all workpieces to complete processing, and other possible evaluation indicators, such as machine load balance, total consumption, advance or delay time, etc. The mathematical model of FJSP usually includes the process sequence constraints, completion time constraints, machine constraints, etc. of the workpiece.
[0073] It should be noted that, in the embodiment of the present application, the work target data includes workpiece target number data and workpiece processing procedure data; wherein the workpiece processing procedure data is used to indicate the processing procedure sequence and the processing machine corresponding to the processing procedure sequence.
[0074] Correspondingly, the work constraint condition is at least one of a processing tool constraint condition, a process constraint condition, a processing priority condition, a processing start time condition, a handling equipment condition, and a processing continuity condition.
[0075] In the embodiment of the present application, when establishing a model, the constraints that need to be considered include at least one of the following:
[0076] (1) The same machine can only process one workpiece at the same time.
[0077] (2) The same process on the same workpiece can only be processed by one machine at the same time.
[0078] (3) Once each process of each workpiece begins, the processing cannot be interrupted.
[0079] (4) Different artifacts have the same priority.
[0080] (5) There are no sequence constraints between the processes of different workpieces, but there are sequence constraints between the processes of the same workpiece.
[0081] (6) All workpieces can be processed at time zero.
[0082] (7) There is only one handling device.
[0083] (8) The handling equipment can only carry one workpiece at a time.
[0084] According to the above conditions, the mathematical model of FJSP in the resource balancing scenario is established, as shown in the following formulas 1 to 3:
[0085] Formula 1:
[0086] Formula 2:
[0087] Formula 3: C jh =C jh1 +C jh2 +C jh3 +C jh4 +C jh5 +t1+t2
[0088] Where Cm is the objective function, which is the minimum and maximum total processing completion time; Cj is the total processing completion time of each workpiece; Cjh is the total processing time of each workpiece process, which is composed of loading time Cjh1, transporting time Cjh2, processing time Cjh3, transporting time Cjh4, unloading time Cjh5, transporting work start delay time t1 and transporting work end delay time t2.
[0089] Correspondingly, in the embodiment of the present application, the FJSP model is subject to the following conditional constraints of Formula 4 to Formula 14:
[0090] Formula 4: s jh +x ijh× p ijh≤ c jh
[0091] Where: i = 1, 2, 3, ..., m; j = 1, 2, 3, ..., n; h = 1, 2, 3, ..., h j
[0092] Formula 5: c jh≤ s j(h+1)
[0093] Where j = 1, 2, 3, ..., n; h = 1, 2, 3, ..., h j -1
[0094] Formula 6:
[0095] Where j = 1, 2, 3, ..., n
[0096] Formula 7: s jh +p ijh≤ s kl +L(1-y ijhkl )
[0097] Where: j = 1, 2, 3, ..., n; k = 1, 2, 3, ..., n; h = 1, 2, 3, ..., h j ; l=1,2,3,...,h k ; i=1,2,3,...,m
[0098] Formula 8: c jh≤ s j(h+1) +L(1-y ijkl(h+1) ) (8)
[0099] Where: j = 1, 2, 3, ..., n; k = 1, 2, 3, ..., n; h = 1, 2, 3, ..., h j -1; l = 1, 2, 3, ..., h k; i=1,2,3,...,m
[0100] Formula 9:
[0101] Where j = 1, 2, 3, ..., n; h = 1, 2, 3, ..., h j
[0102] Formula 10:
[0103] Where: i = 1, 2, 3, ..., m; k = 1, 2, 3, ..., n; l = 1, 2, 3, ..., h k
[0104] Formula 11:
[0105] Where: i = 1, 2, 3, ..., m; j = 1, 2, 3, ..., n; h = 1, 2, 3, ..., h k
[0106] Formula 12: s jh ≥0,c jh ≥0 (12)
[0107] Where j = 1, 2, 3, ..., n; h = 1, 2, 3, ..., h j
[0108] Formula 13: TS jh +TP jh ≤ TS kl +L(1-z jhkl ) (13)
[0109] Where: j = 1, 2, 3, ..., n; k = 1, 2, 3, ..., n; h = 1, 2, 3, ..., h j ; l=1,2,3,...,h k
[0110] Formula 14: TE jh≤ TS j(h+1) +L(1-z jkl(h+1) ) (14)
[0111] Where: j = 1, 2, 3, ..., n; k = 1, 2, 3, ..., n; h = 1, 2, 3, ..., h j -1; l = 1, 2, 3, ..., h k
[0112] The meaning of the symbols and data range in the above formula are as follows:
[0113] m: total number of machines
[0114] n: total number of workpieces
[0115] Ω: total machine set
[0116] i,e: machine serial number, i,e=1,2,3,....,m
[0117] j,k: workpiece serial number, j,k=1,2,3,....,n
[0118] h j : Total number of processes for the jth job
[0119] l: process number, l = 1, 2, 3, ..., h j
[0120] C m :Minimum and maximum completion time
[0121] C max : Maximum completion time
[0122] C jh : Total processing time of the hth process of the jth workpiece
[0123] C j : The total completion time of the jth job
[0124] C jh1 : Loading time of the hth process of the jth workpiece
[0125] C jh2 : The time it takes to transport the jth workpiece to the hth process
[0126] C jh3 : The processing time of the hth process of the jth workpiece
[0127] C jh4 : The time it takes to transport the jth workpiece in the hth process
[0128] C jh5 : The unloading time of the hth process of the jth workpiece
[0129] t1: The delay time of transporting the jth workpiece to the hth process
[0130] t2: The delay time of the jth workpiece in the hth process
[0131] Ω jh : The set of optional processing machines for the hth process of the jth workpiece
[0132] m jh: The number of optional processing machines for the hth process of the jth workpiece
[0133] O jh : The hth process of the jth workpiece
[0134] M ijh : The hth process of the jth workpiece is processed on machine i
[0135] p ijh : The processing time of the hth process of the jth workpiece on machine i
[0136] s jh : The start time of the hth process of the jth workpiece
[0137] c jh : The processing completion time of the hth process of the jth workpiece
[0138] TS jh : The start time of the hth process of the jth workpiece
[0139] TE jh : The hth process handling completion time of the jth workpiece
[0140] TP jh : The handling time of the hth process of the jth workpiece on the handling machine
[0141] L: a sufficiently large positive number
[0142] d j : Delivery date of the jth workpiece
[0143] T0: Total number of all workpiece operations
[0144]
[0145] It should be noted that, in the above formulas, formula (4) and formula (5) represent the process sequence constraints of each workpiece; formula (6) represents the completion time constraint of the workpiece, that is, the completion time of each workpiece cannot exceed the total completion time; formula (7) and formula (8) indicate that the same machine can only process one process at the same time; formula (9) represents the machine constraint, that is, the same process can only be processed by one machine at the same time; formula (10) and formula (11) indicate that each machine has a cycle operation; formula (12) indicates that each parameter variable must be a positive number; formula (13) and formula (14) indicate that the handling equipment can only handle one process at the same time.
[0146] Step 202, using the workshop production scheduling model and combining the sparrow algorithm to generate candidate individuals corresponding to the model parameters.
[0147] In the embodiment of the present application, the computer device will first preset the model parameters before establishing the model. In one example, the model parameters include at least one of a population number parameter, an iteration number parameter, a subpopulation ratio parameter, and a safety threshold parameter. The workshop production scheduling model is constructed by the model.
[0148] In the embodiment of the present application, during the population initialization phase, PopNum individuals will be randomly generated.
[0149] In the embodiment of the present application, each candidate individual includes machine selection coding information and process sorting coding information. Among them, in the machine selection part coding, each gene bit is represented by an integer, and is arranged in the order of workpieces and workpiece processes, and each integer represents the sequence number of the processing machine selected by the current process in the optional machine set. In the process sorting part coding, the length of the process sorting part coding is the sum of the processes of all workpieces. Each gene bit is directly encoded with the workpiece number, and the order in which the workpiece number appears represents the order of processing between the workpiece processes.
[0150] Step 203: determine the fitness value corresponding to the candidate individual.
[0151] In the embodiment of the present application, the fitness value is associated with the working time represented by the processing step corresponding to the individual, which will not be described in detail here.
[0152] Step 204, assigning the candidate individuals to a population based on the fitness values.
[0153] In an embodiment of the present application, the populations corresponding to the candidate individuals include an optimal sub-population, an initial discoverer sub-population, and an initial joiner sub-population, and the population allocation criteria for the optimal sub-population, the initial discoverer sub-population, and the initial joiner sub-population are the fitness of the candidate individuals.
[0154] In the embodiment of the present application, the fitness values of individuals in the population are sorted from small to large, and the first PopNum*r1 individuals are taken to form the optimal sub-population, that is, the optimal sub-population, the first PopNum*r2 individuals are taken to form the discoverer sub-population, that is, the population, and the last PopNum*r3 individuals are taken to form the initial joiner sub-population, that is, the joiner sub-population before the update; the individual with the smallest fitness value in the population is taken as the optimal scheduling solution, and the individual with the largest fitness value is taken as the worst scheduling solution. Among them, r1, r2 and r3 are all preset ratio parameters.
[0155] Step 205, determining the position vector of the sparrow individual corresponding to the candidate individual.
[0156] In the embodiment of the present application, this process is the process of converting all scheduling solutions in the population into individual sparrow position vectors through a conversion mechanism.
[0157] Optionally, in some embodiments of the present application, for the machine selection part encoding, the following formula 15 is called to convert the selected machine number of the corresponding process into the individual position vector element value:
[0158] Formula 15:
[0159] In the formula, x(i) represents the i-th element of the individual position vector; s(i) represents the number of machines that can be selected for the process corresponding to element i; h(i)∈[1,s(i)] represents the serial number of the selected machine in the optional machine set, n represents the total number of workpieces, and if s(i)=1, then x(i) can take any value in [-n,n]. For the process sorting part encoding, a set of random numbers corresponding to the process sorting scheme is generated in [-n,n], and a unique ROV value is assigned to each random number according to the ascending order (ROV) rule, so that each ROV value corresponds to a process, and then the ROV values are rearranged according to the coding order of the process. The order of random numbers corresponding to the obtained ROV values is the value of each element in the individual position vector, and the sparrow individual position corresponding to the optimal scheduling solution is used as the current optimal sparrow individual position; the sparrow individual position corresponding to the worst scheduling solution is used as the current worst sparrow individual position.
[0160] Step 206, based on the individual sparrow position vectors, the initial discoverer sub-population and the initial joiner sub-population are updated to obtain the discoverer population, the joiner population and the alerter sub-population.
[0161] In an embodiment of the present application, by generating a scheduling interface and combining it with a random warning value generation mechanism, the optimal sub-population, the initial discoverer sub-population and the initial joiner sub-population are updated to obtain the discoverer population, the joiner population and the alerter sub-population.
[0162] In one example, the process includes:
[0163] For all individuals in the discoverer subpopulation, a warning value R2 is randomly generated, where R2 is a random number in (0,1], and a safety threshold ST is set. If R2 < ST, the first formula in the discoverer update formula of the sparrow search algorithm is used to update all individuals in the discoverer population; otherwise, the second formula in the discoverer update formula of the sparrow search algorithm is used to update all individuals in the discoverer population. The specific steps are as follows:
[0164] The discoverer update formula is shown in Formula 16 below:
[0165] Formula 16:
[0166] Among them: i represents the i-th sparrow, j represents the dimension of the problem; t represents the current iteration number; represents the position of the i-th sparrow in the j-th dimension at the t+1-th iteration; T is the maximum number of iterations; u is a random number between (0,1]; R2(R2∈[0,1]) and ST(ST∈[0.5,1.0]) represent the warning threshold and safety threshold respectively; Q is a random number and satisfies the normal distribution; L is a 1×d matrix (d represents the dimension) in which all elements are 1.
[0167] 3g) For all individuals in the participant population, according to the participant position update formula, select the corresponding iterative formula to complete the update of all individuals in the participant population. The specific steps are:
[0168] The position update formula of the joiner is shown in Formula 17 below:
[0169] Formula 17:
[0170] Where: x p (t+1) represents the global optimal individual position in the t+1th generation; x worst (t) represents the global worst individual position in the tth generation; PopNum represents the size of the sparrow population; A represents a 1×d matrix that randomly assigns 1 or -1 to each element, and A + =A T (AA T ) -1 .
[0171] In the updated discoverer and joiner sub-populations, PopNum*r4 individuals are randomly selected to form the vigilant sub-population, and the sparrow search algorithm based on the optimal sub-population is used to update the vigilants.
[0172] That is, the process includes: determining the optimal sub-population, the initial discoverer sub-population and the initial joiner sub-population based on individual fitness values; generating random warning values for population individuals in the initial discoverer sub-population; generating a discoverer population based on the random warning values; updating the joiner population based on the initial joiner sub-population; selecting and updating from the discoverer population and the joiner population to obtain the initial alerter sub-population.
[0173] Optionally, the embodiment of the present application also provides a process for updating a sub-population of alerters. In this case, individuals are randomly selected from the discoverer population and the joiner population to form a primary sub-population of alerters;
[0174] The preliminary selected sentinel subpopulation is updated based on an update formula to obtain a sentinel subpopulation, wherein the update formula is associated with the fitness value, the global optimal position and the individual position.
[0175] In one example, the update formula of the vigilant subpopulation is shown in Formula 18 below:
[0176] Formula 18:
[0177] In the formula, f i 、f g and f w They are the current individual sparrow’s fitness value and the global best and worst fitness values; X best is the current global optimal position; X subbest is the position of the randomly selected individual in the optimal subpopulation; r5 is the optimal subpopulation threshold; r is a random number between [0,1]; K is a random number between [-1,1]; β is called the step size control parameter; ε is the smallest constant to avoid zero in the denominator. In the first case, the vigilant subpopulation will be updated to learn according to the optimal solution, and in the second case, the vigilant subpopulation will be updated to learn according to a random solution in the set of optimal multiple solutions.
[0178] Step 207, determining the scheduling solutions corresponding to the candidate individuals in the discoverer population, the joiner population, and the vigilant sub-population.
[0179] In the embodiment of the present application, this process is the process of converting the determined individual position vector of the sparrow into a scheduling solution.
[0180] In one example, the specific method is:
[0181] (1) Machine selection coding information: The calculation formula for obtaining the process selection processing machine number is shown in the following formula 19:
[0182] Formula 19:
[0183] Where: x ij Representation and process O ij The corresponding element value of the sparrow individual position vector; s ij Indicates that O can be processed ij The number of machines; h(i)∈round[1,s ij ] indicates the number of the selected machine, and round is the integer symbol; if s ij =1, then x ij It can take any value in [-n,n], 2n is the length of the position vector of the individual sparrow;
[0184] (2) Encoding information for process sorting: Assign a corresponding ROV value to each individual position element in ascending order, and then use the ROV value as the element number. By matching it with the process, a new sorting scheme can be constructed. The new sorting scheme is the converted scheduling solution. The value with the smallest fitness value is selected as the optimal scheduling solution. The machines and processes corresponding to the current optimal scheduling solution are sorted to form the flexible job shop scheduling solution.
[0185] Step 208, in response to determining the scheduling solution, determining the number of iterations.
[0186] When the number of iterations does not reach the iteration number threshold, in the embodiment of the present application, the fitness value determination process will be repeated.
[0187] Step 209, in response to the number of iterations reaching the iteration number threshold, determining the fitness values of the candidate individuals in the discoverer population, the joiner population, and the vigilant sub-population.
[0188] Step 210 , determining an optimal scheduling solution corresponding to the target work data and the work constraints based on the minimum value of the fitness value.
[0189] Step 211, generating and outputting process allocation results based on the optimal scheduling solution.
[0190] This process is to output the individual with the smallest fitness value in the crowd, obtain the optimal scheduling solution, and output the process allocation result based on the optimal scheduling solution.
[0191] Combination Figure 2 The output process of the process allocation results shown in the figure is as follows: Figure 3 A schematic diagram of a process for determining the fitness value corresponding to a candidate individual provided by an exemplary embodiment of the present application is shown. Please refer to Figure 3 , the process includes:
[0192] Step 301, decoding the machine selection coding information of the candidate individuals to obtain a machine sequence matrix and a time sequence matrix.
[0193] This process is the first stage decoding process, that is, the process of decoding the chromosomes of individuals. This process is divided into the decoding process of machine selection coding information and the decoding process of process order coding information.
[0194] In one example of the embodiment of the present application, the process of decoding the machine selection part is: reading from left to right and converting it into a machine order matrix J M and the time sequence matrix T. Where J M (j, h) represents the machine number J of process O of workpiece J M(j,·) represents the arrangement of the machine numbers of all processes of workpiece J in order of priority; T(j,h) represents the processing time of process O of workpiece J. M The relationship between (j,h) and T(j,h) is one-to-one.
[0195] Step 302, decoding the process sequence coding information to obtain a process decoding result.
[0196] In the embodiment of the present application, the process of decoding the process sorting part is: the chromosomes of the process sorting part are read from left to right in sequence. According to the corresponding machine sequence matrix and time sequence matrix mentioned above, the processing machine and processing time corresponding to each workpiece process are obtained in sequence, and the process is arranged to obtain the scheduling result.
[0197] Step 303, determining the start time and end time of the preliminary selection process corresponding to the candidate individual based on the machine sequence matrix, the time sequence matrix and the process decoding result.
[0198] In the embodiment of the present application, the process includes:
[0199] First, read a gene of the OS part and convert it into the corresponding process Ojh; then, obtain the processing machine Mi = JM (j, h) and processing time pijh = T (j, h) of process Ojh through the machine sequence matrix JM and the time sequence matrix T; then, if process Ojh is the first processing process on machine Mi, then it can be processed directly from the end time of its previous process Oj (h-1). If process Ojh is the first process of workpiece Jj, then it can be processed directly from the zero time of machine Mi. Otherwise, find all the interval idle time periods [TSi, TEi] on machine Mi, TSi represents the start time of the interval time period, and TEi represents the end time of the interval idle time period. According to the following formula 20, the earliest processing time ta of process Ojk can be obtained, which can meet the order constraint of workpiece processing procedures:
[0200] Formula 20: ta = max{cj(h-1),TSi} (15)
[0201] Determine whether the interval idle time period meets the insertion condition according to the following formula 21. If so, insert it into the current idle time period; otherwise, process on machine Mi at time tb according to formula 22, where LMi represents the end time of the last process of the current machine Mi.
[0202] Formula 21: ta+pijh<=TEi
[0203] Formula 22: tb = max{cj(h-1),LMi}
[0204] After that, it is determined whether the chromosomes of the OS part have been read. If they are satisfied, the process ends; otherwise, the gene reading process continues. After the reading is completed, the completion time of each machine and the start and end time of each process are output.
[0205] Step 304, performing a transport conflict check on the start time and the end time of the preliminary selection process.
[0206] In the embodiment of the present application, the transport conflict check is used to check whether a transport device will conflict during an application process.
[0207] Step 305, based on the inspection result of the transport conflict inspection, the start time and the end time of the preliminary process are updated to obtain the processing start time, processing end time, machine completion time and maximum completion time.
[0208] Step 306, determining the fitness value corresponding to the candidate individual based on the processing start time, processing end time, machine completion time and maximum completion time.
[0209] After the inspection of the stem map handling process is completed and the corresponding data is updated, the processing start time, processing end time, machine completion time and maximum completion time can be determined, and the fitness value can be updated accordingly.
[0210] The update process is as follows: Figure 4 As shown, the process includes:
[0211] Step 401, determining the transport process based on the transport equipment conditions.
[0212] In an example, the processing time of each process is divided into five sections: loading time, leading transport time, processing time, trailing transport time and unloading time, and the starting time of leading transport and the starting time of trailing transport of each process can be obtained.
[0213] Step 402 : Generate a transport start time matrix based on the transport process and processing process constraints.
[0214] In the embodiment of the present application, the transport start time matrix includes at least two intervals for indicating the transport start time.
[0215] In an embodiment of the present application, the process is to place the two transport start times of each workpiece process, namely the start time of the front transport and the start time of the post transport, in the order of processing machine 1 to processing machine n into a matrix M, and divide M into n intervals, M1-Mn, each interval representing all transport start times on each machine.
[0216] In this case, M transport times will be stored in the matrix PT.
[0217] Step 403: Arrange the intervals in ascending order based on the transport start time to obtain an ascending matrix.
[0218] The process is to arrange the transport start times in M in ascending order and put them into another matrix B, and store the indexes of the data in B in M in the E matrix in sequence, that is, satisfying the relationship M(E(i))=B(i).
[0219] Step 404, sorting the transport start time of the ascending matrix in combination with the process loading start time and the process loading end time, so as to update the preliminary process start time and the preliminary process end time, and obtain the processing start time, processing end time, machine completion time and maximum completion time.
[0220] In the embodiment of the present application, for the elements in the arranged B matrix, it is determined whether the process of processing the workpiece corresponding to the next transport time (recorded as B(i)) is the first process.
[0221] When it is the first process, the next transport start time (denoted as B(i)) is compared with the previous transport start time (denoted as B(i-1)) plus the transport time corresponding to the previous transport start time (PT(E(i-1))). If the latter is larger, find the difference between the two t (t=B(i-1)+PT(E(i-1))-B(i)). At this time, find the position of B(i) in the interval M1-Mn, find B(i) and all the numbers after it in this interval, and find the positions in the matrix B corresponding to these numbers, and add t to these numbers corresponding to the positions in B.
[0222] When it is not the first process, determine whether B(i) corresponds to the lead-time. If it is the lead-time, find the loading start time (recorded as StartTime) of the process corresponding to B(i) and the end time (recorded as EndTime) of the previous process corresponding to B(i), and determine whether StartTime is greater than EndTime. If it is judged that StartTime is less than EndTime, it means that the processing sequence requirements of the process are not met, and there is a conflict between the previous process and the current process, so the current process needs to be adjusted, and t1 = EndTime-StartTime; compare the next transport start time (denoted as B(i)) with the previous transport start time (denoted as B(i-1)) plus the transport time corresponding to the previous transport start time (PT(E(i-1))). If the latter is larger, find the difference t2 between the two (t2 = B(i-1) + PT(E(i-1))-B(i)), take t = max(t1, t2), if the latter is smaller, take t = t1, find the position of B(i) in the interval M1-Mn, find B(i) and all the numbers after it in this interval, and find the positions in the matrix B corresponding to these numbers, and add t to these numbers corresponding to the positions in B.
[0223] When it is not the first process and it is the post-transfer time, if it is judged that StartTime is greater than EndTime, it means that the processing sequence requirements of the process are met, and there is no conflict between the previous process and the current process, so the current process does not need to be adjusted; the next transfer start time (denoted as B(i)) is compared with the previous transfer start time (denoted as B(i-1)) plus the transfer time corresponding to the previous transfer start time (denoted as PT(E(i-1))). If the latter is larger, find the difference t2 between the two (t2=B(i-1)+PT(E(i-1))-B(i)), t=t2.
[0224] Continue to compare the next transport start time in B with the previous transport start time until all transport start times in B are updated, then restore all times in B to M in index order. At this time, all transport start times in M have been updated and no conflict will occur.
[0225] In this case, the processing start time, processing end time, machine completion time and maximum completion time can be obtained.
[0226] To summarize, the method provided in the embodiment of the present application, in the process of solving the scheduling problem in the flexible workshop, after obtaining the working parameters and working objectives, by taking the target processing data and the corresponding working constraints as reference objects, based on the improved sparrow algorithm, an optimal solution corresponding to the processing process is generated, which can solve the scheduling problem of the flexible workshop in the resource balancing scenario.
[0227] The method provided in the embodiment of the present application adopts an improved sparrow algorithm to improve the guard formula. Compared with the traditional sparrow algorithm, the result is less likely to fall into the local optimum, and two-stage decoding is used in the algorithm solving process, which further solves the problem of flexible workshop scheduling in the resource balancing scenario.
[0228] The above are only optional embodiments of the present application and are not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application should be included in the protection scope of the present application.
Claims
1. A flexible workshop scheduling method based on the sparrow algorithm, characterized in that: The method is applied in a computer device, and the method comprises: Acquire work target data and work parameters corresponding to a target flexible workshop, wherein the work target data is used to indicate the work target of the target flexible workshop, and the work target data and the work parameters are associated with a target workpiece and a processing machine of the target flexible workshop; Generate at least two working constraints corresponding to the target flexible workshop based on the working parameters; Input the work target data and the work constraint conditions into the workshop production scheduling model, and output the process allocation result; the workshop production scheduling model is a mathematical model based on the improved sparrow algorithm; Based on the process allocation result, an allocation processing result corresponding to the processing workpiece and the processing machine in the flexible workshop is generated.
2. The method according to claim 1, characterized in that In the process of obtaining the work target data and work parameters corresponding to the target flexible workshop: The work target data includes workpiece target number data and workpiece processing procedure data; The workpiece processing procedure data is used to indicate the processing procedure sequence and the processing machine corresponding to the processing procedure sequence.
3. The method according to claim 2, characterized in that The constraint conditions include at least one of a processing tool constraint condition, a process constraint condition, a processing priority condition, a processing start time condition, a handling equipment condition, and a processing continuity condition.
4. The method according to claim 3, characterized in that The workshop production scheduling model is a mathematical model based on the improved sparrow algorithm in a resource balancing scenario.
5. The method according to claim 4, characterized in that The method further comprises: Preset model parameters, wherein the model parameters include at least one of a population number parameter, an iteration number parameter, a subpopulation ratio parameter, and a safety threshold parameter; The workshop production scheduling model is constructed based on the model parameters.
6. The method according to claim 4, characterized in that The step of inputting the work target data and the work constraint conditions into the workshop production scheduling model and outputting a process allocation result includes: Inputting the target work data and the work constraint conditions into the workshop production scheduling model; By using the workshop production scheduling model and combining the sparrow algorithm, candidate individuals corresponding to the model parameters are generated, each candidate individual including machine selection coding information and process sorting coding information; Determining a fitness value corresponding to the candidate individual; Based on the fitness value, the candidate individuals are assigned to populations, the populations corresponding to the candidate individuals include an optimal sub-population, an initial discoverer sub-population, and an initial joiner sub-population, and the population assignment criteria of the optimal sub-population, the initial discoverer sub-population, and the initial joiner sub-population are the fitness of the candidate individuals; Determine the sparrow individual position vector corresponding to the candidate individual; Based on the individual position vector of the sparrow, the initial discoverer subpopulation and the initial joiner subpopulation are updated to obtain a discoverer population, a joiner population and a vigilant subpopulation; Determine scheduling solutions corresponding to candidate individuals in the discoverer population, the joiner population, and the vigilant sub-population; In response to determining the scheduling solution, determining a number of iterations; In response to the number of iterations reaching an iteration number threshold, determining the fitness values of the candidate individuals in the discoverer population, the joiner population, and the vigilant sub-population; Determine an optimal scheduling solution corresponding to the target work data and the work constraint condition based on the minimum value of the fitness value; A process allocation result is generated and output based on the optimal scheduling solution.
7. The method according to claim 5, characterized in that The determining of the fitness value corresponding to the candidate individual includes: Decoding the machine selection coding information of the candidate individuals to obtain a machine sequence matrix and a time sequence matrix; Decoding the process sequence coding information to obtain a process decoding result; Determine the start time and end time of the preliminary selection process corresponding to the candidate individual based on the machine sequence matrix, the time sequence matrix and the process decoding result; Performing a transport conflict check on the start time of the preliminary selection process and the end time of the preliminary selection process; Based on the inspection result of the transport conflict inspection, the start time of the preliminary selection process and the end time of the preliminary selection process are updated to obtain the processing start time, processing end time, machine completion time and maximum completion time; The fitness value corresponding to the candidate individual is determined based on the processing start time, the processing end time, the machine completion time and the maximum completion time.
8. The method according to claim 7, characterized in that Based on the inspection result of the transport conflict inspection, the start time of the preliminary selection process and the end time of the preliminary selection process are updated to obtain the processing start time, processing end time, machine completion time and maximum completion time, including: Determining a handling process based on the handling equipment conditions; generating a transport start time matrix based on the transport process and the processing process constraint condition, wherein the transport start time matrix includes at least two intervals for indicating the transport start time; Arranging the intervals in ascending order based on the transport start time to obtain an ascending matrix; The ascending matrix is combined with the process loading start time and the process loading end time to sort the transportation start time, so as to update the preliminary process start time and the preliminary process end time, and obtain the processing start time, the processing end time, the machine completion time and the maximum completion time.
9. The method according to claim 6, characterized in that The initial discoverer subpopulation and the initial joiner subpopulation are updated based on the individual sparrow position vector to obtain a discoverer population, a joiner population and a vigilant subpopulation; Determine the optimal subpopulation, the initial discoverer subpopulation, and the initial joiner subpopulation based on individual fitness values; Generating random warning values for population individuals in the initial discoverer subpopulation; generating the discoverer population based on the random warning value; Based on the initial joiner subpopulation, a joiner population is obtained by updating; The vigilant sub-population is obtained by selecting and updating from the discoverer population and the joiner population.
10. The method according to claim 9, characterized in that The step of selecting and updating from the discoverer population and the joiner population to obtain the alerter sub-population includes: Randomly select individuals from the discoverer population and the joiner population to form a primary vigilant sub-population; The preliminary selected sentinel subpopulation is updated based on an update formula to obtain the sentinel subpopulation, wherein the update formula is associated with the de-fitness value, the global optimal position and the individual position.
Citation Information
Cited By
Flexible workshop scheduling optimization method based on meta-heuristic algorithm
CN121684562A
Flexible job shop scheduling optimization method based on meta-heuristic algorithm
CN121684562B
Dynamic scheduling optimization method for intelligent manufacturing workshop
CN122155323A
