A map processing method, device, apparatus and storage medium
By forming a bounding box set and replacing road segment nodes with node encryption, the problem of high memory consumption in high-precision map matching and positioning is solved, achieving efficient positioning and map display.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- CHINA AUTOMOTIVE INNOVATION CORP
- Filing Date
- 2022-10-27
- Publication Date
- 2026-04-17
AI Technical Summary
Existing technologies for high-precision map matching and positioning employ geometric point encryption, resulting in high memory consumption and positioning accuracy being affected by the number of encrypted points, making it difficult to meet the matching speed requirements of high-precision maps.
By acquiring a set of bounding boxes, bounding boxes are formed based on the coordinate information of node segments on the same road segment, reducing data memory usage. The target bounding box is then matched with the coordinate information of the object to be located to generate map display information.
It reduces the memory usage of data, improves the efficiency and accuracy of locating objects, and enhances the intuitiveness of map display.
Smart Images

Figure CN116049328B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of digital maps, specifically to a map processing method, apparatus, device, and storage medium. Background Technology
[0002] Autonomous driving technology is booming, and more and more autonomous vehicles are equipped with high-precision maps, which have become an essential technology for autonomous vehicles. High-precision maps have the characteristics of high data accuracy, comprehensive feature coverage, and short update cycle. These characteristics make the creation and updating of high-precision maps costly, making it difficult to apply high-precision maps to traditional mapping technologies. Figure 1 The current approach to high-precision map coverage, while providing global and nationwide coverage, only covers limited areas such as highways, urban expressways, ordinary roads in key cities, and autonomous driving experimental zones. This necessitates frequent matching and positioning of vehicles within specific localized areas while in motion. Solving the problem of rapid matching and positioning when vehicles enter areas covered by high-precision maps is the primary technical challenge for high-precision map applications. Existing solutions typically employ a geometric point encryption method to build an index tree before matching and positioning. However, when using this method for centimeter-level lane positioning on high-precision maps, the encryption point method consumes significant memory, and the positioning accuracy is affected by the number of encryption points, making it difficult to meet the matching speed requirements of high-precision maps. Summary of the Invention
[0003] To overcome the shortcomings and deficiencies of existing technologies, this invention discloses a map processing method, apparatus, device, and storage medium that can reduce the number of road segment nodes, thereby reducing data memory usage and improving the positioning efficiency of the object to be located. The method includes:
[0004] Obtain a bounding box set, which includes bounding boxes formed by the node segments corresponding to each of the multiple road segments; each node segment is determined based on the coordinate information of at least two road segment nodes on the same road segment;
[0005] Based on the coordinate information of the object to be located, the target region is determined from multiple index regions; the multiple index regions are determined based on the coordinate information of multiple bounding boxes in the bounding box set;
[0006] A target bounding box is determined in the target region, and the object to be located is located on the node segment corresponding to the target bounding box;
[0007] Based on the coordinate information of the object to be located, determine the position of the object to be located on the node segment corresponding to the target bounding box;
[0008] Based on the surrounding map information corresponding to the target bounding box, and the position of the object to be located on the node segment corresponding to the target bounding box, map display information is generated.
[0009] Furthermore, prior to obtaining the bounding box set, the method further includes:
[0010] Obtain the starting and ending road segment nodes for each road segment;
[0011] By sequentially connecting the starting road segment node and the ending road segment node, the node segments corresponding to each of the multiple road segments are obtained.
[0012] Furthermore, prior to obtaining the bounding box set, the method further includes:
[0013] Based on the coordinate information of the starting road segment node and the ending road segment node of the target node segment, the coordinate information of the first mapping point and the coordinate information of the second mapping point are determined; the x-coordinate of the first mapping point is the same as the x-coordinate of the ending road segment node, and the y-coordinate of the first mapping point is the same as the y-coordinate of the starting road segment node; the x-coordinate of the second mapping point is the same as the x-coordinate of the starting road segment node, and the y-coordinate is the same as the y-coordinate of the ending road segment node.
[0014] Based on the coordinate information of the starting road segment node, the coordinate information of the first mapping point, the coordinate information of the ending road segment node, and the coordinate information of the second mapping point, the coordinate information of the bounding box corresponding to the target node segment is obtained.
[0015] Furthermore, before determining the target region from multiple index regions based on the coordinate information of the object to be located, the method further includes:
[0016] Based on the comparison results of the horizontal and vertical spans of the coordinate information of multiple bounding boxes in the bounding box set, the partitioning type of the bounding box region corresponding to the bounding box set is determined, and the partitioning type includes horizontal dimension partitioning and vertical dimension partitioning.
[0017] Based on the partitioning type corresponding to the current partitioning level, the current bounding box region is partitioned to obtain the current partitioning region corresponding to the current level.
[0018] The next level of the current partitioning level is determined as the current partitioning level;
[0019] Repeat the steps to divide the current bounding box region into regions based on the division type corresponding to the current division level, and obtain the current division region corresponding to the current level; determine the next division level of the current division level as the current division level, until the number of bounding boxes in the current division region is less than or equal to a preset number.
[0020] The multiple index regions are determined based on the current partitioned region.
[0021] Furthermore, before dividing the current bounding box region based on the division type corresponding to the current division level to obtain the current division region corresponding to the current level, the method further includes:
[0022] Determine the dividing line corresponding to the current dividing level. The dividing line corresponding to the current dividing level is located at the middle bounding box of the current bounding box region, so that the difference in the number of bounding boxes on both sides of the dividing line meets a preset difference.
[0023] Furthermore, determining the target region from multiple index regions based on the coordinate information of the object to be located includes:
[0024] Based on the division type corresponding to the current division level, the coordinate information of the object to be located, and the coordinate information of the division boundary line corresponding to the current division level, the current target division region is determined in the current division region corresponding to the current division level;
[0025] The next level of the current partitioning level is determined as the current partitioning level;
[0026] Repeat the following steps: based on the partitioning type corresponding to the current partitioning level, the coordinate information of the object to be located, and the coordinate information of the partitioning boundary corresponding to the current partitioning level, determine the current target partitioning region in the current partitioning region corresponding to the current partitioning level, and determine the next partitioning level of the current partitioning level as the current partitioning level; until the current target region is determined as the current bounding box set, until the number of bounding boxes in the current partitioning region is less than or equal to a preset number;
[0027] The current target region corresponding to the current division level is determined as the target region.
[0028] Furthermore, after generating map display information based on the surrounding map information corresponding to the target bounding box and the position of the object to be located on the node segment corresponding to the target bounding box, the method further includes:
[0029] The map display information is sent to the map display terminal so that the map display terminal can display the map display information and display the object to be located in the map display information.
[0030] On the other hand, this application also provides a map processing apparatus, comprising:
[0031] The acquisition module is used to acquire a bounding box set, which includes bounding boxes formed by the node segments corresponding to each of the multiple road segments; each node segment is determined based on the coordinate information of at least two road segment nodes on the same road segment;
[0032] The first determining module is used to determine the target region from multiple index regions based on the coordinate information of the object to be located; the multiple index regions are determined based on the coordinate information of multiple bounding boxes in the bounding box set;
[0033] The second determining module is used to determine a target bounding box in the target area, wherein the object to be located is located on a node segment corresponding to the target bounding box;
[0034] The third determining module is used to determine the position of the object to be located on the node segment corresponding to the target bounding box based on the coordinate information of the object to be located.
[0035] The generation module is used to generate map display information based on the surrounding map information corresponding to the target bounding box and the position of the object to be located on the node segment corresponding to the target bounding box.
[0036] Thirdly, this application also provides an electronic device, the device including a processor and a memory, the memory storing at least one instruction, at least one program, code set or instruction set, the at least one instruction, the at least one program, the code set or instruction set being loaded and executed by the processor to implement a map processing method as described above.
[0037] Fourthly, this application also provides a computer-readable storage medium storing at least one instruction, at least one program, code set, or instruction set, wherein the at least one instruction, at least one program, code set, or instruction set is loaded by a processor and executed as described above in a map processing method.
[0038] Implementing this invention has the following beneficial effects:
[0039] This application determines the corresponding node segment based on the coordinate information of at least two road segment nodes on the same road segment. By forming node segments instead of encrypting road segment nodes, the memory occupied by the data can be reduced. Multiple node segments are formed into their respective bounding boxes, which facilitates positioning and summarization. Multiple bounding boxes constitute a bounding box set, which corresponds to multiple index regions. By matching the coordinate information of the object to be located with multiple index regions, the target region is obtained. Multiple bounding boxes in other index regions can be excluded. The target bounding box is determined in the target region, which can reduce the number of times the bounding box is matched with the object to be located, thus improving the positioning efficiency of the object to be located. By using the coordinate information of the object to be located, the position of the object to be located on the node segment corresponding to the target bounding box is determined. Map display information is generated based on this position. The object to be located can be displayed in the map display information, which can further improve the intuitiveness of the object to be located in the map display information. Attached Figure Description
[0040] To more clearly illustrate the technical solution of the present invention, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0041] Figure 1 A flowchart of a map processing method provided in an embodiment of the present invention;
[0042] Figure 2 A schematic diagram of a bounding box assembly provided in an embodiment of the present invention;
[0043] Figure 3 A schematic diagram of the bounding box construction principle provided in an embodiment of the present invention;
[0044] Figure 4 This is a schematic diagram of index tree construction provided in an embodiment of the present invention;
[0045] Figure 5 This is a flowchart of an index tree construction method provided in an embodiment of the present invention;
[0046] Figure 6 A flowchart of a method for determining a target region provided in an embodiment of the present invention;
[0047] Figure 7 This is a schematic diagram illustrating the principle of determining map display information provided in the embodiments of the present invention.
[0048] Figure 8 This is a structural block diagram of a map processing device provided in an embodiment of the present invention. Detailed Implementation
[0049] To enable those skilled in the art to better understand the technical solutions in this application, the technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of this application.
[0050] In this embodiment, the technical problem to be solved by the present invention is to reduce the number of road segment nodes, thereby reducing data memory usage and improving the positioning efficiency of the object to be located. (Refer to...) Figure 1 This invention provides a map processing method, which includes:
[0051] S110: Obtain the bounding box set, which includes the bounding boxes formed by the node segments corresponding to each of the multiple road segments; each node segment is determined based on the coordinate information of at least two road segment nodes on the same road segment;
[0052] In this embodiment, the execution entity is a map server, which collects road segment nodes to form node segments. Multiple node segments each form a bounding box, as shown below. Figure 2 The node segment is the diagonal of the corresponding bounding box. Based on the coordinate information of multiple road segment nodes, the coordinates of the node segment are determined, and then the coordinate information of each bounding box is obtained. Multiple bounding boxes with different coordinate information form a bounding box set. In the existing technology, the positioning accuracy is improved by encrypting road segment nodes, but storing the coordinate information of a large number of shape points will occupy a lot of storage space. When positioning the object to be located, the coordinate information of each shape point needs to be matched one by one, and the position of the shape point with the smallest distance to the object to be located is determined as the position of the object to be located. However, matching a large number of shape points will reduce the positioning efficiency of the object to be located. Converting two adjacent road segment nodes into node segments and saving the coordinate information of the node segments can avoid encrypting road segment nodes and occupying a lot of storage space, and can also improve the positioning accuracy of the object to be located later.
[0053] S120: Determine the target region from multiple index regions based on the coordinate information of the object to be located; the multiple index regions are determined based on the coordinate information of multiple bounding boxes in the bounding box set;
[0054] The bounding box set has multiple index regions, each with a coordinate range. The coordinate information of the object to be located is compared with the coordinate range of each index region to determine the target region, which is the area where the object to be located is located.
[0055] S130: Determine the target bounding box in the target area, and the object to be located is located on the node segment corresponding to the target bounding box;
[0056] The process involves matching all bounding boxes in the target area with the object to be located to determine the target bounding box containing the object; then, the coordinate information of the object to be located is sequentially matched with each bounding box in the target area to determine the bounding box closest to the object to be located as the target bounding box. This eliminates the need to match all bounding boxes in the bounding box set with the object to be located, thus reducing the number of bounding boxes to be matched with the object and improving the positioning efficiency of the object.
[0057] In this embodiment, by knowing the coordinate information of the node segment corresponding to the target bounding box, the distance between the object to be located and the node segment in each bounding box can be obtained. The bounding box containing the closest node segment is determined as the target bounding box. Since the object to be located is located on the node segment corresponding to the target bounding box, it can be considered that the bounding box containing the node segment with a distance of zero from the object to be located is the target bounding box.
[0058] S140: Based on the coordinate information of the object to be located, determine the position of the object on the node segment corresponding to the target bounding box;
[0059] In this embodiment, the position where the distance between the node segment and the object to be located is zero can be determined as the position of the object to be located, that is, the perpendicular point of the object to be located on the node segment corresponding to the target bounding box. Based on the coordinate information of the starting road segment node and the ending road segment node of the node segment, the linear function corresponding to the node segment can be calculated. Based on the coordinate information of the object to be located, it can be calculated whether the object to be located is located on the linear function. If so, the bounding box of the node segment corresponding to the linear function is the target bounding box. Based on the coordinate information of the object to be located, the position of the object to be located is determined on the linear function.
[0060] S150: Generate map display information based on the surrounding map information corresponding to the target bounding box and the position of the object to be located on the node segment corresponding to the target bounding box.
[0061] After determining the location of the object to be located on a node segment, a circular map coverage area is formed with the location of the object to be located as the center and a preset distance as the radius. The map display information is the surrounding map information within this coverage area. The coordinate information of at least two road segment nodes on the same road segment is used to determine the corresponding node segment. Since the unit vectors of multiple node segments are different, which is not convenient for calculation, multiple node segments are formed into their respective bounding boxes. Multiple bounding boxes constitute a bounding box set, which includes multiple index regions. By matching the coordinate information corresponding to the object to be located with multiple index regions, the target region is obtained. This can exclude multiple bounding boxes in other index regions and determine the target bounding box in the target region, which can reduce the number of times the bounding box is matched with the vehicle position and improve the vehicle positioning efficiency.
[0062] In one implementation, before obtaining the bounding box set, the method further includes:
[0063] Obtain the starting and ending road segment nodes for each road segment;
[0064] In this embodiment, a road line without bends is defined as a road segment. It's understood that if a road line conventionally has a bend, then in this embodiment, the line is divided into two road segments, ensuring that each road segment is a straight road. In real-world scenarios, road segments are not as straight as expected; therefore, bends with a preset error are allowed. This minimizes the number of road segments and reduces memory usage for initial data without affecting the final positioning accuracy. On a road segment, only the coordinates of the starting and ending road segment nodes need to be obtained. Since a road segment is straight under the preset error condition, storing only the coordinates of the starting and ending road segment nodes is sufficient to obtain the coordinates of all road segment nodes on the road segment.
[0065] By sequentially connecting the starting road segment node and the ending road segment node, the node segments corresponding to each of the multiple road segments are obtained.
[0066] Connect the starting road segment node and the ending road segment node sequentially to construct a node segment s = (start, end), where s is the node segment, start and end are the starting and ending road segment nodes of the node segment, respectively, and the unit vector starting offset so of multiple node segments is:
[0067] dx = end.x - start.x
[0068] dy = end.y - start.y
[0069] length = hyppot(dx, dy)
[0070] su = (dx / length, dy / length)
[0071] soi = ∑length0 + length1 + ... + lengthi-1
[0072] Where, hypot(dx,dy) is the square root of dx and dy, i.e. the length of the node segment; soi is the offset of the i-th line segment; start.x is the x-coordinate of the starting road segment node; start.y is the y-coordinate of the starting road segment node; end.x is the x-coordinate of the ending road segment node; end.y is the y-coordinate of the ending road segment node; i∈(0,n-1), so0=0.
[0073] Based on the initial offset so of the unit vector for each node segment, the node segment set segment_list is obtained:
[0074] segment_list=
s0=(pt0,pt1),s1=(pt1,pt2)...sn-2=(ptn-2,ptn-1)
[0075] Where s is the node segment and n is the number of node segments.
[0076] In this embodiment, only the coordinate information of the starting road segment node and the ending road segment node of each road segment is obtained. The starting road segment node and the ending road segment node are connected to form a node segment. Based on the unit vector and offset so of each node segment, the position of the object to be located in the node segment can be determined. This ensures the positioning accuracy of the object to be located in the subsequent location while reducing the memory occupied by the initial data acquisition.
[0077] In one implementation, before obtaining the bounding box set, the method further includes:
[0078] Based on the coordinate information of the starting road segment node and the ending road segment node of the target node segment, the coordinate information of the first mapping point and the coordinate information of the second mapping point are determined; the x-coordinate of the first mapping point is consistent with the x-coordinate of the ending road segment node, and the y-coordinate of the first mapping point is consistent with the y-coordinate of the starting road segment node; the x-coordinate of the second mapping point is consistent with the x-coordinate of the starting road segment node, and the y-coordinate is consistent with the y-coordinate of the ending road segment node.
[0079] In a Cartesian coordinate system, the unit vector and offset of each node segment are different. In the node segment set, a bounding box is constructed for each node segment. One side of each bounding box is parallel to the X-axis of the Cartesian coordinate system, and the other adjacent side is parallel to the Y-axis. The bounding box is rectangular. By summarizing the bounding boxes, the corresponding node segments are then summarized. In this embodiment, the target node segment refers to any node segment in the node segment set. The node segment is the diagonal of the bounding box. The coordinate information of the first mapping point and the coordinate information of the second mapping point are determined, referring to... Figure 3 The coordinates of the starting road segment node are (x1, y1) and the coordinates of the ending road segment node are (x2, y2). The coordinates of the first mapping point are (x2, y1) and the coordinates of the second mapping point are (x1, y2). It can be seen that the line connecting the starting road segment node and the first mapping point is parallel to the line connecting the ending road segment node and the second mapping point, and is also parallel to the X-axis of the rectangular coordinate system.
[0080] Based on the coordinate information of the starting road segment node, the coordinate information of the first mapping point, the coordinate information of the ending road segment node, and the coordinate information of the second mapping point, the coordinate information of the bounding box corresponding to the target node segment is obtained.
[0081] By sequentially connecting the coordinate information of the starting road segment node, the first mapping point, the ending road segment node, and the second mapping point, the bounding box corresponding to the node segment is obtained. Furthermore, the coordinate information of the four sides of the bounding box can be determined. In another embodiment, the method for determining the target bounding box is as follows: in the target area, the distances between the vertices of multiple bounding boxes and the object to be located are determined, and the bounding box corresponding to the vertex closest to the object to be located is determined as the target bounding box.
[0082] In this embodiment, a bounding box is constructed for each node segment to facilitate summarization, thereby making it easier to divide the bounding box set into multiple index regions and further improve the positioning accuracy of the object to be located.
[0083] In one implementation, before determining the target region from multiple index regions based on the coordinate information of the object to be located, reference is made. Figures 4-5 The methods also include:
[0084] S510: Based on the comparison results of the horizontal and vertical spans of the coordinate information of multiple bounding boxes in the bounding box set, determine the partitioning type of the bounding box region corresponding to the bounding box set. The partitioning type includes horizontal dimension partitioning and vertical dimension partitioning.
[0085] The bounding box set is divided into multiple regions, and an index tree is constructed based on the bounding box set. In this embodiment, the index tree is called a segment-k-dimensional tree. The segment-k-dimensional tree includes a left subtree, tree nodes, and a right subtree. The terms "left" and "right" are just technical terms and are not limited to "left side" and "right side". The left subtree and the right subtree can also represent the upper and lower regions of the bounding box set, respectively.
[0086] Before constructing the KD index tree, parameter configuration is required. The maximum depth of the KD index tree (e.g., max_depth = 8, maximum of 8 levels) and the maximum number of objects in the index region (e.g., max_size = 16, maximum of 16 bounding boxes in the index region) need to be set. The maximum depth is the maximum number of levels that the bounding box set can be divided into, and the maximum number of objects in the index region is the maximum number of bounding boxes in each index region after the hierarchical division. It can be understood that if the number of bounding boxes in a certain index region is still greater than the preset number (maximum number of objects in the index region), and the current division level does not exceed the preset division level (maximum depth), then the index region will continue to be divided into levels so that the number of bounding boxes in the divided region does not exceed the preset number. In this embodiment, the number of bounding boxes in the region does not include the bounding boxes located on the division boundary of the current level.
[0087] To determine the current partitioning type, first calculate the boundary range (extend) of the segment_box_list (bounding box set):
[0088] minx = min(l0.x, l1.x, ... l) n-1 .x)
[0089] miny = min(l0.y, l1.y, ... l) n-1 .y)
[0090] maxx = max(l0.x, l1.x, ..., ln ...0 n-1 .x)
[0091] maxy = max(l0.y, l1.y, ... l) n-1 .y)
[0092] extend=(minx,miny,maxx,maxy)
[0093] Among them, l i .x,l i .y represent the x and y coordinates of the i-th object in the list; we can see that (l0.x, l1.x, ..., l...) n- Let (l0.y, l1.y, ..., ln) be the set of x-coordinates of the vertices of all bounding boxes in the bounding box set. n-1 Let .y) be the set of vertices of all bounding boxes in the bounding box set, where the vertices include the starting road segment node, the first mapping point, the ending road segment node, and the second mapping point. In the Cartesian coordinate system, determine the point with the smallest coordinate value (minx, miny) and the point with the largest coordinate value (maxx, maxy). Use the line connecting the point with the smallest coordinate value and the point with the largest coordinate value as the boundary line to obtain the bounding box container parallel to each bounding box. All bounding boxes are located inside the bounding box container.
[0094] Further, determine the partition type (partition) and partition position (partition_pos).
[0095] width = maxx - minx,
[0096] height = maxy - miny,
[0097] Where width is the span of the bounding box container along the X-axis, and height is the span of the bounding box container along the Y-axis. If width >= height, then the X-dimensional partition is used, denoted as partition = DimX; partition_pos = width / 2. DimX is a vertical partition, with the partition line parallel to the Y-axis of the Cartesian coordinate system. Otherwise, the Y-dimensional partition is used, denoted as partition = DimY; partition_pos = height / 2. DimY is a horizontal partition, with the partition line parallel to the X-axis of the Cartesian coordinate system. The partition line divides the bounding box container into three parts: the left subtree region, the right subtree region, and the middle region. The position of the partition line can be determined as the middle position of the horizontal span of the current partition level, or it can be the bounding box position located in the middle of the current partition level.
[0098] S520: Based on the partitioning type corresponding to the current partitioning level, perform region partitioning on the current bounding box region to obtain the current partitioning region corresponding to the current level;
[0099] After the initial hierarchical partitioning of the bounding box container, three current partitioned regions are obtained (the left subtree region, the right subtree region, and the middle region). These current partitioned regions are then further divided, as follows: Figure 4 In the first partition, both the left and right boundary lines DimY belong to the second partition level. Bounding boxes located on the boundary lines of the first partition level belong to the middle region of the first partition level. Bounding boxes on the boundary lines of the second partition level belong to the left or right subtree region in the first partition level, but belong to the middle region in the second partition level. The partition dimension corresponding to the second partition level can be determined as the opposite dimension to the partition dimension corresponding to the previous partition level. For example, if the partition type of the first level is DimX, then the partition type of the second level is directly determined to be DimY. In another implementation, the partition type of each level is determined in the same way as the partition type of the first level, based on the comparison result of the horizontal span and vertical span of the bounding box container to determine the partition type of the current level.
[0100] S530: Determine the next level of the current partitioning level as the current partitioning level;
[0101] After the current level division is completed, the next level division is determined as the current level division, and the two currently divided regions after the previous level division are determined as the current bounding box regions, and the subsequent division is continued.
[0102] S540: Repeat the following steps: Based on the partitioning type corresponding to the current partitioning level, partition the current bounding box region to obtain the current partitioning region corresponding to the current level; determine the next partitioning level of the current partitioning level as the current partitioning level, until the number of bounding boxes in the current partitioning region is less than or equal to the preset number.
[0103] The current bounding box region is divided based on the division type corresponding to the current division level. This division is then repeated until the number of bounding boxes in the current region does not exceed a preset number, at which point the division ends. As a specific implementation method, such as... Figure 4 As shown, the preset number is 2. In the first partitioning level, there are 10 bounding boxes, and the horizontal span of the bounding box container is greater than the vertical span. Therefore, the first partitioning boundary is perpendicular to the X-axis of the Cartesian coordinate system, taking DimX. The position of the partitioning boundary is located at the center line of the middle bounding box in the first partitioning level. The partitioning ends, resulting in three current partitioned regions: the left subtree region (6 bounding boxes), the middle region (1 bounding box), and the right subtree region (3 bounding boxes). The number of bounding boxes in the left subtree region is greater than the preset number of 2. The second partitioning level... The dimension of the dividing line is the opposite of the dimension of the previous dividing level, taking DimY. The left subtree region of the first dividing level is divided into three regions: the left subtree region of the second dividing level (2 bounding boxes), the middle region of the second dividing level (3 bounding boxes), and the right subtree region of the second dividing level (1 bounding box). The bounding box of the middle region is not divided. The left and right subtree regions of the second dividing level do not exceed the preset number 2. The division ends. The division method of the right subtree of the first dividing level is the same as above, and will not be repeated here.
[0104] S550: Determine multiple index regions based on the current partitioned region.
[0105] After the partitioning is completed, the multiple currently partitioned regions form multiple index regions. Figure 4 The four index regions shown in this embodiment determine the partitioning type of the current partitioning level by comparing the horizontal and vertical spans of the bounding box container. This can divide the multiple bounding boxes in the bounding box container as evenly as possible, avoiding the situation where the number of bounding boxes in the current partitioning area is still greater than the preset number when the current depth reaches the maximum depth value. Dividing the multiple bounding boxes in the bounding box container evenly can improve the efficiency of determining the target bounding box. Determining the partitioning dimension of the subsequent partitioning level to be the opposite dimension of the previous level can reduce the comparison time of the horizontal and vertical spans and improve the partitioning efficiency of the bounding box container.
[0106] In one embodiment, before performing regional division on the current bounding box area based on the division type corresponding to the current division level to obtain the current division area corresponding to the current level, it further includes:
[0107] Determine the division boundary corresponding to the current division level. The division boundary corresponding to the current division level is located at the middle bounding box of the current bounding box area, so that the difference in the number of bounding boxes on both sides of the division boundary satisfies a preset difference.
[0108] The position of the division boundary is selected at the middle of the bounding box container or the middle bounding box of the bounding box container, and the position of the division boundary is determined as the middle bounding box. That is, the coordinate information of the division boundary is determined based on the coordinate information of the middle position point of the middle bounding box. In the case where most of the bounding boxes in the bounding box container are biased to one side, it can avoid uneven division of multiple bounding boxes, avoid an excessive number of bounding boxes in a certain index area and too few bounding boxes in a certain index area. Therefore, the division boundary corresponding to the current division level is located at the middle bounding box of the current bounding box area, and the difference in the number of bounding boxes on both sides of the division boundary satisfies the preset difference, achieving the purpose of balanced division of the bounding boxes at both ends of the current division level. Uniformly dividing multiple bounding boxes can further improve the positioning efficiency of the object to be located.
[0109] In one embodiment, based on the coordinate information of the object to be located, a target area is determined from multiple index areas. Refer to Figure 6 , including:
[0110] S610: Based on the division type corresponding to the current division level, the coordinate information of the object to be located, and the coordinate information of the division boundary corresponding to the current division level, determine the current target division area in the current division area corresponding to the current division level;
[0111] Based on the division type corresponding to the current division level, determine the query value pv for comparison of the object to be located. If the division type of the current division level is DimX, then use point.x as the query value
[0112] pv = point.x (the abscissa of the object to be located)
[0113] If the node division dimension is DimY dimension, then use point.y as the query value
[0114] pv = point.y (the ordinate of the object to be located)
[0115] If pv < partion_pos, then recursively search the left subtree. If the current dimension is DimX, the left subtree is the area on the left side of the division boundary. If the current dimension is DimY, the left subtree is the area below the division boundary; determine this area as the current target division area;
[0116] If pv >= partition_pos, then recursively search the right subtree; if the current dimension is DimX, then the left subtree is the region located to the right of the partition line; if the current dimension is DimY, then the left subtree is the region located above the partition line, and this region is determined as the current target partition region.
[0117] S620: Determine the next level of the current partitioning level as the current partitioning level;
[0118] S630: Repeat the following steps: Based on the partitioning type corresponding to the current partitioning level, the coordinate information of the object to be located, and the coordinate information of the partitioning boundary corresponding to the current partitioning level, determine the current target partitioning region in the current partitioning region corresponding to the current partitioning level, and determine the next partitioning level of the current partitioning level as the current partitioning level; until the current target region is determined as the current bounding box set, until the number of bounding boxes in the current partitioning region is less than or equal to the preset number.
[0119] The current target region is defined as the current region, and the next level of the current region is defined as the current level. In the current level, the target region is defined in the same way. This process is repeated until the number of bounding boxes in the current region is less than or equal to a preset number. If the number of bounding boxes is less than or equal to the preset number, no further level division is required, and this level is the last level.
[0120] S640: Determine the current target region corresponding to the current division level as the target region.
[0121] The current partitioning level is the last partitioning level at this time. The current partitioning level corresponds to two current partitioning regions. Based on the coordinate information of the object to be located and the coordinate information of the partitioning boundary corresponding to the current level, the target region is determined in the two current partitioning regions. In this embodiment, by determining the target region, multiple bounding boxes in non-target regions are excluded. It is only necessary to match the bounding boxes in the target region with the object to be located, which reduces the workload of bounding box matching and improves the positioning efficiency of the object to be located.
[0122] In one implementation, determining the target region from multiple index regions based on the coordinate information of the object to be located further includes:
[0123] After dividing the current bounding box, we obtain the left and right subtrees corresponding to the current division level. Therefore, the bounding boxes in the current division region and the current target division region can be completely located in the left subtree region or completely located in the right subtree region. There are also some bounding boxes located on the division boundary line, i.e., the middle region. The region located on the division boundary line cannot be further divided. If the division type of the current division level is X-dimensional, then the maximum and minimum x-coordinates of all bounding boxes in the current bounding box region are compared with the x-coordinate of the division boundary line of the current level. If the maximum x-coordinate of the bounding box is less than or equal to the x-coordinate of the division boundary line, then the bounding box is determined to be located in the left subtree. If the minimum x-coordinate of the bounding box is greater than or equal to the x-coordinate of the division boundary line, then the bounding box is determined to be located in the right subtree.
[0124] If the current partitioning level is Y-dimensional, then the maximum and minimum ordinates of all bounding boxes in the current bounding box region are compared with the ordinate of the current level's partition boundary. If the maximum ordinate of the bounding box is less than or equal to the ordinate of the partition boundary, the bounding box is determined to be located in the left subtree; if the minimum ordinate of the bounding box is greater than or equal to the ordinate of the partition boundary, the bounding box is determined to be located in the right subtree. For bounding boxes located in the middle region, the middle region corresponding to the bounding box is directly determined as the target region without further recursive queries. In this embodiment, the traditional method of encrypting road segment nodes is replaced by forming node segments from two road segment nodes, thereby achieving full coverage of actual roads in the map and avoiding missing map information. In this embodiment, after each partitioning level is divided, the region where the bounding box is located is divided into three regions: the left subtree region, the middle region, and the right subtree region. When the current target partitioning region is determined to be the middle region, recursive queries are not continued, and the middle region of the current level is directly determined as the target region. This embodiment further considers bounding boxes located on the partition boundary, further improving the accuracy of target bounding box determination.
[0125] In one implementation, after generating map display information based on the surrounding map information corresponding to the target bounding box and the position of the object to be located on the node segment corresponding to the target bounding box, the method further includes:
[0126] Send the map display information to the map display terminal.
[0127] In this embodiment, the area to be displayed on the map is determined by using the position of the object to be located on the node segment corresponding to the target bounding box as the center and a preset distance as the radius. First, the bounding box containing the nearest edge box_min_distance to the object to be located is calculated. If the nearest edge distance is greater than the query distance (box_min_distance>distance), the preset distance needs to be reset. Then, the bounding box containing the farthest edge box_min_distance to the object to be located is calculated. If the farthest distance is less than the query distance (box_max_distance>distance), there is no need to compare the bounding boxes. The map information corresponding to all bounding boxes in the bounding box set is directly determined as the map display information and sent to the display terminal. The object to be located can be displayed in the map display information, which can further improve the intuitiveness of the object to be located in the map display information.
[0128] Except as described above, refer to Figure 7 Based on the node's division dimension, determine the query value pv (the location coordinates of the object to be located), and determine the coordinate information of the division line of the preset distance distance. If the division dimension is X-dimensional, then pv = point.x; if the division dimension is Y-dimensional, then pv = point.y. Figure 7 The pv = point.x shown is calculated by comparing the X coordinate of the object to be located with the X coordinate of the dividing line distance. pv includes two cases: pv < partition_pos and pv ≥ partition_pos. Figure 7 The example shown illustrates the case where pv < partition_pos. It identifies all bounding boxes between the object to be located and the dividing line, and determines the distance between the object to be located and the nearest edge of all bounding boxes in that area. If the distance is less than or equal to a preset distance, the graph information corresponding to the bounding box containing that nearest edge is used for map display. That is, if there are four bounding boxes between the object to be located and the dividing line, the map information corresponding to these four bounding boxes is used for map display. For bounding boxes located on the dividing line, only the portion less than or equal to the preset distance from the object to be located is used for map display. In this embodiment, a dividing line with a preset distance is determined, and all bounding boxes between the object to be located and the dividing line are matched, excluding bounding boxes located completely in the opposite direction of the object to be located. This reduces the number of bounding boxes to be matched to a certain extent, further improving the efficiency of determining map display information.
[0129] This embodiment also provides a map processing device that can implement all the above-described method steps, see reference. Figure 8 As shown, the device includes:
[0130] The acquisition module 810 is used to acquire a bounding box set, which includes bounding boxes formed by the node segments corresponding to each of the multiple road segments; each node segment is determined based on the coordinate information of at least two road segment nodes on the same road segment;
[0131] The first determining module 820 is used to determine the target region from multiple index regions based on the coordinate information of the object to be located; the multiple index regions are determined based on the coordinate information of multiple bounding boxes in the bounding box set;
[0132] The second determining module 830 is used to determine the target bounding box in the target area, and the object to be located is located on the node segment corresponding to the target bounding box.
[0133] The third determining module 840 is used to determine the position of the object to be located on the node segment corresponding to the target bounding box based on the coordinate information of the object to be located.
[0134] The generation module 850 is used to generate map display information based on the surrounding map information corresponding to the target bounding box and the position of the object to be located on the node segment corresponding to the target bounding box.
[0135] The map processing device also includes:
[0136] The first acquisition module is used to acquire the starting road segment node and the ending road segment node on each road segment;
[0137] The connection module is used to sequentially connect the starting road segment node and the ending road segment node to obtain the node segments corresponding to each of the multiple road segments.
[0138] The fourth determining module is used to determine the coordinate information of the first mapping point and the second mapping point based on the coordinate information of the starting road segment node and the ending road segment node of the target node segment; the x-coordinate of the first mapping point is consistent with the x-coordinate of the ending road segment node, and the y-coordinate of the first mapping point is consistent with the y-coordinate of the starting road segment node; the x-coordinate of the second mapping point is consistent with the x-coordinate of the starting road segment node, and the y-coordinate is consistent with the y-coordinate of the ending road segment node.
[0139] The bounding box coordinate information determination module is used to obtain the bounding box coordinate information corresponding to the target node segment based on the coordinate information of the starting road segment node, the coordinate information of the first mapping point, the coordinate information of the ending road segment node, and the coordinate information of the second mapping point.
[0140] The fifth determination module is used to determine the partitioning type of the bounding box region corresponding to the bounding box set based on the comparison results of the horizontal span and vertical span of the coordinate information of multiple bounding boxes in the bounding box set. The partitioning type includes horizontal dimension partitioning and vertical dimension partitioning.
[0141] The hierarchical partitioning module is used to partition the current bounding box region based on the partitioning type corresponding to the current partitioning level, so as to obtain the current partitioned region corresponding to the current level.
[0142] The sixth determining module is used to determine the next dividing level of the current dividing level as the current dividing level;
[0143] The first execution module is used to repeatedly execute the steps: based on the partitioning type corresponding to the current partitioning level, it partitions the current bounding box region to obtain the current partitioned region corresponding to the current level; it determines the next partitioning level of the current partitioning level as the current partitioning level, until the number of bounding boxes in the current partitioned region is less than or equal to the preset number.
[0144] The seventh module is used to determine multiple index regions based on the currently partitioned region.
[0145] The eighth determining module is used to determine the dividing line corresponding to the current dividing level. The dividing line corresponding to the current dividing level is located at the middle bounding box of the current bounding box region, so that the difference in the number of bounding boxes on both sides of the dividing line meets a preset difference.
[0146] The ninth determination module is used to determine the current target division region in the current division region corresponding to the current division level based on the division type corresponding to the current division level, the coordinate information of the object to be located, and the coordinate information of the division boundary line corresponding to the current division level.
[0147] The tenth determination module is used to determine the next division level of the current division level as the current division level;
[0148] The second execution module is used to repeatedly execute the steps. Based on the division type corresponding to the current division level, the coordinate information of the object to be located, and the coordinate information of the division boundary line corresponding to the current division level, the current target division region is determined in the current division region corresponding to the current division level, and the next division level of the current division level is determined as the current division level; until the current target region is determined as the current bounding box set, until the number of bounding boxes in the current division region is less than or equal to the preset number.
[0149] The eleventh determination module is used to determine the current target region corresponding to the current division level as the target region.
[0150] The sending module is used to send map display information to the map display terminal.
[0151] Implementing this embodiment has the following effects:
[0152] 1. In this embodiment, the corresponding node segment is determined based on the coordinate information of at least two road segment nodes on the same road segment. By forming node segments instead of encrypting road segment nodes, the memory occupied by the data can be reduced. Multiple node segments are formed into their respective bounding boxes, which facilitates positioning and summarization. Multiple bounding boxes constitute a bounding box set, which corresponds to multiple index regions. By matching the coordinate information of the object to be located with the multiple index regions, the target region is obtained. Multiple bounding boxes in other index regions can be excluded. The target bounding box is determined in the target region, which can reduce the number of times the bounding box is matched with the object to be located, thus improving the positioning efficiency of the object to be located. By using the coordinate information of the object to be located, the position of the object to be located on the node segment corresponding to the target bounding box is determined. Map display information is generated based on this position. The object to be located can be displayed in the map display information, which can further improve the intuitiveness of the object to be located in the map display information.
[0153] 2. By simply obtaining the coordinate information of the starting and ending road segment nodes of each road segment, and connecting the starting and ending road segment nodes to form node segments, the position of the object to be located in the node segment can be determined based on the unit vector and offset of each node segment. This reduces the memory occupied by the initial data acquisition while ensuring the positioning accuracy of the object to be located.
[0154] Embodiments of the present invention also provide an electronic device, which includes a processor and a memory. The memory stores at least one instruction, at least one program, code set, or instruction set. The at least one instruction, at least one program, code set, or instruction set is loaded and executed by the processor to implement the map processing method as described in the method embodiments.
[0155] Embodiments of the present invention also provide a storage medium, which can be disposed in a server to store at least one instruction, at least one program, code set, or instruction set for implementing a map processing method, wherein the at least one instruction, the at least one program, the code set, or the instruction set is loaded by the processor and the map processing method is executed.
[0156] Optionally, in this embodiment, the storage medium may be located at at least one of the multiple network servers in a computer network. Optionally, in this embodiment, the storage medium may include, but is not limited to, various media capable of storing program code, such as USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks.
[0157] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or server that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or devices.
[0158] The foregoing description has fully disclosed the specific embodiments of the present invention. It should be noted that any modifications made to the specific embodiments of the present invention by those skilled in the art do not depart from the scope of the claims. Accordingly, the scope of the claims is not limited to the foregoing specific embodiments.
Claims
1. A map processing method characterized by comprising: include: Obtain a bounding box set, which includes bounding boxes formed by the node segments corresponding to each of the multiple road segments; each node segment is determined based on the coordinate information of at least two road segment nodes on the same road segment; Based on the comparison results of the horizontal and vertical spans of the coordinate information of multiple bounding boxes in the bounding box set, the partitioning type of the bounding box region corresponding to the bounding box set is determined, and the partitioning type includes horizontal dimension partitioning and vertical dimension partitioning. Based on the partitioning type corresponding to the current partitioning level, the current bounding box region is partitioned to obtain the current partitioned region corresponding to the current partitioning level. The next level of the current partitioning level is determined as the current partitioning level; Repeat the steps to divide the current bounding box region into regions based on the division type corresponding to the current division level, and obtain the current division region corresponding to the current division level; The next level of the current partitioning level is determined as the current partitioning level, until the number of bounding boxes in the current partitioning region is less than or equal to a preset number; Multiple index regions are determined based on the current partitioned region; Based on the coordinate information of the object to be located, the target area is determined from the multiple index areas; A target bounding box is determined in the target region, and the object to be located is located on the node segment corresponding to the target bounding box; Based on the coordinate information of the object to be located, determine the position of the object to be located on the node segment corresponding to the target bounding box; Based on the surrounding map information corresponding to the target bounding box, and the position of the object to be located on the node segment corresponding to the target bounding box, map display information is generated.
2. The map processing method according to claim 1, wherein Before obtaining the bounding box set, the method further includes: Obtain the starting and ending road segment nodes for each road segment; By sequentially connecting the starting road segment node and the ending road segment node, the node segments corresponding to each of the multiple road segments are obtained.
3. The map processing method according to claim 2, wherein Before obtaining the bounding box set, the method further includes: Based on the coordinate information of the starting road segment node and the ending road segment node of the target node segment, the coordinate information of the first mapping point and the coordinate information of the second mapping point are determined; the x-coordinate of the first mapping point is the same as the x-coordinate of the ending road segment node, and the y-coordinate of the first mapping point is the same as the y-coordinate of the starting road segment node; the x-coordinate of the second mapping point is the same as the x-coordinate of the starting road segment node, and the y-coordinate is the same as the y-coordinate of the ending road segment node. Based on the coordinate information of the starting road segment node, the coordinate information of the first mapping point, the coordinate information of the ending road segment node, and the coordinate information of the second mapping point, the coordinate information of the bounding box corresponding to the target node segment is obtained.
4. The map processing method of claim 1, wherein, Before dividing the current bounding box region based on the division type corresponding to the current division level to obtain the current division region corresponding to the current division level, the method further includes: Determine the dividing line corresponding to the current dividing level. The dividing line corresponding to the current dividing level is located at the middle bounding box of the current bounding box region, so that the difference in the number of bounding boxes on both sides of the dividing line meets a preset difference.
5. The map processing method according to claim 4, wherein The process of determining the target region from multiple index regions based on the coordinate information of the object to be located includes: Based on the division type corresponding to the current division level, the coordinate information of the object to be located, and the coordinate information of the division boundary line corresponding to the current division level, the current target division region is determined in the current division region corresponding to the current division level; The next level of the current partitioning level is determined as the current partitioning level; Repeat the following steps: based on the partitioning type corresponding to the current partitioning level, the coordinate information of the object to be located, and the coordinate information of the partitioning boundary corresponding to the current partitioning level, determine the current target partitioning region in the current partitioning region corresponding to the current partitioning level, and determine the next partitioning level of the current partitioning level as the current partitioning level; until the current target region is determined as the current bounding box set, until the number of bounding boxes in the current partitioning region is less than or equal to the preset number; The current target region corresponding to the current division level is determined as the target region.
6. The map processing method of claim 1, wherein, After generating map display information based on the surrounding map information corresponding to the target bounding box and the position of the object to be located on the node segment corresponding to the target bounding box, the method further includes: The map display information is sent to the map display terminal so that the map display terminal can display the map display information and display the object to be located in the map display information.
7. A map processing apparatus characterized by comprising: include: The acquisition module is used to acquire a bounding box set, which includes bounding boxes formed by the node segments corresponding to each of the multiple road segments; each node segment is determined based on the coordinate information of at least two road segment nodes on the same road segment; The fifth determination module is used to determine the partitioning type of the bounding box region corresponding to the bounding box set based on the comparison results of the horizontal span and vertical span of the coordinate information of multiple bounding boxes in the bounding box set. The partitioning type includes horizontal dimension partitioning and vertical dimension partitioning. The hierarchical partitioning module is used to partition the current bounding box region based on the partitioning type corresponding to the current partitioning level, so as to obtain the current partitioned region corresponding to the current partitioning level. The sixth determining module is used to determine the next dividing level of the current dividing level as the current dividing level; The first execution module is used to repeatedly execute the steps, and divide the current bounding box region into regions based on the division type corresponding to the current division level, so as to obtain the current division region corresponding to the current level. The next level of the current partitioning level is determined as the current partitioning level, until the number of bounding boxes in the current partitioning region is less than or equal to the preset number; The seventh module is used to determine multiple index regions based on the currently partitioned region; The first determining module is used to determine the target area from the plurality of index areas based on the coordinate information of the object to be located; The second determining module is used to determine a target bounding box in the target area, wherein the object to be located is located on a node segment corresponding to the target bounding box; The third determining module is used to determine the position of the object to be located on the node segment corresponding to the target bounding box based on the coordinate information of the object to be located. The generation module is used to generate map display information based on the surrounding map information corresponding to the target bounding box and the position of the object to be located on the node segment corresponding to the target bounding box.
8. An electronic device, characterized in that, The device includes a processor and a memory, the memory storing at least one instruction, at least one program, code set, or instruction set, the at least one instruction, the at least one program, the code set, or the instruction set being loaded and executed by the processor to implement a map processing method as described in any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that, The storage medium stores at least one instruction, at least one program, code set, or instruction set, wherein the at least one instruction, at least one program, code set, or instruction set is loaded by a processor and executed as described in any one of claims 1 to 6.
Citation Information
Patent Citations
High-precision map rendering method and device, electronic equipment and automatic driving vehicle
CN112614221A