CN108562302B - Method and device for acquiring closed route - Google Patents

Method and device for acquiring closed route Download PDF

Info

Publication number
CN108562302B
CN108562302B CN201810718398.0A CN201810718398A CN108562302B CN 108562302 B CN108562302 B CN 108562302B CN 201810718398 A CN201810718398 A CN 201810718398A CN 108562302 B CN108562302 B CN 108562302B
Authority
CN
China
Prior art keywords
route
user
search processing
determining
map
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201810718398.0A
Other languages
Chinese (zh)
Other versions
CN108562302A (en
Inventor
伍超
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Baidu Netcom Science and Technology Co Ltd
Original Assignee
Beijing Baidu Netcom Science and Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Baidu Netcom Science and Technology Co Ltd filed Critical Beijing Baidu Netcom Science and Technology Co Ltd
Priority to CN201810718398.0A priority Critical patent/CN108562302B/en
Publication of CN108562302A publication Critical patent/CN108562302A/en
Application granted granted Critical
Publication of CN108562302B publication Critical patent/CN108562302B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G01MEASURING; TESTING
    • G01CMEASURING DISTANCES, LEVELS OR BEARINGS; SURVEYING; NAVIGATION; GYROSCOPIC INSTRUMENTS; PHOTOGRAMMETRY OR VIDEOGRAMMETRY
    • G01C21/00Navigation; Navigational instruments not provided for in groups G01C1/00 - G01C19/00
    • G01C21/26Navigation; Navigational instruments not provided for in groups G01C1/00 - G01C19/00 specially adapted for navigation in a road network
    • G01C21/34Route searching; Route guidance
    • G01C21/3446Details of route searching algorithms, e.g. Dijkstra, A*, arc-flags, using precalculated routes

Landscapes

  • Engineering & Computer Science (AREA)
  • Radar, Positioning & Navigation (AREA)
  • Remote Sensing (AREA)
  • Automation & Control Theory (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Navigation (AREA)

Abstract

The invention provides a method and a device for acquiring a closed route. The method comprises the following steps: receiving a route request message input by a user, wherein the route request message comprises a user position and a route length required by the user; determining a starting point and an end point of a road section closest to the user position on a map according to the user position; determining a first route on the map from the start point to the end point, the first route having a length equal to a difference between the user desired route length and the nearest segment length; forming the first route and the nearest road segment into a closed route; outputting the closed route to the user. The requirement of the user in a scene needing a closed route, such as a running scene, is met.

Description

Method and device for acquiring closed route
Technical Field
The invention relates to the technical field of electronic maps, in particular to a method and a device for acquiring a closed route.
Background
With the continuous development of navigation technology, more and more services are available, such as: after the user inputs the starting point position and the end point position, travel routes such as driving, public transportation, riding, walking, trains and the like between two points can be sent to the user, and great convenience is brought to the work and life of the user.
In the prior art, the shortest route between two points can be calculated on the basis that a user sets a starting point position and an end point position.
However, in some specific scenarios, such as a running scenario, the user may need not be the shortest route, but rather a closed route that conforms to a preset length, such as a "circle" shaped route.
Disclosure of Invention
The invention provides a method and a device for acquiring a closed route, which are used for acquiring the closed route with the length required by a user.
In a first aspect, the present invention provides a method for acquiring a closed route, including:
receiving a route request message input by a user, wherein the route request message comprises a user position and a route length required by the user;
determining a starting point and an end point of a road section closest to the user position on a map according to the user position;
determining a first route on the map from the start point to the end point, the first route having a length equal to a difference between the user desired route length and the nearest segment length;
forming the first route and the nearest road segment into a closed route;
outputting the closed route to the user.
Optionally, the determining a first route from the starting point to the ending point on the map includes:
and determining a first route from the starting point to the end point on the map by adopting a heuristic search processing process.
Optionally, the determining a first route from the starting point to the ending point on the map by using a heuristic search process includes:
performing a forward search process on the map starting from the start point toward the end point direction, and performing a reverse search process on the map starting from the end point toward the start point direction;
and determining the first route according to the route obtained by the forward search processing and the route obtained by the reverse search processing.
Optionally, the performing forward search processing on the map from the starting point toward the end point direction, and performing reverse search processing on the map from the end point toward the starting point direction includes:
inserting the starting point into a forward opening list;
executing the forward search processing on the map according to the forward opening list and a preset cost calculation formula;
inserting the end point into a reverse opening list;
executing the reverse search processing on the map according to the reverse opening list and the preset cost calculation formula;
correspondingly, the determining the first route according to the route obtained by the forward search processing and the route obtained by the reverse search processing includes:
and if the forward search processing and the reverse search processing are processed to the same node, and the sum of the route length obtained by the forward search processing and the route length obtained by the reverse search processing meets the length requirement of a first route, determining that the route obtained by the forward search processing and the route obtained by the reverse search processing form the first route.
Optionally, after determining that the route obtained by the forward search processing and the route obtained by the reverse search processing form the first route, the method further includes:
determining whether a course shape of the first course meets a smooth curve requirement;
and if not, re-performing the heuristic search processing process.
Optionally, if the route request message is a route replacement request message input by a user, after determining that the route obtained by the forward search processing and the route obtained by the reverse search processing form the first route, the method further includes:
determining whether the first route is the same as a first route obtained by a previous route request message sent by a user;
and if the data are the same, the heuristic search processing process is carried out again.
Optionally, the user position is a position keyword;
correspondingly, the determining a starting point and an ending point of a road section closest to the user position on a map according to the user position includes:
performing map retrieval processing on the position keywords to obtain the coordinates of the POI (point of interest) corresponding to the position keywords;
and determining a starting point and an ending point of a road section closest to the position of the user on a map according to the coordinates of the POI.
Optionally, the determining a first route from the starting point to the ending point on the map includes:
determining a first route from the starting point to the ending point on the map according to the historical habits of the user.
Optionally, the route request message is a navigation request message or a running route request message.
In a second aspect, the present invention provides a closed route obtaining apparatus, including:
the system comprises a receiving module, a route processing module and a route processing module, wherein the receiving module is used for receiving a route request message input by a user, and the route request message comprises a user position and a route length required by the user;
the first determining module is used for determining a starting point and an end point of a road section closest to the user position on a map according to the user position;
a second determination module for determining a first route on the map from the start point to the end point, the first route having a length equal to a difference between the user-desired route length and the nearest link length;
an output module for forming the first route and the nearest road segment into a closed route; outputting the closed route to the user.
Optionally, the second determining module is specifically configured to determine the first route from the starting point to the ending point on the map by using a heuristic search processing procedure.
Optionally, the second determining module includes: an execution unit and a determination unit;
the execution unit is specifically configured to execute a forward search process on the map from the start point toward the end point direction, and execute a reverse search process on the map from the end point toward the start point direction;
the determining unit is configured to determine the first route according to the route obtained by the forward search processing and the route obtained by the reverse search processing.
Optionally, the execution unit is specifically configured to insert the starting point into a forward-opening list;
executing the forward search processing on the map according to the forward opening list and a preset cost calculation formula;
inserting the end point into a reverse opening list;
executing the reverse search processing on the map according to the reverse opening list and the preset cost calculation formula;
the determining unit is specifically configured to determine that the route obtained by the forward search processing and the route obtained by the reverse search processing constitute the first route if the forward search processing and the reverse search processing both process the same node and the sum of the route length obtained by the forward search processing and the route length obtained by the reverse search processing satisfies a length requirement of the first route.
Optionally, the first determining module is further configured to determine whether a route shape of the first route meets a smooth curve requirement;
and if not, re-performing the heuristic search processing process.
Optionally, if the route request message is a route replacement request message input by a user;
the first determining module is further configured to determine whether the first route is the same as a first route obtained by a previous route request message sent by a user;
and if the data are the same, the heuristic search processing process is carried out again.
Optionally, when the user location is a location keyword;
the first determining module is specifically configured to perform map retrieval processing on the location keyword to obtain coordinates of a point of interest (POI) corresponding to the location keyword;
and determining a starting point and an ending point of a road section closest to the position of the user on a map according to the coordinates of the POI.
Optionally, the second determining module is further configured to determine a first route from the starting point to the ending point on the map according to the historical habits of the user.
Optionally, the route request message is a navigation request message or a running route request message.
In a third aspect, the present invention provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements the closed route acquisition method described above.
In a third aspect, the present invention provides a terminal, including:
a processor; and
a memory for storing executable instructions of the processor;
wherein the processor is configured to implement the closed route acquisition method described above via execution of the executable instructions.
According to the method for acquiring the closed route, the starting point and the end point of the road section closest to the position of the user are determined on the basis of acquiring the position of the user and the length of the route required by the user, then the first route is determined according to the starting point and the end point, the first route and the closest road section form a closed curve, the length of the closed curve is just the length of the route required by the user, and the requirement of the user in a scene needing the closed route, such as a running scene, is met.
Drawings
Fig. 1 is an application scenario diagram of the method for acquiring a closed route provided by the present invention;
fig. 2 is a flowchart of a first embodiment of a method for acquiring a closed route according to the present invention;
FIG. 3 provides a user interface diagram of the present invention;
FIG. 4 provides another user interface diagram for the present invention;
FIG. 5 is a flowchart of a second embodiment of a method for obtaining a closed route according to the present invention;
FIG. 6 is another flowchart of a second embodiment of the method for obtaining a closed route according to the present invention
Fig. 7 is a flowchart of a third embodiment of a method for acquiring a closed route according to the present invention;
fig. 8 is another flowchart of a third embodiment of a method for acquiring a closed route according to the present invention;
fig. 9 is a schematic structural diagram of a first embodiment of a closed route obtaining device provided by the present invention;
fig. 10 is a schematic structural diagram of a second embodiment of a closed route obtaining device provided by the present invention;
fig. 11 is a schematic diagram of a hardware structure of the terminal provided by the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
In the present invention, the terms "first" and "second" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated.
In the prior art, the shortest route between two points can be calculated on the basis that a user sets a starting point position and an end point position. However, in some specific scenarios, such as a running scenario, the user may need not be the shortest route, but rather a closed route that conforms to a preset length, such as a "circle" shaped route. The prior art does not disclose a specific acquisition method of a closed path such as a "loop" path.
The invention provides a method for acquiring a closed route, which can calculate the closed route according with the length of the route according to the position of a user and the length of the route required by the user, and meets the requirement of the user in a scene needing the closed route, such as a running scene.
The following describes the technical solutions of the present invention and how to solve the above technical problems with specific embodiments. The following several specific embodiments may be combined with each other, and details of the same or similar concepts or processes may not be repeated in some embodiments. Embodiments of the present invention will be described below with reference to the accompanying drawings.
Fig. 1 is an application scenario diagram of the method for acquiring a closed route provided by the present invention, and optionally, the method provided by the present invention may be implemented by a processing device, such as a processor, of a terminal installed with navigation/positioning software executing corresponding software codes, or may be implemented by the processing device of the terminal performing data interaction with a server while executing corresponding software codes. The terminal may be a desktop computer, a notebook, a Personal Digital Assistant (PDA), a smart phone, a tablet computer, and the like, and the following embodiments all use the terminal as an execution subject for description.
Fig. 2 is a flowchart of a first embodiment of a method for acquiring a closed route provided by the present invention, and as shown in fig. 2, the method for acquiring a closed route provided by the present embodiment includes:
s101, receiving a route request message input by a user, wherein the route request message comprises a user position and a route length required by the user.
The user position may be a current position of the user or a position designated by the user through the navigation terminal. The route length required by the user refers to the total length of the closed route that the user wants to acquire.
Optionally, the User may input the User location and the required route length through a User Interface (UI).
And S102, determining a starting point and an ending point of a road section closest to the user position on a map according to the user position.
The position of the user corresponds to one point on the map, each road section on the map corresponds to one line, and the road section L closest to the position of the user can be determined according to a point-to-line distance calculation method.
Optionally, the method for determining the starting point and the end point may be: assuming that two end points of the road segment L closest to the user position are a and B, the user position, the end points a and a distance, and the distance between the user position and the end point B are calculated, and an end point closer to the user position may be used as a starting point, and an end point farther from the user position may be used as an end point.
Referring to fig. 3, point O represents the user position, and the two endpoints of the link L closest to point O are a and B, respectively, and it is calculated that the endpoint a is closer to the point O and the endpoint B is farther from the point O, so that the endpoint a can be used as the starting point of the link L and the endpoint B can be used as the ending point of the link L.
S103, determining a first route from the starting point to the end point on the map, wherein the length of the first route is equal to the difference between the route length required by the user and the nearest road section length.
And S104, forming a closed route by the first route and the nearest road section.
Referring to fig. 4, a first route between a start point a and an end point B determined on a map is R, and the first route R and a link L form a closed curve having a length of a route required by a user, that is, the length of the first route is the length of the route required by the user minus the length of the link L.
And S105, outputting the closed route to the user.
After the closed curve passing through the end point a and the end point B is obtained at S104, the closed curve is output to the user through the UI.
According to the method for acquiring the closed route, the starting point and the end point of the road section closest to the user position are determined on the basis of acquiring the user position and the route length required by the user, then the first route is determined according to the starting point and the end point, the first route and the closest road section form a closed curve, the length of the closed curve is just the route length required by the user, and the requirement of the user in a scene needing the closed route, such as a running scene, is met.
Fig. 5 is a flowchart of a second embodiment of the method for acquiring a closed route provided by the present invention, where this embodiment is further described with respect to an implementation manner of S103 in the foregoing embodiment, and as shown in fig. 5, S103 may specifically include:
s201, determining a first route from the starting point to the end point on the map by adopting a heuristic search processing process.
On the basis of determining the starting point and the end point, the heuristic search can reduce the search range and reduce the complexity of the search process from the starting point to the end point.
Referring to fig. 6, alternatively, the method for determining the first route by using the heuristic search process may be:
s2011, a forward search process is performed on the map from the start point toward the end point direction, and a reverse search process is performed on the map from the end point toward the start point direction.
And S2012, determining the first route according to the route obtained by the forward search processing and the route obtained by the reverse search processing.
As an achievable way, in the forward search processing performed on the map from the starting point toward the ending point, the starting point may be inserted into the forward open list, then all nodes adjacent to the starting point are obtained, and all adjacent nodes are also inserted into the forward open list, then the starting point is deleted from the forward open list, and the cost of all nodes in the current forward open list is calculated by using a preset cost calculation formula, instead of the node with the smallest cost, the node is used as the node to be processed. And in the next forward search processing execution process, acquiring all adjacent nodes of the node to be processed, inserting the adjacent nodes into the forward opening list, deleting the node to be processed from the forward opening list, calculating the cost of all nodes in the current forward opening list by adopting a preset cost calculation formula again, replacing the node with the minimum cost as the next node to be processed, and performing forward search processing by analogy, wherein the preset cost calculation formula can adopt a formula in the prior art, and is not described herein again.
In the process of performing reverse search processing on the map from the end point to the starting point, the end point may be inserted into a reverse opening list, then all nodes adjacent to the end point are obtained, all adjacent nodes are also inserted into the reverse opening list, then the end point is deleted from the reverse opening list, the cost of all nodes in the current reverse opening list is calculated by using a preset cost calculation formula, and the minimum cost is replaced with the minimum cost as a node to be processed. And in the next reverse search processing process, acquiring all adjacent nodes of the nodes to be processed, inserting the adjacent nodes into the reverse opening list, deleting the nodes to be processed from the reverse opening list, calculating the cost of all the nodes in the current reverse opening list by adopting a preset cost calculation formula, replacing the node with the minimum cost as the next node to be processed, and performing reverse search processing in the same way.
Alternatively, the above-described processes of the forward search process and the reverse search process may be performed alternately.
And if the forward search processing and the reverse search processing are processed to the same node, and the sum of the route length obtained by the forward search processing and the route length obtained by the reverse search processing meets the length requirement of a first route, determining that the route obtained by the forward search processing and the route obtained by the reverse search processing form the first route.
The method for acquiring a closed route provided by this embodiment provides an implementable manner for determining a first route from the starting point to the end point on a map, that is, a heuristic search processing procedure is adopted to determine the first route; the search range is reduced, and the complexity of the search process from the starting point to the end point is reduced.
When running, riding or driving along a closed route, users are often reluctant to turn back roads, and therefore, when calculating the closed route for the users, the smoothness of the closed route needs to be guaranteed as much as possible.
Fig. 7 is a flowchart of a third embodiment of a method for acquiring a closed route, as shown in fig. 7, based on the above embodiment, the method for acquiring a closed route according to this embodiment further includes:
s301, determining whether the route shape of the first route meets the requirement of a smooth curve;
and S302, if the condition is not met, the heuristic search processing process is carried out again.
Optionally, a route curvature may be preset, and then it is determined whether the obtained curvature of the first route is smaller than the route curvature, if so, it indicates that the determined first route meets the requirement of the smooth curve; if not, the first route determined cannot meet the requirements of the smooth curve.
And under the condition that the obtained first route cannot meet the requirement of the smooth curve, the heuristic search processing process needs to be carried out again.
After outputting the closed route to the user in S105, the user may be dissatisfied with the closed route and may want to change the alternative closed route.
Fig. 8 is another flowchart of this embodiment, in order to enable the user to select a satisfactory closed route, the route request message in this embodiment may be a route replacement request message input by the user, and after determining that the route obtained by the forward search processing and the route obtained by the reverse search processing form the first route, the method provided in this embodiment further includes:
s303, determining whether the first route is the same as the first route obtained by the previous route request message sent by the user;
and S304, if the data are the same, the heuristic search processing process is carried out again.
If the user is not satisfied with the output closed route, a route replacing request message can be input, after the terminal receives the route replacing request message, whether the currently determined first route is the same as the first route in the previously output closed route or not can be judged, if yes, the heuristic search processing process needs to be carried out again to obtain a first route different from the previous route, and the closed route formed by the currently determined first route is output to the user.
In this case, the step S102 in the above embodiment may specifically include:
s1021, performing map retrieval processing on the position keywords to obtain the coordinates of the POI corresponding to the position keywords;
and S1022, determining a starting point and an ending point of a road section closest to the position of the user on a map according to the coordinates of the POI.
Optionally, the method for determining the start point and the end point of the road segment closest to the user position according to the coordinates of the POI is similar to the above embodiment, and is not described herein again.
Optionally, in addition to determining the first route according to the location of the user in the above embodiment, the first route from the starting point to the ending point may be determined on the map according to the historical habits of the user.
Optionally, the route request message may be a navigation request message, and may also be a running route request message.
In the method for acquiring a closed route provided by this embodiment, by determining whether the route shape of the first route meets the requirement of a smooth curve, and if not, performing the heuristic search processing again, the smoothness of the output closed route is ensured. When the route request message is a route replacement request message input by a user, determining whether the first route is the same as a first route obtained by a previous route request message sent by the user; if the closed routes are the same, the heuristic search processing is carried out again, so that the user can select a satisfactory closed route.
Fig. 9 is a schematic structural diagram of a first embodiment of an apparatus for acquiring a closed route provided by the present invention, and as shown in fig. 9, the apparatus for acquiring a closed route provided by the present embodiment includes:
a receiving module 801, configured to receive a route request message input by a user, where the route request message includes a user location and a route length required by the user;
a first determining module 802, configured to determine, according to the user location, a start point and an end point of a road segment closest to the user location on a map;
a second determining module 803, configured to determine a first route from the starting point to the end point on the map, where the length of the first route is equal to the difference between the route length required by the user and the nearest road segment length;
an output module 804, configured to form the first route and the nearest road segment into a closed route; outputting the closed route to the user.
The device for acquiring a closed route provided in this embodiment may be used to execute the method in the embodiment shown in fig. 1, and the implementation principle and technical effect are similar, which are not described herein again.
Fig. 10 is a schematic structural diagram of a second embodiment of the apparatus for acquiring a closed route according to the present invention, and as shown in fig. 10, the second determining module 803 is specifically configured to determine the first route from the starting point to the end point on the map by using a heuristic search processing procedure.
Optionally, the second determining module 803 includes: an execution unit 901 and a determination unit 902;
the execution unit 901 is specifically configured to execute a forward search process on the map from the start point toward the end point direction, and execute a reverse search process on the map from the end point toward the start point direction;
the determining unit 902 is configured to determine the first route according to the route obtained by the forward search processing and the route obtained by the reverse search processing.
Optionally, the executing unit 901 is specifically configured to insert the starting point into a forward opening list;
executing the forward search processing on the map according to the forward opening list and a preset cost calculation formula;
inserting the end point into a reverse opening list;
executing the reverse search processing on the map according to the reverse opening list and the preset cost calculation formula;
the determining unit 902 is specifically configured to determine that the route obtained by the forward search processing and the route obtained by the reverse search processing constitute the first route if the same node is obtained by the forward search processing and the same node is obtained by the reverse search processing, and a sum of a route length obtained by the forward search processing and a route length obtained by the reverse search processing satisfies a length requirement of the first route.
Optionally, the first determining module 802 is further configured to determine whether the route shape of the first route meets a smooth curve requirement;
and if not, re-performing the heuristic search processing process.
Optionally, if the route request message is a route replacement request message input by a user, the first determining module 802 is further configured to determine whether the first route is the same as a first route obtained by a previous route request message sent by the user;
and if the data are the same, the heuristic search processing process is carried out again.
Optionally, when the user location is a location keyword;
the first determining module 802 is specifically configured to perform map retrieval processing on the location keyword to obtain coordinates of a point of interest (POI) corresponding to the location keyword;
and determining a starting point and an ending point of a road section closest to the position of the user on a map according to the coordinates of the POI.
Optionally, the second determining module 903 is further configured to determine a first route from the starting point to the ending point on the map according to the historical habits of the user.
Optionally, the route request message is a navigation request message or a running route request message.
The device for acquiring a closed route provided by this embodiment may be used to execute the method in any embodiment shown in fig. 2-7, and the implementation principle and technical effect are similar, and are not described herein again.
Fig. 11 is a schematic diagram of a hardware structure of the terminal provided by the present invention. As shown in fig. 11, the terminal of the present embodiment may include:
an input/output interface 1001, where the input/output interface 1001 may include a separate output interface and an input interface, or may be an integrated interface that integrates input and output. The output interface is used for outputting data, the input interface is used for acquiring input data, the output data is a general name output in the method embodiment, and the input data is a general name input in the method embodiment.
A memory 1002 for storing program instructions.
The processor 1003 is configured to implement the method described in any one of the embodiments when the program instructions are executed, and specific implementation principles may refer to the embodiments described above, which are not described herein again.
The present invention provides a computer-readable storage medium having stored thereon a computer program which, when being executed by a processor, implements the method for acquiring a closed route according to any one of the above embodiments.
The invention also provides a program product comprising a computer program stored in a readable storage medium, from which the computer program can be read by at least one processor, the execution of which by the at least one processor causes a terminal to implement the above-mentioned closed route acquisition method.
Those of ordinary skill in the art will understand that: all or a portion of the steps of implementing the above-described method embodiments may be performed by hardware associated with program instructions. The program may be stored in a computer-readable storage medium. When executed, the program performs steps comprising the method embodiments described above; and the aforementioned storage medium includes: various media that can store program codes, such as ROM, RAM, magnetic or optical disks.
Finally, it should be noted that: the above embodiments are only used to illustrate the technical solution of the present invention, and not to limit the same; while the invention has been described in detail and with reference to the foregoing embodiments, it will be understood by those skilled in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; and the modifications or the substitutions do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the embodiments of the present invention.

Claims (12)

1. A method for obtaining a closed route, comprising:
receiving a route request message input by a user, wherein the route request message comprises a user position and a route length required by the user;
determining a starting point and an end point of a road section closest to the user position on a map according to the user position;
determining a first route on the map from the start point to the end point, the first route having a length equal to a difference between the user desired route length and the nearest segment length;
forming the first route and the nearest road segment into a closed route;
outputting the closed route to the user;
wherein the determining a first route on the map from the starting point to the ending point comprises:
determining a first route from the starting point to the end point on the map by adopting a heuristic search processing process;
the determining a first route from the starting point to the ending point on the map by adopting a heuristic search processing process comprises:
performing a forward search process on the map starting from the start point toward the end point direction, and performing a reverse search process on the map starting from the end point toward the start point direction;
determining the first route according to the route obtained by the forward search processing and the route obtained by the reverse search processing;
performing a forward search process on the map starting from the start point toward the end point direction, and performing a reverse search process on the map starting from the end point toward the start point direction, including:
inserting the starting point into a forward opening list;
executing the forward search processing on the map according to the forward opening list and a preset cost calculation formula;
inserting the end point into a reverse opening list;
executing the reverse search processing on the map according to the reverse opening list and the preset cost calculation formula;
correspondingly, the determining the first route according to the route obtained by the forward search processing and the route obtained by the reverse search processing includes:
if the forward search processing and the reverse search processing are processed to the same node, and the sum of the route length obtained by the forward search processing and the route length obtained by the reverse search processing meets the length requirement of a first route, determining that the route obtained by the forward search processing and the route obtained by the reverse search processing form the first route;
after determining that the route obtained by the forward search processing and the route obtained by the reverse search processing form the first route, the method further includes:
determining whether a course shape of the first course meets a smooth curve requirement;
and if not, re-performing the heuristic search processing process.
2. The method according to claim 1, wherein if the route request message is a replacement route request message input by a user, after determining that the route obtained by the forward search processing and the route obtained by the reverse search processing constitute the first route, further comprising:
determining whether the first route is the same as a first route obtained by a previous route request message sent by a user;
and if the data are the same, the heuristic search processing process is carried out again.
3. The method of claim 1 or 2, wherein the user location is a location keyword;
correspondingly, the determining a starting point and an ending point of a road section closest to the user position on a map according to the user position includes:
performing map retrieval processing on the position keywords to obtain the coordinates of the POI (point of interest) corresponding to the position keywords;
and determining a starting point and an ending point of a road section closest to the position of the user on a map according to the coordinates of the POI.
4. The method of claim 1 or 2, wherein said determining a first route on said map from said starting point to said ending point comprises:
determining a first route from the starting point to the ending point on the map according to the historical habits of the user.
5. Method according to claim 1 or 2, wherein the route request message is a navigation request message, a running route request message.
6. An apparatus for obtaining a closed route, comprising:
the system comprises a receiving module, a route processing module and a route processing module, wherein the receiving module is used for receiving a route request message input by a user, and the route request message comprises a user position and a route length required by the user;
the first determining module is used for determining a starting point and an end point of a road section closest to the user position on a map according to the user position;
a second determination module for determining a first route on the map from the start point to the end point, the first route having a length equal to a difference between the user-desired route length and the nearest link length;
an output module for forming the first route and the nearest road segment into a closed route; outputting the closed route to the user;
the second determining module is specifically configured to determine a first route from the starting point to the destination point on the map by using a heuristic search processing procedure;
the second determining module includes: an execution unit and a determination unit;
the execution unit is specifically configured to execute a forward search process on the map from the start point toward the end point direction, and execute a reverse search process on the map from the end point toward the start point direction;
the determining unit is used for determining the first route according to the route obtained by the forward search processing and the route obtained by the reverse search processing;
the execution unit is specifically configured to insert the starting point into a forward opening list;
executing the forward search processing on the map according to the forward opening list and a preset cost calculation formula;
inserting the end point into a reverse opening list;
executing the reverse search processing on the map according to the reverse opening list and the preset cost calculation formula;
the determining unit is specifically configured to determine that the route obtained by the forward search processing and the route obtained by the reverse search processing constitute a first route if the forward search processing and the reverse search processing both process to the same node and the sum of the route length obtained by the forward search processing and the route length obtained by the reverse search processing meets a length requirement of the first route;
the first determination module is further used for determining whether the route shape of the first route meets the requirement of a smooth curve;
and if not, re-performing the heuristic search processing process.
7. The apparatus of claim 6, wherein if the route request message is a user-entered replacement route request message;
the first determining module is further configured to determine whether the first route is the same as a first route obtained by a previous route request message sent by a user;
and if the data are the same, the heuristic search processing process is carried out again.
8. The apparatus of claim 6 or 7, wherein the user location is a location keyword;
the first determining module is specifically configured to perform map retrieval processing on the location keyword to obtain coordinates of a point of interest (POI) corresponding to the location keyword;
and determining a starting point and an ending point of a road section closest to the position of the user on a map according to the coordinates of the POI.
9. The apparatus according to claim 6 or 7,
the second determining module is further used for determining a first route from the starting point to the end point on the map according to the historical habits of the user.
10. The apparatus according to claim 6 or 7, wherein the route request message is a navigation request message, a running route request message.
11. A computer-readable storage medium having stored thereon a computer program, characterized in that,
the computer program, when executed by a processor, implements the method of any of claims 1-5.
12. A terminal, comprising:
a processor; and
a memory for storing executable instructions of the processor;
wherein the processor is configured to implement the method of any of claims 1-5 via execution of the executable instructions.
CN201810718398.0A 2018-07-03 2018-07-03 Method and device for acquiring closed route Active CN108562302B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810718398.0A CN108562302B (en) 2018-07-03 2018-07-03 Method and device for acquiring closed route

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810718398.0A CN108562302B (en) 2018-07-03 2018-07-03 Method and device for acquiring closed route

Publications (2)

Publication Number Publication Date
CN108562302A CN108562302A (en) 2018-09-21
CN108562302B true CN108562302B (en) 2020-07-07

Family

ID=63555067

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810718398.0A Active CN108562302B (en) 2018-07-03 2018-07-03 Method and device for acquiring closed route

Country Status (1)

Country Link
CN (1) CN108562302B (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101713660A (en) * 2008-10-03 2010-05-26 阿迪达斯股份公司 Program products, methods, and systems for providing location-aware fitness monitoring services
CN201909633U (en) * 2010-11-30 2011-07-27 中山市伊达科技有限公司 Multifunctional navigator
CN103900586A (en) * 2012-12-25 2014-07-02 上海博泰悦臻电子设备制造有限公司 Interest point planning method and apparatus
CN103900585A (en) * 2012-12-25 2014-07-02 上海博泰悦臻电子设备制造有限公司 Interest point planning method and apparatus
CN106248072A (en) * 2016-07-15 2016-12-21 上海跑下去网络科技有限公司 A kind of processing method of interesting electronics road book
CN107077136A (en) * 2014-11-10 2017-08-18 彪马欧洲股份公司 Runner or pedestrian are guided along predetermined running or the method and apparatus of Walking Route
CN107982895A (en) * 2017-11-14 2018-05-04 上海斐讯数据通信技术有限公司 A kind of method and system based on wearable device intelligent planning running route

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101713660A (en) * 2008-10-03 2010-05-26 阿迪达斯股份公司 Program products, methods, and systems for providing location-aware fitness monitoring services
CN201909633U (en) * 2010-11-30 2011-07-27 中山市伊达科技有限公司 Multifunctional navigator
CN103900586A (en) * 2012-12-25 2014-07-02 上海博泰悦臻电子设备制造有限公司 Interest point planning method and apparatus
CN103900585A (en) * 2012-12-25 2014-07-02 上海博泰悦臻电子设备制造有限公司 Interest point planning method and apparatus
CN107077136A (en) * 2014-11-10 2017-08-18 彪马欧洲股份公司 Runner or pedestrian are guided along predetermined running or the method and apparatus of Walking Route
CN106248072A (en) * 2016-07-15 2016-12-21 上海跑下去网络科技有限公司 A kind of processing method of interesting electronics road book
CN107982895A (en) * 2017-11-14 2018-05-04 上海斐讯数据通信技术有限公司 A kind of method and system based on wearable device intelligent planning running route

Also Published As

Publication number Publication date
CN108562302A (en) 2018-09-21

Similar Documents

Publication Publication Date Title
EP2957870B1 (en) Integrating online navigation data with cached navigation data during active navigation
CN111158365A (en) Path planning method and device, robot and storage medium
WO2017076023A1 (en) Path navigation method, apparatus and device, and nonvolatile computer storage medium
JP2008275621A (en) Route determination method and device
JP2007107924A (en) Apparatus, method, and program for navigation
CN105143826A (en) Method and apparatus for route comparison
CN111678527A (en) Path network graph generation method and device, electronic equipment and storage medium
JP6625482B2 (en) Range display device, range display method and program
CN108562302B (en) Method and device for acquiring closed route
US10371535B1 (en) Automatic map generation
JP4148159B2 (en) Navigation system
JP6055377B2 (en) Route guidance system, route guidance method and computer program
JP5132694B2 (en) DATA GENERATION DEVICE, DATA GENERATION METHOD, AND ROUTE SEARCH DEVICE
CN112880703B (en) Navigation voice broadcast data generation method, device, medium and electronic equipment
CN114138873A (en) Information processing method, device, equipment and storage medium
JP7173310B2 (en) Route search device, route search method, and route search program
CN113776539B (en) Shortest path acquisition method, track matching method, device and electronic equipment
US11002554B2 (en) Navigation system with customization mechanism and method of operation thereof
JP6276814B2 (en) Route guidance system, route guidance method and computer program
CN111798015A (en) Planned route adjusting method and device, electronic equipment and storage medium
CN113361788B (en) Path planning method for multi-type service demand under urban environment
CN111323015B (en) Method and device for estimating travel information and electronic equipment
CN113494919B (en) Navigation planning method and device based on personal local experience route
JP7473444B2 (en) Navigation device, navigation method, and program
JP6295508B2 (en) Navigation device, navigation method, and program

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant