A gpu-based microscopic traffic simulation method and apparatus
By constructing a main-branch linked list and a vehicle index using a GPU-based micro-traffic simulation method, and utilizing GPU multi-threaded parallel execution, the problem of insufficient computing power for city-level micro-traffic simulation is solved, and efficient fine-grained simulation is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- TSINGHUA UNIVERSITY
- Filing Date
- 2023-08-31
- Publication Date
- 2026-05-05
AI Technical Summary
Existing micro-level traffic simulation methods suffer from insufficient computing power at the city level, making it difficult for a single computer to support fine-grained simulations and limiting the efficient implementation of decision optimization tasks.
A GPU-based microscopic traffic simulation method is adopted. By constructing a main-branch linked list and vehicle index of the urban road network, the traffic operation of vehicles is simulated by using GPU multi-threaded parallel execution, including preset driving strategies and route planning, and tasks are allocated to adapt to the parallel computing capabilities of GPU.
It improves the efficiency of micro-level traffic simulation, effectively supports fine-grained simulation at the city level, fully leverages the massive computing power of GPUs, and improves computational efficiency.
Smart Images

Figure CN117253358B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of traffic simulation technology, and in particular to a GPU-based microscopic traffic simulation method and apparatus. Background Technology
[0002] Micro-traffic simulation is the process of simulating vehicle driving behavior and the relationships and interactions between multiple vehicles on an urban road network. Through micro-traffic simulation, both micro- and macro-level traffic patterns can be obtained, helping decision-makers select better urban road network planning schemes or calculate urban traffic carrying capacity. Therefore, micro-traffic simulation is of great significance for urban construction.
[0003] For city-level micro-traffic simulation, the requirement for a large amount of computing power is a significant factor, which places high demands on the computing equipment and models used in the simulation. However, current micro-traffic simulations are mostly performed using single-threaded or multi-threaded methods, such as SUMO[1], CityFlow[2], and QarSUMO[3]. In these cases, the CPU of a single computer is insufficient to support fine-grained city-level micro-traffic simulations, which limits the true value of micro-traffic simulations and makes it difficult to efficiently carry out downstream decision optimization tasks.
[0004] In recent years, the high computing power of GPUs has enabled groundbreaking achievements in many fields, especially in deep learning. Therefore, applying GPUs to microscopic traffic simulation is an effective means to support fine-grained microscopic traffic simulation at the city level. Consequently, how to design GPU-based microscopic traffic simulation methods is an urgent problem to be solved. Summary of the Invention
[0005] To address the aforementioned issues, this invention provides a GPU-based micro-traffic simulation method and apparatus, which adaptably utilizes GPUs in micro-traffic simulations, enabling GPUs to handle the massive computing power required for fine-grained micro-traffic simulations at the city level, thereby significantly improving the efficiency of micro-traffic simulations.
[0006] In a first aspect, the present invention provides a GPU-based microscopic traffic simulation method for each simulation iteration executed in a GPU, the method comprising:
[0007] Construct a main-branch linked list for each lane of the urban road network;
[0008] Based on the main chain-branch chain list, generate a vehicle index for each vehicle in the urban road network.
[0009] Based on the vehicle index of each vehicle in the urban road network and the route planning of each vehicle in the urban road network obtained from external sources, the traffic operation of each vehicle is simulated.
[0010] In each of the main chain-branch chain lists, the main chain is used to describe the vehicles in each lane and their positional relationships, and the branch chain is used to describe the positional relationships between each lane and the vehicles in its adjacent lanes.
[0011] A vehicle index for each of the vehicles, used to index the lane to which each of the vehicles belongs and the vehicles surrounding each of the vehicles;
[0012] The route planning for each of the vehicles provides driving navigation for each vehicle from a given starting point to a given destination.
[0013] According to the GPU-based microscopic traffic simulation method provided by the present invention, the construction of a main-branch linked list for each lane of the urban road network includes:
[0014] One thread in the GPU is responsible for constructing the main-branch linked list of one lane in the urban road network. The main-branch linked list of each lane in the urban road network is generated by the GPU multi-threaded parallel execution method.
[0015] The process of any thread on the GPU executing the main-branch linked list construction task for any lane of the urban road network includes:
[0016] Write the initial information of any lane and the main-branch linked list construction algorithm code into the programming framework of any thread, so that any thread generates the main-branch linked list of any lane;
[0017] The initial information for any lane includes the main chain, the list of departing vehicles, and the list of joining vehicles for that lane during the previous simulation iteration.
[0018] According to the GPU-based microscopic traffic simulation method provided by the present invention, the main-chain-branch-chain list construction algorithm includes:
[0019] Input the main chain of the target lane, the list of vehicles leaving the lane, and the list of vehicles joining the lane from the previous simulation iteration;
[0020] Record the vehicle nodes that are common to the main chain of the target lane and the list of leaving vehicles in the previous simulation iteration, and delete the vehicle nodes in the main chain of the target lane in the previous simulation iteration to obtain the first linked list;
[0021] The vehicle position of the list of vehicles added to the target lane in the previous simulation iteration is sorted, and the ordered linked list corresponding to the ordered sequence of vehicles is recorded as the second linked list;
[0022] Based on the first linked list and the second linked list, the main chain of the target lane is generated during this round of simulation iteration;
[0023] Based on the main chain of the target lane and each of its adjacent lanes during this round of simulation iteration, establish the link between each vehicle in the target lane and its closest preceding and following vehicles in each of its adjacent lanes to generate the branch chain of the target lane during this round of simulation iteration;
[0024] Based on the main chain and branch chain of the target lane described in this round of simulation iteration, a main chain-branch chain list of the target lane described in this round of simulation iteration is formed.
[0025] According to the GPU-based microscopic traffic simulation method provided by the present invention, generating the main chain of the target lane in the current simulation iteration based on the first linked list and the second linked list includes:
[0026] The first linked list and the second linked list are merged in an orderly manner to obtain the main chain of the target lane in this round of simulation iteration;
[0027] or
[0028] The first linked list is reordered, and the reordered first linked list and the second linked list are merged in an orderly manner to obtain the main chain of the target lane in this round of simulation iteration.
[0029] According to the GPU-based microscopic traffic simulation method provided by the present invention, the step of simulating the traffic operation of each vehicle based on the vehicle index of each vehicle in the urban road network and the path planning of each vehicle in the urban road network obtained from external sources includes:
[0030] One thread in the GPU is responsible for simulating the traffic operation of one vehicle in the urban road network. The traffic operation of each vehicle is simulated by multi-threaded parallel execution of the GPU.
[0031] In this process, any thread of the GPU simulates the traffic flow of any vehicle in the urban road network, including:
[0032] Write simulation algorithm code based on a preset driving strategy, the vehicle index of the target vehicle, and the path planning of the target vehicle into the programming framework of any thread, so that any thread can simulate the traffic operation of the target vehicle based on the simulation algorithm, the path planning of the target vehicle, and the access results of the vehicle index of the target vehicle.
[0033] According to the GPU-based microscopic traffic simulation method provided by the present invention, the preset driving strategy includes, but is not limited to, the following sub-strategies:
[0034] First sub-strategy: When the target vehicle is instructed to change lanes to the first lane in the path planning of the target vehicle, the relative position and speed between the target vehicle and the closest preceding and following vehicles in the first lane is used to determine whether a rear-end collision will occur during the lane change, and the lane change operation is performed if a rear-end collision will not occur; wherein, the first lane is the adjacent lane to the lane to which the target vehicle itself belongs.
[0035] Second sub-strategy: The target vehicle should reach the maximum speed limit of its lane as much as possible;
[0036] The third sub-strategy: Based on the relative position and velocity of the target vehicle and the vehicles in front and behind it, the acceleration of the target vehicle is calculated using a car-following model;
[0037] The fourth sub-strategy: Based on the speed limit of the next lane that the target vehicle will enter, as indicated in the target vehicle's path planning, slow down in a timely manner;
[0038] The fifth sub-strategy: Based on the distance of the target vehicle from the destination indicated in the target vehicle's path planning, slow down in a timely manner.
[0039] According to the GPU-based microscopic traffic simulation method provided by the present invention, the process of generating the path planning for each vehicle in the urban road network includes:
[0040] In the urban road network, lanes are modeled as edges, intersections as points, lane travel time is modeled as the cost of edges, and preset values corresponding to intersection turns are modeled as the cost of points, so as to generate a weighted directed graph of the urban road network.
[0041] The path with the minimum cost from a given starting point to a given ending point for each vehicle in the urban road network is taken as the optimal path for each vehicle in the urban road network.
[0042] By marking key auxiliary information on the optimal path, the path planning for each vehicle in the urban road network is obtained;
[0043] The key auxiliary information includes: driving behavior, lane speed limit, and distance of the vehicle from a given destination;
[0044] The driving behaviors mentioned include changing lanes and going straight.
[0045] Secondly, the present invention provides a GPU-based microscopic traffic simulation device for each simulation iteration executed in the GPU, the device comprising:
[0046] The linked list construction module is used to build a main-branch linked list for each lane of the urban road network.
[0047] The vehicle index building module is used to generate a vehicle index for each vehicle in the urban road network based on the main chain-branch chain list.
[0048] The vehicle traffic simulation module is used to simulate the traffic operation of each vehicle based on the vehicle index of each vehicle in the urban road network and the route planning of each vehicle in the urban road network obtained from external sources.
[0049] In each of the main chain-branch chain lists, the main chain is used to describe the vehicles in each lane and their positional relationships, and the branch chain is used to describe the positional relationships between each lane and the vehicles in its adjacent lanes.
[0050] A vehicle index for each of the vehicles, used to index the lane to which each of the vehicles belongs and the vehicles surrounding each of the vehicles;
[0051] The route planning for each of the vehicles provides driving navigation for each vehicle from a given starting point to a given destination.
[0052] Thirdly, the present invention provides an electronic device including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the program, implements the GPU-based microscopic traffic simulation method as described in the first aspect.
[0053] Fourthly, the present invention provides a non-transitory computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the GPU-based microscopic traffic simulation method as described in the first aspect.
[0054] This invention provides a GPU-based microscopic traffic simulation method and apparatus for each simulation iteration executed in the GPU, comprising: constructing a main-branch linked list for each lane of an urban road network; generating a vehicle index for each vehicle in the urban road network based on the main-branch linked list; 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 obtained from an external source; wherein, the main chain in the main-branch linked list of each lane is used to describe the vehicles in each lane and their positional relationships, and the branch chains are used to describe the positional relationships between each lane and the vehicles in its adjacent lanes; the vehicle index of each vehicle is used to index the lane to which each vehicle belongs and the vehicles surrounding each vehicle; and the path planning of each vehicle is used to provide driving navigation for each vehicle from a given starting point to a given destination. This invention takes into account the characteristics of GPUs, which excel at handling massive amounts of homogeneous parallel tasks and can provide far greater computing power than CPUs. However, their efficiency decreases when executing complex branching and differentiated parallel tasks. Therefore, a micro-traffic simulation framework is designed that includes only highly homogeneous tasks such as index building and vehicle simulation, making micro-traffic simulation compatible with GPUs. This allows GPUs to handle the massive computing power required for fine-grained micro-traffic simulation at the city level, thereby significantly improving the efficiency of micro-traffic simulation. Attached Figure Description
[0055] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0056] Figure 1 This is a flowchart illustrating the GPU-based microscopic traffic simulation method provided by the present invention.
[0057] Figure 2 This is a schematic diagram illustrating the principle of the GPU-based microscopic traffic simulation method provided by the present invention;
[0058] Figure 3 This is a schematic diagram of the main chain construction process of the vehicle provided by the present invention;
[0059] Figure 4 This is a schematic diagram of the branch construction process of a vehicle provided by the present invention;
[0060] Figure 5 This is a schematic diagram of the vehicle simulation principle provided by the present invention;
[0061] Figure 6This is a schematic diagram illustrating the path planning principle based on the A* algorithm provided by the present invention;
[0062] Figure 7 This is a schematic diagram of an embodiment of path planning based on the A* algorithm provided by the present invention;
[0063] Figure 8 This is a schematic diagram of the structure of the GPU-based microscopic traffic simulation device provided by the present invention;
[0064] Figure 9 This is a schematic diagram of the structure of the electronic device provided by the present invention;
[0065] Figure label:
[0066] 910: Processor; 920: Communication interface; 930: Memory; 940: Communication bus. Detailed Implementation
[0067] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.
[0068] The following is combined Figures 1-9 The present invention describes a GPU-based microscopic traffic simulation method and apparatus.
[0069] Firstly, GPUs, as common computing acceleration devices, can provide significantly greater computing power than CPUs. Considering the massive computing power required for the rapid execution of sub-second fine-grained micro-traffic simulation tasks at the city level, GPUs can effectively undertake this task, thereby greatly improving the execution efficiency of micro-traffic simulation tasks and fully realizing the application value of micro-traffic simulation. However, current implementations of micro-traffic simulation using single-threaded or multi-threaded methods lack system models and software frameworks based on GPUs. Therefore, the goal of this invention is to construct a micro-traffic simulation method based on GPU hardware acceleration. In view of this, this invention provides a GPU-based micro-traffic simulation method, which is used in each simulation iteration executed in the GPU, such as... Figure 1 As shown, the method includes:
[0070] S11. Construct a main-branch linked list for each lane of the urban road network;
[0071] S12. Based on the main chain-branch chain list, generate a vehicle index for each vehicle in the urban road network;
[0072] S13. Based on the vehicle index of each vehicle in the urban road network and the path planning of each vehicle in the urban road network obtained from external sources, simulate the traffic operation of each vehicle.
[0073] In each of the main chain-branch chain lists, the main chain is used to describe the vehicles in each lane and their positional relationships, and the branch chain is used to describe the positional relationships between each lane and the vehicles in its adjacent lanes.
[0074] A vehicle index for each of the vehicles, used to index the lane to which each of the vehicles belongs and the vehicles surrounding each of the vehicles;
[0075] The route planning for each vehicle is the driving navigation for each vehicle from a given starting point to a given destination.
[0076] In fact, based on the characteristics of GPUs, which are good at handling massive amounts of homogeneous parallel tasks and can provide far greater computing power than CPUs, but whose execution efficiency will decrease when performing complex branch jumps and differentiated parallel tasks, this invention divides the micro traffic simulation task into three sub-tasks: index building, vehicle simulation, and path planning. Among them, index building includes two parts: lane main chain-branch chain list construction and vehicle index construction. Index building and vehicle simulation are completed on the GPU, while path planning is completed on components outside the GPU.
[0077] Figure 2 A schematic diagram illustrating the principle of a GPU-based microscopic traffic simulation method is shown, such as... Figure 2 As shown, in the micro-traffic simulation process, the computational program first performs an index construction calculation. Since vehicles need to perceive the relative positions and speeds of surrounding vehicles while driving in the urban road network, one aspect of the index construction calculation is to build an index for the vehicle to query its surrounding vehicles. Additionally, during the simulation, vehicles move between different lanes, and the index construction process also needs to assign the vehicle to the index of its current lane. After completing the index construction, the computational program enters the vehicle simulation calculation process. In this process, the vehicle relies on the topological information of the urban road network, the vehicle's path planning, and the constructed vehicle index. By comprehensively considering the driving conditions of surrounding vehicles and the objective conditions of the road network, the program calculates the vehicle's driving behavior (going straight, changing lanes, etc.), and then updates the vehicle's position and speed based on this behavior, thereby achieving the purpose of micro-traffic simulation. After the calculation is completed, the next round of index construction and simulation calculation will be performed iteratively.
[0078] Route planning is the process of calculating the shortest path from a given origin to a destination based on the urban road network topology. The result serves as a crucial input for calculating a vehicle's driving behavior on the road network. When a vehicle enters a new journey or needs to change its destination, the route planning calculation process may be triggered on demand to determine a new route.
[0079] This invention provides a GPU-based micro-traffic simulation method. Considering that GPUs excel at handling massive amounts of homogeneous parallel tasks and can provide significantly greater computing power than CPUs, but their efficiency decreases when executing complex branching and differentiated parallel tasks, the invention designs a micro-traffic simulation framework that includes only highly homogeneous tasks such as index building and vehicle simulation. This adapts micro-traffic simulation to GPUs, enabling GPUs to handle the massive computing power required for fine-grained micro-traffic simulation at the city level, thereby significantly improving the efficiency of micro-traffic simulation.
[0080] Specifically, S11 includes:
[0081] One thread in the GPU is responsible for constructing the main-branch linked list of one lane in the urban road network. The main-branch linked list of each lane in the urban road network is generated by the GPU multi-threaded parallel execution method.
[0082] The process of any thread on the GPU executing the main-branch linked list construction task for any lane of the urban road network includes:
[0083] Write the initial information of any lane and the main-branch linked list construction algorithm code into the programming framework of any thread, so that any thread generates the main-branch linked list of any lane;
[0084] The initial information for any lane includes the main chain, the list of departing vehicles, and the list of joining vehicles for that lane during the previous simulation iteration.
[0085] It should be noted that in reality, there may be situations where the number of GPU threads is less than the number of lanes in a city road network. In such cases, GPU multithreading can be used to build the main chain-branch chain list for each lane in the city road network in batches.
[0086] Furthermore, the main chain-side chain list construction algorithm includes:
[0087] Input the main chain of the target lane, the list of vehicles leaving the lane, and the list of vehicles joining the lane from the previous simulation iteration;
[0088] Record the vehicle nodes that are common to the main chain of the target lane and the list of leaving vehicles in the previous simulation iteration, and delete the vehicle nodes in the main chain of the target lane in the previous simulation iteration to obtain the first linked list;
[0089] The vehicle position of the list of vehicles added to the target lane in the previous simulation iteration is sorted, and the ordered linked list corresponding to the ordered sequence of vehicles is recorded as the second linked list;
[0090] Based on the first linked list and the second linked list, the main chain of the target lane is generated during this round of simulation iteration;
[0091] Based on the main chain of the target lane and each of its adjacent lanes during this round of simulation iteration, establish the link between each vehicle in the target lane and its closest preceding and following vehicles in each of its adjacent lanes to generate the branch chain of the target lane during this round of simulation iteration;
[0092] Based on the main chain and branch chain of the target lane described in this round of simulation iteration, a main chain-branch chain list of the target lane described in this round of simulation iteration is formed.
[0093] Furthermore, the step of generating the main chain of the target lane during this round of simulation iteration based on the first linked list and the second linked list includes:
[0094] The first linked list and the second linked list are merged in an orderly manner to obtain the main chain of the target lane in this round of simulation iteration;
[0095] or
[0096] The first linked list is reordered, and the reordered first linked list and the second linked list are merged in an orderly manner to obtain the main chain of the target lane in this round of simulation iteration.
[0097] In other words, index construction is a preliminary step in the vehicle simulation calculation process during each simulation iteration. Since vehicles may enter or leave lanes and exchange relative positions in each simulation iteration, index construction is used to redetermine the vehicle's affiliation with the lane and the relative relationships between vehicles under the new vehicle position relationships, so that subsequent vehicle simulation calculations can proceed normally.
[0098] In index construction, vehicles in each lane are arranged in a doubly linked list structure according to their relative positions, called the "main chain"; while the links between vehicles and nearby vehicles in adjacent lanes are called "side chains". The lane's "main chain" is constructed using an incremental calculation method. Specifically, Figure 3 A flowchart illustrating the process of building the vehicle's main chain, such as... Figure 3As shown, during the vehicle simulation calculation, vehicles record their lane departures in the corresponding lane's departure list and their lane entry entries in the corresponding lane's entry list. In each simulation iteration's index construction calculation, using lanes as the basic parallel unit on the GPU, the departure and entry lists for each lane are scanned. First, the corresponding vehicle nodes are deleted from the original "main chain," and then, after global synchronization, newly added vehicle nodes are added, thus obtaining the "main chain" index usable in this iteration. Since the "main chain" of vehicle indexes on lanes requires order, the process of adding new vehicle nodes is implemented as a sorting process. First, the original "main chain" is sorted according to the vehicle's new position, correcting inversions caused by special results in the driving simulation calculation (or scanning, defining, and correcting inversions). Second, the newly added small number of vehicles are sorted and organized into an ordered linked list. Finally, an ordered linked list merging algorithm is used to combine two ordered linked lists into one ordered linked list, forming a new "main chain." Of course, since the probability of inversions in the original "main chain" is relatively small, the step of reordering the original "main chain" can be deleted as appropriate. Since the number of vehicles entering and exiting the lane in each step is relatively small, this process can minimize computational overhead.
[0099] For lane "branches," since the positional relationships between vehicles in different lanes are likely to change significantly, a full-scale construction approach is used to ensure the accuracy of the construction results. Specifically, Figure 4 A schematic diagram of the process for building a branch chain for a vehicle, such as... Figure 4 As shown, the full construction process of the "branch" uses lanes as the parallel basic unit on the GPU. Each lane and its left / right lanes form a "branch" construction pair. Since the "main chain" of the two lanes is already an ordered linked list, it can start from the first car in the two lanes and scan forward alternately to obtain the car in front and behind each car in the left / right lane.
[0100] Specifically, S12 includes:
[0101] This invention generates a vehicle index for each vehicle in each lane based on the main-branch linked list of each lane; wherein, the vehicle index of each vehicle is used to index the lane to which each vehicle belongs and the surrounding vehicles of each vehicle, where the surrounding vehicles refer only to the vehicle in front, the vehicle behind, the vehicle in front and the vehicle behind it in the left lane, and the vehicle in front and the vehicle behind it in the right lane.
[0102] Specifically, S13 includes:
[0103] One thread in the GPU is responsible for simulating the traffic operation of one vehicle in the urban road network. The traffic operation of each vehicle is simulated by multi-threaded parallel execution of the GPU.
[0104] In this process, any thread of the GPU simulates the traffic flow of any vehicle in the urban road network, including:
[0105] Write simulation algorithm code based on a preset driving strategy, the vehicle index of the target vehicle, and the path planning of the target vehicle into the programming framework of any thread, so that any thread can simulate the traffic operation of the target vehicle based on the simulation algorithm, the path planning of the target vehicle, and the access results of the vehicle index of the target vehicle.
[0106] Obviously, the vehicle is used here as the basic unit of parallelism on the GPU device.
[0107] Furthermore, the preset driving strategy includes, but is not limited to, the following sub-strategies:
[0108] First sub-strategy: When the target vehicle is instructed to change lanes to the first lane in the path planning of the target vehicle, the relative position and speed between the target vehicle and the closest preceding and following vehicles in the first lane is used to determine whether a rear-end collision will occur during the lane change, and the lane change operation is performed if a rear-end collision will not occur; wherein, the first lane is the adjacent lane to the lane to which the target vehicle itself belongs.
[0109] Second sub-strategy: The target vehicle should reach the maximum speed limit of its lane as much as possible;
[0110] The third sub-strategy: Based on the relative position and velocity of the target vehicle and the vehicles in front and behind it, the acceleration of the target vehicle is calculated using a car-following model;
[0111] The fourth sub-strategy: Based on the speed limit of the next lane that the target vehicle will enter, as indicated in the target vehicle's path planning, slow down in a timely manner;
[0112] The fifth sub-strategy: Based on the distance of the target vehicle from the destination indicated in the target vehicle's path planning, slow down in a timely manner.
[0113] The vehicle's deceleration speed is preset, while the fourth and fifth sub-strategies focus on determining the timing for initiating deceleration. In addition to the above five strategies, an intersection strategy is also required to avoid collisions at intersections.
[0114] In other words, vehicle simulation is the main component of each simulation iteration. During vehicle simulation, the vehicle determines its driving behavior for each iteration based on surrounding environmental information and its own path, according to preset driving strategies. This includes selecting acceleration and whether to change lanes. Subsequently, based on the vehicle's driving behavior, its new speed and position after each iteration are calculated and updated. Figure 5 A schematic diagram illustrating the principle of vehicle simulation is provided, such as... Figure 5 As shown, the driving strategies of a vehicle include: (1) deciding whether to change lanes based on its own path requirements (lane change requirements) and the relative position and speed of vehicles in adjacent lanes, and using a car-following model to determine the acceleration during the lane change process; (2) reaching the maximum speed limit of the current lane as much as possible; (3) considering the relative position and speed of vehicles in front and behind, using a car-following model to calculate appropriate acceleration to maintain a safe distance and avoid collisions; (4) considering the speed limit of the next lane to be entered, and slowing down in time; (5) slowing down and stopping when reaching the destination; (6) at intersections, considering all possible traffic flow situations, and selecting appropriate acceleration based on the conservative safety principle of avoiding collisions.
[0115] Of course, since vehicle simulation needs to take into account all the above driving strategies, the final acceleration is selected as the most suitable one (usually the minimum value).
[0116] In the above driving strategy, the vehicle can obtain the corresponding information about surrounding vehicles after a limited and fixed number of pointer memory accesses, thus ensuring that there are no excessive branching logics in the entire calculation process and guaranteeing the efficient utilization of GPU computing resources. For example, the position and speed information of each vehicle is stored in the GPU's memory. The existence of vehicle indexes on the lanes allows the vehicle to know the relative position and speed of vehicles in adjacent lanes and the relative position and speed of vehicles in front and behind in the same lane with a limited number of memory accesses. Through the information in the path, the speed limit of the lane and the remaining distance to the destination can be obtained.
[0117] Specifically, the process of generating the path planning for each vehicle in the urban road network in S12 includes:
[0118] In the urban road network, lanes are modeled as edges, intersections as points, lane travel time is modeled as the cost of edges, and preset values corresponding to intersection turns are modeled as the cost of points, so as to generate a weighted directed graph of the urban road network.
[0119] The path with the minimum cost from a given starting point to a given ending point for each vehicle in the urban road network is taken as the optimal path for each vehicle in the urban road network.
[0120] By marking key auxiliary information on the optimal path, the path planning for each vehicle in the urban road network is obtained;
[0121] The key auxiliary information includes: driving behavior, lane speed limit, and distance of the vehicle from a given destination;
[0122] The driving behaviors mentioned include changing lanes and going straight.
[0123] Specifically, the path planning component provides the shortest travel path from a given starting point to a destination on a specified urban road network as needed. In the path planning calculation, lanes are modeled as edges on a graph, and intersections are modeled as points on the graph; the travel time of a lane is modeled as the cost of traversing an edge, and the left turn, right turn, and straight-ahead movement at an intersection are pre-set with corresponding values (left turn > straight > right turn) to reflect the cost of traversing the intersection. Under this abstraction, the path planning calculation process is modeled as a shortest path algorithm between points on a weighted directed graph. Common shortest path algorithms include Dijkstra's algorithm based on a greedy strategy and relaxation process, and the A* algorithm based on heuristic search methods. This invention primarily focuses on the A* algorithm. Figure 6 An example is provided illustrating the principle of path planning based on the A* algorithm, such as... Figure 6 As shown, the A* algorithm relies on a pre-defined minimum cost estimation function for the destination, and during the search process, it uses this estimation function to determine the approximate direction to the destination and the topological neighbors of the finite search. In the microscopic traffic simulation, due to the characteristics of the urban road network, the Manhattan distance divided by the average free-flow speed in the city is used as the minimum cost estimation function to reach the destination, guiding the heuristic search algorithm to converge quickly and find the correct path. In addition to calculating the shortest path, the path planning calculation model also labels the obtained path with corresponding driving behaviors, namely lane changes and straight driving, and provides key auxiliary information such as the speed limits of the lanes traversed and the distance to the destination.
[0124] To more clearly illustrate the technical solution of the present invention, two specific embodiments are provided below. Obviously, those skilled in the art can obtain other embodiments based on these two specific embodiments without any creative effort.
[0125] Implementation method 1: The user wants to use this simulation calculation model to simulate the urban micro-traffic operation of location A on June 1, 2022. There are a total of 37,521 lanes in the urban road network of location A.
[0126] On GPU devices, the index construction process is implemented as multiple kernel functions: RemoveVehicleFromIndex<<<num_lanes> >>、InsertAndBuildMainIndex<<<num_lanes> >>、BuildSecondIndex<<<num_lanes> >> are used to remove vehicles from the "main chain", add vehicles to the "main chain" and incrementally build the "main chain", and fully build the "side chain", respectively, where the value of num_lanes is equal to 37521. Specifically, at time 5, there are vehicles A, B, C, and D in lane ID 1023, and their distances relative to the starting point of the lane are 100, 200, 300, and 306, respectively. After completing the simulation calculation at time 5, vehicle B leaves lane 1023, vehicle E enters lane 1023 and is 3 units away from the starting point, and the new positions of vehicles A, C, and D are 102, 320, and 310 units away from the starting point, respectively. In this scenario, the `RemoveVehicleFromIndex` function first removes vehicle B from the lane's "main chain," leaving A, C, and D. Next, the `InsertAndBuildMainIndex` function first reorders the "main chain" to A, D, C, then adds vehicle E to the "main chain," resulting in E, A, D, and C. Finally, `BuildSecondIndex` is called to construct the relationships between vehicles E, A, D, and C and their closest adjacent vehicles in adjacent lanes. All of these processes use lanes as the basic unit of parallel processing, thus fully utilizing the parallel capabilities and computing power of the GPU.
[0127] The vehicle simulation calculation process is implemented as a kernel function UpdateVehicle<<<num_vehicles> >>, which is divided into multiple stages according to the driving strategy and position speed update to be executed. Since the index construction process fully eliminates the uncertainty cost of vehicle information acquisition, the execution of this Kernel function on the GPU device does not need to acquire additional information other than the vehicle's own information, so it can run efficiently on the GPU. Specifically, the vehicle needs to run in the following manner: (1) Check whether the path requires changing lanes to the left or right. If there is a lane change requirement, obtain the relative position and relative speed of the vehicle in front and behind in the lane change direction. Based on the relative position and relative speed, it can be calculated whether a collision can be avoided by ordinary deceleration or acceleration after changing lanes. If there is no possibility of collision, the vehicle's driving behavior is set to change lanes to the left / right, and the vehicle's current acceleration is set to the middle value within the safe range; (2) The vehicle selects appropriate acceleration or deceleration behavior according to the speed limit of the current lane and the speed limit of the next lane to make the vehicle's speed The degree can be as high as possible within the limit; (3) The vehicle checks the vehicle in front in the current lane, and uses its relative position and relative speed with the vehicle in front to determine whether a collision will occur. If a collision will occur, it chooses one of the two driving behaviors, general braking or emergency braking, based on the required acceleration; (4) The vehicle checks its distance from the destination. After the distance from the destination enters the stopping distance of general braking, it chooses general braking driving behavior; (5) If the vehicle is in the intersection, it will consider vehicles whose driving direction vector intersects with its own driving direction vector, and determine whether to give way based on the traffic priority and choose the acceleration and driving behavior to give way. The acceleration and driving behavior generated in all the above links are aggregated through rules to ensure that the final driving behavior achieves the highest traffic efficiency under the constraint of not causing a collision. After obtaining the driving behavior, the position speed update is reflected by adding the vehicle's speed at the previous moment to the acceleration process at the current moment to obtain the speed at the next moment. By using the speeds at the two moments, the uniform acceleration formula is used to calculate the distance traveled by the vehicle after this round of simulation, thereby obtaining the new position of the vehicle. Correspondingly, if a vehicle leaves its current lane, its departure and entry information will be recorded in the corresponding lane.
[0128] The path planning model is implemented using the A* algorithm. Figure 7 A schematic diagram illustrating an example of path planning based on the A* algorithm is shown below. Figure 7As shown, intersections C, G, I, L, etc. in the urban road network are transformed into points on the graph, and the corresponding intersections have a cost of 4, 3, 2, 1, etc. The roads connecting the intersections are transformed into edges on the graph, and the edges have a certain travel cost. When a vehicle requests the shortest path from intersection S to intersection T, the path planning model starts from the starting point intersection S and, guided by the Manhattan distance, sequentially searches paths SBED, SBEF, and SDHJKT, finally finding the shortest path to the destination.
[0129] Implementation Method Two:
[0130] The user wants to use this simulation model to simulate the micro-traffic conditions in city B throughout the day on March 1, 2022. City B's urban road network has a total of 56,612 lanes. On the GPU device, the index construction process is implemented as multiple kernel functions: RemoveVehicleFromIndex<<<num_lanes> >>、InsertAndBuildMainIndex<<<num_lanes> >>、BuildSecondIndex<<<num_lanes> >> are used to remove vehicles from the "main chain", add vehicles to the "main chain" and incrementally build the "main chain", and fully build the "side chain", respectively, where the value of num_lanes is equal to 56612. Specifically, at time 102, there are vehicles A, B, C, and D in lane 5, and their distances relative to the starting point of the lane are 150, 250, 350, and 358, respectively. After completing the simulation calculation at time 102, vehicle C leaves lane 5, and vehicle E enters lane 5 at a distance of 103 from the starting point. The new positions of vehicles A, B, and D are 152, 252, and 360 from the starting point, respectively. In this scenario, the `RemoveVehicleFromIndex` function first removes vehicle C from the lane's "main chain," leaving A, B, and D. Next, the `InsertAndBuildMainIndex` function first reorders the "main chain" to A, B, and D, then adds vehicle E to the "main chain," resulting in E, A, B, and D. Finally, `BuildSecondIndex` is called to construct the relationships between vehicles E, A, B, and D and their closest neighboring vehicles in adjacent lanes. All of these processes use lanes as the basic unit of parallel processing, thus fully utilizing the GPU's parallel capabilities and computing power.
[0131] The vehicle simulation calculation process is implemented as a kernel function UpdateVehicle<<<num_vehicles> >>, which is divided into multiple stages according to the driving strategy and position speed update to be executed. Since the index construction process fully eliminates the uncertainty cost of vehicle information acquisition, the execution of this Kernel function on the GPU device does not need to acquire additional information other than the vehicle's own information, so it can run efficiently on the GPU. Specifically, the vehicle needs to run in the following manner: (1) The vehicle first checks whether the path requires changing lanes to the left or right. If there is a lane change requirement, it obtains the relative position and relative speed of the vehicle in front and behind in the lane change direction. Based on the relative position and relative speed, it can be calculated whether a collision can be avoided by ordinary deceleration or acceleration after changing lanes. If there is no possibility of collision, the vehicle's driving behavior is set to change lanes to the left / right, and the vehicle's current acceleration is set to the middle value within the safe range; (2) The vehicle selects appropriate acceleration or deceleration behavior according to the speed limit of the current lane and the speed limit of the next lane to make the vehicle (3) The vehicle checks the vehicle in front in the current lane and uses its relative position and relative speed with the vehicle in front to determine whether a collision will occur. If a collision will occur, it chooses one of the two driving behaviors, normal braking or emergency braking, based on the required acceleration. (4) The vehicle checks its distance from the destination. After the distance from the destination enters the stopping distance of normal braking, it chooses normal braking driving behavior. (5) If the vehicle is in an intersection, it will consider vehicles whose driving direction vector intersects with its own driving direction vector. It will determine whether to give way based on the traffic priority and choose the acceleration and driving behavior to give way. The acceleration and driving behavior generated in all the above links are aggregated through rules to ensure that the final driving behavior achieves the highest traffic efficiency under the constraint of not causing a collision. After obtaining the driving behavior, the position speed update is reflected by adding the vehicle's speed at the previous moment to the acceleration process at the current moment to obtain the speed at the next moment. By using the speeds at the two moments, the uniform acceleration formula is used to calculate the distance traveled by the vehicle after this round of simulation, thereby obtaining the new position of the vehicle. Correspondingly, if a vehicle leaves its current lane, its departure and entry information will be recorded in the corresponding lane.
[0132] The path planning model is implemented using Dijkstra's algorithm. Intersections A, B, C, and D in the urban road network are transformed into points on a graph, with corresponding costs of 14, 5, 12, and 4 respectively. Roads connecting intersections are transformed into edges on the graph, each with a certain cost. When a vehicle requests the shortest path from intersection A to intersection D, the path planning model starts from the starting point at intersection A and, guided by Euclidean distance, sequentially searches paths ABGT, ABGC, and ABDC, ultimately finding the shortest path to the destination.
[0133] Secondly, the GPU-based micro-traffic simulation device provided by the present invention will be described below. The GPU-based micro-traffic simulation device described below can be referred to in correspondence with the GPU-based micro-traffic simulation method described above. For example... Figure 8 As shown, the device includes:
[0134] Linked list construction module 21 is used to construct the main-branch linked list for each lane of the urban road network;
[0135] The vehicle index construction module 22 is used to generate a vehicle index for each vehicle in the urban road network based on the main chain-branch chain list.
[0136] The vehicle traffic simulation module 23 is used to simulate the traffic operation of each vehicle based on the vehicle index of each vehicle in the urban road network and the route planning of each vehicle in the urban road network obtained from the outside.
[0137] In each of the main chain-branch chain lists, the main chain is used to describe the vehicles in each lane and their positional relationships, and the branch chain is used to describe the positional relationships between each lane and the vehicles in its adjacent lanes.
[0138] A vehicle index for each of the vehicles, used to index the lane to which each vehicle belongs and the vehicles surrounding each vehicle;
[0139] The route planning for each vehicle is the driving navigation for each vehicle from a given starting point to a given destination.
[0140] The GPU-based micro-traffic simulation device provided by this invention takes into account the characteristics of GPUs: they excel at handling massive amounts of homogeneous parallel tasks and can provide computing power far exceeding that of CPUs. However, their execution efficiency decreases when performing complex branching and differentiated parallel tasks. Therefore, the micro-traffic simulation framework is designed to include only highly homogeneous tasks such as index building and vehicle simulation, making micro-traffic simulation compatible with GPUs. This allows GPUs to handle the massive computing power required for fine-grained micro-traffic simulation at the city level, thereby significantly improving the efficiency of micro-traffic simulation.
[0141] Thirdly, Figure 9 An example is a schematic diagram of the physical structure of an electronic device, such as... Figure 9As shown, the electronic device may include: a processor 910, a communication interface 920, a memory 930, and a communication bus 940, wherein the processor 910, the communication interface 920, and the memory 930 communicate with each other through the communication bus 940. The processor 910 can call logical instructions in the memory 930 to execute a GPU-based microscopic traffic simulation method, which includes: constructing a main-branch linked list for each lane of the urban road network; generating a vehicle index for each vehicle in the urban road network based on the main-branch linked list; 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 obtained from an external source; wherein, the main chain in the main-branch linked list of each lane is used to describe the vehicles in each lane and the relative position and speed between them, and the branch chains are used to describe the relative position and speed between each lane and the vehicles in its adjacent lanes; the vehicle index of each vehicle is used to access the lane to which each vehicle belongs and the relative position and speed between each vehicle and its surrounding vehicles; and the path planning of each vehicle is used for driving navigation for each vehicle from a given starting point to a given destination.
[0142] Furthermore, the logical instructions in the aforementioned memory 930 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, essentially, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0143] Fourthly, the present invention also provides a computer program product, the computer program product comprising a computer program that can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer is able to execute the GPU-based microscopic traffic simulation method provided by the above methods. The method includes: constructing a main-branch linked list for each lane of an urban road network; generating a vehicle index for each vehicle in the urban road network based on the main-branch linked list; 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 obtained from an external source; wherein, the main chain in the main-branch linked list of each lane is used to describe the vehicles in each lane and the relative position and speed relationships between them, and the branch chains are used to describe the relative position and speed relationships between each lane and the vehicles in its adjacent lanes; the vehicle index of each vehicle is used to access the lane to which each vehicle belongs and the relative position and speed relationships between each vehicle and its surrounding vehicles; and the path planning of each vehicle is used for driving navigation for each vehicle from a given starting point to a given destination.
[0144] Fifthly, the present invention also provides a non-transitory computer-readable storage medium storing a computer program thereon, which, when executed by a processor, is implemented to perform the GPU-based microscopic traffic simulation method provided by the methods described above. The method includes: constructing a main-branch linked list for each lane of an urban road network; generating a vehicle index for each vehicle in the urban road network based on the main-branch linked list; simulating traffic operation for each vehicle according to the vehicle index and the path planning of each vehicle in the urban road network obtained from an external source; wherein the main chain in the main-branch linked list of each lane describes the vehicles in each lane and their relative position and speed relationships, and the branch chains describe the relative position and speed relationships between each lane and vehicles in its adjacent lanes; the vehicle index of each vehicle is used to access the lane to which each vehicle belongs and the relative position and speed relationships between each vehicle and its surrounding vehicles; and the path planning for each vehicle provides driving navigation for each vehicle from a given starting point to a given destination.
[0145] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.
[0146] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.
[0147] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A GPU-based microscopic traffic simulation method for each simulation iteration executed in a GPU, characterized in that, The method includes: Construct a main-branch linked list for each lane of the urban road network; The construction of the main-branch linked list for each lane of the urban road network includes: One thread in the GPU is responsible for constructing the main-branch linked list of one lane in the urban road network. The main-branch linked list of each lane in the urban road network is generated by the GPU multi-threaded parallel execution method. The process of any thread on the GPU executing the main-branch linked list construction task for any lane of the urban road network includes: Write the initial information of any lane and the main-branch linked list construction algorithm code into the programming framework of any thread, so that any thread generates the main-branch linked list of any lane; The initial information for any lane includes the main chain, the list of departing vehicles, and the list of joining vehicles for any lane during the previous simulation iteration. The main chain-side chain list construction algorithm includes: Input the main chain of the target lane, the list of vehicles leaving the lane, and the list of vehicles joining the lane from the previous simulation iteration; Record the vehicle nodes that are common to the main chain of the target lane and the list of leaving vehicles in the previous simulation iteration, and delete the vehicle nodes in the main chain of the target lane in the previous simulation iteration to obtain the first linked list; The vehicle position of the list of vehicles added to the target lane in the previous simulation iteration is sorted, and the ordered linked list corresponding to the ordered sequence of vehicles is recorded as the second linked list; Based on the first linked list and the second linked list, the main chain of the target lane is generated during this round of simulation iteration; Based on the main chain of the target lane and each of its adjacent lanes during this round of simulation iteration, establish the link between each vehicle in the target lane and its closest preceding and following vehicles in each of its adjacent lanes to generate the branch chain of the target lane during this round of simulation iteration; Based on the main chain and branch chain of the target lane in this round of simulation iteration, a main chain-branch chain list of the target lane in this round of simulation iteration is formed. Based on the main chain-branch chain list, generate a vehicle index for each vehicle in the urban road network. Based on the vehicle index of each vehicle in the urban road network and the route planning of each vehicle in the urban road network obtained from external sources, the traffic operation of each vehicle is simulated. The process of simulating traffic operation for each vehicle, based on the vehicle index of each vehicle in the urban road network and the path planning of each vehicle obtained from external sources, includes: One thread in the GPU is responsible for simulating the traffic operation of one vehicle in the urban road network. The traffic operation of each vehicle is simulated by multi-threaded parallel execution of the GPU. In this process, any thread of the GPU simulates the traffic flow of any vehicle in the urban road network, including: Write simulation algorithm code based on a preset driving strategy, the vehicle index of the target vehicle, and the path planning of the target vehicle into the programming framework of any thread, so that any thread can simulate the traffic operation of the target vehicle based on the simulation algorithm, the path planning of the target vehicle, and the access results of the vehicle index of the target vehicle. In each of the main chain-branch chain lists, the main chain is used to describe the vehicles in each lane and their positional relationships, and the branch chain is used to describe the positional relationships between each lane and the vehicles in its adjacent lanes. A vehicle index for each of the vehicles, used to index the lane to which each of the vehicles belongs and the vehicles surrounding each of the vehicles; The route planning for each vehicle is the driving navigation for each vehicle from a given starting point to a given destination.
2. The GPU-based microscopic traffic simulation method according to claim 1, characterized in that, The process of generating the main chain of the target lane for this round of simulation iteration based on the first linked list and the second linked list includes: The first linked list and the second linked list are merged in an orderly manner to obtain the main chain of the target lane in this round of simulation iteration; or The first linked list is reordered, and the reordered first linked list and the second linked list are merged in an orderly manner to obtain the main chain of the target lane in this round of simulation iteration.
3. The GPU-based microscopic traffic simulation method according to claim 1, characterized in that, The preset driving strategy includes the following sub-strategies: First sub-strategy: When the target vehicle is instructed to change lanes to the first lane in the path planning of the target vehicle, the relative position and speed between the target vehicle and the closest preceding and following vehicles in the first lane is used to determine whether a rear-end collision will occur during the lane change, and the lane change operation is performed if a rear-end collision will not occur; wherein, the first lane is the adjacent lane to the lane to which the target vehicle itself belongs. Second sub-strategy: The target vehicle should reach the maximum speed limit of its lane as much as possible; The third sub-strategy: Based on the relative position and velocity of the target vehicle and the vehicles in front and behind it, the acceleration of the target vehicle is calculated using a car-following model; The fourth sub-strategy: Based on the speed limit of the next lane that the target vehicle will enter, as indicated in the target vehicle's path planning, slow down in a timely manner; The fifth sub-strategy: Based on the distance of the target vehicle from the destination indicated in the target vehicle's path planning, slow down in a timely manner.
4. The GPU-based microscopic traffic simulation method according to claim 1, characterized in that, The process of generating the route planning for each vehicle in the urban road network includes: In the urban road network, lanes are modeled as edges, intersections as points, lane travel time is modeled as the cost of edges, and preset values corresponding to intersection turns are modeled as the cost of points, so as to generate a weighted directed graph of the urban road network. The path with the minimum cost from a given starting point to a given ending point for each vehicle in the urban road network is taken as the optimal path for each vehicle in the urban road network. By marking key auxiliary information on the optimal path, the path planning for each vehicle in the urban road network is obtained; The key auxiliary information includes: driving behavior, lane speed limit, and distance of the vehicle from a given destination; The driving behaviors mentioned include changing lanes and going straight.
5. A GPU-based microscopic traffic simulation device for each simulation iteration executed in the GPU, characterized in that, The device includes: A linked list construction module is used to construct a main-branch linked list for each lane of the urban road network. The construction of the main-branch linked list for each lane of the urban road network includes: assigning one thread in the GPU to be responsible for constructing the main-branch linked list for one lane of the urban road network, generating the main-branch linked list for each lane of the urban road network through GPU multi-threaded parallel execution; wherein, the process of any thread of the GPU executing the main-branch linked list construction task for any lane of the urban road network includes: writing the initial information of the lane and the main-branch linked list construction algorithm code into the programming framework of the thread, so that the thread generates the main-branch linked list for the lane; the initial information of the lane includes the main chain, the list of departing vehicles, and the list of joining vehicles for the lane in the previous simulation iteration; the main-branch linked list construction algorithm includes: inputting the main chain of the target lane in the previous simulation iteration, ... The process involves: leaving and joining vehicle lists; recording the common vehicle nodes in the main chain and leaving vehicle lists of the target lane during the previous simulation iteration, and deleting the vehicle nodes from the main chain of the target lane during the previous simulation iteration to obtain a first linked list; sorting the vehicle positions in the joining vehicle list of the target lane during the previous simulation iteration, and recording the ordered linked list corresponding to the ordered vehicle sequence as a second linked list; generating the main chain of the target lane during this simulation iteration based on the first and second linked lists; establishing links between each vehicle in the target lane and its closest preceding and following vehicles in each of its adjacent lanes, based on the main chain of the target lane during this simulation iteration, to generate the branch chains of the target lane during this simulation iteration; and forming a main chain-branch chain list of the target lane during this simulation iteration based on the main chain and branch chains of the target lane during this simulation iteration. The vehicle index building module is used to generate a vehicle index for each vehicle in the urban road network based on the main chain-branch chain list. A vehicle traffic simulation module is used to simulate the traffic operation of each vehicle based on the vehicle index of each vehicle in the urban road network and the path plan of each vehicle in the urban road network obtained from external sources. The simulation of the traffic operation of each vehicle based on the vehicle index of each vehicle in the urban road network and the path plan of each vehicle in the urban road network obtained from external sources includes: assigning 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 through GPU multi-threaded parallel execution; wherein, the process of any thread of the GPU simulating the traffic operation of any vehicle in the urban road network includes: writing simulation algorithm code based on a preset driving strategy, the vehicle index of the target vehicle, and the path plan of the target vehicle to the programming framework of the any thread, so that the any thread simulates the traffic operation of the target vehicle based on the simulation algorithm, the path plan of the target vehicle, and the access results of the vehicle index of the target vehicle. In each of the main chain-branch chain lists, the main chain is used to describe the vehicles in each lane and their positional relationships, and the branch chain is used to describe the positional relationships between each lane and the vehicles in its adjacent lanes. A vehicle index for each of the vehicles, used to index the lane to which each of the vehicles belongs and the vehicles surrounding each of the vehicles; The route planning for each vehicle is the driving navigation for each vehicle from a given starting point to a given destination.
6. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the GPU-based microscopic traffic simulation method as described in any one of claims 1 to 4.
7. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the GPU-based microscopic traffic simulation method as described in any one of claims 1 to 4.
Citation Information
Patent Citations
Method and system for establishing three-dimensional city road network and micro traffic flow simulation
CN106960097A
Motion planning for autonomous vehicles and reconfigurable motion planning processors
CN109477723A