METHOD AND DEVICE FOR VEHICLE POSITIONING
Patent Information
- Application Number
- DE602018080566
- Authority / Receiving Office
- DE · DE
- Patent Type
- Patents
- Current Assignee / Owner
- Priority Date
- 2017-10-20
- Filing Date
- 2018-08-10
- Publication Date
- 2025-03-26
- Estimated Expiration
- 2038-08-10
AI Technical Summary
Current vehicle positioning methods, such as GPS and BDS, face challenges in accurately determining a vehicle's location in areas with complex road conditions, often resulting in low positioning accuracy and difficulty in distinguishing between adjacent areas.
A vehicle positioning method that utilizes historical driving trajectory information and current coordinate data to select candidate areas and calculate the included angle between vectors, determining the vehicle's location by comparing the direction of entry and driving trajectory, thereby enhancing positioning accuracy.
This method achieves high positioning accuracy by using historical and current data to identify the specific location of a vehicle, even in areas with adjacent POIs, and simplifies the calculation process, ensuring efficient and precise location determination.
Description
Field of the Invention
[0001] The present invention relates to the technical field of vehicle positioning, in particular to a vehicle positioning method and device.Background of the Invention
[0002] With the rise of Internet vehicles, a variety of novel vehicle services have emerged. After a user requests for vehicle positioning service, the vehicle of the user needs to be locate and found accurately and quickly. In traditional GPS (Global Positioning System), BDS (BeiDou Navigation Satellite System) and other positioning manners, the current position coordinates of the vehicle are usually used to locate the vehicle.
[0003] However, for areas with complicated road conditions, there will still be a certain vehicle location error only through the current position coordinate information, and the positioning accuracy is low. For example: if the current GPS location of the vehicle is on the adjacent boundary of two adjacent areas, it is impossible to confirm the vehicle is in which area.
[0004] US 2010 / 0141432 A1 discloses correcting and / or improving an estimated location of a tracked object. A zone location of the tracked object may be refined by (a) accepting first location information derived from a first location technology, (b) generating a set of at least two candidate location zones using the first location, topology information and an accuracy range for the first location technology, (c) for each of the at least two candidate location zones, (1) establishing a path from a previous location zone to the given candidate location zone, and (2) storing, by the computer system and in association with the candidate zone, any location zones on the path, and (d) applying at least one of (A) path-based candidate location zone elimination to each of the at least two candidate location zones, and (B) object-physics-based candidate location zone elimination to each of the at least two candidate location zones, to generate a refined set of at least one candidate location zone.Summary of the Invention
[0005] The technical problem to be solved by the present invention is to provide a vehicle positioning method and device, in order to obtain accurate vehicle location information through the historical driving trajectory information and the current coordinate information of a vehicle. The present invention is simple and easy to implement and has high positioning accuracy.
[0006] In order to solve the above technical problem, the present invention provides a vehicle positioning method, including the following steps: obtaining current location coordinates of a vehicle, and selecting candidate areas within a preset distance according to the current location coordinates of the vehicle; obtaining historical location coordinates of the vehicle within a preset time, and selecting a first candidate area from the candidate areas according to the historical location coordinates of the vehicle; and judging whether the vehicle enters the first candidate area to determine the current location of the vehicle, wherein judging whether the vehicle enters the first candidate area includes the following steps: obtaining a vector in a direction entering the first candidate area at the entrance of the first candidate area to serve as a first vector; obtaining a driving vector of the vehicle at the entrance of the first candidate area to serve as a second vector, comprising obtaining a coordinate point at which the vehicle passes through the entrance of the first candidate area within the preset time to serve as the starting point of the second vector; and starting from the starting point of the second vector, selecting the next driving trajectory point in the historical trajectory of the vehicle to serve as the end point of the second vector, so as to obtain the second vector; and calculating an included angle between the first vector and the second vector, and judging whether the vehicle enters the first candidate area according to the included angle.
[0007] Further, the selecting a first candidate area from the candidate areas according to the historical location coordinates of the vehicle includes the following steps: obtaining the location coordinates of the entrances of the candidate areas; comparing the historical location coordinates of the vehicle with the location coordinates of the entrances of the candidate areas in a reverse chronological manner; and selecting the candidate area corresponding to the entrance of the candidate area that the vehicle passes through most recently as the first candidate area according to the comparison result.
[0008] Further, if there are more than two entrances of the candidate areas that the vehicle pass through most recently, the following step is performed to select the first candidate area: calculating the distances between three coordinate points, that is, when the vehicle passes the entrance of the candidate area, a previous time point and a subsequent time point, and the entrance of each candidate area that the vehicle passes through most recently, comparing the distances, and selecting the candidate area with the minimum distance as the first candidate area.
[0009] Further, the obtaining a vector in a direction entering the first candidate area at the entrance of the first candidate area to serve as a first vector includes the following steps: selecting a point at the entrance of the first candidate area to serve as a starting point of the first vector; and selecting a point on a ray in the direction entering the first candidate area to serve as an end point of the first vector, so as to obtain the first vector.
[0010] Further, the calculating an included angle between the first vector and the second vector, and judging whether the vehicle enters the first candidate area according to the included angle includes the following steps: setting the first vector as (x1, y1), setting the second vector as (x2, y2), setting the included angle between the first vector and the second vector as θ, and calculating θ by the following formula: cos θ = x 1 x 2 + y 1 y 2 x 1 2 + y 1 2 + x 2 2 + y 2 2 if 0° ≤ θ < 90°, judging that the vehicle enters the first candidate area, and that the current location of the vehicle is the first candidate area; and if 90° ≤ θ ≤ 180°, judging that the vehicle does not enter the first candidate area, and that the current location of the vehicle is not in the candidate area within the selected preset distance.
[0011] According to another aspect of the present invention, a vehicle positioning device is provided, including: a first area selection module, configured to obtain current location coordinates of a vehicle, and select candidate areas within a preset distance according to the current location coordinates of the vehicle; a second area selection module, configured to obtain historical location coordinates of the vehicle within a preset time, and select a first candidate area from the candidate areas according to the historical location coordinates of the vehicle; and a judging module, configured to judge whether the vehicle enters the first candidate area to determine the current location of the vehicle, wherein the judging module includes: a first vector obtaining unit, configured to obtain a vector in a direction entering the first candidate area at the entrance of the first candidate area to serve as a first vector; a second vector obtaining unit, configured to obtain a driving vector of the vehicle at the entrance of the first candidate area to serve as a second vector, wherein the second vector obtaining unit is further configured to: obtain a coordinate point at which the vehicle passes through the entrance of the first candidate area within the preset time to serve as the starting point of the second vector; and starting from the starting point of the second vector, select the next driving trajectory point in the historical trajectory of the vehicle to serve as the end point of the second vector, so as to obtain the second vector; and a judging unit, configured to calculate an included angle between the first vector and the second vector, and judge whether the vehicle enters the first candidate area according to the included angle.
[0012] Further, the second area selection module includes: a first coordinate obtaining unit, configured to obtain the location coordinates of the entrances of the candidate areas; a coordinate comparison unit, configured to compare the historical location coordinates of the vehicle with the location coordinates of the entrances of the candidate areas in a reverse chronological manner; and a first candidate area selection unit, configured to select the candidate area corresponding to the entrance of the candidate area that the vehicle passes through most recently as the first candidate area according to the comparison result.
[0013] Further, if there are more than two entrances of the candidate areas that the vehicle pass through most recently, the first candidate area selection unit is further configured to: calculate the distances between three coordinate points, that is, when the vehicle passes through the entrance of the candidate area, a previous time point and a subsequent time point, and the entrance of each candidate area that the vehicle passes through most recently, compare the distances, and select the candidate area with the minimum distance as the first candidate area.
[0014] Further, the first vector obtaining unit is further configured to: select a point at the entrance of the first candidate area to serve as a starting point of the first vector; and select a point on a ray in the direction entering the first candidate area to serve as an end point of the first vector, so as to obtain the first vector.
[0015] Further, the judging unit includes: a calculation sub-unit, configured to calculate the included angle θ between the first vector and the second vector, set the first vector as (x1, y1), set the second vector as (x2, y2), set the included angle between the first vector and the second vector as θ, and specifically calculate θ by the following formula: cos θ = x 1 x 2 + y 1 y 2 x 1 2 + y 1 2 + x 2 2 + y 2 2 a judging sub-unit, configured to judge whether the vehicle enters the first candidate area according to the included angle, specifically: if 0° ≤ θ < 90°, judge that the vehicle enters the first candidate area, and that the current location of the vehicle is the first candidate area; and if 90° ≤ θ ≤ 180°, judge that the vehicle does not enter the first candidate area, and that the current location of the vehicle is not in the candidate area within the selected preset distance.
[0016] According to yet another aspect of the present invention, a controller is provided, including a memory and a processor, wherein the memory stores a computer program, and the program is configured to implement the steps of the method when executed by the processor.
[0017] Compared with the prior art, the present invention has obvious advantages and beneficial effects. By means of the above technical solutions, the vehicle positioning method and device of the present invention can achieve considerable technological advancement and practicality, have wide industrial utilization values, and at least have the following advantages: (1) the present invention obtains accurate vehicle location information through the historical driving trajectory information and the current coordinate information of the vehicle to identify the specific location where the vehicle is located more accurately; (2) in the case of adjacent POIs (Point of Information, Point of Information), the present invention can more accurately judge the POI information to which the vehicle belongs compared with the manner in the prior art that the POI information of the vehicle is judged by directly using the current location coordinate data, without being disturbed by multiple adjacent POIs and other information, the problem that the POI boundary is difficult to judge is solved, and the positioning accuracy is high; and (3) the present invention judges the location of the vehicle by calculating the included angle between the vectors in the driving direction of the vehicle and the direction entering the first candidate area, the calculation amount is relatively small, and the result can be quickly calculated and inferred, the calculation mode is simple, convenient and feasible, and the efficiency is high.
[0018] The above description is only an overview of the technical solutions of the present invention. In order understand the technical means of the present invention more clearly, the present invention can be implemented in accordance with the contents of the specification, and in order to make the above and other objects, features and advantages of the present invention more obvious and understandable, preferred embodiments are listed below and are described in detail below in combination with drawings.Brief Description of the Drawings
[0019] Fig. 1 is a flow diagram of a vehicle positioning method provided by an embodiment of the present invention; Fig. 2 is a schematic diagram of a vehicle coordinate location for vehicle positioning provided by an embodiment of the present invention; Fig. 3 is a schematic diagram of an included angle between a vehicle driving trajectory vector and a vector of entering a candidate area provided by an embodiment of the present invention; Fig. 4 is a schematic diagram of a vehicle positioning device provided by an embodiment of the present invention. Detailed Description of the Embodiments
[0020] In order to further illustrate the technical means and effects adopted in the present invention to achieve the intended purpose of the invention, specific embodiments and effects of a vehicle positioning method and system proposed in accordance with the present invention are described in detail below, in conjunction with the drawings and preferred embodiments.
[0021] As shown in Fig. 1, the present invention provides a vehicle positioning method. The following embodiments are described based on a GPS system. The method includes the following steps: S1. Obtaining current location coordinates of a vehicle, and selecting candidate areas within a preset distance according to the current location coordinates of the vehicle; and the preset distance can be set according to the traffic conditions, the geographic environment and other information of the area where the vehicle is located. S2. Obtaining historical GPS coordinates of the vehicle within a preset time, and selecting a first candidate area from the candidate areas according to the historical GPS coordinates of the vehicle; and the preset time can be set according to specific traffic conditions, the geographic environment, the average driving speed of the vehicle in the candidate areas and other information. S3. Judging whether the vehicle enters the first candidate area to determine the current location of the vehicle. If the vehicle enters the first candidate area, the vehicle is currently in the first candidate area, if the vehicle does not enter the first candidate area, the vehicle is not in the first candidate area, the location of the vehicle is obtained again, the preset distance value and the preset time value are adjusted, and the steps S1-S3 are repeated to perform location judgment, until the current location of the vehicle is determined.
[0022] It should be noted that, the GPS coordinates described in the embodiment of the present invention are not limited thereto and depend on the positioning system used. For example, if BDS is used for positioning, the location coordinates should be BDS coordinates.
[0023] The problem of unclear location of the vehicle is descried in the following embodiments in specific scenarios: As shown in Fig. 2, in the case of two adjacent cells, the two cells are respectively set as a first cell and a second cell, the current coordinate location submitted by the vehicle appears on an adjacent side of the two cells after being drawn on the map, and at this time, the POI information of the vehicle is difficult to judge. In this case, the location of the vehicle has the following two possibilities: 1. Located in the first cell; and 2. Located in the second cell.
[0024] For this kind of scenario, the historical trajectory of the vehicle is obtained via the characteristic that the vehicle periodically uploads the currently located GPS location during the driving process, so as to judge the accurate location of the vehicle.
[0025] In this scenario, in the step S1, the first cell and the second cell are the candidate areas within the preset distance.
[0026] Then, step S2 is executed: selecting the preset time, wherein the preset time can be selected as 1 hour in this scenario, obtaining the historical GPS coordinates of the vehicle within 1 hour, and selecting the first candidate area from the first cell and the second cell according to the historical GPS coordinates of the vehicle, which specifically includes the following steps: S201. Obtaining the GPS coordinates of all entrances of the first cell and the second cell; S202. Comparing the historical GPS coordinates of the vehicle with the GPS coordinates of all entrances of the first cell and the second cell in a reverse chronological manner; and S203. Selecting the cell corresponding to the entrance of the candidate area that the vehicle passes through most recently as the first candidate area according to the comparison result.
[0027] Specifically, assuming that in the step S201, the first cell has two entrances, and the corresponding GPS coordinates are: (1, 1) and (1,2); the second cell has one entrance, and the corresponding GPS coordinates are (2, 1). It should be noted that the scenario is only used as a specific embodiment to illustrate the present invention, the number of the candidate areas is not limited to two, but can also be multiple, and similarly, the number of the entrances of the candidate areas is not unique, which is analyzed according to the specific scenario.
[0028] By searching for the historical driving trajectory of the vehicle, it can be seen that the vehicle passes through (2, 1) half an hour ago, passes through (1, 1) one hour ago, and does not pass through the coordinates of the entrances of other cells thereafter. Then, it can be seen that the entrance point of the cell that the vehicle passes through most recently is (2, 1), and then, the second cell is selected as the first candidate area.
[0029] There may also be a special situation in this scenario: if the distance between the entrances of the first cell and the second cell is very small, and the coordinate point of the entrance of the cell that the vehicle passes through most recently is just located between the entrance of the first cell and the entrance of the second cell, then the following judgement needs to be further performed: calculating the distances between three coordinate points, that is, when the vehicle passes the space between the entrance of the first cell and the entrance of the second cell, a previous time point and a subsequent time point, with the entrance of the first cell and the entrance of the second cell, comparing the distances, and selecting the cell with the minimum distance as the first candidate area.
[0030] After the first candidate area is determined, operations corresponding to the step S3 are performed: the judging whether the vehicle enters the second cell includes the following steps: S301. Obtaining a vector in a direction entering the second cell at the entrance of the second cell to serve as a first vector; S302. Obtaining a driving vector of the vehicle at the entrance of the second cell to serve as a second vector; and S303. Calculating an included angle between the first vector and the second vector, and judging whether the vehicle enters the second cell according to the included angle, as shown in Fig. 3.
[0031] Preferably, the step S301 includes the following steps: S311. Selecting a point at the entrance of the second cell to serve as a starting point of the first vector, or directly using the coordinates (2, 1) of the entrance of the second cell as the starting point of the first vector; and S312. Selecting a point on a ray in the direction entering the second cell to serve as an end point of the first vector, so as to obtain the first vector.
[0032] The step S302 includes the following steps: S321. Obtaining a coordinate point at which the vehicle passes through the entrance of the second cell most recently within the preset time to serve as the starting point of the second vector; and S222. Starting from the starting point of the second vector, selecting the next driving trajectory point in the historical trajectory of the vehicle to serve as the end point of the second vector, so as to obtain the second vector.
[0033] Further, the calculating an included angle between the first vector and the second vector, and judging whether the vehicle enters the second cell according to the included angle includes the following steps: setting the first vector as (x1, y1), setting the second vector as (x2, y2), setting the included angle between the first vector and the second vector as θ, and calculating θ by the following formula: cos θ = x 1 x 2 + y 1 y 2 x 1 2 + y 1 2 + x 2 2 + y 2 2 if 0° ≤ θ < 90°, judging that the vehicle enters the second cell, and that the current location of the vehicle is the second cell; and if 90° ≤ θ ≤ 180°, judging that the vehicle does not enter the second cell, and that the current location of the vehicle is not in the first cell or the second cell.
[0034] As shown in Fig. 3, when the traveling trajectory of the vehicle is the vector 1, the included angle θ of which with the vector in the direction entering the second cell is less than 90°, and it can be judged that the vehicle enters the second cell; and the traveling trajectory of the vehicle is the vector 2, and the included angle θ of which with the vector in the direction entering the second cell is greater than 90°, it can be judged that the vehicle leaves the cell.
[0035] The location of the vehicle is obtained again, the preset distance value and the preset time value are adjusted, and the steps S1-S3 are repeated to perform location judgment, until the current location of the vehicle is determined.
[0036] According to the method described in the embodiment of the present invention, accurate vehicle location information is obtained through the historical driving trajectory information and the current POI information of the vehicle to identify the specific location where the vehicle is located more accurately; in the case of adjacent POIs, compared with the manner in the prior art that the POI information of the vehicle is judged by directly using the current GPS data, the POI information to which the vehicle belongs can be judged more accurately, without being disturbed by multiple adjacent POIs and other information, the problem that the POI boundary is difficult to judge is solved, and the positioning accuracy is high; and in addition, the location of the vehicle is judged in the method by calculating the included angle between the vectors in the driving direction of the vehicle and the direction entering the first candidate area, the calculation amount is relatively small, and the result can be quickly calculated and inferred, the calculation mode is simple, convenient and feasible, and the efficiency is high.
[0037] The embodiment of the present invention further provides a vehicle positioning device. As shown in Fig. 4, the device includes: a first area selection module 1, configured to obtain current location coordinates of a vehicle, and select candidate areas within a preset distance according to the current location coordinates of the vehicle; and the preset distance can be set according to the traffic conditions, the geographic environment and other information of the area where the vehicle is located.
[0038] A second area selection module 2, configured to obtain historical GPS coordinates of the vehicle within a preset time, and select a first candidate area from the candidate areas according to the historical GPS coordinates of the vehicle; and the preset time can be set according to specific traffic conditions, the geographic environment, the average driving speed of the vehicle in the candidate areas and other information.
[0039] A judging module 3, configured to judge whether the vehicle enters the first candidate area to determine the current location of the vehicle. If the vehicle enters the first candidate area, the vehicle is currently in the first candidate area, if the vehicle does not enter the first candidate area, the vehicle is not in the first candidate area, the location of the vehicle is obtained again, the preset distance value and the preset time value are adjusted, and the steps S1-S3 are repeated to perform location judgment, until the current location of the vehicle is determined.
[0040] The problem of unclear location of the vehicle is descried in the following embodiments in specific scenarios: As shown in Fig. 2, in the case of two adjacent cells, the two cells are respectively set as a first cell and a second cell, the current coordinate location submitted by the vehicle appears on an adjacent side of the two cells after being drawn on the map, and at this time, the POI information of the vehicle is difficult to judge. In this case, the location of the vehicle has the following two possibilities: 1. Located in the first cell; and 2. Located in the second cell.
[0041] For this kind of scenario, the historical trajectory of the vehicle is obtained via the characteristic that the vehicle periodically uploads the currently located GPS location during the driving process, so as to judge the accurate location of the vehicle.
[0042] In this scenario, the first area selection module 1 selects the first cell and the second cell as the candidate areas within the preset distance.
[0043] The second area selection module 2 selects the preset time, wherein the preset time can be selected as 1 hour in this scenario, obtains the historical GPS coordinates of the vehicle within 1 hour, and selects the first candidate area from the first cell and the second cell according to the historical GPS coordinates of the vehicle.
[0044] The second area selection module 2 includes: a first coordinate obtaining unit, configured to obtain the GPS coordinates of all entrances of the first cell and the second cell; a coordinate comparison unit, configured to compare the historical GPS coordinates of the vehicle with the GPS coordinates of all entrances of the first cell and the second cell in a reverse chronological manner; and a first candidate area selection unit, configured to select the candidate area corresponding to the entrance of the candidate area that the vehicle passes through most recently as the first candidate area according to the comparison result.
[0045] Specifically, assuming that the first cell has two entrances, and the corresponding GPS coordinates are: (1, 1) and (1,2); the second cell has one entrance, and the corresponding GPS coordinates are (2, 1). It should be noted that the scenario is only used as a specific embodiment to illustrate the present invention, the number of the candidate areas is not limited to two, but can also be multiple, and similarly, the number of the entrances of the candidate areas is not unique, which is analyzed according to the specific scenario.
[0046] By searching for the historical driving trajectory of the vehicle, it can be seen that the vehicle passes through (2, 1) half an hour ago, passes through (1, 1) one hour ago, and does not pass through the coordinates of the entrances of other cells thereafter. Then, it can be seen that the entrance point of the cell that the vehicle passes through most recently is (2, 1), and then, the first candidate area selection unit selects the second cell as the first candidate area.
[0047] There may also be a special situation in this scenario: if the distance between the entrances of the first cell and the second cell is very small, and the coordinate point of the entrance of the cell that the vehicle passes through most recently is just located between the entrance of the first cell and the entrance of the second cell, then the first candidate area selection unit needs to perform the following judgement: calculating the distances between three coordinate points, that is, when the vehicle passes the space between the entrance of the first cell and the entrance of the second cell, a previous time point and a subsequent time point, with the entrance of the first cell and the entrance of the second cell, comparing the distances, and selecting the cell with the minimum distance as the first candidate area.
[0048] The judging module 3 includes: a first vector obtaining unit, configured to obtain a vector in a direction entering the second cell at the entrance of the second cell to serve as a first vector; a second vector obtaining unit, configured to obtain a driving vector of the vehicle at the entrance of the second cell to serve as a second vector; and a judging unit, configured to calculate an included angle between the first vector and the second vector, and judging whether the vehicle enters the second cell according to the included angle, as shown in Fig. 3.
[0049] Preferably, the first vector obtaining unit is further configured to: select a point at the entrance of the second cell to serve as a starting point of the first vector, or directly use the coordinates (2, 1) of the entrance of the second cell as the starting point of the first vector; and select a point on a ray in the direction entering the second cell to serve as an end point of the first vector, so as to obtain the first vector.
[0050] The second vector obtaining unit is further configured to: obtain a coordinate point at which the vehicle passes through the entrance of the second cell most recently within the preset time to serve as the starting point of the second vector; and starting from the starting point of the second vector, select the next driving trajectory point in the historical trajectory of the vehicle to serve as the end point of the second vector, so as to obtain the second vector.
[0051] The judging unit includes: a calculation sub-unit, configured to calculate the included angle θ between the first vector and the second vector, set the first vector as (x1, y1), set the second vector as (x2, y2), set the included angle between the first vector and the second vector as θ, and specifically calculate θ by the following formula: cos θ = x 1 x 2 + y 1 y 2 x 1 2 + y 1 2 + x 2 2 + y 2 2 a judging sub-unit, configured to judge whether the vehicle enters the first candidate area according to the included angle, specifically: if 0° ≤ θ < 90°, judge that the vehicle enters the second cell, and that the current location of the vehicle is the second cell; and if 90° ≤ θ ≤ 180°, judge that the vehicle does not enter the second cell, and that the current location of the vehicle is not in the first cell or the second cell.
[0052] As shown in Fig. 3, when the traveling trajectory of the vehicle is the vector 1, the included angle θ of which with the vector in the direction entering the second cell is less than 90°, and the judging sub-unit judges that the vehicle enters the second cell; and the traveling trajectory of the vehicle is the vector 2, and the included angle θ of which with the vector in the direction entering the second cell is greater than 90°, and the judging sub-unit judges that the vehicle leaves the cell.
[0053] The first area selection module 1 obtains the location of the vehicle again, adjusts the preset distance value and the preset time value, and performs location judgment again by using the device, until the current location of the vehicle is determined.
[0054] According to the device described in the embodiment of the present invention, accurate vehicle location information is obtained through the historical driving trajectory information and the current POI information of the vehicle to identify the specific location where the vehicle is located more accurately; in the case of adjacent POIs, compared with the manner in the prior art that the POI information of the vehicle is judged by directly using the current GPS data, the POI information to which the vehicle belongs can be judged more accurately, without being disturbed by multiple adjacent POIs and other information, the problem that the POI boundary is difficult to judge is solved, and the positioning accuracy is high; and in addition, the location of the vehicle is judged in the method by calculating the included angle between the vectors in the driving direction of the vehicle and the direction entering the first candidate area, the calculation amount is relatively small, and the result can be quickly calculated and inferred, the calculation mode is simple, convenient and feasible, and the efficiency is high.
[0055] The embodiment of the present invention further provides a controller, including a memory and a processor, wherein the memory stores a computer program, and the program is configured to implement the steps of the method when executed by the processor.
[0056] The embodiment of the present invention further provides a computer-readable storage medium for storing a computer instruction, wherein the instruction implements the steps of the method when executed by a computer or a processor.
[0057] The above descriptions are only the preferred embodiments of the present invention, and do not limit the present invention in any form. Although the present invention has been disclosed in the preferred embodiments as above, the preferred embodiments are not used for limiting the present invention, anyone skilled familiar with this art can make some changes or modifications by using the technical contents disclosed above to serve as equivalent embodiments of equivalent changes, without departing from the scope of the technical solutions of the present invention as defined in the appended claims, and any simple modifications, equivalent changes and modifications made to the above embodiments according to the technical essence of the present invention as defined in the appended claims, without departing from the contents of the technical solutions of the present invention, still fall within the scope of the technical solutions of the present invention as defined in the appended claims.
Claims
1. A vehicle positioning method, comprising the following steps: obtaining current location coordinates of a vehicle, and selecting candidate areas within a preset distance according to the current location coordinates of the vehicle (S1); obtaining historical location coordinates of the vehicle within a preset time, and selecting a first candidate area from the candidate areas according to the historical location coordinates of the vehicle (S2); and judging whether the vehicle enters the first candidate area to determine the current location of the vehicle (S3), characterized in that, judging whether the vehicle enters the first candidate area (S3) comprises: obtaining a vector in a direction entering the first candidate area at an entrance of the first candidate area to serve as a first vector; obtaining a driving vector of the vehicle at the entrance of the first candidate area to serve as a second vector, comprising obtaining a coordinate point at which the vehicle passes through the entrance of the first candidate area within the preset time to serve as the starting point of the second vector; and starting from the starting point of the second vector, selecting the next driving trajectory point in the historical trajectory of the vehicle to serve as the end point of the second vector, so as to obtain the second vector; and calculating an included angle between the first vector and the second vector, and judging whether the vehicle enters the first candidate area according to the included angle.
2. The vehicle positioning method according to claim 1, wherein the selecting a first candidate area from the candidate areas according to the historical location coordinates of the vehicle (S2) comprises the following steps: obtaining the location coordinates of the entrances of the candidate areas; comparing the historical location coordinates of the vehicle with the location coordinates of the entrances of the candidate areas in a reverse chronological manner; and selecting the candidate area corresponding to the entrance of the candidate area that the vehicle passes through most recently as the first candidate area according to the comparison result.
3. The vehicle positioning method according to claim 2, wherein: if there are more than two entrances of the candidate areas that the vehicle pass through most recently, the following step is performed to select the first candidate area: calculating the distances between three coordinate points, that is, when the vehicle passes the entrance of the candidate area, a previous time point and a subsequent time point, and the entrance of each candidate area that the vehicle passes through most recently, comparing the distances, and selecting the candidate area with the minimum distance as the first candidate area.
4. The vehicle positioning method according to claim 1, wherein: the obtaining a vector in a direction entering the first candidate area at the entrance of the first candidate area to serve as a first vector comprises the following steps: selecting a point at the entrance of the first candidate area to serve as a starting point of the first vector; and selecting a point on a ray in the direction entering the first candidate area to serve as an end point of the first vector, so as to obtain the first vector.
5. The vehicle positioning method according to claim 1, wherein: the calculating an included angle between the first vector and the second vector, and judging whether the vehicle enters the first candidate area according to the included angle comprises the following steps: setting the first vector as (x1, y1), setting the second vector as (x2, y2), setting the included angle between the first vector and the second vector as θ, and calculating θ by the following formula: cos θ = x 1 x 2 + y 1 y 2 x 1 2 + y 1 2 + x 2 2 + y 2 2 if 0° ≤ θ < 90°, judging that the vehicle enters the first candidate area, and that the current location of the vehicle is the first candidate area; and if 90° ≤ θ ≤ 180°, judging that the vehicle does not enter the first candidate area, and that the current location of the vehicle is not in the candidate area within the selected preset distance.
6. A vehicle positioning device, comprising: a first area selection module (1), configured to obtain current location coordinates of a vehicle, and select candidate areas within a preset distance according to the current location coordinates of the vehicle (S1); a second area selection module (2), configured to obtain historical location coordinates of the vehicle within a preset time, and select a first candidate area from the candidate areas according to the historical location coordinates of the vehicle (S2); and a judging module (3), configured to judge whether the vehicle enters the first candidate area to determine the current location of the vehicle (S3), characterized in that, the judging module (3) comprises: a first vector obtaining unit, configured to obtain a vector in a direction entering the first candidate area at an entrance of the first candidate area to serve as a first vector; a second vector obtaining unit, configured to obtain a driving vector of the vehicle at the entrance of the first candidate area to serve as a second vector, wherein the second vector obtaining unit is further configured to: obtain a coordinate point at which the vehicle passes through the entrance of the first candidate area within the preset time to serve as the starting point of the second vector; and starting from the starting point of the second vector, select the next driving trajectory point in the historical trajectory of the vehicle to serve as the end point of the second vector, so as to obtain the second vector; and a judging unit, configured to calculate an included angle between the first vector and the second vector, and judge whether the vehicle enters the first candidate area according to the included angle.
7. The vehicle positioning device according to claim 6, wherein: the second area selection module (2) comprises: a first coordinate obtaining unit, configured to obtain the location coordinates of the entrances of the candidate areas; a coordinate comparison unit, configured to compare the historical location coordinates of the vehicle with the location coordinates of the entrances of the candidate areas in a reverse chronological manner; and a first candidate area selection unit, configured to select the candidate area corresponding to the entrance of the candidate area that the vehicle passes through most recently as the first candidate area according to the comparison result.
8. The vehicle positioning device according to claim 7, wherein if there are more than two entrances of the candidate areas that the vehicle pass through most recently, the first candidate area selection unit is further configured to: calculate the distances between three coordinate points, that is, when the vehicle passes through the entrance of the candidate area, a previous time point and a subsequent time point, and the entrance of each candidate area that the vehicle passes through most recently, compare the distances, and select the candidate area with the minimum distance as the first candidate area.
9. The vehicle positioning device according to claim 6, wherein the first vector obtaining unit is further configured to: select a point at the entrance of the first candidate area to serve as a starting point of the first vector; and select a point on a ray in the direction entering the first candidate area to serve as an end point of the first vector, so as to obtain the first vector.
10. The vehicle positioning device according to claim 6, wherein the judging unit comprises: a calculation sub-unit, configured to calculate the included angle θ between the first vector and the second vector, set the first vector as (x1, y1), set the second vector as (x2, y2), set the included angle between the first vector and the second vector as θ, and specifically calculate θ by the following formula: cos θ = x 1 x 2 + y 1 y 2 x 1 2 + y 1 2 + x 2 2 + y 2 2 a judging sub-unit, configured to judge whether the vehicle enters the first candidate area according to the included angle, specifically: if 0° ≤ θ < 90°, judge that the vehicle enters the first candidate area, and that the current location of the vehicle is the first candidate area; and if 90° ≤ θ ≤ 180°, judge that the vehicle does not enter the first candidate area, and that the current location of the vehicle is not in the candidate area within the selected preset distance.
11. A controller, comprising a memory and a processor, wherein the memory stores a computer program, and the program is configured to implement the steps of the method according to any of claims 1-5 when executed by the processor.