Trajectory data and map data fast association method, device, equipment and medium
Patent Information
- Application Number
- CN202410550156.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-06
- Publication Date
- 2026-10-30
- Estimated Expiration
- 2044-05-06
AI Technical Summary
[0003]本发明提供一种轨迹数据与地图数据快速关联方法、装置、电子设备及存储介质,用以解决传统轨迹数据与地图数据关联方法增加人力和维护成本,并且以城市为单位将地图数据进行划分后与轨迹数据匹配会造成轨迹数据进行割裂,影响轨迹数据与地图数据匹配效果的缺陷
[0029]本发明还提供一种电子设备,包括存储器、处理器及存储在所述存储器上并可在所述处理器上运行的计算机程序,所述处理器执行所述程序时实现上述任一项所述的轨迹数据与地图数据快速关联方法。
Smart Images

Figure CN118535663B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of autonomous driving technology, and in particular to a method, apparatus, electronic device, and storage medium for rapidly associating trajectory data and map data. Background Technology
[0002] As autonomous driving technology develops rapidly, map data becomes increasingly important for vehicles. Simultaneously, the number of vehicles with autonomous driving capabilities is increasing, generating tens of thousands of in-vehicle trajectory data points. If these trajectories can be quickly correlated with maps, it's possible to utilize the route recording function of automated navigation systems to extract map data based on past paths for navigation preparation. Furthermore, map data can be quickly extracted for scenario simulation during problem analysis in autonomous driving. It can also be used for commercial data analysis, extracting map data to analyze the correlation between energy consumption and real-world scenarios. However, high-precision maps themselves have massive data volumes, reaching tens of millions. Trajectory data in the autonomous driving field also reaches tens of millions. Therefore, matching these two data sources of tens of millions presents a significant challenge for data querying. Increasing computing resources and adding computers to perform matching queries would drastically increase costs. In related technologies, to achieve trajectory data and map data matching, map data is first divided by city, and trajectory data belonging to that city is then matched. However, this method requires manual pre-division and maintenance of city road element packages, increasing manpower and maintenance costs. Furthermore, dividing map data into city units and matching it with trajectory data will cause the trajectory data to be fragmented, affecting the matching effect between trajectory data and map data. Summary of the Invention
[0003] This invention provides a method, apparatus, electronic device, and storage medium for rapidly associating trajectory data with map data, in order to solve the shortcomings of traditional methods for associating trajectory data with map data, which increase manpower and maintenance costs, and cause the trajectory data to be fragmented when matching with trajectory data after dividing the map data by city, thus affecting the matching effect of trajectory data and map data.
[0004] This invention provides a method for rapidly associating trajectory data and map data, comprising:
[0005] The trajectory data and map data are preprocessed. The preprocessing of the map data includes constructing an RTree index based on the road elements in the map data. The RTree index includes a root node, child nodes, and leaf nodes. There is a geometric overlay relationship between the root node, child nodes, and leaf nodes. Each leaf node is used to record a road element object. The preprocessing of the trajectory data includes constructing a grid structure based on the trajectory data.
[0006] Iterate through each trajectory point to be queried in the same grid structure, and query whether there is a road element object that matches the trajectory point to be queried from the road element objects that have been matched by other trajectory points in the same grid structure.
[0007] If it does not exist, start from the root node of the RTree index and traverse its child nodes until a leaf node that can geometrically cover the trajectory point to be queried is reached, and the road element object recorded in the leaf node is used as the road element object associated with the trajectory point to be queried.
[0008] Traverse different grid structures until the trajectory points in all grid structures are associated with the road element objects.
[0009] According to a method for rapidly associating trajectory data and map data provided by the present invention, the step of constructing an RTree index based on road elements in the map data includes:
[0010] Construct the bounding box for each road element;
[0011] Insert the bounding box corresponding to each road element into the RTree index space until all road elements have been inserted, thus obtaining the Rtree index.
[0012] According to the present invention, a method for rapidly associating trajectory data and map data includes inserting the bounding box corresponding to each road element into the RTree index space, comprising:
[0013] If there exists a leaf node in the RTree index space that can geometrically cover the bounding box corresponding to the inserted road element, and the number of bounding boxes corresponding to the road element covered by the leaf node is less than the preset leaf node capacity, the bounding box corresponding to the road element is directly inserted into the leaf node.
[0014] According to the method for rapidly associating trajectory data and map data provided by the present invention, the step of inserting the bounding box corresponding to each road element into the RTree index space further includes:
[0015] If none of the existing leaf nodes in the RTree index space can geometrically cover the bounding box corresponding to the inserted road element, and the number of bounding boxes covered by the leaf node with the largest intersection area with the bounding box corresponding to the road element is less than the preset leaf node capacity, then the bounding box parameters of the leaf node with the largest intersection area with the bounding box corresponding to the road element will be expanded, and the bounding box parameters of the parent node corresponding to the leaf node will be updated synchronously until the root node is updated.
[0016] Insert the bounding box corresponding to the road element into the leaf node of the expanded bounding box parameter.
[0017] According to the method for rapidly associating trajectory data and map data provided by the present invention, the step of inserting the bounding box corresponding to each road element into the RTree index space further includes:
[0018] If the existing leaf nodes in the RTree index space can geometrically cover the bounding boxes corresponding to the inserted road elements, and the number of road element bounding boxes covered by the leaf nodes that can geometrically cover the bounding boxes corresponding to the inserted road elements is not less than the preset leaf node capacity, then the leaf node is split. The bounding boxes corresponding to the road elements in the original leaf node whose sum of the areas of the bounding boxes corresponding to the road elements is greater than half of the area of the bounding box of the leaf node itself are retained in the original leaf node, and the bounding box parameters of the original leaf node are updated. The bounding boxes corresponding to the remaining road elements are regenerated into new leaf nodes, and the bounding box parameters of the parent nodes of the original leaf nodes are updated sequentially until the root node is updated.
[0019] The method for rapidly associating trajectory data and map data according to the present invention further includes:
[0020] If there is no intersection between the existing leaf node in the RTree index space and the bounding box corresponding to the inserted road element, then a new leaf node is constructed and the bounding box corresponding to the road element is used as the bounding box of the leaf node.
[0021] According to the present invention, a method for rapidly associating trajectory data and map data includes constructing a grid structure based on the trajectory data, wherein:
[0022] Convert the geographic coordinates of each trajectory point in the trajectory data into geodetic coordinates;
[0023] Divide the coordinates of the trajectory points in the geodetic coordinate system by a preset value to obtain the grid structure of the trajectory points. The preset value is determined according to the preset grid structure size. Trajectory points falling in the same grid structure are regarded as a group of trajectory points.
[0024] The present invention also provides a device for rapidly associating trajectory data and map data, comprising:
[0025] The preprocessing module is used to preprocess trajectory data and map data. The preprocessing of map data includes constructing an RTree index based on road elements in the map data. The RTree index includes root nodes, child nodes, and leaf nodes. There is a geometric coverage relationship between the root nodes, child nodes, and leaf nodes. Each leaf node is used to record a road element object. The preprocessing of trajectory data includes constructing a grid structure based on the trajectory data.
[0026] The first query module is used to traverse each trajectory point to be queried in the same grid structure and query whether there is a road element object that matches the trajectory point to be queried from the road element objects that have been matched by other trajectory points in the same grid structure.
[0027] The second query module is used to, if it does not exist, traverse its child nodes starting from the root node of the RTree index until a leaf node that can geometrically cover the trajectory point to be queried is reached, and the road element object recorded by the leaf node is used as the road element object associated with the trajectory point to be queried.
[0028] Create a module to traverse different grid structures until the trajectory points in all grid structures are associated with the road element objects.
[0029] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the method for rapidly associating trajectory data and map data as described above.
[0030] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the method for rapidly associating trajectory data and map data as described in any of the preceding claims.
[0031] This invention provides a method, apparatus, electronic device, and storage medium for rapidly associating trajectory data and map data. The method involves preprocessing the trajectory data and map data. The map data preprocessing includes constructing an RTree index based on road elements in the map data. The RTree index includes root nodes, child nodes, and leaf nodes, with a geometric overlap between the root nodes, child nodes, and leaf nodes. Each leaf node records a road element object. The trajectory data preprocessing includes constructing a grid structure based on the trajectory data. It then traverses each trajectory point to be queried within the same grid structure, querying whether a road element object exists among the matched road element objects of other trajectory points within the same grid structure. If no road element object matches the queried trajectory point, the child nodes of the RTree index are traversed starting from the root node until a leaf node that can geometrically cover the queried trajectory point is reached. The road element object recorded in the leaf node is then used as the road element object associated with the queried trajectory point. This process is repeated across different grid structures until all trajectory points in all grid structures are associated with road element objects. This improves the matching efficiency between trajectory data and map data, allows for rapid association of trajectories with the map, saves computational resources and costs, and avoids fragmenting the trajectory data. This is beneficial for the automatic assisted navigation system to extract map data to prepare for navigation and autonomous driving scenario simulation. Attached Figure Description
[0032] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0033] Figure 1 This is a flowchart illustrating the method for rapidly associating trajectory data and map data provided by the present invention;
[0034] Figure 2 This is one of the schematic diagrams of the scenario for constructing an RTree index provided by the present invention;
[0035] Figure 3 This is the second schematic diagram of the scenario for constructing an RTree index provided by the present invention;
[0036] Figure 4 This is the third schematic diagram of the scenario for constructing an RTree index provided by the present invention;
[0037] Figure 5 This is the fourth schematic diagram of the scenario for constructing an RTree index provided by the present invention;
[0038] Figure 6 This is a schematic diagram of the constructed mesh structure provided by the present invention;
[0039] Figure 7 This is a schematic diagram of querying a single coordinate point provided by the present invention;
[0040] Figure 8 This is a schematic diagram of the structure of the device for rapidly associating trajectory data and map data provided by the present invention;
[0041] Figure 9 This is a schematic diagram of the structure of the electronic device provided by the present invention. Detailed Implementation
[0042] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.
[0043] Figure 1 A flowchart of a method for rapidly associating trajectory data and map data provided in an embodiment of the present invention is shown below. Figure 1As shown, the method for quickly associating trajectory data and map data provided in this embodiment of the invention includes:
[0044] Step 101: Preprocess the trajectory data and map data. The preprocessing of the map data includes constructing an RTree index based on the road elements in the map data. The RTree index includes a root node, child nodes, and leaf nodes. There is a geometric coverage relationship between the root node, child nodes, and leaf nodes. Each leaf node is used to record a road element object. The preprocessing of the trajectory data includes constructing a grid structure based on the trajectory data.
[0045] In this embodiment of the invention, the RTree index is a spatial index, commonly used for storing and querying spatial objects. A key feature of the RTree index is its ability to efficiently query the location of objects in a multi-dimensional space.
[0046] Step 102: Traverse each trajectory point to be queried in the same grid structure, and query whether there is a road element object that matches the trajectory point to be queried from the road element objects that have been matched by other trajectory points in the same grid structure;
[0047] In this embodiment of the invention, the trajectory points to be queried in the same grid structure are preferentially matched with the already matched road element objects, and adjacent trajectory points are matched with road element regions, which can improve matching efficiency.
[0048] Step 103: If it does not exist, start from the root node of the RTree index and traverse its child nodes until a leaf node that can geometrically cover the trajectory point to be queried is reached. Use the road element object recorded in the leaf node as the road element object associated with the trajectory point to be queried.
[0049] Step 104: Traverse different grid structures until the trajectory points in all grid structures are associated with the road element objects.
[0050] Traditional methods for matching trajectory data with map data first divide the map data into city units, then match trajectory data belonging to that city. However, this method requires manual pre-division and maintenance of city road element packages, increasing manpower and maintenance costs. Furthermore, dividing the map data by city and matching it with trajectory data results in fragmented trajectory data, affecting the matching accuracy.
[0051] This invention provides a method for rapidly associating trajectory data and map data. The method involves preprocessing the trajectory and map data. The map data preprocessing includes constructing an RTree index based on road elements in the map data. The RTree index includes root nodes, child nodes, and leaf nodes, and these nodes have a geometric overlap relationship. Each leaf node records a road element object. The trajectory data preprocessing includes constructing a grid structure based on the trajectory data. It then traverses each trajectory point to be queried within the same grid structure, querying the road element objects already matched with other trajectory points in the same grid structure to see if a match exists between the queried trajectory point and the target trajectory point. The system queries for road element objects that match the trajectory points. If no such object exists, it traverses its child nodes starting from the root node of the RTree index until a leaf node that can geometrically cover the trajectory point to be queried is reached. The road element object recorded in the leaf node is then used as the road element object associated with the trajectory point to be queried. This process is repeated across different grid structures until all trajectory points in all grid structures are associated with road element objects. This improves the matching efficiency between trajectory data and map data, allows for the rapid association of trajectories with the map, saves computational resources and costs, and avoids fragmenting the trajectory data. This is beneficial for the automatic assisted navigation system to extract map data to prepare for navigation and autonomous driving scenario simulation.
[0052] Based on any of the above embodiments, constructing an RTree index based on road elements in the map data includes:
[0053] Step 201: Construct the bounding box corresponding to each road element;
[0054] Step 202: Insert the bounding box corresponding to each road element into the RTree index space until all road elements are inserted, thus obtaining the Rtree index.
[0055] In this embodiment of the invention, inserting the bounding box corresponding to each road element into the RTree index space includes:
[0056] If there exists a leaf node in the RTree index space that can geometrically cover the bounding box corresponding to the inserted road element, and the number of bounding boxes corresponding to the road element covered by the leaf node is less than the preset leaf node capacity, the bounding box corresponding to the road element is directly inserted into the leaf node.
[0057] like Figure 2 As shown, a bounding box (bbox) is constructed for each road element in the high-precision map, and the maximum x, maximum y, minimum x, and minimum y coordinates of the bounding box are determined.
[0058] Insert the bounding box of each road element into the RTree index space in sequence. The insertion of any road element shall meet the following four scenarios, and the capacity of each leaf node in the RTree index space shall be 4.
[0059] The inserted object satisfies two conditions within an existing leaf node: first, the leaf node's bounding box (bbox) can cover the x-axis (x-axis), and second, the leaf node's capacity is less than 4. The insertion operation is performed directly, recording the road element object under the corresponding leaf node.
[0060] In this embodiment of the invention, inserting the bounding box corresponding to each road element into the RTree index space further includes:
[0061] If none of the existing leaf nodes in the RTree index space can geometrically cover the bounding box corresponding to the inserted road element, and the number of bounding boxes covered by the leaf node with the largest intersection area with the bounding box corresponding to the road element is less than the preset leaf node capacity, then the bounding box parameters of the leaf node with the largest intersection area with the bounding box corresponding to the road element will be expanded, and the bounding box parameters of the parent node corresponding to the leaf node will be updated synchronously until the root node is updated.
[0062] Insert the bounding box corresponding to the road element into the leaf node of the expanded bounding box parameter.
[0063] like Figure 3 As shown, if the inserted object satisfies one of the conditions of the existing leaf nodes (i.e., the capacity of the leaf node is less than 4), then the leaf node's bounding box is expanded and updated. Figure 3 The object insertion is completed by updating the bounding box of the parent node of P2 if P2 has a parent node, and so on, until the root node is updated.
[0064] In this embodiment of the invention, inserting the bounding box corresponding to each road element into the RTree index space further includes:
[0065] If the existing leaf nodes in the RTree index space can geometrically cover the bounding boxes corresponding to the inserted road elements, and the number of road element bounding boxes covered by the leaf nodes that can geometrically cover the bounding boxes corresponding to the inserted road elements is not less than the preset leaf node capacity, then the leaf node is split. The bounding boxes corresponding to the road elements in the original leaf node whose sum of the areas of the bounding boxes corresponding to the road elements is greater than half of the area of the bounding box of the leaf node itself are retained in the original leaf node, and the bounding box parameters of the original leaf node are updated. The bounding boxes corresponding to the remaining road elements are regenerated into new leaf nodes, and the bounding box parameters of the parent nodes of the original leaf nodes are updated sequentially until the root node is updated.
[0066] like Figure 4 , Figure 5 As shown, the inserted object satisfies one of the following conditions in the existing leaf nodes: the bounding box (bbox) of the leaf node can cover w, and the leaf node's capacity is insufficient. A leaf node split is performed: the sum of the bbox areas of the objects in the existing leaf node is greater than 50% of the area of the leaf node's own bbox (P1). This split forms a new leaf, and the bbox value of P1 is updated. The remaining objects are used to construct a new leaf node P5. The parent nodes are then updated sequentially, as shown in the diagram, creating new nodes Q1 and Q2, thus completing the insertion of w.
[0067] In this embodiment of the invention, inserting the bounding box corresponding to each road element into the RTree index space further includes:
[0068] If there is no intersection between the existing leaf node in the RTree index space and the bounding box corresponding to the inserted road element, then a new leaf node is constructed and the bounding box corresponding to the road element is used as the bounding box of the leaf node.
[0069] Based on any of the above embodiments, constructing a grid structure based on the trajectory data includes:
[0070] Convert the geographic coordinates of each trajectory point in the trajectory data into geodetic coordinates;
[0071] Divide the coordinates of the trajectory points in the geodetic coordinate system by a preset value to obtain the grid structure of the trajectory points. The preset value is determined according to the preset grid structure size. Trajectory points falling in the same grid structure are regarded as a group of trajectory points.
[0072] In embodiments of the present invention, such as Figure 6 As shown, each trajectory point in the trajectory data is converted to a geodetic coordinate system. The x and y coordinates of each trajectory point in the geodetic coordinate system are divided by 10 to control the grid size within the meter range. The result after division (new x, new y) is the grid structure of the original coordinate points. Grids belonging to the same coordinate system are considered as one group.
[0073] In this embodiment of the invention, the trajectory points of each trajectory data are classified into groups based on the grid structure size. For example, suppose the trajectory is a point sequence {p1, p2, p3, ..., pn}. Each trajectory point is assigned a gridID using the grid method, represented as {p1->grid1, p2->grid1, p3->grid2, ..., pn->gridm}. The corresponding road element objects are queried sequentially. Trajectory points belonging to the same group for each gridID are traversed in units of grid structure. Each trajectory point first queries the road element object in the gridID cache. If not found, the trajectory point to be queried starts from the root node of the RTree and traverses its child nodes until a leaf node is reached. The road element objects recorded in the leaf nodes are recorded in the road element cache corresponding to the gridID. Taking the query of a single coordinate point as an example, the query checks which region of P1, P2, P3, P4 the single coordinate point falls into. If a match is found, the query continues in its child nodes until a leaf node is reached. Figure 7 As shown, since the trajectory point to be queried intersects with P3 and P4, the coordinate points are traversed sequentially to see which data in P3 (F or G) or P4 (H or J) matches. The matched data is returned, and if no data is matched, the query returns no result.
[0074] If the trajectory point matches the road element object, that is, the trajectory point is geometrically covered by the bbox of the road element object, then the trajectory point to be queried is associated with the road element object. Otherwise, if the search yields no results, it indicates that the map data is missing, and a map data improvement reminder is sent to the user.
[0075] The method for quickly associating trajectory data and map data provided in this embodiment of the invention can greatly save memory by building RTree indexes only for road element objects. Generally speaking, the ratio of road element objects to lane element objects is 1:5, and the ratio of road element objects to boundary objects is 1:7. By using this embodiment of the invention, 10% of memory resources can be saved in terms of cost when building RTree indexes.
[0076] The device for rapidly associating trajectory data and map data provided by the present invention is described below. The device for rapidly associating trajectory data and map data described below can be referred to in correspondence with the method for rapidly associating trajectory data and map data described above.
[0077] Figure 8 This is a schematic diagram of a device for rapidly associating trajectory data and map data according to an embodiment of the present invention, as shown below. Figure 8 As shown, the device for rapidly associating trajectory data and map data provided in this embodiment of the invention includes:
[0078] The preprocessing module 801 is used to preprocess trajectory data and map data. The preprocessing of map data includes constructing an RTree index based on road elements in the map data. The RTree index includes root nodes, child nodes, and leaf nodes. There is a geometric coverage relationship between the root nodes, child nodes, and leaf nodes. Each leaf node is used to record a road element object. The preprocessing of trajectory data includes constructing a grid structure based on the trajectory data.
[0079] The first query module 802 is used to traverse each trajectory point to be queried in the same grid structure and query whether there is a road element object that matches the trajectory point to be queried from the road element objects that have been matched by other trajectory points in the same grid structure.
[0080] The second query module 803 is used to, if it does not exist, traverse its child nodes starting from the root node of the RTree index until a leaf node that can geometrically cover the trajectory point to be queried is reached, and the road element object recorded by the leaf node is used as the road element object associated with the trajectory point to be queried.
[0081] Create module 804 to traverse different grid structures until the trajectory points in all grid structures are associated with the road element objects.
[0082] In this embodiment of the invention, the preprocessing module 801 is configured as follows:
[0083] Construct the bounding box for each road element;
[0084] Insert the bounding box corresponding to each road element into the RTree index space until all road elements have been inserted, thus obtaining the Rtree index.
[0085] The step of inserting the bounding box corresponding to each road element into the RTree index space includes:
[0086] If there exists a leaf node in the RTree index space that can geometrically cover the bounding box corresponding to the inserted road element, and the number of bounding boxes corresponding to the road element covered by the leaf node is less than the preset leaf node capacity, the bounding box corresponding to the road element is directly inserted into the leaf node.
[0087] Alternatively, if none of the existing leaf nodes in the RTree index space can geometrically cover the bounding box corresponding to the inserted road element, and the number of bounding boxes covered by the leaf node with the largest intersection area with the bounding box corresponding to the road element is less than the preset leaf node capacity, then the bounding box parameters of the leaf node with the largest intersection area with the bounding box corresponding to the road element will be expanded, and the bounding box parameters of the parent node corresponding to the leaf node will be updated synchronously until the root node is updated.
[0088] Insert the bounding box corresponding to the road element into the leaf node of the expanded bounding box parameter.
[0089] Alternatively, if the existing leaf nodes in the RTree index space can geometrically cover the bounding boxes corresponding to the inserted road elements, and the number of road element bounding boxes covered by the leaf nodes that can geometrically cover the bounding boxes corresponding to the inserted road elements is not less than the preset leaf node capacity, then the leaf node is split. The bounding boxes corresponding to the road elements in the original leaf node whose sum of the areas of the bounding boxes corresponding to the road elements is greater than half of the area of the bounding box of the leaf node itself are retained in the original leaf node, and the bounding box parameters of the original leaf node are updated. The bounding boxes corresponding to the remaining road elements are regenerated into new leaf nodes, and the bounding box parameters of the parent nodes of the original leaf nodes are updated sequentially until the root node is updated.
[0090] Alternatively, if the existing leaf node in the RTree index space does not intersect with the bounding box corresponding to the inserted road element, then a new leaf node is constructed and the bounding box corresponding to the road element is used as the bounding box of the leaf node.
[0091] In this embodiment of the invention, the preprocessing module 801 is further configured to:
[0092] Convert the geographic coordinates of each trajectory point in the trajectory data into geodetic coordinates;
[0093] Divide the coordinates of the trajectory points in the geodetic coordinate system by a preset value to obtain the grid structure of the trajectory points. The preset value is determined according to the preset grid structure size. Trajectory points falling in the same grid structure are regarded as a group of trajectory points.
[0094] This invention provides a device for rapidly associating trajectory data and map data. The device preprocesses the trajectory data and map data, including: preprocessing the map data by constructing an RTree index based on road elements in the map data. The RTree index includes root nodes, child nodes, and leaf nodes, which have a geometric overlap relationship. Each leaf node records a road element object. Preprocessing the trajectory data involves constructing a grid structure based on the trajectory data; traversing each trajectory point to be queried within the same grid structure, and querying the road element objects already matched with other trajectory points in the same grid structure to see if a match exists between the trajectory point and the queried trajectory point. The system queries for road element objects that match the trajectory points. If no such object exists, it traverses its child nodes starting from the root node of the RTree index until a leaf node that can geometrically cover the trajectory point to be queried is reached. The road element object recorded in the leaf node is then used as the road element object associated with the trajectory point to be queried. This process is repeated across different grid structures until all trajectory points in all grid structures are associated with road element objects. This improves the matching efficiency between trajectory data and map data, allows for the rapid association of trajectories with the map, saves computational resources and costs, and avoids fragmenting the trajectory data. This is beneficial for the automatic assisted navigation system to extract map data to prepare for navigation and autonomous driving scenario simulation.
[0095] Figure 9 An example is a schematic diagram of the physical structure of an electronic device, such as... Figure 9As shown, the electronic device may include: a processor 910, a communication interface 920, a memory 930, and a communication bus 940, wherein the processor 910, the communication interface 920, and the memory 930 communicate with each other through the communication bus 940. The processor 910 can call logical instructions in the memory 930 to execute a method for quickly associating trajectory data and map data. This method includes: preprocessing the trajectory data and map data, wherein preprocessing the map data includes constructing an RTree index based on road elements in the map data, the RTree index including root nodes, child nodes, and leaf nodes, with geometric coverage relationships between the root nodes, child nodes, and leaf nodes, and each leaf node recording a road element object; preprocessing the trajectory data includes constructing a grid structure based on the trajectory data; traversing each trajectory point to be queried in the same grid structure, querying whether there is a road element object matching the trajectory point to be queried from the road element objects already matched by other trajectory points in the same grid structure; if not, traversing its child nodes starting from the root node of the RTree index until a leaf node that can geometrically cover the trajectory point to be queried is reached, and the road element object recorded by the leaf node is used as the road element object associated with the trajectory point to be queried; traversing different grid structures until trajectory points in all grid structures are associated with road element objects.
[0096] On the other hand, the present invention also provides a non-transitory computer-readable storage medium storing a computer program thereon. When executed by a processor, the computer program implements a method for rapidly associating trajectory data and map data provided by the above methods. This method includes: preprocessing the trajectory data and map data, wherein preprocessing the map data includes constructing an RTree index based on road elements in the map data, the RTree index including root nodes, child nodes, and leaf nodes, wherein there is a geometric coverage relationship between the root nodes, child nodes, and leaf nodes, and each leaf node is used to record a road element object; preprocessing the trajectory data includes constructing a grid structure based on the trajectory data; traversing each trajectory point to be queried in the same grid structure, querying whether there is a road element object matching the trajectory point to be queried from the road element objects already matched by other trajectory points in the same grid structure; if not, traversing its child nodes starting from the root node of the RTree index until a leaf node that can geometrically cover the trajectory point to be queried is reached, and the road element object recorded by the leaf node is used as the road element object associated with the trajectory point to be queried; traversing different grid structures until trajectory points in all grid structures are associated with road element objects.
[0097] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.
[0098] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., including several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods of various embodiments or some parts of embodiments.
[0099] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for rapidly associating trajectory data with map data, characterized in that, include: The trajectory data and map data are preprocessed. The preprocessing of the map data includes constructing an RTree index based on the road elements in the map data. The RTree index includes a root node, child nodes, and leaf nodes. There is a geometric overlay relationship between the root node, child nodes, and leaf nodes. Each leaf node is used to record a road element object. The preprocessing of the trajectory data includes constructing a grid structure based on the trajectory data. Iterate through each trajectory point to be queried in the same grid structure, and query whether there is a road element object that matches the trajectory point to be queried from the road element objects that have been matched by other trajectory points in the same grid structure. If it does not exist, start from the root node of the RTree index and traverse its child nodes until a leaf node that can geometrically cover the trajectory point to be queried is reached, and the road element object recorded in the leaf node is used as the road element object associated with the trajectory point to be queried. Traverse different grid structures until the trajectory points in all grid structures are associated with the road element objects.
2. The method for rapidly associating trajectory data and map data according to claim 1, characterized in that, The construction of the RTree index based on road elements in the map data includes: Construct the bounding box for each road element; Insert the bounding box corresponding to each road element into the RTree index space until all road elements have been inserted, thus obtaining the Rtree index.
3. The method for rapidly associating trajectory data and map data according to claim 1, characterized in that, The step of inserting the bounding box corresponding to each road element into the RTree index space includes: If there exists a leaf node in the RTree index space that can geometrically cover the bounding box corresponding to the inserted road element, and the number of bounding boxes corresponding to the road element covered by the leaf node is less than the preset leaf node capacity, the bounding box corresponding to the road element is directly inserted into the leaf node.
4. The method for rapidly associating trajectory data and map data according to claim 3, characterized in that, The step of inserting the bounding box corresponding to each road element into the RTree index space further includes: If none of the existing leaf nodes in the RTree index space can geometrically cover the bounding box corresponding to the inserted road element, and the number of bounding boxes covered by the leaf node with the largest intersection area with the bounding box corresponding to the road element is less than the preset leaf node capacity, then the bounding box parameters of the leaf node with the largest intersection area with the bounding box corresponding to the road element will be expanded, and the bounding box parameters of the parent node corresponding to the leaf node will be updated synchronously until the root node is updated. Insert the bounding box corresponding to the road element into the leaf node of the expanded bounding box parameter.
5. The method for rapidly associating trajectory data and map data according to claim 3, characterized in that, The step of inserting the bounding box corresponding to each road element into the RTree index space further includes: If the existing leaf nodes in the RTree index space can geometrically cover the bounding boxes corresponding to the inserted road elements, and the number of road element bounding boxes covered by the leaf nodes that can geometrically cover the bounding boxes corresponding to the inserted road elements is not less than the preset leaf node capacity, then the leaf node is split. The bounding boxes corresponding to the road elements in the original leaf node whose sum of the areas of the bounding boxes corresponding to the road elements is greater than half of the area of the bounding box of the leaf node itself are retained in the original leaf node, and the bounding box parameters of the original leaf node are updated. The bounding boxes corresponding to the remaining road elements are regenerated into new leaf nodes, and the bounding box parameters of the parent nodes of the original leaf nodes are updated sequentially until the root node is updated.
6. The method for rapidly associating trajectory data and map data according to claim 1, characterized in that, The step of inserting the bounding box corresponding to each road element into the RTree index space further includes: If there is no intersection between the existing leaf node in the RTree index space and the bounding box corresponding to the inserted road element, then a new leaf node is constructed and the bounding box corresponding to the road element is used as the bounding box of the leaf node.
7. The method for rapidly associating trajectory data and map data according to claim 1, characterized in that, The construction of the grid structure based on the trajectory data includes: Convert the geographic coordinates of each trajectory point in the trajectory data into geodetic coordinates; Divide the coordinates of the trajectory points in the geodetic coordinate system by a preset value to obtain the grid structure of the trajectory points. The preset value is determined according to the preset grid structure size. Trajectory points falling in the same grid structure are regarded as a group of trajectory points.
8. A device for rapidly associating trajectory data and map data, characterized in that, include: The preprocessing module is used to preprocess trajectory data and map data. The preprocessing of map data includes constructing an RTree index based on road elements in the map data. The RTree index includes root nodes, child nodes, and leaf nodes. There is a geometric coverage relationship between the root nodes, child nodes, and leaf nodes. Each leaf node is used to record a road element object. The preprocessing of trajectory data includes constructing a grid structure based on the trajectory data. The first query module is used to traverse each trajectory point to be queried in the same grid structure and query whether there is a road element object that matches the trajectory point to be queried from the road element objects that have been matched by other trajectory points in the same grid structure. The second query module is used to, if it does not exist, traverse its child nodes starting from the root node of the RTree index until a leaf node that can geometrically cover the trajectory point to be queried is reached, and the road element object recorded by the leaf node is used as the road element object associated with the trajectory point to be queried. Create a module to traverse different grid structures until the trajectory points in all grid structures are associated with the road element objects.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the method for rapidly associating trajectory data and map data as described in any one of claims 1 to 7.
10. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the method for rapidly associating trajectory data and map data as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Candidate road section screening method based on grid segmentation and grid segmentation method
CN110275929A
Track indexing and querying method and system based on inverted sorting index and prefix tree
CN112579921A