A distributed flexible job shop scheduling method and system based on multi-scale graph attention mechanism for automobile manufacturing
Through the multi-scale graph attention mechanism and the agent PAC algorithm optimization scheduling strategy, the problems of operation conflicts and resource allocation in distributed flexible operation workshops are solved, production efficiency and adaptability are improved, and are suitable for traditional manufacturing and high-variability production needs.
Patent Information
- Application Number
- CN202510630742.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-16
- Publication Date
- 2025-09-02
- Estimated Expiration
- 2045-05-16
AI Technical Summary
The prior art is difficult to effectively deal with job conflicts and resource allocation problems in distributed flexible operation workshop scheduling, resulting in increased machine idleness and waiting time, affecting production efficiency.
The distributed flexible operation workshop scheduling method based on the multi-scale graph attention mechanism is adopted. By constructing an energy-saving distributed flexible operation workshop scheduling model, the Markov decision-making process and the agent PAC algorithm are used to optimize the scheduling strategy, and combined with the multi-scale center expansion attention window and adaptive multi-node embedded heterogeneous graph neural network, the efficient scheduling of operations and resources is achieved.
It improves production efficiency, shortens the overall operation completion time of the work workshop, enhances the system's adaptability in complex operation scenarios, and can effectively respond to high variability and personalized production needs.
Smart Images

Figure CN120146147B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of automobile manufacturing technology, and in particular to a distributed flexible job shop scheduling method and system based on a multi-scale graph attention mechanism for automobile manufacturing. Background Art
[0002] In the automotive manufacturing industry, parts processing is a crucial link in the entire production chain. Each vehicle requires the precise assembly of numerous mechanical components. In the production of automotive parts, multi-process machining accounts for the majority of the output value. These multi-layered processing capabilities have become the most important metric for measuring the level of automotive manufacturing technology. With increasingly fierce market competition, single-factory parts processing has evolved into distributed processing, increasing scheduling complexity. Effectively improving the efficiency of each link in the multi-process parts production process and coordinating production across factories is key to enhancing a company's economic profitability and market competitiveness.
[0003] In automotive manufacturing, a distributed flexible job shop specifically refers to a manufacturing system capable of flexibly responding to a variety of production tasks. Such a system typically consists of multiple independent yet collaborative production workshops and production machines, each capable of handling all types of manufacturing tasks, while each machine handles specific types of tasks. For example, one machine might specialize in machining engine components, while another handles the welding and assembly of vehicle bodies. Therefore, the scheduling system must efficiently manage resources and production processes, ensuring smooth transitions between processes, minimizing waiting and idle time, and optimizing overall production line performance. The energy-efficient distributed flexible job shop scheduling problem (DFJSP) for automotive manufacturing is a complex problem in industrial production management. It aims to optimize job sequencing, machine allocation, and time scheduling in the automotive parts production process to improve production efficiency and reduce costs. For tasks with multiple processing sequences and multiple machines, effective scheduling is key to improving production flexibility and market responsiveness. In the DFJSP, three tightly coupled subproblems require decision-making: assigning jobs to plants, assigning operations to machines, and determining the sequence of operations.
[0004] In recent years, many effective methods have emerged to solve the DFJSP. These solutions can be categorized into four main groups: exact algorithms, heuristic algorithms, metaheuristic algorithms, and machine learning-based algorithms. Exact algorithms, including mixed integer linear programming (MILP) and branch-and-bound (B&B), can achieve optimal solutions. Among exact algorithms, MILP is frequently used to solve the DFJSP and its extensions. While MILP is well-suited for small and medium-sized problems, it often fails to achieve optimal or even satisfactory solutions for large-scale problems. Heuristic algorithms can quickly find solutions but cannot guarantee optimality and may become trapped in local optima. Most recent research on the DFJSP has employed metaheuristic algorithms, which can be broadly divided into three categories: trajectory-based metaheuristics, swarm-based metaheuristics, and hybrid metaheuristics. Trajectory-based metaheuristics search the solution space by iteratively improving a single or a few solutions. Most trajectory-based metaheuristics, such as simulated annealing (SA) and tabu search (TA), are local searches. Trajectory-based metaheuristics seek optimal solutions by gradually exploring and forming specific paths through the solution space. In contrast, swarm-based metaheuristics use the solution of the entire swarm, including genetic algorithms (GA), particle swarm optimization (PSO), and ant colony optimization (ACO). Hybrid algorithms combine the capabilities of trajectory-based search enhancement metaheuristics and population-based search diversification metaheuristics, and have been shown to be effective in solving a variety of problems. Hybrid algorithms mainly include hybrid intelligent optimization algorithms (HIOA) and hybrid genetic algorithms (HGA), among which HIOA is a particularly popular method for solving DFJSP. HIOA provides a combination of the advantages of multiple algorithms, but with increased complexity and higher computational costs. In addition, HIOA cannot achieve interactive learning. HIOA is usually based on predefined rules and heuristics, which results in the inability of HIOA to re-optimize parameters and strategies through trial and error feedback. Summary of the Invention
[0005] (1) Technical problems solved
[0006] In response to the shortcomings of the existing technology, the present invention provides a distributed flexible job shop scheduling method and system based on a multi-scale graph attention mechanism for automobile manufacturing, which has the advantages of improving production efficiency and solving the above-mentioned technical problems.
[0007] (2) Technical solution
[0008] To achieve the above objectives, the present invention provides the following technical solution: a distributed flexible job shop scheduling method based on a multi-scale graph attention mechanism for automobile manufacturing, comprising the following steps:
[0009] S1. Obtain the constraints of the distributed flexible job shop and the maximum completion time of the optimization target, and build an energy-saving distributed flexible job shop scheduling model;
[0010] Taking the maximum completion time as the optimization objective, the expression is as follows:
[0011]
[0012] Where, represents the maximum completion time;
[0013] Obtain distributed flexible job shop constraints, including job allocation constraints, machine occupancy constraints, machine availability constraints, operation sequence constraints, time calculation, job conflict-free constraints, and maximum completion time definition;
[0014] The expression of the job allocation constraint is as follows:
[0015]
[0016] Where, represents the total number of factories; The index of the factory; represents the first binary decision variable, i.e. if the job Assigned to factory , then it is set to 1, otherwise it is 0; Represents any symbol; Indicates the job index;
[0017]
[0018] Where, Indicates the factories, ,in, Represents a collection of factories, ; Indicates the number of machines in each factory, Indicates the index of the machine; Indicates that in the factory Machine operands on ; Representation position,constraints ensure that each position of each machine can only be occupied by one,operation; Represents the second binary variable, that is, if the operation In the factory First Machine Position on Processing and operation On the second machine If the process is on, it is set to 1, otherwise it is 0, where represents the index of the machine, ≠ ; Subscript Indicates the index of the operation, , Indicates execution of assignments The number of operations, Indicates homework No. operations; among them, Represents a collection of assignments. , Represents a collection of machines, ,and Represents a virtual machine, Represents a collection of operations. ;
[0019]
[0020] Where, Indicates homework The first operation in the virtual machine The allocation variable on , i.e. the virtual starting node;
[0021] The machine occupancy constraints are as follows:
[0022]
[0023]
[0024] Where, Indicates the total number of jobs, Indicates the index of the job ; Represents the third binary variable, that is, if the operation In the factory Medium Machine Position on Processing and operation In the machine If the operation is processed, it is set to 1, otherwise it is 0, ensuring that each operation must be assigned to a unique location and machine;
[0025] The machine availability constraint expression is as follows:
[0026]
[0027]
[0028]
[0029] Where, Represents the fourth binary variable, that is, if the operation Able to Medium Machine If the above is processed, it is set to 1, otherwise it is 0;
[0030] The expression of the operation order constraint is as follows:
[0031]
[0032] Where, represents the fifth binary decision variable, i.e. if the operation In the factory Medium Machine Position on Processing and operation In the machine If the process is on, it is set to 1, otherwise it is 0, where, represents the index of the machine, ≠ ;
[0033]
[0034] Where, Indicates when The second binary variable when taking 2; Indicates the assignment The first operation in the virtual machine Assign variables on ;
[0035] The expression for time calculation is as follows:
[0036]
[0037] Where, Indicates an operation completion time; Indicates an operation The start time of Indicates an operation In the factory Medium Machine The actual processing time on
[0038]
[0039] Where, Indicates when When 1 is taken, the operation completion time; Show when When 1 is taken, the operation The start time of
[0040]
[0041] Where, Indicates that when When operating completion time;
[0042] The expression of the conflict-free constraint between jobs is as follows:
[0043]
[0044]
[0045] Where, Indicates the second operation The completion time of represents the index of the second job, , represents the index of the second operation, ; Represents the fifth binary variable, if the operation In the factory Medium Machine Position on Processing and operation In the machine If it is processed, it is set to 1, otherwise it is 0; Represents a positive number, used to convert logical constraints into mathematical expressions; Represents a sorting decision variable. If the operation exist If it is processed before, it is set to 1, otherwise it is 0; since a machine position p only processes one workpiece, , Only one is 1;
[0046] The expression for the maximum completion time definition is as follows:
[0047]
[0048] Where, Indicates when Pick Time Operation completion time;
[0049] .
[0050] S2, model the distributed flexible job shop scheduling model as a single-agent Markov decision process;
[0051] S3. Obtain the processing information of the distributed flexible workshop and organize it into a processing feature matrix, and represent the processing feature matrix as a heterogeneous graph , the heterogeneous graph The heterogeneous graph is first expanded in multiple scales by multi-scale center expansion attention window, and the heterogeneous graph is Different node types in the graph are embedded using two different algorithms, and finally a heterogeneous graph embedding is obtained. ;
[0052] S4, using intelligent agent PAC according to the current state , based on the Softmax strategy probabilistic selection of actions , get rewards And enter the next state , and store all the agent's data and read it when updating the strategy. Indicates the time step, that is, the time of the current state is t;
[0053] S5. Update the network and train the Critic network in the agent PAC based on the state, action, and average reward of the agent. Output the value function value based on the Critic network. , calculate the advantage function: , and then calculate the loss function , the Actor network in the agent PAC performs gradient descent based on rewards; Indicates cumulative rewards, represents the time step for loss function calculation, Indicates the critic network's response to the current state The predicted value of
[0054] S6. Determine whether all action scheduling is completed. If no termination signal appears, return to S3. If a termination signal appears, it means that the scheduling is completed.
[0055] S7. Determine whether the current number of iterations is equal to the update step size. If so, verify the verification set and retain the optimal strategy and optimal scheduling solution. If not, proceed to the next step.
[0056] S8. Determine whether the current number of iterations exceeds the maximum number of iterations. If so, end all training and output the optimal strategy and optimal scheduling plan. If not, proceed to the next training.
[0057] As a preferred technical solution of the present invention, step S2 includes the following steps:
[0058] S2.1. Set the state set, including:
[0059] Operation status , It is represented by six local features, namely ,in, Indicates that the operation Has scheduling been arranged? Indicates that it can be used for processing operations The number of machines, Indicates that it can be used for processing operations The number of factories, Indicates the processing time of the operation, Indicates the operation Assignment The number of unprocessed operations, Indicates an operation The start time, Indicates the job End time;
[0060] Machine operating status , It is represented by three local features, namely ,in, represents the operations that the machine can handle, Indicates the available time of the machine, Indicates the utilization rate of the machine;
[0061] Factory operating status , It is represented by three local features, namely , Indicates that it is expected to be in the factory The number of operations to process, It is expected to be in the factory The processing time of the operations processed in Indicates factory machine utilization;
[0062] Undirected arcs connecting operation nodes and machine nodes Original Features The state is represented by , , ; It contains a feature , represents the actual processing time of the machine operation, represents the arc set consisting of all undirected arcs, Represents features as a one-dimensional tensor;
[0063] Undirected arcs connecting factory nodes and machine nodes Original Features The state is represented by , , ; It contains a feature , represents the total time of the operation to be processed on the machine, represents the set of undirected arc features connecting factory nodes and machine nodes;
[0064] S2.2. Build the PAC agent. The PAC agent is constructed by applying the optimization strategy of PPO to the Actor-Critic architecture.
[0065] S2.3. Setting the Agent PAC Discount Factor , the reward function , cumulative rewards , its specific expression is as follows:
[0066]
[0067]
[0068] in, represents the agent PAC reward, Represents scheduling The maximum completion time of Represents scheduling Maximum completion time Indicates the maximum completion time initially set. In a specific problem instance, there is a constant , which means minimizing and maximize are equivalent, represents the total time step, Indicates the maximum completion time.
[0069] As a preferred technical solution of the present invention, the specific steps in step S3 are as follows:
[0070] S3.1. Using multi-scale center dilated attention window for heterogeneous graphs To expand;
[0071] S3.2. Expand the heterogeneous graph Input into the adaptive multi-node embedding heterogeneous graph neural network for embedding, the adaptive multi-node embedding heterogeneous graph neural network is used for the expanded heterogeneous graph Embedding specifically includes machine node embedding, factory node embedding, operation node embedding and graph embedding. After embedding is completed, aggregation is performed to finally obtain heterogeneous graph embedding. .
[0072] As the preferred technical solution of the present invention, the adaptive multi-node embedding heterogeneous graph neural network for machine node embedding includes two meta-paths. The first is from the machine node to the operation node, and the self-attention mechanism is used for path embedding. The second is from the machine node to the factory node, and the self-attention mechanism is used for path embedding. The embedding results of the two meta-paths are aggregated using the self-attention mechanism to obtain the machine embedding feature. ;
[0073] The adaptive multi-node embedding heterogeneous graph neural network is used to embed factory nodes, which only contains one meta-path and uses the self-attention mechanism for path embedding without path aggregation to obtain machine embedding features. ;
[0074] The adaptive multi-node embedding heterogeneous graph neural network performs operation node embedding. The operation nodes are embedded by stacking multiple layers of MLP. The specific expression is as follows:
[0075]
[0076] in, Indicates that the instance is based on the original heterogeneous graph to perform operation nodes Embed, 、 、 、 、 Represents the first to fifth multi-layer perceptrons used for embedding, Indicates the current embed operation Direct front drive The original characteristics of Indicates the current embed operation direct successor The original characteristics of Indicates the current embed operation The original characteristics of the machine embedding are performed before the operation embedding. Indicates the machine that the current embedded operation is connected to Embedded features obtained through machine embedding, They represent activation functions, Indicates cascade;
[0077] The specific expression of graph embedding by the adaptive multi-node embedding heterogeneous graph neural network is as follows:
[0078]
[0079]
[0080]
[0081] 、 、 Represent the final operation embedding, machine embedding, factory embedding, They represent the local operation embedding, local machine embedding, and local factory embedding obtained by embedding the heterogeneous graph subgraph with scale r=1. They represent the local operation embedding, local machine embedding, and local factory embedding obtained by embedding the heterogeneous graph subgraph with a scale of r=2. Respectively represent the scale based on r= The local operation embedding, local machine embedding, and local factory embedding are obtained by embedding the heterogeneous graph subgraphs. They represent the local operation embedding, local machine embedding, and local factory embedding obtained by graph embedding based on the original heterogeneous graph. Represents a cascade, where is the scale parameter of the multi-scale center dilated attention window.
[0082] As the preferred technical solution of the present invention, the step S4 selects the action based on the Softmax strategy probability. The specific expression is as follows:
[0083]
[0084] in, Represents the probability based on Softmax strategy, Indicates action In the current state The priority index of Indicates all actions In the current state The sum of the priority indexes, Represents an exponential function with a natural constant as its base.
[0085] A distributed flexible job shop scheduling system based on a multi-scale graph attention mechanism for automobile manufacturing is used to run the above-mentioned distributed flexible job shop scheduling method based on a multi-scale graph attention mechanism for automobile manufacturing.
[0086] Compared with the existing technology, the present invention provides a distributed flexible job shop scheduling method and system based on a multi-scale graph attention mechanism for automobile manufacturing, which has the following beneficial effects:
[0087] 1. This invention utilizes a scheduling strategy optimized by the PPO-AC algorithm to more effectively address job conflicts and resource allocation, reducing machine idling and waiting time caused by improper scheduling. In an experimental environment, using this scheduling strategy, the overall job completion time in the job shop was reduced by an average of 20%, improving production efficiency.
[0088] 2. The present invention uses a multi-scale attention mechanism to enable the system to understand and utilize the relationship between factory operations and machines at different levels, thereby enhancing the adaptability of the scheduling algorithm to complex operation scenarios. Deep reinforcement learning with an adaptive multi-scale graph attention mechanism has horizontally expanded the application of deep reinforcement learning in solving distributed flexible job shop scheduling problems. This flexibility makes the present invention not only suitable for traditional manufacturing environments, but also able to effectively respond to high variability and personalized production needs. BRIEF DESCRIPTION OF THE DRAWINGS
[0089] Figure 1 It is a schematic diagram of the process of the present invention;
[0090] Figure 2 Schematic diagram of the algorithm framework of the present invention;
[0091] Figure 3 This is a schematic diagram of the network framework of the present invention;
[0092] Figure 4 Schematic diagram of an isomeric graph of an example of the present invention;
[0093] Figure 5 This is a schematic diagram of the MCW principle of the present invention;
[0094] Figure 6 This is a scheduling diagram of a 2*10*5 DFJSP instance of the present invention;
[0095] Figure 7 This is a scheduling diagram of a 2*20*10 DFJSP instance of the present invention. DETAILED DESCRIPTION
[0096] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.
[0097] See also Figure 1-7 A distributed flexible job shop scheduling method based on a multi-scale graph attention mechanism for automobile manufacturing includes the following steps:
[0098] S1. Obtaining distributed flexible job shop constraints and optimization target maximum completion time , and build an energy-saving distributed flexible job shop scheduling model. The specific expression is as follows:
[0099] (1)
[0100] Where, represents the maximum completion time;
[0101] Obtain distributed flexible job shop constraints, including job allocation constraints, machine occupancy constraints, machine availability constraints, operation sequence constraints, time calculation, job conflict-free constraints, and maximum completion time definition;
[0102] The expression of the job allocation constraint is as follows:
[0103] (2)
[0104] Where, represents the total number of factories; The index of the factory; represents the first binary decision variable, i.e. if the job Assigned to factory , then it is set to 1, otherwise it is 0; Represents any symbol; Indicates the job index;
[0105] (3)
[0106] Where, Indicates the factories, ,in, Represents a collection of factories, ; Indicates the number of machines in each factory, Indicates the index of the machine; Indicates that in the factory Machine operands on ; Representation position,constraints ensure that each position of each machine can only be occupied by one,operation; Represents the second binary variable, that is, if the operation In the factory First Machine Position on Processing and operation On the second machine If the process is on, it is set to 1, otherwise it is 0, where represents the index of the machine, ≠ ; Subscript Indicates the index of the operation, , Indicates execution of assignments The number of operations, Indicates homework No. operations; among them, Represents a collection of assignments. , Represents a collection of machines, ,and Represents a virtual machine, Represents a collection of operations. ;
[0107] (4)
[0108] Where, Indicates homework The first operation in the virtual machine The allocation variable on , i.e. the virtual starting node;
[0109] The machine occupancy constraints are as follows:
[0110] (5)
[0111] (6)
[0112] Where, Indicates the total number of jobs, Indicates the index of the job ; Represents the third binary variable, that is, if the operation In the factory Medium Machine Position on Processing and operation In the machine If the operation is processed, it is set to 1, otherwise it is 0, ensuring that each operation must be assigned to a unique location and machine;
[0113] The machine availability constraint expression is as follows:
[0114] (7)
[0115] (8)
[0116] (9)
[0117] Where, Represents the fourth binary variable, that is, if the operation Able to Medium Machine If the above is processed, it is set to 1, otherwise it is 0;
[0118] The expression of the operation order constraint is as follows:
[0119] (10)
[0120] Where, represents the fifth binary decision variable, i.e. if the operation In the factory Medium Machine Position on Processing and operation In the machine If the process is on, it is set to 1, otherwise it is 0, where, represents the index of the machine, ≠ ;
[0121] (11)
[0122] Where, Indicates when The second binary variable when taking 2; Indicates the assignment The first operation in the virtual machine Assign variables on ;
[0123] The expression for time calculation is as follows:
[0124] (12)
[0125] Where, Indicates an operation completion time; Indicates an operation The start time of Indicates an operation In the factory Medium Machine The actual processing time on
[0126] (13)
[0127] Where, Indicates when When 1 is taken, the operation completion time; Show when When 1 is taken, the operation The start time of
[0128] (14)
[0129] Where, Indicates that when When operating completion time;
[0130] The expression of the conflict-free constraint between jobs is as follows:
[0131] (15)
[0132] (16)
[0133] Where, Indicates the second operation The completion time of represents the index of the second job, , represents the index of the second operation, ; Represents the fifth binary variable, if the operation In the factory Medium Machine Position on Processing and operation In the machine If it is processed, it is set to 1, otherwise it is 0; Represents a positive number, used to convert logical constraints into mathematical expressions; Represents a sorting decision variable. If the operation exist If it is processed before, it is set to 1, otherwise it is 0; since a machine position p only processes one workpiece, , Only one is 1;
[0134] The expression for the maximum completion time definition is as follows:
[0135] (17)
[0136]
[0137] Constraint (1) represents the optimization goal of minimizing the construction period.
[0138] Constraint (2) ensures that the jobs are concentrated in each Assigned to a single plant .
[0139] Constraint sets (3)-(4) ensure that the job All operations All in the same factory is processed in .
[0140] Constraint (5) stipulates that each factory Machine Each position Can only be operated Occupy once.
[0141] Constraint (6) ensures that each operation Can be assigned to the factory Machine Location superior.
[0142] Constraint (7) ensures that there is at least one operation There are multiple machines available for processing.
[0143] Constraints (8)-(9) ensure that each operation Selected processing machines From the available machine set Selected in.
[0144] The set of constraints (10)-(11) ensures that all operations Can be processed sequentially, requiring the first operation of each job From the virtual machine Ship out to ensure operations are performed in the correct order.
[0145] The set of constraints (12)-(14) determines each operation Start time and completion time .
[0146] Constraints (15)-(16) restrict different operations There is no overlap between them, that is, the operations of different jobs do not interfere with each other in terms of scheduling or machine allocation.
[0147] Constraint (17) defines the maximum completion time .
[0148] S2. Modeling the distributed flexible job shop scheduling model as a single-agent Markov decision process; step S2 includes the following steps:
[0149] S2.1. Set the state set, including:
[0150] Operation status , It is represented by six local features, namely ,in, Indicates that the operation Has scheduling been arranged? Indicates that it can be used for processing operations The number of machines, Indicates that it can be used for processing operations The number of factories, Indicates the processing time of the operation, Indicates the operation Assignment The number of unprocessed operations, Indicates an operation The start time, Indicates the job End time;
[0151] Machine operating status , It is represented by three local features, namely ,in, represents the operations that the machine can handle, Indicates the available time of the machine, Indicates the utilization rate of the machine;
[0152] Factory operating status , It is represented by three local features, namely , Indicates that it is expected to be in the factory The number of operations to process, It is expected to be in the factory The processing time of the operations processed in Indicates factory machine utilization;
[0153] Undirected arcs connecting operation nodes and machine nodes Original Features The state is represented by , , ; It contains a feature , represents the actual processing time of the machine operation, represents the arc set consisting of all undirected arcs, Represents features as a one-dimensional tensor;
[0154] Undirected arcs connecting factory nodes and machine nodes Original Features The state is represented by , , ; It contains a feature , Represents the total time of the operation to be processed on the machine; represents the set of undirected arc features connecting factory nodes and machine nodes;
[0155] S2.2. Build the PAC agent. The PAC agent is constructed by applying the optimization strategy of PPO to the Actor-Critic architecture.
[0156] S2.3. Setting the Agent PAC Discount Factor , the reward function , cumulative rewards , its specific expression is as follows:
[0157]
[0158]
[0159] in, represents the agent PAC reward function, Represents scheduling The maximum completion time of Represents scheduling The maximum completion time of Indicates the maximum completion time initially set. In a specific problem instance, there is a constant , which means minimizing and maximize are equivalent, represents the total time step, Indicates the maximum completion time.
[0160] S3. Obtain the processing information of the distributed flexible workshop and organize it into a processing feature matrix, and represent the processing feature matrix as a heterogeneous graph , the heterogeneous graph The heterogeneous graph is first expanded in multiple scales by multi-scale center expansion attention window, and the heterogeneous graph is Different node types in the graph are embedded using two different algorithms, and finally a heterogeneous graph embedding is obtained. ;
[0161] The specific steps in step S3 are as follows:
[0162] S3.1. Using multi-scale center dilated attention window for heterogeneous graphs To expand, first use the original image Based on, find the key nodes, that is, the graph in the graph , in particular, hour, , that is, with a selection node set, , Then, with the key node as the center, we search outward for a subgraph consisting of related nodes with a distance r from the key node, and obtain a heterogeneous graph set after multi-scale expansion. ,in For heterogeneous graphs, multi-scale center expansion attention window is used to The scale obtained by expansion is r, where The heterogeneous graph subgraph of is the original heterogeneous graph, Cascade and feed into MLP to get the action In state Priority index at , the priority index of each action is normalized to obtain the probability distribution;
[0163] S3.2. Expand the heterogeneous graph Input into the adaptive multi-node embedding heterogeneous graph neural network for embedding, the adaptive multi-node embedding heterogeneous graph neural network is used for the expanded heterogeneous graph Embedding specifically includes machine node embedding, factory node embedding, operation node embedding and graph embedding. After embedding is completed, aggregation is performed to finally obtain heterogeneous graph embedding. ;
[0164] The adaptive multi-node embedding heterogeneous graph neural network for machine node embedding includes: the features to be aggregated mainly include machine nodes The original characteristics , target operation node The original characteristics , factory node The original characteristics , undirected arc The original characteristics , undirected arc The original characteristics , two meta-paths, the first one is from the machine node to the operation node, i.e. , using self-attention mechanism for path embedding , They are By linearly transforming to the same dimension of features, the second one is from machine nodes to factory nodes , using self-attention mechanism for path embedding , They are By linearly transforming the features to the same dimension, the embedding results of the two meta-paths are aggregated using the self-attention mechanism. Get machine embedding features ;in, represents the attention parameter of the first meta-path (machine → operation); represents the attention parameter of the second meta-path (machine → operation);
[0165] The adaptive multi-node embedding heterogeneous graph neural network is used to embed factory nodes. The features to be aggregated mainly include machine nodes. The original characteristics , factory node The original characteristics Undirected arc The original characteristics , contains only one meta-path , using self-attention mechanism for path embedding , without path aggregation, to obtain factory embedding features ;in, represents the attention parameter that contains only one meta-path (machine → operation);
[0166] The adaptive multi-node embedding heterogeneous graph neural network performs operation node embedding. The operation nodes are embedded by stacking multiple layers of MLP. The features to be aggregated mainly include target operation nodes. The original characteristics , direct pre-order operation The original characteristics , direct post-sequence operation The original characteristics , machine nodes The original characteristics , undirected arc - The original characteristics , and two directed arcs representing the sequence relationship between operations (that is, operations Connect to Directed arcs of Connect to The specific expression is as follows:
[0167]
[0168] in, Indicates that the instance is based on the original heterogeneous graph to perform operation nodes Embed, 、 、 、 、 Represents the first to fifth multi-layer perceptrons used for embedding, Indicates the current embed operation Direct front drive The original characteristics of Indicates the current embed operation direct successor The original characteristics of Indicates the current embed operation The original characteristics of the machine embedding are performed before the operation embedding. Indicates the machine that the current embedded operation is connected to Embedded features obtained through machine embedding, They represent activation functions, Indicates cascade;
[0169] The specific expression of graph embedding by the adaptive multi-node embedding heterogeneous graph neural network is as follows:
[0170]
[0171]
[0172]
[0173] in,, 、 、 、、 、 、 、 、 、 、
[0174] 、 、 Represent the final operation embedding, machine embedding, factory embedding, They represent the local operation embedding, local machine embedding, and local factory embedding obtained by embedding the heterogeneous graph subgraph with scale r=1. They represent the local operation embedding, local machine embedding, and local factory embedding obtained by embedding the heterogeneous graph subgraph with a scale of r=2. Respectively represent the scale based on r= The local operation embedding, local machine embedding, and local factory embedding are obtained by embedding the heterogeneous graph subgraphs. They represent the local operation embedding, local machine embedding, and local factory embedding obtained by graph embedding based on the original heterogeneous graph. Represents a cascade, where is the scale parameter of the multi-scale center dilated attention window.
[0175] S4, using intelligent agent PAC according to the current state , based on the Softmax strategy probabilistic selection of actions , get rewards And enter the next state , and store all the agent's data and read it when updating the strategy. Indicates the time step, that is, the time of the current state is t;
[0176] Probabilistic action selection based on Softmax strategy The specific expression is as follows:
[0177]
[0178] in, Represents the probability based on Softmax strategy, Indicates action In the current state The priority index of Indicates all actions In the current state The sum of the priority indexes, represents an exponential function with a natural constant as its base;
[0179] S5. Update the network and train the Critic network in the agent PAC based on the state, action, and average reward of the agent. Output the value function value based on the Critic network. , calculate the advantage function: , and then calculate the loss function ,in, represents the advantage function, represents the loss function, express At this moment, the Critic network outputs the value function value. express At this moment, the Critic network outputs the value function value. Indicates the total time, Represents the reward, and the Actor network in the agent PAC performs gradient descent based on the reward; Indicates cumulative rewards, represents the time step for loss function calculation, Indicates the critic network's response to the current state The predicted value of
[0180] S6. Determine whether all action scheduling is completed. If no termination signal appears, return to S3. If a termination signal appears, it means that the scheduling is completed.
[0181] S7. Determine whether the current number of iterations is equal to the update step size. If so, verify the verification set and retain the optimal strategy and optimal scheduling solution. If not, proceed to the next step.
[0182] S8. Determine whether the current number of iterations exceeds the maximum number of iterations. If so, end all training and output the optimal strategy and optimal scheduling plan. If not, proceed to the next training.
[0183] While embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions, and variations may be made to these embodiments without departing from the principles and spirit of the invention, and that the scope of the invention is defined by the appended claims and their equivalents.
Claims
1. A distributed flexible job shop scheduling method based on a multi-scale graph attention mechanism for automobile manufacturing, characterized by: The following steps are involved: S1. Obtain the constraints of the distributed flexible job shop and the maximum completion time of the optimization target, and build an energy-saving distributed flexible job shop scheduling model; The distributed flexible job shop constraints include: job allocation constraints, machine occupancy constraints, machine availability constraints, operation sequence constraints, time calculation, conflict-free constraints between jobs, and maximum completion time definition; S2, model the distributed flexible job shop scheduling model as a single-agent Markov decision process; S3. Obtain the processing information of the distributed flexible job shop and organize it into a processing feature matrix. The processing feature matrix is represented as a heterogeneous graph. The heterogeneous graph is first expanded at multiple scales through a multi-scale center-expanded attention window. Two different algorithms are used to embed different node types in the heterogeneous graph, and finally the heterogeneous graph embedding is obtained. The specific steps in step S3 are as follows: S3.
1. Using multi-scale center dilated attention window for heterogeneous graphs To expand; First, take the original image Based on, find the key nodes, that is, the graph in the graph , in particular, hour, , that is, with a selection node set, , Then, with the key node as the center, look outward for the distance from the key node r After multi-scale expansion, a heterogeneous graph set is obtained. ,in For heterogeneous graphs, multi-scale center expansion attention window is used to The scale obtained by expansion is r, where The heterogeneous graph subgraph of is the original heterogeneous graph, Cascade and feed into MLP to get the action In state Priority index at , normalize the priority index of each action to obtain the probability distribution; S3.2, the expanded heterogeneous graph Input into the adaptive multi-node embedding heterogeneous graph neural network for embedding, the adaptive multi-node embedding heterogeneous graph neural network is used for the expanded heterogeneous graph Embedding specifically includes machine node embedding, factory node embedding, operation node embedding and graph embedding. After embedding is completed, aggregation is performed to finally obtain heterogeneous graph embedding. ; The adaptive multi-node embedding heterogeneous graph neural network for machine node embedding includes two meta-paths. The first is from the machine node to the operation node, and the self-attention mechanism is used for path embedding. The second is from the machine node to the factory node, and the self-attention mechanism is used for path embedding. The embedding results of the two meta-paths are aggregated using the self-attention mechanism to obtain the machine embedding feature. ; The adaptive multi-node embedding heterogeneous graph neural network is used to embed factory nodes, which only contains one meta-path and uses the self-attention mechanism for path embedding without path aggregation to obtain the factory embedding feature. ; The adaptive multi-node embedding heterogeneous graph neural network performs operation node embedding. The operation nodes are embedded by stacking multiple layers of MLP. The specific expression is as follows: ; in, Indicates that the instance is based on the original heterogeneous graph to perform operation nodes Embed, 、 、 、 、 Represents the first to fifth multi-layer perceptrons used for embedding, Indicates the current embed operation Direct front drive The original characteristics of Indicates the current embed operation direct successor The original characteristics of Indicates the current embed operation The original characteristics of the machine embedding are performed before the operation embedding. Indicates the machine that the current embedded operation is connected to Embedded features obtained through machine embedding, They represent activation functions, Indicates cascade; The specific expression of graph embedding by the adaptive multi-node embedding heterogeneous graph neural network is as follows: ; ; ; 、 、 Represent the final operation embedding, machine embedding, factory embedding, They represent the local operation embedding, local machine embedding, and local factory embedding obtained by embedding the heterogeneous graph subgraph with scale r=1. They represent the local operation embedding, local machine embedding, and local factory embedding obtained by embedding the heterogeneous graph subgraph with a scale of r=2. Respectively represent the scale based on r= The local operation embedding, local machine embedding, and local factory embedding are obtained by embedding the heterogeneous graph subgraphs. They represent the local operation embedding, local machine embedding, and local factory embedding obtained by graph embedding based on the original heterogeneous graph. Represents a cascade, where is the scale parameter of the multi-scale center expansion attention window; S4, using the intelligent agent PAC to select actions based on the Softmax strategy according to the current state , get rewards And enter the next state And store all the agent's data and read it when updating the strategy; S5. Update the network and train the Critic network in the agent PAC based on the state, action, and average reward of the agent. Output the value function value based on the Critic network. , calculate the advantage function, and then calculate the loss function; S6. Determine whether all action scheduling is completed. If no termination signal appears, return to S3. If a termination signal appears, it means that the scheduling is completed. S7. Determine whether the current number of iterations is equal to the update step size. If so, verify the verification set and retain the optimal strategy and optimal scheduling solution. If not, proceed to the next step. S8. Determine whether the current number of iterations exceeds the maximum number of iterations. If so, end all training and output the optimal strategy and optimal scheduling plan. If not, proceed to the next training.
2. The distributed flexible job shop scheduling method based on a multi-scale graph attention mechanism for automobile manufacturing according to claim 1 is characterized by: The step S2 comprises the following steps: S2.
1. Set the state set, including: Operation status , It is represented by six local features, namely ,in, Indicates that the operation Has scheduling been arranged? Indicates that it can be used for processing operations The number of machines, Indicates that it can be used for processing operations The number of factories, Indicates the processing time of the operation, Indicates the operation Assignment The number of unprocessed operations, Indicates an operation The start time, Indicates the job End time; Machine operating status , It is represented by three local features, namely ,in, represents the operations that the machine can handle, Indicates the available time of the machine, Indicates the utilization rate of the machine; Factory operating status , It is represented by three local features, namely , Indicates that it is expected to be in the factory The number of operations to process, It is expected to be in the factory The processing time of the operations processed in Indicates factory machine utilization; Undirected arcs connecting operation nodes and machine nodes Original Features The state is represented by , , ; It contains a feature , represents the actual processing time of the machine operation, represents the arc set consisting of all undirected arcs, Represents features as a one-dimensional tensor; Undirected arcs connecting factory nodes and machine nodes Original Features The state is represented by , , ; It contains a feature , Represents the total time of the operation to be processed on the machine; represents the set of undirected arcs connecting factory nodes and machine nodes; S2.
2. Build the PAC agent. The PAC agent is constructed by applying the optimization strategy of PPO to the Actor-Critic architecture. S2.
3. Setting the Agent PAC Discount Factor , the reward function , cumulative rewards , its specific expression is as follows: ; ; in, represents the agent PAC reward function, Represents scheduling The maximum completion time of Represents scheduling The maximum completion time of Indicates the maximum completion time initially set. In a specific problem instance, there is a constant , which means minimizing and maximize are equivalent, represents the total time step, Indicates the maximum completion time.
3. The distributed flexible job shop scheduling method based on a multi-scale graph attention mechanism for automobile manufacturing according to claim 1 is characterized by: In step S4, the action is selected based on the Softmax strategy probability. The specific expression is as follows: ; in, Represents the probability based on Softmax strategy, Indicates action In the current state The priority index of Indicates all actions In the current state The sum of the priority indexes, Represents an exponential function with a natural constant as its base.
4. A distributed flexible job shop scheduling system for automobile manufacturing based on a multi-scale graph attention mechanism, characterized by: Used to run a distributed flexible job shop scheduling method based on a multi-scale graph attention mechanism for automobile manufacturing as described in any one of claims 1-3.
Citation Information
Patent Citations
Job-shop scheduling method and system based on principal component heterogeneous graph neural network
CN119512005A