A fully parallel NSGA-II approach for dynamic scheduling in flexible job shops

By running all the steps of NSGA-II on the GPU and designing suitable data structures, the NSGA-II method solves the problem of high computational volume and low efficiency when solving complex optimization problems, achieving efficient full parallel processing and high-quality Pareto optimal solution set.

CN117764150BActive Publication Date: 2024-12-06BEIJING UNIV OF TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311800963.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-12-26
Publication Date
2024-12-06
Estimated Expiration
2043-12-26

AI Technical Summary

Technical Problem

The existing NSGA-II method is computationally expensive and time-consuming when solving complex optimization problems. The parallel processing based on GPU cannot be processed in full parallel, resulting in frequent data transmission between the CPU and the GPU, limiting the operation efficiency of the method and difficult to ensure High-quality Pareto optimal solution set.

Method used

All steps to run NSGA-II on GPU, design three-layer data structures and secondary GPU pointers, use sparse matrix to store non-dominant layers, maintain the core structure of fast non-dominant sorting and crowded distance calculations, realize full parallel processing, and reduce CPU Transmission costs between GPU.

Benefits of technology

It improves the efficiency of NSGA-II in solving complex problems, ensures the quality of Pareto's optimal solution set, realizes the complete parallel processing of NSGA-II, and reduces the computing cost.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117764150B_ABST
    Figure CN117764150B_ABST
Patent Text Reader

Abstract

The present invention discloses a fully parallel NSGA-II method suitable for dynamic scheduling of flexible job shops. By using a secondary GPU pointer and designing a three-layer data structure, the fast non-dominated sorting and crowding distance calculation operations of NSGA-II are compatible with the grid-type physical structure of the GPU; a fitness function integrating non-dominated hierarchy and crowding distance is constructed to realize parallel processing of the elite retention strategy in NSGA-II. The present invention provides a fully parallel NSGA-II method suitable for dynamic scheduling of flexible job shops. By running all steps of NSGA-II on a GPU, the transmission cost between the CPU and the GPU is minimized, and the efficiency of the method in solving complex problems is improved; the core structure of NSGA-II is retained, especially the fast non-dominated sorting, crowding distance calculation and elite retention operations, without sacrificing the solution accuracy of the method, and ensuring the quality of the Pareto optimal solution set.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of multi-objective optimization applications, and in particular to a fully parallel NSGA-II method suitable for dynamic scheduling of flexible job shops. Background Art

[0002] NSGA-II (fast non-dominated sorting genetic algorithm with elite strategy) is one of the most popular multi-objective genetic algorithms. Its basic principles are as follows:

[0003] 1. Initialize the population: Randomly generate a group of individuals as the initial population.

[0004] 2. Calculate multi-objective values: Calculate the multi-objective values ​​of each individual in the population.

[0005] 3. Fast non-dominated sorting: According to multiple objective values, the individuals in the population are sorted by non-dominated individuals. The fewer individuals an individual is dominated by, the higher its non-dominated level.

[0006] 4. Crowding distance calculation: For individuals of the same non-dominated level, calculate their crowding distance. A higher crowding distance means that the individual is in a less crowded area.

[0007] 5. Selection: According to the non-dominated level and crowding distance, select the better individuals as the new generation population. The higher the non-dominated level and the larger the crowding distance of the individual, the higher the probability of being selected.

[0008] 6. Crossover and mutation: Perform crossover and mutation operations on the selected individuals to generate a new generation of population.

[0009] 7. Elite retention: retain excellent individuals based on the non-dominated sorting and crowding distance values ​​of individuals in the new and old populations.

[0010] 8. Repeat steps 2-7 until the set termination condition (such as the number of iterations or the optimal solution) is reached.

[0011] Padurariu et al. designed a parallel NSGA-II to solve the ZDT function. 1), 2), 3), and 6) of NSGA-II are executed on the GPU. The GPU-based non-dominated sorting design is divided into two parts: setting the first non-dominated layer and finding other non-dominated layers. There are two stages in setting the first non-dominated layer. First, execute a CUDA kernel, call N*N CUDA threads to calculate the number of times each individual is dominated, and find the individuals dominated by it. Secondly, call N CUDA threads to determine the individuals that are not dominated by any other individuals, and set their non-dominated levels to 1. Finding other non-dominated layers is achieved by executing the CUDA kernel multiple times, and each time the CUDA kernel is executed, a non-dominated layer is determined.

[0012] Wang Haijun and others used parallel NSGA-II to solve the land use optimization configuration problem. 1), 2), 5), and 6) of NSGA-II were executed on the GPU. The land use status raster data was converted into a two-dimensional array, and each CUDA thread was responsible for the calculation of a geographic unit. The corresponding CUDA parallel architecture was set according to different geographic raster data sets to maximize the GPU utilization.

[0013] Aguilar-Rivera designed random non-dominated sorting and grid crowding distance calculation, realizing full parallelism of NSGA-II on GPU, reducing the calculation time of the method to solve the ZDT function, but at the same time sacrificing the calculation accuracy of the method. Among them, random non-dominated sorting introduces random individuals xi to determine whether individuals need to be non-dominated sorting calculations. The value of xi is randomly obtained from the shuffled target matrix; grid crowding distance calculation imposes a grid on the search space, assigns each individual to a cell in the grid, and the metric is the normalized number of adjacent individuals of the individual in its corresponding cell.

[0014] Hu Binbin et al. used the construction of non-dominated sets and microhabitat technology to enable the entire NSGA-II program to be executed on the GPU. The construction of non-dominated sets parallelizes the dominance relationship between individuals in the group, and uses merge operations to count the total number of times each individual is dominated; the microhabitat technology introduces shared fitness, which encourages the population to maintain diversity by limiting competition between individuals. This method achieves excellent acceleration effects when solving ZDT functions and oil blending process problems. However, the microhabitat technology has defects such as difficulty in parameter selection and problem dependence, which makes it difficult to ensure that this method can achieve good optimization effects when solving other problems.

[0015] However, the above uses all have the following problems:

[0016] 1. NSGA-II is computationally intensive and time-consuming when solving complex optimization problems. GPU-based parallel processing can improve the efficiency of the algorithm, but the structure of NSGA-II is not suitable for full GPU-based parallel processing. Partial parallel processing requires frequent data transfer between the CPU and GPU, which limits the operating efficiency of the method.

[0017] 2. Fast non-dominated sorting, crowding distance calculation, and elite retention operations are the core structures of NSGA-II. Changing the core structure of NSGA-II will affect the performance of the algorithm and make it difficult to ensure that the algorithm obtains a high-quality Pareto optimal solution set when solving complex problems. Summary of the invention

[0018] In view of the above-mentioned defects of the prior art, the technical problem to be solved by the present invention is that the existing NSGA-II method used to solve multi-objective optimization solutions has a large amount of calculation and a long time consumption when solving complex optimization problems. When the parallel processing is based on GPU, it cannot be fully parallelized and data needs to be frequently transmitted between the CPU and GPU, which limits the operation efficiency of the method and makes it difficult to ensure that the method obtains a high-quality Pareto optimal solution set when solving complex problems. The present invention provides a fully parallel NSGA-II method suitable for dynamic scheduling of flexible job shops. By running all steps of NSGA-II on the GPU, the transmission cost between the CPU and GPU is minimized, and the efficiency of the method in solving complex problems is improved; the core structure of NSGA-II is retained, especially the fast non-dominated sorting, crowding distance calculation and elite retention operations, to ensure the quality of the Pareto optimal solution set.

[0019] To achieve the above object, the present invention provides a fully parallel NSGA-II method suitable for dynamic scheduling of flexible job shops, which runs all steps of NSGA-II on a GPU without changing the core structure of NSGA-II; specifically, the following steps are included:

[0020] Allocate memory for POP, RANK, and CROWD on the CPU side, and allocate memory for d_POP, d_RANK, and d_CROWD on the GPU side;

[0021] Randomly initialize the #chrom of all individuals in POP on the CPU;

[0022] Copy the common variables and pointer variables in POP, RANK and CROWD on the CPU side to d_POP, d_RANK and d_CROWD on the GPU side as required;

[0023] Start the kernel function on the GPU to initialize d_POP, d_RANK, and d_CROWD;

[0024] Launch the kernel function fast_nondom_first_front<< on the GPU<blocks,threads> >>(d_POP,d_RANK,ps), set the first non-dominated layer;

[0025] Use the for loop to repeatedly start the kernel function fast_nondom_other_front<< on the GPU<blocks,threads> >>(d_POP, d_RANK, k); when the kernel function is started for the kth time (k starts from 0), the k+1th non-dominated layer is set, and the kernel function is started ps-1 times in total;

[0026] Use the for loop to calculate the crowding distance of the individual about the kth target and accumulate it;

[0027] Launch the kernel function on the GPU, use bitune merge sort, and sort the elements of d_CROWD row by row in descending order by #value;

[0028] Launch the kernel function dummy_fitness<< on the GPU<blocks,threads> >>(d_RANK,d_CROWD,base,ps);

[0029] Use the while loop to generate a new generation of d_POP;

[0030] Copy the common variables in d_RANK on the GPU side to RANK on the CPU side as required;

[0031] Finally, release the allocated memory on the CPU and GPU.

[0032] Furthermore, the fully parallel NSGA-II method includes a three-layer data structure, uses a secondary GPU pointer, and designs a sparse matrix RANK to store each non-dominated layer, individuals in each non-dominated layer, and individuals dominated by each individual.

[0033] Furthermore, a kernel function is started on the GPU to initialize d_POP, d_RANK and d_CROWD, wherein the #objvalue of all individuals in d_POP is calculated by the #chrom of the corresponding individuals in d_POP; the #index of all individuals in d_POP is initialized in ascending order between 0 and ps-1; the #dummy, #flag, #np and #dp of all individuals in d_POP are initialized to 0; the values ​​in the vector pointed to by *sp of all individuals in d_POP are initialized to -1; the #value and #index of all elements in d_RANK are initialized to -1; the #dp of all elements in d_RANK are initialized to 0; the values ​​in the vector pointed to by *sp of all elements in d_RANK are initialized to -1; the #value and #index of all elements in d_CROWD are initialized to -1.

[0034] Furthermore, the kernel function fast_nondom_first_front<< is started on the GPU<blocks,threads> >>(d_POP,d_RANK,ps), set the first non-dominated layer, specifically including the following steps:

[0035] Count the number of times individual p is dominated by other individuals and assign it to #np of the corresponding d_POP. Collect the set of individuals dominated by individual p and store it in the memory pointed to by *sp of the corresponding d_POP.

[0036] Synchronize all GPU cores __syncthreads();

[0037] If #np of individual p in d_POP is equal to 0, set #flag of the corresponding d_POP to 1, marking that the individual p has been assigned to the non-dominated layer, and copy the corresponding d_POP to the first row of d_RANK, that is, copy the individuals belonging to the first non-dominated layer to the first row of d_RANK.

[0038] Furthermore, the kernel function fast_nondom_other_front<< is repeatedly started on the GPU using a for loop<blocks,threads> >>(d_POP, d_RANK, k); when the kernel function is started for the kth time (k starts counting from 0), the k+1th non-dominated layer is set, and the kernel function is started a total of ps-1 times; specifically including:

[0039] Subtract 1 from #np of each individual q in the memory pointed to by *sp of all elements p in the kth row of d_RANK, and use atomicSub atomic operation to process this step;

[0040] Synchronize all GPU cores __syncthreads();

[0041] If #np of individual q is equal to 0 and #flag of the corresponding d_POP is equal to 0, set #flag of the corresponding d_POP to 1 to mark that the individual q has been assigned to the non-dominated layer, and copy the corresponding d_POP to the k+1th row of d_RANK, that is, copy the individuals belonging to the k+1th non-dominated layer to the k+1th row of d_RANK.

[0042] Furthermore, a for loop is used to calculate the crowding distance of the individual with respect to the k-th target and to accumulate the distances. Specifically, the for loop is used to execute the following steps multiple times, and the k-th execution (k starts counting from 0) is performed to calculate the crowding distance of the individual with respect to the k-th target and to accumulate the distances. The total execution of funcno times:

[0043] Start the kernel function on the GPU, check the elements of d_RANK column by column, and if the #index of d_RANK is equal to the #index of d_POP, assign the kth #objvalue of d_POP to the #value of d_RANK;

[0044] Launch the kernel function on the GPU, use a bitune merge sort, and sort the elements of d_RANK row by row in descending order by #value;

[0045] Launch the kernel function crowd_distance<< on the GPU<blocks,threads> >>(d_RANK,d_CROWD,k,ps,max,min).

[0046] Furthermore, the kernel function crowd_distance<< is launched on the GPU<blocks,threads> >>(d_RANK,d_CROWD,k,ps,max,min), specifically including the following steps:

[0047] Check the valid elements of d_RANK row by row;

[0048] The #value of the first and last valid elements in each row of d_RANK is assigned a maximum value row by row, and the #value of the remaining valid elements in each row of d_RANK is assigned according to the absolute normalized difference between the #values ​​of two adjacent elements;

[0049] If k=0, copy the #index and #value of the valid elements in d_RANK to the #index and #value of d_CROWD row by row; if k>0, use the #index of the valid elements in d_RANK to add the #value of d_RANK to the #value of the corresponding #index position in d_CROWD row by row.

[0050] Furthermore, the kernel function dummy_fitness<< is started on the GPU<blocks,threads> >>(d_RANK,d_CROWD,base,ps), specifically including the following steps:

[0051] Convert the #value of the valid elements in d_CROWD row by row to the quotient of the element's position in the row divided by base. When the population size is i digits, base = 10^i;

[0052] Add the #value of the valid element in d_CROWD and the sequence number of the row where the element is located row by row, and assign the value to the #dummy at the corresponding #index position in d_POP. The integer part of #dummy represents the non-dominated layer level of the individual, and the decimal part represents the crowding distance after conversion.

[0053] Further, using a while loop, a new generation of d_POP is generated, specifically including using the while loop to execute the following steps multiple times, and executing maxgen times in total;

[0054] Start the kernel function on the GPU and perform selection, crossover and mutation operations in sequence to generate a temporary population;

[0055] Start the kernel function on the GPU, perform the elite retention operation, merge d_POP with the temporary population, calculate the #dummy of each individual in the merged population, sort the individuals in the merged population in descending order by #dummy, retain the first ps individuals, and generate a new generation of d_POP.

[0056] Technical Effects

[0057] The present invention provides a fully parallel NSGA-II method suitable for dynamic scheduling of flexible job shops. The method utilizes a secondary GPU pointer and designs a three-layer data structure to make the fast non-dominated sorting and crowding distance calculation operations of NSGA-II compatible with the grid-type physical structure of the GPU. The fitness function integrating the non-dominated hierarchy and the crowding distance is constructed to realize the parallel processing of the elite strategy in NSGA-II. The present invention provides a fully parallel NSGA-II method suitable for dynamic scheduling of flexible job shops. By running all steps of NSGA-II on the GPU, the transmission cost between the CPU and the GPU is minimized, and the efficiency of the method in solving complex problems is improved. The core structure of NSGA-II is retained, especially the fast non-dominated sorting, crowding distance calculation and elite retention operations, without sacrificing the solution accuracy of the method, and ensuring the quality of the Pareto optimal solution set.

[0058] The concept, specific structure and technical effects of the present invention will be further described below in conjunction with the accompanying drawings to fully understand the purpose, characteristics and effects of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0059] Figure 1 It is a schematic diagram of a framework of a fully parallel NSGA-II method suitable for dynamic scheduling of flexible job shops according to a preferred embodiment of the present invention;

[0060] Figure 2 It is a schematic diagram of a three-layer data structure of a fully parallel NSGA-II method suitable for dynamic scheduling of flexible job shops in a preferred embodiment of the present invention;

[0061] Figure 3 It is a schematic diagram of a GPU-based genetic operator of a fully parallel NSGA-II method suitable for dynamic scheduling of flexible job shops according to a preferred embodiment of the present invention;

[0062] Figure 4 It is a coding example of a fully parallel NSGA-II method suitable for dynamic scheduling of flexible job shops in a preferred embodiment of the present invention;

[0063] Figure 5 It is an example of crossover operation of a fully parallel NSGA-II method suitable for dynamic scheduling of flexible job shops in a preferred embodiment of the present invention;

[0064] Figure 6 It is an example of a variation operation of a fully parallel NSGA-II method suitable for dynamic scheduling of flexible job shops in a preferred embodiment of the present invention;

[0065] Figure 7 is a symbolic description of a fully parallel NSGA-II method suitable for dynamic scheduling of flexible job shops in a preferred embodiment of the present invention;

[0066] Figure 8 It is a triggering rescheduling factor of a fully parallel NSGA-II method suitable for dynamic scheduling of flexible job shops in a preferred embodiment of the present invention;

[0067] Fig. 9 It is a schematic diagram of performance comparison results of a fully parallel NSGA-II method suitable for dynamic scheduling of flexible job shops in a preferred embodiment of the present invention;

[0068] Fig.10 It is a schematic diagram of non-parametric test results of a fully parallel NSGA-II method suitable for dynamic scheduling of flexible job shops in a preferred embodiment of the present invention. DETAILED DESCRIPTION

[0069] In order to make the technical problems, technical solutions and beneficial effects to be solved by the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.

[0070] In the following description, specific details such as specific internal procedures and techniques are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present invention. However, it should be clear to those skilled in the art that the present invention may be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present invention.

[0071] like Figure 1As shown in FIG. 1 , the present invention provides a fully parallel NSGA-II method suitable for dynamic scheduling of flexible job shops, which minimizes the transmission cost between the CPU and the GPU by running all NSGA-II steps on the GPU. When the termination condition is reached, the NSGA-II executed on the GPU can always obtain a set of feasible solutions and send them back to the CPU when the application ends. The technical solution includes the following four parts, where the relevant symbols are as follows: Figure 7 shown.

[0072] 1. Design a three-layer data structure

[0073] Using the secondary GPU pointer, a sparse matrix RANK is designed to store each non-dominated layer, the individuals in each non-dominated layer, and the individuals dominated by each individual. Its three-layer data structure is as follows: Figure 2 As shown, the solid arrows represent the copying of ordinary variables and pointer variables, and the hollow arrows represent the copying of ordinary variables only. *RANK is the CPU pointer on the CPU side, *h_RANK and *h_R are the GPU pointers on the CPU side, and *d_RANK and *d_R are the GPU pointers on the GPU side. The blue and yellow solid arrows point to the same GPU global memory of size 1×ps on the GPU side, and the green and red solid arrows point to the same GPU global memory of size ps×1 on the GPU side. The yellow hollow arrow indicates the process of copying the final result from the GPU side to the CPU side.

[0074] 2. Design fitness function

[0075] Calculate the non-dominated level and crowding distance of all individuals. Since the evaluation criteria of the non-dominated level and the individual crowding distance are inconsistent, the fitness function is designed to facilitate NSGA-II to make full use of the SIMT architecture of the GPU. CROWD is a sparse matrix similar to RANK. The rows of CROWD represent the non-dominated level from low to high, and the columns represent the valid individuals in the same non-dominated level arranged from high to low according to the crowding distance. base is the conversion base. When the population size is i digits, base = 10^i. The fitness function value is the quotient of the crowding distance value of the valid individual in CROWD in this row divided by the base and the sum of the serial number of the row where it is located, that is, the integer part of the fitness function value represents the non-dominated level of the individual, and the decimal part represents the crowding distance of the individual after conversion.

[0076] 3. Design of genetic operators

[0077] The NSGA-II genetic operator is designed based on the two-dimensional physical structure of the NVIDIA CUDA computing platform. The specific process is as follows Figure 3As shown in the figure, each gray circle represents a GPU core. GPU cores are matched one-to-one with NSGA-II individuals, and each GPU core is responsible for processing an NSGA-II individual and its genetic operator operations. Two individuals are randomly selected using the competitive selection method, and the individual with the smaller fitness function value is retained. Any two individuals in the temporary new population are randomly paired and a crossover operation is performed. The mutation operation is performed on the new individuals formed by the crossover operator to generate a temporary population.

[0078] 4. Design data synchronization mechanism

[0079] When executing NSGA-II, a single individual will not have a relationship with other individuals except in the objective function value calculation operation. Operations such as fast non-dominated sorting, crowding distance calculation, and genetic operators will cause a single individual to have data dependencies with other individuals. In order to protect the integrity of the data, it is necessary to design a data synchronization mechanism based on the memory structure of the NVIDIA CUDA computing platform. When calculating non-dominated layers other than the first layer, the atomicSub atomic operation is used to handle the subtraction operation stored in the local memory across GPU cores. When processing sorting operations, the __syncthreads() built-in command is used to synchronize the internal data of the GPU block stored in the shared memory. The GPU kernel function kernel<<<>>>() is restarted when calculating the crowding distance of each non-dominated layer level and individuals in each non-dominated layer, effectively synchronizing the data stored in the global memory across GPU blocks.

[0080] The present invention discloses a fully parallel NSGA-II method suitable for dynamic scheduling of flexible job shops, and the specific steps are as follows:

[0081] 1. Allocate memory for POP, RANK, and CROWD on the CPU side, and allocate memory for d_POP, d_RANK, and d_CROWD on the GPU side.

[0082] 2. Randomly initialize the #chrom of all individuals in POP on the CPU.

[0083] 3. Set the common variables and pointer variables in the RANK on the CPU side according to Figure 2 The directions of the blue, yellow, green and red solid arrows are copied to d_RANK on the GPU side. Similarly, the common variables and pointer variables in POP and CROWD on the CPU side are copied to d_POP and d_CROWD on the GPU side.

[0084] 4. Start the kernel function on the GPU to initialize d_POP, d_RANK, and d_CROWD. The #objvalue of all individuals in d_POP is calculated from the #chrom of the corresponding individuals in d_POP; the #index of all individuals in d_POP is initialized in ascending order between 0 and ps-1; the #dummy, #flag, #np, and #dp of all individuals in d_POP are initialized to 0; the values ​​in the vector pointed to by *sp of all individuals in d_POP are initialized to -1. The #value and #index of all elements in d_RANK are initialized to -1; the #dp of all elements in d_RANK is initialized to 0; the values ​​in the vector pointed to by *sp of all elements in d_RANK are initialized to -1. The #value and #index of all elements in d_CROWD are initialized to -1.

[0085] 5. Start the kernel function fast_nondom_first_front<< on the GPU<blocks,threads> >>(d_POP,d_RANK,ps), set the first non-dominated layer.

[0086] 5.1 Count the number of times individual p is dominated by other individuals and assign it to #np of the corresponding d_POP. Collect the set of individuals dominated by individual p and store it in the memory pointed to by *sp of the corresponding d_POP.

[0087] 5.2__syncthreads().

[0088] 5.3 If #np of individual p in d_POP is equal to 0, set #flag of the corresponding d_POP to 1, marking that the individual p has been assigned to the non-dominated layer, and copy the corresponding d_POP to the first row of d_RANK, that is, copy the individuals belonging to the first non-dominated layer to the first row of d_RANK.

[0089] 6. Use the for loop to repeatedly start the kernel function fast_nondom_other_front<< on the GPU<blocks,threads> >>(d_POP,d_RANK,k). The kernel function is started for the kth time (k starts at 0) to set the k+1th non-dominated layer, and the kernel function is started ps-1 times in total.

[0090] 6.1 Subtract 1 from #np of each individual q in the memory pointed to by *sp of all elements p in the kth row of d_RANK, and use the atomicSub atomic operation to handle this step.

[0091] 6.2__syncthreads().

[0092] 6.3 If #np of individual q is equal to 0 and #flag of the corresponding d_POP is equal to 0, set #flag of the corresponding d_POP to 1, mark that the individual q has been assigned to the non-dominated layer, and copy the corresponding d_POP to the k+1th row of d_RANK, that is, copy the individuals belonging to the k+1th non-dominated layer to the k+1th row of d_RANK.

[0093] 7. Use a for loop to execute the following steps multiple times. The kth execution (k starts from 0) calculates the crowding distance of the individual with respect to the kth target and accumulates it, and executes funcno times in total.

[0094] 7.1 Start the kernel function on the GPU, check the elements of d_RANK column by column, and if the #index of d_RANK is equal to the #index of d_POP, assign the kth #objvalue of d_POP to the #value of d_RANK.

[0095] 7.2 Launch the kernel function on the GPU and use bitune merge sort to sort the elements of d_RANK row by row in descending order by #value.

[0096] 7.3 Launch the kernel function crowd_distance<< on the GPU<blocks,threads> >>(d_RANK,d_CROWD,k,ps,max,min).

[0097] 7.3.1 Check the valid elements of d_RANK row by row.

[0098] 7.3.2 Assign a maximum value to the first and last #value of each valid element in each row of d_RANK row by row, and assign the #value of the remaining valid elements in each row of d_RANK according to the absolute normalized difference between the #values ​​of two adjacent elements.

[0099] 7.3.3 If k=0, copy the #index and #value of the valid elements in d_RANK to the #index and #value of d_CROWD row by row; if k>0, use the #index of the valid elements in d_RANK to add the #value of d_RANK to the #value of the corresponding #index position in d_CROWD row by row.

[0100] 8. Start the kernel function on the GPU and use bitonic merge sort to sort the elements of d_CROWD row by row in descending order by #value.

[0101] 9. Start the kernel function dummy_fitness<< on the GPU<blocks,threads> >>(d_RANK,d_CROWD,base,ps).

[0102] 9.1 Convert the #value of the valid elements in d_CROWD row by row to the quotient of the element's position in the row divided by base. When the population size is i digits, base = 10^i.

[0103] 9.2 Add the #value of the valid element in d_CROWD and the serial number of the row where the element is located row by row, and assign the value to the #dummy at the corresponding #index position in d_POP. The integer part of #dummy represents the non-dominated layer level of the individual, and the decimal part represents the crowding distance after conversion.

[0104] 10. Use a while loop to execute the following steps multiple times, a total of maxgen times.

[0105] 10.1 Start the kernel function on the GPU, press Figure 4 As shown, selection, crossover and mutation operations are performed in sequence to generate a temporary population.

[0106] 10.2 Launch the kernel function on the GPU to perform elite preservation operations. Merge d_POP with the temporary population and calculate the #dummy of each individual in the merged population. Sort the individuals in the merged population in descending order by #dummy. Keep the first ps individuals to generate a new generation of d_POP.

[0107] 11. Set the normal variables in d_RANK on the GPU side according to Figure 2 The direction of the yellow hollow arrow is copied to the RANK on the CPU side. The valid elements in the first row of the RANK matrix are the Pareto optimal solution set of the multi-objective optimization problem.

[0108] 12. Release the allocated memory on the CPU and GPU.

[0109] The following will take solving the problem of dynamic scheduling of a flexible job shop as an example to illustrate the feasibility and technical effect of a fully parallel NSGA-II method suitable for dynamic scheduling of a flexible job shop of the present invention.

[0110] In the application of the embodiment of the present invention, the core structure and process of the NSGA-II method are retained, and full parallelism is achieved during operation, so as to ensure the solution accuracy, ensure the quality of the Pareto optimal solution set, minimize the transmission cost between the CPU and the GPU, and improve the efficiency of the method in solving complex problems.

[0111] The dynamic flexible job shop scheduling problem can be described as follows: there are n original workpieces to be processed, which can be processed on m equipment. Each workpiece contains multiple processes. There is a definite processing order between the processes of the same workpiece, and each process can be processed on multiple equipment. Workshop production is a dynamic environment. In the actual processing process, there are n' newly added workpieces to be processed. Dynamic scheduling requires reasonable adjustment of the existing scheduling plan, that is, equipment redistribution and process reordering, so that the existing plan and the new plan are connected in an orderly manner, and the workshop efficiency and scheduling stability are optimized while meeting the constraints. Among them, the workshop efficiency is defined as the sum of the total delay time of the workpiece and the maximum processing time, and the scheduling stability is defined as the sum of the deviation of the total start time of the original workpiece process and the deviation of the total processing equipment of the original workpiece process.

[0112] 1. Coding and initialization

[0113] The flexible job shop scheduling problem involves the process and the allocation of production equipment for the process. Therefore, the process sorting vector and the equipment selection vector are needed to represent the complete scheduling, that is, the #chrom of all individuals in the POP is represented by a two-dimensional vector composed of the process sorting vector and the equipment selection vector. The process sorting vector is directly encoded with the workpiece number, and the order of appearance of the workpiece number represents the order of processing of the workpiece process. Each gene bit in the equipment selection vector is represented by an integer, which is arranged in the order of the workpiece and the process of the workpiece. Each integer represents the order number of the processing equipment selected for the current process in the optional equipment set.

[0114] In the existing plan, the processes whose start time is earlier than the rescheduling time are considered completed processes and will not be interrupted by the rescheduling. Their process order codes and equipment selection codes will be directly obtained from the existing plan, where the process order codes are placed at the starting position of the new plan and the equipment selection codes are placed at the corresponding original positions in the new plan. The codes of the remaining positions will be randomly initialized.

[0115] Initialize the #chrom of all individuals in POP on the CPU, and copy the POP on the CPU to d_POP on the GPU. Each GPU core is responsible for processing an individual in d_POP, and uses the #chrom of the individual to parallelly calculate the #objvalue of the individual, i.e., the workshop efficiency value and scheduling stability value. Then parallelly calculate the #dummy of the individual.

[0116] Figure 4An example is shown, where workpiece 0, workpiece 1, and workpiece 2 are the original workpieces to be processed, and workpiece 3 is a newly added workpiece to be processed. Process 2 of workpiece 2 is scheduled to be processed by equipment 0, and then process 3 of workpiece 0 is scheduled to be processed by equipment 2. In addition, the numbers with a gray background represent the completed processes and the equipment used to process them, while the part with a white background shows the processes and equipment waiting to be processed after the rescheduling time.

[0117] 2. Select an action

[0118] Each GPU core is responsible for processing the selection operation of an individual in d_POP. A competitive selection method is used to randomly select an individual from all individuals in d_POP and compare it with the individual processed by the GPU core. The individual with a small #dummy value is retained to generate a temporary population.

[0119] 3. Crossover Operation

[0120] Each GPU core is responsible for processing the crossover operation of one individual in the temporary population. The Fisher-Yates method is used to randomly select an individual from all individuals in the temporary population to pair with the individual processed by the GPU core. The process sorting vector and device selection vector of the paired individual group adopt different crossover operations. Among them, the process sorting vector uses a process-based sequential crossover operator and only acts on unfinished processes; while the device selection vector uses a traditional single-point crossover operator. The two crossover operations are executed serially in one GPU core.

[0121] Figure 5 An example is shown, where Workpiece 0, Workpiece 1, and Workpiece 2 are the original workpieces to be processed, and Workpiece 3 is a newly added workpiece to be processed. The gray highlighted positions represent the completed operations and the equipment used to process these operations. The bold marked positions represent the randomly selected intersection points in the operation sorting vector and the randomly selected single-point intersection points in the equipment selection vector.

[0122] 4. Mutation Operation

[0123] Each GPU core is responsible for processing the mutation operation of an individual in the temporary population. Each individual's process sorting vector and device selection vector adopt different mutation operations, both of which only act on the unfinished processes and the codes of the devices used to process these processes. Among them, the process sorting vector adopts the exchange mutation operator, and the device selection vector will randomly select n+n' codes, and randomly generate a value within a range to replace the original code in addition to its original value. The two mutation operations are executed serially in one GPU core.

[0124] Figure 6An example is shown, where Workpiece 0, Workpiece 1, and Workpiece 2 are the original workpieces to be processed, and Workpiece 3 is a newly added workpiece to be processed. The gray highlighted codes represent the completed operations and the equipment used to handle these operations. The bold marked positions represent the codes affected by the variation operation.

[0125] 5. Elite retention operation

[0126] Each GPU core is responsible for processing an individual in the temporary population, and uses the #chrom of the individuals after selection, crossover, and mutation to parallelly calculate the #objvalue of the individuals in the temporary population. The temporary population and d_POP are merged, and the #dummy of each individual in the merged population is parallelly calculated. The individuals in the merged population are sorted in descending order by #dummy, and the first ps individuals are retained to generate a new generation of d_POP.

[0127] 6. Experimental Results

[0128] The present invention first expands 6 representative flexible job shop scheduling problem instances from Comparative Example 1 (2 groups contain 10 workpieces, 2 groups contain 15 workpieces and 2 groups contain 20 workpieces), and the factors that trigger rescheduling are as follows: Figure 8 As shown. Secondly, three examples of the flexible job shop dynamic scheduling problem from comparative example 2 are considered, and PF f% means that f% of the total number of equipment can be used to process the same process.

[0129] Since the true Pareto frontier of the flexible job shop dynamic scheduling problem instance in the experiment is unknown in advance, four common evaluation indicators are used to evaluate their performance. The explanations are as follows:

[0130] Number of Pareto Solutions (NPS): A quality evaluation metric where a higher value means more alternative solutions are available to the decision maker.

[0131] Spacing: A quality evaluation metric where lower values ​​indicate more consistent spacing between non-dominated solutions.

[0132] Modified Mean Ideal Distance (MMID): Quality evaluation indicator, lower values ​​represent methods with better convergence performance.

[0133] Time: Execution time indicator, lower values ​​indicate that the method takes less time to run.

[0134] Two existing GPU-based parallel genetic methods (hereinafter referred to as existing method 1 and existing method 2) are used to compare with the fully parallel NSGA-II method proposed in the embodiment of the present invention. Each method is tested 150 groups independently, and the results are as follows: Fig. 9 As shown in the figure, each row represents an example, each column represents the average value of an evaluation index, and the best value is shown in bold. In addition, the Wilcoxon signed rank test is used to study the difference in overall performance between the method proposed in the present invention and the other two methods, with the significance level set to 0.1. The results are shown in the figure. Fig.10 In general, the method proposed in the present invention achieves the best performance in most instances on all indicators, and statistical significance is proved to be significant in most instances.

[0135] The preferred specific embodiments of the present invention are described in detail above. It should be understood that a person skilled in the art can make many modifications and changes based on the concept of the present invention without creative work. Therefore, any technical solution that can be obtained by a person skilled in the art through logical analysis, reasoning or limited experiments based on the concept of the present invention on the basis of the prior art should be within the scope of protection determined by the claims.

Claims

1. A fully parallel NSGA-II approach for dynamic scheduling of flexible job shops, It is characterized in that All steps of NSGA-II are run on GPU without changing the core structure of NSGA-II, and are fully parallelized at runtime; specifically, the following steps are included: Allocate memory for POP, RANK, and CROWD on the CPU side, and allocate memory for d_POP, d_RANK, and d_CROWD on the GPU side; Randomly initialize the #chrom of all individuals in POP on the CPU; the #chrom of all individuals in POP is represented by a two-dimensional vector composed of a process sorting vector and a device selection vector; Copy the common variables and pointer variables in POP, RANK and CROWD on the CPU side to d_POP, d_RANK and d_CROWD on the GPU side as required; Start the kernel function on the GPU to initialize d_POP, d_RANK, and d_CROWD; Launch the kernel function fast_nondom_first_front<< on the GPU<blocks,threads> >>(d_POP,d_RANK,ps), set the first non-dominated layer; Use the for loop to repeatedly start the kernel function fast_nondom_other_front<< on the GPU<blocks,threads> >>(d_POP, d_RANK, k); when the kernel function is started for the kth time, k starts counting from 0 to set the k+1th non-dominated layer, and the kernel function is started ps-1 times in total; Use the for loop to calculate the crowding distance of the individual about the kth target and accumulate it; Launch the kernel function on the GPU, use the bitune merge sort, and sort the elements of d_CROWD row by row in descending order by #value; Launch the kernel function dummy_fitness<< on the GPU<blocks,threads> >>(d_RANK,d_CROWD,base,ps); Use the while loop to generate a new generation of d_POP; The common variables in d_RANK on the GPU side are copied to RANK on the CPU side as required; the valid elements in the first row of the RANK matrix are the Pareto optimal solution set of the multi-objective optimization problem; Finally, release the allocated memory on the CPU and GPU sides; The fully parallel NSGA-II method includes a three-layer data structure, using a secondary GPU pointer, and designing a sparse matrix RANK to store each non-dominated layer, individuals in each non-dominated layer, and individuals dominated by each individual; *RANK is a CPU pointer located on the CPU side, *h_RANK and *h_R are GPU pointers located on the CPU side, and *d_RANK and *d_R are GPU pointers located on the GPU side; it also includes ordinary variables, pointer variable replication, and ordinary variable replication; the ordinary variables and pointer variables in the RANK on the CPU side are copied to the d_RANK on the GPU side in a specified direction; similarly, the ordinary variables and pointer variables in the POP and CROWD on the CPU side are copied to the d_POP and d_CROWD on the GPU side; the ordinary variables in the d_RANK on the GPU side are copied to the RANK on the CPU side in a specified direction.

2. A fully parallel NSGA-II method for dynamic scheduling of flexible job shops as claimed in claim 1, It is characterized in that Start the kernel function on the GPU to initialize d_POP, d_RANK and d_CROWD, where the #objvalue of all individuals in d_POP is calculated by the #chrom of the corresponding individuals in d_POP; the #index of all individuals in d_POP is initialized in ascending order between 0 and ps-1; the #dummy, #flag, #np and #dp of all individuals in d_POP are initialized to 0; the values ​​in the vector pointed to by *sp of all individuals in d_POP are initialized to -1; the #value and #index of all elements in d_RANK are initialized to -1; the #dp of all elements in d_RANK are initialized to 0; the values ​​in the vector pointed to by *sp of all elements in d_RANK are initialized to -1; the #value and #index of all elements in d_CROWD are initialized to -1.

3. A fully parallel NSGA-II method for dynamic scheduling of flexible job shops as claimed in claim 1, It is characterized in that Launch the kernel function fast_nondom_first_front<< on the GPU<blocks,threads> >>(d_POP,d_RANK,ps), set the first non-dominated layer, specifically including the following steps: Count the number of times individual p is dominated by other individuals and assign it to #np of the corresponding d_POP. Collect the set of individuals dominated by individual p and store it in the memory pointed to by *sp of the corresponding d_POP. Synchronize all GPU cores __syncthreads(); If #np of individual p in d_POP is equal to 0, set #flag of the corresponding d_POP to 1, marking that the individual p has been assigned to the non-dominated layer, and copy the corresponding d_POP to the first row of d_RANK, that is, copy the individuals belonging to the first non-dominated layer to the first row of d_RANK.

4. A fully parallel NSGA-II method for dynamic scheduling of flexible job shops as claimed in claim 1, It is characterized in that Use the for loop to repeatedly start the kernel function fast_nondom_other_front<< on the GPU<blocks,threads> >>(d_POP, d_RANK, k); when the kernel function is started for the kth time, k starts counting from 0 to set the k+1th non-dominated layer, and the kernel function is started ps-1 times in total; Specifically include: Subtract 1 from #np of each individual q in the memory pointed to by *sp of all elements p in the kth row of d_RANK, and use atomicSub atomic operation to process this step; Synchronize all GPU cores __syncthreads(); If #np of individual q is equal to 0 and #flag of the corresponding d_POP is equal to 0, set #flag of the corresponding d_POP to 1 to mark that the individual q has been assigned to the non-dominated layer, and copy the corresponding d_POP to the k+1th row of d_RANK, that is, copy the individuals belonging to the k+1th non-dominated layer to the k+1th row of d_RANK.

5. A fully parallel NSGA-II method for dynamic scheduling of flexible job shops as claimed in claim 1, It is characterized in that Use a for loop to calculate the crowding distance of the individual about the k-th target and accumulate it. Specifically, use a for loop to execute the following steps multiple times. For the k-th execution, k starts counting from 0 to calculate the crowding distance of the individual about the k-th target and accumulate it. The total execution of funcno times: Start the kernel function on the GPU, check the elements of d_RANK column by column, and if the #index of d_RANK is equal to the #index of d_POP, assign the kth #objvalue of d_POP to the #value of d_RANK; Launch the kernel function on the GPU, use a bitune merge sort, and sort the elements of d_RANK row by row in descending order by #value; Launch the kernel function crowd_distance<< on the GPU<blocks,threads> >>(d_RANK,d_CROWD,k,ps,max,min).

6. A fully parallel NSGA-II method for dynamic scheduling of flexible job shops as claimed in claim 5, It is characterized in that Launch the kernel function crowd_distance<< on the GPU<blocks,threads> >>(d_RANK,d_CROWD,k,ps,max,min), specifically including the following steps: Check the valid elements of d_RANK row by row; The #value of the first and last valid elements in each row of d_RANK is assigned a maximum value row by row, and the #value of the remaining valid elements in each row of d_RANK is assigned according to the absolute normalized difference between the #values ​​of two adjacent elements; If k=0, copy the #index and #value of the valid elements in d_RANK to the #index and #value of d_CROWD row by row; if k>0, use the #index of the valid elements in d_RANK to add the #value of d_RANK to the #value of the corresponding #index position in d_CROWD row by row.

7. A fully parallel NSGA-II method for dynamic scheduling of flexible job shops as claimed in claim 1, It is characterized in that Launch the kernel function dummy_fitness<< on the GPU<blocks,threads> >>(d_RANK,d_CROWD,base,ps), specifically including the following steps: Convert the #value of the valid elements in d_CROWD row by row into the quotient of the element's position in the row divided by base; when the population size is i digits, base = 10^i; Add the #value of the valid element in d_CROWD and the serial number of the row where the element is located row by row, and assign the sum to the #dummy at the corresponding #index position in d_POP. The integer part of #dummy represents the non-dominated layer level of the individual, and the decimal part represents the crowding distance after conversion.

8. A fully parallel NSGA-II method for dynamic scheduling of flexible job shops as claimed in claim 1, It is characterized in that Using a while loop, a new generation of d_POP is generated, specifically including using a while loop to execute the following steps multiple times, a total of maxgen times; Start the kernel function on the GPU and perform selection, crossover and mutation operations in sequence to generate a temporary population; Start the kernel function on the GPU, perform the elite retention operation, merge d_POP with the temporary population, calculate the #dummy of each individual in the merged population, sort the individuals in the merged population in descending order by #dummy, retain the first ps individuals, and generate a new generation of d_POP.