Production line scheduling method, device and equipment based on genetic algorithm
By introducing a second population of the solved scheduling problem into the genetic algorithm, and using encoding mapping and neural network optimization of feature mapping to guide the search of the first population, the problem of long solution time in the prior art is solved, and the efficiency of production line scheduling is improved.
Patent Information
- Application Number
- CN202210309062.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-28
- Publication Date
- 2025-12-30
- Estimated Expiration
- 2042-03-28
AI Technical Summary
Existing genetic algorithms for solving production line scheduling problems cannot quickly obtain optimal scheduling solutions, resulting in low industrial production efficiency.
By introducing the second population corresponding to the solved scheduling problem, the first population is initialized using a pre-defined encoding mapping mechanism, and the first population is updated using a genetic algorithm. The feature mapping is optimized by combining the feature mapping function and the neural network model to guide the search direction of the first population, thus quickly obtaining the scheduling scheme for the problem to be solved.
It enables the rapid acquisition of optimal scheduling schemes under similar production conditions, thereby improving industrial production efficiency and reducing solution time.
Smart Images

Figure CN114943402B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of automatic control and information technology, and in particular to a production line scheduling method, device and equipment based on a genetic algorithm. BACKGROUND
[0002] The production line scheduling problem is an important problem in the field of industrial production, and its main task is to reasonably schedule the execution order of each production step of the production line under the constraints of actual production conditions (such as equipment, raw materials, labor, and inter-process dependencies), so as to achieve efficient use of production resources and improve production efficiency.
[0003] The genetic algorithm is a method of searching for an optimal solution by simulating the natural evolution process. This algorithm can convert the problem solving process into processes such as crossing and mutation of chromosome genes in biological evolution through mathematical means and computer simulation operations. Genetic algorithms often obtain good optimization results in solving optimization problems, and are therefore often used to solve production line scheduling problems. By encoding mapping to determine the individual corresponding to the scheduling scheme, combining multiple individuals into a population, selecting individuals with higher fitness in the population, crossing and mutating based on the individuals with higher fitness, iterating in turn, obtaining the individual with the highest fitness in the population at the end of iteration, and determining the scheduling scheme corresponding to the individual as the solution to the production line scheduling problem.
[0004] However, the above genetic algorithm-based solution to the production line scheduling problem only considers the solution to a single problem. For each new production line scheduling problem, a long time is required to obtain a better scheduling scheme, i.e., there is a problem of low industrial production efficiency. SUMMARY
[0005] The present application provides a production line scheduling method, device and equipment based on a genetic algorithm to solve the problem of low industrial production efficiency caused by the inability to quickly obtain a better scheduling scheme for the to-be-solved scheduling problem.
[0006] In a first aspect, the present application provides a production line scheduling method based on a genetic algorithm, which comprises:
[0007] According to a first scheduling problem to be solved in the production line, a first population corresponding to the first scheduling problem is initialized by a pre-set encoding mapping mechanism, and a second population corresponding to a second scheduling problem is determined according to the pre-set encoding mechanism; wherein the second scheduling problem is a scheduling problem in the production line that matches the first scheduling problem and has been solved; the first population includes a plurality of first individuals; the second population includes a plurality of second individuals; the second individual corresponds to a scheduling scheme of the second scheduling problem;
[0008] Based on the first population and the second population, the first population is updated using a genetic algorithm;
[0009] Based on the updated first group, determine the scheduling scheme corresponding to the first scheduling problem.
[0010] Optionally, before updating the first population using a genetic algorithm based on the first population and the second population, the method further includes:
[0011] Determine a feature mapping function for feature mapping of the second individual; the feature mapping function indicates that the second population formed by the second individual after feature mapping has the minimum statistical distance to the corresponding first population;
[0012] The second individual is feature-mapped according to the feature mapping function to obtain the mapped second individual, and the updated second population is obtained based on the mapped second individual.
[0013] Optionally, a feature mapping function for feature mapping of the second individual is determined, including:
[0014] The second individual is used as the input to the neural network model, the second population formed by the mapped second individual is used as the output of the neural network model, and the goal of training the neural network model is to minimize the statistical distance between the second population formed by the mapped second individual and the corresponding first population.
[0015] The function corresponding to the trained neural network model is determined as the feature mapping function.
[0016] Optionally, based on the first population and the second population, the first population is updated using a genetic algorithm, including:
[0017] Select the first individuals and the second individuals with the highest fitness from the first population and the second population, respectively;
[0018] The first group corresponding to the first scheduling problem is updated based on the selected plurality of first bodies and the plurality of second bodies.
[0019] Optionally, multiple individuals with the highest fitness are selected from the first population and multiple individuals with the highest fitness from the second population, including:
[0020] The scheduling scheme corresponding to each first entity and each second entity is determined through the encoding mapping mechanism;
[0021] Determine the total time for completing all production steps of the production line scheduling corresponding to each scheduling scheme, and determine the fitness of the scheduling scheme based on the total time; the fitness is negatively correlated with the total time.
[0022] The fitness of each first individual and each second individual is determined based on the fitness of each scheduling scheme. Then, m first individuals are selected from the first population in descending order of fitness, and n second individuals are selected from the second population in descending order of fitness.
[0023] Optionally, updating the first group corresponding to the first scheduling problem based on the selected plurality of first bodies and the plurality of second bodies includes:
[0024] Select the m1 individuals with the highest fitness from the selected m individuals, and add the m1 individuals to the updated first population; the updated first population is the next generation first population;
[0025] Select the n1 second individuals with the highest fitness from the selected n second individuals, and add the n1 second individuals to the updated first population;
[0026] New individuals are obtained from m2 first individuals and n2 second individuals through gene segment crossover and / or gene segment perturbation mutation, and the new individuals are added to the updated first population; wherein, the m2 first individuals are multiple first individuals other than m1 first individuals from the m first individuals; and the n2 second individuals are multiple second individuals other than n1 second individuals from the n second individuals.
[0027] Optionally, determining the scheduling scheme corresponding to the first scheduling problem based on the updated first group includes:
[0028] Obtain a pre-set termination condition; the pre-set termination condition is that the number of iterations reaches a preset number or the maximum fitness of the first individual in the first population reaches a preset fitness.
[0029] When the termination condition is that the number of iterations reaches a preset number, the iteration number corresponding to the current iteration execution step is obtained; when the number of iterations reaches the preset number, the termination condition of the iteration is determined to be met; when the number of iterations does not reach the preset number, the iteration number is updated, and the step of updating the first population continues; and / or,
[0030] When the termination condition is that the maximum fitness of the first individual in the first population reaches a preset fitness, the maximum fitness of the first individual in the first population is obtained. When the maximum fitness reaches the preset fitness, it is determined that the termination condition of the iteration is met. When the maximum fitness does not reach the preset fitness, the step of updating the first population continues.
[0031] When the termination condition of the iteration is met, the process of selecting the individual with the highest fitness from the first population is performed, and the scheduling scheme corresponding to the individual with the highest fitness is obtained. The determined scheduling scheme is then identified as the scheduling scheme corresponding to the first scheduling problem.
[0032] Secondly, this application provides a production line scheduling device based on a genetic algorithm, the device comprising:
[0033] The population determination module is used to initialize a first population corresponding to a first scheduling problem to be solved in the production line through a preset encoding mapping mechanism, and to determine a second population corresponding to a second scheduling problem according to the preset encoding mechanism; wherein, the second scheduling problem is a scheduling problem in the production line that matches the first scheduling problem and has been solved; the first population includes multiple first individuals; the second population includes multiple second individuals; the second individuals correspond to the scheduling scheme of the second scheduling problem;
[0034] The update module is used to update the first population using a genetic algorithm based on the first population and the second population.
[0035] The scheme determination module is used to determine the scheduling scheme corresponding to the first scheduling problem based on the updated first population.
[0036] Thirdly, this application provides a production line scheduling device based on a genetic algorithm, comprising: at least one processor and a memory;
[0037] The memory stores computer-executed instructions;
[0038] The at least one processor executes computer execution instructions stored in the memory, causing the at least one processor to perform the method as described in any of the first aspects.
[0039] Fourthly, this application provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the method described in any of the first aspects.
[0040] This invention provides a production line scheduling method, apparatus, and equipment based on a genetic algorithm. The method includes: initializing a first population corresponding to a first scheduling problem to be solved in the production line through a preset encoding mapping mechanism, and determining a second population corresponding to a second scheduling problem according to the preset encoding mechanism; wherein, the second scheduling problem is a scheduling problem in the production line that matches the first scheduling problem and has been solved; the first population includes multiple first individuals; the second population includes multiple second individuals; the second individuals correspond to the scheduling scheme of the second scheduling problem; updating the first population using a genetic algorithm based on the first population and the second population; determining the scheduling scheme corresponding to the first scheduling problem based on the updated first population; and obtaining a population of scheduling schemes corresponding to the solved second scheduling problem, which provides a better solution direction for the first scheduling problem to be solved, thereby quickly obtaining a scheduling scheme for the problem to be solved, and thus improving industrial production efficiency. Attached Figure Description
[0041] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0042] Figure 1 This invention provides an application scenario illustration;
[0043] Figure 2 A flowchart illustrating a production line scheduling method based on a genetic algorithm provided by this invention;
[0044] Figure 3 A schematic diagram of a process for modifying the second group provided by the present invention;
[0045] Figure 4 A flowchart illustrating a method for selecting multiple individuals with the highest fitness in a first population and a second population, provided by this invention;
[0046] Figure 5 A schematic diagram of a production line scheduling device based on a genetic algorithm provided by the present invention;
[0047] Figure 6 This is a schematic diagram of the hardware structure of a production line scheduling device based on a genetic algorithm, provided by the present invention. Detailed Implementation
[0048] The technical solutions of this invention will now be clearly and completely described with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this invention, and not all of them. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.
[0049] The terms “first,” “second,” “third,” “fourth,” etc. (if present) in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that embodiments of the invention described herein can be implemented, for example, in orders other than those illustrated or described herein. Furthermore, the terms “comprising” and “having,” and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0050] Figure 1 This is a schematic diagram of an application scenario provided by the present invention, such as... Figure 1 As shown, the production line scheduling problem typically involves a production task with multiple steps, each with its own production time and resource requirements. Solving the scheduling problem involves optimizing the start and finish times of each production step under production constraints to minimize the total production time. These production constraints include the order constraints and resource constraints (equipment, raw materials, and labor resources). When solving the problem, the production line scheduling equipment first determines a randomly initialized first population corresponding to the problem. Simultaneously, it obtains a second population based on previously solved scheduling schemes. A genetic algorithm is then used to update the first population based on sampling from both populations. Finally, the updated first population is used to determine the scheduling scheme for the remaining problem.
[0051] In existing technologies, determining the scheduling scheme for a problem typically relies solely on genetic algorithms. This means that each time a new problem arises, a genetic algorithm must be used to search for and obtain a scheduling scheme from a randomly initialized population. Consequently, determining a superior scheduling scheme takes a considerable amount of time.
[0052] We consider that when facing a problem to be solved, we often already possess scheduling schemes for previously solved scheduling problems. These established schemes contain knowledge specific to scheduling problems. Applying this knowledge to the solution process of the problem to be solved can accelerate the determination of the solution direction, thereby quickly obtaining a scheduling scheme and improving industrial production efficiency. Furthermore, there is a certain correlation between the solved scheduling problems and the problem to be solved. For example, the scheduling problems before and after changes in production conditions on a production line can be considered as the solved and the problem to be solved, respectively.
[0053] To address the aforementioned issues, the production line scheduling method based on genetic algorithms provided by this invention retains the process of starting the search from a randomly initialized first population, while also introducing a second population corresponding to the solved scheduling problem. Based on the second population, a better search direction can be provided for the update process of the first population, thereby achieving the goal of quickly obtaining the scheduling scheme for the problem to be solved.
[0054] The technical solution of the present invention will be described in detail below with reference to specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments.
[0055] Figure 2 A flowchart illustrating a production line scheduling method based on a genetic algorithm provided by this invention is shown below. Figure 2 As shown, the execution entity of the method is a production line scheduling device based on a genetic algorithm, which is installed on a production line scheduling device based on a genetic algorithm. The method includes:
[0056] Step S201: Based on the first scheduling problem to be solved in the production line, initialize the first group corresponding to the first scheduling problem through a preset encoding mapping mechanism, and determine the second group corresponding to the second scheduling problem according to the preset encoding mechanism; wherein, the second scheduling problem is a scheduling problem in the production line that matches the first scheduling problem and has been solved; the first group includes multiple first individuals; the second group includes multiple second individuals; the second individuals correspond to the scheduling scheme of the second scheduling problem.
[0057] The first scheduling problem refers to the production line scheduling problem to be solved, while the second scheduling problem is the production line scheduling problem that has already been solved. The second scheduling problem and the first scheduling problem are matched. Matching means that the first scheduling problem and the second scheduling problem are similar. For example, the second scheduling problem corresponds to the second production condition, while the first production condition corresponding to the first scheduling problem is only slightly different from the second production condition. For example, the total amount of production resources may change, or the order of each production step may change.
[0058] To determine whether the first scheduling problem and the second scheduling problem are similar, we can judge based on the corresponding production conditions manually. Alternatively, we can obtain the production conditions corresponding to the first scheduling problem and the second scheduling problem respectively, and determine the similarity between the two production conditions based on preset evaluation indicators. When the similarity is greater than the preset value, it means that the second scheduling problem and the first scheduling problem are matched. That is, the scheduling scheme corresponding to the second scheduling problem can be used to guide the solution process of the first scheduling problem.
[0059] When solving the first scheduling problem, a genetic algorithm is used. First, a pre-defined encoding mapping mechanism M needs to be determined for the first scheduling problem. Based on this mechanism, any scheduling scheme can be mapped to a first individual with specific genetic characteristics in the genetic algorithm, i.e., G = M(S), where S represents the scheduling scheme, G represents the individual, and each individual is represented as a vector of a specified dimension. Multiple first individuals are obtained, and these multiple first individuals can be combined to form the first population P(0). The first individual obtained here is randomly generated based on the pre-defined encoding mechanism.
[0060] Furthermore, to guide the solution process of the first scheduling problem using the scheduling scheme corresponding to the second scheduling problem, a pre-defined encoding mechanism for the first scheduling problem can be used to map the scheduling scheme of the second scheduling problem, resulting in multiple corresponding second entities. A second population is then derived based on these second entities. The number of scheduling schemes corresponding to the second scheduling problem can be multiple. The second population represents the knowledge population corresponding to the second scheduling problem. Subsequently, knowledge transfer methods can be used to guide the solution of the first scheduling problem using the knowledge contained within the knowledge population.
[0061] Step S202: Update the first population using a genetic algorithm based on the first population and the second population;
[0062] After obtaining the first and second populations, a genetic algorithm can be used to update the first population P(t) multiple times based on the two populations, where t represents the number of iterations, until the termination condition is met. This process mainly involves: obtaining multiple individuals with high fitness from the first and second populations respectively; and using these individuals with high fitness to generate an updated first population through genetic mutation, which is the next generation of the first population P(t+1). Fitness, a concept in genetic algorithms, refers to the relative ability of an individual to pass on its genes to its offspring gene pool under certain environmental conditions; it is a measure of an individual's survival and reproductive chances. Specifically, genes are represented as feature vectors with specific dimensions corresponding to an individual.
[0063] This process enables the inheritance of genes corresponding to individuals in the second population to the next generation of the first population when updating the first population, thereby transferring knowledge from the second population and quickly obtaining a scheduling solution for the first scheduling problem.
[0064] Step S203: Determine the scheduling scheme corresponding to the first scheduling problem based on the updated first group.
[0065] The process involves determining whether a termination condition is met after an update to the first group. If the termination condition is met, a scheduling scheme corresponding to the first scheduling problem can be determined based on the last updated first group. The termination condition can be the number of iterations or a preset fitness level. Specifically, multiple individuals with high fitness from the first group can be selected as the optimal solution to the first scheduling problem. Based on the obtained individuals, a preset encoding mapping mechanism M is used to remap them back to the scheduling scheme space, yielding the scheduling scheme corresponding to the optimal solution. This encoding mapping mechanism is a one-to-one mapping mechanism, meaning one scheduling scheme corresponds to one individual, and vice versa.
[0066] In this embodiment, to solve the first scheduling problem, a genetic algorithm based on knowledge transfer is used. A first population corresponding to the first scheduling problem is initialized through a preset encoding mapping mechanism. Simultaneously, a second population is determined based on the scheduling scheme corresponding to the second scheduling problem through the same preset encoding mapping mechanism. The first population is then updated using the genetic algorithm based on the first and second populations. The updated first population is then used to determine the scheduling scheme corresponding to the first scheduling problem. By obtaining a population with the solved scheduling scheme for the second scheduling problem, a better direction for solving the first scheduling problem is provided. This allows individuals in the updated first population to more quickly approach the final selected individuals, thereby rapidly obtaining a scheduling scheme for the problem and improving industrial production efficiency.
[0067] In the above method, the first scheduling problem and the second scheduling problem need to satisfy a matching relationship. When the matching degree between the two scheduling problems is low, a feature mapping step can be added to the second individual in the second population to correct the second population. This corrected second population can improve the guidance role in updating the first population to a certain extent.
[0068] Figure 3 This is a schematic diagram of a process for modifying the second group provided by the present invention.
[0069] Optionally, before updating the first population using a genetic algorithm based on the first population and the second population, the method further includes:
[0070] Step S301: Determine the feature mapping function for feature mapping of the second individual; the feature mapping function indicates that the second population formed by the second individual after feature mapping has the minimum statistical distance with the corresponding first population.
[0071] Before updating the first population using a genetic algorithm based on the first and second populations, steps S204 and S205 can be executed. When updating the second population, a feature mapping function F(t) needs to be determined first. Based on the feature mapping function, individuals G(i) can be mapped, and the updated second population F(t)(Q) is obtained from the mapped individuals. The feature mapping function must satisfy the requirement that the mapped second population and the first population have the minimum statistical distance. Each individual in the second population corresponds to a feature vector, thus containing multiple feature vectors. Simultaneously, the first population also corresponds to multiple feature vectors. The distance between the second and first populations can be measured based on statistical distance. The feature mapping function that minimizes the statistical distance is obtained through learning.
[0072] The feature mapping function can be determined through function optimization or based on neural network methods. The process of determining the feature mapping function using neural networks is explained in detail below.
[0073] Optionally, a feature mapping function for feature mapping of the second individual is determined, including:
[0074] The second individual is used as the input to the neural network model, and the second population formed by the mapped second individual is used as the output of the neural network model. The goal of training the neural network model is to minimize the statistical distance between the second population formed by the mapped second individual and the corresponding first population. The function corresponding to the trained neural network model is determined as the feature mapping function.
[0075] When using neural networks to determine the feature mapping function, traditional neural network models such as BP neural networks, convolutional neural networks, and recurrent neural networks can be employed. The feature vector corresponding to each second entity is used as the input to the neural network model. After learning by the neural network model, a second population composed of the second entities after feature mapping is obtained, and the second population is the output of the neural network model. The model learning process involves determining the statistical distance between the second population after feature mapping and the corresponding first population (initially the first population P(0) corresponding to random initialization, and subsequently the first population P(t) corresponding to each update). By minimizing the statistical distance as the optimization objective, after multiple learning iterations, the neural network model is determined as the corresponding feature mapping function.
[0076] The neural network method can quickly and accurately determine the feature mapping function, thereby reducing the time required to determine the updated second population.
[0077] Step S302: Perform feature mapping on the second individual according to the feature mapping function to obtain the mapped second individual, and obtain the updated second population based on the mapped second individual.
[0078] In this process, after determining the feature mapping function, feature mapping can be performed on each second individual based on the determined feature mapping function to obtain each second individual after mapping, and further to obtain the updated second population.
[0079] It should be noted that if a step to correct the second group is to be added, then steps S301 and S302 need to be executed every time the first group is iterated and updated.
[0080] By taking the above two steps, the second population can be updated, making the distance between the updated second population and the first population smaller, thereby strengthening the guiding role of the second population on the first population.
[0081] The following section details how to use a genetic algorithm to update the first population.
[0082] Optionally, based on the first population and the second population, the first population is updated using a genetic algorithm, including:
[0083] Select the first individuals and the second individuals with the highest fitness from the first population and the second population, respectively;
[0084] The first group corresponding to the first scheduling problem is updated based on the selected plurality of first bodies and the plurality of second bodies.
[0085] After obtaining the first and second populations, the fitness of each first individual in the first population and the fitness of each second individual in the second population can be calculated. Then, the top few first individuals with the highest fitness are selected from the first population, and the top few second individuals with the highest fitness are selected from the second population. Fitness represents the quality of the scheduling scheme corresponding to that individual after passing through a pre-defined encoding and mapping mechanism.
[0086] Figure 4 This is a flowchart illustrating a method for selecting multiple individuals with the highest fitness in a first and second population, as provided by the present invention.
[0087] Optionally, multiple individuals with the highest fitness are selected from the first population and multiple individuals with the highest fitness from the second population, including:
[0088] Step S401: Determine the scheduling scheme corresponding to each first entity and each second entity through the encoding mapping mechanism.
[0089] When selecting the first and second individuals with the highest fitness, it is necessary to first calculate the fitness of each individual. Specifically, an encoding mapping mechanism can be used to determine the scheduling scheme corresponding to each first individual. Since the encoding mapping mechanism is a one-to-one mapping process, that is, there is a one-to-one relationship between the individual and the scheduling scheme, a preset encoding mapping mechanism can be used to map the individuals to the scheduling scheme space, thereby obtaining the scheduling scheme corresponding to each first individual and each second individual.
[0090] Step S402: Determine the total time for completing all production steps of the production line scheduling corresponding to each scheduling scheme, and determine the fitness of the scheduling scheme based on the total time; the fitness is negatively correlated with the total time.
[0091] A scheduling plan represents the start and finish times of each production step. Once the scheduling plan is determined, the total time to complete all production steps on the production line can be obtained. The fitness of the scheduling plan can be measured based on the total time. A longer total time indicates lower fitness, while a shorter total time indicates higher fitness. In other words, the fitness of a scheduling plan is negatively correlated with the total time.
[0092] In addition, other indicators can be set to measure the merits of scheduling schemes. Based on multiple indicators, the fitness of each scheduling scheme can be determined by weighted summation.
[0093] Step S403: Determine the fitness of each first individual and each second individual according to the fitness of each scheduling scheme, and select m first individuals from the first population in descending order of fitness and n second individuals from the second population in descending order of fitness, respectively.
[0094] After determining the fitness for each scheduling scheme, the fitness for each first individual and each second individual can be determined accordingly. For the first group, all first individuals can be arranged in descending order of fitness, and the top m individuals with the highest fitness can be selected. Similarly, for the second group, all second individuals can be arranged in descending order of fitness, and the top n individuals with the highest fitness can be selected.
[0095] The above method can quickly and accurately identify individuals with higher fitness in the first and second groups, providing a basis for subsequent updates to the first group.
[0096] After obtaining multiple first individuals and multiple second individuals with high fitness, an updated first population can be obtained based on genetic variation.
[0097] By obtaining multiple first individuals and multiple second individuals with the highest fitness, the next generation of the first population is updated based on the determined multiple first individuals and multiple second individuals, so that the next generation of the first population not only contains the genes of the first individuals in the initial first population, but also the genes of the second individuals in the second population containing knowledge.
[0098] The process of obtaining the updated first population using specific genetic variation-based methods is described in detail below.
[0099] Optionally, updating the first group corresponding to the first scheduling problem based on the selected plurality of first bodies and the plurality of second bodies includes:
[0100] Select the m1 individuals with the highest fitness from the selected m individuals, and add the m1 individuals to the updated first population; the updated first population is the next generation first population;
[0101] Select the n1 second individuals with the highest fitness from the selected n second individuals, and add the n1 second individuals to the updated first population;
[0102] New individuals are obtained from m2 first individuals and n2 second individuals through gene segment crossover and / or gene segment perturbation mutation, and the new individuals are added to the updated first population; wherein, the m2 first individuals are multiple first individuals other than m1 first individuals from the m first individuals; and the n2 second individuals are multiple second individuals other than n1 second individuals from the n second individuals.
[0103] In this process, after selecting multiple first individuals from the first population and multiple second individuals from the second population, some of the first individuals and second individuals can be directly added to the next generation of the first population. Alternatively, some of the first individuals and second individuals can be mutated to obtain new individuals, and these new individuals can be added to the next generation of the first population.
[0104] Specifically, since the number of individuals selected in the first screening is m, the m1 individuals with the highest fitness can be selected and directly added to the first population of the next generation. The values of m and m1 can be set according to the actual situation and are not limited here.
[0105] Similarly, for the selected n second individuals, the n1 second individuals with the highest fitness are directly selected and added to the first population of the next generation. The values of n and n1 can be set according to the actual situation and are not limited here.
[0106] After the above operations, m first individuals are selected and m2 first individuals remain, and n second individuals are selected and n2 second individuals remain. New individuals are obtained by performing gene segment crossover and / or gene segment perturbation mutation on the m2 first individuals and n2 second individuals, and the new individuals are added to the next generation of the first population.
[0107] The method for obtaining a new individual based on m2 first individuals and n2 second individuals is as follows.
[0108] Form an individual pool of m2 first individuals and n2 second individuals. Select two individuals from the pool and replace the values at the same position in the feature vectors of the two selected individuals to obtain two new individuals. Or, for each individual in the pool, randomly select a preset dimension of the feature vector corresponding to the individual and replace the original value of the preset dimension with a target value to obtain a new individual. The target value is a random value or the sum of the original value and the random noise perturbation value.
[0109] It should be noted that when obtaining new individuals through gene segment crossover and / or gene segment perturbation mutation, the resulting individuals may not conform to the actual conditions of the production line scheduling scheme. For example, the production line scheduling problem contains 6 steps, represented by 1-6. When the individual obtained through the encoding mapping mechanism is the execution order of each step, such as the feature vector corresponding to the individual being 236514, after gene segment crossover or gene segment perturbation mutation, the feature vector corresponding to the individual obtained is 234514. The resulting individual can then be further corrected to obtain 234516, thus conforming to the actual conditions of the production line scheduling scheme.
[0110] When determining new individuals through genetic variation, the resulting new individuals simultaneously incorporate genes from individuals with high fitness in the first population and genes from individuals with high fitness in the second population, thus enabling the rapid acquisition of scheduling schemes corresponding to the scheduling problem.
[0111] The process of determining the scheduling scheme corresponding to the first scheduling problem based on the updated first population is explained in detail below.
[0112] Optionally, determining the scheduling scheme corresponding to the first scheduling problem based on the updated first group includes:
[0113] Obtain a pre-set termination condition; the pre-set termination condition is that the number of iterations reaches a preset number or the maximum fitness of the first individual in the first population reaches a preset fitness.
[0114] When the termination condition is that the number of iterations reaches a preset number, the iteration number corresponding to the current iteration execution step is obtained; when the number of iterations reaches the preset number, the termination condition of the iteration is determined to be met; when the number of iterations does not reach the preset number, the iteration number is updated, and the step of updating the first population continues; and / or,
[0115] When the termination condition is that the maximum fitness of the first individual in the first population reaches a preset fitness, the maximum fitness of the first individual in the first population is obtained. When the maximum fitness reaches the preset fitness, it is determined that the termination condition of the iteration is met. When the maximum fitness does not reach the preset fitness, the step of updating the first population continues.
[0116] When the termination condition of the iteration is met, the process of selecting the individual with the highest fitness from the first population is performed, and the scheduling scheme corresponding to the individual with the highest fitness is obtained. The determined scheduling scheme is then identified as the scheduling scheme corresponding to the first scheduling problem.
[0117] Before iteratively updating the first group, it is necessary to determine the termination condition of the iteration. The termination condition can be that the number of iterations reaches a preset value or the fitness reaches a preset fitness.
[0118] When using the number of iterations as the termination condition, the number of iterations can be initialized when randomly initializing the first group, such that the number of iterations t = 0, and a preset number of iterations can be set. Each time the first group is updated, the number of iterations is updated, incrementing by 1. After updating the first group, it is checked whether the number of iterations corresponding to the current iteration step has reached the preset number. If the preset number is 10, and the number of iterations corresponding to the iteration step is also 10, then the termination condition for iteration is met. If the number of iterations corresponding to the iteration step has not reached the preset number of iterations, the number of iterations is updated, and the first group is updated.
[0119] When fitness is used as the termination condition, a preset fitness can be set when randomly initializing the first population. After each update of the first population, the fitness of each individual in the first population is obtained, and the individual with the highest fitness is identified. If the highest fitness reaches the preset fitness, the termination condition of the iteration is met. If the highest fitness does not reach the preset fitness, the update process for the first population continues.
[0120] When the termination condition of the iteration is met, the individual with the highest fitness can be selected from the first group, and the scheduling scheme corresponding to the individual with the highest fitness can be obtained based on the preset encoding mapping mechanism. The determined scheduling scheme is then used as the optimal scheduling scheme for the first scheduling problem.
[0121] By setting a termination condition for the iteration and determining when to stop updating the first group when the termination condition is met, a scheduling scheme corresponding to the first scheduling problem can be obtained according to the user's needs.
[0122] In this embodiment, a genetic algorithm for knowledge transfer is used. If the solved second scheduling problem has a matching relationship with the first scheduling problem to be solved, then the solution knowledge corresponding to the solved second scheduling problem can facilitate the solution of the first scheduling problem. The solution knowledge of the solved second scheduling problem is represented as an individual in the genetic algorithm's solution process. By adding the genes corresponding to the solution knowledge of the solved second scheduling problem to the genetic algorithm's solution process for the first scheduling problem, knowledge is transferred from the solved second scheduling problem, thereby facilitating the solution of the first scheduling problem.
[0123] Existing genetic algorithm-based methods for solving the first scheduling problem require starting the search from a randomly initialized first population, necessitating numerous iterations to obtain a satisfactory solution. However, the knowledge transfer-based genetic algorithm in this application retains the process of searching from the randomly initialized first population while introducing a second population corresponding to the already solved second scheduling problem, providing a better search direction. This allows for obtaining a better solution with fewer iterations; alternatively, it allows for obtaining individuals with higher fitness from the updated first population with fewer iterations, thus quickly obtaining a scheduling scheme, enabling rapid adaptation to changes in production conditions, and improving industrial production efficiency.
[0124] Figure 5 This is a schematic diagram of a production line scheduling device based on a genetic algorithm, provided by the present invention. Figure 5 As shown, the production line scheduling device 50 based on genetic algorithms in this embodiment may include:
[0125] The population determination module 501 is used to initialize a first population corresponding to a first scheduling problem to be solved in the production line through a preset encoding mapping mechanism, and to determine a second population corresponding to a second scheduling problem according to the preset encoding mechanism; wherein, the second scheduling problem is a scheduling problem in the production line that matches the first scheduling problem and has been solved; the first population includes multiple first individuals; the second population includes multiple second individuals; the second individuals correspond to the scheduling scheme of the second scheduling problem;
[0126] The update module 502 is used to update the first population using a genetic algorithm based on the first population and the second population.
[0127] The scheme determination module 503 is used to determine the scheduling scheme corresponding to the first scheduling problem based on the updated first population.
[0128] Optionally, before updating the first population using a genetic algorithm based on the first and second populations, the update module 502 is further configured to:
[0129] Determine a feature mapping function for feature mapping of the second individual; the feature mapping function indicates that the second population formed by the second individual after feature mapping has the minimum statistical distance to the corresponding first population;
[0130] The second individual is feature-mapped according to the feature mapping function to obtain the mapped second individual, and the updated second population is obtained based on the mapped second individual.
[0131] Optionally, when determining the feature mapping function used for feature mapping of the second individual, the update module 502 specifically performs the following:
[0132] The second individual is used as the input to the neural network model, the second population formed by the mapped second individual is used as the output of the neural network model, and the goal of training the neural network model is to minimize the statistical distance between the second population formed by the mapped second individual and the corresponding first population.
[0133] The function corresponding to the trained neural network model is determined as the feature mapping function.
[0134] Optionally, when updating the first population using a genetic algorithm based on the first and second populations, the update module 502 is specifically used for:
[0135] Select the first individuals and the second individuals with the highest fitness from the first population and the second population, respectively;
[0136] The first group corresponding to the first scheduling problem is updated based on the selected plurality of first bodies and the plurality of second bodies.
[0137] Optionally, when the update module 502 selects the multiple first individuals and multiple second individuals with the highest fitness from the first population and the second population respectively, it is specifically used for:
[0138] The scheduling scheme corresponding to each first entity and each second entity is determined through the encoding mapping mechanism;
[0139] Determine the total time for completing all production steps of the production line scheduling corresponding to each scheduling scheme, and determine the fitness of the scheduling scheme based on the total time; the fitness is negatively correlated with the total time.
[0140] The fitness of each first individual and each second individual is determined based on the fitness of each scheduling scheme. Then, m first individuals are selected from the first population in descending order of fitness, and n second individuals are selected from the second population in descending order of fitness.
[0141] Optionally, when updating the first group corresponding to the first scheduling problem based on the selected plurality of first bodies and the plurality of second bodies, the update module 502 is specifically used for:
[0142] Select the m1 individuals with the highest fitness from the selected m individuals, and add the m1 individuals to the updated first population; the updated first population is the next generation first population;
[0143] Select the n1 second individuals with the highest fitness from the selected n second individuals, and add the n1 second individuals to the updated first population;
[0144] New individuals are obtained from m2 first individuals and n2 second individuals through gene segment crossover and / or gene segment perturbation mutation, and the new individuals are added to the updated first population; wherein, the m2 first individuals are multiple first individuals other than m1 first individuals from the m first individuals; and the n2 second individuals are multiple second individuals other than n1 second individuals from the n second individuals.
[0145] Optionally, the scheme determination module 503 is specifically used for:
[0146] Obtain a pre-set termination condition; the pre-set termination condition is that the number of iterations reaches a preset number or the maximum fitness of the first individual in the first population reaches a preset fitness.
[0147] When the termination condition is that the number of iterations reaches a preset number, the iteration number corresponding to the current iteration execution step is obtained; when the number of iterations reaches the preset number, the termination condition of the iteration is determined to be met; when the number of iterations does not reach the preset number, the iteration number is updated, and the step of updating the first population continues; and / or,
[0148] When the termination condition is that the maximum fitness of the first individual in the first population reaches a preset fitness, the maximum fitness of the first individual in the first population is obtained. When the maximum fitness reaches the preset fitness, it is determined that the termination condition of the iteration is met. When the maximum fitness does not reach the preset fitness, the step of updating the first population continues.
[0149] When the termination condition of the iteration is met, the process of selecting the individual with the highest fitness from the first population is performed, and the scheduling scheme corresponding to the individual with the highest fitness is obtained. The determined scheduling scheme is then identified as the scheduling scheme corresponding to the first scheduling problem.
[0150] The production line scheduling device based on genetic algorithms provided by this invention can achieve the above-mentioned... Figures 2 to 4 The production line scheduling method based on genetic algorithms shown in the embodiment has a similar implementation principle and technical effect, and will not be described again here.
[0151] Figure 6 This is a schematic diagram of the hardware structure of a production line scheduling device based on a genetic algorithm, provided by the present invention. (See diagram below.) Figure 6 As shown, the production line scheduling device 60 based on genetic algorithm provided in this embodiment includes at least one processor 601 and a memory 602. The processor 601 and the memory 602 are connected via a bus 603.
[0152] In a specific implementation, at least one processor 601 executes computer execution instructions stored in the memory 602, causing at least one processor 601 to execute the production line scheduling method based on genetic algorithm in the above method embodiment.
[0153] The specific implementation process of processor 601 can be found in the above method embodiments, and its implementation principle and technical effect are similar. It will not be repeated here.
[0154] In the above Figure 6 In the illustrated embodiments, it should be understood that the processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), etc. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in this invention can be directly implemented by a hardware processor, or implemented by a combination of hardware and software modules within the processor.
[0155] The memory may include high-speed RAM, and may also include non-volatile storage (NVM), such as at least one disk storage.
[0156] The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. Buses can be categorized as address buses, data buses, control buses, etc. For ease of illustration, the buses shown in the accompanying drawings are not limited to a single bus or a single type of bus.
[0157] The present invention also provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the production line scheduling method based on a genetic algorithm described in the above method embodiments.
[0158] The aforementioned computer-readable storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk. The readable storage medium can be any available medium accessible to a general-purpose or special-purpose computer.
[0159] An exemplary readable storage medium is coupled to a processor, enabling the processor to read information from and write information to the readable storage medium. Of course, the readable storage medium can also be a component of the processor. The processor and the readable storage medium can reside in an Application Specific Integrated Circuit (ASIC). Alternatively, the processor and the readable storage medium can exist as discrete components in the device.
[0160] One embodiment of this application provides a computer program product, including a computer program that, when executed by a processor, implements the features described in this application. Figures 2 to 5 The corresponding embodiments provide a production line scheduling method based on a genetic algorithm.
[0161] Those skilled in the art will understand that all or part of the steps of the above-described method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When executed, the program performs the steps of the above-described method embodiments; and the aforementioned storage medium includes various media capable of storing program code, such as ROM, RAM, magnetic disks, or optical disks.
[0162] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features therein. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this application.
Claims
1. A production line scheduling method based on a genetic algorithm, characterized by, The method comprises: According to the first scheduling problem to be solved in the production line, the first population corresponding to the first scheduling problem is initialized by a preset encoding mapping mechanism, and the second population corresponding to the second scheduling problem is determined according to the preset encoding mapping mechanism; wherein the second scheduling problem is a scheduling problem matched with the first scheduling problem in the production line and has been solved; the first population comprises a plurality of first individuals; the second population comprises a plurality of second individuals; the second individual corresponds to the scheduling scheme of the second scheduling problem; According to the first population and the second population, the first population is updated by a genetic algorithm; According to the updated first population, the scheduling scheme corresponding to the first scheduling problem is determined; According to the first population and the second population, the first population is updated by a genetic algorithm, comprising: Screening a plurality of first individuals and a plurality of second individuals with the maximum fitness from the first population and the second population respectively; Updating the first population corresponding to the first scheduling problem according to the plurality of first individuals and the plurality of second individuals screened.
2. The method of claim 1, wherein, Before the first population is updated by a genetic algorithm according to the first population and the second population, it further comprises: Determining a feature mapping function for mapping the features of the second individuals; the feature mapping function represents that the second population composed of the second individuals after feature mapping has the smallest statistical distance with the corresponding first population; According to the feature mapping function, the features of the second individuals are mapped to obtain the mapped second individuals, and the updated second population is obtained based on the mapped second individuals.
3. The method of claim 2, wherein, Determining a feature mapping function for mapping the features of the second individuals, comprising: Taking the second individuals as the input of a neural network model, taking the second population composed of the mapped second individuals as the output of the neural network model, and taking the smallest statistical distance between the second population composed of the second individuals after feature mapping and the corresponding first population as the optimization target to train the neural network model; The function corresponding to the trained neural network model is determined as the feature mapping function.
4. The method of claim 1, wherein, Screening a plurality of first individuals and a plurality of second individuals with the maximum fitness from the first population and the second population respectively, comprising: Determining the scheduling scheme corresponding to each first individual and each second individual through the encoding mapping mechanism; Determining the total time of all production steps for completing the scheduling of the production line corresponding to each scheduling scheme, and determining the fitness corresponding to each scheduling scheme according to the total time; the fitness is negatively correlated with the total time; According to the fitness corresponding to each scheduling scheme, the fitness corresponding to each first individual and each second individual is determined, and m first individuals are screened from the first population in the order of fitness from large to small, and n second individuals are screened from the second population in the order of fitness from large to small.
5. The method of claim 1, wherein, Updating the first population corresponding to the first scheduling problem according to the plurality of first individuals and the plurality of second individuals screened, comprising: selecting m1 first individuals with the largest fitness from the screened m first individuals, and adding the m1 first individuals to an updated first population; the updated first population is a next-generation first population; selecting n1 second individuals with the largest fitness from the screened n second individuals, and adding the n1 second individuals to the updated first population; obtaining new individuals from m2 first individuals and n2 second individuals through gene fragment crossover and / or gene fragment disturbance variation, and adding the new individuals to the updated first population; the m2 first individuals are a plurality of first individuals in the m first individuals except the m1 first individuals; the n2 second individuals are a plurality of second individuals in the n second individuals except the n1 second individuals.
6. The method according to any one of claims 1 to 5, characterized in that, The method further includes: obtaining a preset termination condition; the preset termination condition is that an iteration number reaches a preset number of times or a maximum value of fitness of a first individual in the first population reaches a preset fitness; when the termination condition is that the iteration number reaches the preset number of times, obtaining an iteration number corresponding to a current iteration execution step, determining that the termination condition of iteration is satisfied when the iteration number reaches the preset number of times, updating the iteration number when the iteration number does not reach the preset number of times, and continuing to perform the step of updating the first population; and / or when the termination condition is that the maximum value of fitness of the first individual in the first population reaches the preset fitness, obtaining the maximum value of fitness of the first individual in the first population, determining that the termination condition of iteration is satisfied when the maximum value of fitness reaches the preset fitness, and continuing to perform the step of updating the first population when the maximum value of fitness does not reach the preset fitness; when the termination condition of iteration is satisfied, performing the step of selecting a maximum fitness individual from the first population, and obtaining a scheduling scheme corresponding to the maximum fitness individual, and determining the scheduling scheme as a scheduling scheme corresponding to the first scheduling problem.
7. A production line scheduling apparatus based on a genetic algorithm, characterized by, The apparatus includes: a population determination module configured to initialize a first population corresponding to a first scheduling problem to be solved in a production line through a preset encoding mapping mechanism, and determine a second population corresponding to a second scheduling problem through the preset encoding mapping mechanism; the second scheduling problem is a scheduling problem that is matched with the first scheduling problem and has been solved in the production line; the first population includes a plurality of first individuals; the second population includes a plurality of second individuals; the second individuals correspond to a scheduling scheme of the second scheduling problem; an updating module configured to screen a plurality of first individuals with the largest fitness from the first population and a plurality of second individuals with the largest fitness from the second population, and update the first population corresponding to the first scheduling problem according to the plurality of screened first individuals and the plurality of screened second individuals; a scheme determination module configured to determine a scheduling scheme corresponding to the first scheduling problem according to the updated first population.
8. A production line scheduling apparatus based on a genetic algorithm, characterized by, The apparatus includes: at least one processor and a memory. The memory stores computer-executable instructions; The at least one processor executes the computer-executable instructions stored in the memory, so that the at least one processor executes the method according to any one of claims 1-6.
9. A computer-readable storage medium, characterized in that, The storage medium stores a computer program, and the computer program is executed by a processor to implement the method according to any one of claims 1-6.
Citation Information
Patent Citations
Scheduling method and device based on genetic algorithm
CN108399455A
High-end device flow line production dispatching method based on improved genetic algorithm
CN108460463A