A road segment determination method, apparatus, storage medium, and device
By selecting non-elevated, non-tunnel, non-ramp, and non-one-way main road sections as target road sections in the navigation system, the problem of the navigation system matching the destination location as an unsuitable place to get off is solved, resulting in more accurate route planning and improved user experience.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- HANHAI INFORMATION TECH SHANGHAI
- Filing Date
- 2021-01-07
- Publication Date
- 2026-04-14
AI Technical Summary
Existing navigation systems often match the destination to unsuitable locations, such as overpasses or tunnels, when determining the route to the target location, resulting in a poor user experience and inaccurate fare estimates.
Based on the target location and a preset navigation map, candidate road segments are determined, and road segments that are not classified as elevated roads, tunnels, ramps, or one-way main roads are selected as target road segments to avoid matching the destination location to an unsuitable place to get off the vehicle.
This effectively avoids driving to places where it is not permissible to get off or where the wrong place is located, reduces detours, lowers the deviation of the estimated price, and improves the user experience.
Smart Images

Figure CN114743088B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data processing technology, and in particular to a method for determining road segments, a device for determining road segments, a computer-readable storage medium, and a computer device. Background Technology
[0002] With the development of navigation technology, more and more services are integrating with navigation. For example, when hailing a taxi, a navigation route can be planned directly based on the given target location information, which can be the starting point or the destination. In practical applications, since navigation routes are often composed of multiple road segments, it is usually necessary to first determine the target road segment that matches the target location information, and then plan the route based on the target road segment.
[0003] Currently, navigation systems typically store navigation maps, and the roads in these maps are usually pre-divided into multiple segments according to specific rules; that is, each road in the navigation map includes at least one segment. For a given target location, current navigation systems generally determine the closest road segment to the target location based on that target location information and the stored navigation map, and then use that closest road segment as the target road segment matching the target location information.
[0004] The applicant's research revealed discrepancies in the locations of a small number of drop-off points. For example, according to online feedback, for a few personalized drop-off points, drivers, following navigation instructions, sometimes find the final destination located in unsuitable areas such as elevated roads or tunnels, impacting the user experience for both drivers and passengers. Furthermore, some personalized drop-off point names and locations cross street boundaries, leading to disputes regarding estimated fares and detours. The root cause is that when the final destination is near elevated roads or tunnels, the system may match the nearest drop-off point and road segment, resulting in the final destination being located on elevated roads or within enclosed sections such as ramps or tunnels. Summary of the Invention
[0005] This invention provides a method, apparatus, electronic device, and computer-readable storage medium for determining road sections, thereby solving the problem of location deviation when the drop-off point is located in an unsuitable location such as an elevated road or tunnel.
[0006] To address the above problems, this invention discloses a method for determining road segments, comprising:
[0007] Based on the target location and a preset navigation map, at least one candidate road segment corresponding to the target location is determined, wherein the distance between the candidate road segment and the target location is less than a first preset distance;
[0008] Obtain the road segment classification of the at least one candidate road segment;
[0009] Among the at least one candidate road segment, the candidate road segment whose road segment classification is not a preset classification is determined as the target road segment corresponding to the target location, wherein the preset classification includes at least one of elevated road, tunnel, ramp, and one-way main road.
[0010] Optionally, among the at least one candidate road segment, determining a candidate road segment whose road segment classification is not a preset classification as the target road segment corresponding to the target location includes:
[0011] Based on the distance between the target location and each of the candidate road segments, candidate road segments whose distance from the target location is less than a second preset distance are selected according to different road segment categories.
[0012] Based on the road segment classification of the selected candidate road segments, the target road segments whose road segment classification is not the preset classification are determined.
[0013] Optionally, the step of classifying different road segments according to the distance between the target location and each of the candidate road segments, and filtering candidate road segments whose distance to the target location is less than a second preset distance, includes:
[0014] When the road segment classification of the at least one candidate road segment includes at least one of named roads, unnamed roads, and internal roads, among the candidate road segments classified as named roads, unnamed roads, and internal roads, a first candidate road segment that is closest to the target location and whose distance is less than a second preset distance is selected based on the distance between the target location and each of the candidate road segments.
[0015] When the road segment classification of the at least one candidate road segment includes at least one of elevated road and tunnel, among the candidate road segments classified as elevated road and tunnel, a second candidate road segment with the closest distance to the target location and the distance between the target location and each candidate road segment is selected based on the distance between the target location and each candidate road segment.
[0016] Optionally, determining the target road segment whose classification is not a preset classification based on the road segment classification of the selected candidate road segments includes:
[0017] When the first candidate road segment is selected and the second candidate road segment is not selected, the first candidate road segment is determined as the target road segment;
[0018] When the first candidate road segment and the second candidate road segment are selected, the candidate road segment whose road segment classification is not a preset classification is determined according to the driving direction of the first candidate road segment and the second candidate road segment, and is then used as the target road segment.
[0019] Optionally, determining candidate road segments whose classification is not a preset classification, based on the driving direction of the first and second candidate road segments, as the target road segments includes:
[0020] When the driving directions of the first candidate road segment and the second candidate road segment differ within a first preset range, and the distance between the first candidate road segment and the second candidate road segment is not less than a third preset distance, the first candidate road segment is determined as the target road segment.
[0021] Optionally, determining candidate road segments whose classification is not a preset classification, based on the driving direction of the first and second candidate road segments, as the target road segments includes:
[0022] When the driving directions of the first candidate road segment and the second candidate road segment are not within a first preset range, a third candidate road segment whose driving direction differs from that of the second candidate road segment is within a first preset range from the candidate road segments classified as named roads and unnamed roads.
[0023] In the third candidate road segment, based on the distance between the target location and each of the third candidate road segments, a fourth candidate road segment that is closest to the target location and whose distance is less than a second preset distance is selected, and the fourth candidate road segment is determined as the target road segment.
[0024] Optionally, the step of determining candidate road segments whose classification is not a preset classification as target road segments based on the driving direction of the first and second candidate road segments further includes:
[0025] When the fourth candidate road segment is not selected, and the distance between the first candidate road segment and the second candidate road segment is not less than the third preset distance, the first candidate road segment is determined as the target road segment.
[0026] Optionally, the step of determining candidate road segments whose classification is not a preset classification as target road segments based on the driving direction of the first and second candidate road segments further includes:
[0027] When the distance between the first candidate road segment and the second candidate road segment is less than a third preset distance, the target position is moved away from the second candidate road segment by the third preset distance.
[0028] Optionally, determining the target road segment whose classification is not a preset classification based on the road segment classification of the selected candidate road segments includes:
[0029] When the first candidate road segment is classified as a named road and is a one-way main road, a fifth candidate road segment whose driving direction differs from that of the first candidate road segment from the candidate road segments classified as named roads and unnamed roads is selected from the candidate road segments.
[0030] Eliminate the candidate road segments that are inside the first candidate road segment from the fifth candidate road segment;
[0031] Among the remaining fifth candidate road segments, the candidate road segment that is furthest from the first candidate road segment is selected as the target road segment.
[0032] Optionally, the step of filtering the first candidate road segment that is closest to the target location and whose distance is less than a second preset distance from the candidate road segments classified as named roads, unnamed roads, and internal roads includes:
[0033] Among the candidate road segments classified as named roads and unnamed roads, the first candidate road segment with the closest distance to the target location and the distance less than a second preset distance is selected based on the distance between the target location and each candidate road segment.
[0034] If the first candidate road segment is not selected, then among the candidate road segments classified as internal roads, the first candidate road segment with the closest distance to the target location and the distance less than the second preset distance is selected based on the distance between the target location and each of the candidate road segments.
[0035] Accordingly, the present invention discloses a road segment determination device, comprising:
[0036] The candidate road segment determination module is used to determine at least one candidate road segment corresponding to the target location based on the target location and a preset navigation map, wherein the distance between the candidate road segment and the target location is less than a first preset distance;
[0037] The road segment classification acquisition module is used to acquire the road segment classification of the at least one candidate road segment;
[0038] The target road segment determination module is used to determine, among the at least one candidate road segments, a candidate road segment whose road segment classification is not a preset classification, as the target road segment corresponding to the target location, wherein the preset classification includes at least one of elevated roads, tunnels, ramps, and one-way main roads.
[0039] Optionally, the target road segment determination module includes:
[0040] The road segment filtering submodule is used to filter candidate road segments whose distance from the target location is less than a second preset distance according to different road segment categories based on the distance between the target location and each of the candidate road segments;
[0041] The road segment determination submodule is used to determine the target road segment whose road segment classification is not a preset classification based on the road segment classification of the selected candidate road segments.
[0042] Optionally, the road segment screening submodule includes:
[0043] The first road segment filtering unit is used to filter the first candidate road segment that is closest to the target location and whose distance is less than a second preset distance from the target location, based on the distance between the target location and each of the candidate road segments when the road segment classification of the at least one candidate road segment includes at least one of named roads, unnamed roads, and internal roads.
[0044] The second road segment filtering unit is used to filter the second candidate road segment that is closest to the target location and whose distance is less than a second preset distance from the candidate road segments that are classified as elevated roads or tunnels, when the road segment classification of the at least one candidate road segment includes at least one of elevated roads and tunnels.
[0045] Optionally, the road segment determination submodule includes:
[0046] The first road segment determination unit is used to determine the first candidate road segment as the target road segment when the first candidate road segment is selected and the second candidate road segment is not selected.
[0047] The second road segment determination unit is used to determine, based on the driving direction of the first and second candidate road segments, a candidate road segment whose classification is not a preset classification, as the target road segment when the first candidate road segment and the second candidate road segment are selected.
[0048] Optionally, the second road segment determination unit includes:
[0049] The first road segment determination subunit is used to determine the first candidate road segment as the target road segment when the driving directions of the first candidate road segment and the second candidate road segment differ within a first preset range and the distance between the first candidate road segment and the second candidate road segment is not less than a third preset distance.
[0050] Optionally, the second road segment determination unit includes:
[0051] The first road segment filtering subunit is used to filter a third candidate road segment whose driving direction differs from that of the second candidate road segment from the candidate road segments classified as named roads and unnamed roads when the driving direction of the first candidate road segment and the second candidate road segment is not within a first preset range.
[0052] The second road segment determination subunit is used to filter the fourth candidate road segment that is closest to the target location and whose distance is less than a second preset distance from the target location in the third candidate road segments, based on the distance between the target location and each of the third candidate road segments, and determine the fourth candidate road segment as the target road segment.
[0053] Optionally, the second road segment determination unit further includes:
[0054] The third road segment determination subunit is used to determine the first candidate road segment as the target road segment when the fourth candidate road segment is not selected and the distance between the first candidate road segment and the second candidate road segment is not less than the third preset distance.
[0055] Optionally, the second road segment determination unit further includes:
[0056] The moving subunit is used to move the target position away from the second candidate segment by the third preset distance when the distance between the first candidate road segment and the second candidate road segment is less than the third preset distance.
[0057] Optionally, the road segment determination submodule includes:
[0058] The third road segment filtering unit is used to filter the fifth candidate road segment whose driving direction differs from that of the first candidate road segment from that of the first candidate road segment when the road segment classification of the first candidate road segment is a named road and the first candidate road segment is a one-way main road.
[0059] The road segment elimination unit is used to eliminate the candidate road segments that are inside the first candidate road segment in the fifth candidate road segment;
[0060] The road segment selection unit is used to select the candidate road segment that is farthest from the first candidate road segment from the remaining fifth candidate road segments, and use it as the target road segment.
[0061] Optionally, the first road segment filtering unit includes:
[0062] The second road segment filtering subunit is used to filter the first candidate road segment that is closest to the target location and whose distance is less than a second preset distance from the candidate road segments classified as named roads and unnamed roads, based on the distance between the target location and each candidate road segment.
[0063] The third road segment filtering subunit is used to, if the first candidate road segment is not selected, filter the first candidate road segment that is closest to the target location and whose distance is less than a second preset distance from the candidate road segments classified as internal roads, based on the distance between the target location and each of the candidate road segments.
[0064] In another aspect of the present invention, an electronic device is also provided, including a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus.
[0065] Memory, used to store computer programs;
[0066] When a processor executes a program stored in memory, it implements any of the steps described above.
[0067] In another aspect of the present invention, a computer-readable storage medium is also provided, wherein instructions are stored therein, which, when executed on a computer, cause the computer to perform any of the methods described above.
[0068] In another aspect of the present invention, a computer program product containing instructions is also provided, which, when run on a computer, causes the computer to perform any of the methods described above.
[0069] In summary, according to the embodiments of the present invention, at least one candidate road segment corresponding to the target location is determined based on the target location and a preset navigation map. The distance between the candidate road segment and the target location is less than a first preset distance. The road segment classification of the at least one candidate road segment is obtained. Among the at least one candidate road segment, the candidate road segment whose road segment classification is not a preset classification is determined as the target road segment corresponding to the target location. The preset classification includes at least one of elevated roads, tunnels, ramps, and one-way main roads. This avoids determining the target road segment corresponding to the target location as an elevated road, tunnel, ramp, or one-way main road, thereby avoiding driving to a point where it is not permissible to get off or the wrong drop-off point, reducing the occurrence of detours, and reducing the deviation of the estimated price. Attached Figure Description
[0070] Figure 1 A flowchart illustrating the steps of a road segment determination method according to Embodiment 1 of the present invention is shown.
[0071] Figure 2 A schematic diagram showing the road-binding point situation is provided;
[0072] Figure 3 A schematic diagram of the road network acquisition process is shown;
[0073] Figure 4 A flowchart illustrating the steps of a road segment determination method according to Embodiment 2 of the present invention is shown.
[0074] Figure 5 A schematic diagram of the nearest road-binding process is shown;
[0075] Figure 6 A schematic diagram of the elevated road avoidance procedure is shown;
[0076] Figure 7 A schematic diagram of the main road avoidance process is shown;
[0077] Figure 8 A structural block diagram of a road segment determination device according to Embodiment 3 of the present invention is shown;
[0078] Figure 9 A schematic diagram of an electronic device according to the present invention is shown. Detailed Implementation
[0079] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0080] This invention can be applied to navigation scenarios, specifically in situations where users query routes or ride-hailing drivers pick up and drop off passengers based on navigation routes. For example, users can select a personalized destination in navigation or ride-hailing software to query navigation routes from their current location to that destination. In this process, the system first determines the destination route matching the destination based on the destination location and the stored navigation map, so that a navigation route can be planned based on the destination road segment. Specifically, determining the destination road segment matching the destination location based on the destination location and the stored navigation address is called route binding.
[0081] Typically, a target location is considered for multiple road segments, and the road-binding coordinates from the target location to each road segment are calculated sequentially. The distance between the target location and the road-binding coordinates on the road segment is called the road-binding distance. For nearest road binding, the road segment with the shortest road-binding distance among the candidate road segments is returned, along with the road-binding coordinates between the target location and that road segment.
[0082] The embodiments of this invention can be applied to terminals or servers. For example, the terminal can be a terminal with navigation software or ride-hailing software installed, and the terminal can implement the methods provided in the embodiments of this invention through the installed navigation software. As another example, the server can be a backend server for navigation software or ride-hailing software, and the methods provided in the embodiments of this invention can be implemented through the backend server. The navigation software or ride-hailing software refers to software that stores navigation addresses and can plan navigation routes based on navigation maps; specifically, it can be electronic map software, ride-hailing software, etc.
[0083] Reference Figure 1 As shown in Figure 1 , the flowchart of the steps of a road segment determination method according to Embodiment 1 of the present invention is shown, which may specifically include the following steps:
[0084] Step 101, based on the target location and the preset navigation map, determine at least one candidate road segment corresponding to the target location, where the distance between the candidate road segment and the target location is less than the first preset distance.
[0085] In the embodiments of the present invention, the target location includes a starting location, an ending location, or a passing point location, etc., or any other applicable location, and the embodiments of the present invention do not limit this. For example, according to the user's historical car-hailing records, the longitude and latitude coordinates of the automatically recorded ending point by the software are used as the personalized ending location.
[0086] In the embodiments of the present invention, a road refers to a passable path between two places, such as an expressway, an urban road, a rural road, etc. A road segment is obtained by dividing a road, that is, a road segment is a part of a road, and each road may include at least one road segment.
[0087] In the embodiments of the present invention, the preset navigation map is pre-stored map data. The map data is provided by a company or an institution that makes the map data. The roads shown in life are often very long, such as ring roads, expressways, etc. To facilitate distinguishing different positions of the road and calculating routes, the company or institution that makes the map data will divide the road into multiple road segments with shorter distances according to specific rules and store the information of these road segments in the map data. The specific rules for dividing road segments are set by the company or institution that makes the map data. The rules for dividing road segments of each road may be the same or different, and the lengths of each road segment may be the same or different. The embodiments of the present invention do not limit the way of dividing road segments.
[0088] In the embodiments of the present invention, the distance between the road segment and the target location may be the distance between the target location and the nearest location on the road segment, or the distance between the target location and the tie point on the road segment, or the distance calculated by any other applicable method, and the embodiments of the present invention do not limit this.
[0089] For example, as Figure 2 shown in the schematic diagram of the tie point situation, the haversine formula can be used to calculate the actual distance between two longitudes and latitudes. Then, use the haversine distance to describe the distance between two longitude and latitude points, calculate the pedal of the tie point to the road segment to be tied. If haversine(begin, end) < haversine(begin, pedal) + haversine(pedal, end), then it means that the pedal is on the extension line of the road segment, otherwise it belongs to Figure 2In case 0, the road tying point is the foot coordinate. If the foot falls on the extension of the road segment, but haversine(begin, pedal) < threshold or haversine(end, pedal) < threshold, where threshold is taken as 2m, this case is that the foot is on the extension of the road segment, but very close to the start and end points. Considering the calculation accuracy, the road tying point in this case can be the foot coordinate. If the foot is on the extension of the road segment and the distance from the start or end point is not less than threshold, if haversine(begin, pedal) < haversin(pedal, end), it means that this case belongs to case 1 in the figure, the foot falls on the extension near the start point, and the road tying point is the coordinate of begin; otherwise, it belongs to case 2 in the figure, the foot falls on the extension near the end point, and the road tying point is the coordinate of end.
[0090] In an embodiment of the present invention, in order to determine a road segment closer to the target position among multiple road segments included in a preset navigation map, a first preset distance can be set in advance, and then based on the target position and the preset navigation map, the distances between the target position and the multiple road segments are calculated. At least one road segment whose distance from the target position is less than the first preset distance is recorded as a candidate road segment. The first preset distance can be set according to actual needs, and the embodiments of the present invention do not limit this.
[0091] For example, as Figure 3 shown in the schematic diagram of the road network acquisition process, according to the road tying coordinates of the target position, a 7-bit geohash is calculated. Here, geohash is an address encoding method that can encode two-dimensional spatial longitude and latitude data into a string. All road segment information of this 7-bit geohash is obtained from the road network database, and then the road segments are filtered, and only the road segments with the road tying case of 0 and the road tying distance less than 80 meters (i.e., the first preset distance) as shown in Figure 2 are retained as candidate road segments.
[0092] Step 102, obtain the road segment classification of the at least one candidate road segment.
[0093] In an embodiment of the present invention, the preset navigation map may include the road segment classifications of multiple road segments, or the road segment classifications of multiple road segments can be determined according to the names of the multiple road segments. Road segment classifications include named roads, unnamed roads, internal roads, elevated roads, etc., or any other applicable classifications, and the embodiments of the present invention do not limit this. Among them, a named road is a road with a corresponding name, such as the Fourth Ring Road, XX Road, XX Avenue, XX Expressway, etc. An unnamed road is a road without a corresponding name. An internal road is a road located inside residential communities, campuses, industrial parks, parks, scenic spots, etc.
[0094] For example, road names can be used to determine whether a road is an elevated road, tunnel, expressway, or other road where getting off is prohibited. A pre-defined whitelist of terms includes "auxiliary road," while a blacklist includes "tunnel, elevated road, expressway, exit, entrance, fast road, interchange, bridge, second bridge, third bridge, fourth bridge, fifth bridge, sixth bridge, level road, service area." If a road name contains one or more words from the blacklist but not from the whitelist, it is considered an elevated road, tunnel, or similar road that must be avoided; otherwise, it is considered a regular road.
[0095] Step 103: Among the at least one candidate road segment, determine the candidate road segment whose road segment classification is not a preset classification, and use it as the target road segment corresponding to the target location, wherein the preset classification includes at least one of elevated road, tunnel, ramp, and one-way main road.
[0096] In this embodiment of the invention, compared to the prior art which determines the target road segment corresponding to the target location by identifying the road segment closest to the target location, this embodiment of the invention identifies candidate road segments whose classification is not a preset category from at least one candidate road segment, thereby avoiding the nearest road segment being an unsuitable or incorrect drop-off point. The preset category includes at least one of elevated roads, tunnels, ramps, and one-way main roads, or may include any other applicable classification as needed; this embodiment of the invention does not impose any limitations on this.
[0097] In this embodiment of the invention, among the at least one candidate road segment, the candidate road segment whose road segment classification is not a preset classification is determined as the target road segment corresponding to the target location. The implementation methods can include various methods, such as: according to the distance between the target location and each of the candidate road segments, for different road segment classifications, candidate road segments whose distance to the target location is less than a second preset distance are selected respectively; according to the road segment classification of the selected candidate road segments, the target road segment whose road segment classification is not a preset classification is determined; or all candidate road segments classified as preset classifications are eliminated, and then the closest candidate road segment is selected from the remaining candidate road segments as the target road segment; or any other applicable implementation methods. This embodiment of the invention does not limit this.
[0098] In summary, according to the embodiments of the present invention, at least one candidate road segment corresponding to the target location is determined based on the target location and a preset navigation map. The distance between the candidate road segment and the target location is less than a first preset distance. The road segment classification of the at least one candidate road segment is obtained. Among the at least one candidate road segment, the candidate road segment whose road segment classification is not a preset classification is determined as the target road segment corresponding to the target location. The preset classification includes at least one of elevated roads, tunnels, ramps, and one-way main roads. This avoids determining the target road segment corresponding to the target location as an elevated road, tunnel, ramp, or one-way main road, thereby avoiding driving to a point where it is not permissible to get off or the wrong drop-off point, reducing the occurrence of detours, and reducing the deviation of the estimated price.
[0099] Reference Figure 4 The diagram illustrates a flowchart of a road segment determination method according to Embodiment 2 of the present invention, which may specifically include the following steps:
[0100] Step 201: Based on the target location and a preset navigation map, determine at least one candidate road segment corresponding to the target location, wherein the distance between the candidate road segment and the target location is less than a first preset distance.
[0101] Step 202: Obtain the road segment classification of the at least one candidate road segment.
[0102] Step 203: Based on the distance between the target location and each of the candidate road segments, classify the road segments according to different categories, and filter the candidate road segments whose distance from the target location is less than the second preset distance.
[0103] In this embodiment of the invention, to achieve proximity-based road binding, a second preset distance can be pre-set. Then, based on the distance between the target location and multiple candidate road segments, different road segment categories are defined, and at least one candidate road segment whose distance to the target location is less than the second preset distance is selected. The second preset distance can be set according to actual needs, and this embodiment of the invention does not impose any restrictions on it.
[0104] In one specific implementation, firstly, from candidate road segments such as named roads, unnamed roads, and internal roads, the candidate road segment that is closest to the target location and whose distance is less than a second preset distance is selected. Then, from candidate road segments such as elevated roads and tunnels, the candidate road segment that is closest to the target location and whose distance is less than a second preset distance is selected.
[0105] In an optional embodiment of the present invention, one implementation of filtering candidate road segments whose distance to the target location is less than a second preset distance according to different road segment classifications based on the distance between the target location and each of the candidate road segments includes: when the road segment classification of the at least one candidate road segment includes at least one of named roads, unnamed roads, and internal roads, among the candidate road segments classified as named roads, unnamed roads, and internal roads, a first candidate road segment whose distance to the target location is closest and whose distance is less than the second preset distance is filtered according to the distance between the target location and each of the candidate road segments; when the road segment classification of the at least one candidate road segment includes at least one of elevated roads and tunnels, among the candidate road segments classified as elevated roads and tunnels, a second candidate road segment whose distance to the target location is closest and whose distance is less than the second preset distance is filtered according to the distance between the target location and each of the candidate road segments.
[0106] For candidate road segments categorized by different road segment types, each candidate road segment is screened separately. When at least one candidate road segment includes at least one of named roads, unnamed roads, and internal roads, for each of these candidate road segments, based on the distance between the target location and each of the candidate road segments, the candidate road segment closest to the target location and with a distance less than a second preset distance is selected and designated as the first candidate road segment. It is possible that the first candidate road segment is selected, or it is possible that it is not selected. Similarly, when at least one candidate road segment includes at least one of elevated roads and tunnels, for each of these candidate road segments, based on the distance between the target location and each of the candidate road segments, the candidate road segment closest to the target location and with a distance less than a second preset distance is selected and designated as the second candidate road segment. It is possible that the second candidate road segment is selected, or it is possible that it is not selected.
[0107] In one optional embodiment of the present invention, one implementation of filtering candidate road segments classified as named roads, unnamed roads, and internal roads, based on the distance between the target location and each of the candidate road segments, to select a first candidate road segment whose distance to the target location is closest and whose distance is less than a second preset distance, includes: filtering candidate road segments classified as named roads and unnamed roads to select a first candidate road segment whose distance to the target location is closest and whose distance is less than a second preset distance, based on the distance between the target location and each of the candidate road segments; if the first candidate road segment is not selected, then filtering candidate road segments classified as internal roads to select a first candidate road segment whose distance to the target location is closest and whose distance is less than a second preset distance, based on the distance between the target location and each of the candidate road segments. Prioritizing the selection of first candidate road segments from named roads and unnamed roads, and only filtering from internal roads when no first candidate road segment can be selected, thereby minimizing the possibility of identifying the target road segment as an internal road.
[0108] For example, such as Figure 5 The diagram illustrates the process of binding the nearest road segment. Based on the coordinates of the road to be bound at the target location, the nearest road segment is bound from both named and unnamed candidate roads. The process involves selecting the candidate road segment closest to the target location and determining if the distance is less than 30 meters. If a candidate road segment exists that is less than 30 meters from the target location, it is selected as the first candidate road segment. If no candidate road segment exists that is less than 30 meters from the target location, no first candidate road segment is selected. The process then continues by binding the nearest road segment from internal roads, again selecting the closest candidate road segment to the target location and determining if the distance is less than 30 meters. If a candidate road segment exists that is less than 30 meters from the target location, it is selected as the first candidate road segment. If no candidate road segment exists that is less than 30 meters from the target location, no first candidate road segment is selected, and the process fails.
[0109] Step 204: Based on the road segment classification of the selected candidate road segments, determine the target road segment whose road segment classification is not the preset classification.
[0110] In this embodiment of the invention, a target road segment is determined from at least one selected candidate road segment. To avoid the nearest road segment being an unsuitable or incorrect drop-off point, the target road segment can be selected based on the road segment classification of the candidate road segments, or based on the road segment classification and other criteria, thereby ensuring that the target road segment is not classified according to a preset category. For example, if two candidate road segments are selected, one being an unnamed road and the other being an elevated road, the candidate segment of the unnamed road is determined as the target road segment. Various scenarios can be used to determine the target road segment, and this embodiment of the invention does not limit the specific method of determining the target road segment.
[0111] In an optional embodiment of the present invention, one implementation of determining a target road segment whose road segment classification is not a preset classification based on the road segment classification of the screened candidate road segments includes: when the first candidate road segment is screened out and the second candidate road segment is not screened out, determining the first candidate road segment as the target road segment; when the first candidate road segment is screened out and the second candidate road segment is screened out, determining a candidate road segment whose road segment classification is not a preset classification based on the driving direction of the first candidate road segment and the second candidate road segment, and using it as the target road segment.
[0112] The preset navigation map stores the direction attributes of road segments. For example, it stores the direction vector of a road segment: Vector = (cos(direct), sin(direct)). If it is necessary to determine the angle between the driving directions of two road segments, the dot product of the two direction vectors is calculated as dotProd = VectorA·VectorB, and the angle is α = arccos(dotProd). The angle between the road segments can be calculated from the dot product of the road segment vectors.
[0113] For example, such as Figure 6The diagram illustrating the elevated road avoidance process shows that, based on the coordinates of the road to be tied to at the target location, the nearest road segment is selected from the candidate elevated road sections. The process involves filtering for the closest candidate road segment to the target location and determining if the distance is less than 30 meters. If no closest candidate road segment exists within 30 meters of the target location, meaning no second candidate road segment is selected, and a first candidate road segment is chosen as the target road segment, the result of the nearest road segment tying process is directly applied. If a closest candidate road segment exists within 30 meters of the target location, meaning both a first and a second candidate road segment are selected, then the target road segment is determined based on the driving directions of both candidates. In practice, when the driving directions of the first candidate road segment and the second candidate road segment are similar, the first candidate road segment can be identified as the target road segment. When the driving directions of the first candidate road segment and the second candidate road segment are significantly different, other candidate road segments with driving directions that are similar to those of the second candidate road segment are selected from the candidate road segments, and the road segment classification is not a preset classification candidate road segment, and these are identified as the target road segment.
[0114] In an optional embodiment of the present invention, a candidate road segment whose classification is not a preset classification is determined based on the driving direction of the first candidate road segment and the second candidate road segment. As an implementation of the target road segment, the method includes: when the driving direction of the first candidate road segment and the second candidate road segment differs from that of the first candidate road segment and the second candidate road segment within a first preset range, and the distance between the first candidate road segment and the second candidate road segment is not less than a third preset distance, the first candidate road segment is determined as the target road segment.
[0115] The first candidate road segment is a named road, an unnamed road, or an internal road, while the second candidate road segment is an elevated road or a tunnel. When the driving directions of the first and second candidate road segments are not much different and the distance between the first and second candidate road segments is relatively far, the first candidate road segment is usually not under the elevated road or above the tunnel. When the driving directions of the first and second candidate road segments are much different, or the distance between the first and second candidate road segments is relatively close, the first candidate road segment is usually very likely to be under the elevated road or above the tunnel. Therefore, when determining the target road segment, it is determined whether the difference in driving direction between the first candidate road segment and the second candidate road segment is within a first preset range, and whether the distance between the first candidate road segment and the second candidate road segment is not less than a third preset distance. If the difference in driving direction between the first candidate road segment and the second candidate road segment is within the first preset range, and the distance between the first candidate road segment and the second candidate road segment is not less than the third preset distance, it can be indicated that the first candidate road segment is not under an elevated road or above a tunnel. Specifically, the first preset range and the third preset distance can be determined according to the actual situation, and this embodiment of the invention does not impose any restrictions on this. Therefore, determining the first candidate road segment as the target road segment can avoid the target road segment being located under an elevated road or above a tunnel, which are unsuitable locations as drop-off points.
[0116] For example, such as Figure 6 As shown, the first candidate road segment is the road binding result v1 from the nearest road binding process, and the second candidate road segment is the nearest elevated road. It is determined whether the absolute value of the dot product between the direction vectors of the road binding result v1 and the nearest elevated road is less than 0.6. If abs(dotProd) is less than 0.6, it indicates that the driving directions of the first candidate road segment and the second candidate road segment are different within a first preset range. Then, the distance between the road binding result v1 and the nearest elevated road is calculated, and it is determined whether the distance between the road binding result v1 and the nearest elevated road is less than 10 meters. If it is not less than 10 meters, it indicates that the distance between the first candidate road segment and the second candidate road segment is not less than a third preset distance. At this time, the road binding result v1 can be determined as the target road segment.
[0117] In an optional embodiment of the present invention, candidate road segments whose road segment classification is not a preset classification are determined based on the driving directions of the first candidate road segment and the second candidate road segment. As another implementation of the target road segment, the method includes: when the driving directions of the first candidate road segment and the second candidate road segment are not different within a first preset range, selecting a third candidate road segment whose driving direction differs from that of the second candidate road segment from the candidate road segments classified as named roads and unnamed roads within the first preset range; among the third candidate road segments, selecting a fourth candidate road segment whose distance to the target location is closest to the target location and whose distance is less than a second preset distance based on the distance between the target location and each of the third candidate road segments, and determining the fourth candidate road segment as the target road segment.
[0118] When determining the target road segment, it is judged whether the difference in driving direction between the first candidate road segment and the second candidate road segment is within a first preset range. When the difference in driving direction between the first candidate road segment and the second candidate road segment is not within the first preset range, that is, the difference in driving direction between the first candidate road segment and the second candidate road segment is large, the first candidate road segment is likely to appear under the elevated road or above the tunnel. In order to avoid the target road segment being located under the elevated road or above the tunnel, which are unsuitable as drop-off points, it is necessary to filter out the candidate road segments classified as named roads and unnamed roads, and select the candidate road segments whose driving direction differs from that of the second candidate road segment within the first preset range. These are recorded as the third candidate road segment. Then, among the third candidate road segments, based on the distance between the target location and each third candidate road segment, the candidate road segment that is closest to the target location and whose distance is less than the second preset distance is selected and recorded as the fourth candidate road segment. The fourth candidate road segment is determined as the target road segment, thus avoiding the target road segment being an elevated road or a tunnel, which are not suitable for getting off the vehicle, and also avoiding the target road segment being below an elevated road or above a tunnel, which are not suitable as a drop-off point.
[0119] For example, such as Figure 6 As shown, if the absolute value of the dot product between the road binding result v1 and the direction vector of the nearest elevated road, abs(dotProd), is not less than 0.6, it indicates that the driving directions of the first candidate road segment and the second candidate road segment are not different within the first preset range. In this case, road filtering is performed from named and unnamed roads to filter out the road in the same direction as the nearest elevated road, that is, to select candidate road segments whose driving directions differ from the second candidate road segment within the first preset range. Then, based on the coordinates of the road to be bound at the target location and the filtered third candidate road segment, the nearest road binding is performed. It is determined whether the distance between the nearest candidate road segment and the target location is less than 30 meters. If it is less than 30 meters, the selected candidate road segment can be used and determined as the target road segment. This achieves both elevated road avoidance and the use of a road in the same direction as the elevated road.
[0120] In an optional embodiment of the present invention, a candidate road segment whose classification is not a preset classification is determined based on the driving direction of the first candidate road segment and the second candidate road segment. As an implementation of the target road segment, it may further include: when the fourth candidate road segment is not selected and the distance between the first candidate road segment and the second candidate road segment is not less than a third preset distance, the first candidate road segment is determined as the target road segment.
[0121] Since a fourth candidate road segment cannot be selected from the third candidate road segment, meaning there is no candidate road segment in the third candidate road segment whose distance from the target location is less than the second preset distance, in order to avoid the target road segment being too far from the target location, it is determined whether the distance between the first candidate road segment and the second candidate road segment is not less than the third preset distance. When the distance between the first candidate road segment and the second candidate road segment is not less than the third preset distance, the first candidate road segment can also be determined as the target road segment, thus achieving elevated road avoidance while ensuring that the target road segment is relatively close to the target location.
[0122] For example, such as Figure 6 As shown, based on the coordinates of the road to be bound at the target location and the third candidate road segment obtained through filtering, the nearest road is bound. It is determined whether the distance between the nearest candidate road segment and the target location is less than 30 meters. If it is not less than 30 meters, the distance between the bound road result v1 and the nearest elevated road can be calculated. It is determined whether the distance between the bound road result v1 and the nearest elevated road is less than 10 meters. If it is not less than 10 meters, it indicates that the distance between the first candidate road segment and the second candidate road segment is not less than the third preset distance. At this time, the bound road result v1 can be determined as the target road segment.
[0123] In an optional embodiment of the present invention, a candidate road segment whose classification is not a preset classification is determined based on the driving direction of the first candidate road segment and the second candidate road segment. As an implementation of the target road segment, it may further include: when the distance between the first candidate road segment and the second candidate road segment is less than a third preset distance, the target position is moved away from the second candidate road segment by the third preset distance.
[0124] When the distance between the first and second candidate road segments is less than the third preset distance, the first candidate road segment is likely located below an elevated road or above a tunnel. These locations are generally unsuitable as drop-off points. The target location can be moved the third preset distance away from the second candidate road segment. This achieves both avoiding elevated roads or tunnels and moving the target location to a location next to them. The specific movement of the target location can be based on actual road conditions and traffic rules. For example, if the second candidate road segment is an eastbound elevated road, the target location can be moved 10 meters south; if the second candidate road segment is a westbound elevated road, the target location can be moved 10 meters north.
[0125] In an optional embodiment of the present invention, one implementation of determining a target road segment whose road segment classification is not a preset classification based on the road segment classification of the screened candidate road segments includes: when the road segment classification of the first candidate road segment is a named road and the first candidate road segment is a one-way main road, among the candidate road segments classified as named roads and unnamed roads, selecting a fifth candidate road segment whose driving direction differs from that of the first candidate road segment by a second preset range; eliminating candidate road segments inside the first candidate road segment from the fifth candidate road segment; and selecting the candidate road segment farthest from the first candidate road segment from the remaining fifth candidate road segments as the target road segment.
[0126] In preset navigation maps, some roads have a direction. For example, a section of the Fourth Ring Road running from east to west is one segment, and a section running from west to east is another segment. Such main roads with a single direction are called one-way main roads. One-way main roads may have auxiliary roads, and one-way main roads are not permitted or suitable as drop-off points. Therefore, if there is an auxiliary road or other road on one side of a one-way main road, you should choose the auxiliary road or other road to drop off.
[0127] When the first candidate road segment is classified as a named road, the process of binding the main road to the main road begins. First, it's determined whether the first candidate road segment is a one-way main road. If it's not, it can be used as a drop-off point, meaning it's one of the candidate road segments. If it is a one-way main road, from the candidate road segments classified as named or unnamed roads, those with a travel direction differing from the first candidate road segment by a second preset range are selected and designated as the fifth candidate road segment. Then, among the fifth candidate road segments, only those outside the first candidate road segment are retained, leaving only those inside. The distance between the fifth and first candidate road segments is then calculated. Typically, the outermost segment of a one-way main road is the most suitable as a drop-off point; therefore, the candidate road segment furthest from the first candidate road segment is selected as the target road segment.
[0128] For example, such as Figure 7The diagram illustrating the main road avoidance process shows that after entering the main road binding process, it first determines whether the main road binding segment (i.e., the first candidate segment) is a one-way road. If it is a one-way road, direction filtering is performed between named and unnamed roads, retaining segments with a dotProd greater than 0.8 and which are one-way roads. Then, inside-outside filtering is performed, retaining segments outside the main road binding segment. Next, the distance between the segment and the main road binding segment is calculated, and the segment with the largest distance is selected. If a segment that meets the above conditions does not exist, the main road binding segment is used as a candidate segment. If a segment that meets the above conditions exists, it is re-bound to that segment, replacing the main road binding segment, thereby avoiding drop-off points located on one-way main roads or other unsuitable drop-off locations.
[0129] In summary, according to the embodiments of the present invention, by determining at least one candidate road segment corresponding to the target location based on the target location and a preset navigation map, wherein the distance between the candidate road segment and the target location is less than a first preset distance, the road segment classification of at least one candidate road segment is obtained, and according to the distance between the target location and each of the candidate road segments, for different road segment classifications, candidate road segments whose distance to the target location is less than a second preset distance are filtered respectively, and according to the road segment classification of the filtered candidate road segments, the target road segment whose road segment classification is not a preset classification is determined. This avoids determining the target road segment corresponding to the target location as an elevated road, tunnel, ramp, one-way main road, etc., thereby avoiding driving to a point where it is not permissible to get off or the wrong drop-off point, reducing the occurrence of detours, and reducing the deviation of the estimated price.
[0130] It should be noted that, for the sake of simplicity, the method embodiments are all described as a series of actions. However, those skilled in the art should understand that the embodiments of the present invention are not limited to the described order of actions, because according to the embodiments of the present invention, some steps can be performed in other orders or simultaneously. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions involved are not necessarily essential to the embodiments of the present invention.
[0131] Example 3
[0132] Reference Figure 8 The diagram shows a structural block diagram of a road segment determination device according to Embodiment 3 of the present invention, which may specifically include the following modules:
[0133] The candidate road segment determination module 301 is used to determine at least one candidate road segment corresponding to the target location based on the target location and a preset navigation map, wherein the distance between the candidate road segment and the target location is less than a first preset distance;
[0134] The road segment classification acquisition module 302 is used to acquire the road segment classification of the at least one candidate road segment;
[0135] The target road segment determination module 303 is used to determine, among the at least one candidate road segments, a candidate road segment whose road segment classification is not a preset classification, as the target road segment corresponding to the target location, wherein the preset classification includes at least one of elevated roads, tunnels, ramps, and one-way main roads.
[0136] In an optional embodiment of the present invention, the target road segment determination module includes:
[0137] The road segment filtering submodule is used to filter candidate road segments whose distance from the target location is less than a second preset distance according to different road segment categories based on the distance between the target location and each of the candidate road segments;
[0138] The road segment determination submodule is used to determine the target road segment whose road segment classification is not a preset classification based on the road segment classification of the selected candidate road segments.
[0139] In an optional embodiment of the present invention, the road segment screening submodule includes:
[0140] The first road segment filtering unit is used to filter the first candidate road segment that is closest to the target location and whose distance is less than a second preset distance from the target location, based on the distance between the target location and each of the candidate road segments when the road segment classification of the at least one candidate road segment includes at least one of named roads, unnamed roads, and internal roads.
[0141] The second road segment filtering unit is used to filter the second candidate road segment that is closest to the target location and whose distance is less than a second preset distance from the candidate road segments that are classified as elevated roads or tunnels, when the road segment classification of the at least one candidate road segment includes at least one of elevated roads and tunnels.
[0142] In an optional embodiment of the present invention, the road segment determination submodule includes:
[0143] The first road segment determination unit is used to determine the first candidate road segment as the target road segment when the first candidate road segment is selected and the second candidate road segment is not selected.
[0144] The second road segment determination unit is used to determine, based on the driving direction of the first and second candidate road segments, a candidate road segment whose classification is not a preset classification, as the target road segment when the first candidate road segment and the second candidate road segment are selected.
[0145] In an optional embodiment of the present invention, the second road segment determination unit includes:
[0146] The first road segment determination subunit is used to determine the first candidate road segment as the target road segment when the driving directions of the first candidate road segment and the second candidate road segment differ within a first preset range and the distance between the first candidate road segment and the second candidate road segment is not less than a third preset distance.
[0147] In an optional embodiment of the present invention, the second road segment determination unit includes:
[0148] The first road segment filtering subunit is used to filter a third candidate road segment whose driving direction differs from that of the second candidate road segment from the candidate road segments classified as named roads and unnamed roads when the driving direction of the first candidate road segment and the second candidate road segment is not within a first preset range.
[0149] The second road segment determination subunit is used to filter the fourth candidate road segment that is closest to the target location and whose distance is less than a second preset distance from the target location in the third candidate road segments, based on the distance between the target location and each of the third candidate road segments, and determine the fourth candidate road segment as the target road segment.
[0150] In an optional embodiment of the present invention, the second road segment determination unit further includes:
[0151] The third road segment determination subunit is used to determine the first candidate road segment as the target road segment when the fourth candidate road segment is not selected and the distance between the first candidate road segment and the second candidate road segment is not less than the third preset distance.
[0152] In an optional embodiment of the present invention, the second road segment determination unit further includes:
[0153] The moving subunit is used to move the target position away from the second candidate segment by the third preset distance when the distance between the first candidate road segment and the second candidate road segment is less than the third preset distance.
[0154] In an optional embodiment of the present invention, the road segment determination submodule includes:
[0155] The third road segment filtering unit is used to filter the fifth candidate road segment whose driving direction differs from that of the first candidate road segment from that of the first candidate road segment when the road segment classification of the first candidate road segment is a named road and the first candidate road segment is a one-way main road.
[0156] The road segment elimination unit is used to eliminate the candidate road segments that are inside the first candidate road segment in the fifth candidate road segment;
[0157] The road segment selection unit is used to select the candidate road segment that is farthest from the first candidate road segment from the remaining fifth candidate road segments, and use it as the target road segment.
[0158] In an optional embodiment of the present invention, the first road segment screening unit includes:
[0159] The second road segment filtering subunit is used to filter the first candidate road segment that is closest to the target location and whose distance is less than a second preset distance from the candidate road segments classified as named roads and unnamed roads, based on the distance between the target location and each candidate road segment.
[0160] The third road segment filtering subunit is used to, if the first candidate road segment is not selected, filter the first candidate road segment that is closest to the target location and whose distance is less than a second preset distance from the candidate road segments classified as internal roads, based on the distance between the target location and each of the candidate road segments.
[0161] In summary, according to the embodiments of the present invention, at least one candidate road segment corresponding to the target location is determined based on the target location and a preset navigation map. The distance between the candidate road segment and the target location is less than a first preset distance. The road segment classification of the at least one candidate road segment is obtained. Among the at least one candidate road segment, the candidate road segment whose road segment classification is not a preset classification is determined as the target road segment corresponding to the target location. The preset classification includes at least one of elevated roads, tunnels, ramps, and one-way main roads. This avoids determining the target road segment corresponding to the target location as an elevated road, tunnel, ramp, or one-way main road, thereby avoiding driving to a point where it is not permissible to get off or the wrong drop-off point, reducing the occurrence of detours, and reducing the deviation of the estimated price.
[0162] This invention also provides an electronic device, such as... Figure 9 As shown, it includes a processor 901, a communication interface 902, a memory 903, and a communication bus 904, wherein the processor 901, the communication interface 902, and the memory 903 communicate with each other through the communication bus 904.
[0163] Memory 903 is used to store computer programs;
[0164] When processor 901 executes a program stored in memory 903, it performs the following steps:
[0165] Based on the target location and a preset navigation map, at least one candidate road segment corresponding to the target location is determined, wherein the distance between the candidate road segment and the target location is less than a first preset distance;
[0166] Obtain the road segment classification of the at least one candidate road segment;
[0167] Among the at least one candidate road segment, the candidate road segment whose road segment classification is not a preset classification is determined as the target road segment corresponding to the target location, wherein the preset classification includes at least one of elevated road, tunnel, ramp, and one-way main road.
[0168] Optionally, among the at least one candidate road segment, determining a candidate road segment whose road segment classification is not a preset classification as the target road segment corresponding to the target location includes:
[0169] Based on the distance between the target location and each of the candidate road segments, candidate road segments whose distance from the target location is less than a second preset distance are selected according to different road segment categories.
[0170] Based on the road segment classification of the selected candidate road segments, the target road segments whose road segment classification is not the preset classification are determined.
[0171] Optionally, the step of classifying different road segments according to the distance between the target location and each of the candidate road segments, and filtering candidate road segments whose distance to the target location is less than a second preset distance, includes:
[0172] When the road segment classification of the at least one candidate road segment includes at least one of named roads, unnamed roads, and internal roads, among the candidate road segments classified as named roads, unnamed roads, and internal roads, a first candidate road segment that is closest to the target location and whose distance is less than a second preset distance is selected based on the distance between the target location and each of the candidate road segments.
[0173] When the road segment classification of the at least one candidate road segment includes at least one of elevated road and tunnel, among the candidate road segments classified as elevated road and tunnel, a second candidate road segment with the closest distance to the target location and the distance between the target location and each candidate road segment is selected based on the distance between the target location and each candidate road segment.
[0174] Optionally, determining the target road segment whose classification is not a preset classification based on the road segment classification of the selected candidate road segments includes:
[0175] When the first candidate road segment is selected and the second candidate road segment is not selected, the first candidate road segment is determined as the target road segment;
[0176] When the first candidate road segment and the second candidate road segment are selected, the candidate road segment whose road segment classification is not a preset classification is determined according to the driving direction of the first candidate road segment and the second candidate road segment, and is then used as the target road segment.
[0177] Optionally, determining candidate road segments whose classification is not a preset classification, based on the driving direction of the first and second candidate road segments, as the target road segments includes:
[0178] When the driving directions of the first candidate road segment and the second candidate road segment differ within a first preset range, and the distance between the first candidate road segment and the second candidate road segment is not less than a third preset distance, the first candidate road segment is determined as the target road segment.
[0179] Optionally, determining candidate road segments whose classification is not a preset classification, based on the driving direction of the first and second candidate road segments, as the target road segments includes:
[0180] When the driving directions of the first candidate road segment and the second candidate road segment are not within a first preset range, a third candidate road segment whose driving direction differs from that of the second candidate road segment is within a first preset range from the candidate road segments classified as named roads and unnamed roads.
[0181] In the third candidate road segment, based on the distance between the target location and each of the third candidate road segments, a fourth candidate road segment that is closest to the target location and whose distance is less than a second preset distance is selected, and the fourth candidate road segment is determined as the target road segment.
[0182] Optionally, the step of determining candidate road segments whose classification is not a preset classification as target road segments based on the driving direction of the first and second candidate road segments further includes:
[0183] When the fourth candidate road segment is not selected, and the distance between the first candidate road segment and the second candidate road segment is not less than the third preset distance, the first candidate road segment is determined as the target road segment.
[0184] Optionally, the step of determining candidate road segments whose classification is not a preset classification as target road segments based on the driving direction of the first and second candidate road segments further includes:
[0185] When the distance between the first candidate road segment and the second candidate road segment is less than a third preset distance, the target position is moved away from the second candidate road segment by the third preset distance.
[0186] Optionally, determining the target road segment whose classification is not a preset classification based on the road segment classification of the selected candidate road segments includes:
[0187] When the first candidate road segment is classified as a named road and is a one-way main road, a fifth candidate road segment whose driving direction differs from that of the first candidate road segment from the candidate road segments classified as named roads and unnamed roads is selected from the candidate road segments.
[0188] Eliminate the candidate road segments that are inside the first candidate road segment from the fifth candidate road segment;
[0189] Among the remaining fifth candidate road segments, the candidate road segment that is furthest from the first candidate road segment is selected as the target road segment.
[0190] Optionally, the step of filtering the first candidate road segment that is closest to the target location and whose distance is less than a second preset distance from the candidate road segments classified as named roads, unnamed roads, and internal roads includes:
[0191] Among the candidate road segments classified as named roads and unnamed roads, the first candidate road segment with the closest distance to the target location and the distance less than a second preset distance is selected based on the distance between the target location and each candidate road segment.
[0192] If the first candidate road segment is not selected, then among the candidate road segments classified as internal roads, the first candidate road segment with the closest distance to the target location and the distance less than the second preset distance is selected based on the distance between the target location and each of the candidate road segments.
[0193] The communication bus mentioned above can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. This communication bus can be divided into address bus, data bus, control bus, etc. For ease of illustration, only one thick line is used to represent it in the diagram, but this does not mean that there is only one bus or one type of bus.
[0194] The communication interface is used for communication between the aforementioned terminal and other devices.
[0195] The memory may include random access memory (RAM) or non-volatile memory, such as at least one disk storage device. Optionally, the memory may also be at least one storage device located remotely from the aforementioned processor.
[0196] The processors mentioned above can be general-purpose processors, including central processing units (CPUs), network processors (NPs), etc.; they can also be digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.
[0197] In another embodiment of the present invention, a computer-readable storage medium is also provided, which stores instructions that, when executed on a computer, cause the computer to perform any of the methods described in the above embodiments.
[0198] In yet another embodiment of the present invention, a computer program product containing instructions is also provided, which, when run on a computer, causes the computer to perform any of the methods described in the above embodiments.
[0199] In the above embodiments, implementation can be achieved entirely or partially through software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented entirely or partially in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of the present invention are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid state disk (SSD)).
[0200] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0201] The various embodiments in this specification are described in a related manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the system embodiments are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions of the method embodiments.
[0202] The above description is merely a preferred embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention are included within the scope of protection of the present invention.
Claims
1. A method for determining road segments, characterized in that, include: Based on the target location and a preset navigation map, at least one candidate road segment corresponding to the target location is determined, wherein the distance between the candidate road segment and the target location is less than a first preset distance; Obtain the road segment classification of the at least one candidate road segment; Among the at least one candidate road segment, a candidate road segment whose road segment classification is not a preset classification is determined as the target road segment corresponding to the target location, wherein the preset classification includes at least one of elevated roads, tunnels, ramps, and one-way main roads; the candidate road segment whose road segment classification is not a preset classification among the at least one candidate road segment, and which is determined as the target road segment corresponding to the target location, includes: Based on the distance between the target location and each of the candidate road segments, candidate road segments whose distance from the target location is less than a second preset distance are selected according to different road segment categories. Based on the road segment classification of the selected candidate road segments, determine the target road segments whose road segment classification is not a preset classification; the step of selecting candidate road segments whose distance from the target location to each candidate road segment is less than a second preset distance for different road segment classifications includes: When the road segment classification of the at least one candidate road segment includes at least one of named roads, unnamed roads, and internal roads, among the candidate road segments classified as named roads, unnamed roads, and internal roads, a first candidate road segment that is closest to the target location and whose distance is less than a second preset distance is selected based on the distance between the target location and each of the candidate road segments. When the road segment classification of the at least one candidate road segment includes at least one of elevated road and tunnel, among the candidate road segments classified as elevated road or tunnel, a second candidate road segment with the closest distance to the target location and a distance less than a second preset distance is selected based on the distance between the target location and each candidate road segment; determining the target road segment whose road segment classification is not a preset classification based on the selected candidate road segment classification includes: When the first candidate road segment is selected and the second candidate road segment is not selected, the first candidate road segment is determined as the target road segment; When the first candidate road segment and the second candidate road segment are selected, the candidate road segment whose road segment classification is not a preset classification is determined according to the driving direction of the first candidate road segment and the second candidate road segment, and is then used as the target road segment.
2. The method according to claim 1, characterized in that, The step of determining candidate road segments whose classification is not a preset classification, based on the driving direction of the first and second candidate road segments, as the target road segments includes: When the driving directions of the first candidate road segment and the second candidate road segment differ within a first preset range, and the distance between the first candidate road segment and the second candidate road segment is not less than a third preset distance, the first candidate road segment is determined as the target road segment.
3. The method according to claim 1, characterized in that, The step of determining candidate road segments whose classification is not a preset classification, based on the driving direction of the first and second candidate road segments, as the target road segments includes: When the driving directions of the first candidate road segment and the second candidate road segment are not within a first preset range, a third candidate road segment whose driving direction differs from that of the second candidate road segment is within a first preset range from the candidate road segments classified as named roads and unnamed roads. In the third candidate road segment, based on the distance between the target location and each of the third candidate road segments, a fourth candidate road segment that is closest to the target location and whose distance is less than a second preset distance is selected, and the fourth candidate road segment is determined as the target road segment.
4. The method according to claim 3, characterized in that, The step of determining candidate road segments whose classification is not a preset classification, based on the driving direction of the first candidate road segment and the second candidate road segment, as the target road segment, further includes: When the fourth candidate road segment is not selected, and the distance between the first candidate road segment and the second candidate road segment is not less than the third preset distance, the first candidate road segment is determined as the target road segment.
5. The method according to claim 2 or 4, characterized in that, The step of determining candidate road segments whose classification is not a preset classification, based on the driving direction of the first candidate road segment and the second candidate road segment, as the target road segment, further includes: When the distance between the first candidate road segment and the second candidate road segment is less than a third preset distance, the target position is moved away from the second candidate road segment by the third preset distance.
6. The method according to claim 1, characterized in that, The step of determining target road segments whose road segment classification is not a preset classification based on the screened candidate road segments includes: When the first candidate road segment is classified as a named road and is a one-way main road, a fifth candidate road segment whose driving direction differs from that of the first candidate road segment from the candidate road segments classified as named roads and unnamed roads is selected from the candidate road segments. Eliminate the candidate road segments that are inside the first candidate road segment from the fifth candidate road segment; Among the remaining fifth candidate road segments, the candidate road segment that is furthest from the first candidate road segment is selected as the target road segment.
7. The method according to claim 1, characterized in that, The step of filtering candidate road segments categorized into named roads, unnamed roads, and internal roads, based on the distance between the target location and each candidate road segment, to select a first candidate road segment whose distance to the target location is closest to the target location and whose distance is less than a second preset distance includes: Among the candidate road segments classified as named roads and unnamed roads, the first candidate road segment with the closest distance to the target location and the distance less than a second preset distance is selected based on the distance between the target location and each candidate road segment. If the first candidate road segment is not selected, then among the candidate road segments classified as internal roads, the first candidate road segment with the closest distance to the target location and the distance less than the second preset distance is selected based on the distance between the target location and each of the candidate road segments.
8. A road segment determination device, characterized in that, include: The candidate road segment determination module is used to determine at least one candidate road segment corresponding to the target location based on the target location and a preset navigation map, wherein the distance between the candidate road segment and the target location is less than a first preset distance; The road segment classification acquisition module is used to acquire the road segment classification of the at least one candidate road segment; A target road segment determination module is used to determine, among the at least one candidate road segments, candidate road segments whose road segment classification is not a preset classification, as the target road segment corresponding to the target location, wherein the preset classification includes at least one of elevated roads, tunnels, ramps, and one-way main roads; the target road segment determination module includes: The road segment filtering submodule is used to filter candidate road segments whose distance from the target location is less than a second preset distance according to different road segment categories based on the distance between the target location and each of the candidate road segments; The road segment determination submodule is used to determine target road segments whose road segment classification is not a preset classification based on the road segment classification of the selected candidate road segments; the road segment filtering submodule includes: The first road segment filtering unit is used to filter the first candidate road segment that is closest to the target location and whose distance is less than a second preset distance from the target location, based on the distance between the target location and each of the candidate road segments when the road segment classification of the at least one candidate road segment includes at least one of named roads, unnamed roads, and internal roads. The second road segment filtering unit is configured to, when the road segment classification of the at least one candidate road segment includes at least one of elevated road and tunnel, filter the candidate road segments classified as elevated road or tunnel based on the distance between the target location and each candidate road segment, selecting the second candidate road segment whose distance to the target location is closest to the target location and whose distance is less than a second preset distance; the road segment determination submodule includes: The first road segment determination unit is used to determine the first candidate road segment as the target road segment when the first candidate road segment is selected and the second candidate road segment is not selected. The second road segment determination unit is used to determine, based on the driving direction of the first and second candidate road segments, a candidate road segment whose classification is not a preset classification, as the target road segment when the first candidate road segment and the second candidate road segment are selected.
9. The apparatus according to claim 8, characterized in that, The second road segment determination unit includes: The first road segment determination subunit is used to determine the first candidate road segment as the target road segment when the driving directions of the first candidate road segment and the second candidate road segment differ within a first preset range and the distance between the first candidate road segment and the second candidate road segment is not less than a third preset distance.
10. The apparatus according to claim 8, characterized in that, The second road segment determination unit includes: The first road segment filtering subunit is used to filter a third candidate road segment whose driving direction differs from that of the second candidate road segment from the candidate road segments classified as named roads and unnamed roads when the driving direction of the first candidate road segment and the second candidate road segment is not within a first preset range. The second road segment determination subunit is used to filter the fourth candidate road segment that is closest to the target location and whose distance is less than a second preset distance from the target location in the third candidate road segments, based on the distance between the target location and each of the third candidate road segments, and determine the fourth candidate road segment as the target road segment.
11. The apparatus according to claim 10, characterized in that, The second road segment determination unit also includes: The third road segment determination subunit is used to determine the first candidate road segment as the target road segment when the fourth candidate road segment is not selected and the distance between the first candidate road segment and the second candidate road segment is not less than the third preset distance.
12. The apparatus according to claim 9 or 11, characterized in that, The second road segment determination unit also includes: The moving subunit is used to move the target position away from the second candidate segment by the third preset distance when the distance between the first candidate road segment and the second candidate road segment is less than the third preset distance.
13. The apparatus according to claim 8, characterized in that, The road segment determination submodule includes: The third road segment filtering unit is used to filter the fifth candidate road segment whose driving direction differs from that of the first candidate road segment from that of the first candidate road segment when the road segment classification of the first candidate road segment is a named road and the first candidate road segment is a one-way main road. The road segment elimination unit is used to eliminate the candidate road segments that are inside the first candidate road segment in the fifth candidate road segment; The road segment selection unit is used to select the candidate road segment that is farthest from the first candidate road segment from the remaining fifth candidate road segments, and use it as the target road segment.
14. The apparatus according to claim 8, characterized in that, The first road segment screening unit includes: The second road segment filtering subunit is used to filter the first candidate road segment that is closest to the target location and whose distance is less than a second preset distance from the candidate road segments classified as named roads and unnamed roads, based on the distance between the target location and each candidate road segment. The third road segment filtering subunit is used to, if the first candidate road segment is not selected, filter the first candidate road segment that is closest to the target location and whose distance is less than a second preset distance from the candidate road segments classified as internal roads, based on the distance between the target location and each of the candidate road segments.
15. An electronic device, characterized in that, It includes a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus; Memory, used to store computer programs; A processor, when executing a program stored in memory, implements the steps of the method described in any one of claims 1-7.
16. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the method as described in any one of claims 1-7.
Citation Information
Patent Citations
Method and device for determining navigation end point in navigation system, and navigation equipment
CN104949678A
Method and device for determining road section on basis of position and storage medium
CN109489674A