A method for intersection traffic assignment and trajectory calculation for traffic simulation

CN117854271BActive Publication Date: 2026-10-30四川易方智慧科技有限公司
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311627277.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-11-30
Publication Date
2026-10-30
Estimated Expiration
2043-11-30

AI Technical Summary

Technical Problem

[0007]本发明的目的在于提供一种面向交通仿真的交叉路口通行分配及轨迹计算方法,以解决背景技术中提出的交叉路口通行分配需要手动设置,不够灵活,遇到道路修改,需要重新设置的问题

Benefits of technology

通过本发明中的方法,车道通行分配自动计算,无需手动设置,有效的降低了交叉路口的放置设置的工作量,解决了现有交通仿真系统中交叉路口通行分配存在手动设置工作量大、灵活性低的问题。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117854271B_ABST
    Figure CN117854271B_ABST
Patent Text Reader

Abstract

The application discloses a kind of intersection traffic distribution and trajectory calculation method for traffic simulation, comprising the following steps: step S1, obtaining intersection information;Step S2, obtain the import and export lane information of each road section;Step S3, calculate the distribution of each road section import road to other road;Step S4, calculate the situation of each road section export road from other road;Step S5, lane traffic distribution and calculate vehicle intersection driving trajectory.Through the method in the application, lane traffic distribution is automatically calculated, without manual setting, effectively reduce the workload of intersection placement setting, solve the problem that the existing traffic simulation system intersection traffic distribution exists manual setting workload, low flexibility.Through the method in the application, it can also automatically calculate the intersection driving trajectory of simulation vehicle and automatically judge the intersection simulation vehicle steering type.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of traffic engineering technology, specifically a method for traffic allocation and trajectory calculation at intersections for traffic simulation. Background Technology

[0002] Since the 1980s, the country has vigorously developed basic transportation infrastructure, and significant progress has been made in road construction in my country's large and medium-sized cities. Currently, vehicle-to-everything (V2X) and Intelligent Transportation Systems (ITS) are also developing rapidly, forming a relatively complete road traffic system. However, with the increase in the number of vehicles, urban pollution is becoming increasingly serious, traffic pressure is increasing, and the utilization rate of roads varies. For congested road sections, municipal planning requires redesign and replanning. To assess the environmental pollution caused by vehicle exhaust and verify the rationality and effectiveness of municipal road design, a three-dimensional traffic simulation system needs to be designed based on urban road data to test simulation effects and efficiency. This system is also of great significance for urban traffic display and accident scene reconstruction. Current traffic simulation technology, in terms of simulation scale, still suffers from limitations such as small simulation scale, insufficient flexibility, and limited application value. In terms of three-dimensional simulation, most methods use graphics tools such as 3ds Max and CAD to model roads. However, methods for modeling three-dimensional road networks and intersections through programs are relatively complex and require a foundation in computer graphics.

[0003] In one existing technique, Adam Goodenough and Scott Brown proposed a method to integrate CityEnine and SUMO to construct scenes, combining the simulation advantages of SUMO with the modeling advantages of the City-Engine urban model.

[0004] The drawback of the existing technology is that the traffic allocation at intersections needs to be set manually, which is not flexible enough. If the road is modified, it needs to be reset.

[0005] In the second prior art, Wang Xianlong et al. proposed a method for automatically constructing a three-dimensional urban road network, which realizes the automatic identification of planar road structures and intersection structures and the automatic construction of three-dimensional scenes.

[0006] The drawback of the existing technology 2 is that the traffic allocation at intersections needs to be set manually, which is not flexible enough. If the road is modified, the traffic allocation needs to be reset. Summary of the Invention

[0007] The purpose of this invention is to provide a method for traffic allocation and trajectory calculation at intersections for traffic simulation, in order to solve the problem in the background art that traffic allocation at intersections needs to be manually set, which is not flexible enough and needs to be reset when the road is modified.

[0008] To solve the above-mentioned technical problems, the technical solution adopted by the present invention is as follows: A method for traffic allocation and trajectory calculation at intersections for traffic simulation includes the following steps: Step S1: Obtain intersection information; specifically: obtain intersection information through the RoadInfos list of road segments connected to the intersection. The road segment information list includes the road segment ID and the control point index MarkerIndex at the intersection where the road segment connects. The lanes of each road segment are divided into entrance lanes (EnterLanes) and exit lanes (ExitLanes). The lane information (LaneData) includes the lane name, location, and direction vector. Step S2, obtain the entrance and exit information for each road segment; including the following steps: Step S201: Obtain the rectangular point set Polygon of road segment outline points from the road segment information list, with a size of n; Step S202, define two dictionaries: Dictionary <string,List <lanedata>> Named Road_EnterLanes and Road_ExitLanes, these are used to store the entrance and exit lanes corresponding to road segments. The key of the dictionary is the road segment ID, and the value is the lane information. Step S203: Define an array Pos of size 2 to store the required road segment outline points for later calculation of lane positions; Step S204: Iterate through the RoadInfos list of road segment information connected to the intersection and determine whether MarkerIndex is 0. Step S205: If MarkerIndex equals 0, then the left lane of the road segment is the exit lane and the right lane is the entrance lane. Take the two points Polygon[0] and Polygon[1] and store them in Pos; traverse the left lane to obtain the exit lane information and store it in List. <lanedata>The lane name is RoadId_Left_i; the obtained exit lane information will be listed. <lanedata>Stored in the dictionary Road_ExitLanes, with the key being the current road segment ID; traverse the right lanes to obtain the entrance lane information, with the lane name being RoadId_Right_i; and store it in the dictionary Road_EnterLanes; Step S206: If MarkerIndex is not equal to 0, then the left lane of the road segment is the entrance lane and the right lane is the exit lane. Take the two points Polygon[n-1] and Polygon[n-2] and store them in Pos; traverse the left lane to obtain the entrance lane information and store it in List. <lanedata>The lane name is RoadId_Left_i; the obtained entrance lane information will be listed. <lanedata>Stored in the dictionary Road_EnterLanes, with the key being the current road segment ID; traverse the right lanes to obtain the exit lane information, with the lane name being RoadId_Right_i; and store it in the dictionary Road_ExitLanes; Step S3: Calculate the allocation of each road segment's entrance lane to other roads; Step S4: Calculate the situation where the exit lanes of each road segment are accessed from other roads; Step S5: Lane traffic allocation and calculation of vehicle travel trajectories at intersections.

[0009] According to the above technical solution, road segment information is stored clockwise with the intersection as the center.

[0010] According to the above technical solution, the lane name includes the road segment ID (RoadId), the left and right directions (Direction), and the lane number (LaneNum), namely RoadId_Direction_LaneNum.

[0011] According to the above technical solution, step S205, traversing the left lane specifically involves: Location:

[0012]

[0013] Where width is the sum of the widths of the preceding lanes, LeftLaneWidth[i] is the current lane width, and normalized is a unit vector; Direction vector:

[0014]

[0015] Where Cross is the cross product function, and N is the vertical upward normal of the road segment.

[0016] According to the above technical solution, step S205, traversing the right lane specifically involves: Location:

[0017]

[0018] Where width is the sum of the widths of the lanes in front, RightLaneWidth[i] is the width of the current lane, and normalized is a unit vector; Direction vector:

[0019]

[0020] Where Cross is the cross product function, and N is the vertical upward normal of the road segment.

[0021] According to the above technical solution, the specific calculation method in step S3 includes the following steps: Step S301, first define the dictionary. <string,List <lanedata>>FromTo_EnterLanes, the key is the string From_To composed of the IDs of the road segments (From) to another road segment (To), and the value is the entrance lane of the From road segment; Step S302: Iterate through the RoadInfos information of the road segments connected to the intersection. The index of the current road segment information in the list is Index. Based on the RoadId in the road segment information, obtain the dictionary Road_EnterLanes obtained in step S2, and obtain the entrance lane information of the current road segment from the dictionary Road_EnterLanes. Step S303: The obtained approach lane information is evaluated. If the number of approach lanes is not zero, then the coefficient for lane allocation segments is determined.

[0022]

[0023] Here, InfoCount represents the size of RoadInfos, i.e., the number of road segments, and EnterLaneCount represents the number of approach lanes.

[0024] According to the above technical solution, based on coefficient C LR The allocation of each lane to other road segments is calculated using the following method: Step S3011: Define the number of steps as count, the step size as step, and the step size coefficient as C. step =C LR k=1, j=EnterLaneCount-1; Execute the outer loop, checking if j≥0. At the end of each loop, decrement j and increment k; if the condition is met, then:

[0025]

[0026] CeilToInt(x) is a function that returns the smallest integer greater than or equal to x; Step S3012: When k=1, step=0; when k>1, determine if InfoCount-1≥EnterLaneCount. If InfoCount-1 is greater than or equal to EnterLaneCount, then:

[0027]

[0028] C step +=C LR If InfoCount-1 is less than EnterLaneCount, then: C step +=C LR

[0029] ; Step S3013: Execute the inner loop, record the allocation status, determine whether step < count and step ≥ 0, and increment step at the end of each loop; create key = current segment Id + "_" + (Index + 1 + step) % InfoCount segment Id; Step S3014: Determine if the key exists in the dictionary FromTo_EnterLanes. If it exists, add the entrance lane information of lane j directly to the value. If it does not exist, create a new value, add the entrance lane information of lane j, and add the new key-value pair to FromTo_EnterLanes.

[0030] According to the above technical solution, the calculation method in step S4 is as follows: Step S401, Define a dictionary. <string,List <lanedata>>FromTo_ExitLanes, the key is the string From_To consisting of the IDs of the road segments (From) to (To), and the value is the exit lane of the To road segment; Step S402: Iterate through the RoadInfos information of the road segments connected to the intersection. The index of the current road segment information in the list is Index. Based on the RoadId in the road segment information, obtain the dictionary Road_ExitLanes obtained in step S2, and obtain the exit lane information of the current road segment from the dictionary Road_ExitLanes. Step S403: Based on the exit lane information of the current road segment obtained in step S402, determine the coefficient C for lane allocation on the road segment. RL :

[0031]

[0032] Here, InfoCount represents the size of RoadInfos, i.e. the number of road segments, and ExitLaneCount represents the number of exit lanes.

[0033] According to the above technical solution, based on coefficient C LR The allocation of each lane to other road segments is calculated using the following method: Step S4011: Define the number of steps as count, the step size as step, and the step size coefficient as C. step =C RL k=1, j=0; execute the outer loop, checking if j < InfoCount - 1, incrementing j and k at the end of each loop; if the condition is met, then:

[0034]

[0035] CeilToInt(x) is a function that returns the smallest integer greater than or equal to x; Step S4012: When k=1, step=0; when k>1, determine if ExitLaneCount≥InfoCount-1. If ExitLaneCount is greater than or equal to InfoCount-1, then:

[0036]

[0037] C step +=C RL , If ExitLaneCount is less than InfoCount-1, then: C step +=C RL

[0038] ; Step S4013: Execute the inner loop, record the allocation status, determine whether step < count and step ≥ 0, increment step at the end of each loop; create key = (Index + 1 + j) % InfoCount segment Id + "_" + current segment Id; Step S4014: Determine if the key exists in the dictionary FromTo_ExitLanes. If it exists, add the exit lane information of the first lane directly to the value. If it does not exist, create a new value, add the exit lane information of the first lane, and add the new key-value pair to FromTo_ExitLanes.

[0039] According to the above technical solution, the specific calculation method in step S5 is as follows: Step S501, first define the dictionary. <string,List <connection>>VehicleTrack, the key is the lane name of the entrance lane, the value is the traffic status, and Connection is the connection information, which consists of the lane name of the exit lane, the steering type, and the vehicle's travel trajectory points; Step S501: After obtaining the dictionaries FromTo_EnterLanes and FromTo_ExitLanes through steps S3 and S4, the exit lane of the road segment that matches the entrance lane of the road segment is obtained through the same key in the dictionary, and the lane allocation is completed. Step S502: Loop through the key-value pairs of the dictionary FromTo_EnterLanes and retrieve the value List. <lanedata>EnterLanes; Step S503: Determine whether the key's value is contained in the dictionary FromTo_ExitLanes. If the key's value is contained in the dictionary FromTo_ExitLanes, then retrieve the List. <lanedata>ExitLanes then has the coefficient for allocating the import lane to the export lane:

[0040]

[0041] Where EnterLaneCount represents the size of the list EnterLanes, and ExitLaneCount represents the size of the list ExitLanes; According to coefficient C LR The allocation of each lane to other road segments is calculated using the following method: Step B1: Define the number of steps as count, the step size as step, and the step size coefficient as C. step =C EnEx k=1, i=EnterLaneCount-1; Execute the outer loop, checking if i≥0, decrementing i and incrementing k at the end of each loop; if the condition is met, then:

[0042]

[0043] CeilToInt(x) is a function that returns the smallest integer greater than or equal to x; Step B2: When k=1, step=0; when k>1, check if ExitLaneCount ≥ EnterLaneCount. If ExitLaneCount is greater than or equal to EnterLaneCount, then:

[0044]

[0045] C step +=C EnEx ; If ExitLaneCount is less than EnterLaneCount, then: C step +=C EnEx

[0046]

[0047] Step B3: Execute the inner loop, record the allocation status, and check if there is a case where step < count and step ≥ 0. If successful, continue execution; otherwise, end the loop. Step B4: After one loop, increment step; create key = EnterLanes[i].LaneName, and check if the key exists in the dictionary VehicleTrack; Step B5: If step S5014 exists, create a new Connection object with the exit channel name ExitLanes[step].LaneName; Step B6, calculate the steering type. The steering type is determined by calculating the size of the included angle. Specifically:

[0048]

[0049] Angle(V1,V2) is a function to calculate the angle between two vectors. When angle≤45, it means going straight; when angle≤180 and angle≥165, it means turning around; when 45<angle<165, it means turning left or right. Step B7: When 45 < angle < 165, determine the left or right turn by comparing the result of the dot product. Specifically:

[0050]

[0051] Where Dot is the dot product function, Cross is the cross product function, and vector V up The vertical upward unit vector is (0,1,0). If it is less than 0, it is a left turn; otherwise, it is a right turn. The method for calculating vehicle trajectory points is as follows: Step B8: Calculate the intersection of the entrance lane and the exit lane. The position and direction of the entrance lane and the position and direction of the exit lane have been obtained in step S2. The position and direction of the entrance lane can determine a straight line, and the position and direction of the exit lane can determine another straight line. The intersection point (Intersection) of the two non-parallel straight lines can be determined. Step B9: Given the location of the entrance lane, the location of the exit lane, and the intersection point calculated in step S5018, the vehicle trajectory path points between the entrance lane and the exit lane are calculated using the Bézier curve algorithm. Step B10: Add the newly created Connection object to the value; In step B11, if the value in step S5014 does not exist, create a new value, add a new Connection object, and add a key-value pair to VehicleTrack.

[0052] Compared with the prior art, the present invention has the following beneficial effects: The method in this invention automatically calculates lane traffic allocation without requiring manual settings, effectively reducing the workload of setting up intersections and solving the problems of large workload and low flexibility in manual setting of intersection traffic allocation in existing traffic simulation systems.

[0053] The method in this invention can also automatically calculate the driving trajectory of simulated vehicles at intersections and automatically determine the turning type of simulated vehicles at intersections. Attached Figure Description

[0054] Figure 1 This is a schematic diagram of the road sections and intersection structures in the present invention. Figure 2 This is a schematic diagram of lane information in this invention; Figure 3 This is a schematic diagram of the mid-path branching in this invention; Figure 4 This is a schematic diagram of the lane division in this invention; Figure 5 This is a diagram illustrating the lane allocation effect at a T-shaped intersection according to the present invention. Figure 6 This is a diagram illustrating the effect of lane traffic allocation at a crossroads according to the present invention. Detailed Implementation

[0055] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention. Example 1

[0056] A method for traffic allocation and trajectory calculation at intersections for traffic simulation includes the following steps: like Figure 1 As shown, step S1 involves obtaining intersection information; specifically, this involves obtaining intersection information through the road segment information list (RoadInfos) connected to the intersection. The road segment information list includes the road segment ID and the control point index MarkerIndex at the intersection where the road segment connects. Each road segment's lanes are divided into entrance lanes (EnterLanes) and exit lanes (ExitLanes). Lane information (LaneData) includes lane name, location, and direction vector. like Figure 2 As shown, step S2 involves obtaining the entrance and exit lane information for each road segment; this includes the following steps: Step S201: Obtain the rectangular point set Polygon of the road segment outline points, with a size of n; Step S202, define two dictionaries: Dictionary <string,List <lanedata>The dictionary is named Road_EnterLanes and Road_ExitLanes, and is used to store the entrance lanes and exit lanes corresponding to the road segments. The key of the dictionary is the road segment ID, and the value is the lane information. Step S203: Define an array Pos of size 2 to store the required road segment outline points for later calculation of lane positions; Step S204: Iterate through the RoadInfos information of the road segments connected to the intersection and determine whether MarkerIndex is 0. Step S205: If MarkerIndex equals 0, then the left lane of the road segment is the exit lane and the right lane is the entrance lane. Take the two points Polygon[0] and Polygon[1] and store them in Pos; traverse the left lane to obtain the exit lane information and store it in List. <lanedata>The lane name is RoadId_Left_i; the obtained exit lane information will be listed. <lanedata>Stored in the dictionary Road_ExitLanes, with the key being the current road segment ID; traverse the right lanes to obtain the entrance lane information, with the lane name being RoadId_Right_i; and store it in the dictionary Road_EnterLanes; Step S206: If MarkerIndex is not equal to 0, then the left lane of the road segment is the entrance lane and the right lane is the exit lane. Take the two points Polygon[n-1] and Polygon[n-2] and store them in Pos; traverse the left lane to obtain the entrance lane information and store it in List. <lanedata>The lane name is RoadId_Left_i; the obtained entrance lane information will be listed. <lanedata>Stored in the dictionary Road_EnterLanes, with the key being the current road segment ID; traverse the right lanes to obtain the exit lane information, with the lane name being RoadId_Right_i; and store it in the dictionary Road_ExitLanes; Step S3: Calculate the allocation of each road segment's entrance lane to other roads; Step S4: Calculate the situation where the exit lanes of each road segment are accessed from other roads; Step S5: Lane traffic allocation and calculation of vehicle travel trajectories at intersections.

[0057] like Figure 5 and Figure 6 As shown, the method in this invention automatically calculates lane traffic allocation without requiring manual settings, effectively reducing the workload of setting up intersections and solving the problems of high workload and low flexibility in manual setting of intersection traffic allocation in existing traffic simulation systems. The method in this invention can also automatically calculate the driving trajectory of simulated vehicles at intersections and automatically determine the turning type of simulated vehicles at intersections. Example 2

[0058] The inventive concept of this invention is as follows: Step S1: Determine intersection information Given a list of road segment information (RoadInfos) connected to an intersection, the road segment information includes the road segment ID and the MarkerIndex (0 or n, where 0 represents the starting mark and n represents the ending mark) of the control point at the intersection. The road segment information is stored clockwise from the intersection. Figure 1 As shown.

[0059] Each road segment is divided into entrance lanes (EnterLanes) and exit lanes (ExitLanes). Lane information (LaneData) includes lane name, position, and direction vector. The lane name is composed of the road segment ID (RoadId), left and right direction (Direction), and lane number (LaneNum), i.e., RoadId_Direction_LaneNum. The left and right direction of the lane refers to the direction from the start to the end of the road segment control point. The lane number is the lane number from the outside to the inside of the road segment, and the lane number increments from 0. The position (Position) is the three-dimensional spatial coordinate of the point where the road segment lane connects to the intersection. The direction vector (Vector) is the direction of the lane.

[0060] Step S2: Obtain the entrance and exit lane information for each road segment. The road segment outline points are known to be a rectangular point set Polygon of size n.

[0061] First, define two dictionaries: Dictionary <string,List <lanedata>The key is the road segment ID, and the value is the road segment lane information, namely Road_EnterLanes and Road_ExitLanes, which store the entrance lane and exit lane corresponding to the road segment. An array Pos of size 2 is defined to store the required road segment outline points for later calculation of lane positions.

[0062] Iterate through the RoadInfos information of the road segments connected by the intersection and determine whether MarkerIndex is 0. If it is 0, the left lane of the road segment is the exit lane and the right lane is the entrance lane. Take Polygon[0] and Polygon[1] and store them in Pos. If it is not 0, the left lane of the road segment is the entrance lane and the right lane is the exit lane. Take Polygon[n-1] and Polygon[n-2] and store them in Pos.

[0063] like Figure 2 As shown, taking MarkerIndex equal to 0 as an example, we define i=0 and increment it sequentially. By traversing the left lane, we can obtain the entrance lane information and store it in a List. <lanedata>The lane name is RoadId_Left_i; the location is:

[0064]

[0065] Where `width` is the sum of the widths of the preceding lanes, `LeftLaneWidth[i]` is the current lane width, `normalized` is a unit vector, and the direction vector is:

[0066]

[0067] Where Cross is the cross product function, and N is the vertical upward normal of the road segment; the acquired entrance lane information List <lanedata>This information is stored in the dictionary `Road_EnterLanes`, with the key being the current road segment ID. Similarly, traversing the right lanes yields the exit lane information, with the lane name being `RoadId_Right_i`. The location is:

[0068] ; The direction vector is:

[0069]

[0070] It is stored in the dictionary Road_ExitLanes.

[0071] Step S3: Calculate the allocation of each road segment's entrance lane to other roads. like Figure 3 As shown, first define a dictionary (Dictionary). <string,List <lanedata>>FromTo_EnterLanes, the key is the string From_To composed of the IDs of the road segments (From) to (To), and the value is the entrance lane of the From road segment; Iterate through the RoadInfos list of road segments connected to the intersection. The index of the current road segment information in the list is Index. Based on the RoadId in the road segment information, obtain the dictionary Road_EnterLanes obtained in step S2, and obtain the entrance lane information of the current road segment from the dictionary Road_EnterLanes. The obtained entrance lane information is evaluated. If the number of entrance lanes is not zero, then the coefficient for lane allocation segments is determined.

[0072]

[0073] Here, InfoCount represents the size of RoadInfos, i.e., the number of road segments, and EnterLaneCount represents the number of approach lanes.

[0074] Based on coefficient C LR Calculate the allocation of each lane to other road segments, i.e., lane separation. Figure 3 As shown, since road segment information is stored clockwise in S1, lane allocation should start with the lane with the highest lane number. The specific calculation method is as follows, completed by two nested loops: Define the number of steps (the number of steps is the maximum value of incrementing step) as count, the step size as step, and the step size coefficient C. step =C LR k=1, j=EnterLaneCount-1; Execute the outer loop, checking if j≥0. At the end of each loop, decrement j and increment k; if the condition is met, then:

[0075]

[0076] CeilToInt(x) is a function that returns the smallest integer greater than or equal to x; When k=1, step=0. When k>1, check if InfoCount-1≥EnterLaneCount. If InfoCount-1 is greater than or equal to EnterLaneCount, then:

[0077]

[0078] C step +=C LR If InfoCount-1 is less than EnterLaneCount, then: C step +=C LR

[0079] ; Execute the inner loop, record the allocation status, check if step < count and step ≥ 0, and increment step at the end of each loop; create a key = current segment Id + "_" + segment Id of (Index + 1 + step) % InfoCount; for example Figure 1 In the example, there are 4 road segments, so infoCount=4. When the current road segment is the first one, index=0. When step=0, then (index+1+step)%InfoCount=1%4=1, which is the second road segment. The id of road segment 1 is 0, and the id of road segment 2 is 1, so key="0_1".

[0080] Check if the key exists in the dictionary FromTo_EnterLanes. If it exists, add the entrance information of lane j directly to the value. If it does not exist, create a new value, add the entrance information of lane j, and add the new key-value pair to FromTo_EnterLanes.

[0081] After executing the entire process, the information on how each road segment's entrance lanes are allocated to other roads can be obtained and stored in the dictionary FromTo_EnterLanes as key-value pairs.

[0082] Step S4: Calculate the situation where each road segment's exit lane comes from other roads. like Figure 4 As shown, define a dictionary. <string,List <lanedata>>FromTo_ExitLanes, the key is the string From_To consisting of the IDs of the road segments (From) to (To), and the value is the exit lane of the To road segment; Iterate through the RoadInfos list of road segments connected to the intersection. The index of the current road segment information in the list is Index. Based on the RoadId in the road segment information, obtain the dictionary Road_ExitLanes obtained in step S2, and obtain the exit lane information of the current road segment from the dictionary Road_ExitLanes. Based on the obtained exit lane information for the current road segment, the coefficient C for lane allocation for that road segment is determined. RL :

[0083]

[0084] Here, InfoCount represents the size of RoadInfos, i.e., the number of road segments, and ExitLaneCount represents the number of exit lanes.

[0085] Based on coefficient C RL Calculate the situations where other road segments can be assigned exit lanes, i.e., road lane division such as Figure 4 As shown, the specific calculation method is as follows, which is completed by two nested loops: Let count be the number of steps, step be the step size, and C be the step size coefficient. step =C RL k=1, j=0; execute the outer loop, checking if j < InfoCount - 1, incrementing j and k at the end of each loop; if the condition is met, then:

[0086]

[0087] CeilToInt(x) is a function that returns the smallest integer greater than or equal to x; When k=1, step=0. When k>1, check if ExitLaneCount≥InfoCount-1. If ExitLaneCount is greater than or equal to InfoCount-1, then:

[0088]

[0089] C step +=C RL , If ExitLaneCount is less than InfoCount-1, then: C step +=C RL

[0090] ; Execute the inner loop, record the allocation status, check if step < count and step ≥ 0, and increment step at the end of each loop; create a key = (Index + 1 + j) % InfoCount segment Id + "_" + current segment Id; Check if the key exists in the dictionary FromTo_ExitLanes. If it exists, add the exit lane information of the first lane directly to the value. If it does not exist, create a new value, add the exit lane information of the first lane, and add the new key-value pair to FromTo_ExitLanes.

[0091] Step S5: Lane allocation and calculation of vehicle trajectory at intersection First, define a dictionary. <string,List <connection>>VehicleTrack, the key is the name of the entrance lane, the value is the traffic status, and Connection is the connection information, which consists of the name of the exit lane, the steering type, and the vehicle's trajectory points; After obtaining the dictionaries FromTo_EnterLanes and FromTo_ExitLanes through steps S3 and S4, the exit lanes of the road segment that match the entrance lanes of the road segment are obtained through the same keys in the dictionaries, thus completing the allocation of lane passage. Loop through the dictionary FromTo_EnterLanes and retrieve a list of keys and values. <lanedata>EnterLanes; Check if the value of the key is contained in the dictionary FromTo_ExitLanes. If the value of the key is contained in the dictionary FromTo_ExitLanes, then retrieve the List. <lanedata>ExitLanes then has the coefficient for allocating the import lane to the export lane:

[0092]

[0093] Where EnterLaneCount represents the size of the list EnterLanes, and ExitLaneCount represents the size of the list ExitLanes.

[0094] Based on coefficient C EnEx The calculation of the allocation of the approach lane to the exit lane, i.e., lane separation, is performed as follows, also using two nested loops: Let count be the number of steps, step be the step size, and C be the step size coefficient. step =C EnEx k=1, i=EnterLaneCount-1; Execute the outer loop, checking if i≥0, decrementing i and incrementing k at the end of each loop; if the condition is met, then:

[0095]

[0096] CeilToInt(x) is a function that returns the smallest integer greater than or equal to x; When k=1, step=0. When k>1, check if ExitLaneCount ≥ EnterLaneCount. If ExitLaneCount is greater than or equal to EnterLaneCount, then:

[0097]

[0098] C step +=C EnEx ; If ExitLaneCount is less than EnterLaneCount, then: C step +=C EnEx

[0099]

[0100] Execute the inner loop, record the allocation status, and check if there is a step < count and step ≥ 0. If successful, continue execution; otherwise, end the loop. After each loop, step is incremented; a key is created = EnterLanes[i].LaneName, and it is checked whether the key exists in the dictionary VehicleTrack. If it exists, a new Connection object is created with the exit lane name ExitLanes[step].LaneName; The steering type is determined by calculating the angle between the two sides. Specifically:

[0101] , Angle(V1,V2) is a function to calculate the angle between two vectors. When angle≤45, it means going straight; when angle≤180 and angle≥165, it means turning around; when 45<angle<165, it means turning left or right. To determine the magnitude of the dot product, specifically:

[0102]

[0103] Where Dot is the dot product function, Cross is the cross product function, and vector V up The vertical upward unit vector is (0,1,0). If it is less than 0, it is a left turn; otherwise, it is a right turn. The method for calculating vehicle trajectory points is as follows: By calculating the intersection of the entrance lane and the exit lane, and given that the position and direction of the entrance lane and the exit lane have been determined in step S2, the intersection point between the two lanes can be calculated. Knowing the position of the entrance lane, the position of the exit lane, and the intersection point, the vehicle trajectory path points between the entrance lane and the exit lane can be calculated using the Bézier curve algorithm.

[0104] Add a new Connection object to the value.

[0105] If the value does not exist, a new value is created, a new Connection object is added, and a new key-value pair is added to VehicleTrack. After completing the entire process, lane allocation and vehicle intersection travel trajectories can be obtained and stored in the VehicleTrack dictionary.

[0106] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus.

[0107] Finally, it should be noted that the above descriptions are merely preferred embodiments of the present invention and are not intended to limit the present invention. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art can still modify the technical solutions described in the foregoing embodiments or make equivalent substitutions for some of the technical features. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.< / lanedata> < / lanedata> < / connection> < / lanedata> < / lanedata> < / lanedata> < / lanedata> < / lanedata> < / lanedata> < / lanedata> < / lanedata> < / lanedata> < / lanedata> < / lanedata> < / lanedata> < / connection> < / lanedata> < / lanedata> < / lanedata> < / lanedata> < / lanedata> < / lanedata> < / lanedata>

Claims

1. A method for traffic allocation and trajectory calculation at intersections for traffic simulation, characterized in that: Includes the following steps: Step S1: Obtain intersection information; specifically: obtain intersection information through the RoadInfos list of road segments connected to the intersection. The road segment information list includes the road segment ID and the control point index MarkerIndex at the intersection where the road segment connects. The lanes of each road segment are divided into EnterLanes (entry lanes) and ExitLanes (exit lanes). The lane information LaneData includes the lane name, location, and direction vector. Step S2, obtain the entrance and exit information for each road segment; including the following steps: Step S201: Obtain the rectangular point set Polygon of road segment outline points from the road segment information list, with a size of n; Step S202, define two dictionaries: Dictionary <string,List <lanedata> The dictionary is named Road_EnterLanes and Road_ExitLanes to store the entrance and exit lanes corresponding to the road segment. The key of the dictionary is the road segment ID and the value is the lane information.< / lanedata> Step S203: Define an array Pos of size 2 to store the required road segment outline points for later calculation of lane positions; Step S204: Iterate through the RoadInfos list of road segment information connected to the intersection and determine whether MarkerIndex is 0. Step S205: If MarkerIndex equals 0, then the left lane of the road segment is the exit lane and the right lane is the entrance lane. Take the two points Polygon[0] and Polygon[1] and store them in Pos; traverse the left lane to obtain the exit lane information and store it in List. <lanedata>The lane name is RoadId_Left_i; the obtained exit lane information will be listed. <lanedata> Stored in the dictionary Road_ExitLanes, with the key being the current road segment ID; traverse the right lanes to obtain the entrance lane information, with the lane name being RoadId_Right_i; and store it in the dictionary Road_EnterLanes;< / lanedata> < / lanedata> Step S206: If MarkerIndex is not equal to 0, then the left lane of the road segment is the entrance lane and the right lane is the exit lane. Take the two points Polygon[n-1] and Polygon[n-2] and store them in Pos; traverse the left lane to obtain the entrance lane information and store it in List. <lanedata>The lane name is RoadId_Left_i; the obtained entrance lane information will be listed. <lanedata> Stored in the dictionary Road_EnterLanes, with the key being the current road segment ID; traverse the right lanes to obtain the exit lane information, with the lane name being RoadId_Right_i; and store it in the dictionary Road_ExitLanes;< / lanedata> < / lanedata> Step S3, calculate the allocation of each road segment's approach lane to other roads; including the following steps: Step S301, first define the dictionary. <string,List <lanedata> >FromTo_EnterLanes, the key is the string From_To consisting of the IDs of the road segments from From to To, and the value is the entrance lane of the From road segment;< / lanedata> Step S302: Iterate through the RoadInfos list of road segment information connected to the intersection. The index of the current road segment information in the list is Index. Based on the RoadId in the road segment information, obtain the dictionary Road_EnterLanes obtained in step S2, and obtain the approach lane information of the current road segment from the dictionary Road_EnterLanes. Step S303: The obtained approach lane information is evaluated. If the number of approach lanes is not zero, then the coefficient for lane allocation segments is determined. Among them, InfoCount represents the size of RoadInfos, i.e., the number of road segments, and EnterLaneCount represents the number of approach lanes; According to coefficient C LR The allocation of each lane to other road segments is calculated using the following method: Step S3011: Define the number of steps as count, the step size as step, and the step size coefficient as C. step =C LR k=1, j=EnterLaneCount-1; Execute the outer loop, checking if j≥0. At the end of each loop, decrement j and increment k; if the condition is met, then: CeilToInt(x) is a function that returns the smallest integer greater than or equal to x; Step S3012: When k=1, step=0; when k>1, determine if InfoCount-1≥EnterLaneCount. If InfoCount-1 is greater than or equal to EnterLaneCount, then: C step +=C LR If InfoCount-1 is less than EnterLaneCount, then: C step +=C LR ; Where InfoCount represents the size of RoadInfos, i.e. the number of road segments; Step S3013: Execute the inner loop, record the allocation status, determine whether step < count and step ≥ 0, and increment step at the end of each loop; create key = current segment Id + "_" + (Index + 1 + step) % InfoCount segment Id; Step S3014: Determine if the key exists in the dictionary FromTo_EnterLanes. If it exists, add the entrance lane information of lane j directly to the value. If it does not exist, create a new value, add the entrance lane information of lane j, and add the new key-value pair to FromTo_EnterLanes. Step S4: Calculate the situation where each road segment's exit lanes are accessed from other roads; the specific calculation method is as follows: Step S401, Define a dictionary. <string,List <lanedata> >FromTo_ExitLanes, the key is the string From_To consisting of the IDs of the routes from one road segment From to another road segment To, and the value is the exit lane of the To road segment;< / lanedata> Step S402: Iterate through the RoadInfos list of road segment information connected to the intersection. The index of the current road segment information in the list is Index. Based on the RoadId in the road segment information, obtain the dictionary Road_ExitLanes obtained in step S2, and obtain the exit lane information of the current road segment from the dictionary Road_ExitLanes. Step S403: Based on the exit lane information of the current road segment obtained in step S402, determine the coefficient C for lane allocation on the road segment. RL : Where InfoCount represents the size of RoadInfos, i.e., the number of road segments, and ExitLaneCount represents the number of exit lanes; according to coefficient C RL Calculate the allocation of each lane to other road segments; Step S5: Lane traffic allocation and calculation of vehicle travel trajectories at intersections.

2. The method for traffic allocation and trajectory calculation at intersections based on traffic simulation as described in claim 1, characterized in that: Road segment information is stored clockwise with the intersection as the center.

3. The method for traffic allocation and trajectory calculation at intersections based on traffic simulation as described in claim 1, characterized in that: The lane name includes the road segment ID (RoadId), the left and right direction direction (Direction), and the lane number (LaneNum, RoadId_Direction_LaneNum).

4. The method for traffic allocation and trajectory calculation at intersections based on traffic simulation as described in claim 1, characterized in that: In step S205, traversing the left lane specifically involves: Location: Where width is the sum of the widths of the preceding lanes, LeftLaneWidth[i] is the current lane width, and normalized is a unit vector; Direction vector: Where Cross is the cross product function, and N is the vertical upward normal of the road segment.

5. The method for traffic allocation and trajectory calculation at intersections based on traffic simulation as described in claim 1, characterized in that: In step S205, traversing the right lane specifically involves: Location: Where width is the sum of the widths of the lanes in front, RightLaneWidth[i] is the width of the current lane, and normalized is a unit vector; Direction vector: Where Cross is the cross product function, and N is the vertical upward normal of the road segment.

6. The method for traffic allocation and trajectory calculation at intersections based on traffic simulation as described in claim 1, characterized in that: According to coefficient C RL The allocation of each lane to other road segments is calculated using the following method: Step S4011: Define the number of steps as count, the step size as step, and the step size coefficient as C. step =C RL k=1, j=0; execute the outer loop, checking if j < InfoCount - 1, incrementing j and k at the end of each loop; if the condition is met, then: CeilToInt(x) is a function that returns the smallest integer greater than or equal to x; Step S4012: When k=1, step=0; when k>1, determine if ExitLaneCount≥InfoCount-1. If ExitLaneCount is greater than or equal to InfoCount-1, then: C step +=C RL , If ExitLaneCount is less than InfoCount-1, then: C step +=C RL ; Step S4013: Execute the inner loop, record the allocation status, determine whether step < count and step ≥ 0, increment step at the end of each loop; create key = (Index + 1 + j) % InfoCount segment Id + "_" + current segment Id; Step S4014: Determine if the key exists in the dictionary FromTo_ExitLanes. If it exists, add the exit lane information of the first lane directly to the value. If it does not exist, create a new value, add the exit lane information of the first lane, and add the new key-value pair to FromTo_ExitLanes.

7. The method for traffic allocation and trajectory calculation at intersections based on traffic simulation as described in claim 1, characterized in that: In step S5, the specific calculation method is as follows: Step S501, first define the dictionary. <string,List <connection> >VehicleTrack, the key is the lane name of the entrance lane, the value is the traffic status, and Connection is the connection information, which consists of the lane name of the exit lane, the steering type, and the vehicle's travel trajectory points;< / connection> After obtaining the dictionaries FromTo_EnterLanes and FromTo_ExitLanes through steps S3 and S4, the exit lanes of the road segment that match the entrance lanes of the road segment are obtained through the same keys in the dictionaries, thus completing the allocation of lane passage. Step S502: Loop through the key-value pairs of the dictionary FromTo_EnterLanes and retrieve the value List. <lanedata> EnterLanes;< / lanedata> Step S503: Determine whether the key's value is contained in the dictionary FromTo_ExitLanes. If the key's value is contained in the dictionary FromTo_ExitLanes, then retrieve the List. <lanedata> ExitLanes then has the coefficient for allocating the import lane to the export lane:< / lanedata> According to coefficient C EnEx The allocation of each lane to other road segments is calculated using the following method: Step B1: Define the number of steps as count, the step size as step, and the step size coefficient as C. step =C EnEx k=1, i=EnterLaneCount-1; Execute the outer loop, checking if i≥0, decrementing i and incrementing k at the end of each loop; if the condition is met, then: CeilToInt(x) is a function that returns the smallest integer greater than or equal to x; Step B2: When k=1, step=0; when k>1, check if ExitLaneCount ≥ EnterLaneCount. If ExitLaneCount is greater than or equal to EnterLaneCount, then: C step +=C EnEx ; If ExitLaneCount is less than EnterLaneCount, then: C step +=C EnEx Step B3: Execute the inner loop, record the allocation status, and check if there is a case where step < count and step ≥ 0. If successful, continue execution; otherwise, end the loop. Step B4: After one loop, increment step; create key = EnterLanes[i].LaneName, and check if the key exists in the dictionary VehicleTrack; Step B5: If step B4 exists, create a new Connection object with the exit lane name ExitLanes[step].LaneName; Step B6, calculate the steering type. The steering type is determined by calculating the size of the included angle. Specifically: Angle(V1,V2) is a function to calculate the angle between two vectors. When angle≤45, it means going straight; when angle≤180 and angle≥165, it means turning around; when 45<angle<165, it means turning left or right. Step B7: When 45 < angle < 165, determine the left or right turn by comparing the result of the dot product. Specifically: Where Dot is the dot product function, Cross is the cross product function, and vector V up The vertical upward unit vector is (0,1,0). If it is less than 0, it is a left turn; otherwise, it is a right turn. The method for calculating vehicle trajectory points is as follows: Step B8: Calculate the intersection of the entrance lane and the exit lane. The position and direction of the entrance lane and the position and direction of the exit lane have been obtained in step S2. The position and direction of the entrance lane can determine a straight line, and the position and direction of the exit lane can determine another straight line. The intersection point (Intersection) of the two non-parallel straight lines can be determined. Step B9: Given the location of the entrance lane, the location of the exit lane, and the intersection point calculated in step B8, the vehicle trajectory path points between the entrance lane and the exit lane are calculated using the Bézier curve algorithm. Step B10: Add the newly created Connection object to the value; In step B11, if the value in step B4 does not exist, create a new value, add a new Connection object, and add a key-value pair to VehicleTrack.

Citation Information

Patent Citations

  • Large-scale traffic simulation system and method based on parallel computing

    CN111856968A

  • Intersection lane topology connection relation generation method

    CN114495489A