Lane matching method and device, terminal equipment and storage medium
By using pre-built ordered index structures, such as kd-tree, the problem of low lane matching efficiency in the prior art is solved, fast and accurate lane positioning is achieved, and matching efficiency and accuracy are improved.
Patent Information
- Application Number
- CN202311339781.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-16
- Publication Date
- 2025-04-18
AI Technical Summary
The existing lane matching method requires traversing a large amount of lane data and performing complex geometric relationship calculations, which makes the calculation time-consuming and difficult to meet services with high latency requirements.
By pre-constructing an ordered index structure, such as kd-tree, the location coordinates of the target vehicle are used to match distances, and the target lane is quickly positioned to avoid complex geometric area calculations.
It achieves fast and accurate lane matching, improves matching efficiency, reduces time delay, and meets the needs of high precision and high efficiency.
Smart Images

Figure CN119845290A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of assisted driving technology, and in particular to a lane matching method, apparatus, terminal device and storage medium. Background Art
[0002] When doing lane-level path planning or vehicle-to-everything (V2X)-related applications based on high-precision map data, it is necessary to locate the lane based on the main vehicle's position coordinates. In other words, how to quickly and accurately match the main vehicle's lane directly affects the speed and accuracy of path planning or V2X applications.
[0003] The usual lane matching method requires traversing all lane data and calculating the regional matching degree between each lane and the main vehicle through geometric relationships. However, due to the large number of candidate lanes that need to be traversed and the complex geometric relationships used to calculate the matching degree, the calculation is very time-consuming and it is difficult to meet the needs of services with high latency requirements.
[0004] Therefore, it is necessary to propose a solution that can accurately and quickly match the lane where the target vehicle is located. Summary of the invention
[0005] The main purpose of the present application is to provide a lane matching method, apparatus, terminal device and storage medium, aiming to accurately and quickly match the lane where the target vehicle is located.
[0006] To achieve the above object, the present application provides a lane matching method, which includes:
[0007] Obtain the location coordinates and search conditions of the target vehicle;
[0008] Taking the position coordinate as the center, matching is performed on an ordered index structure pre-created based on map coordinate point sequences corresponding to a plurality of lanes to obtain a list of candidate nodes that meet the search condition;
[0009] The target lane where the target vehicle is located is determined according to the candidate node list.
[0010] Optionally, before the step of matching the position coordinates as the center on an ordered index structure pre-created based on map coordinate point sequences corresponding to a plurality of lanes to obtain a list of candidate nodes that meet the search condition, the step further includes:
[0011] Obtaining a map coordinate point sequence corresponding to each of the plurality of lanes; wherein the map coordinate point sequence includes a plurality of lane centerline points;
[0012] Using a preset interpolation step size, linear interpolation encryption is performed on the segments between adjacent lane centerline points to obtain lane centerline interpolation point sequences corresponding to the plurality of lanes;
[0013] Mapping the lane centerline interpolation point sequences corresponding to the plurality of lanes respectively to obtain an interpolated lane centerline node sequence;
[0014] Each node in the lane centerline node column is used as a leaf node to construct the ordered index structure of a preset dimension.
[0015] Optionally, the step of performing linear interpolation encryption on the segments between adjacent lane centerline points at a preset interpolation step size to obtain lane centerline interpolation point sequences corresponding to each of the plurality of lanes comprises:
[0016] Calculating the distance between the adjacent lane centerline points to obtain the segment length between the adjacent lane centerline points;
[0017] Combining the segment length and the interpolation step length, obtaining the number of interpolation points between the adjacent lane centerline points;
[0018] When the number of interpolation points is greater than a preset first threshold, linear interpolation is performed on the segments between the adjacent lane centerline points based on the number of interpolation points to obtain the lane centerline interpolation point sequence.
[0019] Optionally, the search condition includes a neighbor search condition and a range search condition, and the step of matching on an ordered index structure pre-created based on map coordinate point sequences corresponding to a plurality of lanes with the position coordinate as the center to obtain a list of candidate nodes that meet the search condition includes:
[0020] If the search condition is the neighbor search condition, then taking the position coordinate as the center, perform neighbor matching on the ordered index structure to obtain a list of candidate nodes that meet the neighbor search condition;
[0021] If the search condition is the range search condition, range matching is performed on the ordered index structure with the position coordinate as the center to obtain a list of candidate nodes that meet the range search condition.
[0022] Optionally, the step of performing range matching on the ordered index structure with the position coordinate as the center to obtain a list of candidate nodes that meet the range search condition includes:
[0023] Taking the position coordinate as the center, performing range matching on the ordered index structure, and detecting whether the matching is successful;
[0024] If the match is successful, a list of candidate nodes that meet the preset range is obtained;
[0025] If the matching fails, the steps are executed: taking the position coordinates as the center, performing neighbor matching on the ordered index structure to obtain a list of candidate nodes that meet the neighbor search conditions.
[0026] Optionally, the step of determining the target lane where the target vehicle is located according to the candidate node list includes:
[0027] Obtaining the lane identification pre-mapped to each node in the candidate node list;
[0028] De-duplicating the lane identifiers to obtain a candidate lane list;
[0029] The target lane where the target vehicle is located is determined according to the candidate lane list.
[0030] Optionally, the step of determining the target lane where the target vehicle is located according to the candidate lane list includes:
[0031] Obtaining the number of lanes in the candidate lane list, and detecting whether the number of lanes meets a preset second threshold;
[0032] If the number of lanes meets the second threshold, the target lane is obtained;
[0033] If the number of lanes does not meet the second threshold, a preset geometric method is used to match the candidate lane list to obtain the target lane.
[0034] The embodiment of the present application further provides a lane matching device, the lane matching device comprising:
[0035] An acquisition module is used to obtain the location coordinates and search conditions of the target vehicle;
[0036] A matching module, which is used to perform matching on an ordered index structure pre-created based on map coordinate point sequences corresponding to a plurality of lanes, with the position coordinates as the center, to obtain a list of candidate nodes that meet the search conditions;
[0037] A determination module is used to determine the target lane where the target vehicle is located according to the candidate node list.
[0038] An embodiment of the present application also proposes a terminal device, which includes a memory, a processor, and a lane matching program stored in the memory and executable on the processor, wherein the lane matching program implements the steps of the lane matching method described above when executed by the processor.
[0039] An embodiment of the present application further proposes a computer-readable storage medium, on which a lane matching program is stored. When the lane matching program is executed by a processor, the steps of the lane matching method described above are implemented.
[0040] The lane matching method, device, terminal device and storage medium proposed in the embodiment of the present application obtain the position coordinates and search conditions of the target vehicle; with the position coordinates as the center, match on the ordered index structure created in advance based on the map coordinate point columns corresponding to several lanes to obtain a list of candidate nodes that meet the search conditions; determine the target lane where the target vehicle is located based on the candidate node list. By constructing an ordered index structure containing several nodes for all lanes in advance, the target lane can be quickly located by accessing a small number of nodes during lane matching, that is, with the position coordinates of the target vehicle as the center, distance matching is performed on the ordered index structure to obtain a list of candidate nodes, thereby locating the target lane, avoiding complex geometric area calculation methods, effectively solving the technical problem of low lane matching efficiency, and improving the efficiency of lane matching on the basis of ensuring the accuracy of lane matching. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] Figure 1 This is a schematic diagram of the functional modules of the terminal device to which the lane matching device of this application belongs;
[0042] Figure 2 This is a flow chart of a first exemplary embodiment of a lane matching method of the present application;
[0043] Figure 3 This is a flow chart of a second exemplary embodiment of the lane matching method of the present application;
[0044] Figure 4 A flowchart for creating a lane centerline point index structure for the lane matching method of this application;
[0045] Figure 5 This is a flow chart of a third exemplary embodiment of the lane matching method of the present application;
[0046] Figure 6a A schematic diagram of the original lane centerline points of the lane matching method of this application;
[0047] Figure 6b This is a schematic diagram of sparse interpolation of the lane matching method of this application;
[0048] Figure 6c This is a dense interpolation schematic diagram of the lane matching method of this application;
[0049] Figure 7 A schematic diagram of the lane centerline interpolation and encryption process of the lane matching method of this application;
[0050] Figure 8 This is a flowchart of a fourth exemplary embodiment of the lane matching method of the present application.
[0051] Fig. 9 Lane matching search calculation flow chart of the lane matching method of the present application.
[0052] The realization of the purpose, functional features and advantages of this application will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0053] It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0054] The main solution of the embodiment of the present application is: obtain the position coordinates and search conditions of the target vehicle; with the position coordinates as the center, match on the ordered index structure created in advance based on the map coordinate point columns corresponding to several lanes to obtain a list of candidate nodes that meet the search conditions; determine the target lane where the target vehicle is located based on the candidate node list. By constructing an ordered index structure containing several nodes for all lanes in advance, the target lane can be quickly located by accessing a small number of nodes during lane matching, that is, with the position coordinates of the target vehicle as the center, distance matching is performed on the ordered index structure to obtain a list of candidate nodes, thereby locating the target lane, avoiding complex geometric area calculation methods, effectively solving the technical problem of low lane matching efficiency, and improving the efficiency of lane matching on the basis of ensuring the accuracy of lane matching.
[0055] Technical terms involved in the embodiments of this application:
[0056] kd-tree (K-dimensional tree), kd-tree is a binary tree in which each node is a k-dimensional point. All non-leaf nodes can be regarded as a hyperplane that divides the space into two half-spaces. The subtree to the left of the node represents the points on the left side of the hyperplane, and the subtree to the right of the node represents the points on the right side of the hyperplane. The method of selecting the hyperplane is as follows: each node is related to the dimension in k dimensions that is perpendicular to the hyperplane. Therefore, if you choose to divide according to the x-axis, all nodes with x values less than the specified value will appear in the left subtree, and all nodes with x values greater than the specified value will appear in the right subtree. In this way, the hyperplane can be determined by the x value, and its normal is the unit vector of the x-axis.
[0057] The embodiments of the present application take into account the problem of low efficiency of lane matching. When doing lane-level path planning or V2X-related applications based on high-precision map data, it is necessary to locate the lane based on the position coordinates of the main vehicle. How to quickly and accurately match the lane where the main vehicle is located directly affects the speed and accuracy of path planning or V2X applications. The usual method requires traversing all lane data and calculating the regional matching degree between each lane and the main vehicle through geometric relationships. This type of method requires a large number of candidate lanes to be traversed and the matching degree is calculated through relatively complex geometric relationships, so the calculation is very time-consuming and it is difficult to meet the needs of services with high latency requirements.
[0058] Therefore, the embodiment of the present application, starting from the practical problem of low efficiency of lane matching, proposes a fast lane matching method based on kd-tree. By pre-creating an ordered index structure for all lanes, only a small number of branch nodes need to be accessed on the kd-tree structure to quickly locate the target lane, thereby avoiding the high latency caused by traversing and searching a large number of lanes. In addition, in order to make the matching calculation speed faster during the search, by storing two-dimensional coordinate points in the index structure, the matching calculation only calculates the Euclidean distance between the coordinate points, which can improve the efficiency of lane matching while ensuring the accuracy of lane matching.
[0059] Specifically, refer to Figure 1 , Figure 1 This is a functional module diagram of the terminal device to which the lane matching device of this application belongs. The lane matching device can be a device that is independent of the terminal device and can perform lane matching, and it can be carried on the terminal device in the form of hardware or software. The terminal device can be a smart mobile terminal with data processing functions such as a mobile phone or a tablet computer, or a fixed terminal device or server with data processing functions.
[0060] In this embodiment, the terminal device to which the lane matching apparatus belongs includes at least an output module 110 , a processor 120 , a memory 130 and a communication module 140 .
[0061] The memory 130 stores an operating system and a lane matching program. The lane matching device can obtain the position coordinates and search conditions of the target vehicle; with the position coordinates as the center, match on the ordered index structure pre-created based on the map coordinate point columns corresponding to several lanes, and obtain a list of candidate nodes that meet the search conditions; according to the candidate node list, the target lane where the target vehicle is located and other information are stored in the memory 130; the output module 110 can be a display screen, etc. The communication module 140 can include a WIFI module, a mobile communication module, a Bluetooth module, etc., and communicate with an external device or server through the communication module 140.
[0062] When the lane matching program in the memory 130 is executed by the processor, the following steps are implemented:
[0063] Obtain the location coordinates and search conditions of the target vehicle;
[0064] Taking the position coordinate as the center, matching is performed on an ordered index structure pre-created based on map coordinate point sequences corresponding to a plurality of lanes to obtain a list of candidate nodes that meet the search condition;
[0065] The target lane where the target vehicle is located is determined according to the candidate node list.
[0066] Furthermore, when the lane matching program in the memory 130 is executed by the processor, the following steps are also implemented:
[0067] Obtaining a map coordinate point sequence corresponding to each of the plurality of lanes; wherein the map coordinate point sequence includes a plurality of lane centerline points;
[0068] Using a preset interpolation step size, linear interpolation encryption is performed on the segments between adjacent lane centerline points to obtain lane centerline interpolation point sequences corresponding to the plurality of lanes;
[0069] Mapping the lane centerline interpolation point sequences corresponding to the plurality of lanes respectively to obtain an interpolated lane centerline node sequence;
[0070] Each node in the lane centerline node column is used as a leaf node to construct the ordered index structure of a preset dimension.
[0071] Furthermore, when the lane matching program in the memory 130 is executed by the processor, the following steps are also implemented:
[0072] Calculating the distance between the adjacent lane centerline points to obtain the segment length between the adjacent lane centerline points;
[0073] Combining the segment length and the interpolation step length, obtaining the number of interpolation points between the adjacent lane centerline points;
[0074] When the number of interpolation points is greater than a preset first threshold, linear interpolation is performed on the segments between the adjacent lane centerline points based on the number of interpolation points to obtain the lane centerline interpolation point sequence.
[0075] Furthermore, when the lane matching program in the memory 130 is executed by the processor, the following steps are also implemented:
[0076] If the search condition is the neighbor search condition, then taking the position coordinate as the center, perform neighbor matching on the ordered index structure to obtain a list of candidate nodes that meet the neighbor search condition;
[0077] If the search condition is the range search condition, range matching is performed on the ordered index structure with the position coordinate as the center to obtain a list of candidate nodes that meet the range search condition.
[0078] Furthermore, when the lane matching program in the memory 130 is executed by the processor, the following steps are also implemented:
[0079] Taking the position coordinate as the center, performing range matching on the ordered index structure, and detecting whether the matching is successful;
[0080] If the match is successful, a list of candidate nodes that meet the preset range is obtained;
[0081] If the matching fails, the steps are executed: taking the position coordinates as the center, performing neighbor matching on the ordered index structure to obtain a list of candidate nodes that meet the neighbor search conditions.
[0082] Furthermore, when the lane matching program in the memory 130 is executed by the processor, the following steps are also implemented:
[0083] Obtaining the lane identification pre-mapped to each node in the candidate node list;
[0084] De-duplicating the lane identifiers to obtain a candidate lane list;
[0085] The target lane where the target vehicle is located is determined according to the candidate lane list.
[0086] Furthermore, when the lane matching program in the memory 130 is executed by the processor, the following steps are also implemented:
[0087] Obtaining the number of lanes in the candidate lane list, and detecting whether the number of lanes meets a preset second threshold;
[0088] If the number of lanes meets the second threshold, the target lane is obtained;
[0089] If the number of lanes does not meet the second threshold, a preset geometric method is used to match the candidate lane list to obtain the target lane.
[0090] This embodiment adopts the above scheme, specifically by obtaining the position coordinates and search conditions of the target vehicle; taking the position coordinates as the center, matching on the ordered index structure pre-created based on the map coordinate point columns corresponding to several lanes, to obtain a list of candidate nodes that meet the search conditions; and determining the target lane where the target vehicle is located according to the candidate node list. By pre-constructing an ordered index structure containing several nodes for all lanes, the target lane can be quickly located by accessing a small number of nodes during lane matching, that is, taking the position coordinates of the target vehicle as the center, distance matching is performed on the ordered index structure to obtain a list of candidate nodes, thereby locating the target lane, avoiding complex geometric area calculation methods, effectively solving the technical problem of low lane matching efficiency, and improving the efficiency of lane matching on the basis of ensuring the accuracy of lane matching.
[0091] Based on the above terminal device architecture but not limited to the above architecture, an embodiment of the method of the present application is proposed.
[0092] The method embodiments of the present application take into account that when lane-level path planning or V2X-related applications are performed based on high-precision map data, it is necessary to locate the lane based on the position coordinates of the main vehicle. How to quickly and accurately match the lane where the main vehicle is located directly affects the speed and accuracy of path planning or V2X applications. The usual method requires traversing all lane data and calculating the regional matching degree between each lane and the main vehicle through geometric relationships. This type of method requires a large number of candidate lanes to be traversed and the matching degree is calculated through relatively complex geometric relationships, so the calculation is very time-consuming and it is difficult to meet the needs of businesses with high latency requirements.
[0093] For example, the existing solution (1) searches for all lanes within a preset radius with the vehicle position as the center to form a lane set; determines a list of candidate lanes based on the distance between the vehicle position and the lane centerline or lane guide line of each lane in the lane set; then calculates the matching weight based on the distance between the vehicle position and the lane centerline or lane guide line of each lane in the list of candidate lanes and the angle between the vehicle position and the lane; and determines the lane with the smallest matching weight as the optimal lane.
[0094] However, the existing method (1) needs to first search for lanes within a preset radius from all lanes. The process of searching the lane set itself is relatively time-consuming. Secondly, a more complex set relationship calculation method is used when calculating the matching weight in the candidate lane set. It is necessary to calculate the distance value and the angle at the same time, which also increases the amount of calculation.
[0095] For example, the existing solution (2) obtains lane line information of multiple lanes from a high-precision map; generates an influence domain of each lane based on the lane line information of each lane, and the influence domain corresponds to the coordinate range corresponding to the two lane lines of the lane; finds the relevant lanes that intersect with the unmanned vehicle based on the influence domain; and uses the ray method to find the current driving lane of the unmanned vehicle from the relevant lanes. Find the relevant influence domain of the unmanned vehicle from each influence domain, determine the relevant lane corresponding to the relevant influence domain, first perform coarse-grained screening on thousands of lanes to obtain the relevant lanes; then use the ray method to perform fine-grained screening from the relevant lanes to find the driving lane of the unmanned vehicle.
[0096] However, in the existing solution (2), lane line information is obtained from the high-precision map to generate the influence domain of the lane. Based on the influence domain, the relevant lanes that intersect with the unmanned vehicle are found; this step still includes the process of traversing all lanes to construct the influence domain and performing full matching calculations, which results in a large amount of overall calculations. In addition, the matching relationship is obtained by calculating whether the lane influence domain intersects with the main vehicle. This geometric calculation matching method is more complicated and time-consuming.
[0097] Therefore, in order to meet the matching accuracy, the embodiment of the present application significantly improves the calculation speed. That is, consider how to avoid traversing a large number of candidate lanes when matching queries, and secondly, consider how to reduce the complexity of matching calculations. Figure 2 , Figure 2 This is a flow chart of a first exemplary embodiment of a lane matching method of the present application. The lane matching method comprises:
[0098] Step S210, obtaining the location coordinates and search conditions of the target vehicle;
[0099] The executor of the method of this embodiment may be a lane matching device, or a lane matching terminal device or server. This embodiment takes a lane matching device as an example, and the lane matching device may be integrated in a terminal device such as a smart car, a smart phone, a tablet computer, etc. having a data processing function.
[0100] The embodiment of the present application mainly creates an ordered index structure for all lanes in advance, on which only a small number of branch nodes need to be accessed to quickly locate the target lane, thereby avoiding the high latency caused by traversing and searching a large number of lanes. In addition, in order to make the matching calculation speed faster during the search, by storing two-dimensional coordinate points in the index structure, the lane matching efficiency can be improved by calculating the Euclidean distance between the coordinate points during lane matching, while ensuring the accuracy of lane matching.
[0101] Specifically, the location coordinates may be coordinate values of the current geographical location of the target vehicle, may include coordinate information such as longitude and latitude, and may be acquired by a global positioning system or other positioning technologies.
[0102] The search condition may determine a set of conditions or rules for the lane where the target vehicle is located. The search condition may include the direction of the vehicle and the distance relationship of the position relative to a certain landmark, which is used to accurately locate the target lane where the target vehicle is located.
[0103] Step S220, taking the position coordinate as the center, matching is performed on an ordered index structure pre-created based on map coordinate point sequences corresponding to a plurality of lanes to obtain a list of candidate nodes that meet the search condition;
[0104] Specifically, the map coordinate point column can be at least two sequentially arranged geographic coordinate points obtained based on a high-precision map or an electronic map, and each geographic coordinate point can be a two-dimensional coordinate composed of longitude and latitude, which is used to describe the center line of the lane, wherein each lane center line is associated with a corresponding map coordinate point column.
[0105] The ordered index structure may be a data structure for storing node coordinate data.
[0106] The candidate node list can be a collection of lane data points or nodes that meet the search conditions. The candidate node list includes at least one candidate node, and the nodes in the candidate node list can represent the lane where the target vehicle is located. During the matching process, the system will search for nodes that meet the conditions in the pre-established index structure based on the location coordinates of the target vehicle and the search conditions, and then add these nodes to the candidate node list.
[0107] Step S230: determining the target lane where the target vehicle is located according to the candidate node list.
[0108] Specifically, since there may be one or more nodes in the candidate list, the lane where the target vehicle is located can be determined by further screening or analyzing the candidate node list, for example, by selecting the node closest to the position coordinates.
[0109] This embodiment adopts the above scheme, specifically by obtaining the position coordinates and search conditions of the target vehicle; taking the position coordinates as the center, matching on the ordered index structure pre-created based on the map coordinate point columns corresponding to several lanes, to obtain a list of candidate nodes that meet the search conditions; and determining the target lane where the target vehicle is located according to the candidate node list. By pre-constructing an ordered index structure containing several nodes for all lanes, the target lane can be quickly located by accessing a small number of nodes during lane matching, that is, taking the position coordinates of the target vehicle as the center, distance matching is performed on the ordered index structure to obtain a list of candidate nodes, thereby locating the target lane, avoiding complex geometric area calculation methods, effectively solving the technical problem of low lane matching efficiency, and improving the efficiency of lane matching on the basis of ensuring the accuracy of lane matching.
[0110] Reference Figure 3 , Figure 3 This is a flow chart of the second exemplary embodiment of the lane matching method of this application. Figure 2 In the embodiment shown, step S220, taking the position coordinate as the center, matching is performed on an ordered index structure pre-created based on map coordinate point sequences corresponding to a plurality of lanes to obtain a list of candidate nodes that meet the search condition, and further includes:
[0111] Step S310, obtaining a map coordinate point sequence corresponding to each of the plurality of lanes; wherein the map coordinate point sequence includes a plurality of lane centerline points;
[0112] Specifically, in order to solve the problem of large search volume for vehicle matching, the ordered index structure in the embodiment of the present application is preferably a k-dimensional tree (kd-tree). An ordered index structure kd-tree is constructed for all lanes, and the leaf nodes used to construct the kd-tree correspond to the map coordinate point sequence after the lane centerline is interpolated and encrypted, so that when searching, only a small number of branch nodes need to be accessed to quickly locate the optimal matching lane, thereby significantly reducing the number of lanes to be searched. Compared with the O(n) time complexity of traversal search, the embodiment of the present application searches on the ordered index structure kd-tree created by the map coordinate point sequence based on the high-precision map, so that the query time complexity is optimally O(logn) and at worst.
[0113] In addition, kd-tree has strong adaptability to different data scales and can quickly adapt to different data scales to build a hierarchical index mechanism.
[0114] Specifically, each lane has an associated map coordinate point column, and the lane centerline points in the map coordinate point column can be arranged in a certain order to describe the position of the lane centerline. It can be understood that there are several lanes on a road, and each lane corresponds to a lane centerline, which can be the central axis of the lane.
[0115] Step S320, performing linear interpolation encryption on the segments between adjacent lane centerline points with a preset interpolation step length, to obtain lane centerline interpolation point sequences corresponding to the plurality of lanes;
[0116] Specifically, since the distance between each adjacent point of the original lane centerline is uncertain, in order to control the search accuracy, the original lane centerline can be interpolated and encrypted. Linear interpolation is performed on the centerline map coordinate point sequence of each lane, that is, additional interpolation points are inserted between adjacent lane centerline points, and then the lane centerline interpolation point sequence corresponding to the lane is obtained, thereby improving the coordinate point density of the lane centerline.
[0117] The interpolation step size is a parameter used to increase the density and accuracy of coordinate nodes. The smaller the interpolation step size, the more points there are after interpolation, and the larger the node size of the corresponding kd-tree, which will increase the storage space and the number of nodes accessed by the query, but when matching and searching on the kd-tree, it is easier to directly and accurately match the target lane. Conversely, the larger the interpolation step size, the fewer points there are after interpolation, the smaller the size of the corresponding kd-tree, and the fewer nodes accessed during the corresponding query, but the search error is also larger. Therefore, multiple candidate lanes can be roughly selected within the interpolation step size range, and then accurate matching can be performed in the candidate lane list through geometric methods.
[0118] For example, first determine the interpolation step length r, then perform interpolation and encryption between each two adjacent points of each lane centerline with a step length of r, and finally construct a two-dimensional kd-tree with the interpolated and encrypted lane centerline map coordinate point column as a leaf node.
[0119] Step S330, mapping the lane centerline interpolation point sequences corresponding to the plurality of lanes respectively to obtain an interpolated lane centerline node sequence;
[0120] Specifically, the lane centerline interpolation points corresponding to several lanes are converted into numbers or texts so that the lane centerline interpolation points can be used as leaf nodes of the kd-tree and store the corresponding position coordinates. At the same time, the interpolation point columns corresponding to each lane are mapped so that the lane centerline interpolation points are associated with the original lane, so that the target lane can be located in the subsequent lane matching process.
[0121] Step S340: Take each node in the lane centerline node column as a leaf node to construct the ordered index structure of a preset dimension.
[0122] Specifically, the encoded interpolation points are used as leaf nodes to construct a two-dimensional ordered index structure kd-tree.
[0123] For example, refer to Figure 4 , Figure 4 This is a flowchart for creating a lane centerline point index structure for the lane matching method in this application. The specific steps for constructing a lane index kd-tree are as follows:
[0124] Step 1: Extract all lanes and lane centerline data from the high-precision map data. The lane centerline is a sequence of map coordinate points;
[0125] Step 2: Select the interpolation step length r and perform interpolation encryption on the lane centerline point sequence segment by segment;
[0126] Step 3: Encode the lane centerline points after interpolation and encryption as kd-tree leaf nodes, and establish a mapping relationship from node ID to lane ID;
[0127] Step 4: Use the nodes in Step 3 as leaf nodes to construct a kd-tree with a dimension of 2. The constructed kd-tree is used for lane matching and search.
[0128] This embodiment uses the above scheme to perform piecewise linear interpolation encryption on the map coordinate point sequence in the lane data to obtain the interpolated centerline interpolation point sequence to construct an ordered index structure, so as to use the ordered index structure to efficiently store and retrieve these data, improve lane matching efficiency, and can be used in applications such as autonomous driving, navigation, traffic management, and location recognition.
[0129] Reference Figure 5 , Figure 5 This is a flow chart of the third exemplary embodiment of the lane matching method of this application. Figure 2 In the embodiment shown, step S320 performs linear interpolation encryption on the segments between adjacent lane centerline points at a preset interpolation step length to obtain lane centerline interpolation point sequences corresponding to the plurality of lanes, including:
[0130] Step S510, calculating the distance between the adjacent lane centerline points to obtain the segment length between the adjacent lane centerline points;
[0131] Because the matching query on the kd-tree is ultimately unified to coordinate point matching, and the length between any two adjacent points on the original lane centerline is uncertain, in order to facilitate precision control during vehicle matching queries, the lane centerline can be interpolated and encrypted. If the distance between adjacent points on the lane centerline is large, directly matching nodes may match adjacent lanes. To explain the principle of lane centerline interpolation and encryption, please refer to Figure 6a , Figure 6b and Figure 6c .
[0132] like Figure 6a The original lane centerline points are shown. The vehicle is located on lane 1. If point matching is performed on the kd-tree created with the original lane centerline points, the point closest to the vehicle is P4, and P4 is located on lane 2, which makes it difficult to directly use the lane corresponding to P4 as the target lane. If the lane centerline is interpolated and encrypted, such as the interpolation step length is r, then r can be used as the upper limit of accuracy, and all points within the range of r may be nodes on the target lane. When r is large, such as Figure 6b The sparse interpolation case is shown in Figure 1. All candidate nodes can be matched within the precision of r, and P4 and P6 may be matched. Then lane 1 corresponding to P4 and lane 2 corresponding to P6 are taken as candidate lanes for further precise matching. Furthermore, when r is relatively small, such as Figure 6c In the case of dense interpolation shown in the figure, the best matching point P8 is directly obtained by using the 1-nearest neighbor search. The corresponding lane 1 is the target lane, and the lane matching is completed in one step.
[0133] Specifically, two adjacent points in the lane centerline point sequence are traversed to calculate the distance d between the two adjacent points. This distance can be calculated using a distance formula in geometry, such as the Euclidean distance.
[0134] Step S520, combining the segment length and the interpolation step length to obtain the number of interpolation points between the adjacent lane centerline points;
[0135] Specifically, the distance d between two adjacent points is divided by the interpolation step length r, and the result is rounded up to get the number of interpolation points. Each segment corresponds to an interpolation point number. The number of interpolation points is used to indicate how many additional interpolation point coordinates need to be inserted in the corresponding segment.
[0136] Step S530, when the number of interpolation points is greater than a preset first threshold, linear interpolation is performed on the segments between the adjacent lane centerline points based on the number of interpolation points to obtain the lane centerline interpolation point sequence.
[0137] Specifically, by respectively detecting whether the number of points n to be interpolated in the segments between adjacent lane centerline points is greater than a first threshold, it is determined whether the segments between adjacent lane centerline points need to be interpolated. When performing interpolation operations on segments between adjacent lane centerline points, it is necessary to consider that the endpoints of the segments (i.e., the lane centerline points) also need to be interpolated and encrypted. Therefore, the embodiment of the present application adds one to the number of interpolation points, that is, considering that the lane centerline points also need to be interpolated and encrypted, and finally an interpolated lane centerline point column can be obtained, so as to improve the density and accuracy of the lane centerline coordinate point column through an ordered index structure.
[0138] In this embodiment of the present application, the first threshold is preferably a value of 2, and in other embodiments, it can also be set according to actual conditions. If n is less than or equal to 2, it means that the length of this segment is less than the interpolation step, and no interpolation operation is required. The interpolation step can be skipped and the next set of adjacent points can be checked; if the number of points to be interpolated n is greater than 2, it means that this segment needs to perform a linear interpolation operation, and n additional points are inserted linearly in this segment to increase the density of the lane centerline.
[0139] Reference Figure 7 , Figure 7 This is a schematic diagram of the lane centerline interpolation and encryption process of the lane matching method of this application. The specific steps of lane centerline interpolation and encryption are as follows:
[0140] Step A1: Input the lane centerline map coordinate point sequence and interpolation step length r;
[0141] Step A2: Traverse the lane centerline point sequence section by section and calculate the distance d between two adjacent points;
[0142] Step A3: Calculate the number of points to be interpolated Round d / r upwards;
[0143] Step A4: Determine whether n is greater than 2. If so, proceed to step A5. Otherwise, it means that the length of this segment is less than the interpolation step length, and no interpolation operation is performed. Return to step A2 to continue checking the next set of adjacent points.
[0144] Step A5: perform linear interpolation on the segment at interpolation points n+1 (including the endpoints);
[0145] Step A6: Traverse all adjacent points segment by segment to obtain the lane centerline interpolation point sequence.
[0146] This embodiment uses the above scheme to obtain the segment length by calculating the distance between adjacent lane centerline points; the number of interpolation points to be inserted in each segment is determined by combining the segment length and the interpolation step; if the number of interpolation points is greater than the first threshold, a linear interpolation operation is performed to generate interpolation points, thereby obtaining the lane centerline after interpolation encryption. Through interpolation encryption, more coordinate points can be added to the lane centerline, thereby improving the efficiency of lane matching.
[0147] Reference Figure 8 , Figure 8 This is a flow chart of the fourth exemplary embodiment of the lane matching method of the present application. Figure 2 In the embodiment shown, step S220, with the position coordinate as the center, matching is performed on an ordered index structure pre-created based on map coordinate point sequences corresponding to a plurality of lanes to obtain a list of candidate nodes that meet the search condition, including:
[0148] Step S810: If the search condition is the neighbor search condition, neighbor matching is performed on the ordered index structure with the position coordinate as the center to obtain a list of candidate nodes that meet the neighbor search condition;
[0149] The embodiment of the present application takes into account that when searching on the ordered index structure kd-tree, it is only necessary to calculate the matching degree through the Euclidean distance between the coordinate points, avoiding the more complicated geometric area calculation method. Compared with the angle method, ray method or geometric area intersection method, the calculation is simpler, further improving the calculation efficiency.
[0150] Specifically, before step S810, it is possible to detect whether the current search condition is a neighbor search condition or a range search condition. When the search condition is a neighbor search condition, a neighbor matching is performed on the ordered index structure kd-tree with the given position coordinate as the center, and a k-nearest neighbor search method is used to find the candidate node closest to the position coordinate to obtain a candidate node list. At this time, there is a candidate node in the candidate node list.
[0151] Step S820: If the search condition is the range search condition, range matching is performed on the ordered index structure with the position coordinate as the center to obtain a list of candidate nodes that meet the range search condition.
[0152] Specifically, if the search condition is a range search condition, the given range R is obtained according to the range search condition, so as to search for all matching points within the given range R on the kd-tree. If a matching point is successfully found, a list of candidate nodes is returned, otherwise, the system will return to the k nearest neighbor search method to ensure that at least one matching node is returned.
[0153] Further, step S820 includes:
[0154] Step S821, performing range matching on the ordered index structure with the position coordinate as the center, and detecting whether the matching is successful;
[0155] Step S822: if the match is successful, a list of candidate nodes that meet the preset range is obtained;
[0156] Step S823, if the matching fails, execute the steps of: taking the position coordinates as the center, performing neighbor matching on the ordered index structure to obtain a list of candidate nodes that meet the neighbor search conditions.
[0157] Specifically, when the search condition is a range search condition, the system will take the given position coordinates as the center, perform matching within the given range R on the ordered index structure, and detect whether there is a lane that successfully matches the range search condition; if the match is successful, all nodes within the given range R can be obtained, thereby forming a candidate node list; if the range match fails, the system will perform the following steps: take the same position coordinates as the center, and perform nearest neighbor matching on the ordered tree structure.
[0158] For example, the search method is determined according to the search condition; if the search method is the k-nearest neighbor method (usually k is set to 1, that is, searching for the nearest point), then the system will directly search through the kd-tree to find the matching point closest to the main vehicle position as the candidate node;
[0159] If the search mode is a range search mode, all matching points within the given range R can be searched on the kd-tree. If a matching point is successfully found, a list of candidate nodes is returned, otherwise, the system will return to the 1-nearest neighbor search mode to ensure that at least one matching node is returned.
[0160] Among them, the neighbor search condition or the range search condition can be based on the size of the interpolation step or can be pre-set, and the embodiment of the present application does not limit this.
[0161] Further, step S230, determining the target lane where the target vehicle is located according to the candidate node list, includes:
[0162] Step S830, obtaining the lane identification pre-mapped to each node in the candidate node list;
[0163] Specifically, for each candidate node obtained by the query, the node-to-lane mapping relationship established when constructing the kd-tree can be obtained to find the lane identification corresponding to each candidate node, and the lane identification will be used for subsequent lane matching.
[0164] Step S840, removing duplicate lane identifiers to obtain a candidate lane list;
[0165] Specifically, since the candidate node list may contain multiple nodes of the same lane, the system will deduplicate the lane identifiers to obtain a unique candidate lane list.
[0166] Step S850: Determine the target lane where the target vehicle is located according to the candidate lane list.
[0167] Specifically, if there is only one lane in the list, then this lane is the target lane. If there are multiple lanes in the list, the target lane can be determined in the following way: select the lane closest to the position coordinates among the multiple lanes, that is, the lane closest to the position of the main vehicle. Traverse the candidate lane list and perform an exact matching operation to select the best matching lane.
[0168] Further, step S850 includes:
[0169] Step S851, obtaining the number of lanes in the candidate lane list, and detecting whether the number of lanes meets a preset second threshold;
[0170] Specifically, in order to determine how many candidate lanes are available, the number of lanes in the candidate lane list may be counted, and it may be detected whether the number of lanes obtained meets a preset second threshold. The second threshold may be a preset value, such as a value of 1, for controlling the strictness or accuracy of the matching.
[0171] Step S852, if the number of lanes meets the second threshold, obtaining the target lane;
[0172] Specifically, if the number of lanes found in the candidate lane list meets the second threshold, it indicates that the match is clear and the target lane can be directly determined based on the unique lane identifier in the candidate lane list.
[0173] Step S853: If the number of lanes does not meet the second threshold, a preset geometric method is used to match the candidate lane list to obtain the target lane.
[0174] Specifically, if the number of candidate lanes does not meet the second threshold, some preset geometric methods may be used to accurately match the candidate lanes. These methods may be based on the shape, direction, position or other geometric features of the lanes, thereby improving the accuracy of the matching to ensure that the most appropriate target lane is selected.
[0175] Exemplarily, when the interpolation step length r is small enough, the node with the shortest distance can be found with 1 nearest neighbor. This node is the node closest to the target vehicle, and the lane where this nearest node is located is the optimal matching lane for the main vehicle. If a range search is performed with a preset radius R, it is possible to match 0 or more candidate nodes. If 0 nodes are matched, it means that the distance between the main vehicle position and all node coordinates is greater than R. At this time, the 1 nearest neighbor search can be switched to ensure that at least one node can be matched. Then, based on the mapping relationship between nodes and lanes, the target lane id is obtained. If the number of lane ids obtained is greater than 1, there may be duplicate lane ids, and deduplication needs to be performed; if the target lane id is still not unique after deduplication, the one with the shortest matching distance can be selected, or precise matching can be performed in the candidate list through geometric methods to determine the only optimal matching lane. Reference Fig. 9 , Fig. 9 Lane matching search calculation flow chart of the lane matching method of the present application, the specific steps of lane matching search are as follows:
[0176] Step B1: Provide the main vehicle position coordinates and search method;
[0177] Step B2: If the search method is k nearest neighbors (usually k is set to 1), the nearest matching point is directly found through the kd-tree as a candidate node;
[0178] Step B3: If the search mode is range search, search for all matching points within the given range R on the kd-tree. If successful, return a list of candidate nodes. Otherwise, switch to 1-nearest-neighbor search to ensure that at least one matching node is returned.
[0179] Step B4: For the candidate nodes obtained in step B2 or step B3, the lane ID corresponding to each node is obtained by using the mapping relationship between tree nodes and lanes established when constructing the kd-tree, and then the lane IDs are deduplicated to obtain a candidate lane list;
[0180] Step B5: Check the candidate lane list. If there is only one lane, it is the target lane. If there are multiple lanes, select the one with the shortest distance, or perform an exact match in the traversal list to select the best matching lane.
[0181] This embodiment adopts the above scheme, specifically by matching based on the neighbor search condition or the range search condition on the ordered index structure pre-created based on the map coordinate point columns of several lanes, and determining the target lane according to the node matching result and the number of lanes, which can ensure that the most suitable target lane is found, thereby improving the accuracy and efficiency of lane matching.
[0182] In addition, the embodiment of the present application further provides a lane matching device, the lane matching device comprising:
[0183] An acquisition module is used to obtain the location coordinates and search conditions of the target vehicle;
[0184] A matching module, which is used to perform matching on an ordered index structure pre-created based on map coordinate point sequences corresponding to a plurality of lanes, with the position coordinates as the center, to obtain a list of candidate nodes that meet the search conditions;
[0185] A determination module is used to determine the target lane where the target vehicle is located according to the candidate node list.
[0186] For the principle and implementation process of lane matching in this embodiment, please refer to the above embodiments and will not be described in detail here.
[0187] In addition, an embodiment of the present application also proposes a terminal device, which includes a memory, a processor, and a lane matching program stored in the memory and executable on the processor, and the lane matching program implements the steps of the lane matching method described above when executed by the processor.
[0188] Since all the technical solutions of all the aforementioned embodiments are adopted when the lane matching program is executed by the processor, it has at least all the beneficial effects brought by all the technical solutions of all the aforementioned embodiments, which will not be described one by one here.
[0189] In addition, an embodiment of the present application further proposes a computer-readable storage medium, on which a lane matching program is stored. When the lane matching program is executed by a processor, the steps of the lane matching method described above are implemented.
[0190] Since all the technical solutions of all the aforementioned embodiments are adopted when the lane matching program is executed by the processor, it has at least all the beneficial effects brought by all the technical solutions of all the aforementioned embodiments, which will not be described one by one here.
[0191] Compared with the prior art, the lane matching method, device, terminal device and storage medium proposed in the embodiment of the present application obtain the position coordinates and search conditions of the target vehicle; with the position coordinates as the center, matching is performed on an ordered index structure pre-created based on the map coordinate point columns corresponding to several lanes to obtain a list of candidate nodes that meet the search conditions; according to the candidate node list, the target lane where the target vehicle is located is determined. By constructing an ordered index structure containing several nodes for all lanes in advance, the target lane can be quickly located by accessing a small number of nodes during lane matching, that is, with the position coordinates of the target vehicle as the center, distance matching is performed on the ordered index structure to obtain a list of candidate nodes, thereby locating the target lane, avoiding complex geometric area calculation methods, effectively solving the technical problem of low lane matching efficiency, and improving the efficiency of lane matching on the basis of ensuring the accuracy of lane matching.
[0192] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or system including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or system. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or system including the element.
[0193] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.
[0194] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) as above, and includes a number of instructions for a terminal device (which can be a mobile phone, a computer, a server, a controlled terminal, or a network device, etc.) to execute the method of each embodiment of the present application.
[0195] The above are only preferred embodiments of the present application, and are not intended to limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.
Claims
1. A lane matching method, characterized in that: The lane matching method comprises the following steps: Obtain the location coordinates and search conditions of the target vehicle; Taking the position coordinate as the center, matching is performed on an ordered index structure pre-created based on map coordinate point sequences corresponding to a plurality of lanes to obtain a list of candidate nodes that meet the search condition; The target lane where the target vehicle is located is determined according to the candidate node list.
2. The lane matching method according to claim 1, characterized in that: Before the step of matching the position coordinates as the center on an ordered index structure pre-created based on map coordinate point sequences corresponding to a plurality of lanes to obtain a list of candidate nodes that meet the search conditions, the method further includes: Obtaining a map coordinate point sequence corresponding to each of the plurality of lanes; wherein the map coordinate point sequence includes a plurality of lane centerline points; Using a preset interpolation step size, linear interpolation encryption is performed on the segments between adjacent lane centerline points to obtain lane centerline interpolation point sequences corresponding to the plurality of lanes; Mapping the lane centerline interpolation point sequences corresponding to the plurality of lanes respectively to obtain an interpolated lane centerline node sequence; Each node in the lane centerline node column is used as a leaf node to construct the ordered index structure of a preset dimension.
3. The lane matching method according to claim 2, characterized in that: The step of performing linear interpolation encryption on the segments between adjacent lane centerline points at a preset interpolation step length to obtain lane centerline interpolation point sequences corresponding to each of the plurality of lanes comprises: Calculating the distance between the adjacent lane centerline points to obtain the segment length between the adjacent lane centerline points; Combining the segment length and the interpolation step length, obtaining the number of interpolation points between the adjacent lane centerline points; When the number of interpolation points is greater than a preset first threshold, linear interpolation is performed on the segments between the adjacent lane centerline points based on the number of interpolation points to obtain the lane centerline interpolation point sequence.
4. The lane matching method according to claim 1, characterized in that: The search conditions include neighbor search conditions and range search conditions. The step of matching the position coordinates on an ordered index structure pre-created based on map coordinate point sequences corresponding to a plurality of lanes to obtain a list of candidate nodes that meet the search conditions includes: If the search condition is the neighbor search condition, then taking the position coordinate as the center, perform neighbor matching on the ordered index structure to obtain a list of candidate nodes that meet the neighbor search condition; If the search condition is the range search condition, range matching is performed on the ordered index structure with the position coordinate as the center to obtain a list of candidate nodes that meet the range search condition.
5. The lane matching method according to claim 4, characterized in that: The step of performing range matching on the ordered index structure with the position coordinate as the center to obtain a list of candidate nodes that meet the range search condition comprises: Taking the position coordinate as the center, performing range matching on the ordered index structure, and detecting whether the matching is successful; If the match is successful, a list of candidate nodes that meet the preset range is obtained; If the matching fails, the steps are executed: taking the position coordinates as the center, performing neighbor matching on the ordered index structure to obtain a list of candidate nodes that meet the neighbor search conditions.
6. The lane matching method according to claim 1, characterized in that: The step of determining the target lane where the target vehicle is located according to the candidate node list comprises: Obtaining the lane identification pre-mapped to each node in the candidate node list; De-duplicating the lane identifiers to obtain a candidate lane list; The target lane where the target vehicle is located is determined according to the candidate lane list.
7. The lane matching method according to claim 6, characterized in that: The step of determining the target lane where the target vehicle is located according to the candidate lane list comprises: Obtaining the number of lanes in the candidate lane list, and detecting whether the number of lanes meets a preset second threshold; If the number of lanes meets the second threshold, the target lane is obtained; If the number of lanes does not meet the second threshold, a preset geometric method is used to match the candidate lane list to obtain the target lane.
8. A lane matching device, characterized in that: The lane matching device comprises: An acquisition module is used to obtain the location coordinates and search conditions of the target vehicle; A matching module, which is used to perform matching on an ordered index structure pre-created based on map coordinate point sequences corresponding to a plurality of lanes, with the position coordinates as the center, to obtain a list of candidate nodes that meet the search conditions; A determination module is used to determine the target lane where the target vehicle is located according to the candidate node list.
9. A terminal device, characterized in that: The terminal device includes a memory, a processor, and a lane matching program stored in the memory and executable on the processor. When the lane matching program is executed by the processor, the steps of the lane matching method according to any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a lane matching program, and when the lane matching program is executed by a processor, the steps of the lane matching method according to any one of claims 1 to 7 are implemented.