Disclosure of Invention
The application provides a method and a terminal for route planning, which can plan a route for a user by combining time and improve user experience.
A first aspect of the present application provides a method for route planning, including:
acquiring a destination address and position information of a terminal;
acquiring a bus route capable of reaching a destination address and position information of a corresponding station according to the position information of the terminal;
determining the time when the user arrives at the site position according to the position information of the terminal and the site position information;
acquiring the time of a bus running a bus route to a stop position;
planning travel route information according to the time of a user reaching the station position and the time of a bus reaching the station position;
and outputting the trip line information.
In one possible implementation, obtaining the time when the bus traveling the bus route reaches the stop location includes:
acquiring a bus running a bus route;
acquiring the position information of a bus;
calculating the time of the bus reaching the stop according to the position information of the bus, the running speed of the bus, the position of the stop and the current time;
or,
acquiring a bus running a bus route and departure time of the bus;
and calculating the time of the bus reaching the stop according to the position of the bus at the bus stop, the departure time of the bus, the running speed of the bus, the position of the stop and the current time.
In another possible implementation manner, before the user arrives at the station location, if two or more buses arrive at the station location within a preset time range, the travel route information includes:
the display sequence of the more than two buses corresponds to the sequence of the time when the more than two buses reach the stop position.
In another possible implementation, the travel route information includes a recommended target bus;
the method further comprises the following steps:
and judging whether the time of the user reaching the stop position is greater than the time of the target bus reaching the stop position, and if so, recommending another bus for the user.
In another possible implementation manner, the method further includes:
when a bus line with a stop position reaching a destination address has a switching stop, determining the time of a target bus reaching the switching stop and the time of a bus to be switched reaching the switching stop;
and outputting the time of the target bus reaching the converting station and the time of the bus to be converted reaching the converting station.
A second aspect of an embodiment of the present invention provides a terminal, including:
the device comprises an acquisition unit, a processing unit and a processing unit, wherein the acquisition unit is used for acquiring a destination address and position information of a terminal;
the acquisition unit is also used for acquiring the bus route capable of reaching the destination address and the position information of the corresponding station according to the position information of the terminal;
the determining unit is used for determining the time when the user arrives at the site according to the position information of the terminal and the position information of the site;
the acquisition unit is also used for acquiring the time of the bus running on the bus line reaching the station position;
the planning unit is used for planning the travel route information according to the time of the user reaching the stop position and the time of the bus reaching the stop position;
and the output unit is used for outputting the trip line information.
In a possible implementation manner, the obtaining unit is specifically configured to:
acquiring a bus running a bus route;
acquiring the position information of a bus;
calculating the time of the bus reaching the stop according to the position information of the bus, the running speed of the bus, the position of the stop and the current time;
or the acquisition unit may be specifically adapted to,
acquiring a bus running a bus route and departure time of the bus;
and calculating the time of the bus reaching the stop according to the position of the bus at the bus stop, the departure time of the bus, the running speed of the bus, the position of the stop and the current time.
In another possible implementation manner, before the user arrives at the station location, if two or more buses arrive at the station location within a preset time range, the travel route information includes:
the display sequence of the more than two buses corresponds to the sequence of the time when the more than two buses reach the stop position.
In another possible implementation, the travel route information includes a recommended target bus;
the terminal further includes:
the judging unit is used for judging whether the time of the user reaching the station position is greater than the time of the target bus reaching the station position;
and the recommending unit is used for recommending another bus for the user when the judging unit judges that the time for the user to reach the stop position is greater than the time for the target bus to reach the stop position.
In another possible implementation manner, the determining unit is further configured to:
when a bus line with a stop position reaching a destination address has a switching stop, determining the time of a target bus reaching the switching stop and the time of a bus to be switched reaching the switching stop;
the output unit is also used for outputting the time of the target bus reaching the converting station and the time of the bus to be converted reaching the converting station.
In the embodiment of the invention, a terminal acquires a destination address and position information of the terminal; acquiring a bus route capable of reaching a destination address and position information of a corresponding station according to the position information of the terminal; determining the time when the user arrives at the site position according to the position information of the terminal and the site position information; acquiring the time of a bus running a bus route to a stop position; planning travel route information according to the time of a user reaching the station position and the time of a bus reaching the station position; and outputting the trip line information. Therefore, the travel route information planned by the terminal is the bus which arrives at the stop position after the user arrives at the stop position, the condition that the user cannot catch up with the bus after catching up with the stop position is avoided, and the user experience is improved.
Detailed Description
The application provides a method and a terminal for route planning, which are used for planning an optimal route for a user and improving the experience of the user.
The technical solutions in the present application will be described clearly and completely with reference to the accompanying drawings in the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. 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 application.
Referring to fig. 1, an embodiment of a method for route planning in an embodiment of the present invention includes:
101. acquiring a destination address and position information of a terminal;
if the terminal wants to plan a route for the user, a destination address of the user is obtained first, and the destination address can be input by the user. Since the method needs to calculate the time when the user moves from the current position to the station position, the terminal also needs to obtain the current position information of the terminal, and generally, the current position information of the terminal represents the current position information of the user. Specifically, the terminal can perform real-time acquisition by starting a GPS positioning system.
102. Acquiring the bus route capable of reaching the destination address and the position information of the corresponding station according to the position information of the terminal;
and after the current position information of the terminal is determined, the bus route capable of reaching the destination address and the corresponding stop position information can be obtained through the position information of the terminal. Specifically, the terminal can acquire the stops of the buses within the preset range by acquiring the traffic map information within the preset range of the terminal, and then screen out the bus lines capable of reaching the destination address according to the bus driving lines of each stop, namely, the corresponding stop position information is also determined.
The terminal may screen out multiple bus routes and corresponding multiple stop position information, optionally, the terminal may determine a stop position closest to the terminal position as a recommended stop position according to a user requirement, and may also use each stop position and each bus route as travel route information.
103. Determining the time of the user reaching the site position according to the position information of the terminal and the site position information;
after the position of the terminal and the position of the station are determined, the terminal can calculate the distance between the position of the terminal and the position of the station, namely the distance between the position of the user using the terminal and the position of the station. The distance may be a straight-line distance calculated by the terminal according to the two location points, or may be an actual distance calculated by the terminal according to specific map information.
The terminal can acquire the moving speed of the terminal in real time, for example, the moving speed of the terminal can be calculated according to the terminal position at the first moment and the terminal position at the second moment acquired by the GPS through GPS positioning. For example, after the user walks a distance with the terminal, the terminal calculates an average moving rate of the terminal according to the moving distance and the moving time of the terminal, and the average moving rate also represents the moving rate of the user. Alternatively, the moving speed of the terminal may be preset, for example, to 1m/s by the user. After the position information of the terminal, the position information of the station and the moving speed are determined, the terminal can determine the time when the user arrives at the position of the station. The specific determination process is that the distance between the position of the terminal and the position of the station is calculated, the distance is divided by the moving speed to obtain the time spent by the user to reach the position of the station, and the time spent by the user to reach the position of the station is determined according to the time of the current moment.
104. Acquiring the time of a bus running the bus route to the stop position;
because the bus is provided with the GPS positioning device, the terminal only needs to be connected with the GPS positioning device, the specific position information of the bus on the bus line at the current moment can be determined, and the time of the bus reaching the station position can be determined through the specific position information of the bus, the distance between the position and the station position and the preset driving speed of the bus.
105. Planning travel route information according to the time of the user reaching the stop position and the time of the bus reaching the stop position;
after the time when the user arrives at the stop position and the time when the bus arrives at the stop position are determined, the terminal can plan the travel route information for the user, and specifically, the bus arriving at the stop after the user arrives at the stop position can be recommended to the user as the travel route information.
106. Outputting the travel route information;
after the terminal plans the route information for the user, the information is output and displayed to the user for the user to refer to, and buses which can reach the stop and the arrival time of each bus can be listed and displayed in a specific output interface, so that the user can conveniently select the buses according to the display information.
In the embodiment of the invention, a terminal acquires a destination address and position information of the terminal; acquiring the bus route capable of reaching the destination address and the position information of the corresponding station according to the position information of the terminal; determining the time of the user reaching the site position according to the position information of the terminal and the site position information; acquiring the time of a bus running the bus route to the stop position; planning travel route information according to the time of the user reaching the stop position and the time of the bus reaching the stop position; and outputting the travel route information. Therefore, the travel route information planned by the terminal is the bus which arrives at the stop position after the user arrives at the stop position, the condition that the user cannot catch up with the bus after catching up with the stop position is avoided, and the user experience is improved.
Referring to fig. 2, another embodiment of the method for route planning in the embodiment of the present invention includes:
201. acquiring a destination address and position information of a terminal;
the details are described with reference to step 101.
202. Acquiring the bus route capable of reaching the destination address and the position information of the corresponding station according to the position information of the terminal;
the details are described with reference to step 102.
203. Determining the time of the user reaching the site position according to the position information of the terminal and the site position information;
the details are described with reference to step 103.
204. Acquiring the time of a bus running the bus route to the stop position;
in a possible implementation manner, the time for the bus traveling the bus route to reach the stop position may be acquired as follows: the terminal acquires a bus running the bus route, acquires the position information of the bus, and calculates the time of the bus reaching the stop according to the position information of the bus, the running speed of the bus, the position of the stop and the current time;
the position information of the bus can be acquired from GPS positioning information in an external bus system, and the driving speed of the bus can be calculated by the terminal according to the driving distance and time of the GPS positioning information of at least two moments of the bus, or can be preset by the terminal. When the position information of the bus is determined, the running speed of the bus is determined, and the position of a stop is determined, the time of the bus reaching the stop can be calculated, and the specific calculation mode is that the distance between the position of the bus and the stop is calculated, the running speed of the bus is divided by the calculated distance to obtain the time required by the bus reaching the stop, and the time required by the bus reaching the stop is obtained by adding the time required by the bus reaching the stop according to the time of the current moment.
In another possible implementation manner, the time for the bus running the bus route to reach the stop position may be acquired as follows: the terminal obtains the bus running the bus route and the departure time of the bus, and the terminal calculates the time of the bus reaching the stop according to the position of the bus at the bus stop, the departure time of the bus, the running speed of the bus, the position of the stop and the current time.
The terminal can obtain the position of a bus station and the departure time of the bus from an external bus system, the driving speed of the bus can be preset, or the terminal can calculate the GPS positioning position of the bus at the first moment and the positioning position of the bus at the second moment, after the position of the bus station is determined, the terminal can calculate the distance between the bus station and the bus station through map information, so that the distance is divided by the driving speed of the bus to obtain the time spent by the bus from the bus station to the bus station, and the departure time of the bus is added to obtain the time spent by the bus to the bus station.
205. When a bus line of the destination address at the stop position has a switching stop, determining the time of the target bus reaching the switching stop and the time of the bus to be switched reaching the switching stop;
because there may be a switching station in the bus route from the station position to the destination address, the user needs to switch to the destination address after arriving at the switching station, so as to avoid that the bus to be switched does not run in the same day after the user arrives at the switching station, which causes great influence to the user. Therefore, the terminal can determine the time of the target bus arriving at the switching station and the time of the bus to be switched arriving at the station, and update the two times into the travel route information for the reference of the user, so that the user experience is improved.
206. Planning travel route information according to the time of the user reaching the stop position and the time of the bus reaching the stop position;
the details are described with reference to step 105.
207. Outputting the travel route information, wherein the travel route information comprises a target bus recommended for a user, and the travel route information also comprises the time of the target bus arriving at the conversion station and the time of the bus to be converted arriving at the conversion station;
in the travel route information, a target bus recommended by the terminal for the user can be displayed for the user to perform priority selection.
Optionally, before the user arrives at the station position, if two or more buses arrive at the station position within a preset time range, the travel route information includes:
the display sequence of the two or more pieces of bus information corresponds to the sequence of the time when the two or more pieces of buses arrive at the stop positions.
Since there may be a plurality of bus routes to the destination, that is, there may be a plurality of buses arriving before the user arrives at the station position, in order to provide a better choice for the user, the terminal sorts more than two buses arriving within a preset time range, which may be set by the user, for example, within 10 minutes, that is, more than two buses arriving within 10 minutes after the user arrives at the station position, and the terminal sorts according to the arrival sequence to remind the user of which bus to select first.
208. Judging whether the time of the user reaching the stop position is greater than the time of the target bus reaching the stop position, if so, executing step 209, and if not, executing other operations;
since the moving speed of the user cannot be completely determined in practical applications, the user may not catch up with the bus because the user walks slowly. Therefore, in the method, the terminal can also acquire the position information of the terminal at the current moment in real time, and then judge whether the user can arrive before the recommended bus arrives at the stop position according to the distance between the current position information and the position information of the stop and the movement rate of the user acquired in real time, if not, the terminal recommends the user according to other buses which are going to arrive at the stop position. In the method, the terminal can update the travel route information in real time according to the judgment result.
209. And recommending another bus for the user.
And the other bus recommended by the terminal for the user is the bus which runs the route and passes the stop, and the time of the bus reaching the stop is only second to the time of the bus recommended by the user.
Optionally, the terminal may further obtain schedule information of the bus on the travel route, and the specific obtaining manner may download the bus schedule information on the network, and update and display the schedule information in the travel route information. The bus schedule information comprises the departure time of the bus, the current specific position information of the bus, the stop information of the bus line and the road condition information of the bus line.
Referring to fig. 3, an embodiment of the terminal in the embodiment of the present invention includes:
an obtaining unit 301, configured to obtain a destination address and location information of a terminal;
the details are described with reference to step 101.
The obtaining unit 301 is further configured to obtain, according to the position information of the terminal, a bus route and corresponding stop position information that can reach the destination address;
the details are described with reference to step 102.
The determining unit 302 is configured to determine, according to the location information of the terminal and the location information of the site, a time when the user arrives at the site;
the details are described with reference to step 103.
The obtaining unit 301 is further configured to obtain the time when the bus running on the bus route reaches the stop position;
the details are described with reference to step 104.
A planning unit 303, configured to plan route information according to the time when the user arrives at the stop location and the time when the bus arrives at the stop location;
the details are described with reference to step 105.
An output unit 304, configured to output the trip line information.
The details are described with reference to step 106.
Referring to fig. 4, another embodiment of the terminal in the embodiment of the present invention includes:
an obtaining unit 401, configured to obtain a destination address and location information of a terminal;
the details are described with reference to step 201.
The obtaining unit 401 is further configured to obtain, according to the position information of the terminal, a bus route and corresponding stop position information that can reach the destination address;
details are described with reference to step 202.
A determining unit 402, configured to determine, according to the location information of the terminal and the location information of the site, a time when the user arrives at the site;
the details are described with reference to step 203.
The obtaining unit 401 is further configured to obtain time when a bus running the bus route reaches the stop position; the obtaining unit 401 is specifically configured to:
acquiring a bus running the bus route;
acquiring the position information of the bus;
calculating the time of the bus reaching the stop according to the position information of the bus, the running speed of the bus, the position of the stop and the current time;
or the obtaining unit may be specifically configured to,
acquiring a bus running the bus route and departure time of the bus;
and calculating the time of the bus reaching the stop according to the position of the bus at the total stop, the departure time of the bus, the running speed of the bus, the position of the stop and the current time.
The details are described with reference to step 204.
The determining unit 402 is further configured to: when a bus line of the destination address at the stop position has a switching stop, determining the time of the target bus reaching the switching stop and the time of the bus to be switched reaching the switching stop;
the details are described with reference to step 205.
A planning unit 403, configured to plan route information according to the time when the user arrives at the stop location and the time when the bus arrives at the stop location; before the user arrives at the stop position, if two or more buses arrive at the stop position within a preset time range, the travel route information comprises: the display sequence of the two or more pieces of bus information corresponds to the sequence of the time when the two or more pieces of buses arrive at the stop positions.
The details are described with reference to step 206.
An output unit 406 configured to output the trip line information;
details are described with reference to step 207.
The travel route information comprises a recommended target bus;
the terminal further comprises:
a judging unit 404, configured to judge whether the time when the user arrives at the stop position is greater than the time when the target bus arrives at the stop position;
and the recommending unit 405 is configured to recommend another bus to the user when the judging unit judges that the time when the user arrives at the station position is longer than the time when the target bus arrives at the station position.
The output unit 406 is further configured to output the time when the target bus arrives at the transfer station and the time when the bus to be transferred arrives at the transfer station.
The details are described with reference to step 208.
The above embodiments are only used for illustrating the technical solutions of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions in the embodiments of the present application.