CN-117253358-B - Microscopic traffic simulation method and device based on GPU
Abstract
The invention provides a microscopic traffic simulation method and device based on a Graphic Processing Unit (GPU), which are used for each round of simulation iteration executed in the GPU, and comprise the steps of constructing a main chain-branched chain list of each lane of an urban road network, generating a vehicle index of each vehicle of the urban road network based on the main chain-branched chain list, simulating traffic operation of each vehicle according to the vehicle index of each vehicle of the urban road network and a path plan of each vehicle of the urban road network acquired from outside, wherein the vehicle index of each vehicle is used for indexing lanes to which each vehicle belongs and surrounding vehicles of each vehicle, and the path plan of each vehicle is used for driving navigation from a given starting point to a given terminal point of each vehicle. The GPU is adaptively used in microscopic traffic simulation, so that the GPU bears massive calculation force required by fine-grained microscopic traffic simulation at the urban level, and the efficiency of microscopic traffic simulation is greatly improved.
Inventors
- LI YONG
- ZHANG JUN
- YAN HUAN
Assignees
- 清华大学
Dates
- Publication Date
- 20260505
- Application Date
- 20230831
Claims (7)
- 1. A GPU-based microscopic traffic simulation method for each round of simulation iteration performed in a GPU, the method comprising: constructing a main chain-branched chain list of each lane of the urban road network; the construction of the main chain-branched chain list of each lane of the urban road network comprises the following steps: Enabling one thread in the GPU to be responsible for a main chain-branched chain list construction task of one lane in the urban road network, and generating a main chain-branched chain list of each lane of the urban road network in a GPU multithread parallel execution mode; wherein, the process of executing the main chain-branched chain list construction task of any lane of the urban road network by any thread of the GPU comprises the following steps: writing the initial information of any lane and a main chain-branched chain list construction algorithm code into a programming framework of any thread so that the any thread generates a main chain-branched chain list of any lane; The initial information of any lane comprises a main chain, a vehicle leaving list and a vehicle joining list of any lane in the last round of simulation iteration; the main chain-branched chain list construction algorithm comprises the following steps: Inputting a main chain of a target lane, a vehicle leaving list and a vehicle adding list in the previous round of simulation iteration; Recording a vehicle node shared by a main chain of the target lane and a vehicle leaving list during a previous round of simulation iteration, and deleting the vehicle node in the main chain of the target lane during the previous round of simulation iteration to obtain a first linked list; The method comprises the steps that vehicle position ordering is conducted on a vehicle adding list of a target lane in the last round of simulation iteration, and an ordered chain corresponding to the ordered sequence of the vehicles is marked as a second linked list; generating a main chain of the target lane in the simulation iteration of the round based on the first linked list and the second linked list; Establishing a link between each vehicle in the target lane and the nearest front vehicle and rear vehicle on each adjacent lane of the target lane according to the main chain of the target lane and each adjacent lane during the simulation iteration of the present wheel so as to generate a branched chain of the target lane during the simulation iteration of the present wheel; based on the main chain and the branched chain of the target lane in the simulation iteration of the round, forming a main chain-branched chain list of the target lane in the simulation iteration of the round; generating a vehicle index of each vehicle of the urban road network based on the main chain-branched chain list; Simulating traffic operation of each vehicle according to the vehicle index of each vehicle of the urban road network and the path planning of each vehicle of the urban road network acquired from the outside; the simulation of traffic operation of each vehicle according to the vehicle index of each vehicle of the urban road network and the path plan of each vehicle of the urban road network acquired from the outside comprises: Enabling one thread in the GPU to be responsible for a traffic operation simulation task of one vehicle in the urban road network, and simulating traffic operation of each vehicle in a GPU multithread parallel execution mode; wherein, the process of traffic operation of any vehicle of the urban road network is simulated by any thread of the GPU, which comprises the following steps: writing simulation algorithm codes for simulating traffic operation of the target vehicle based on a preset driving strategy, a vehicle index of the target vehicle and a path planning of the target vehicle into a programming frame of any thread, so that the any thread simulates traffic operation of any vehicle based on the simulation algorithm, the path planning of any vehicle and an access result of the vehicle index of any vehicle; the main chain in the main chain-branched chain list of each lane is used for describing the vehicles on each lane and the position relation between the vehicles on each lane, and the branched chain is used for describing the position relation between each lane and the vehicles on the adjacent lanes; a vehicle index for each of the vehicles for indexing lanes to which each of the vehicles belongs and surrounding vehicles of each of the vehicles; Each of the vehicles is routed for driving navigation from a given start point to a given end point.
- 2. The GPU-based microscopic traffic simulation method of claim 1, wherein the generating the backbone of the target lane at the present round of simulation iteration based on the first linked list and the second linked list comprises: orderly combining the first linked list and the second linked list to obtain a main chain of the target lane in the simulation iteration of the round; Or alternatively And reordering the first linked list, and orderly combining the reordered first linked list and the reordered second linked list to obtain the main chain of the target lane in the simulation iteration of the round.
- 3. The GPU-based microscopic traffic simulation method of claim 1, wherein the preset driving strategy comprises the following sub-strategies: the first sub-strategy is to determine whether the lane change is overtaking or not and execute lane change operation when the lane change is not overtaking based on the relative relation of the position and speed between the target vehicle and the nearest front vehicle and rear vehicle on the first lane when the path planning of the target vehicle indicates that the target vehicle needs to change the lane to the first lane; The target vehicle reaches the highest speed limit of the lane where the target vehicle is located as far as possible; Calculating the acceleration of the target vehicle by using a following model based on the relative relation of the position and the speed of the target vehicle and the front and rear vehicles; according to the speed limit of the next lane which the target vehicle will enter and indicated in the path planning of the target vehicle, the vehicle speed is reduced and slowly moved in time; And a fifth sub-strategy for timely decelerating and slowing according to the distance from the target vehicle to the end point indicated in the path planning of the target vehicle.
- 4. The GPU-based microscopic traffic simulation method according to claim 1, wherein the generation process of the path plan of each vehicle of the urban road network comprises: modeling lanes in the urban road network as edges, modeling intersections as points, modeling lane transit time as the cost of the edges, and modeling a preset value corresponding to intersection turning as the cost of the points to generate a weighted directed graph of the urban road network; taking a path with the minimum cost from a given starting point to a given end point of each vehicle of the urban road network as an optimal path of each vehicle of the urban road network; Marking key auxiliary information on the optimal path to obtain a path plan of each vehicle of the urban road network; The key auxiliary information comprises driving behavior, lane speed limit and distance from a vehicle to a given destination; the driving behavior comprises lane changing and straight running.
- 5. A GPU-based microscopic traffic simulation apparatus for each round of simulation iterations performed in a GPU, the apparatus comprising: The chain table construction module is used for constructing a main chain-branched chain table of each lane of the urban road network; the method comprises the steps of enabling one thread in a GPU to be responsible for a main chain-branched chain list construction task of one lane in the urban road network, generating a main chain-branched chain list of each lane of the urban road network in a GPU multi-thread parallel execution mode, wherein the process of executing the main chain-branched chain list construction task of any lane of the urban road network by any thread of the GPU comprises the steps of writing initial information of any lane and main chain-branched chain list construction algorithm codes into a programming frame of any thread, enabling any thread to generate a main chain-branched chain list of any lane, enabling any lane initial information to comprise a main chain of any lane, a vehicle leaving list and a vehicle joining list when a simulation iteration is carried out, recording a vehicle node shared by the main chain and the vehicle leaving list of the target when the simulation iteration is carried out, deleting the initial information of any lane and the main chain list of the target when the simulation iteration is carried out, enabling any lane initial information of any thread to comprise the main chain of any lane, the vehicle leaving list and the vehicle joining list when the simulation iteration is carried out on the first lane, enabling the initial information of any lane to comprise the main chain of any lane when the simulation iteration is carried out on the first lane, enabling the target chain list and the vehicle entering the target chain list when the simulation iteration is carried out on the first lane and the first lane, and the vehicle joining list when the target chain is carried out on the first lane and the first lane is carried out on the first iteration, and the first lane is based on the first iteration and the first lane and the first iteration, establishing a link between each vehicle in the target lane and the nearest preceding vehicle and the nearest following vehicle on each adjacent lane of the target lane so as to generate a branched chain of the target lane during the simulation iteration of the present wheel; the vehicle index construction module is used for generating a vehicle index of each vehicle of the urban road network based on the main chain-branched chain list; The vehicle traffic simulation module is used for simulating the traffic operation of each vehicle according to the vehicle index of each vehicle in the urban road network and the path planning of each vehicle in the urban road network acquired from the outside, and comprises a process of enabling one thread in the GPU to be responsible for the traffic operation simulation task of one vehicle in the urban road network and simulating the traffic operation of each vehicle in a multi-thread parallel execution mode, wherein the process of simulating the traffic operation of any vehicle in the urban road network by any thread of the GPU comprises writing simulation algorithm codes for simulating the traffic operation of a target vehicle based on a preset driving strategy, the vehicle index of the target vehicle and the path planning of the target vehicle into a programming frame of any thread, so that any thread simulates the traffic operation of any vehicle based on the simulation algorithm, the path planning of any vehicle and the access result of the vehicle index of any vehicle; the main chain in the main chain-branched chain list of each lane is used for describing the vehicles on each lane and the position relation between the vehicles on each lane, and the branched chain is used for describing the position relation between each lane and the vehicles on the adjacent lanes; a vehicle index for each of the vehicles for indexing lanes to which each of the vehicles belongs and surrounding vehicles of each of the vehicles; Each of the vehicles is routed for driving navigation from a given start point to a given end point.
- 6. An electronic device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein the processor implements the GPU-based microscopic traffic simulation method of any of claims 1 to 4 when the program is executed.
- 7. A non-transitory computer readable storage medium having stored thereon a computer program, which when executed by a processor implements the GPU-based microscopic traffic simulation method according to any of claims 1 to 4.
Description
Microscopic traffic simulation method and device based on GPU Technical Field The invention relates to the technical field of traffic simulation, in particular to a microscopic traffic simulation method and device based on a Graphic Processing Unit (GPU). Background The microscopic traffic simulation is a process of simulating the driving behaviors of vehicles on the urban road network and the association relations and the mutual influences among a plurality of vehicles, and the microscopic and macroscopic traffic running situation of the city can be obtained through the microscopic traffic simulation, so that a decision maker is helped to select a better urban road network planning scheme or calculate the urban traffic bearing capacity. Therefore, microscopic traffic simulation is of great importance for urban construction. For microscopic traffic simulation at the urban level, the method has the characteristic of consuming a large amount of calculation force, and high requirements are put on the computing equipment and the computing model selected for the microscopic traffic simulation. However, the current micro traffic simulation basically adopts a single-thread or multi-thread mode to calculate, such as SUMO [1], cityFlow [2], qarSUMO [3], and the like, and the situation that the CPU of a single computer is difficult to support fine-grained micro traffic simulation at the urban level exists, which restricts the real value of the micro traffic simulation, so that the downstream decision optimization task cannot be efficiently developed. In recent years, the powerful features of the GPU enable GPU computing acceleration to achieve breakthrough results in many fields, particularly in the field of deep learning. Therefore, the application of the GPU in the microscopic traffic simulation is an effective means for supporting the fine-grained microscopic traffic simulation at the urban level, so how to design the GPU-based microscopic traffic simulation method is a problem to be solved urgently. Disclosure of Invention In order to solve the problems, the invention provides a microscopic traffic simulation method and device based on a GPU, which adaptively uses the GPU in microscopic traffic simulation so that the GPU bears massive calculation force required by fine-grained microscopic traffic simulation at the urban level, thereby greatly improving the efficiency of microscopic traffic simulation. In a first aspect, the present invention provides a GPU-based microscopic traffic simulation method for each round of simulation iteration performed in a GPU, the method comprising: constructing a main chain-branched chain list of each lane of the urban road network; generating a vehicle index of each vehicle of the urban road network based on the main chain-branched chain list; Simulating traffic operation of each vehicle according to the vehicle index of each vehicle of the urban road network and the path planning of each vehicle of the urban road network acquired from the outside; the main chain in the main chain-branched chain list of each lane is used for describing the vehicles on each lane and the position relation between the vehicles on each lane, and the branched chain is used for describing the position relation between each lane and the vehicles on the adjacent lanes; A vehicle index for each of the vehicles for indexing lanes to which each of the vehicles belongs and surrounding vehicles of each of the vehicles; The path plan for each of the vehicles navigates for driving of each of the vehicles from a given origin to a given destination. According to the GPU-based microscopic traffic simulation method provided by the invention, the main chain-branched chain list of each lane of the urban road network is constructed, and the method comprises the following steps: Enabling one thread in the GPU to be responsible for a main chain-branched chain list construction task of one lane in the urban road network, and generating a main chain-branched chain list of each lane of the urban road network in a GPU multithread parallel execution mode; wherein, the process of executing the main chain-branched chain list construction task of any lane of the urban road network by any thread of the GPU comprises the following steps: writing the initial information of any lane and a main chain-branched chain list construction algorithm code into a programming framework of any thread so that the any thread generates a main chain-branched chain list of any lane; The initial information of any lane comprises a main chain of the lane, a vehicle leaving list and a vehicle joining list when the simulation iterates in the last round. According to the GPU-based microscopic traffic simulation method provided by the invention, the main chain-branched chain list construction algorithm comprises the following steps: Inputting a main chain of a target lane, a vehicle leaving list and a vehicle adding list in the previous round of simulatio