Production line scheduling method, device, equipment and medium based on heuristic algorithm
By optimizing product scheduling on the production line using heuristic algorithms, the problem of low production efficiency caused by excessively long product changeover times was solved, resulting in more efficient production line processing.
Patent Information
- Application Number
- CN202411082771.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-08
- Publication Date
- 2024-11-22
- Estimated Expiration
- 2044-08-08
AI Technical Summary
Existing technologies suffer from excessively long product changeover times, resulting in low production efficiency and a lack of thorough planning and optimization of the product type changeover process on the production line.
A production line scheduling method based on heuristic algorithms is adopted. By using a pre-sorting method and heuristic algorithms, the target processing sequence and machine position of products are determined, thereby optimizing the scheduling and processing of products on the production line.
This reduces changeover time between products and improves production line efficiency.
Smart Images

Figure CN118605429B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of production and processing, and in particular to a production line scheduling method, device, equipment and medium based on a heuristic algorithm. Background Art
[0002] With the rapid advancement of science and technology, humans are increasingly relying on machines for efficient production and processing of products. However, given that product demand far exceeds the amount of machine configuration, it is inevitable to achieve product type conversion on processing machines during the production process. This conversion process is subject to multiple factors such as raw material differences and machine setting adjustments. The transition from one product to another is often accompanied by an increase in time costs. Unfortunately, many current technical systems lack careful planning and optimization of this conversion link, which directly leads to the extension of the product conversion cycle on the machine, which in turn accumulates the total time consumed in product processing and significantly reduces overall production efficiency. Summary of the invention
[0003] The embodiments of the present invention provide a production line scheduling method, device, equipment and medium based on a heuristic algorithm, aiming to solve the problem of low production efficiency caused by long product conversion time in the prior art.
[0004] In the first aspect, an embodiment of the present invention provides a production line scheduling method based on a heuristic algorithm, comprising: determining a target processing order of the products to be processed through a preset sorting method according to the processing workload and product conversion time of each product to be processed and an objective function, wherein the objective function is a function constructed according to the processing completion time of the products to be processed and the processing time of each processing machine; determining a target machine and a target processing position for processing the products to be processed by a heuristic algorithm using the objective function and the target processing order; and scheduling and processing the products to be processed according to the target machine and the target processing position.
[0005] In the second aspect, an embodiment of the present invention also provides a production line scheduling device based on a heuristic algorithm, comprising: determining the target processing sequence of the products to be processed through a preset sorting method according to the processing workload and product conversion time of each product to be processed and the objective function, wherein the objective function is a function constructed according to the processing completion time of the products to be processed and the processing time of each processing machine; determining the target machine and target processing position for processing the products to be processed by a heuristic algorithm using the objective function and the target processing sequence; and scheduling and processing the products to be processed according to the target machine and the target processing position.
[0006] In a third aspect, an embodiment of the present invention further provides a computer device, which includes a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the above method when executing the computer program.
[0007] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, wherein the storage medium stores a computer program, wherein the computer program includes program instructions, and the program instructions can implement the above method when executed by a processor.
[0008] The embodiment of the present invention provides a production line scheduling method, device, equipment and medium based on a heuristic algorithm. The method includes: a sequence determination unit, which is used to determine the target processing sequence of the products to be processed by a preset sorting method according to the processing workload and product conversion time of each product to be processed and the target function, wherein the target function is a function constructed according to the processing completion time of the product to be processed and the processing time of each processing machine; a target determination unit, which is used to determine the target machine and target processing position for processing the product to be processed by the target function and the target processing sequence through a heuristic algorithm; and a processing unit, which is used to schedule and process the product to be processed according to the target machine and the target processing position. The embodiment of the present invention determines the target processing sequence according to the conversion time between products and the processing workload of the products to determine the processing sequence of each product on all machines, and determines the target machine and target processing position on the machine production line for processing a product under the target processing sequence through a heuristic algorithm, so as to reduce the time required for product conversion between products, and schedule and process the product to be processed according to the target machine and the target processing position, so as to efficiently process all products to be processed on the basis of reducing the product conversion time, thereby improving the production efficiency of the products processed by the production line. BRIEF DESCRIPTION OF THE DRAWINGS
[0009] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying any creative work.
[0010] Figure 1 A schematic diagram of a process flow of a production line scheduling method based on a heuristic algorithm provided by an embodiment of the present invention;
[0011] Figure 2 A schematic diagram of a sub-process of a production line scheduling method based on a heuristic algorithm provided in an embodiment of the present invention;
[0012] Figure 3A schematic diagram of a sub-process of a production line scheduling method based on a heuristic algorithm provided in an embodiment of the present invention;
[0013] Figure 4 A schematic diagram of a sub-process of a production line scheduling method based on a heuristic algorithm provided in an embodiment of the present invention;
[0014] Figure 5 A schematic diagram of a sub-process of a production line scheduling method based on a heuristic algorithm provided in an embodiment of the present invention;
[0015] Figure 6 A schematic diagram of a sub-process of a production line scheduling method based on a heuristic algorithm provided in an embodiment of the present invention;
[0016] Figure 7 A schematic block diagram of a production line scheduling device based on a heuristic algorithm provided by an embodiment of the present invention;
[0017] Figure 8 A schematic block diagram of a computer device provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0018] 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 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.
[0019] It should be understood that when used in this specification and the appended claims, the terms "include" and "comprises" indicate the presence of described features, integers, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or combinations thereof.
[0020] It should also be understood that the terms used in this specification of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. As used in the specification of the present invention and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include plural forms.
[0021] It should be further understood that the term "and / or" used in the present description and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.
[0022] See also Figure 1 , Figure 1A flowchart of a production line scheduling method based on a heuristic algorithm provided in an embodiment of the present invention. The production line scheduling method based on a heuristic algorithm in this embodiment can be applied to a production line that processes products to be processed. For example, a production line that processes parts can adopt the method of the present invention to reduce the time for processing conversion between different processed products, thereby improving the production efficiency of the products processed by the production line.
[0023] Figure 1 1 is a flow chart of a production line scheduling method based on a heuristic algorithm provided by an embodiment of the present invention. As shown in the figure, the method includes the following steps S110-S130.
[0024] S110. Determine the target processing order of the products to be processed by a preset sorting method according to the processing workload and product conversion time of each product to be processed and the objective function, wherein the objective function is a function constructed according to the processing completion time of the products to be processed and the processing time of each processing machine.
[0025] In this embodiment, the products to be processed are products that need to be processed in the production line, wherein the products may belong to different subcategories of products under the same category. For example, the products to be processed may be parts products, specifically parts products such as screws, bolts and nuts, or may be life products, such as cup lids, cup handles and other products that need to be processed. The preset sorting method is a method for sorting the products to be processed, for example, randomly sorting the products to be processed, and the target processing sequence is a determined sequence of processing each product to be processed, for example, nuts, screws, and bolts may be processed on multiple processing machines in the order of processing. It should be noted that the order to be processed at this time does not involve which processing machine is used for processing. The processing completion time of the product to be processed is the time required after all products to be processed are successfully processed. The processing time of each processing machine is the processing time required for each machine to process the product assigned to it. Specifically, the processing time of each processing machine can be determined by the type of product to be processed, the quantity of each product, and the workload required for the processing machine to process the product. For example, the time required for a processing machine to process a screw is 1 minute, and there are 60 screws in total, so the processing time of the processing machine is 60 minutes. The objective function is a function constructed based on the processing completion time of the product to be processed and the processing time of each processing machine. Specifically, Wherein, Y is the value of the objective function, n represents the total number of types of products to be processed, i is the i-th type of product to be processed, represents the product weight of the i-th product to be processed, is the completion time of the i-th product to be processed, m represents the total number of processing machines, j represents the j-th processing machine, represents the processing weight of the j-th processing machine, T represents the preset maximum operating time of the processing machine, represents the actual running time of the jth processing machine. The actual running time is: in, represents the workload of processing the i-th product, The quantity of the i-th product, represents the processing speed of the jth machine, represents the conversion time from processing product i to product l on the jth machine, It should be noted that the constructed objective function needs to meet the preset limiting conditions, where the decision variables can be set in advance, specifically: Specifically, the above decision variables define that the products need to be processed on the machine, and that one product can only be processed after the processing of another product is completed. The formula for the preset limiting condition is as follows: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10) (11) (12); where M = {0, 1, 2, ..., m-1}, M represents the type set of the processing machine, N = {0, 1, 2, ..., n-1}, N represents the type set of the products to be processed, and formula (1) stipulates that the actual processing time of the processing machine needs to be less than its corresponding preset maximum running time. The first product processed on the machine is randomly initialized as , substitute the initialized data into the decision variables to obtain formula (2) and formula (3). Formula (2) and formula (3) stipulate that the initial product assigned to each machine must meet the conditions under the decision variables; Formula (4) ensures that each product to be processed is assigned to a machine; Formula (5) stipulates that it is not allowed and does not exist to process product i after starting processing with product i and then processing product i at the end of processing, that is, it is stipulated that one product can only be processed after it is completely processed. Another product; Formula (6) stipulates that if multiple processing of a product to be processed is generated, the processing sequence is eliminated. Formula (7) indicates that the processing sequence on the same machine The relationship between the production order of the products to be processed, formula (8) to formula (10) indicate that the product will be processed on the machine only when the conversion from the product or the conversion to the product occurs on the machine, formula (11) indicates the relationship between the completion time of various products, and at the same time limits the constraints of the completion time, that is, the production order on each machine is required to be a line segment formed by connecting all products, and cannot be connected end to end to form a closed loop, otherwise, the completion time of each product cannot be directly solved by restricting formula (11). For example, when processing three products a, b, and c, the processing order can only be abc, not abca. Formula (12) is the integrity constraint of the decision variable. The target processing order under the constraint conditions of the objective function is determined according to the processing workload and product conversion time of each product to be processed, and the conversion time between products is reduced according to the target processing order.
[0026] In one embodiment, if Figure 2 As shown, the step S110 also includes steps S111-S115.
[0027] S111, randomly sorting the products to be processed to obtain a first processing sequence;
[0028] S112, obtaining a second processing sequence by descending sorting according to the processing workload corresponding to each of the products to be processed;
[0029] S113, obtaining a third processing sequence by descending sorting according to the average product conversion time of the products to be processed among the plurality of processing machines;
[0030] S114, performing comprehensive sorting according to the processing workload of each product to be processed and the average product conversion time to obtain a fourth processing sequence;
[0031] S115. Obtain corresponding objective function values for the four processing sequences respectively through the objective function, wherein the processing sequence corresponding to the minimum objective function value is the target processing sequence.
[0032] In this embodiment, the processing workload is determined according to the number of products to be processed and the workload required by the processing machine to process them. Several products to be processed are randomly sorted to obtain a first processing sequence, and the second processing sequence can be obtained by descending sorting according to the processing workload corresponding to each product to be processed, or the third processing sequence can be obtained by descending sorting according to the average product conversion time between several processing machines. Specifically, the average product conversion time is obtained in the following manner: Among them, the represents the average product conversion time, j represents the product j to be processed, r represents the processing machine r, j=0 represents the product traversed from 0 to n-1, r=0 represents the machine traversed from 0 to m-1, wherein n is the number of processes of a product to be processed, m is the total number of processing machines, and Respectively represent the processing conversion time of product i and j on machine r, and the processing conversion time of product j and i on machine r, that is, the average conversion time is determined according to the processing conversion time of every two products on each machine to determine the third processing sequence, and the fourth processing sequence can also be obtained by comprehensively sorting the processing workload of each product to be processed and the average product conversion time. Specifically, different weights can be set for the processing workload and the average product conversion time, and the fourth processing sequence can be obtained by descending sorting according to the weighted results, wherein the specific weight setting and other values are not limited, and the descending sorting can be performed by referring to the processing workload and the average product conversion time at the same time. The four processing sequences are respectively obtained by the objective function. Specifically, the processing sequence of the products to be processed under the four sequences is substituted into the objective function to obtain different objective function values, and the processing sequence corresponding to the minimum objective function value is used as the target processing sequence. By determining the target processing sequence according to the processing time of each product to be processed and the processing conversion time between products, the processing conversion time between products is reduced, thereby improving the processing efficiency of the production line.
[0033] S120, using the objective function and the target processing sequence through a heuristic algorithm to determine a target machine and a target processing position for processing the product to be processed.
[0034] In this embodiment, the heuristic algorithm is an algorithm constructed based on intuition or experience, which is intended to solve complex problems. It can give a feasible solution to the problem under acceptable conditions, although the degree of deviation between this feasible solution and the optimal solution cannot be predicted in general. A high-quality solution can be generated within an acceptable time by a heuristic algorithm. The target processing sequence is only the processing sequence between products and does not involve the processing machine that needs to process the product to be processed. Therefore, the heuristic algorithm can be used to calculate the processing plan of which processing machine and which position to put the product to be processed into according to the target processing sequence, and calculate the target function value according to the processing machine and processing position in the corresponding processing scheme through the objective function, and determine the target machine and target processing position for processing the product to be processed according to the objective function value. For example, the machine and position corresponding to the minimum value in the objective function value are the target machine and target processing position. By re-determining the processing position and processing machine of the product to be processed according to the heuristic algorithm and the target processing sequence, the value of the objective function is optimized again, so that the processing conversion time between products is further reduced on the basis of the target processing sequence, so as to more significantly improve the processing efficiency of the production line.
[0035] In one embodiment, if Figure 3 As shown, the step S120 also includes steps S121-S122.
[0036] S121, placing the product to be processed into any processing position of each processing machine production line according to the target processing sequence, and calculating the processing position through the objective function to obtain the corresponding objective function value;
[0037] S122. Determine the processing machine and the processing position corresponding to the minimum objective function value as the target machine and the target processing position.
[0038] In this embodiment, the product to be processed is placed in any processing position of each processing machine production line according to the target processing sequence. Specifically, the product to be processed can be placed in any processing position of each processing machine production line according to the target processing sequence, and the value of the objective function under the processing position is obtained. For example, a type of product to be processed is placed in the third processing position of the B processing machine production line, that is, after the products to be processed in the first and second positions are produced in the B processing machine, a type of product to be processed will be processed. The processing speed of the B processing machine and the processing workload of the a type of product to be processed are substituted into the objective function to determine the corresponding objective function value. The objective function values under all feasible positions are compared to obtain the minimum objective function value, and the processing machine and the processing position corresponding to the minimum objective function value are determined as the target machine and the target processing position. It can be understood that the smaller the objective function value, the higher the processing efficiency. Therefore, the processing machine and the processing position corresponding to the minimum objective function value are determined as the target machine and the target processing position to better improve the processing efficiency of the production line.
[0039] In one embodiment, if Figure 4 As shown, the step S121 also includes steps S1211-S1213.
[0040] S1211, performing time calculation according to the processing speed and the processing workload of the product to be processed to obtain the actual operating time of the processing machine when the product to be processed is processed at the processing position;
[0041] S1212, determining whether the actual running time exceeds the preset maximum running time of the processing machine;
[0042] S1213. If it does not exceed, obtaining the objective function value of the processing position according to the objective function.
[0043] In this embodiment, the processing speed is the processing speed of the processing machine on the product, and the actual running time is the processing time required for the processing machine to process all the products to be processed assigned to it according to their corresponding processing positions. Specifically, the actual running time is obtained in the following manner: , wherein the corresponding parameter value is the same as the parameter value in the above step S110, which will not be repeated here. Specifically, the product i to be processed can be inserted into all possible positions in the production sequence of the processing machine, and the actual running time of the processing machine under the processing sequence at the corresponding position is calculated to determine whether the actual running time exceeds the preset maximum running time of the processing machine, wherein the preset maximum running time is set according to the machine's own parameters and is not limited to this. If the actual running time does not exceed the preset maximum running time of the processing machine, the objective function value of the processing position is obtained according to the objective function. If the actual running time exceeds the preset maximum running time of the processing machine, the processing position is removed and other positions are tried. If all positions in the production sequence of a processing machine are removed, the product cannot be assigned to this machine, and is placed in any position of the next processing machine for actual running time calculation. By comparing the actual running time with the preset maximum running time of the processing machine, it is determined whether processing at the processing position will affect the machine or whether it can be effectively processed by the processing machine, so as to ensure the safety and effectiveness of the processing process.
[0044] To further illustrate how to determine the target machine and target processing position for processing the product to be processed by a heuristic algorithm, the following specific code is used for explanation:
[0045] for r in range(1): # Try the above 4 methods of sorting products to be processed
[0046] Pr = np.ones((m, n), dtype=np.int) * n # Randomly initialize each product to be processed
[0047] complete_time = [0 for i in range(n)] # complete_time is the completion time of the product
[0048] X = np.zeros((n,m), dtype = np.int) #If product i is produced on processing machine j, then X[i,j] is 1, otherwise it is 0
[0049] Y = np.zeros((m,n,n),dtype = np.int)#When processing machine i switches from product j to k, Y[i,j,k] is 1
[0050] T = [0 for i in range(m)] #Total processing time spent by each processing machine
[0051] for i in range(m):
[0052] Pr[i, 0] = seq[i]
[0053] complete_time[Pr[i, 0]] += p[Pr[i, 0]]* d[Pr[i, 0]] / s[i]
[0054] T[i] = p[Pr[i, 0]]* d[Pr[i, 0]] / s[i]
[0055] X[seq[i], i] = 1
[0056] for i in Pr[:, 0]: # Delete the allocated products to be processed
[0057] list[r].remove(i)
[0058] L = len(list[r])
[0059] pr = Pr.copy()
[0060] for q in range(L): # Assign one product to be processed each time
[0061] min_min_obj = []; min_min_obj_index = []
[0062] for i in range(m):# Try to allocate to which machine to cause the least increase in objective function
[0063] pri = []
[0064] for l in range(n):
[0065] pri.append(Pr[i,l])
[0066] ind = pri.index(n)
[0067] min_obj = float('inf')
[0068] for j in range(ind+1):#Add the newly added product to be processed to the position j of the production line. There are ind+1 optional positions.
[0069] y = Y.copy();x = X.copy();ct = complete_time.copy()
[0070] TT = T.copy();pr = Pr.copy()
[0071] for k in range(ind,j,-1):
[0072] pr[i,k] = pr[i,k-1]#After a product is inserted into a certain position, the subsequent products to be processed must be moved back one position
[0073] pr[i,j] = list[r][0]
[0074] if j == 0: #The new product is placed at the first position in the sequence
[0075] ad_time = switch_time[pr[i,j],pr[i,j+1],i]+p[list[r][0]]*d[list[r][0]] / s[i]
[0076] y[i,list[r][0],pr[i,1]] = 1
[0077] elif j == ind:#The newly added products to be processed in the production line are placed at the last position of the production line
[0078] ad_time = switch_time[pr[i,j-1],pr[i,j],i]+p[list[r][0]]*d[list[r][0]] / s[i]
[0079] y[i,pr[i,ind-1],list[r][0]] = 1
[0080] ct[pr[i,j]] += ct[pr[i,j-1]]
[0081] else:
[0082] ad_time = switch_time[pr[i,j-1],pr[i,j],i]+switch_time[pr[i,j],pr[i,j+1],i]+p[list[r][0]]*d[list[r][0]] / s[i]
[0083] y[i,pr[i,j-1],pr[i,j+1]] = 0
[0084] y[i,list[r][0],pr[i,j+1]] = 1
[0085] y[i,pr[i,j-1],list[r][0]] = 1
[0086] ct[pr[i,j]] += ct[pr[i,j-1]]
[0087] for h in range(j,ind+1):
[0088] ct[pr[i,h]] += ad_time#Product completion time
[0089] TT[i] = ct[pr[i,ind]]
[0090] if TT[i]>T_MAX:#The maximum running time of the machine must not be exceeded
[0091] continue
[0092] x[list[r][0],i] = 1
[0093] if obj(n,w,ct,m,gama,T_MAX,TT) <min_obj :
[0094] min_obj = obj(n,w,ct,m,gama,T_MAX,TT)
[0095] min_obj_index = j
[0096] min_min_obj.append(min_obj)
[0097] min_min_obj_index.append(min_obj_index)#Add the product to the processing machine production line
[0098] Min_obj = min(min_min_obj)
[0099] Min_obj_index = min_min_obj.index(min(min_min_obj))#Add the product to be processed to the processing machine
[0100] insertproduct(Min_obj_index,min_min_obj_index[Min_obj_index],r)
[0101] end = time.perf_counter()
[0102] obj1 = obj(n,w,complete_time,m,gama,T_MAX,T) #Get the objective function value
[0103] print(end-start)#Get the processing position
[0104] #print(Pr)
[0105] The above code can be used to determine the processing machine to which the product to be processed is added to determine the target processing machine, and to determine the target processing position according to the processing position corresponding to the output objective function value.
[0106] In one embodiment, if Figure 5 As shown, step S120 also includes steps S1201-S1202.
[0107] S1201, solving the sub-objective function according to the products to be processed on the production line of each processing machine to obtain a target production sequence, wherein the sub-objective function is a function that satisfies preset constraints and is constructed according to the products to be processed on the production line of each processing machine;
[0108] S1202. Scheduling and processing the products to be processed according to the target production sequence of each processing machine.
[0109] In this embodiment, the sub-objective function is a function constructed according to the products to be processed on the production line of each processing machine. Specifically, because the target machine and the target processing position for processing each workpiece to be processed are determined, the products to be processed that each processing machine needs to process and the processing position corresponding to the machine can be determined at the same time. The sub-objective function is solved according to the products to be processed that each processing machine needs to process, wherein the sub-objective function is: The parameter values in the sub-objective function have the same meaning as those in the objective function, which will not be described here. In order to prevent the wrong sorting of processing one product before processing another product, the sub-objective function is conditionally limited. At this time, the product assigned to each machine is Pr, Specifically, the preset constraints in the construction of the sub-objective function are: (2-1) (2-2) (2-3) (2-4) (2-5) (2-6) (2-7) (2-8) (2-9) (2-10) Where S is the set of products to be processed by the processing machine. Formula (2-1) stipulates that the actual processing time of the processing machine must be less than its corresponding preset maximum running time. (2-2) indicates that the products assigned to machine j are not allowed to be sorted with the products not assigned to machine j. (2-3) stipulates that it is not allowed and there is no such thing as starting with product i and then processing product i at the end of the processing. (2-4) stipulates that if a product to be processed is generated, it is not allowed to be processed multiple times. (2-5) indicates that the number of connections between the product produced on machine j and all products should be equal to the number of products produced on machine j - 1. (2-6) and (2-7) respectively stipulate that there can be at most one product produced after i. Product i can only be produced immediately after one product, that is, i cannot be produced after i and then another i is produced. (2-8) indicates that there must be at least one connection between product i and all other products to be processed. That is, product i cannot exist alone and have no connection with other products. (2-9) indicates the calculated completion time of product i. (2-10) indicates It can only take the value of 0 or 1. That is, the production sequence on each machine is required to be a line segment formed by connecting all products, and cannot be connected end to end to form a closed loop. Otherwise, the completion time of each product cannot be directly solved by the restriction formula (11). For example, when processing three products a, b, and c, the processing sequence can only be abc, not abca. The target processing sequence that meets the constraints of the objective function is determined according to the processing workload and product conversion time of each product to be processed, and the conversion time between products is reduced according to the target processing sequence. Among them, in the process of solving the sub-objective function, the dynamic restricted production method is adopted to obtain the solution of the sub-objective function while reducing the conditional constraints on the model. Specifically, the conditional constraints of (2-4) are relaxed during the solution operation. When a product to be processed is not processed and other products are produced, resulting in multiple processing of the product, the corresponding constraints are added to cut off the situation, making the sub-objective function easier to solve. The specific implementation is as follows: first, the constraints of (2-4) are relaxed. When a feasible solution is found, the callback function is used to check whether the feasible solution includes a sub-ring (a situation where a product to be processed is not processed completely and other products are produced, resulting in multiple processing of the product). If a sub-ring is included, then the constraints are added: in, The number of product processing types corresponding to the current sub-ring (solution), that is, if it is abca, the number of product processing types is 4. Cut off the sub-ring through conditional constraints. If it contains multiple sub-rings, select the sub-ring with the shortest length. . By adding constraints in the sub-objective function to constrain the above preset constraints to cut off the sub-ring, until an optimal solution that does not violate any sub-ring to eliminate the constraints is found. Wherein, the optimal solution is the target production sequence. According to the sub-objective function, the corresponding target production sequence is obtained to schedule and process the products to be processed, so as to optimize the production sequence again to improve the processing efficiency of the production line.
[0110] In one embodiment, if Figure 6 As shown, step S1202 also includes steps S1203-S1205.
[0111] S1203, randomly exchanging the production sequences in the two processing machines, wherein the production sequence includes a randomly selected product to be processed and all subsequent products to be processed;
[0112] S1204, obtaining a corresponding function exchange value through the sub-objective function of the production sequence on the processing machine after the exchange;
[0113] S1205. If the function exchange value is less than the sub-objective function value corresponding to the target production sequence, the products to be processed are scheduled and processed according to the exchanged production sequence.
[0114] In this embodiment, the production sequence includes a randomly selected product to be processed and all subsequent products to be processed. In order to optimize the target production sequence again, it can be sorted and calculated again to determine whether a better production sequence can be obtained, thereby further improving the product processing efficiency. Specifically, the production sequences of the two processing machines are randomly exchanged. For example, processing machines m1 and m2 are randomly selected, and segments of length a and b are selected from the production sequences of the two machines respectively. The difference in the number of products between a and b cannot exceed the preset number of products. If it exceeds, the actual running time of the machine may exceed the maximum running time. Therefore, the lengths of the two exchange segments cannot differ too much. In this embodiment, the preset number of products is 3. Specifically, U m It represents the set of machines that have not exchanged production sequence fragments. The exchange is initialized to U m =M, where M is defined in the above content and will not be repeated here. mA machine m1 is randomly selected, and the position of product P1 before the exchange segment is randomly determined. It should be noted that P1 cannot be the last position in the production sequence. Product P2 with the shortest processing conversion time with product P1 is selected from other processing machines. P1 and all products to be processed after it are taken as production sequence a, and P2 and all products to be processed after it are taken as production sequence b. A and b are exchanged and the corresponding function exchange value is obtained through the sub-objective function, wherein the function exchange value is the value of the sub-objective function after the production sequence is exchanged. If the function exchange value is less than the sub-objective function value corresponding to the target production sequence, it indicates that the production efficiency after the exchange is higher, and the products to be processed are scheduled and processed according to the exchanged production sequence. By exchanging the production sequences in the two processing machines, it is determined whether there is a better production sequence, so as to continuously improve the processing efficiency of the production line.
[0115] S130: Scheduling and processing the product to be processed according to the target machine and the target processing position.
[0116] In this embodiment, the product to be processed is scheduled and processed according to the target machine and the target processing position. Specifically, the product to be processed is scheduled to the target processing position of the corresponding target machine, and the processing machine is controlled to process the product to be processed. By processing the product to be processed according to the target machine and the target processing position, the time for processing conversion between different processed products is reduced, thereby improving the production efficiency of the processed products on the production line.
[0117] Figure 7 is a schematic block diagram of a production line scheduling device 200 based on a heuristic algorithm provided by an embodiment of the present invention. Figure 7 As shown, corresponding to the above production line scheduling method based on heuristic algorithm, the present invention also provides a production line scheduling device based on heuristic algorithm. The production line scheduling device based on heuristic algorithm includes a unit for executing the above production line scheduling method based on heuristic algorithm, and the device can be configured in a desktop computer, tablet computer, laptop computer, etc. Specifically, please refer to Figure 7 The production line scheduling device based on the heuristic algorithm includes a sequence determination unit 210, a target determination unit 220, and a processing unit 230.
[0118] The sequence determination unit 210 is used to determine the target processing sequence of the products to be processed by a preset sorting method according to the processing workload and product conversion time of each product to be processed and the objective function, wherein the objective function is a function constructed according to the processing completion time of the products to be processed and the processing time of each processing machine.
[0119] In one embodiment, the sequence determining unit 210 includes a first sequence unit, a second sequence unit, a third sequence unit, a fourth sequence unit, and a first acquiring unit.
[0120] A first sequence unit, used for randomly sorting the products to be processed to obtain a first processing sequence;
[0121] A second sequence unit, used for obtaining a second processing sequence by descending sorting according to the processing workload corresponding to each of the products to be processed;
[0122] A third sequence unit, used for obtaining a third processing sequence by descending sorting according to the average product conversion time of the products to be processed among the plurality of processing machines;
[0123] A fourth sequence unit, used for performing comprehensive sorting according to the processing workload of each product to be processed and the average product conversion time to obtain a fourth processing sequence;
[0124] The first acquisition unit is used to obtain corresponding objective function values of four processing sequences through the objective function, wherein the processing sequence corresponding to the minimum objective function value is the target processing sequence.
[0125] The target determination unit 220 is used to determine the target machine and target processing position for processing the product to be processed by using the target function and the target processing sequence through a heuristic algorithm.
[0126] In one embodiment, the target determination unit 220 includes a placing unit and a comparing unit.
[0127] A placing unit, used to place the product to be processed into any processing position of each processing machine production line according to the target processing sequence, and calculate the processing position through the objective function to obtain the corresponding objective function value;
[0128] A comparison unit is used to determine the processing machine and the processing position corresponding to the minimum objective function value as the target machine and the target processing position.
[0129] In one embodiment, the target determination unit 220 includes a calculation unit, a judgment unit, and a second acquisition unit.
[0130] A calculation unit, configured to perform time calculation according to a processing speed and a processing workload of the product to be processed to obtain an actual operating time of the processing machine when the product to be processed is processed at the processing position;
[0131] a judging unit, configured to judge whether the actual running time exceeds a preset maximum running time of the processing machine;
[0132] The second acquisition unit is used to acquire the target function value of the processing position according to the target function if it is not exceeded.
[0133] In one embodiment, the target determination unit 220 includes a solution unit and a processing sub-unit.
[0134] A solving unit, used for solving a sub-objective function according to the products to be processed on the production line of each processing machine to obtain a target production sequence, wherein the sub-objective function is a function that satisfies preset constraints and is constructed according to the products to be processed on the production line of each processing machine;
[0135] The processing subunit is used to schedule and process the products to be processed according to the target production sequence of each processing machine.
[0136] In one embodiment, the target determination unit 220 includes a random unit, a switching unit, and a second processing sub-unit.
[0137] A random unit, used for randomly exchanging the production sequences in the two processing machines, wherein the production sequence includes a randomly selected one of the to-be-processed products and all subsequent to the to-be-processed products;
[0138] An exchange unit, used for obtaining a corresponding function exchange value through the sub-objective function of the production sequence on the exchanged processing machine;
[0139] The second processing subunit is used to schedule and process the product to be processed according to the exchanged production sequence if the function exchange value is less than the sub-objective function value corresponding to the target production sequence.
[0140] The processing unit 230 is used to schedule and process the product to be processed according to the target machine and the target processing position.
[0141] It should be noted that technicians in the relevant field can clearly understand that the specific implementation process of the above-mentioned heuristic algorithm-based production line scheduling device 200 and each unit can refer to the corresponding description in the aforementioned method embodiment, and for the convenience and conciseness of the description, it will not be repeated here.
[0142] The above-mentioned production line scheduling device based on heuristic algorithm can be implemented in the form of a computer program. The computer program can be used in Figure 8 Runs on the computer device shown.
[0143] See also Figure 8 , Figure 85 is a schematic block diagram of a computer device provided in an embodiment of the present application. The computer device 500 may be a terminal or a server, wherein the terminal may be an electronic device with communication functions such as a smart phone, a tablet computer, a laptop computer, a desktop computer, a personal digital assistant, and a wearable device. The server may be an independent server or a server cluster composed of multiple servers.
[0144] See also Figure 8 The computer device 500 includes a processor 502 , a memory and a network interface 505 connected via a system bus 501 , wherein the memory may include a non-volatile storage medium 503 and an internal memory 504 .
[0145] The non-volatile storage medium 503 can store an operating system 5031 and a computer program 5032. The computer program 5032 includes program instructions, and when the program instructions are executed, the processor 502 can execute a production line scheduling method based on a heuristic algorithm.
[0146] The processor 502 is used to provide computing and control capabilities to support the operation of the entire computer device 500 .
[0147] The internal memory 504 provides an environment for the operation of the computer program 5032 in the non-volatile storage medium 503. When the computer program 5032 is executed by the processor 502, the processor 502 can execute a production line scheduling method based on a heuristic algorithm.
[0148] The network interface 505 is used to communicate with other devices over the network. Figure 8 The structure shown in the figure is merely a block diagram of a portion of the structure related to the solution of the present application, and does not constitute a limitation on the computer device 500 to which the solution of the present application is applied. The specific computer device 500 may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0149] The processor 502 is used to run a computer program 5032 stored in the memory to implement the steps of the above method.
[0150] It should be understood that in the embodiment of the present application, the processor 502 may be a central processing unit (CPU), and the processor 502 may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Among them, the general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.
[0151] It can be understood by those skilled in the art that all or part of the processes in the method for implementing the above embodiment can be completed by instructing the relevant hardware through a computer program. The computer program includes program instructions, and the computer program can be stored in a storage medium, which is a computer-readable storage medium. The program instructions are executed by at least one processor in the computer system to implement the process steps of the embodiment of the above method.
[0152] Therefore, the present invention also provides a storage medium. The storage medium may be a computer-readable storage medium. The storage medium stores a computer program, wherein the computer program includes program instructions. When the program instructions are executed by a processor, the processor executes the steps of the above method.
[0153] The storage medium may be a USB flash drive, a mobile hard disk, a read-only memory (ROM), a magnetic disk, or an optical disk, etc., which are computer-readable storage media that can store program codes.
[0154] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in terms of function in the above description. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0155] In the several embodiments provided by the present invention, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of each unit is only a logical function division, and there may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed.
[0156] The steps in the method of the embodiment of the present invention can be adjusted in order, combined and deleted according to actual needs. The units in the device of the embodiment of the present invention can be combined, divided and deleted according to actual needs. In addition, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0157] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a storage medium. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, terminal, or network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention.
[0158] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed by the present invention, and these modifications or replacements should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be based on the protection scope of the claims.
Claims
1. A production line scheduling method based on heuristic algorithm, characterized in that: The method comprises: Determine the target processing sequence of the products to be processed by a preset sorting method according to the processing workload and product conversion time of each product to be processed and the objective function, wherein the objective function is a function constructed according to the processing completion time of the products to be processed and the processing time of each processing machine; Determine the target machine and target processing position for processing the product to be processed by using the target function and the target processing sequence through a heuristic algorithm; Scheduling and processing the product to be processed according to the target machine and the target processing position; After the step of determining the target machine and the target processing position for processing the product to be processed by the heuristic algorithm using the target function and the target processing sequence, the method further comprises: Solving the sub-objective function according to the products to be processed on the production line of each processing machine to obtain the target production sequence, wherein the sub-objective function is a function that satisfies preset constraints and is constructed according to the products to be processed on the production line of each processing machine; Scheduling and processing the products to be processed according to the target production sequence of each processing machine; After the step of solving the sub-objective function according to the to-be-processed products on the production line of each processing machine to obtain the target production sequence, the method further comprises: Randomly exchanging the production sequences in the two processing machines, wherein the production sequence includes a randomly selected product to be processed and all subsequent products to be processed; Obtaining a corresponding function exchange value through the sub-objective function for the production sequence on the processing machine after the exchange; If the function exchange value is less than the sub-objective function value corresponding to the target production sequence, the products to be processed are scheduled and processed according to the exchanged production sequence.
2. The method according to claim 1, characterized in that The step of determining the target processing sequence of the products to be processed by a preset sorting method according to the processing workload and product conversion time of each product to be processed and the objective function comprises: Randomly sorting the products to be processed to obtain a first processing order; Obtaining a second processing sequence by descending sorting according to the processing workload corresponding to each of the products to be processed; Obtaining a third processing sequence by descending sorting of the average product conversion time of the products to be processed among the plurality of processing machines; Obtaining a fourth processing sequence by comprehensively sorting the processing workload of each product to be processed and the average product conversion time; The four processing sequences are respectively subjected to the objective function to obtain corresponding objective function values, wherein the processing sequence corresponding to the minimum objective function value is the target processing sequence.
3. The method according to claim 1, characterized in that: The step of determining the target machine and the target processing position for processing the product to be processed by using the target function and the target processing sequence through a heuristic algorithm comprises: According to the target processing sequence, the product to be processed is placed in any processing position of each processing machine production line, and the processing position is calculated by the objective function to obtain the corresponding objective function value; The processing machine and the processing position corresponding to the minimum objective function value are determined as the target machine and the target processing position.
4. The method according to claim 3, characterized in that The step of calculating the processing position through an objective function to obtain a corresponding objective function value comprises: Performing time calculation based on the processing speed and the processing workload of the product to be processed to obtain the actual operating time of the processing machine when the product to be processed is processed at the processing position; determining whether the actual operating time exceeds a preset maximum operating time of the processing machine; If it does not exceed, the objective function value of the processing position is obtained according to the objective function.
5. The method according to claim 1, characterized in that The objective function and the sub-objective function are: ; Wherein, Y is the value of the objective function, n represents the total number of types of products to be processed, i is the i-th type of product to be processed, represents the product weight of the i-th product to be processed, is the completion time of the i-th product to be processed, m represents the total number of processing machines, j represents the j-th processing machine, represents the processing weight of the j-th processing machine, T represents the preset maximum operating time of the processing machine, The actual operating time of the processing machine.
6. A production line scheduling device based on a heuristic algorithm, characterized in that: The apparatus comprises means for executing the method according to any one of claims 1-5.
7. A computer device, characterized in that: The computer device includes a memory and a processor, the memory stores a computer program, and the processor implements the method according to any one of claims 1 to 5 when executing the computer program.
8. A storage medium, characterized in that: The storage medium stores a computer program, wherein the computer program includes program instructions, and when the program instructions are executed by a processor, the method according to any one of claims 1 to 5 can be implemented.
