Track nearest point searching method and code table applied by same
By judging the repetition and directionality of coordinate points in the nearest point search method, the problem of wrong route guidance in the two-way lane scenario is solved, and the accuracy of route guidance and navigation efficiency are improved.
Patent Information
- Application Number
- CN202411997802.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-31
- Publication Date
- 2025-04-18
AI Technical Summary
In the two-way lane scenario, the use of the closest point search method in the prior art may lead to wrong route guidance, causing guidance errors to the user, and there is a problem of misjudgment when driving in the round-trip two-way lane of uneven coordinate points.
Provide a method for finding the nearest point of the track. By traversing all coordinate points in the route track, finding the coordinate point closest to the current coordinate point, and determining whether the point is duplicated or located in the direction of travel. If it does not match, the closest point of the track found in the last search is used.
It improves the accuracy of route guidance, reduces the computing power of the CPU, reduces costs, and solves the problem that the round trip path cannot be judged normally in special narrow sections.
Smart Images

Figure CN119845249A_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of map navigation, and in particular relates to a method for finding the nearest point of a track and a code table for its application. Background Art
[0002] The meter road book navigation is based on the road book file. The current GPS position is used to find the nearest coordinate point with the coordinate points in the road book file. Because the coordinate points in the road book are not evenly distributed, and there may be two-way round-trip routes, and the coordinate points on the round-trip routes of narrow roads are often repeated, such as Figure 4 shown.
[0003] Therefore, in a two-way lane scenario, the nearest point found using the nearest point search method may be wrong, causing the route that has not been traveled on the screen to become a route that has been traveled, causing guidance errors for users. In addition, when driving on a round-trip two-way lane with uneven coordinates, the calculation method using the nearest coordinate point may also have misjudgment problems.
[0004] In view of this, how to design a technology that accurately guides routes and improves user experience is a technical problem to be solved by the present invention. Summary of the invention
[0005] The present invention provides a method for finding the nearest point of a track and a code table using the same, thereby improving the accuracy of route guidance and enhancing user experience.
[0006] In order to achieve the above technical objectives, the present invention adopts the following technical solutions:
[0007] In one aspect, the present invention provides a method for finding the closest point of a trajectory, comprising the following steps:
[0008] Traverse all coordinate points in the route trajectory and find the coordinate point closest to the current coordinate point as the pre-selected nearest point;
[0009] Determine whether the pre-selected nearest point has duplicate coordinate points:
[0010] If there are duplicate coordinate points, determine whether the pre-selected nearest point is located in the travel direction corresponding to the route trajectory:
[0011] If the preselected closest point is located in the direction of travel corresponding to the route trajectory, the preselected closest point is the trajectory closest point; if the preselected closest point is not located in the direction of travel corresponding to the route trajectory, the preselected closest point is determined to be located in the opposite lane, and the last searched trajectory closest point is used as the current trajectory closest point;
[0012] If there are no duplicate coordinate points, determine multiple times whether the pre-selected nearest point is located in the travel direction corresponding to the route trajectory:
[0013] If the pre-selected nearest point is located in the direction of travel corresponding to the route trajectory, or the pre-selected point is not located in the direction of travel corresponding to the route trajectory after a number of times exceeding a set threshold, the pre-selected nearest point is the trajectory nearest point; otherwise, the last searched trajectory nearest point is used as the current trajectory nearest point. The steps of searching for the coordinate point closest to the current coordinate point in the above-mentioned trajectory nearest point search method are as follows:
[0014] Convert the longitude and latitude of all coordinate points into plane coordinates;
[0015] The minimum distance between the current coordinate point and the other coordinate point is calculated based on the plane coordinates of the two coordinate points. The calculation formula is as follows:
[0016]
[0017] Where d represents the minimum distance; x d Indicates the horizontal coordinate of the current coordinate point; x i Indicates the horizontal coordinate of other coordinate points; y d Indicates the ordinate of the current coordinate point; y i Represents the ordinate of other coordinate points.
[0018] The method for finding the nearest point of the trajectory described above, the formula for converting the longitude and latitude of all coordinate points into plane coordinates is as follows:
[0019]
[0020] Where x represents the horizontal coordinate of the coordinate point plane; Rad lon Indicates the longitude in radians of the coordinate point; TILESIZE indicates the size of the map tiles; zoom indicates the zoom level of the map display; Rad lat Represents the latitude of a coordinate point in radians.
[0021] In the above-mentioned method for finding the nearest point on the trajectory, the step of determining whether the pre-selected nearest point is located in the travel direction corresponding to the route trajectory includes:
[0022] Select two coordinate points located before and after the pre-selected closest point on the route trajectory;
[0023] Calculate the route trajectory heading according to the coordinates of the two adjacent coordinate points;
[0024] Calculate the actual driving heading;
[0025] The angle between the route trajectory heading and the actual driving heading is calculated, and if the angle is within a set range, it is determined that the pre-selected closest point is located in the travel direction corresponding to the route trajectory.
[0026] The method for finding the nearest point of the trajectory as described above, the formula for calculating the route trajectory heading according to the coordinates of the two adjacent coordinate points is as follows:
[0027]
[0028] Among them, Heading represents the heading of the route track; Slope represents the slope of two adjacent coordinate points. Based on the above-mentioned method for finding the nearest point of the track, the formula for calculating the actual driving heading is as follows:
[0029] UsedHeading=Alpha*GpsHeading+(1-Alpha)*MagneticHeading
[0030] Among them, UsedHeading represents the actual driving heading; Alpha represents the weighting coefficient; GpsHeading represents the heading value collected by the GPS positioning device; MagneticHeading represents the heading value collected by the geomagnetic sensor.
[0031] As mentioned above, if there are no duplicate coordinate points in the nearest point search method, after calculating the route trajectory heading, it is necessary to determine whether the current route trajectory is entered for the first time:
[0032] If it is not the first entry, the pre-selected closest point is the closest point of the trajectory;
[0033] If it is the first time to enter, then determine whether the road segment index in the pre-selected nearest point has changed:
[0034] If the road segment index in the preselected nearest point has not changed, the preselected nearest point is the trajectory nearest point; if the road segment index in the preselected nearest point has changed, it is determined multiple times whether the preselected nearest point is located in the travel direction corresponding to the route trajectory.
[0035] In another aspect, the present invention provides a code table, including a code table body, wherein the code table body has a built-in navigation system, and the navigation system applies the method for finding the nearest point of a trajectory as described in any one of the above items.
[0036] In another aspect, the present invention further provides an electronic device, comprising: a processor, and a memory and a transceiver communicatively connected to the processor;
[0037] The memory stores computer-executable instructions; the transceiver is used to send and receive data;
[0038] The processor executes the computer-executable instructions stored in the memory to implement any of the above methods.
[0039] In another aspect, the present invention also provides a computer-readable storage medium,
[0040] The computer-readable storage medium stores computer-executable instructions, which are used to implement the method described above when executed by a processor.
[0041] Compared with the prior art, the advantages and positive effects of the present invention are: marking repeated coordinate points in the route, and there is no need to calculate repeated routes and repeated coordinate points in real time during the subsequent loading of the route for navigation, which reduces the computing power of the CPU and reduces costs; searching for the nearest point of the trajectory according to different situations of whether it is a repeated coordinate point, solving the problem that the round-trip path cannot be judged normally in special narrow sections, improving the accuracy of route guidance, and improving navigation efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0043] Figure 1 A flowchart of an embodiment of a method for finding the closest point of a trajectory according to the present invention;
[0044] Figure 2 It is a schematic diagram of the complete overlap of the coordinate points of the two-way lane route;
[0045] Figure 3 It is a schematic diagram of the partial overlap of the coordinate points of the two-way lane route;
[0046] Figure 4 This is a schematic diagram of the actual operation of a two-way lane. DETAILED DESCRIPTION
[0047] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0048] It should be noted that in the description of the present invention, the terms "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer" and the like indicating directions or positional relationships are based on the directions or positional relationships shown in the drawings, which are only for the convenience of description, and do not indicate or imply that the device or element must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as limiting the present invention. In addition, the terms "first" and "second" are used for descriptive purposes only, and cannot be understood as indicating or implying relative importance.
[0049] In the present invention, unless otherwise clearly specified and limited, the terms "installed", "connected", "connected" and the like should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be an indirect connection through an intermediate medium, or it can be the internal communication of two components. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0050] In the present invention, unless otherwise clearly specified and limited, a first feature being "above" or "below" a second feature may include that the first and second features are in direct contact, or may include that the first and second features are not in direct contact but are in contact through another feature between them. Moreover, a first feature being "above", "above" and "above" a second feature includes that the first feature is directly above and obliquely above the second feature, or simply indicates that the first feature is higher in level than the second feature. A first feature being "below", "below" and "below" a second feature includes that the first feature is directly below and obliquely below the second feature, or simply indicates that the first feature is lower in level than the second feature.
[0051] The disclosure below provides many different embodiments or examples to realize different structures of the present invention. In order to simplify the disclosure of the present invention, the parts and settings of specific examples are described below. Of course, they are only examples, and the purpose is not to limit the present invention. In addition, the present invention can repeat reference numbers and / or reference letters in different examples, and this repetition is for the purpose of simplicity and clarity, which itself does not indicate the relationship between the various embodiments and / or settings discussed. In addition, the present invention provides various specific examples of processes and materials, but those of ordinary skill in the art can be aware of the application of other processes and / or the use of other materials.
[0052] like Figures 1 to 3 As shown, the present application provides a method for finding the nearest point of a track, which can correctly identify the track coordinate point closest to the current coordinate point in the case of a bidirectional coincident coordinate point route, thereby determining which road section the current coordinate point belongs to. A method for finding the nearest point of a track includes the following steps:
[0053] First, traverse all the coordinate points in the route track of the road book file and find the coordinate point closest to the current coordinate point as the pre-selected nearest point. Specifically:
[0054] First, convert the longitude and latitude of all coordinate points in the route trajectory into plane coordinates (x, y). The formulas for the horizontal and vertical coordinates are as follows:
[0055]
[0056] Where x represents the horizontal coordinate of the coordinate point plane; Rad lon Indicates the longitude in radians of the coordinate point; TILESIZE indicates the map tile size, which refers to the pixel width of the map block inside the code table; zoom indicates the zoom level of the code table map display, for details, please refer to Table 1 below; Rad lat Represents the latitude of a coordinate point in radians.
[0057] Table 1
[0058]
[0059]
[0060] The formula for calculating longitude in radians is as follows:
[0061]
[0062] Among them, Rad lon Indicates the longitude of the coordinate point in radians; deg lon Indicates the coordinate longitude of the coordinate point. The calculation formula for radian latitude is as follows:
[0063]
[0064] Among them, Rad lat Indicates the latitude of the coordinate point in radians; deg lat Indicates the coordinate latitude of the coordinate point.
[0065] Then, the minimum distance between the current coordinate point and other coordinate points is calculated based on the plane coordinates of the two points. The calculation formula is as follows:
[0066]
[0067] Where d represents the minimum distance; x d Indicates the horizontal coordinate of the current coordinate point; x i Indicates the horizontal coordinate of other coordinate points; y d Indicates the ordinate of the current coordinate point; y i Represents the ordinate of other coordinate points.
[0068] Then, it is determined whether there are duplicate coordinate points in the pre-selected nearest point. Duplicate coordinate points refer to the same coordinate points included in the planned paths. For example, a lane and its opposite lane both contain the same coordinate point, that is, there are duplicate coordinate points, but the two duplicate coordinate points located on the two lanes are in opposite directions.
[0069] The steps for determining whether there are duplicate coordinate points of the pre-selected nearest points are as follows: first, select coordinate points with the same distance from the current coordinate point among the pre-selected nearest points, and then calculate the longitude and latitude coordinates of the coordinate points with the same distance. The coordinate points with the same longitude and latitude coordinates are duplicate coordinate points. For example, Figure 2 Road2_P5 and Road3_P13, Road2_P6 and Road3_P12, Road2_P7 and Road3_P11, Road2_P8 and Road3_P10.
[0070] If there are duplicate coordinate points, it is necessary to determine whether the pre-selected nearest point is in the direction of travel corresponding to the route trajectory. The steps are as follows:
[0071] Select two adjacent coordinate points located before and after the pre-selected nearest point on the route track, that is, select the two points closest to the pre-selected nearest point, and the longitude and latitude coordinates of the two points are inconsistent with the longitude and latitude coordinates of the pre-selected nearest point. For example: if the current nearest point is Road2_7, the two adjacent coordinate points before and after are Road2_6 and Road2_8 respectively.
[0072] The route trajectory heading is calculated based on the coordinates of two adjacent coordinate points. The formula is as follows:
[0073]
[0074] Among them, Heading represents the heading of the route trajectory; Slope represents the slope of two adjacent coordinate points.
[0075]
[0076] Among them, Slope represents the slope of two adjacent coordinate points; Sum_a represents the cumulative sum of all x-axis coordinate values of the current coordinate point and the two adjacent coordinate points minus the average value multiplied by the y-coordinate value minus the average value; Sum_b represents the cumulative sum of all x-axis coordinate values of the current coordinate point and the two adjacent coordinate points minus the average value of the square. The calculation formulas of Sum_a and Sum_b are as follows:
[0077]
[0078] Wherein, n represents the total number of coordinate points, which in this embodiment includes the current coordinate point and two adjacent coordinate points, so n=3; k represents the initial value; X n Indicates the x-axis coordinate value of the nth coordinate point; X_average indicates the average value of all x-axis coordinate values of the current coordinate point and the two adjacent coordinate points; Y n Represents the y-axis coordinate value of the nth coordinate point; Y_average represents the average value of all y-axis coordinate values of the current coordinate point and the two adjacent coordinate points.
[0079] Calculate the actual driving heading. To calculate the actual driving heading, it is necessary to first collect heading values through the GPS positioning device and the geomagnetic sensor respectively. The heading is calculated after a weighted algorithm is performed using the two devices. Compared with other single methods of calculating the heading, it can bring more accurate and stable results: (1) It can improve accuracy; (2) It can enhance robustness: when using multiple types of sensors, even if a sensor fails or is affected by external factors (such as electromagnetic interference), the overall performance of the system will not be greatly affected; (3) It can adapt to dynamic environmental changes.
[0080] The formula for calculating the actual driving heading is as follows:
[0081] UsedHeading=Alpha*GpsHeading+(1-Alpha)*MagneticHeading
[0082] Among them, UsedHeading represents the actual driving heading; Alpha represents the weighting coefficient, which ranges from 0 to 1 and can be dynamically adjusted according to the actual situation; GpsHeading represents the heading value collected by the GPS positioning device; MagneticHeading represents the heading value collected by the geomagnetic sensor.
[0083] Calculate the angle between the route trajectory heading and the actual driving heading. If the angle is within the set range, it is determined that the pre-selected closest point is located in the direction of travel corresponding to the route trajectory. In this application, the set range is 60°, specifically:
[0084] The absolute value of the angle between the route trajectory heading and the actual driving heading is calculated. If the absolute value is less than 60°, it is determined that the pre-selected nearest point is located in the direction of travel corresponding to the route trajectory. If the absolute value is greater than or equal to 60°, it is determined that the pre-selected nearest point is not located in the direction of travel corresponding to the route trajectory.
[0085] If the pre-selected nearest point is located in the direction of travel corresponding to the route trajectory, the pre-selected nearest point is used as the trajectory nearest point, and the current road section index is obtained for navigation; if the pre-selected nearest point is not located in the direction of travel corresponding to the route trajectory, the pre-selected nearest point is determined to be located in the opposite lane, and the last searched trajectory nearest point is used as the current trajectory nearest point.
[0086] If there are no duplicate coordinate points, it is necessary to determine multiple times whether the pre-selected nearest point is located in the direction of travel corresponding to the route trajectory. The calculation process is the same as the calculation process with duplicate coordinate points, which will not be repeated here. However, the setting range of the angle between the route trajectory heading and the actual driving heading is greater than 135°. If the absolute value is less than 135°, it is determined that the pre-selected nearest point is located in the direction of travel corresponding to the route trajectory. If the absolute value is greater than or equal to 135°, it is determined that the pre-selected nearest point is not located in the direction of travel corresponding to the route trajectory. 60° and 135° are the optimal parameters debugged according to actual application effects after a lot of repeated debugging, and are more anti-interference than other values.
[0087] Therefore, if there are repeated coordinate points, if the pre-selected nearest point is located in the travel direction corresponding to the route trajectory, or the pre-selected point is not located on the route trajectory after the number of consecutive calculations exceeds the set threshold, then the pre-selected nearest point is the nearest point of the trajectory; otherwise, the nearest point of the trajectory found last time is used as the nearest point of the trajectory this time.
[0088] Multiple determinations of whether the preselected nearest point is located in the direction of travel corresponding to the route trajectory can prevent misjudgment operations during the calculation process. For example, when it is determined for 10 consecutive times that the preselected nearest point is not located in the direction of travel corresponding to the route trajectory, it indicates that the user wants to walk along this route, that is, the preselected nearest point is selected as the nearest point of the trajectory.
[0089] After calculating the route track heading, it is necessary to determine whether the current route track is entered for the first time:
[0090] If it is not the first entry, the closest point is pre-selected as the closest point of the trajectory;
[0091] If it is the first time to enter, then determine whether the road segment index in the pre-selected nearest point has changed:
[0092] If the road segment index in the pre-selected nearest point has not changed, the pre-selected nearest point is the nearest point of the trajectory; if the road segment index in the pre-selected nearest point has changed, it is determined multiple times whether the pre-selected nearest point is located in the travel direction corresponding to the route trajectory.
[0093] The first entry refers to the first import and calculation of the current route trajectory. Each time the route trajectory is updated, it will be judged as the first time. Because it is impossible to know where the entry is from the trajectory route when entering for the first time, there is no valid position information, that is, no initial value, and assignment is required. Compared with loading all the trajectory route information and then obtaining the corresponding position, assignment can save calculation time and improve navigation efficiency.
[0094] If the route is not entered for the first time or the road section index has not changed, the pre-selected nearest point can be directly selected as the nearest point of the trajectory. There is no need to calculate multiple times whether the pre-selected nearest point is located in the direction of travel of the route trajectory, which reduces the computing power required for calculation, shortens the calculation time, and further improves the accuracy and efficiency of navigation.
[0095] If it is not the first entry, the closest point of the trajectory found last time is used as the closest point of the trajectory this time.
[0096] like Figure 2 As shown, when running from Road2_P7 to Road2_P8, the pre-selected closest points are calculated to be Road3_P10 and Road2_P8. According to the normal driving route, the correct closest point of the trajectory should only be Road2_P8 at this time. However, due to the duplication of coordinate points Road2_P8 and Road3_P10, a misjudgment occurred, resulting in the closest coordinate point also being judged to be on the opposite lane. After introducing the trajectory closest point search method of this application, the repeated points of the route can be determined, and the current determined repeated point Road3_P10 and the next coordinate point Road3_P11 are used to calculate the route heading, and compared with the current actual driving heading UsedHeading. Figure 2 The headings calculated by Road3_P10 and Road3_P11 are exactly opposite to the direction of travel, so Road2_7 is still used as the closest point of the trajectory.
[0097] like Figure 3 As shown in the figure, when running from Road3_P9 to Road3_P10, the pre-selected nearest point is calculated to be Road3_P10. If it is determined that there is no duplicate point, the current pre-selected nearest point Road3_P10 and the next coordinate point Road3_P11 are used to calculate the heading of the route, and compared with the current actual driving heading UsedHeading. If the angle is within the threshold range, the coordinate point Road3_P10 in the same direction is determined to be the nearest point of the trajectory.
[0098] The present application also provides a code table, including a code table body, the code table body has a built-in navigation system, and the navigation system applies the trajectory nearest point search method as described above.
[0099] The present application also provides an electronic device, comprising: a processor, and a memory and a transceiver communicatively connected to the processor;
[0100] The memory stores computer executable instructions; the transceiver is used to send and receive data;
[0101] The processor executes the computer-executable instructions stored in the memory to implement the method described above.
[0102] The present application also provides a computer-readable storage medium,
[0103] The computer-readable storage medium stores computer-executable instructions, which are used to implement the above-mentioned method when executed by a processor.
[0104] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "illustrative embodiments", "examples", "specific examples", or "some examples" means that the specific features, structures, materials, or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the utility model. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials, or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.
[0105] The above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, it is still possible for a person skilled in the art to modify the technical solutions described in the aforementioned embodiments, or to replace some of the technical features therein by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions claimed to be protected by the present invention.
[0106] Wherever possible, the various aspects and features described and shown in the specification may be applied separately and these separate aspects may be made the subject of divisional applications.
Claims
1. A method for finding the nearest point of a trajectory, characterized in that: The following steps are involved: Traverse all coordinate points in the route trajectory and find the coordinate point closest to the current coordinate point as the pre-selected nearest point; Determine whether the pre-selected nearest point has duplicate coordinate points: If there are duplicate coordinate points, determine whether the pre-selected nearest point is located in the travel direction corresponding to the route trajectory: If the preselected closest point is located in the direction of travel corresponding to the route trajectory, the preselected closest point is the trajectory closest point; if the preselected closest point is not located in the direction of travel corresponding to the route trajectory, the preselected closest point is determined to be located in the opposite lane, and the last searched trajectory closest point is used as the current trajectory closest point; If there are no duplicate coordinate points, determine multiple times whether the pre-selected nearest point is located in the travel direction corresponding to the route trajectory: If the preselected nearest point is located in the direction of travel corresponding to the route trajectory, or if the number of consecutive times exceeding the set threshold shows that the preselected point is not located in the direction of travel corresponding to the route trajectory, then the preselected nearest point is the trajectory nearest point; otherwise, the trajectory nearest point found last time is used as the trajectory nearest point this time.
2. The method for finding the closest point of a trajectory according to claim 1, characterized in that: The steps to find the coordinate point closest to the current coordinate point are as follows: Convert the longitude and latitude of all coordinate points into plane coordinates; The minimum distance between the current coordinate point and the other coordinate point is calculated based on the plane coordinates of the two coordinate points. The calculation formula is as follows: Where d represents the minimum distance; x d Indicates the horizontal coordinate of the current coordinate point; x i Indicates the horizontal coordinate of other coordinate points; y d Indicates the ordinate of the current coordinate point; y i Represents the ordinate of other coordinate points.
3. The method for finding the closest point of a trajectory according to claim 2, characterized in that: The formula for converting the latitude and longitude of all coordinate points into plane coordinates is as follows: Where x represents the horizontal coordinate of the coordinate point plane; Rad lon Indicates the radian longitude of the coordinate point; TILESIZE indicates the map tile size; zoom indicates the zoom level of the map display; Rad lat Represents the latitude of a coordinate point in radians.
4. The method for finding the closest point of a trajectory according to claim 1, characterized in that: The step of determining whether the pre-selected nearest point is located in the travel direction corresponding to the route trajectory comprises: Select two coordinate points located before and after the pre-selected closest point on the route trajectory; Calculate the route trajectory heading according to the coordinates of the two adjacent coordinate points; Calculate the actual driving heading; The angle between the route trajectory heading and the actual driving heading is calculated, and if the angle is within a set range, it is determined that the pre-selected closest point is located in the travel direction corresponding to the route trajectory.
5. The method for finding the closest point of a trajectory according to claim 4, characterized in that: The formula for calculating the route trajectory heading according to the coordinates of the two adjacent coordinate points is as follows: Among them, Heading represents the heading of the route trajectory; Slope represents the slope of two adjacent coordinate points.
6. The method for finding the closest point of a trajectory according to claim 4, characterized in that: The formula for calculating the actual driving heading is as follows: UsedHeading=Alpha*GpsHeading+(1-Alpha)*MagneticHeading Among them, UsedHeading represents the actual driving heading; Alpha represents the weighting coefficient; GpsHeading represents the heading value collected by the GPS positioning device; MagneticHeading represents the heading value collected by the geomagnetic sensor.
7. The method for finding the closest point of a trajectory according to claim 4, characterized in that: If there are no duplicate coordinate points, after calculating the route track heading, it is necessary to determine whether the current route track is entered for the first time: If it is not the first entry, the pre-selected closest point is the closest point of the trajectory; If it is the first time to enter, then determine whether the road segment index in the pre-selected nearest point has changed: If the road segment index in the pre-selected closest point has not changed, the pre-selected closest point is the closest point of the trajectory; If the road segment index in the pre-selected nearest point changes, it is determined multiple times whether the pre-selected nearest point is located in the travel direction corresponding to the route trajectory.
8. A code table, characterized in that: The invention comprises a code table body, wherein the code table body has a built-in navigation system, and the navigation system applies the method for finding the nearest point of a track as described in any one of claims 1 to 7.
9. An electronic device, characterized in that: include: A processor, and a memory and a transceiver communicatively connected to the processor; The memory stores computer-executable instructions; the transceiver is used to send and receive data; The processor executes the computer-executable instructions stored in the memory to implement the method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, which are used to implement the method according to any one of claims 1 to 7 when executed by a processor.