Casting heat treatment production scheduling method based on grey wolf optimization algorithm
By improving the population initialization, convergence factor and weighting strategy of the gray wolf optimization algorithm, the problem that traditional casting heat treatment scheduling methods are difficult to cope with complex production tasks is solved, and more efficient production scheduling and product quality improvement are achieved.
Patent Information
- Application Number
- CN202411560578.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-04
- Publication Date
- 2025-02-14
AI Technical Summary
Traditional casting heat treatment scheduling methods are difficult to cope with complex production tasks and diversified product needs, and optimization algorithms are prone to fall into local optimal solutions when dealing with large-scale and complex scheduling problems.
The casting heat treatment production scheduling method based on the gray wolf optimization algorithm is adopted, and the algorithm's global search ability and local development ability are enhanced by improving population initialization strategies, nonlinear convergence factors and weighting strategies.
It effectively solves the complex workshop scheduling problem, improves production efficiency and product quality, and improves the flexibility and robustness of scheduling.
Smart Images

Figure CN119439917A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of intelligent manufacturing and optimization algorithms, and in particular to a method for scheduling production of heat treatment of castings based on a Grey Wolf optimization algorithm. Background Art
[0002] In the foundry industry, heat treatment is a key process link that directly affects the mechanical properties and service life of castings. With the rapid development of the manufacturing industry, casting heat treatment workshops are facing challenges such as complex production tasks, diversified product specifications and strict process requirements. How to effectively schedule casting heat treatment workshops to maximize production efficiency, optimize resource utilization and minimize delivery time has become an important factor in corporate competition. However, traditional heat treatment scheduling methods often rely on experience and rules, and are difficult to cope with the complex needs in modern manufacturing environments.
[0003] The introduction of optimization algorithms provides a new solution to the workshop scheduling problem. In recent years, optimization algorithms based on swarm intelligence and nature-inspired optimization have been widely used in the field of workshop scheduling, including genetic algorithms, particle swarm algorithms, ant colony algorithms, and gray wolf optimization algorithms. These algorithms simulate biological behaviors in nature to find the optimal solution to the problem and have good global search capabilities and adaptability. However, these algorithms also face many challenges when applied to workshop scheduling problems.
[0004] First, the complex constraints of the workshop scheduling problem make it difficult for traditional optimization algorithms to find a satisfactory solution within a limited time. Secondly, optimization algorithms often require a lot of computing resources and time, and are prone to fall into local optimal solutions when dealing with large-scale and complex scheduling problems. Among many optimization algorithms, the Grey Wolf Optimizer (GWO) has attracted the attention of researchers due to its simplicity, strong adaptability, and fast convergence speed. The Grey Wolf Optimizer solves complex optimization problems by simulating the group hunting behavior and social hierarchy structure of grey wolves. However, the standard Grey Wolf Optimizer still has problems such as slow convergence and easy to fall into local optimal solutions when dealing with high-dimensional and multi-peak functions. Summary of the invention
[0005] In order to solve the above technical problems, the present invention provides a casting heat treatment production scheduling method based on the Grey Wolf optimization algorithm.
[0006] The present invention adopts the following technical solutions:
[0007] A method for scheduling casting heat treatment production based on the Grey Wolf optimization algorithm comprises the following steps:
[0008] S1: According to the heat treatment process and machines, the basic model of the workshop scheduling problem is established, the process layer and the machine layer are encoded by integer coding, and the workshop scheduling problem is converted into the problem of finding the optimal position of prey by the gray wolf optimization algorithm;
[0009] S2: Set the algorithm parameters population size, maximum number of iterations, calculate the LOF value of each individual in the population, and create the initial population by sorting the LOF values from large to small;
[0010] S3: Evaluate the fitness values of individuals in the population according to the objective function, and determine the fitness values from large to small. α , β and δ;
[0011] S4: Update individual location information;
[0012] S5: Determine whether the algorithm has reached the maximum number of iterations. If so, go to step S6; otherwise, go to step S3;
[0013] S6: Terminate the algorithm and output the optimal result.
[0014] Furthermore, the initial population in step S2 is created by generating a larger initial candidate set C in the solution space through a random generation method, which contains more individuals than the final population. This set should cover all areas of the solution space. For each individual in the initial candidate set, calculate its local outlier factor. For each individual x i , calculate the distance of its k nearest neighbor individuals:
[0015] reach_dist k (o, p) = max{d k (o), d(o, p)}
[0016] And calculate the local reachability density
[0017]
[0018] Calculate the individual LOF value through the local reachable density
[0019]
[0020] Among them, d k (o) is the kth distance of the neighborhood point o, d(o, p) is the distance from the neighborhood point o to the point p, N k (p) is the kth distance neighborhood of point p.
[0021] The larger the LOF value, the more the individual deviates from the density of its neighborhood, indicating the degree to which it is an outlier. According to the calculated LOF value, individuals with larger LOF values are selected from the initial candidate set to form the final initial population.
[0022] Furthermore, in the gray wolf optimization algorithm, the convergence factor a is calculated according to the following algorithm:
[0023]
[0024] Among them, i is the current iteration number, i max is the maximum number of iterations, p is the smoothness of the transition of the convergence factor in the initial stage of the iteration, and 0 <p≤1。
[0025] The convergence factor is small in the early stage of iteration, which enables the gray wolf to have moderate exploration ability when searching for target prey and avoid falling into local optimality too early. As the number of iterations increases, the convergence factor gradually increases to 2, enhancing the exploration strength in the middle stage to fully explore the problem space and obtain more possible solutions. Then, when the iteration enters the late stage, the convergence factor quickly decreases to 0, helping the gray wolf to lock the target more accurately and improve the effectiveness of optimization.
[0026] Furthermore, during the iteration process, different weight coefficients are assigned to each wolf type, adjusting their influence on the final position update according to their importance:
[0027]
[0028] w α 、w β 、w δ Represents the weight coefficients of α wolf, β wolf, and δ wolf respectively, w α ≥w β ≥w δ , and add the weight coefficients so that the sum of the weight coefficients is 1, ensuring that the final updated position is the weighted average value; the step S4 updates the individual position according to the above formula.
[0029] The present invention discloses a method for scheduling the production of heat treatment of castings based on the Gray Wolf Optimization Algorithm, which combines the swarm intelligence and natural heuristic characteristics of the Gray Wolf Optimization Algorithm, and enhances the global search capability and local development capability of the algorithm by improving the population initialization strategy, improving the weight strategy and nonlinear convergence factor. By optimizing the diversity and weight parameters of the initial population, the algorithm can more effectively solve complex workshop scheduling problems. The scheduling rules of production tasks are analyzed by the optimization algorithm method, and resources and time are reasonably allocated, thereby improving production efficiency and product quality. This method is of great significance in improving the flexibility and robustness of scheduling in heat treatment workshops for castings, and provides a new path for realizing intelligent production and energy conservation and emission reduction. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] Figure 1 This is an implementation diagram of the casting heat treatment production scheduling method based on the Grey Wolf optimization algorithm of the present invention for workshop scheduling.
[0031] Figure 2 The figure is a flow chart of the improved gray wolf optimization algorithm in the present invention. DETAILED DESCRIPTION
[0032] In order to more clearly introduce the purpose and technical solution of the present invention, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. The embodiments described herein are only used to explain the present invention and are not used to limit the present invention.
[0033] Example
[0034] like Figure 1 The figure shows a casting heat treatment production scheduling method based on the Grey Wolf optimization algorithm, which mainly covers the following stages. First, the basic scheduling problem of the casting heat treatment workshop is modeled, then the objective function is established, and the process layer and machine layer are encoded. Finally, the improved Grey Wolf optimization algorithm is used to solve the scheduling model and output it.
[0035] 1. Modeling of basic scheduling problems in machining workshops
[0036] The scheduling problem of heat treatment of castings is a typical flexible job shop scheduling problem (FJSP) due to its complex process flow and changeable production environment. It is a classic NP-hard problem. The FJSP scheduling problem can be described as: there are (n) workpieces that need to be processed on (m) equipment. The workpieces, equipment, and workpieces are independent of each other. The total number of processes of the workpiece is pre-set and has nothing to do with the number of equipment. Each process can be processed by different equipment, which will give different processing times, and the process route remains unchanged during the processing. The scheduling plan needs to comprehensively consider factors such as efficiency, cost, delivery time, and resources, select appropriate processing equipment for each process of each workpiece, and formulate the start time of each process to optimize the system performance indicators. Unlike the traditional inflexible JSP problem, FJSP needs to select processing equipment for each process, while the JSP problem only needs to sort the processes on each equipment to determine their start time. In addition, FJSP also follows the following assumptions.
[0037] (1) The same equipment can only process one process of a certain workpiece in the same time;
[0038] (2) The same workpiece can only be processed once by a certain equipment at the same time;
[0039] (3) All equipment and workpieces can be started at time 0;
[0040] (4) The process route of the workpiece remains unchanged during the processing;
[0041] (5) Different workpieces are independent and there is no priority in the processing sequence;
[0042] (6) The process is not allowed to be interrupted during the processing of the equipment;
[0043] (7) Equipment preparation time and workpiece transfer time have been included in the process time.
[0044] (II) Objective Function
[0045] Basic scheduling first considers the punctuality of scheduling, and the optimization goal is to minimize the maximum completion time. The maximum completion time here refers to the time taken by the workpiece from the start of work to the completion of the last process of the corresponding workpiece in the basic scheduling plan of the processing workshop. The maximum completion time is the time taken by the workpiece with the longest time. It can be used to most directly represent the production scheduling efficiency of the processing workshop. It can be expressed by formula (1)
[0046]
[0047] Among them, T i represents the completion time of job i.
[0048] (III) Sequence layer and machine layer encoding and decoding
[0049] The scheduling problem of heat treatment workshop for castings is a discrete problem, and the Grey Wolf Optimization Algorithm was proposed to solve continuous problems. At this time, the discrete quantity and the continuous quantity can be linked by appropriate encoding and decoding methods to facilitate the solution. According to the main characteristics of the problem to be solved in the scheduling of heat treatment workshop for castings, the individual coding is divided into two modules: process layer coding and machine layer coding. Including process sequence X p and machine sequence X m The chromosome composed of these two parts is regarded as a feasible scheduling solution for the flexible job shop. The feasible solution of this scheduling problem can be expressed as X = [X p |X m ]
[0050] The casting heat treatment workshop processes three workpieces in one cycle, and each workpiece has three processes, with a total of four machines. It can be represented as an individual position vector, with each process forming a number denoted as O ij represents the jth process of workpiece i. The process set corresponding to each workpiece is {O 11 , O 12 , O 13},{O 21 , O 22 , O 23},{O 31 , O 32 , O33 The machine set of each process is {M1, M2, M3, M4}. The specific encoding and decoding steps are as follows:
[0051] (1) Process level coding
[0052] The encoding method of this encoding layer adopts integer encoding. The elements in the vector represent the number of the workpiece, and the order of each element in the set represents the process in which the corresponding workpiece appears. p =[2, 1, 1, 3, 2, 3, 1, 2, 3], the first "3" in the vector represents the first process O of workpiece 3 31 .
[0053] (2) Machine-level encoding
[0054] The elements in the machine layer are X p The index of the processing machine corresponding to the process in the set of selectable machines. m =[1,3,1,4,2,3,2,3,4] The first "1" in the vector represents the corresponding process O 21 , processing on the first machine in its selectable machine set, the second "2" indicates that the second machine in the selectable machine set is processing step O 22 .
[0055] According to the above steps, we can get X = [2, 1, 1, 3, 2, 3, 1, 2, 3 | 1, 3, 1, 4, 2, 3, 2, 3, 4]. When decoding X, X p The vector is the inverse process of encoding, X m The vector needs to correspond the machine index number in the code to the machine number in the optional machine set of the process. p The third "1" in the figure represents the third process O of workpiece 1. 13 , X m The corresponding "2" represents process O 13 Processing is performed on the second machine in its corresponding selectable machine set.
[0056] (IV) Grey Wolf Optimization Algorithm
[0057] As an emerging swarm intelligence algorithm, the Gray Wolf Optimization Algorithm (GWO) has attracted attention for its fewer control parameters, simple structure and easy implementation. It has an information feedback mechanism and can adaptively adjust the convergence process to achieve a good balance between local optimization and global optimization. It is proposed by simulating the social hierarchy and predation behavior mechanism of wolves. The leadership level of a wolf pack can be divided into four levels: the head wolf α, the subordinate wolf β, the ordinary wolf δ and the bottom wolf w. Among them, α is responsible for leading the wolf pack, β assists α in making decisions, δ obeys the instructions of αβ and can also command the bottom individual w. α , β and δ represent the historical optimal solution, the suboptimal solution and the third candidate optimal solution respectively, and w represents the remaining individuals. During the algorithm execution, α , β and δ are responsible for locating the position of the prey and guiding other individuals to complete behaviors such as approaching, surrounding and attacking, and finally achieving the purpose of preying on the prey. The process can be expressed as:
[0058]
[0059] Among them: When using the Gray Wolf Optimization Algorithm for production scheduling, is the position vector, which indicates the distance between the current position of the gray wolf and the optimal wolf (optimal scheduling solution); The position vector of the optimal wolf at the current position represents the arrangement of machines and workpieces of the current optimal scheduling solution; The current position vector of the gray wolf represents the current scheduling plan; is the adjustment coefficient, which affects the scope and direction of the search. is the weighting coefficient, which determines the degree to which the wolf pack approaches the optimal solution when updating its position; D α , D β , D δ are the distance vectors between the current position and α wolf, β wolf, and δ wolf (the first, second, and third optimal scheduling solutions, respectively); It is the position vector adjusted according to α wolf, β wolf, and δ wolf, representing the potential new scheduling scheme in each direction; r1 and r2 are both random number vectors, which are used to simulate the randomness of the gray wolf's re-search to avoid falling into the local optimum, and they decrease linearly from 2 to 0 during the iteration process; Represents the updated position vector of the gray wolf, indicating the adjusted new plan.
[0060]
[0061] According to formula (1), in order to obtain the scheduling plan with the shortest completion time, each scheduling plan has a final completion time according to the selection of machines for each process and the processing time of the machines for each process. When the number of iterations reaches the maximum, the optimal scheduling plan is X*.
[0062] (V) Improved Gray Wolf Optimization Algorithm
[0063] The algorithm flow chart is as follows Figure 2 shown.
[0064] (1) Improved population initialization strategy
[0065] The distance-based outlier detection algorithm (LOF) is used to improve the population initialization of the gray wolf optimization algorithm, so that the population is more dispersed in the solution space. First, a large initial candidate set C is generated in the solution space by a random generation method, which contains more individuals than the final population. This set should cover all areas of the solution space. For each individual in the initial candidate set, its local outlier factor is calculated. For each individual x i , calculate the distance of its k nearest neighbor individuals (Formula 14), and calculate the local reachable density (Formula 15). Through the local reachable density, calculate the LOF value of the individual (Formula 16). The larger the LOF value, the more the individual deviates from the density of its neighborhood, indicating the degree to which it is an outlier. According to the calculated LOF value, select individuals with larger LOF values from the initial candidate set to form the final initial population. These individuals are more dispersed in the solution space. The selected individuals with high LOF values are used as the initial population of the gray wolf optimization algorithm. These initial individuals cover different areas of the solution space, improve the diversity of the initial population, and improve the performance of the gray wolf optimization algorithm in solving complex scheduling problems. The formula is as follows.
[0066] reach_dist k (o, p) = max{d k (o), d(o, p)} (14)
[0067]
[0068] Among them, d k (o) is the kth distance of the neighborhood point o, d(o, p) is the distance from the neighborhood point o to the point p, N k (p) is the kth distance neighborhood of point p.
[0069] (2) Improvement of nonlinear convergence factor
[0070] Based on the analysis of the gray wolf optimization algorithm parameters, it can be seen that parameter A is the key to determining whether the wolf pack is successful in hunting. The size of parameter A is largely related to the convergence factor a, which decreases linearly from 2 to 1 during the iteration process. The improved convergence factor is smaller in the early stage of the iteration, which enables the gray wolf to have moderate exploration ability when searching for target prey and avoid falling into the local optimum too early. As the number of iterations increases, the convergence factor gradually increases to 2, enhancing the exploration strength in the middle stage to fully explore the problem space and obtain more possible solutions. Subsequently, when the iteration enters the later stage, the convergence factor quickly decreases to 0, helping the gray wolf to lock the target more accurately and improve the effectiveness of the optimization. In this way, through multi-stage control, more flexible search strategy adjustment can be achieved, see formula (17).
[0071]
[0072] Among them, i is the current iteration number, i max is the maximum number of iterations, p is the smoothness of the transition of the convergence factor in the initial stage of the iteration, and 0 <p≤1。
[0073] (3) Optimize weight coefficient
[0074] In the gray wolf optimization algorithm, the gray wolf individuals in the population will adjust their positions as the positions of α wolf, β wolf and δ wolf change. Although the roles of these three wolves are different, they play the same role in the algorithm. The advantage of α wolf in the wolf pack is not highlighted, and the three types of wolves must have priorities. This lack of differences in wolf levels may lead to a slower overall convergence of the algorithm. In order to improve the convergence speed, dynamic weights based on fitness changes are introduced. During the iteration process, different weight coefficients are assigned to each wolf, and their influence on the final position update is adjusted according to their importance, see formula (18).
[0075]
[0076] w α 、w β 、w δ Represents the weight coefficients of α wolf, β wolf, and δ wolf respectively, w α ≥w β ≥w δ , and add the weight coefficients so that the sum of the weight coefficients is 1, ensuring that the final updated position is the weighted average.
[0077] According to the objective function, the fitness values of individuals in the population are evaluated, and α, β and δ are determined from large to small according to the fitness values. According to formula (18), the individual position information is updated to determine whether the algorithm has reached the maximum number of iterations. If so, the algorithm is terminated and the optimal result is output according to formula (13); if it is not the maximum number of iterations, the fitness values of individuals in the population are re-evaluated according to the objective function, and the corresponding operations are continued until the maximum number of iterations is reached and the optimal result is output.
Claims
1. A method for scheduling casting heat treatment production based on the Grey Wolf optimization algorithm, characterized in that: It includes the following steps: S1: According to the heat treatment process and machines, the basic model of the workshop scheduling problem is established, the process layer and the machine layer are encoded by integer coding, and the workshop scheduling problem is converted into the problem of finding the optimal position of prey by the gray wolf optimization algorithm; S2: Set the algorithm parameters population size, maximum number of iterations, calculate the LOF value of each individual in the population, and create the initial population by sorting the LOF values from large to small; S3: Evaluate the fitness values of individuals in the population according to the objective function, and determine α, β and δ from large to small according to the fitness values; S4: Update individual location information; S5: Determine whether the algorithm has reached the maximum number of iterations. If so, go to step S6; otherwise, go to step S3; S6: Terminate the algorithm and output the optimal result.
2. The method for scheduling casting heat treatment production based on the Grey Wolf optimization algorithm according to claim 1, characterized in that: The initial population in step S2 is created by randomly generating a larger initial candidate set C in the solution space, which contains more individuals than the final population. This set should cover all areas of the solution space. For each individual in the initial candidate set, calculate its local outlier factor. For each individual x i , calculate the distance of its k nearest neighbor individuals: reach_dist k (o,p)=max{d k (o),d(o,p)} And calculate the local reachability density Calculate the individual LOF value through local reachability density Among them, d k (o) is the kth distance of the neighborhood point o, d(o, p) is the distance from the neighborhood point o to the point p, N k (p) is the kth distance neighborhood of point p. The larger the LOF value, the more the individual deviates from the density of its neighborhood, indicating the degree to which it is an outlier. According to the calculated LOF value, individuals with larger LOF values are selected from the initial candidate set to form the final initial population.
3. The method for scheduling casting heat treatment production based on the Grey Wolf optimization algorithm according to claim 2, characterized in that: In the gray wolf optimization algorithm, the convergence factor a is calculated according to the following algorithm: Among them, i is the current iteration number, i max is the maximum number of iterations, p controls the smoothness of the transition of the convergence factor in the initial iteration, and 0<p≤1. The convergence factor is small in the early stage of iteration, which enables the gray wolf to have moderate exploration ability when searching for target prey and avoid falling into local optimality too early. As the number of iterations increases, the convergence factor gradually increases to 2, enhancing the exploration strength in the middle stage to fully explore the problem space and obtain more possible solutions. Then, when the iteration enters the late stage, the convergence factor quickly decreases to 0, helping the gray wolf to lock the target more accurately and improve the effectiveness of optimization.
4. The method for scheduling casting heat treatment production based on the Grey Wolf optimization algorithm according to claim 3 is characterized in that: During the iteration process, different weight coefficients are assigned to each type of wolf, adjusting their influence on the final position update according to their importance: w α 、w β 、w δ Represents the weight coefficients of α wolf, β wolf, and δ wolf respectively, w α ≥w β ≥w δ , and add the weight coefficients so that the sum of the weight coefficients is 1, ensuring that the final updated position is the weighted average value; the step S4 updates the individual position according to the above formula.
Citation Information
Cited By
Metal cavity cooling channel parameter design method based on multi-physics field coupling
CN119940231A