H3-based road geographic information processing method, apparatus and device, and storage medium
H3 technology uses map grid technology to divide indexes in road geographical information processing, simplifying the complexity of existing algorithms, solving the problems of long road geographical information processing and high CPU usage in the existing technology, and realizing rapid processing of route information. and smooth presentation.
Patent Information
- Application Number
- CN202410793178.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-19
- Publication Date
- 2024-10-15
AI Technical Summary
Existing road geographic information processing algorithms have high time complexity, space complexity, and algorithm complexity in terms of thinning, filling, location aggregation, and collision prediction, resulting in high CPU usage, long time consumption, and difficulty in regular use.
H3 technology is used to divide geographical areas in the form of regular hexagons through map grid technology, establish indexes, and fill or thin out based on the number of reported coordinate points in the index, simplifying algorithm complexity and reducing CPU usage.
H3 technology is used to quickly process path information, save computing time, reduce front-end HTML rendering pressure, display smoother completion results, reduce CPU usage, and prevent memory overflow.
Smart Images

Figure CN118779550A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of intelligent transportation technology, and in particular, to a road geographic information processing method, device, equipment and storage medium based on H3. Background Art
[0002] In the path planning technology in the field of intelligent road traffic, it is often necessary to process road geographic information, and the processing methods include but are not limited to: thinning, filling, position aggregation, and collision prediction. For example, if the reported coordinate data is too dense, resulting in high pressure on the front-end HTML rendering, or the reported coordinate points are too sparse, resulting in too many edges and corners in the front-end web page rendering trajectory, it is necessary to thin out or fill in the path trajectory coordinate points. For another example, if due to problems such as GPS accuracy, the reported vehicle coordinates cannot completely coincide with the coordinates on the path, resulting in unsatisfactory path planning accuracy, position aggregation is required. For another example, at the same time, due to problems such as GPS accuracy, the reported vehicle coordinates cannot completely coincide with the coordinates on the path, resulting in inaccurate collision predictions, and accurate collision predictions are required.
[0003] However, the current mainstream road geographic information processing algorithms (sparseness, completion, location aggregation, collision prediction, etc.) are very complex and difficult to implement in terms of time complexity, space complexity, or algorithm complexity, which is not conducive to routine use. In addition, because a large amount of calculation is required, the CPU usage is very high and the time consumption is long. Summary of the invention
[0004] In order to solve one of the above-mentioned technical defects, an H3-based road geographic information processing method, device, equipment and storage medium are provided in the embodiments of the present application.
[0005] According to a first aspect of an embodiment of the present application, a road geographic information processing method based on H3 is provided, the method comprising:
[0006] By using a map grid technology, the geographical area is divided into at least one level in the form of regular hexagons and an index is established;
[0007] Obtain the path of the vehicle within the geographic area and the reported coordinate points of the path;
[0008] When the number of reported coordinate points in an index meets the filling condition, the reported coordinate points in the index are filled; when the number of reported coordinate points in an index meets the thinning condition, the reported coordinate points in the index are thinned.
[0009] In an optional embodiment of the present application, the method further comprises: dividing the geographical area into at least one level in the form of regular hexagons and creating an index by using a map grid technology:
[0010] The path is entered according to the index, and the parent quadrilateral index of the path is also entered at the same time.
[0011] In an optional embodiment of the present application, when the number of reported coordinate points in an index meets the filling condition, filling the reported coordinate points in the index further includes:
[0012] If the number of reported coordinate points in an index is less than or equal to the completion threshold, the area corresponding to the index is used as the coordinate completion area;
[0013] Get the starting point and end point of the path in the coordinate completion area;
[0014] In the reference coordinate system, determine the coordinates of the starting point and the angle α between the line connecting the starting point and the end point and the horizontal axis of the reference coordinate system, obtain the angle between the line connecting the starting point and the center point of each regular hexagon around it and the horizontal axis of the reference coordinate system, and take the coordinates of the center point of the regular hexagon with the smallest difference from the angle α as the supplementary point;
[0015] With the supplementary point as the new starting point, repeat the steps of determining the starting point coordinates in the reference coordinate system and the subsequent steps, and stop searching for the supplementary point when the regular hexagon with the smallest difference with the angle α is the regular hexagon where the end point is located;
[0016] Connect the starting point, the supplementary point and the end point in sequence to complete the filling.
[0017] In an optional embodiment of the present application, when the number of reported coordinate points in an index meets the filling threshold requirement, filling the reported coordinate points further includes:
[0018] When the number of reported coordinate points in an index meets the filling condition, filling the reported coordinate points in the index further includes:
[0019] If the number of reported coordinate points in an index is less than or equal to the completion threshold, the area corresponding to the index is used as the coordinate completion area;
[0020] Get the starting point and end point of the path in the coordinate completion area;
[0021] In the reference coordinate system, determine the coordinates of the starting point, as well as the angle α between the line connecting the starting point and the end point and the horizontal axis of the reference coordinate system, obtain the angle between the line connecting the starting point and the center point of each regular hexagon around it and the horizontal axis of the reference coordinate system, and use the coordinates of the center point of the regular hexagon with the smallest difference from the angle α as the pre-selected point for the supplementary point;
[0022] Determine whether the pre-selected point is within the road range:
[0023] If so, the pre-selected point is used as the supplementary point;
[0024] If not, the road adsorption technology is used to determine the supplementary point within the road range based on the pre-selected points for supplementary points;
[0025] With the supplementary point as the new starting point, repeat the steps of determining the starting point coordinates in the reference coordinate system and the subsequent steps, and stop searching for the supplementary point when the regular hexagon with the smallest difference with the angle α is the regular hexagon where the end point is located;
[0026] Connect the starting point, the supplementary point and the end point in sequence to complete the filling.
[0027] In an optional embodiment of the present application, when the number of reported coordinate points in an index meets the thinning condition, thinning the reported coordinate points in the index further includes:
[0028] If the number of reported coordinate points in an index is greater than or equal to the thinning threshold, the area corresponding to the index is used as the coordinate thinning area;
[0029] Calculate the average value of all reported coordinate points in the coordinate sparse area;
[0030] Selecting a retained coordinate point according to the difference between the reported coordinate points in the coordinate thinning area and the average value, the retained coordinate point being one or more of the reported coordinate points in the coordinate thinning area;
[0031] Remove the coordinate points other than the retained coordinate points.
[0032] In an optional embodiment of the present application, after selecting the retained coordinate points according to the difference between the reported coordinate points and the average value in the coordinate thinning area, the method further includes:
[0033] Add time stamps to the reserved coordinate points.
[0034] In an optional embodiment of the present application, after obtaining the reported coordinate points of the path, the method further includes:
[0035] Get the vehicle coordinate point of the vehicle and compare it with the reported coordinate point at the same index:
[0036] If there is only one target reported coordinate point, the vehicle coordinate point is included in the target reported coordinate point, wherein the target reported coordinate point is a reported coordinate point with the same index value as the vehicle coordinate point and a direction angle difference that satisfies the direction coincidence threshold;
[0037] If there are multiple target reported coordinate points, the vehicle coordinate point is classified into the target reported coordinate point with the smallest direction angle difference with the vehicle coordinate point;
[0038] If there is no reported coordinate point with the same index value as the vehicle coordinate point, or there is a reported coordinate point with the same index value as the vehicle coordinate point but the direction angle difference does not meet the direction overlap threshold, then when the scale corresponding to the previous level index of the index does not exceed the preset error range, the above comparison is performed in the previous level index until the scale corresponding to the previous level index exceeds the preset error range.
[0039] In an optional embodiment of the present application, after obtaining the vehicle coordinate point of the vehicle, the method further includes:
[0040] Obtain the vehicle coordinate points of another vehicle, and determine whether the two vehicles are simultaneously located at the same index after a preset time according to the vehicle coordinate points and driving directions of the two vehicles;
[0041] If so, a collision warning of the two vehicles is issued.
[0042] According to a second aspect of the embodiment of the present application, a road geographic information processing device based on H3 is provided, the device comprising an index building module and a path optimization module; wherein:
[0043] An index building module, which divides the geographical area into at least one level in the form of regular hexagons and builds an index by using a map grid technology;
[0044] The path optimization module obtains the path of the vehicle in the geographical area and the reported coordinate points of the path; when the number of reported coordinate points in an index meets the completion condition, the reported coordinate points in the index are completed; when the number of reported coordinate points in an index meets the thinning condition, the reported coordinate points in the index are thinned.
[0045] According to the third aspect of an embodiment of the present application, a computer device is provided, comprising: a memory; a processor; and a computer program; wherein the computer program is stored in the memory and is configured to be executed by the processor to implement the steps of any method as in the first aspect of an embodiment of the present application.
[0046] According to a fourth aspect of an embodiment of the present application, a computer-readable storage medium is provided, on which a computer program is stored; the computer program is executed by a processor to implement the steps of any method of the first aspect of the embodiment of the present application.
[0047] The road geographic information processing method based on H3 provided in the embodiment of the present application has the following features:
[0048] Beneficial effects:
[0049] 1. Introducing H3 technology, which enables fast processing of path information by establishing hexagonal indexes, and using H3geo technology to perform pre-calculations when entering paths, which can greatly save subsequent calculation time;
[0050] 2. Use H3 grid technology to thin out the unevenly distributed coordinate path points, and display the thinning results more evenly, reduce the pressure of front-end HTML rendering, and reduce the large amount of data to be rendered at one time; use H3 grid technology to fill in the unevenly distributed coordinate path points (due to network reasons), and display the filling results more smoothly;
[0051] 3. Simplify the time complexity, algorithm complexity, and space complexity of the current mainstream path thinning and completion algorithms, combine them with the pre-calculation of calculation results, reduce the CPU usage in actual calculations, smooth the CPU usage, and prevent memory overflow. BRIEF DESCRIPTION OF THE DRAWINGS
[0052] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0053] Figure 1 A flowchart of a road geographic information processing method based on H3 provided in an embodiment of the present application;
[0054] Figure 2 A schematic diagram of an overview of index partitioning based on H3 provided in an embodiment of the present application;
[0055] Figure 3 A local schematic diagram of index partitioning based on H3 provided in an embodiment of the present application;
[0056] Figure 4 A schematic diagram showing a map path to be completed provided in an embodiment of the present application;
[0057] Figure 5 A schematic diagram of the completion execution provided in an embodiment of the present application;
[0058] Figure 6 A schematic diagram of the filling effect provided in the embodiment of the present application;
[0059] Figure 7 A schematic diagram showing a map path that needs to be thinned provided in an embodiment of the present application;
[0060] Figure 8 A schematic diagram of obtaining the vehicle position provided in an embodiment of the present application;
[0061] Fig. 9 A schematic diagram of a vehicle collision provided in an embodiment of the present application;
[0062] Fig.10 A structural diagram of a road geographic information processing device based on H3 provided in an embodiment of the present application;
[0063] Fig.11 A schematic diagram of the computer device structure provided for one embodiment of the present application. DETAILED DESCRIPTION
[0064] In order to make the technical solutions and advantages in the embodiments of the present application more clearly understood, the exemplary embodiments of the present application are further described in detail below in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present application, rather than an exhaustive list of all the embodiments. It should be noted that the embodiments in the present application and the features in the embodiments can be combined with each other without conflict.
[0065] The current mainstream road geographic information processing algorithms (sparseness, completion, location aggregation, collision prediction, etc.) are all very complex and difficult to implement in terms of time complexity, space complexity, or algorithm complexity, which is not conducive to routine use. In addition, because a large amount of calculation is required, the CPU usage is very high and the time consumption is long.
[0066] In response to the above problems, an embodiment of the present application provides a road geographic information processing method based on H3. This method is a road geographic information processing method including thinning, completion, position aggregation, and collision prediction. By introducing H3 indexing technology, the accuracy of road traffic path planning can be improved and computing power resources can be saved.
[0067] Please see Figure 1 Steps shown:
[0068] S1: Using map grid technology, a geographical area is divided into at least one level in the form of regular hexagons and an index is established.
[0069] S2: Obtain the path of the vehicle within the geographic area and the reported coordinate points of the path.
[0070] In a specific implementation, the path of the vehicle in the geographical area is obtained, the path is entered according to the index, and the parent quadrilateral index of the path is entered at the same time.
[0071] See also Figure 2 , Figure 3 , dividing the world into multiple levels of regular hexagons to determine the subordinate relationship and position relationship of each region. In this embodiment, the index establishment of this step is explained by the following example:
[0072]
[0073]
[0074] In the embodiment of the present application, through H3 technology, when entering a path, the parent quadrilateral index has been entered into the database, which can greatly save subsequent calculation time and achieve pre-calculation. Specifically, taking the above table as an example, the present application further illustrates:
[0075] When entering a path, the parent quadrilateral index, i.e. index 7, 8, 9, 10, 11, 12, is entered into the database:
[0076]
[0077]
[0078] As some preferred embodiments of the present application, in order to avoid the problem of meaningless rendering of paths in the map due to excessive scale, it can be divided only to the index of H3 being 10. Since the indexes 13, 14, and 15 need to render 6, 8, and 10 points respectively, they can be not used to avoid wasting data. In addition, as a preference, when the scale is less than 20 meters (for example, the indexes 13, 14, and 15), the map is too small and no selection is made in this embodiment. In some other embodiments of the present application, selection can be added according to actual needs.
[0079] Please continue to see Figure 1 :
[0080] S3: When the number of reported coordinate points in an index meets the filling condition, the reported coordinate points in the index are filled; when the number of reported coordinate points in an index meets the thinning condition, the reported coordinate points in the index are thinned.
[0081] Get the reported coordinate points of the path. When the number of reported coordinate points in an index meets the filling threshold requirement, fill the reported coordinate points; when the number of reported coordinate points in an index meets the thinning threshold requirement, thin the reported coordinate points.
[0082] Due to network problems or machine problems, the vehicle may occasionally upload intermittent coordinates. After being rendered by the front-end technology, the path will appear as Figure 4 The uneven and sharpened effect shown is, in some embodiments of the present application, in order to improve the problem of map path display, a point-filling operation is performed on some paths with too long time intervals.
[0083] Existing filling technologies include the nearest road solution and the average increasing longitude and latitude solution. However, the current mainstream filling point algorithms require a lot of calculations when used, which results in a slow result time and high CPU usage. The algorithm complexity is relatively complex and difficult to implement, which is not conducive to the use of conventional programs. The above-mentioned nearest road solution relies heavily on the acquisition of the road coordinates of the path, which increases the complexity of the algorithm. If the filling coordinates happen to fall on other roads at the corner, it will cause greater deviations. The average increasing longitude and latitude solution algorithm is too rough. If it encounters a bend, the right angle feature will be lost.
[0084] In some embodiments of the present application, if the number of reported coordinate points in an index is less than or equal to a completion threshold, the area corresponding to the index is used as a coordinate completion area;
[0085] Get the starting point and end point of the path in the coordinate completion area;
[0086] In the reference coordinate system, determine the coordinates of the starting point and the angle α between the line connecting the starting point and the end point and the horizontal axis of the reference coordinate system, obtain the angle between the line connecting the starting point and the center point of each regular hexagon around it and the horizontal axis of the reference coordinate system, and take the coordinates of the center point of the regular hexagon with the smallest difference from the angle α as the supplementary point;
[0087] With the supplementary point as the new starting point, repeat the steps of determining the starting point coordinates in the reference coordinate system and the subsequent steps, and stop searching for the supplementary point when the regular hexagon with the smallest difference with the angle α is the regular hexagon where the end point is located;
[0088] Connect the starting point, the supplementary point and the end point in sequence to complete the filling.
[0089] In a specific implementation, if the number of reported coordinate points in an index is less than or equal to a completion threshold, the index is selected as a coordinate completion area; optionally, the completion threshold is 0.
[0090] Get the angle α of the line connecting the coordinate points on both sides of the path in the padded area, get the coordinates of the starting point in the coordinate points on both sides, and get the angle of the line connecting the starting point and the center point of each regular hexagon around it.
[0091] Optionally, the coordinates of the center point of the regular hexagon with the smallest difference with the angle α can be used as the filling point, and the above filling steps are repeated to fill to the end point of the coordinate points on both sides;
[0092] Optionally, in some embodiments of the present application, the coordinates of the center point of the regular hexagon with the smallest difference from the angle α can be used as the pre-selected point for the supplementary point, and the pre-selected point for the supplementary point is adsorbed by the road coordinate adsorption technology to determine the supplementary point, and the above steps are repeated to complete the end point in the coordinate points on both sides. Specifically:
[0093] If the number of reported coordinate points in an index is less than or equal to the completion threshold, the area corresponding to the index is used as the coordinate completion area;
[0094] Get the starting point and end point of the path in the coordinate completion area;
[0095] In the reference coordinate system, determine the coordinates of the starting point, as well as the angle α between the line connecting the starting point and the end point and the horizontal axis of the reference coordinate system, obtain the angle between the line connecting the starting point and the center point of each regular hexagon around it and the horizontal axis of the reference coordinate system, and use the coordinates of the center point of the regular hexagon with the smallest difference from the angle α as the pre-selected point for the supplementary point;
[0096] Determine whether the pre-selected point is within the road range:
[0097] If so, the pre-selected point is used as the supplementary point;
[0098] If not, the road adsorption technology is used to determine the supplementary point within the road range based on the pre-selected points for supplementary points;
[0099] With the supplementary point as the new starting point, repeat the steps of determining the starting point coordinates in the reference coordinate system and the subsequent steps, and stop searching for the supplementary point when the regular hexagon with the smallest difference with the angle α is the regular hexagon where the end point is located;
[0100] Connect the starting point, the supplementary point and the end point in sequence to complete the filling.
[0101] Specifically, this application further illustrates this through an example, see Figure 5 :
[0102] Due to network and other reasons, the distance between point A and point B is long, but only points A and B are reported, so coordinate completion is required;
[0103] Select one of the indexes to complete the coordinates. In this example, we take index 11 and the 50-meter scale as an example:
[0104] tangα=(B latitude-A latitude) / (B longitude-A longitude), angle α can be calculated;
[0105] The longitude and latitude coordinates of the center points a, b, c, d, e, and f around the regular hexagon h are obtained through the H3 grid technology;
[0106] Get the coordinates of point h on the central grid, then connect the center points of the six regular hexagons around it, calculate the various angles, and the coordinates of the center point of the regular hexagon with the smallest difference with α is the supplementary point; and so on and so forth until it is finally supplemented to point b (α is the angle of intersection with the x-axis, and the second connection only needs to connect the three regular hexagons on the right, and the number of supplementary points is determined by when point b is reached, that is, supplement points until point B is reached).
[0107] As a preference, the road adsorption technology may be used to adsorb the supplementary point onto the nearest road; specifically, the point closest to the road. Furthermore, the nearest point in the direction of the two-lane road may be selected.
[0108] like Figure 6 As shown, a smooth effect can be obtained after padding.
[0109] In summary, the embodiments of the present application simplify the time complexity, algorithm complexity, and space complexity of the current mainstream path completion algorithm. The calculation results are placed in advance, which reduces the CPU usage in the actual completion calculation, smoothes the CPU peaks and valleys, makes the CPU occupancy smoother, and prevents memory overflow. This embodiment uses H3 grid technology to complete the unevenly distributed coordinate path points (network reasons) and display the completion results more smoothly.
[0110] The following further describes the thinning algorithm in the embodiment of the present application:
[0111] In some scenarios, vehicles report high-precision coordinates through industrial computers at a frequency of 20 times / s. Assuming the vehicle speed is 60KM / H and 17M / S, it is calculated that the coordinates are uploaded once every 0.85 meters; in actual implementation, if displayed on a high-precision map, the coordinates need to be thinned to 5 times / second. Taking the Third Ring Road of a certain city, an ordinary taxi with a speed of 60KM per hour, and an industrial computer with an upload speed of 20 times per second as an example, after rendering, 600 points need to be rendered within a distance of 500 meters, which causes waste. Reasonable and fast coordinate thinning should be performed.
[0112] Existing thinning algorithms include Douglas-Peucker thinning algorithm, vertical distance limit method, step compression algorithm and line segment filtering algorithm. However, the current mainstream thinning algorithms require a lot of calculations when used, resulting in a slow result time and high CPU usage. The algorithm complexity is relatively complex and difficult to implement, which is not conducive to the use of conventional programs.
[0113] In some embodiments of the present application, a thinning operation is performed to solve the above problem: if the number of reported coordinate points in an index is greater than or equal to a thinning threshold, the area corresponding to the index is used as a coordinate thinning area;
[0114] Calculate the average value of all reported coordinate points in the coordinate sparse area;
[0115] Selecting a retained coordinate point according to the difference between the reported coordinate points in the coordinate thinning area and the average value, the retained coordinate point being one or more of the reported coordinate points in the coordinate thinning area;
[0116] Remove the coordinate points other than the retained coordinate points.
[0117] In a specific implementation, if the number of reported coordinate points in an index is greater than or equal to a thinning threshold, the index is selected as a coordinate thinning area;
[0118] The average value of all reported coordinate points in the coordinate thinning area is calculated, and one or part of all reported coordinate points are selected as retained coordinate points based on the gap between the reported coordinate points and the expected value, and the coordinate points other than the retained coordinate points in the coordinate thinning area are removed; optionally, a timestamp is added to the retained coordinate points so that the remaining points have time attributes, representing the running time of the vehicle in the hexagon.
[0119] Specifically, this application further illustrates this through an example.
[0120] First determine the required H3 index level:
[0121] List the current H3 index, report at the map scale at a frequency of 15 frames / s on the industrial computer, get the number of track points at a speed of 60km / h, and determine the number of rendering points:
[0122]
[0123]
[0124] In the table above:
[0125] Length per scale - actual number of rendered points = (scale / (60km*1000 / 3600s))*15≈2 frames (points) / meter;
[0126] Length of each scale - number of rendering points after thinning in this scheme = scale / diameter (side length * 2);
[0127] The number of original rendering points in the unit scale = scale length / vehicle speed*number of frames reported per second;
[0128] When observing the map in practice, the scale range generally used is 7 to 12 indexes, corresponding to the scales of 5000m and 20m, that is, other scales are too large or too small to be used for actual path display. For example: the scale of index 6 is 25 kilometers, corresponding to a large province-level area and not suitable for displaying vehicle tracks. The scale of index 12 is 15 meters, corresponding to a small area of 250 meters long and 250 meters wide, which is not suitable for displaying vehicle tracks.
[0129] Furthermore, obtain the original trajectory coordinate data:
[0130]
[0131]
[0132] Calculate the H3 index address of the original coordinates. Take H3 indexes 11 and 12 as an example. Use H3geo grid technology to obtain the index addresses 10 and 11:
[0133] serial number Longitude, latitude Index value address H3: 11 Index value address H3: 10 1 116.259646,39.769081 8b0d4b88578afff 8a0d4b88578ffff 2 116.259877,39.769302 8b0d4b8856a4fff 8a0d4b8856a7fff 3 116.259897,39.769351 8b0d4b8856a4fff 8a0d4b8856a7fff 4 116.260171,39.769471 8b0d4b8856a5fff 8a0d4b8856a7fff 5 116.260233,39.769523 8b0d4b8856a5fff 8a0d4b8856a7fff 6 116.260287,39.769533 8b0d4b8856a5fff 8a0d4b8856a7fff 7 116.260302,39.769584 8b0d4b8856a5fff 8a0d4b8856a7fff 8 116.260361,39.769632 8b0d4b8856a5fff 8a0d4b8856a7fff 9 116.260462,39.769748 8b0d4b885612fff 8a0d4b8856a7fff 10 116.260513,39.769794 8b0d4b885612fff 8a0d4b8856a7fff 11 116.260528,39.769813 8b0d4b885612fff 8a0d4b885617fff 12 116.260538,39.769827 8b0d4b885612fff 8a0d4b885617fff
[0134] Draw as Figure 7 The specific implementation diagram of thinning is shown in the figure. Further, the coordinate points are merged and thinned and the merging operation is performed with the timestamp:
[0135] When there is only one point in the same index area, this point is used directly without deleting the point;
[0136] When there are only 3 or more points in the same area, Figure 7 Take the "h" area as an example:
[0137] serial number Longitude, latitude Index value address H3: 11 4 116.260171,39.769471 8b0d4b8856a5fff 5 116.260233,39.769523 8b0d4b8856a5fff 6 116.260287,39.769533 8b0d4b8856a5fff 7 116.260302,39.769584 8b0d4b8856a5fff 8 116.260361,39.769632 8b0d4b8856a5fff
[0138] Calculate the expected value of the above five sets of data, retain the points closest to the expected value, and remove all other points to perform thinning. Optionally, the expected value calculation can be performed by any one of the variance, mean or standard deviation methods.
[0139] In this embodiment, only the point numbered 6 may be retained.
[0140] In summary, the embodiment of the present application simplifies the time complexity, algorithm complexity, and space complexity of the current mainstream path thinning algorithm. The calculation results are placed in advance, which reduces the CPU usage in the actual thinning calculation, smoothes the CPU peak and valley, makes the CPU occupancy smoother, and prevents memory overflow. This embodiment uses H3 grid technology to reduce the front-end HTML rendering pressure and reduce the large amount of data rendered at one time.
[0141] In some embodiments of the present application, the vehicle coordinate point of the vehicle is obtained and compared with the reported coordinate point under the same index:
[0142] If there is only one target reported coordinate point, the vehicle coordinate point is included in the target reported coordinate point, wherein the target reported coordinate point is a reported coordinate point with the same index value as the vehicle coordinate point and a direction angle difference that satisfies the direction coincidence threshold;
[0143] If there are multiple target reported coordinate points, the vehicle coordinate point is classified into one of the target reported coordinate points according to the difference in direction angles; specifically, the vehicle coordinate point is classified into the target reported coordinate point with the smallest direction angle difference with the vehicle coordinate point;
[0144] If there is no reported coordinate point with the same index value as the vehicle coordinate point, or there is a reported coordinate point with the same index value as the vehicle coordinate point but the direction angle difference does not meet the direction overlap threshold, then when the scale corresponding to the previous level index of the index does not exceed the preset error range, the above comparison is performed in the previous level index until the scale corresponding to the previous level index exceeds the preset error range.
[0145] In actual application scenarios, after the vehicle has planned its driving trajectory, there will inevitably be paths that have been driven and paths that have not been driven. However, due to various issues such as GPS accuracy, the reported coordinates cannot completely coincide with the coordinates on the path, so the actual coordinates of the vehicle need to be adsorbed onto the path.
[0146] Existing technologies include Euclidean distance judgment and driving direction judgment, but because the vehicle repeatedly calculates the position relationship during continuous driving, square and square root operations will waste computer performance. If the path position is directly used to represent the vehicle position after the first road adsorption, the algorithm must consider the vehicle's intentional deviation from the route. In addition, a lot of calculations will be wasted when converting longitude and latitude into distance, because the distance with the same precision difference is different at different latitudes.
[0147] The solution provided in the embodiment of the present application is as follows:
[0148] List the current H3 index, in the map scale, with distances at common scales:
[0149] For example, if the vehicle width is 2 m, the calculation is performed with index 14 to determine the error range of 12-13 digits, and the allowable error range is 16.2 m (ie (9.5-1.4)*2=16.2).
[0150] H3 Index (resolution) H3 index regular hexagon side length Corresponding web map scale m 7 1220.6 5000m 8 461.4 2000m 8 461.4 1000m 9 174.4 500m 10 65.9 200 meters 11 24.9 50 meters 12 9.5 20 meters 13 3.6 15 14 1.4m 10 15 0.5m 5
[0151] Get the original trajectory coordinate data (longitude, latitude), for example (where x is the actual coordinate point of the vehicle):
[0152] Coordinate Number Longitude, latitude Direction (true north coordinate) 1 116.259646,39.769081 102 2 116.259897,39.769351 47 3 116.260302,39.769584 37 4 116.260528,39.769813 44 x 116.260307,39.769589 41
[0153] After obtaining, we get Figure 8 The schematic diagram shown;
[0154] Calculate the H3 index address of the original coordinates. Take H3 indexes 11 and 12 as an example. Use H3geo grid technology to obtain the index addresses 10 and 11:
[0155]
[0156] To obtain the vehicle position index, take the vehicle coordinates of 116.260322, 39.769594 as an example, calculate the index values 12, 13, and 14 corresponding to the position of the vehicle at this point. Since the index calculation here is a mapping transformation, the consumption performance is very low.
[0157]
[0158] Determine the position relationship between the vehicle position and the planned path:
[0159] First, compare from index 14:
[0160] Compare the index 14 value 8e0d4b8856a5767 of the x-point coordinate with numbers 1, 2, 3, and 4. If an equal value is found and the direction angle difference does not exceed 5°, the point is closest to the vehicle position and is included in the path point:
[0161] If there is a value that meets the above conditions, it will be directly classified as a waypoint;
[0162] If there are two or more values that meet the above conditions, the one with the smallest angle deviation is selected.
[0163] If there are two or more values that meet the above conditions and have the same minimum deviation angle, then it is proved that under the premise of 1.5 meter accuracy, the two points coincide and the first value can be selected.
[0164] If there is no coordinate point that meets the above conditions, 13 index comparisons are performed;
[0165] If there is no coordinate point that meets the above conditions under index 13, then perform index 12 comparison;
[0166] If there is still no matching coordinate point under index 12, it means that there is no nearest coordinate within the error range of 16.2 meters. You should consider discarding this point or compare it with a larger index. In this embodiment, the coordinate error of index 11 is 50 meters, so no further judgment is made.
[0167] In summary, this embodiment reduces the algorithm complexity and time complexity, and puts the calculation amount in front, transforming the previous position calculation judgment into query judgment, thereby greatly reducing the CPU occupancy rate and reducing the time consumption for obtaining results.
[0168] In some embodiments of the present application, a vehicle coordinate point of another vehicle is obtained, and based on the vehicle coordinate points and driving directions of the two vehicles, it is determined whether the two vehicles are simultaneously located at the same index after a preset time;
[0169] If so, a collision warning of the two vehicles is issued.
[0170] In an actual application scenario, a vehicle reports high-precision coordinates through an industrial computer at a frequency of 20 times / s. Assuming the vehicle speed is 60 km / h and 17 m / s, it is calculated that the coordinates are uploaded every 0.85 meters. At this time, a collision warning is required for the two vehicles, or in other words, a warning is issued for whether the driving trajectories of the two vehicles will overlap in 1 to 5 seconds.
[0171] In the prior art, the collision warning is mainly performed through distance and direction calculation, that is, geometric calculation is performed on the two objects after the speed and direction are known. This method consumes too much CPU and memory, resulting in poor real-time effect of collision warning.
[0172] Please refer to Fig. 9 , the solution provided in the embodiment of the present application includes:
[0173] In this example, index 14 is selected because the vehicle width is generally less than 2 meters. This is because under index 14, a regular hexagon with a radius of 1.3 meters and a diameter of 2.6 meters can reserve some warning margin.
[0174] Vehicles A and B are shown on the map as follows Figure 8 The vehicle's travel direction and current time coordinates are shown;
[0175] According to the current longitude and latitude, vehicle speed and direction, the longitude and latitude offset difference after 1s to 5s is obtained;
[0176] Compare the indexes of car A 1 second later and car B 1 second later to see if they are the same. If they are the same index, a collision occurs. In some other embodiments of the present application, other time thresholds may also be set.
[0177] In the embodiment of the present application, different colors may be used to mark different collision prediction times, for example:
[0178] If the collision occurs within 1 to 2 seconds, it will be marked red; within 3 to 4 seconds, it will be marked orange; after 5 seconds, it will be marked green; this is how the degree of urgency is distinguished.
[0179] In summary, the solution provided in the embodiment of the present application can provide early warning of collision more quickly, simplify the calculation logic, and greatly reduce the difficulty of implementation.
[0180] It should be understood that, although the various steps in the flow chart are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear description in this article, the execution of these steps is not strictly limited in order, and these steps can be executed in other orders. Moreover, at least a portion of the steps in the figure may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these sub-steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a portion of the sub-steps or stages of other steps.
[0181] See also Fig.10 An embodiment of the present application provides a road geographic information processing device based on H3, including an index building module 10 and a path optimization module 20; wherein,
[0182] An index building module 10, which divides a geographical area into at least one level in the form of regular hexagons and builds an index by using a map grid technology;
[0183] The path optimization module 20 obtains the reported coordinate points of the path, and when the number of reported coordinate points in an index meets the completion threshold requirement, the reported coordinate points are completed; when the number of reported coordinate points in an index meets the thinning threshold requirement, the reported coordinate points are thinned.
[0184] For the specific limitations of the above-mentioned road geographic information processing device based on H3, please refer to the limitations of the road geographic information processing method based on H3 above, which will not be repeated here. The various modules in the above-mentioned road geographic information processing device based on H3 can be fully or partially implemented by software, hardware and their combination. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.
[0185] In one embodiment, a computer device is provided, the internal structure diagram of which can be as follows: Fig.11As shown. The computer device includes a processor, a memory, a network interface and a database connected via a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store data. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a road geographic information processing method based on H3 as described above is implemented. It includes: a memory and a processor, the memory stores a computer program, and when the processor executes the computer program, any step in the road geographic information processing method based on H3 as described above is implemented.
[0186] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, any step in the above-mentioned road geographic information processing method based on H3 can be implemented.
[0187] Those skilled in the art will appreciate that the embodiments of the present application can be provided as methods, systems, or computer program products. Therefore, the present application can adopt the form of complete hardware embodiments, complete software embodiments, or embodiments in combination with software and hardware. Moreover, the present application can adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code. The scheme in the embodiments of the present application can be implemented in various computer languages, for example, C language, VHDL language, Verilog language, object-oriented programming language Java and literal scripting language JavaScript, etc.
[0188] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0189] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0190] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0191] Although the preferred embodiments of the present application have been described, those skilled in the art may make other changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications falling within the scope of the present application.
[0192] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.
Claims
1. A road geographic information processing method based on H3, characterized in that: include: By using a map grid technology, the geographical area is divided into at least one level in the form of regular hexagons and an index is established; Obtaining a path of the vehicle within the geographic area and reported coordinate points of the path; When the number of reported coordinate points in an index meets the filling condition, the reported coordinate points in the index are filled; when the number of reported coordinate points in an index meets the thinning condition, the reported coordinate points in the index are thinned.
2. The road geographic information processing method based on H3 according to claim 1 is characterized in that: The method of dividing the geographical area into at least one level in the form of regular hexagons and indexing the geographical area by using the map grid technology further includes: The path is entered according to the index, and the parent quadrilateral index of the path is also entered at the same time.
3. The road geographic information processing method based on H3 according to claim 1 is characterized in that: When the number of reported coordinate points in an index meets the filling condition, filling the reported coordinate points in the index further includes: If the number of reported coordinate points in an index is less than or equal to the completion threshold, the area corresponding to the index is used as the coordinate completion area; Obtain the starting point and the end point of the path in the coordinate completion area; In the reference coordinate system, determine the coordinates of the starting point and the angle α between the line connecting the starting point and the end point and the horizontal axis of the reference coordinate system, obtain the angle between the line connecting the starting point and the center point of each regular hexagon around it and the horizontal axis of the reference coordinate system, and use the coordinates of the center point of the regular hexagon with the smallest difference from the angle α as the supplementary point; Taking the supplementary point as a new starting point, repeating the step of determining the starting point coordinates in the reference coordinate system and the subsequent steps, and stopping the search for the supplementary point when the regular hexagon with the smallest difference with the angle α is the regular hexagon where the end point is located; The starting point, the supplementary point and the end point are connected in sequence to complete the supplementation.
4. The road geographic information processing method based on H3 according to claim 1 is characterized in that: When the number of reported coordinate points in an index meets the filling condition, filling the reported coordinate points in the index further includes: If the number of reported coordinate points in an index is less than or equal to the completion threshold, the area corresponding to the index is used as the coordinate completion area; Obtain the starting point and the end point of the path in the coordinate completion area; In the reference coordinate system, determine the coordinates of the starting point and the angle α between the line connecting the starting point and the end point and the horizontal axis of the reference coordinate system, obtain the angle between the line connecting the starting point and the center point of each regular hexagon around it and the horizontal axis of the reference coordinate system, and use the coordinates of the center point of the regular hexagon with the smallest difference from the angle α as the pre-selected point for the supplementary point; Determine whether the pre-selected point is within the road range: If yes, the pre-selected point is used as the supplementary point; If not, then determining the supplementary point within the road range based on the pre-selected supplementary point by using the road adsorption technology; Taking the supplementary point as a new starting point, repeating the step of determining the starting point coordinates in the reference coordinate system and the subsequent steps, and stopping the search for the supplementary point when the regular hexagon with the smallest difference with the angle α is the regular hexagon where the end point is located; The starting point, the supplementary point and the end point are connected in sequence to complete the supplementation.
5. The road geographic information processing method based on H3 according to claim 1 is characterized in that: When the number of reported coordinate points in an index meets the thinning condition, thinning the reported coordinate points in the index further includes: If the number of reported coordinate points in an index is greater than or equal to the thinning threshold, the area corresponding to the index is used as the coordinate thinning area; Calculate the average value of all reported coordinate points in the coordinate thinning area; Selecting a reserved coordinate point according to the difference between the reported coordinate points in the coordinate thinning area and the average value, wherein the reserved coordinate point is one or more of the reported coordinate points in the coordinate thinning area; The coordinate points other than the reserved coordinate points are removed.
6. The road geographic information processing method based on H3 according to claim 5 is characterized in that: After selecting the retained coordinate points according to the difference between the reported coordinate points in the coordinate thinning area and the average value, the method further includes: A time stamp is added to the reserved coordinate point.
7. The road geographic information processing method based on H3 according to claim 1 is characterized in that: After obtaining the reported coordinate points of the path, the method further includes: Get the vehicle coordinate point of the vehicle and compare it with the reported coordinate point under the same index: If there is only one target reported coordinate point, the vehicle coordinate point is included in the target reported coordinate point, wherein the target reported coordinate point is a reported coordinate point having the same index value as the vehicle coordinate point and a direction angle difference that satisfies a direction coincidence threshold; If there are multiple target reported coordinate points, the vehicle coordinate point is classified into the target reported coordinate point with the smallest direction angle difference with the vehicle coordinate point; If there is no reported coordinate point with the same index value as the vehicle coordinate point, or there is a reported coordinate point with the same index value as the vehicle coordinate point but the direction angle difference does not meet the direction overlap threshold, then when the scale corresponding to the previous level index of the index does not exceed the preset error range, the above comparison is performed in the previous level index until the scale corresponding to the previous level index exceeds the preset error range.
8. The road geographic information processing method based on H3 according to claim 7 is characterized in that: After obtaining the vehicle coordinate point of the vehicle, the method further includes: Obtain the vehicle coordinate points of another vehicle, and determine whether the two vehicles are simultaneously located at the same index after a preset time according to the vehicle coordinate points and driving directions of the two vehicles; If so, a collision warning of the two vehicles is issued.
9. A computer device, characterized in that: include: Memory; processor; as well as Computer programs; The computer program is stored in the memory and is configured to be executed by the processor to implement the method according to any one of claims 1 to 8.
10. A computer-readable storage medium, characterized in that: A computer program is stored thereon; the computer program is executed by a processor to implement the method according to any one of claims 1 to 8.
