Intelligent network connection vehicle optimal scheduling sequence obtaining method based on deep learning
Through the combination of deep learning and neural network, the optimal scheduling sequence of intelligent connected vehicles is generated, solving the problems of in real-time and inflexible scheduling in the prior art, and achieving high efficiency and security improvement of the traffic system.
Patent Information
- Application Number
- CN202411429743.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-14
- Publication Date
- 2025-01-14
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The existing technology lacks real-time, flexibility and intelligence in intelligent connected vehicle scheduling, resulting in traffic congestion and safety hazards, making it difficult to effectively generate the optimal scheduling sequence.
Using a deep learning-based method, by building a Petri network model and a fully connected neural network, combining genetic algorithms and cluster search algorithms, the optimal scheduling sequence of intelligent connected vehicles is generated, and the remaining time of vehicle passage is predicted in real time, and the vehicle passage order is optimized to avoid Deadlocks and congestion.
It significantly improves the real-time and accuracy of intersection scheduling, reduces vehicle waiting time, improves traffic system efficiency and safety, and ensures efficient and safe vehicle traffic.
Smart Images

Figure CN119314313A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of intelligent transportation, and specifically relates to a method for obtaining an optimal scheduling sequence for intelligent networked vehicles based on deep learning. Background Art
[0002] With the acceleration of urbanization and the surge in motor vehicles, urban road traffic networks face severe challenges. As key nodes, intersections are crucial for efficient operation. Although traditional management methods such as timing, sensing and adaptive control have alleviated some of the challenges, they are insufficient in the face of complex and changing traffic environments. They lack real-time, flexibility and intelligence, leading to congestion, delays and safety hazards.
[0003] Intelligent connected vehicles (CAVs) integrate advanced technologies to achieve information sharing and collaborative control, bringing new opportunities for intersection management. In the intelligent connected environment, intersection management is shifting towards intelligence, flexibility, and efficiency. However, efficient dispatching of intelligent connected vehicles requires solving a core problem: generating the optimal dispatch sequence in real time.
[0004] Deep learning has become a key technology to solve this problem with its powerful data processing and feature extraction capabilities. By building a deep learning model, we can deeply mine traffic data, predict traffic status, and comprehensively consider vehicle status, path selection, and intersection capacity to provide the optimal scheduling sequence for intelligent connected vehicles. This method will significantly improve the real-time, accuracy, and intelligence of intersection scheduling, effectively alleviate traffic congestion, and improve the overall efficiency and safety of the transportation system. Summary of the invention
[0005] The purpose of the present invention is to overcome the limitations of the prior art in the field of intelligent connected vehicle scheduling, and propose a method for obtaining the optimal scheduling sequence of intelligent connected vehicles based on deep learning. This method deeply mines traffic data and uses the powerful analytical ability of deep learning models to customize the optimal sequence for intelligent connected vehicles to pass through intersections, thereby effectively reducing the waiting time of vehicles at intersections and avoiding unnecessary traffic delays.
[0006] In order to achieve the above-mentioned purpose, the present invention adopts the following technical solutions:
[0007] The method for obtaining the optimal scheduling sequence of intelligent connected vehicles based on deep learning includes the following steps:
[0008] Step 1) (Modeling): According to the spatial resource allocation inside the intersection and the dynamic occupation of these resources by vehicles in the process of continuous crossing of the intersection, a Petri net model (P, T, F, M0) of the unsignalized intersection system is constructed, where P is a finite place set; T is a finite transition set; F = (P × T) ∪ (T × P) is a directed arc set; and M0 is an initial identification set.
[0009] Step 2) (Initialize the record table): Obtain vehicle information in the unsignalized intersection area, including the number of vehicles, speed, and lane number.
[0010] Step 3) (Generate neural network data set): Use genetic algorithm to perform global optimization and generate a set of scheduling sequences for the intelligent connected vehicle system. While searching for suboptimal solutions, it also builds a data set for subsequent neural network training. The specific steps are as follows:
[0011] Step 3-1) (Randomly generate the initial population): Since the encoding reflects the vehicle's passage sequence, according to the characteristics of the intelligent connected vehicle system and the genetic algorithm, the vehicle passage sequence is encoded and decoded, and a certain number of chromosomes are randomly generated to form the initial population. The specific steps are as follows:
[0012] Step 3-1-1): The vehicle number is an integer AB, where A represents the vehicle's driving path and B represents the vehicle's driving priority.
[0013] Step 3-1-2): Sort the vehicles from small to large, and then expand the sequence according to the number of transitions that each vehicle needs to pass, and the expanded vehicle sequence is Car_sequence.
[0014] Step 3-1-3): Decode the expanded vehicle traffic sequence Car_sequence into a transition sequence Tran.
[0015] Step 3-1-4): Through encoding and decoding, a certain number of chromosomes are randomly generated to form the initial population.
[0016] Step 3-2) (Detection and repair): The transition sequence decoded according to step 3-1 is not necessarily a feasible pass sequence, and deadlock detection and repair are required. This paper uses the deadlock avoidance algorithm in the prior art to detect and repair the transition sequence of each chromosome to ensure that each transition in the transition sequence can be triggered in sequence.
[0017] Step 3-3) (Output the optimal individual in the population): Calculate the maximum transit time makespan and its fitness value of each chromosome in the population corresponding to the transit sequence, and output the chromosome with the highest fitness value in the population and its makespan. The fitness value calculation formula is as follows:
[0018]
[0019] Where w(t) is the inertia weight value in the Gen-th iteration; maxGen is the maximum number of iterations; p(t) is the fitness update rate of the population individuals. update(Gen) is the number of fitness improvements of the population individuals in the Gen-th iteration; Adapt[i] is the fitness value after the Gen-th update, Adapt[i-1] is the fitness value of the Gen-th update, and r i is a random number between [0,1], Adapt best is the optimal fitness value, ND is a random integer between [1,2], Adapt mean is the mean fitness of chromosomes.
[0020] Step 3-4): Determine whether the termination condition Gen>maxGen is met, where Gen is the number of iterations of the current population and maxGen is the maximum number of iterations; if the termination condition is met, the optimal individual is output, otherwise the genetic operation is performed.
[0021] Step 3-5) (Genetic Operation): Perform the three operations of selection, crossover and mutation on the current population to obtain a new generation of population, and execute steps 3-3 and 3-4.
[0022] Step 3-6) (Obtain the neural network data set): Calculate the identifier M, the corresponding processed time g, and the estimated remaining time h corresponding to the optimal transition sequence of each generation as the data set, where the estimated remaining time h is obtained by subtracting the processed time g from makespan, and the ratio of 8:2 is used as the training set and test set.
[0023] Step 4) (obtain neural network weights and parameters): build a fully connected neural network, determine the network structure, set relevant parameters, train the fully connected neural network with the data set obtained by the genetic algorithm in step 3, and test its training completion, save the trained network weights and parameters in a pth file for subsequent predictions. The specific steps are as follows.
[0024] Step 4-1) (Determine the number of neurons in the input and output layers): The number of neurons in the input layer of the neural network is the total number of Petri net places plus 1. The input is the number of tokens in each Petri net place and the processed time g. The number of neurons in the output layer is 1, and the output is the estimated remaining time h.
[0025] Step 4-2) (Determine the number of hidden layers, Dropout layers, and the number of neurons in each layer): In order to find the appropriate number of hidden layers, the hidden layers are constructed incrementally from one to ten layers, and the Dropout layer is introduced in each hidden layer configuration. The neural networks with different numbers of hidden layers are trained with the same data set, and the connections between neurons are reduced through a fixed formula to prevent overfitting and improve the generalization ability of the model. In order to evaluate the effectiveness of each architecture, the model's mean square error (MSE) is focused on, which measures the average of the squares of the differences between the model's predicted values and the actual values. Through comparative analysis, the number of hidden layers and the corresponding Dropout layer configuration that minimizes the MSE can be obtained.
[0026] Step 4-3) (Building the network structure): After completing steps 4-1 and 4-2 and successfully obtaining the input dimension, expected output, and predetermined number of network layers of the neural network, build a specific network structure in the Sequential() model, and define each layer in order, including the input layer, multiple hidden layers, the Dropout layer interspersed therein, and the final output layer. The ReLU function is selected as the activation function, the Adam algorithm is selected as the optimizer, and the MSE is used as the loss function for the model prediction accuracy error.
[0027] Step 4-4) (Training the neural network): Use the training set to train the neural network, normalize the data set before training, train 3000 times, and use the test set to test the trained neural network, and save the trained network parameters and weights in the pth file.
[0028] Step 5) (Use beam search algorithm to obtain the shortest pass sequence): After obtaining the trained fully connected neural network, use the improved beam search algorithm to iteratively generate the reachable identification of the Petri net until it iterates to the target identification to find the optimal scheduling sequence that meets the objective function. The objective function is as follows.
[0029] F=min{max{C l}}
[0030] T max =max{C l}
[0031] Among them, C l is the time when the lth vehicle leaves the intersection, T max The maximum travel time for all vehicles to complete the journey.
[0032] As a preferred technical solution of the present invention, the step 4-3 builds a network structure. Through step 4-2, it is obtained that when the network hidden layer structure is six layers, the MSE is the smallest. The specific network structure is built as follows:
[0033] Step 4-3-1) (Input layer): The input layer has 81 nodes for receiving input data, and the output layer has 256 nodes. In order to introduce nonlinearity and promote fast training, ReLU is used as the activation function. In order to prevent the model from overfitting during training, 30% Dropout technology is applied, that is, some neurons are randomly discarded in each training iteration to improve the generalization ability of the model.
[0034] Step 4-3-2) (Second layer): The first hidden layer has 128 input nodes and 64 output nodes, which are processed by ReLU activation function. In order to prevent overfitting, 30% Dropout is applied to help the model better generalize to new data.
[0035] Step 4-3-3) (Third layer): The second hidden layer has 64 input nodes and 32 output nodes. ReLU is used as the activation function. In order to prevent overfitting, 30% Dropout is applied.
[0036] Step 4-3-4) (Fourth layer): The third hidden layer has 32 input nodes and 16 output nodes. ReLU is used as the activation function. In order to prevent overfitting, 30% Dropout is applied.
[0037] Step 4-3-5) (Fifth layer): The fourth hidden layer has 16 input nodes and 8 output nodes. ReLU is used as the activation function. In order to prevent overfitting, 30% Dropout is applied.
[0038] Step 4-3-6) (Sixth layer): The fifth hidden layer has 8 input nodes and 4 output nodes. It uses ReLU activation function. In order to prevent overfitting, 30% Dropout is applied.
[0039] Step 4-3-7) (Seventh layer): The sixth hidden layer has 4 input nodes and 2 output nodes. It uses ReLU activation function. In order to prevent overfitting, 30% Dropout is applied.
[0040] Step 4-3-8) (Output layer): The input node of the output layer is 2, the output node is 1, and the final output is the estimated remaining time h.
[0041] The selection scheme for input layer and hidden layer nodes is as follows:
[0042]
[0043] Among them, Init is the total number of initial input features, O is the number of output nodes of the input layer and also the number of input nodes of the first hidden layer, I[j+1] is the number of output nodes of the j+1th hidden layer and also the number of input nodes of the next layer.
[0044] Table 1 Fully connected neural network architecture
[0045] Number of layers Input Node Output Node 1 81 128 2 128 64 3 64 32 4 32 16 5 16 8 6 8 4 7 4 2 8 2 1
[0046] As a preferred technical solution of the present invention, in step 5, a clustering algorithm is used to obtain the optimal passage sequence, and the specific steps are as follows:
[0047] Step 5-1) (obtaining the final marking final_marking): Under the condition that the initial marking M0 is known, the transitions in Tran of any chromosome among the chromosomes with the highest fitness value obtained in step 3-3 are triggered in sequence to obtain the final final_marking.
[0048] Step 5-2) (Initialization): Initialize the node FATHER. The FATHER node contains the initial identifier, the processed time, the estimated remaining time, and the current safe transition set.
[0049] Step 5-3) (Obtain safe transition): Trigger the current flag to obtain the safe transition and store it in Safe_Trans.
[0050] Step 5-4) (Get new node SON): If Safe_Trans in step 5-3 is empty, sort the elements in SON by the sum of the second and third elements (i.e., by the sum of the processed time and the estimated remaining time), and select the first beam_width elements to FATHER, where beam_width is the width of the beam search algorithm. Otherwise, process SON. The specific steps are as follows:
[0051] Step 5-4-1): Trigger the i-th (i≥1) element in Safe_Trans, obtain a new marker new_marking, and store the Safe_Tran obtained after the new marker is triggered in Safe_Trans.
[0052] Step 5-4-2): Get the resources corresponding to the current transition Safe_Tran and calculate the time consumed by the current resources, which is the processed time g.
[0053] Step 5-4-3): Use the current new_marking and g as the input of the neural network, and obtain the estimated remaining time h through the neural network.
[0054] Step 5-4-4): Store the current new_marking, g, h, and Safe_Trans in SON, and determine whether the current new_marking is the same as final_marking. If they are the same, return FATHER, otherwise continue to execute steps 5-2 and 5-3.
[0055] Step 5-5) (Output the optimal scheduling sequence and its corresponding time): Through step 5-3, output FATHE, including the mark Mark of the previous beam_width bar and its corresponding processed time g, the estimated remaining time h, and the corresponding transitions.
[0056] Step 5-6) (Output the optimal scheduling sequence): The sum of the processed time g and the estimated remaining time h is the total time total_time. Output beam_width scheduling sequences with the smallest sum of g+h, which is the optimal scheduling sequence.
[0057] The method for obtaining the optimal scheduling sequence of intelligent connected vehicles based on deep learning described in the present invention adopts the above technical solution and has the following technical effects compared with the prior art:
[0058] (1) The present invention constructs a special fully connected neural network to predict the remaining time of vehicle travel sequences, which provides a solid data foundation and effective support for selecting the optimal vehicle scheduling sequence. At the same time, the fully connected neural network can predict the remaining time of vehicle travel in real time, thereby facilitating the rapid response of the traffic management system and formulating a more efficient and reasonable vehicle scheduling plan.
[0059] (2) The present invention adopts an optimized beam search algorithm, which accurately evaluates the travel time of each travel sequence and selects the best sequence with the optimal travel time through an iterative process.
[0060] (3) The present invention fully considers the algorithm operation efficiency and ensures extremely fast operation speed. Through this strategy, the search process of the scheduling sequence that meets specific conditions is accelerated, thereby greatly improving the overall traffic efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0061] Figure 1 This is a flow chart of a method for acquiring an optimal scheduling sequence for intelligent connected vehicles based on deep learning involved in the present invention.
[0062] Figure 2 The present invention relates to a Petri net model of a two-way four-lane intersection.
[0063] Figure 3 It is an iteration graph of the training error and test error curves in a specific example of the present invention.
[0064] Figure 4 It is a comparison chart of predicted time and actual time in a specific example of the present invention. DETAILED DESCRIPTION
[0065] In order to enable those skilled in the art to better understand the technical solutions in the embodiments of the present application, some symbols in the embodiments of the present application are first explained to facilitate understanding by those skilled in the art.
[0066] like Figure 1 As shown, the method for obtaining the optimal scheduling sequence of intelligent connected vehicles based on deep learning includes the following steps:
[0067] Step 1) (Modeling): Divide the right-of-way points and resource points at the unsignalized intersection and establish a Petri net model, such as Figure 2 shown.
[0068] Step 2) (Initialize the record table): careveryroad = [[11,12,13,14,15,16],[21,22,23,24,25],[31,32,33,34],[41,42,43,44,45],[51,52,53],
[61] ,[71,72,73,74],
[81] ], careveryspeed = [[15,10,13,8,15,17],[5,12,10,15,6],[7,14,15,8],[10,11,8,15,13],[5,9,6],[4],[6,7,14,11],
[10] ].
[0069] Step 3) (Generate neural network data set): Use genetic algorithm to perform global optimization and generate a set of scheduling sequences for the intelligent connected vehicle system. While searching for suboptimal solutions, it also builds a data set for subsequent neural network training. The specific steps are as follows:
[0070] Step 3-1) (Randomly generate the initial population): Since the encoding reflects the vehicle's passage sequence, according to the characteristics of the intelligent connected vehicle system and the genetic algorithm, the vehicle passage sequence is encoded and decoded, and a certain number of chromosomes are randomly generated to form the initial population. The specific steps are as follows:
[0071] Step 3-1-1): Number the vehicles that are about to arrive at the intersection area and generate the intersection vehicle traffic sequence according to the order in which each vehicle passes through each right-of-way point on its path. Specifically, there are 29 vehicles in the eight lanes of the two-way four-lane intersection area. The 29 vehicles are numbered according to the rules and shuffled to obtain the vehicle sequence L0: (14,44,71,31,11,51,15,43,52,32,16,21,13,45,23,25,72,24,53,33,81,12,74,34,73,22,61,41,42)
[0072] Step 3-1-2): Sort the vehicles from small to large, and then expand the sequence according to the number of transitions that each vehicle needs to pass. The expanded vehicle sequence is Car_sequence = (14,14,14,14,14,44,44,44,44,44,71,71,71,71,71,71,71,71,31,31,31,31,11,1 1,11,11,11,51,51,51,51,51,51,51,15,15,15,15,15,43,43,43,43,43,43,52,52,52,52,52,52,52,32,32,32,32,32,16,16,16,16,16,21,21,21,21,21,13,13,13,13, 13,45,45,45,45,45,23,23,23,23,23,25,25,25,25,25,72,72,72,72,72,72,72,24,24,24,24,53,53,53,53,53,53,53,33,33,33,33,81,81,81,81,81,81,81,81 ,12,12,12,12,12,74,74,74,74,74,74,74,34,34,34,34,73,73,73,73,73,73,73,22,22,22,22,22,61,61,61,61,61,61,61,41,41,41,41,42,42,42,42,42).
[0073] Step 3-1-3): Decode the extended vehicle traffic sequence Car_sequence into a transition sequence Tran = (t 11 ,t 12 ,t 13 ,t 14 ,t 15 ,t 41 ,t 42 ,t 43 ,t 44 ,t45 ,t 71 ,t 72 ,t 73 ,t 74 ,t 75 ,t 76 ,t 77 ,t 31 ,t 32 ,t 33 ,t 34 ,t 35 ,t 11 ,t 12 ,t 13 ,t 14 ,t 15 ,t 51 ,t 52 ,t 53 ,t 54 ,t 55 ,t 56 ,t 57 ,t 11 ,t 12 ,t 13 ,t 14 ,t 15 ,t 41 ,t 42 ,t 43 ,t 44 ,t 45 ,t 51 ,t 52 ,t 53 ,t 54 ,t 55 ,t 56 ,t 57 ,t 31 ,t 32 ,t 33 ,t 34 ,t 35 ,t 11 ,t 12 ,t 13 ,t 14 ,t 15 ,t 21 ,t 22 ,t 23 ,t 24 ,t 25 ,t 11 ,t 12 ,t 13 ,t 14 ,t 15 ,t 41 ,t 42 ,t 43 ,t 44 ,t 45,t 21 ,t 22 ,t 23 ,t 24 ,t 25 ,t 21 ,t 22 ,t 23 ,t 24 ,t 25 ,t 71 ,t 72 ,t 73 ,t 74, t 75 ,t 76 ,t 77 ,t 21 ,t 22 ,t 23 ,t 24 ,t 25 ,t 51 ,t 52 ,t 53 ,t 54 ,t 55 ,t 56 ,t 57 ,t 31 ,t 32 ,t 33 ,t 34 ,t 35 ,t 81 ,t 82 ,t 83 ,t 84 ,t 85 ,t 86 ,t 87 ,t 11 ,t 12 ,t 13 ,t 14 ,t 15 ,t 71 ,t 72 ,t 73 ,t 74 ,t 75 ,t 76 ,t 77 ,t 31 ,t 32 ,t 33 ,t 34 ,t 35 ,t 71 ,t 72 ,t 73 ,t 74 ,t 75 ,t 76 ,t 77 ,t 21 ,t22 ,t 23 ,t 24 ,t 25 ,t 61 ,t 62 ,t 63 ,t 64 ,t 65 ,t 66 ,t 67 ,t 41 ,t 42 ,t 43 ,t 44 ,t 45 ,t 41 ,t 42 ,t 43 ,t 44 ,t 45 ).
[0074] Step 3-2) (Detection and repair): Use the one-step look-ahead method to detect whether a deadlock occurs to ensure that the system is safe and free of deadlock. The specific process is as follows: Obtain the transition sequence Tran through step 3-1-3. 0= (6,0,0,0,0,0,5,0,0,0,0,0,4,0,0,0,0,0,5,0,0,0,0,0,3,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1), starting from i=1, detect transition t 11 :If t 11 Reduced library place 10 If the condition is met in M0, then t 11 Enabled and safe (does not cause deadlock). Execute t 11 Then, update the current identifier to M1 == (5,1,0,0,0,0,5,0,0,0,0,0,4,0,0,0,0,0,5,0,0,0,0,0,3,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1), and increment i. After testing, there is no deadlock in this example.
[0075] Step 3-3) (Output the optimal individual in the population): Calculate the maximum transit time ma kespan and its fitness value of each chromosome in the population corresponding to the transit sequence, and output the chromosome with the highest fitness value in the population PopChrom = [[21,11,11,31,31,21,21,21,21,11,11,11,71,71,51,41,41,42,71,71,71,51,52,12,72,22,32,41,42,43,12, 41,61,41,13,22,22,72,12,12,12,13,13,13,13,72,72,51,51,51,51,51,52,31,32,22,22,33,23,73,14,14,73,14,73,15,23,14,14,74,23,24,61,42,71,7 1,52,52,52,52,52,15,16,74,15,72,72,72,73,74,73,74,73,74,73,74,73,74,74,43,16,42,42,43,43,43,24,25,31,31,44,32,33,23,23,61,61,61,44,32,32,44 ,44,44,53,53,33,24,24,24,61,61,81,81,81,81,81,45,45,33,33,45,45,45 ,34,34,25,15,15,16,81,81,25,25,25,34,34,34,53,53,53,53,53,16,16],[t 21 ,t 11 ,t 12 ,t 31 ,t 32 ,t 22 ,t 23 ,t 24 ,t 25 ,t 13 ,t 14 ,t 15 ,t 71 ,t 72 ,t 51 ,t 41 ,t 42 ,t 41 ,t 73 ,t 74 ,t 75 ,t 52 ,t 51 ,t 11 ,t 71 ,t 21 ,t 31 ,t 43 ,t42 ,t 41 ,t 12 ,t 44 ,t 61 ,t 45 ,t 11 ,t 22 ,t 23 ,t 72 ,t 13 ,t 14 ,t 15 ,t 12 ,t 13 ,t 14 ,t 15 ,t 73 ,t 74 ,t 53 ,t 54 ,t 55 ,t 56 ,t 57 ,t 52 ,t 33 ,t 32 ,t 24 ,t 25 ,t 31 ,t 21 ,t 71 ,t 11 ,t 12 ,t 72 ,t 13 ,t 73 ,t 11 ,t 22 ,t 14 ,t 15 ,t 71 ,t 23 ,t 21 ,t 62 ,t 43 ,t 76 ,t 77 ,t 53 ,t 54 ,t 55 ,t 56 ,t 57 ,t 12 ,t 11 ,t 72 ,t 13 ,t 75 ,t 76 ,t 77 ,t 74 ,t 73 ,t 75 ,t 74 ,t 76 ,t 75 ,t 77,t 76 ,t 77 ,t 42 ,t 12 ,t 44 ,t 45 ,t 43 ,t 44 ,t 45 ,t 22 ,t 21 ,t 34 ,t 35 ,t 41 ,t 33 ,t 32 ,t 24 ,t 25 ,t 63 ,t 64 ,t 65 ,t 42 ,t 34 ,t 35 ,t 43 ,t 44 ,t 45 ,t 51 ,t 52 ,t 33 ,t 23 ,t 24 ,t 25 ,t 66 ,t 67 ,t 81 ,t 82 ,t 83 ,t 84 ,t 85 ,t 41 ,t 42 ,t 34 ,t 35 ,t 43 ,t 44 ,t 45 ,t 31 ,t 32 ,t 22 ,t 14 ,t 15 ,t 13 ,t 86 ,t 87 ,t 23 ,t 24 ,t 25 ,t 33 ,t 34 ,t 35 ,t 53 ,t 54 ,t 55 ,t 56 ,t 57 ,t14 ,t 15 ],18.775324675324676]] and its make espan=18.775324675324676.
[0076] Step 3-4): Determine whether the termination condition Gen>maxGen is met, where Gen is the number of iterations of the current population and maxGen is the maximum number of iterations; if the termination condition is met, the optimal individual is output, otherwise the genetic operation is performed;
[0077] Step 3-5) (Genetic Operation): Perform the three operations of selection, crossover and mutation on the current population to obtain a new generation of population, and execute steps 3-3 and 3-4.
[0078] Step 4) (Obtain neural network weights and parameters): Build a fully connected neural network, determine the network structure, set relevant parameters, train the fully connected neural network with the data set obtained by the genetic algorithm in step 3-3, and test its training completion. Save the trained network weights and parameters in a pth file for subsequent predictions. The specific steps are as follows.
[0079] Step 4-1): Obtain 39 chromosomes with the highest fitness values through step 3-3, process each chromosome to obtain the corresponding identifier M and processed time g as the input set of the neural network, and the output set is the current remaining time, remaining time = total time - completion time of current resources. For an input set like [5,0,1,0,0,0,4,1,0,0,0,0,4,0,0,0,0,0,5,0,0,0,0,0,3,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,1,1,1,1,1,0,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1.6], the output set is 17.175324675324674.
[0080] Step 4-2): All input sets are stored in the input.txt file, and the corresponding output sets are stored in the out.txt file. The data in input.txt and out.txt are referenced, and the input and output data are standardized. Specifically, the feature data and target data are converted to a standard normal distribution with a mean of 0 and a standard deviation of 1.
[0081] Step 4-3): After the data is standardized, the feature data is divided into a training set and a test set at 80% and 20%. Subsequently, the constructed neural network model is iterated for 3000 rounds using this training set, and the training loss is saved in train_lossess. During the training process, the Adam optimizer is used to accelerate the learning process and optimize the model parameters. After the training is completed, the weights and parameters of the neural network are saved in a pth file, and the test set is evaluated using the trained neural network model. The test loss is saved in test_lossess, and the predicted time of the model is compared with the actual time. Figure 3 Iteration graph of training error and test error curves and comparison graph of predicted time and actual time.
[0082] Step 4-4): Evaluate the generalization of the neural network. Given the input data set input_data = [6,0,0,0,0,0,4,1,0,0,0,0,4,0,0,0,0,0,5,0,0,0,0,0,3,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1.6], use the neural network to predict the remaining time and get 12.6851s. The actual time is 12.7820s. By comparing the test results with the actual time through multiple attempts, we can observe that the two are very close, which demonstrates the powerful generalization ability of the neural network model when processing data.
[0083] Step 5) (Use the beam search algorithm to obtain the shortest pass sequence): After obtaining the trained fully connected neural network, use the improved beam search algorithm to iteratively generate the reachable identification of the Petri net until it iterates to the target identification and finds the shortest path that satisfies the objective function.
[0084] Step 5-1): In order to obtain the target identifier, given the initial identifier M 0= Under the condition of (6,0,0,0,0,0,5,0,0,0,0,0,4,0,0,0,0,0,5,0,0,0,0,0,3,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1), step 3-3 is initiated in sequence to obtain the Tran of any chromosome among the chromosomes with the highest fitness value, for example, Tran=(t 21 ,t11 ,t 12 ,t 31 ,t 32 ,t 22 ,t 23 ,t 24 ,t 25 ,t 13 ,t 14 ,t 15 ,t 71 ,t 72 ,t 51 ,t 41 ,t 42 ,t 41 ,t 73 ,t 74 ,t 75 ,t 52 ,t 51 ,t 11 ,t 71 ,t 21 ,t 31 ,t 43 ,t 42 ,t 41 ,t 12 ,t 44 ,t 61 ,t 45 ,t 11 ,t 22 ,t 23 ,t 72 ,t 13 ,t 14 ,t 15 ,t 12 ,t 13 ,t 14 ,t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1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],0,inf,[]]]
[0086] Step 5-3) triggers the current flag to obtain the safety transition and stores it in Safe_Trans = (t 11 ,t 21 ,t 31 ,t 41 ,t 51 ,t 61 ,t 71 ,t81 ).
[0087] Step 5-4) (Get new node SON): If Safe_Trans in step 5-2 is empty, sort the elements in SON by the sum of the second and third elements (i.e., by the sum of the processed time and the estimated remaining time), and select the first beam_width elements to FATHER, where beam_width is the width of the beam search algorithm. Otherwise, process SON. The specific steps are as follows:
[0088] Step 5-4-1): Trigger the i-th (i≥1) element in Safe_Trans, obtain the new marking new_marking=(5,1,0,0,0,0,5,0,0,0,0,0,4,0,0,0,0,0,5,0,0,0,0,0,3,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1), and convert the new marking into Safe_Tran=(t 11 ,t 21 ,t 31 ,t 41 ,t 51 ,t 61 ,t 71 ,t 81 ), stored in Safe_Trans, Safe_Trans = (t 11 ,t 21 ,t 31 ,t 41 ,t 51 ,t 61 ,t 71 ,t 81 ,t 12 ,t 21 ,t 31 ,t 41 ,t 51 ,t 61 ,t 71 ,t 81 ).
[0089] Step 5-4-2): Get the resources corresponding to the current transition Safe_Tran, and calculate the time consumed by the current resources, which is the processed time g=0.5333.
[0090] Step 5-4-3): Use the current new_marking and g as the input of the neural network, and obtain the estimated remaining time h=13.29697 through the neural network.
[0091] Step 5-4-4): Store the current new_marking, g, h, and Safe_Trans in SON, and determine whether the current new_marking is the same as final_marking. If they are the same, return FATHER, otherwise continue to execute steps 5-2 and 5-3.
[0092] Step 5-5) (Output the optimal scheduling sequence and its corresponding time): Through step 5-3, output FATHE = [[[0,0,0,0,0,6,0,0,0,0,0,5,0,0,0,0,0,4,0,0,0,0,0,0,5,0,0,0,0,0,0,3,0,0,0,0,0,0,0,1,0,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 ,t 45 ,t 11 ,t 75 ,t 63 ,t 76 ,t 77 ,t 23 ,t 22 ,t 21 ,t 32 ,t 24 ,t 23 ,t 25 ,t 22 ,t 14 ,t 24 ,t 13 ,t 12 ,t 25 ,t 15 ,t 14 ,t 13 ,t 33 ,t 15 ,t 14 ,t 15 ,t 23 ,t 56 ,t 34 ,t55 ,t 57 ,t 56 ,t 57 ,t 35 ,t 54 ,t 64 ,t 24 ,t 55 ,t 65 ,t 25 ,t 74 ,t 75 ,t 76 ,t 77 ,t 56 ,t 66 ,t 57 ]]].
[0093] Step 5-6) (Output the optimal scheduling sequence): Output the sequence with the smallest sum of beam_width scheduling sequences g+h, which is the shortest scheduling sequence = [[0,0,0,0,0,6,0,0,0,0,0,5,0,0,0,0,0,4,0,0,0,0,0,5,0,0,0,0,0,0,3,0,0,0,0,0,0,1,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,0,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],15.085225885225885,1.1493342,,[t 81 ,t 41 ,t 31 ,t 82 ,t 71 ,t 42 ,t 41 ,t 61 ,t 72 ,t 32 ,t 71 ,t 73 ,t 31 ,t 11 ,t 83 ,t 21 ,t 22 ,t 21 ,t 72 ,t 71 ,t 62 ,t 12 ,t 51 ,t 43 ,t 42 ,t 41 ,t 11 ,t 52 ,t 51 ,t 53 ,t74 ,t 73 ,t 72 ,t 13 ,t 12 ,t 44 ,t 75 ,t 45 ,t 11 ,t 74 ,t 73 ,t 43 ,t 42 ,t 41 ,t 52 ,t 51 ,t 23 ,t 22 ,t 14 ,t 71 ,t 72 ,t 15 ,t 21 ,t 13 ,t 12 ,t 44 ,t 43 ,t 42 ,t 45 ,t 41 ,t 44 ,t 43 ,t 76 ,t 45 ,t 77 ,t 42 ,t 11 ,t 75 ,t 74 ,t 84 ,t 54 ,t 85 ,t 73 ,t 53 ,t 52 ,t 33 ,t 32 ,t 24 ,t 23 ,t 22 ,t 25 ,t 31 ,t 14 ,t 15 ,t 55 ,t 54 ,t 53 ,t 13 ,t 14 ,t 86 ,t 15 ,t 21 ,t 34 ,t 33 ,t 32 ,t 35 ,t 34,t 87 ,t 12 ,t 44 ,t 43 ,t 45 ,t 11 ,t 24 ,t 25 ,t 76 ,t 31 ,t 35 ,t 77 ,t 33 ,t 34 ,t 35 ,t 13 ,t 12 ,t 44 ,t 45 ,t 11 ,t 75 ,t 63 ,t 76 ,t 77 ,t 23 ,t 22 ,t 21 ,t 32 ,t 24 ,t 23 ,t 25 ,t 22 ,t 14 ,t 24 ,t 13 ,t 12 ,t 25 ,t 15 ,t 14 ,t 13 ,t 33 ,t 15 ,t 14 ,t 15 ,t 23 ,t 56 ,t 34 ,t 55 ,t 57 ,t 56 ,t 57 ,t 35 ,t 54 ,t 64 ,t 24 ,t 55 ,t 65 ,t 25 ,t 74 ,t 75 ,t 76 ,t 77 ,t 56 ,t 66 ,t 57 ]]。
[0094] Through the verification of actual cases, this method successfully planned the best scheduling sequence for intelligent connected vehicles, ensuring that vehicles can pass through intersections safely and efficiently, and effectively avoiding the risk of deadlock. This scheduling strategy not only speeds up the process of vehicles passing through intersections, but also significantly shortens the waiting time, providing strong support for alleviating urban traffic congestion.
[0095] The specific implementation scheme described above further describes in detail the purpose, technical scheme and beneficial effects of the present invention. It should be understood that the above is only a specific implementation scheme of the present invention and is not intended to limit the scope of the present invention. Any equivalent changes and modifications made by any technician in the field without departing from the concept and principle of the present invention should fall within the scope of protection of the present invention.
Claims
1. A method for obtaining the optimal scheduling sequence of intelligent connected vehicles based on deep learning, characterized in that: The following steps are involved: Step S1, modeling: according to the spatial resource allocation inside the intersection and the dynamic occupation of these resources by vehicles in the process of continuous crossing of the intersection, a Petri net model (P, T, F, M0) of the unsignalized intersection system is constructed, where P is a finite place set; T is a finite transition set; F = (P × T) ∪ (T × P) is a directed arc set; M0 is an initial identification set; Step S2, initializing the record table: obtaining vehicle information in the unsignalized intersection area, including the number of vehicles, speed, and lane number; Step S3, generating a neural network data set: using a genetic algorithm to perform global optimization and generate a set of scheduling sequences for the intelligent connected vehicle system; while searching for suboptimal solutions, a data set is also constructed for subsequent neural network training. The specific steps are as follows: Step S3-1, randomly generate the initial population: Since the encoding reflects the vehicle's passage sequence, according to the characteristics of the intelligent connected vehicle system and the genetic algorithm, the vehicle passage sequence is encoded and decoded, and a certain number of chromosomes are randomly generated to form the initial population. The specific steps are as follows: Step 3-1-1, the vehicle number is an integer AB, where A represents the vehicle's driving path and B represents the vehicle's driving priority; Step 3-1-2, sort the vehicles from small to large, and then expand the sequence according to the number of transitions that each vehicle needs to pass, and the expanded vehicle sequence is Car_sequence; Step 3-1-3, decoding the expanded vehicle traffic sequence Car_sequence into a transition sequence Tran; Step 3-1-4: Through encoding and decoding, a certain number of chromosomes are randomly generated to form an initial population; Step S3-2, detection and repair: The transition sequence obtained by decoding in step S3-1 is not necessarily a feasible pass sequence, and deadlock detection and repair are required for it; using the deadlock avoidance algorithm, the transition sequence of each chromosome is detected and repaired to ensure that each transition in the transition sequence can be triggered in sequence; Step S3-3, output the optimal individual in the population: calculate the maximum transit time makespan and its fitness value of each chromosome in the population corresponding to the transit sequence, and output the chromosome with the highest fitness value in the population and its makespan. The fitness value calculation formula is as follows: Where w(t) is the inertia weight value in the Gen-th iteration; maxGen is the maximum number of iterations; p(t) is the fitness update rate of the population individuals; update(Gen) is the number of fitness improvements of the population individuals in the Gen-th iteration; Adapt[i] is the fitness value after the Gen-th update, Adapt[i-1] is the fitness value after the Gen-th update, i is a random number between [0,1], Adapt best is the optimal fitness value, ND is a random integer between [1,2], Adapt mean is the mean chromosome fitness; Step S3-4, determine whether the termination condition Gen>maxGen is met, where Gen is the number of iterations of the current population and maxGen is the maximum number of iterations; if the termination condition is met, the optimal individual is output; if not, the genetic operation is performed; Step S3-5, genetic operation: perform the three operations of selection, crossover and mutation on the current population to obtain a new generation of population, and execute steps S3-3 and S3-4; Step S3-6, obtaining a neural network data set: calculating the identifier M corresponding to each generation of the optimal transition sequence, the corresponding processed time g, and the estimated remaining time h as the data set, wherein the estimated remaining time h is obtained by subtracting the processed time g from the makespan, and selecting the training set and the test set at a ratio of 8:2; Step S4, obtain neural network weights and parameters: build a fully connected neural network, determine the network structure, set relevant parameters, train the fully connected neural network with the data set obtained by the genetic algorithm in step S3, and test its training completion, save the trained network weights and parameters in a pth file for subsequent predictions, the specific steps are as follows: Step S4-1, determine the number of neurons in the input and output layers: the number of neurons in the input layer of the neural network is the total number of Petri net places plus 1, the input is the number of tokens in each Petri net place and the processed time g, the number of neurons in the output layer is 1, and the output is the estimated remaining time h; Step S4-2, determine the number of hidden layers, Dropout layers and the number of neurons in each layer: In order to find the appropriate number of hidden layers, the hidden layers are constructed incrementally from one to ten layers, and the Dropout layer is introduced in each hidden layer configuration. The neural networks with different numbers of hidden layers are trained with the same data set, and the connection between neurons is reduced by a fixed formula to prevent overfitting and improve the generalization ability of the model; through comparative analysis, the number of hidden layers and the corresponding Dropout layer configuration with the minimum MSE are obtained; Step S4-3, building a network structure: after successfully obtaining the input dimension, expected output, and predetermined number of network layers of the neural network, a specific network structure is constructed in the Sequential() model, and each layer is defined in sequence, including the input layer, multiple hidden layers, the Dropout layer interspersed therein, and the final output layer. The activation function selects the ReLU function, the optimizer selects the Adam algorithm, and the MSE is used as the loss function for the model prediction accuracy error; Step S4-4, training the neural network: use the training set to train the neural network, normalize the data set before training, train 3000 times, and use the test set to test the trained neural network, and save the trained network parameters and weights in the pth file; Step S5, using a beam search algorithm to obtain the shortest pass sequence: After obtaining the trained fully connected neural network, an improved beam search algorithm is used to iteratively generate the reachable identifier of the Petri net until it iterates to the target identifier to find the optimal scheduling sequence that satisfies the objective function. The objective function is as follows: F=min{max{C l }} T max =max{C l } Among them, C l is the time when the lth vehicle leaves the intersection, and Tmax is the maximum time for all vehicles to pass through.
2. The method for acquiring the optimal scheduling sequence of intelligent connected vehicles based on deep learning according to claim 1 is characterized in that: In step S4-3, a network structure is constructed. Through step S4-2, it is obtained that when the network hidden layer structure is six layers, the MSE is the smallest. The specific network structure is constructed as follows: Step S4-3-1, input layer: The input layer has 81 nodes for receiving input data, and the output layer has 256 nodes. In order to introduce nonlinearity and promote fast training, ReLU is used as the activation function. In order to prevent the model from overfitting during training, 30% Dropout technology is applied, that is, some neurons are randomly discarded in each training iteration to improve the generalization ability of the model; Step S4-3-2, second layer: The first hidden layer has 128 input nodes and 64 output nodes, which are processed by ReLU activation function. In order to prevent overfitting, 30% Dropout is applied to help the model better generalize to new data; Step S4-3-3, third layer: The second hidden layer has 64 input nodes and 32 output nodes. ReLU is used as the activation function. In order to prevent overfitting, 30% Dropout is applied. Step S4-3-4, the fourth layer: The third hidden layer has 32 input nodes and 16 output nodes. ReLU is used as the activation function. In order to prevent overfitting, 30% Dropout is applied. Step S4-3-5, fifth layer: The fourth hidden layer has 16 input nodes and 8 output nodes. ReLU is used as the activation function. In order to prevent overfitting, 30% Dropout is applied. Step S4-3-6, sixth layer: The fifth hidden layer has 8 input nodes and 4 output nodes, and uses ReLU activation function. In order to prevent overfitting, 30% Dropout is applied; Step S4-3-7, seventh layer: The sixth hidden layer has 4 input nodes and 2 output nodes. It uses ReLU activation function. In order to prevent overfitting, 30% Dropout is applied. Step S4-3-8, output layer: the input node of the output layer is 2, the output node is 1, and the final output is the estimated remaining time h; The selection scheme for input layer and hidden layer nodes is as follows: Among them, Init is the total number of initial input features, O is the number of output nodes of the input layer and also the number of input nodes of the first hidden layer, I[j+1] is the number of output nodes of the j+1th hidden layer and also the number of input nodes of the next layer.
3. The method for acquiring the optimal scheduling sequence of intelligent connected vehicles based on deep learning according to claim 2 is characterized in that: In step S5, a clustering algorithm is used to obtain the optimal passage sequence. The specific steps are as follows: Step S5-1, obtaining the final marking final_marking: Under the condition that the initial marking M0 is known, the transitions in Tran of any chromosome among the chromosomes with the highest fitness value obtained in step S3-3 are triggered in sequence to obtain the final final_marking; Step S5-2, initialization: Initialize the node FATHER, which contains the initial identification, the processed time, the estimated remaining time, and the current safe transition set; Step S5-3, obtaining a safe transition: triggering the current flag to obtain a safe transition and storing it in Safe_Trans; Step S5-4, obtain a new node SON: If Safe_Trans in step S5-3 is empty, sort the elements in SON by the sum of the second and third elements, that is, by the sum of the processed time and the estimated remaining time, and select the first beam_width element to FATHER, where beam_width is the width of the beam search algorithm; otherwise, process SON, and the specific steps are as follows: Step S5-4-1, trigger the i-th element in Safe_Trans, i≥1, obtain a new mark new_marking, and store the Safe_Tran obtained after the new mark is triggered in Safe_Trans; Step S5-4-2, obtain the resources corresponding to the current transition Safe_Tran, and calculate the time of consuming the current resources, which is the processed time g; Step S5-4-3, using the current new_marking and g as inputs of the neural network, and obtaining the estimated remaining time h through the neural network; Step S5-4-4, store the current new_marking, g, h, Safe_Trans in SON, and determine whether the current new_marking is the same as final_marking. If they are the same, return to FATHER, otherwise continue to execute steps S5-2 and S5-3; Step S5-5, output the optimal scheduling sequence and its corresponding time: through step S5-3, output FATHER, including the identifier M of the previous beam_width bar and its corresponding processed time g, the estimated remaining time h, and the corresponding transition; Step S5-6, output the optimal scheduling sequence: the sum of the processed time g and the estimated remaining time h is the total time total_time, and the sequence with the smallest sum of beam_width scheduling sequences g+h is the optimal scheduling sequence.
Citation Information
Patent Citations
Deadlock-free scheduling method of flexible manufacturing system based on Petri network and neural network
CN117314078A
Deadlock-free scheduling method for flexible manufacturing system containing central resources based on deep learning
CN117852825A