A method for determining whether a vehicle is traveling on a highway and for accurately positioning the vehicle

By combining vehicle trajectories and highway network topology maps, using ray casting and spherical triangulation to calculate distances, and combining Dijkstra's algorithm to verify path connectivity, the accuracy problem of vehicle position and direction in traditional positioning methods is solved, and precise vehicle positioning on highways is achieved.

CN119043323BActive Publication Date: 2026-07-03重庆数字交通产业集团有限公司

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
重庆数字交通产业集团有限公司
Filing Date
2024-08-20
Publication Date
2026-07-03

AI Technical Summary

Technical Problem

Traditional positioning methods struggle to accurately determine whether a vehicle is on a highway and to precisely obtain the vehicle's location and direction of travel.

Method used

By combining the vehicle's trajectory with the highway network topology map, the approximate location of the vehicle is determined using the ray casting method. The highway network topology map is then constructed, and the distance is calculated using spherical trigonometry. Finally, Dijkstra's algorithm is used to verify path connectivity to determine the vehicle's accurate location and direction.

Benefits of technology

It enables more accurate determination of whether a vehicle is traveling on a highway and its precise direction of travel and latitude and longitude, thus improving positioning accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119043323B_ABST
    Figure CN119043323B_ABST
Patent Text Reader

Abstract

This invention belongs to the field of high-speed vehicle positioning technology and discloses a method for determining whether a vehicle is traveling on a highway and for precise vehicle positioning. The method includes: S1. Obtaining the latitude and longitude of the vehicle's current location and, in cooperation with the vehicle manufacturer, obtaining the vehicle's most recent travel trajectory information affected by an accident; S2. Determining whether the vehicle is within a large area of ​​a target city; S3. Constructing a highway network topology map of the target city; S4. Within the target city, determining whether the vehicle is on a highway within the target city; S5. Finding the most probable true path through the few edges closest to the vehicle's latitude and longitude sequence; S6. Using shortest path planning to verify the connectivity of all complete paths and whether they represent the shortest distance, thereby reconstructing the correct path and accurate location of the vehicle. This invention can accurately determine whether a vehicle is traveling on a highway and accurately obtain the vehicle's travel direction and latitude and longitude.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of high-speed vehicle positioning technology, specifically relating to a method for determining whether a vehicle is traveling on a highway and for precise vehicle positioning. Background Technology

[0002] The main challenge in highway vehicle rescue services is how to quickly and accurately determine the location of a vehicle after an emergency (such as a tire blowout or accident) in order to provide timely highway assistance. Due to limitations in the accuracy of vehicle location information, traditional positioning methods struggle to accurately determine whether a vehicle is on a highway and to precisely obtain its exact location and direction of travel.

[0003] To address the aforementioned issues, a method was developed in collaboration with automakers to utilize vehicle event-triggered mechanisms to upload the most recent driving trajectory information of affected vehicles. Analyzing this data allows for a preliminary assessment of whether a vehicle is likely on a highway. To further improve positioning accuracy, a method for determining whether a vehicle is traveling on a highway and for precise vehicle location was invented. By combining the vehicle's driving trajectory with a highway network topology map, it is possible to more accurately determine whether a vehicle is traveling on a highway, while simultaneously obtaining the vehicle's direction of travel and latitude and longitude. Summary of the Invention

[0004] In view of this, the present invention provides a method for determining whether a vehicle is traveling on a highway and for precise vehicle positioning. The present invention aims to solve the problems of traditional positioning methods being unable to accurately determine whether a vehicle is on a highway and being unable to accurately obtain the vehicle's position and direction of travel.

[0005] This invention provides a method for determining whether a vehicle is traveling on a highway and for precise vehicle location, comprising the following steps:

[0006] S1. Obtain the latitude and longitude of the vehicle's current location, and cooperate with the car manufacturer to obtain the vehicle's most recent driving trajectory information affected by the accident, i.e., the latitude and longitude sequence of the most recent driving trajectory;

[0007] S2. Determine whether the vehicle's approximate location is within a large area of ​​the target city;

[0008] Obtain the boundary range data of the target city, which is a polygon composed of multiple latitude and longitude points corresponding to the boundary of the target city. Then, based on the latitude and longitude of the vehicle's current location, use the ray method to determine whether the latitude and longitude of the vehicle's current location are within the polygon range.

[0009] If the vehicle's current latitude and longitude are within the polygon area, proceed to step S3;

[0010] If the latitude and longitude of the vehicle's current location are not within the polygon, then other adjacent cities are selected as the target city, and the vehicle's general location is re-evaluated to see if it is within the target city's general area, until the latitude and longitude of the vehicle's current location are within the target city's polygon.

[0011] S3. Construct a highway network topology map of the target city;

[0012] S4. Within the target city, determine whether the vehicle is on the highway in the target city. Input the latitude and longitude sequence of the vehicle's most recent travel trajectory and find the three nearest edges in the topology graph for each point in the sequence.

[0013] S5. Find the most probable true path by using the nearest edges of the vehicle's latitude and longitude sequence;

[0014] S6. Use shortest path planning to verify the connectivity of all complete paths and whether they are the shortest distances, thereby reconstructing the correct path and accurate location of the vehicle.

[0015] Furthermore, in step S2, the step of determining whether the latitude and longitude of the vehicle's current position are within the polygon range using the ray casting method is as follows:

[0016] Treat the city boundary as a polygon. If the number of foci between a ray emanating from the point to be judged and the polygon is odd, then the point to be judged is inside the polygon; otherwise, the point to be judged is outside the polygon.

[0017] Furthermore, the highway network topology map in step S3 includes points and edges;

[0018] The structural information of a point includes: point number, name, type, latitude and longitude, and service code;

[0019] The structural information of an edge includes: edge number, starting point number, ending point number, distance, and latitude and longitude path.

[0020] Furthermore, step S4 includes the following sub-steps:

[0021] S4.1 loads the topology graph data;

[0022] S4.2 Find the k nearest edges to each target point, the exact points on the corresponding edges, and the smallest unit edge in the corresponding path;

[0023] I. Select target point a, traverse all edges, obtain the latitude and longitude path from target point a to the edge, traverse the latitude and longitude path, and then select two points b and c that are adjacent to target point a before and after it, where point b and c are in different positions.

[0024] II. Use spherical trigonometry to calculate the distance between any two points a, b, and c;

[0025] d1=distance(a,b), d2=distance(a,c), d3=distance(b,c);

[0026] S4.3 defines a maximum threshold and compares it with d1 and d2 to filter data that exceeds the threshold distance;

[0027] If d1>d3 and d1>d2, then the shortest distance is d2;

[0028] If d2>d3 and d2>d1, then the shortest distance is d1;

[0029] When the conditions d1>d3 and d1>d2 and d2>d3 and d2>d1 are not met, the first step is to calculate the semi-perimeter pp = (d1+d2+d3) / 2; the second step is to calculate the area of ​​the triangle S = √(pp*(pp-d1)*(pp-d2)*(pp-d3)) using Heron's formula; finally, calculate the shortest distance between the target point a and points b and c: 2*S / d3.

[0030] Furthermore, in step S4.2, the calculation steps of the spherical trigonometry method are as follows:

[0031] I. Define the Earth's average radius R;

[0032] II. Convert the latitude values ​​lat1 and lat2, and the longitude values ​​lon1 and lon2 of the two points from degrees to radians, and calculate their differences;

[0033] latDistance=(lat2-lat1)*π / 180

[0034] lonDistance=(lon2-lon1)*π / 180

[0035] III. Apply the formulas in spherical trigonometry to calculate variable a;

[0036] The variable 'a' consists of two parts: one part is the square of the sine of half the latitude difference; the other part is twice the product of the sine of half the longitude difference and the cosine of the latitude of the two points.

[0037] a=sin2(latDistance / 2)+cos(lat1)*cos(lat2)*sin2(lonDistance / 2)

[0038] IV. Use atan to calculate variable c, where variable c represents the radian value of the arc distance between two points on the sphere;

[0039] c = 2 * atan(√(a) / √(1-a))

[0040] V. Finally, multiply the Earth's radius R by c to obtain the actual distance between the two points.

[0041] Furthermore, step S5 includes the following sub-steps:

[0042] S5.1 generates all keys for two adjacent points in the latitude and longitude sequence;

[0043] The key format is: starting edge number|starting point precise point lng, starting point precise point lat|ending edge number|ending point precise point lng, ending point precise point lat;

[0044] S5.2 Use a recursive method to concatenate all the keys generated in step S5.1 into a complete path.

[0045] Furthermore, step S6 includes the following sub-steps:

[0046] S6.1 uses Dijkstra's algorithm as the shortest path algorithm based on topological graph data to construct the restorePath method. By taking the start and end point numbers as input, it obtains all the edge and point data traversed, thereby obtaining the distance data.

[0047] S6.2 When there is no path between two points, the corresponding path is considered to be blocked and the corresponding path data is excluded.

[0048] S6.3 Filter out all complete paths and take the shortest path as the final result;

[0049] S6.4 returns the vehicle to the highway based on the shortest path and calculates the vehicle's latitude and longitude on the highway.

[0050] Beneficial effects:

[0051] This invention provides a method for determining whether a vehicle is traveling on a highway and for precise vehicle positioning. By combining the vehicle's travel trajectory with a highway network topology map, it is possible to more accurately determine whether a vehicle is traveling on a highway, as well as its precise travel direction and latitude and longitude.

[0052] Other advantages, objectives, and features of the invention will be set forth in part in the description which follows, and in part will be apparent to those skilled in the art from the following examination, or may be learned from practice of the invention. The objectives and other advantages of the invention can be realized and obtained through the following description. Attached Figure Description

[0053] Figure 1 This is a flowchart of a method for determining whether a vehicle is traveling on a highway and for precise vehicle positioning according to the present invention;

[0054] Figure 2 For example data;

[0055] Figure 3 This is sample data for the edges;

[0056] Figure 4 This is a topology map of Chongqing's expressway network. Detailed Implementation

[0057] To make the technical solutions, advantages, and objectives of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. All other embodiments obtained by those skilled in the art based on the described embodiments of the present invention without creative effort are within the protection scope of this application.

[0058] This embodiment uses a practical application in Chongqing's expressways as an example to illustrate the method of the present invention.

[0059] like Figure 1 As shown, this embodiment provides a method for determining whether a vehicle is traveling on a highway and for precise vehicle location, including the following steps:

[0060] S1. Obtain the latitude and longitude of the vehicle's current location, and cooperate with the car manufacturer to obtain the vehicle's most recent driving trajectory information affected by the accident, i.e., the latitude and longitude sequence of the most recent driving trajectory;

[0061] Information parameters are shown in Table 1:

[0062] Table 1

[0063]

[0064] S2. Determine whether the vehicle's approximate location is within a large area of ​​the target city;

[0065] Obtain the Chongqing boundary range data, which is a polygon composed of multiple latitude and longitude points corresponding to the Chongqing boundary. Then, based on the latitude and longitude of the vehicle's current location, use the ray method to determine whether the vehicle's current location's latitude and longitude are within the polygon range.

[0066] If the vehicle's current latitude and longitude are within the polygon area, proceed to step S3;

[0067] If the latitude and longitude of the vehicle's current location are not within the polygon, then other adjacent cities are selected as the target city, and the vehicle's general location is re-evaluated to see if it is within the target city's general area, until the latitude and longitude of the vehicle's current location are within the target city's polygon.

[0068] In step S2, the city boundary is treated as a polygon. The ray casting method is used to determine if the vehicle's current latitude and longitude are within the polygon's boundaries. If the number of foci between a ray originating from the point being judged and the polygon is odd, then the point is within the polygon; otherwise, the point is outside the polygon (the ray cannot intersect with any vertex of the polygon). The specific steps are as follows:

[0069] I. Initialize variables, including the number of vertices of the polygon, boundary or vertex markers, intersection counts, and precision, etc.

[0070] II. Traverse all edges of the polygon and check whether the point corresponding to the latitude and longitude of the vehicle's current position is located to the left or right of the edge;

[0071] III. If the current point is to the left of the edge, calculate the y-coordinate of the point that intersects the edge. If the y-coordinate of the current point is less than the y-coordinate of the intersection point, it means that the current point is to the left of the ray, and increment the intersection point count by 1.

[0072] IV. If the current point is to the right of an edge, skip that edge and continue checking the next edge;

[0073] V. If the current point happens to be on a vertex of the polygon, return true directly;

[0074] VI. After all edges have been checked, determine whether a point is inside the polygon based on the parity of the intersection count;

[0075] If the intersection count is even, the point is outside the polygon; if the intersection count is odd, the point is inside the polygon.

[0076] VII. If the point is not inside the polygon, it means the vehicle is not in the target city. If the vehicle is in the target city, then further determine whether the vehicle is on the highway in the target city.

[0077] S3. Construct a highway network topology map of the target city, such as... Figure 4 As shown;

[0078] The highway network topology diagram includes points and edges;

[0079] The structural information of points is shown in Table 2; the structural information of edges is shown in Table 3; and the sample data of points and edges are shown in Table 4. Figure 2 and Figure 3 As shown.

[0080] Table 2

[0081]

[0082] Table 3

[0083]

[0084] S4. Within the target city, determine whether the vehicle is on the highway in the target city. Input the latitude and longitude sequence of the vehicle's most recent travel trajectory and find the three nearest edges in the topology graph for each point in the sequence.

[0085] S4.1 loads the topology graph data;

[0086] S4.2 Find the k nearest edges to each target point, the exact points on the corresponding edges, and the minimum unit edge minEdge in the corresponding path;

[0087] I. Select target point a, traverse all edges, obtain the latitude and longitude path from target point a to the edge, traverse the latitude and longitude path, and then select two points b and c that are adjacent to target point a before and after it, where point b and c are in different positions.

[0088] II. Use spherical trigonometry to calculate the distance between any two points a, b, and c;

[0089] d1=distance(a,b), d2=distance(a,c), d3=distance(b,c);

[0090] The calculation steps of spherical trigonometry are as follows:

[0091] I. Define the average radius R of the Earth in meters. The value used in this method is 6,371,000 meters to represent the Earth's radius.

[0092] II. Convert the latitude values ​​lat1 and lat2, and the longitude values ​​lon1 and lon2 of the two points from degrees to radians, and calculate their differences, storing them in latDistance and lonDistance respectively;

[0093] latDistance=(lat2-lat1)*π / 180

[0094] lonDistance=(lon2-lon1)*π / 180

[0095] III. Apply the formulas in spherical trigonometry to calculate variable a;

[0096] The variable 'a' consists of two parts: one part is the square of the sine of half the latitude difference; the other part is twice the product of the sine of half the longitude difference and the cosine of the latitude of the two points.

[0097] a=sin2(latDistance / 2)+cos(lat1)*cos(lat2)*sin2(lonDistance / 2)

[0098] IV. Use atan to calculate variable c, where variable c represents the radian value of the arc distance between two points on the sphere;

[0099] c = 2 * atan(√(a) / √(1-a))

[0100] V. Finally, multiply the Earth's radius R by c to obtain the actual distance between the two points.

[0101] S4.3 defines a maximum threshold and compares it with d1 and d2 to filter data that exceeds the threshold distance. In this embodiment, the maximum threshold is set to 500m.

[0102] If d1>d3 and d1>d2, then the shortest distance is d2;

[0103] If d2>d3 and d2>d1, then the shortest distance is d1;

[0104] When the conditions d1>d3 and d1>d2 and d2>d3 and d2>d1 are not met, the first step is to calculate the semi-perimeter pp = (d1+d2+d3) / 2; the second step is to calculate the area of ​​the triangle S = √(pp*(pp-d1)*(pp-d2)*(pp-d3)) using Heron's formula; finally, calculate the shortest distance between the target point a and points b and c: 2*S / d3.

[0105] S5. Find the most probable true path by using the nearest edges of the vehicle's latitude and longitude sequence;

[0106] We currently have data in the format shown in Table 4, with latitude and longitude sequences a>b>c>d. The precise points corresponding to the three nearest edges are x1, x2, and x3.

[0107] Table 4

[0108]

[0109] S5.1 generates all keys for two adjacent points in the latitude and longitude sequence;

[0110] The key format is: starting edge number|starting point precise point lng, starting point precise point lat|ending edge number|ending point precise point lng, ending point precise point lat; example data is shown in Table 5.

[0111] Table 5

[0112] Sample data a.id|a1.lng,a1.lat|b.id|b1.lng,b1.lat a.id|a1.lng,a1.lat|b.id|b2.lng,b2.lat a.id|a1.lng,a1.lat|b.id|b3.lng,b3.lat a.id|a2.lng,a2.lat|b.id|b1.lng,b1.lat ... b.id|b1.lng,b1.lat|c.id|c1.lng,c1.lat ...

[0113] S5.2 Use a recursive method to concatenate all the keys generated in step S5.1 into a complete path. Example data is shown in Table 6.

[0114] Table 6

[0115] Sample data a.id|a1.lng,a1.lat|b.id|b1.lng,b1.lat|c.id|c1.lng,c1.lat|d.id|d1.lng,d1.lat a.id|a1.lng,a1.lat|b.id|b1.lng,b1.lat|c.id|c1.lng,c1.lat|d.id|d2.lng,d2.lat a.id|a1.lng,a1.lat|b.id|b1.lng,b1.lat|c.id|c1.lng,c1.lat|d.id|d3.lng,d3.lat a.id|a1.lng,a1.lat|b.id|b1.lng,b1.lat|c.id|c2.lng,c2.lat|d.id|d1.lng,d1.lat ...

[0116] S6. Use shortest path planning to verify the connectivity of all complete paths and whether they are the shortest distances, thereby reconstructing the correct path and accurate location of the vehicle;

[0117] S6.1 uses Dijkstra's algorithm as the shortest path algorithm based on topological graph data. It constructs a restore path(String start, String end) method, which takes the start and end point numbers as input, and obtains all the edge and point data traversed, thereby obtaining the distance data.

[0118] S6.2 When there is no path between two points, the corresponding path is considered to be blocked and the corresponding path data is excluded.

[0119] S6.3 Filter out all complete paths and take the shortest path as the final result. Example data is shown in Table 7.

[0120] Table 7

[0121]

[0122] S6.4 Based on the shortest path, return the vehicle to the highway and return the calculated latitude and longitude of the vehicle on the highway;

[0123] In this embodiment, the shortest path is a1>b1>c2>d1, and the shortest distance is 500m. Therefore, the system returns that the vehicle is on the Chongqing Expressway and returns the calculated latitude and longitude of the vehicle on the Expressway.

[0124] It is hereby declared that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the present invention, and all such modifications or substitutions should be covered within the scope of the claims of the present invention.

Claims

1. A method for determining whether a vehicle is traveling on a highway and for precise vehicle location, characterized in that, Includes the following steps: S1. Obtain the latitude and longitude of the vehicle's current location, and cooperate with the car manufacturer to obtain the vehicle's most recent driving trajectory information affected by the accident, i.e., the latitude and longitude sequence of the most recent driving trajectory; S2. Determine whether the vehicle's approximate location is within a large area of ​​the target city; Obtain the boundary range data of the target city, which is a polygon composed of multiple latitude and longitude points corresponding to the boundary of the target city. Then, based on the latitude and longitude of the vehicle's current location, use the ray method to determine whether the latitude and longitude of the vehicle's current location are within the polygon range. If the vehicle's current latitude and longitude are within the polygon area, proceed to step S3; If the latitude and longitude of the vehicle's current location are not within the polygon, then other adjacent cities are selected as the target city, and the vehicle's general location is re-evaluated to see if it is within the target city's general area, until the latitude and longitude of the vehicle's current location are within the target city's polygon. S3. Construct a highway network topology map of the target city; S4. Within the target city, determine whether the vehicle is on the highway in the target city. Input the latitude and longitude sequence of the vehicle's most recent travel trajectory and find the three nearest edges in the topology graph for each point in the sequence. Step S4 includes the following sub-steps: S4.1 loads the topology graph data; S4.2 Find the k nearest edges to each target point, the exact points on the corresponding edges, and the smallest unit edge in the corresponding path; I. Select target point a, traverse all edges, obtain the latitude and longitude path from target point a to the edge, traverse the latitude and longitude path, and then select two points b and c that are adjacent to target point a before and after it, where point b and c are in different positions. II. Use spherical trigonometry to calculate the distance between any two points a, b, and c; d1=distance(a,b), d2=distance(a,c), d3=distance(b,c); S4.3 defines a maximum threshold and compares it with d1 and d2 to filter data that exceeds the threshold distance; If d1 > d3 and d1 > d2, then the shortest distance is d2. If d2 > d3 and d2 > d1, then the shortest distance is d1; When the conditions d1 > d3 and d1 > d2 and d2 > d3 and d2 > d1 are not met, the first step is to calculate the semi-perimeter pp = (d1 + d2 + d3) / 2; the second step is to calculate the area of ​​the triangle S = √(pp * (pp - d1) * (pp - d2) * (pp - d3)) using Heron's formula; finally, calculate the shortest distance between the target point a and points b and c: 2 * S / d3. S5. Find the most probable true path by using the nearest edges of the vehicle's latitude and longitude sequence; S6. Use shortest path planning to verify the connectivity of all complete paths and whether they are the shortest distances, thereby reconstructing the correct path and accurate location of the vehicle.

2. The method for determining whether a vehicle is traveling on a highway and for precise vehicle positioning according to claim 1, characterized in that: In step S2, the step of determining whether the latitude and longitude of the vehicle's current position are within the polygon range using the ray casting method is as follows: Treat the city boundary as a polygon. If the number of foci between a ray emanating from the point to be judged and the polygon is odd, then the point to be judged is inside the polygon; otherwise, the point to be judged is outside the polygon.

3. The method for determining whether a vehicle is traveling on a highway and for precise vehicle positioning according to claim 2, characterized in that: The highway network topology map in step S3 includes points and edges; The structural information of a point includes: point number, name, type, latitude and longitude, and service code; The structural information of an edge includes: edge number, starting point number, ending point number, distance, and latitude and longitude path.

4. The method for determining whether a vehicle is traveling on a highway and for precise vehicle positioning according to claim 3, characterized in that: In step S4.2, the calculation steps of the spherical trigonometry method are as follows: I. Define the Earth's average radius R; II. Convert the latitude values ​​lat1 and lat2, and the longitude values ​​lon1 and lon2 of the two points from degrees to radians, and calculate their differences; latDistance= (lat2 - lat1) * π / 180 lonDistance= (lon2 - lon1) * π / 180 III. Apply the formulas in spherical trigonometry to calculate variable a; The variable 'a' consists of two parts: one part is the square of the sine of half the latitude difference; the other part is twice the product of the sine of half the longitude difference and the cosine of the latitude of the two points. a = sin²(latDistance / 2) + cos(lat1) * cos(lat2) * sin²(lonDistance / 2) IV. Use atan to calculate variable c, where variable c represents the radian value of the arc distance between two points on the sphere; c=2 * atan(√(a) / √(1 - a)) V. Finally, by multiplying the Earth's radius R by c, we obtain the actual distance between the two points.

5. The method for determining whether a vehicle is traveling on a highway and for precise vehicle positioning according to claim 4, characterized in that: Step S5 includes the following sub-steps: S5.1 generates all keys for two adjacent points in the latitude and longitude sequence; The key format is: starting edge number|starting point precise point lng, starting point precise point lat|ending edge number|ending point precise point lng, ending point precise point lat; S5.2 Use a recursive method to concatenate all the keys generated in step S5.1 into a complete path.

6. The method for determining whether a vehicle is traveling on a highway and for precise vehicle positioning according to claim 5, characterized in that: Step S6 includes the following sub-steps: S6.1 uses Dijkstra's algorithm as the shortest path algorithm based on topological graph data to construct the restorePath method. By taking the start and end point numbers as input, it obtains all the edge and point data traversed, thereby obtaining the distance data. S6.2 When there is no path between two points, the corresponding path is considered to be blocked and the corresponding path data is excluded. S6.3 Filter out all complete paths and take the shortest path as the final result; S6.4 returns the vehicle to the highway based on the shortest path and calculates the vehicle's latitude and longitude on the highway.