Genetic scheduling method and device for dividing male parents and female parents based on mean clustering
By introducing the method of dividing parent-parent parent-books into the genetic algorithm, the problem of inefficiency of genetic algorithms in workshop scheduling is solved, and more efficient gene recombination and faster convergence speed are achieved.
Patent Information
- Application Number
- CN202411724057.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-28
- Publication Date
- 2025-03-04
AI Technical Summary
The existing genetic algorithms are less efficient in workshop scheduling schedules, mainly because similar individuals may be selected during cross-operation, resulting in a decrease in the quality of gene recombination and a slowdown in convergence rate.
The genetic scheduling scheduling method based on mean clustering is adopted, and the initial population is divided into the first cluster cluster and the second cluster cluster through the k-mean clustering algorithm to ensure that the similarity between the parent and the parent is low, thereby generating a better off-child production plan in the cross-operation.
It effectively avoids the appearance of inferior genes in offspring, speeds up the iteration speed, improves the efficiency of workshop scheduling, and ensures the quality of generated production plans.
Smart Images

Figure CN119558605A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of workshop scheduling, and in particular to a genetic scheduling method and device based on mean clustering to divide paternal and maternal genes. Background Art
[0002] Genetic Algorithm (GA) is a search heuristic algorithm that simulates the biological evolution process. Genetic algorithms are usually used to solve optimization and search problems, especially when the search space of the problem is large or the problem itself is difficult to solve with traditional methods. Its general steps are: encoding, initial population, fitness calculation, execution selection elimination, crossover, mutation. Its application in flow shop scheduling problem (FSP) and hybrid flow shop scheduling problem (HFSP) can achieve good performance.
[0003] However, when solving the workshop scheduling problem, the existing genetic algorithm, because the crossover operation is mostly to randomly select two individuals from the population to exchange genes, if two similar individuals are selected, their genes will also have a certain similarity, just like the offspring of close relatives are prone to mental retardation, congenital malformations, poor physical fitness and other problems. The offspring individuals of such crossover are very likely not to have better genes, but will make good gene recombination disappear, thereby reducing the convergence rate and resulting in low efficiency of workshop scheduling. Summary of the invention
[0004] The purpose of the present invention is to provide a genetic scheduling method and device based on mean clustering to divide paternal and maternal genes, which is used to solve the problem of low efficiency of traditional genetic algorithms in solving workshop scheduling.
[0005] In order to solve the above technical problems, an embodiment of the present invention provides a genetic scheduling method based on mean clustering to divide paternal and maternal parents, comprising:
[0006] Acquire first times corresponding to processing of a plurality of workpieces in a target production line, wherein the first time includes a plurality of second times, the target production line includes a plurality of processing equipment, and each of the processing equipment corresponds to one second time;
[0007] Arranging the plurality of workpieces according to different production sequences to generate an initial population, wherein the initial population includes a plurality of production plans, wherein one production plan corresponds to one production sequence;
[0008] According to the cosine similarity between the multiple production plans in the initial population, the production plans are clustered using a k-means clustering algorithm to obtain a first clustering cluster and a second clustering cluster;
[0009] Performing a cross operation on any one of the production plans in the first cluster and any one of the production plans in the second cluster to generate a plurality of child production plans;
[0010] According to the first time, obtaining a first total processing time corresponding to the processing of the child production plan on the target production line;
[0011] When the first total processing time satisfies a convergence condition, the child production plan with the shortest first total processing time is determined as the final production plan.
[0012] Optionally, clustering the production plans using a k-means clustering algorithm according to cosine similarities between the production plans to obtain a first cluster and a second cluster;
[0013] selecting a first production plan and a second production plan from among the plurality of production plans;
[0014] Calculate the cosine similarity between each of the production plans and the first production plan to obtain multiple first similarities;
[0015] Calculate the cosine similarity between each of the production plans and the second production plan to obtain multiple second similarities;
[0016] A k-means clustering algorithm is performed according to the first similarity and the second similarity to obtain a first cluster and a second cluster.
[0017] Optionally, performing a k-means clustering algorithm according to the first similarity and the second similarity to obtain a first cluster and a second cluster includes:
[0018] Obtaining coordinates corresponding to each of the production plans according to the first similarity and the second similarity;
[0019] A k-means clustering algorithm is performed on the plurality of coordinates to obtain a first cluster and a second cluster.
[0020] Optionally, obtaining coordinates corresponding to each of the production plans according to the first similarity and the second similarity includes:
[0021] The first similarity is used as the horizontal coordinate and the second similarity is used as the vertical coordinate to obtain the coordinate corresponding to each of the production plans.
[0022] Optionally, before clustering the production plans using a k-means clustering algorithm according to the cosine similarity between the production plans, the method further includes:
[0023] Obtaining a second total processing time corresponding to processing each of the production plans on the target production line;
[0024] The plurality of production plans are screened according to the second total processing time, and the production plans whose second total processing time is greater than a first threshold are deleted.
[0025] Optionally, the method further comprises:
[0026] When the first total processing time does not meet the convergence condition, the initial population is updated according to the child production plan, and the child production plan corresponding to the updated initial population is obtained until the total processing time corresponding to the child production plan meets the convergence condition.
[0027] The embodiment of the present invention further provides a genetic scheduling device based on mean clustering to divide paternal and maternal parents, comprising:
[0028] A first acquisition module is used to acquire first times corresponding to processing of a plurality of workpieces in a target production line, wherein the first time includes a plurality of second times, the target production line includes a plurality of processing equipment, and each of the processing equipment corresponds to one second time;
[0029] A first generating module is used to arrange the plurality of workpieces according to different production sequences to generate an initial population, wherein the initial population includes a plurality of production plans, wherein one production plan corresponds to one production sequence;
[0030] A first clustering module, used for clustering the production plans according to the cosine similarity between the multiple production plans in the initial population using a k-means clustering algorithm to obtain a first clustering cluster and a second clustering cluster;
[0031] A second generating module, configured to perform a cross operation on any one of the production plans in the first cluster and any one of the production plans in the second cluster to generate a plurality of child production plans;
[0032] A first calculation module, configured to obtain, according to the first time, a first total processing time corresponding to the processing of the child production plan on the target production line;
[0033] The first determination module is used to determine the child production plan with the shortest first total processing time as the final production plan when the first total processing time meets the convergence condition.
[0034] An embodiment of the present invention also provides a network device, comprising: a processor, a memory, and a program stored in the memory and executable on the processor, wherein when the program is executed by the processor, the program implements the genetic scheduling method based on mean clustering partitioning of parent and parent as described in any one of the above items.
[0035] An embodiment of the present invention further provides a readable storage medium, comprising: a program is stored on the readable storage medium, and when the program is executed by a processor, the steps of the genetic scheduling method based on mean clustering to divide the paternal and maternal parents as described in any of the above items are implemented.
[0036] An embodiment of the present invention further provides a computer program product, comprising computer instructions, which, when executed by a processor, implement the steps of the genetic scheduling method based on mean clustering partitioning of paternal and maternal parents as described in any of the above items.
[0037] At least one of the above technical solutions of the present invention has the following beneficial effects:
[0038] In the above scheme, the workshop scheduling problem is optimized based on the genetic algorithm. Since the second processing time corresponding to any workpiece on different processing equipment in the target production line is different, and the second processing time corresponding to different workpieces on the same processing equipment in the target production line is different, the production order between the workpieces will affect the total processing time of the target production line. In order to minimize the total processing time of the target production line, it is necessary to determine the optimal production order between the workpieces, that is, the final production plan. First, the multiple workpieces are arranged in different production orders to generate an initial population, wherein the initial population includes multiple production plans; then, the k-means clustering algorithm is introduced, and the initial population is clustered into a first cluster cluster and a second cluster cluster according to the cosine similarity between the multiple production plans, ensuring that the similarity of the production plans in the first cluster cluster and the production plans in the second cluster cluster is low; secondly, a production plan is selected from the first cluster cluster as the parent, and a production plan is selected from the second cluster cluster as the parent, and the parent and parent perform crossover operations to generate a child production plan; finally, when the first total processing time corresponding to the child production plan processing on the target production line meets the convergence condition, the final production plan is determined. Compared with the traditional genetic algorithm, the present invention can ensure that the similarity between the father and the mother is low, effectively avoid the appearance of inferior genes in the offspring, speed up the iteration speed, improve the efficiency of generating the final production plan, and improve the efficiency of workshop scheduling. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] Figure 1 It is a flow chart of a genetic scheduling method based on mean clustering to divide paternal and maternal parents according to an embodiment of the present invention;
[0040] Figure 2A schematic diagram of generating a first cluster and a second cluster by using a K-means clustering algorithm in an embodiment of the present invention;
[0041] Figure 3 It is a flow chart of a genetic scheduling method based on mean clustering to divide paternal and maternal parents according to an embodiment of the present invention;
[0042] Figure 4 This is a schematic diagram of the structure of the target production line in an embodiment of the present invention;
[0043] Figure 5 This is a data analysis diagram for scheduling through traditional genetic algorithms;
[0044] Figure 6 This is a data analysis diagram of scheduling performed by the genetic scheduling method based on mean clustering to divide paternal and maternal parents according to an embodiment of the present invention;
[0045] Figure 7 It is a structural schematic diagram of a genetic scheduling device based on mean clustering to divide paternal and maternal parents according to an embodiment of the present invention. DETAILED DESCRIPTION
[0046] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0047] The scheduling method provided by the embodiment of the present invention is implemented based on a genetic algorithm. The traditional genetic algorithm is mainly divided into the process of encoding, initializing the population, fitness evaluation, selection operation, crossover operation, mutation operation, termination condition judgment, and outputting the optimal solution. If the preset termination condition is met, such as reaching the maximum number of iterations or the quality of the solution reaches a predetermined standard, the solution is determined to be the optimal solution; if the preset termination condition is not met, it returns to the selection operation step and iterates continuously until the preset termination condition is met. Then, the crossover operation and selection operation in the traditional genetic algorithm are mostly to randomly select two individuals from the population for gene exchange, which easily leads to the situation that two individuals with similar genes are selected, just like the phenomenon that close relatives marrying will cause defects in the genes of the offspring and make good genes disappear. Based on the above situation, the embodiment of the present invention improves the traditional genetic algorithm and combines it with the workshop scheduling problem to provide a genetic scheduling method based on mean clustering to divide the paternal and maternal parents.
[0048] like Figure 1 As shown, an embodiment of the present invention provides a genetic scheduling method based on mean clustering to divide paternal and maternal parents, comprising:
[0049] Step S101, obtaining first times corresponding to processing of a plurality of workpieces in a target production line, wherein the first time includes a plurality of second times, the target production line includes a plurality of processing equipment, and each of the processing equipment corresponds to one second time;
[0050] In step S101, the target production line includes multiple processing equipment, and the process of processing each workpiece on the target production line is that the workpiece is processed on each processing equipment of the target production line in turn. Therefore, the first time required for processing each workpiece on the target production line includes the second time required for processing the workpiece on each processing equipment. It should be noted that the second time required for any workpiece on different processing equipment in the target production line is different, and the second time required for processing different workpieces on the same processing equipment in the target production line is also different.
[0051] Step S102, arranging the plurality of workpieces according to different production sequences to generate an initial population, wherein the initial population includes a plurality of production plans, wherein one production plan corresponds to one production sequence;
[0052] In step S102, the plurality of workpieces are arranged in different production orders to generate a plurality of production plans, which constitute an initial population, wherein each production plan is equivalent to an individual, and the encoding of the individual gene is the different production orders corresponding to the plurality of workpieces in the production plan.
[0053] It should be noted that different production sequences between workpieces will affect the total time required for processing on the target production line, so different production plans correspond to different total times required for processing on the target production line.
[0054] Step S103, clustering the production plans using a k-means clustering algorithm according to the cosine similarities between the multiple production plans in the initial population to obtain a first cluster and a second cluster;
[0055] In step S103, a k-means clustering algorithm is introduced to cluster the initial population into a first cluster and a second cluster according to the cosine similarity between the multiple production plans, ensuring that the similarity between the production plans in the first cluster and the production plans in the second cluster is low.
[0056] Step S104, performing a cross operation on any one of the production plans in the first cluster and any one of the production plans in the second cluster to generate a plurality of child production plans;
[0057] In step S104, a production plan is selected from the first cluster as the parent, and a production plan is selected from the second cluster as the father. The father and the mother perform a crossover operation to generate an offspring production plan, which can ensure that the similarity between the father and the mother is low, effectively avoid the appearance of inferior genes in the offspring, and improve the quality of the offspring production plan.
[0058] Step S105, obtaining a first total processing time corresponding to the processing of the child production plan on the target production line according to the first time;
[0059] In step S105, each child production plan includes multiple workpieces, and different child production plans correspond to different workpiece production sequences; based on the workpiece production sequence corresponding to the child production plan, according to the first time required for each workpiece to be processed on the target production line, the total time required for the child production plan to be processed on the target production line, i.e., the first total processing time, is determined.
[0060] Step S106: When the first total processing time satisfies a convergence condition, determine the child production plan with the shortest first total processing time as the final production plan.
[0061] In step S106, when the first total processing time required for the child production plan to be processed on the target production line meets the convergence condition, that is, when the objective function converges, the child production plan with the shortest first total processing time is selected as the final production plan. In the embodiment of the present invention, the objective function to be solved is the total time required for multiple workpieces to be processed on the target production line, and the optimal solution corresponding to the objective function is the shortest time required for multiple workpieces to be processed on the target production line. Since the second time required for processing any workpiece on different processing equipment in the target production line is different, and the corresponding second time for processing different workpieces on the same processing equipment in the target production line is also different, the production sequence between workpieces will affect the total time required for processing on the target production line. In order to minimize the total time required for processing on the target production line, it is necessary to determine the optimal production sequence between workpieces, that is, the final production plan.
[0062] Therefore, the present invention determines the final production plan based on the genetic algorithm, and at the same time improves the methods of selection operation and crossover operation in the traditional genetic algorithm. By introducing the k-means clustering algorithm, clustering is performed according to the cosine similarity between multiple production plans, so that the similarity between the father and the mother in the crossover operation is low, which effectively avoids the appearance of inferior genes in the offspring, improves the quality of the generated offspring production plan, that is, the total time (first total processing time) required for the offspring production plan to be processed on the target production line is shorter, the iteration speed is accelerated, and the efficiency of workshop scheduling is improved.
[0063] Optionally, clustering the production plans using a k-means clustering algorithm according to cosine similarities between the production plans to obtain a first cluster and a second cluster;
[0064] selecting a first production plan and a second production plan from among the plurality of production plans;
[0065] Calculate the cosine similarity between each of the production plans and the first production plan to obtain multiple first similarities;
[0066] Calculate the cosine similarity between each of the production plans and the second production plan to obtain multiple second similarities;
[0067] A k-means clustering algorithm is performed according to the first similarity and the second similarity to obtain a first cluster and a second cluster.
[0068] In an embodiment of the present invention, a first production plan and a second production plan are randomly selected from a plurality of production plans of an initial population; then, based on a cosine similarity algorithm, a first similarity between each production plan of the initial population and the first production plan and a second similarity between each production plan of the initial population and the second production plan are calculated; finally, a k-means clustering algorithm is performed according to the first similarity and the second similarity to obtain a first cluster cluster and a second cluster cluster; the cosine similarity algorithm and the k-means clustering algorithm are introduced to ensure that the similarity between the production plans in the first cluster cluster and the production plans in the second cluster cluster is low, which is convenient for subsequent operations.
[0069] Among them, the cosine similarity algorithm is a similarity measurement method for measuring the angle between two non-zero vectors. It determines the similarity between them by calculating the cosine value of the angle between the two vectors. The range of cosine similarity is from -1 to 1, where: 1 means that the vectors are in exactly the same direction, that is, completely similar, 0 means that the vectors are orthogonal, that is, unrelated, and -1 means that the vectors are in completely opposite directions, that is, completely dissimilar. The calculation formula for cosine similarity is: Among them, A and B are respectively the vectors corresponding to the two production plans whose similarity needs to be calculated. Since each production plan is equivalent to an individual, each individual is genetically encoded based on the production sequence of the workpiece before executing step S103. Therefore, each production plan has a corresponding vector form; ‖A‖ is the Euclidean norm of vector A; ‖B‖ is the Euclidean norm of vector B; n is an integer greater than 1.
[0070] Optionally, performing a k-means clustering algorithm according to the first similarity and the second similarity to obtain a first cluster and a second cluster includes:
[0071] Obtaining coordinates corresponding to each of the production plans according to the first similarity and the second similarity;
[0072] A k-means clustering algorithm is performed on the plurality of coordinates to obtain a first cluster and a second cluster.
[0073] In the embodiment of the present invention, first, the coordinates corresponding to each of the production plans are obtained, that is, the production plans are converted into the form of data points, and then the initial population is converted into a data set; then, k-means clustering is performed on the multiple data points to divide them into a first clustering cluster and a second clustering cluster, such as Figure 2 As shown, according to the k-means clustering algorithm, it is divided into two clusters. It can be seen that there is an obvious dividing line between the two clusters, which can ensure that the similarity between the production plan in the first cluster and the production plan in the second cluster is low, which is convenient for subsequent operations.
[0074] Among them, the specific steps of k-means clustering are: the first step, initialization: randomly select 2 data points as the initial cluster centers; the second step, allocation: for each point in the data set, according to its distance to each cluster center, it is assigned to the cluster represented by the nearest cluster center; the third step, update: recalculate the mean of all points in each cluster, and set the mean as the new cluster center; the fourth step, iteration: repeat the second and third steps until a termination condition is met, such as reaching the maximum number of iterations, the change of the cluster center is less than a threshold, or the change of the clustering result is no longer significant; the fifth step, output: output the first cluster cluster and the second cluster cluster.
[0075] Optionally, obtaining coordinates corresponding to each of the production plans according to the first similarity and the second similarity includes:
[0076] The first similarity is used as the horizontal coordinate and the second similarity is used as the vertical coordinate to obtain the coordinate corresponding to each of the production plans.
[0077] In the embodiment of the present invention, a method for generating coordinates corresponding to the production plan is specifically described, with the first similarity as the horizontal coordinate and the second similarity as the vertical coordinate. Only after clustering can it be ensured that the production plan in the first cluster cluster is not similar to the production plan in the second cluster cluster.
[0078] Optionally, before clustering the production plans using a k-means clustering algorithm according to the cosine similarity between the production plans, the method further includes:
[0079] Obtaining a second total processing time corresponding to processing each of the production plans on the target production line;
[0080] The plurality of production plans are screened according to the second total processing time, and the production plans whose second total processing time is greater than a first threshold are deleted.
[0081] In an embodiment of the present invention, the second total processing time represents the total time required for processing on the target production line according to the production plan. Different production plans have different second total processing times. Before clustering, it is also necessary to perform a fitness evaluation operation on the initial population to obtain the second total processing time corresponding to each production plan processed on the target production line. If the second total processing time is too long (such as the second total processing time is greater than the first threshold), it is a poor quality gene. In order to further ensure the quality of the father and the mother and thus speed up the iteration speed, the production plans whose second total processing time is greater than the first threshold are deleted, which can effectively improve the workshop scheduling efficiency.
[0082] Optionally, before obtaining the child production plan, the method further includes:
[0083] A mutation operation is performed on the child production plan to generate a new child production plan.
[0084] In an embodiment of the present invention, after generating a offspring production plan and before determining whether the first total processing time corresponding to the offspring production plan satisfies the convergence condition, that is, before determining whether the objective function satisfies the convergence condition, it is necessary to perform a mutation operation on the offspring production plan. The main purpose of the mutation operation is to introduce new genetic information by modifying certain genes in individual chromosomes with a certain probability, thereby increasing the diversity of the population. The specific operation methods include but are not limited to basic bit mutation, uniform mutation, Gaussian mutation, non-uniform mutation, etc., which are all prior arts and will not be elaborated herein by the present invention.
[0085] Optionally, the method further comprises:
[0086] When the first total processing time does not meet the convergence condition, the initial population is updated according to the child production plan, and the child production plan corresponding to the updated initial population is obtained until the first total processing time corresponding to the child production plan meets the convergence condition.
[0087] In an embodiment of the present invention, if the first total processing time does not meet the convergence condition, the generated child production plan is added to the initial population to update the initial population, and steps S103-S105 are executed on the updated initial population, and it is continuously iterated until the first total processing time corresponding to the child production plan meets the convergence condition.
[0088] Embodiment 1, as Figure 3As shown, the specific process of the genetic scheduling method based on mean clustering division of paternal and maternal parents provided by the present invention is as follows:
[0089] Prerequisite: Arrange multiple workpieces in different production sequences and generate multiple production plans, where one production plan corresponds to one production sequence;
[0090] Step S301, genetically encoding each production plan based on the production sequence of the workpieces in each production plan;
[0091] Step S302, initializing the population, generating an initial population according to multiple production plans;
[0092] Step S303, screening the production plans in the initial population and updating the initial population;
[0093] Step S304, clustering the production plans using a k-means clustering algorithm according to the cosine similarity between the multiple production plans in the initial population to obtain a first cluster and a second cluster;
[0094] Step S305, performing a cross operation on any production plan in the first cluster and any production plan in the second cluster to generate multiple child production plans;
[0095] Step S306, performing mutation operation on the offspring production plan;
[0096] Step S307, obtaining a first total processing time corresponding to the processing of the child production plan on the target production line;
[0097] Step S308, determine whether the first total processing time meets the convergence condition. If yes, go to step S310; if not, go to step S309;
[0098] Step S309, adding the offspring production plan to the initial population, and then going to step S303;
[0099] Step S310, determining the child production plan with the shortest first total processing time as the final production plan.
[0100] By adopting the genetic scheduling method based on mean clustering division of paternal and maternal parents provided by the present invention, the similarity of the production plans in the first cluster cluster and the second cluster cluster obtained by clustering is low, so the quality of the generated offspring production plan is better, which effectively avoids the appearance of inferior genes in the offspring, speeds up the iteration speed, and improves the efficiency of workshop scheduling.
[0101] Example 2, the target production line is as follows Figure 4As shown, there are 4 processing equipment, and 100 workpieces are produced in the target production line, wherein the second time required for processing each workpiece on the 4 processing equipment is different, for example: the second time required for processing workpiece 1 on the 4 processing equipment is 7.0, 19.0, 71.0, and 73.0 respectively; the second time required for processing workpiece 2 on the 4 processing equipment is 12.0, 13.0, 29.0, and 31.0 respectively; the second time required for processing workpiece 3 on the 4 processing equipment is 98.0, 14.0, 8.0, and 82.0 respectively.
[0102] If the traditional genetic algorithm is used to determine the optimal production plan, it will take about 40 iterations. Figure 5 As shown;
[0103] If the genetic scheduling method based on mean clustering to divide the sire and the dam provided by the present invention is used to determine the optimal production plan, it only takes about 20 iterations of calculations. Figure 6 As shown;
[0104] It can be seen that the method provided by the present invention can speed up the iteration speed and improve the efficiency of workshop scheduling.
[0105] like Figure 7 As shown, the embodiment of the present invention also provides a genetic scheduling device based on mean clustering to divide paternal and maternal parents, including:
[0106] A first acquisition module 701 is used to acquire first times corresponding to processing of a plurality of workpieces in a target production line, wherein the first time includes a plurality of second times, the target production line includes a plurality of processing equipment, and each of the processing equipment corresponds to a second time;
[0107] A first generating module 702 is used to arrange the plurality of workpieces according to different production sequences to generate an initial population, wherein the initial population includes a plurality of production plans, wherein one production plan corresponds to one production sequence;
[0108] A first clustering module 703 is used to cluster the production plans according to the cosine similarity between the multiple production plans in the initial population using a k-means clustering algorithm to obtain a first cluster and a second cluster;
[0109] A second generation module 704 is used to perform a cross operation on any one of the production plans in the first cluster and any one of the production plans in the second cluster to generate multiple child production plans;
[0110] A first calculation module 705 is used to obtain, according to the first time, a first total processing time corresponding to the processing of the child production plan on the target production line;
[0111] The first determination module 706 is used to determine the child production plan with the shortest first total processing time as the final production plan when the first total processing time meets the convergence condition.
[0112] Optionally, the first clustering module 703 includes:
[0113] A first selection unit, used for selecting a first production plan and a second production plan from the plurality of production plans;
[0114] A first calculation unit, configured to perform cosine similarity calculation on each of the production plans and the first production plan to obtain a plurality of first similarities;
[0115] A second calculation unit, configured to calculate cosine similarity between each of the production plans and the second production plan, to obtain a plurality of second similarities;
[0116] The first clustering unit is used to perform a k-means clustering algorithm according to the first similarity and the second similarity to obtain a first clustering cluster and a second clustering cluster.
[0117] Optionally, the first clustering unit includes:
[0118] A first processing unit, configured to obtain coordinates corresponding to each of the production plans according to the first similarity and the second similarity;
[0119] The second clustering unit is used to perform a k-means clustering algorithm on the plurality of coordinates to obtain a first clustering cluster and a second clustering cluster.
[0120] Optionally, the first processing unit includes:
[0121] The second processing unit is used to obtain the coordinates corresponding to each of the production plans by taking the first similarity as the horizontal coordinate and the second similarity as the vertical coordinate.
[0122] Optionally, the device further comprises:
[0123] A second acquisition module is used to acquire a second total processing time corresponding to each of the production plans being processed on the target production line;
[0124] The first screening module is used to screen the multiple production plans according to the second total processing time, and delete the production plans whose second total processing time is greater than a first threshold.
[0125] Optionally, the device further comprises:
[0126] The first updating module is used to update the initial population according to the offspring production plan when the first total processing time does not meet the convergence condition, and obtain the offspring production plan corresponding to the updated initial population until the first total processing time corresponding to the offspring production plan meets the convergence condition.
[0127] It should be noted that the embodiment of the device is a device corresponding to the embodiment of the above method, and all implementation methods in the embodiment of the above method are applicable to the embodiment of the device and can achieve the same technical effect.
[0128] An embodiment of the present invention also provides a network device, comprising: a processor, a memory, and a program stored in the memory and executable on the processor. When the program is executed by the processor, the program implements the genetic scheduling method based on mean clustering partitioning of parent and parent as described in any of the above items, and can achieve the same technical effect. To avoid repetition, it will not be described here.
[0129] The embodiment of the present invention also provides a readable storage medium, including: a program is stored on the readable storage medium, and when the program is executed by the processor, the steps of the genetic scheduling method based on mean clustering to divide the paternal and maternal parents as described in any of the above items are implemented, and the same technical effect can be achieved. To avoid repetition, it is not repeated here. Among them, the computer-readable storage medium is such as a read-only memory (Read-Only Memory, referred to as ROM), a random access memory (RandomAccess Memory, referred to as RAM), a disk or an optical disk, etc.
[0130] An embodiment of the present invention also provides a computer program product, including computer instructions. When the computer instructions are executed by a processor, the steps of the genetic scheduling method based on mean clustering partitioning of paternal and maternal parents as described in any of the above items are implemented, and the same technical effect can be achieved. To avoid repetition, they will not be repeated here.
[0131] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or terminal device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0132] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.
Claims
1. A genetic scheduling method based on mean clustering to divide paternal and maternal parents, characterized in that: include: Acquire first times corresponding to processing of a plurality of workpieces in a target production line, wherein the first time includes a plurality of second times, the target production line includes a plurality of processing equipment, and each of the processing equipment corresponds to one second time; Arranging the plurality of workpieces according to different production sequences to generate an initial population, wherein the initial population includes a plurality of production plans, wherein one production plan corresponds to one production sequence; According to the cosine similarity between the multiple production plans in the initial population, the production plans are clustered using a k-means clustering algorithm to obtain a first clustering cluster and a second clustering cluster; Performing a cross operation on any one of the production plans in the first cluster and any one of the production plans in the second cluster to generate a plurality of child production plans; According to the first time, obtaining a first total processing time corresponding to the processing of the child production plan on the target production line; When the first total processing time satisfies a convergence condition, the child production plan with the shortest first total processing time is determined as the final production plan.
2. The genetic scheduling method based on mean clustering partitioning of paternal and maternal parents according to claim 1 is characterized in that: According to the cosine similarity between the production plans, the production plans are clustered using a k-means clustering algorithm to obtain a first cluster and a second cluster; selecting a first production plan and a second production plan from among the plurality of production plans; Calculate the cosine similarity between each of the production plans and the first production plan to obtain multiple first similarities; Calculate the cosine similarity between each of the production plans and the second production plan to obtain multiple second similarities; A k-means clustering algorithm is performed according to the first similarity and the second similarity to obtain a first cluster and a second cluster.
3. The genetic scheduling method based on mean clustering partitioning of paternal and maternal parents according to claim 2 is characterized in that: The step of performing a k-means clustering algorithm according to the first similarity and the second similarity to obtain a first cluster and a second cluster includes: Obtaining coordinates corresponding to each of the production plans according to the first similarity and the second similarity; A k-means clustering algorithm is performed on the plurality of coordinates to obtain a first cluster and a second cluster.
4. The genetic scheduling method based on mean clustering partitioning of paternal and maternal parents according to claim 3 is characterized in that: The obtaining, according to the first similarity and the second similarity, coordinates corresponding to each of the production plans includes: The first similarity is used as the horizontal coordinate and the second similarity is used as the vertical coordinate to obtain the coordinate corresponding to each of the production plans.
5. The genetic scheduling method based on mean clustering partitioning of paternal and maternal parents according to claim 1 is characterized in that: Before clustering the production plans using a k-means clustering algorithm according to the cosine similarity between the production plans, the method further includes: Obtaining a second total processing time corresponding to processing each of the production plans on the target production line; The plurality of production plans are screened according to the second total processing time, and the production plans whose second total processing time is greater than a first threshold are deleted.
6. The genetic scheduling method based on mean clustering partitioning of paternal and maternal parents according to claim 1 is characterized in that: The method further comprises: When the first total processing time does not meet the convergence condition, the initial population is updated according to the child production plan, and the child production plan corresponding to the updated initial population is obtained until the first total processing time corresponding to the child production plan meets the convergence condition.
7. A genetic scheduling device based on mean clustering to divide paternal and maternal genes, characterized in that: include: A first acquisition module is used to acquire first times corresponding to processing of a plurality of workpieces in a target production line, wherein the first time includes a plurality of second times, the target production line includes a plurality of processing equipment, and each of the processing equipment corresponds to one second time; A first generating module is used to arrange the plurality of workpieces according to different production sequences to generate an initial population, wherein the initial population includes a plurality of production plans, wherein one production plan corresponds to one production sequence; A first clustering module, used for clustering the production plans according to the cosine similarity between the multiple production plans in the initial population using a k-means clustering algorithm to obtain a first clustering cluster and a second clustering cluster; A second generating module, configured to perform a cross operation on any one of the production plans in the first cluster and any one of the production plans in the second cluster to generate a plurality of child production plans; A first calculation module, configured to obtain, according to the first time, a first total processing time corresponding to the processing of the child production plan on the target production line; The first determination module is used to determine the child production plan with the shortest first total processing time as the final production plan when the first total processing time meets the convergence condition.
8. A network device, characterized in that: include: A processor, a memory, and a program stored in the memory and executable on the processor, wherein the program, when executed by the processor, implements the genetic scheduling method based on mean clustering partitioning of paternal and maternal parents as described in any one of claims 1 to 4.
9. A readable storage medium, characterized in that: include: The readable storage medium stores a program, and when the program is executed by the processor, the steps of the genetic scheduling method based on mean clustering partitioning of paternal and maternal parents as described in any one of claims 1 to 4 are implemented.
10. A computer program product, characterized in that It comprises computer instructions, which, when executed by a processor, implement the steps of the genetic scheduling method based on mean clustering partitioning of paternal and maternal parents as described in any one of claims 1 to 4.