Summary of the invention
The object of this invention is to provide the location recommendation method based on public transport line that a kind of corresponding speed is fast, save system resources in computation.
For achieving the above object, the present invention is by the following technical solutions:
Based on a location recommendation method for public transport line, it comprises the steps:
1., under off-line state, system, for each public traffic station, looks for all public transport lines through this website, in geographical data bank, then finds all points of interest along every bar public transport line, and sort out point of interest; Described point of interest is also referred to as the association place of this public traffic station; Or under off-line state, system, for each public transport line, finds all points of interest that this public transport line is along the line, and sorts out point of interest in geographical data bank; Described point of interest is also referred to as the association place of this public transport line; Or under off-line state, system, for each geographic area, first finds all public traffic stations in this region, then find the point of interest associated by these public traffic stations in the ground in database, and point of interest is sorted out; Described point of interest is also referred to as the association place of this geographic area;
2., same under off-line state, system by each public traffic station or every bar public transport line or each geographic area all kinds of associatedly point caches in the server memory of system;
3. the departure place screening that, system is specified according to user associates place, if system cache is the association place of public traffic station, so system is by the public traffic station near traversal, for each traffic website, system is directly retrieved its association place and is taken out the classification wherein meeting user and require from the buffer memory of internal memory; If system cache is the association place of public transport line, so near system goes, there is the public transport line of website, from the buffer memory of internal memory, then retrieve its association place and take out the classification wherein meeting user and require; If buffer memory is the association place of geographic area, the geographic area belonging to it is searched in the departure place that so system is directly specified according to user, and from the buffer memory of internal memory, retrieves its association place and take out the classification wherein meeting user and require; Finally, given all association places meeting user and require, system sends to user the association place meeting most user's requirement.
Described step 2. in, by public traffic station, or public transport line, or the title of geographic area or No. ID key as buffer memory, its associated stations point set cooperation is the value of buffer memory.
Described step 3. in, utilize bayesian algorithm in the association place of the user appointed place periphery public traffic station that all users of meeting require or meet in the public transport line association place of the geographic area, user place that user requires in the association of the public transport line through the user appointed place place that all users of meeting require or all, calculating the association place meeting user most and require.
Adopt the present invention of technique scheme, do not need too complicated computation process, thus reaction velocity is fast, can find a most suitable public transport line of user, improve service quality within the as far as possible short time.
Embodiment
Embodiment 1
Based on a location recommendation method for public transport line, it comprises the steps:
1., under off-line state, system is for each public traffic station, look for all public transport lines through this website, then in geographical data bank, find all points of interest (Point Of Interest) along every bar public transport line, and system is sorted out to point of interest according to predefined classification, such as dining room, supermarket, arenas, night shop, bar etc.For convenience of description, in description below, we claim these points of interest to be the association place of this public traffic station.This step is more consuming time, but because be off-line operation, completes before online implementing, can not response time of requiring user of influential system.
2., equally under off-line state, all kinds of association places of each public traffic station by data buffering systems such as Redis or MemoryCatche, are cached in the server memory of system by system; And in the process, can using the title of public traffic station or No. ID key as buffer memory (Key), its association Website Hosting can using certain data structure or character string forms as the value (Value) of buffer memory.Above-mentioned data structure can be site object list (List) as Hash table (Hash Table), also may be the data structure that other is difficult to enumerate.
3., the system departure place of specifying according to user, the public traffic station near traversal; For each traffic website, system is directly retrieved its association place and is taken out the classification wherein meeting user and require from the buffer memory of internal memory; Finally, given all association places meeting the user appointed place periphery public traffic station that user requires, system utilizes certain existing recommendation sort algorithm, as bayesian algorithm meets in the association place of the user appointed place periphery public traffic station that user requires all, calculate the association place meeting user's requirement most and issue user.In bayesian algorithm, favorable comment degree, discount/preferential dynamics, bid ranking etc. are comprehensively analyzed, a part the highest for rank is recommended user.
As shown in Figure 1, show when not considering transfer for a specific public traffic station " station, five buildings ", how system calculates its association website and recommends.
First, the calculating of system needs a Bus information database for inquiring about website, line information.In addition, system also needs a geographic information database to be used for inquiring about the point of interest near certain specified sites.
Assuming that system recommended distance user can only be specified the place in station, departure place three and requires that the place of recommendation is no more than 200 meters from the distance of get-off stop at most, for station, five buildings, system is first by the public transport line of Bus information data base querying through this website.Tentation data storehouse have recorded 723 roads and No. 12 buses pass through this station, so station, building between all distances five of traversal 723 road and No. 12 bus processes is no more than the website (solid black circle) at three stations by system, and in geographic information database, find all points of interest (in website peripheral annular region) near it in 200 meters.These points of interest are exactly the association place at station, five buildings.Other website for each, system is found its association place by similar computation process and is buffered in internal memory by caching system.The data structure storage of list object can be used in association place.The structure of the list object in an association place as shown in Figure 2.This example illustrates two associations place (KFC dining room and the Starbucks coffee Room) in list.
Assuming that user Xiao Wang requires system recommendation, some convenient do from family the restaurant that bus goes to have dinner, system first by Bus information data base querying from the public traffic station of Xiao Wang family's distance in 200.Suppose that between five, station, building is the public traffic station that unique distance Xiao Wang family is no more than 200 meters, system will recall the association place that station, buffer memory Nei Wujian building all categories is restaurant and sort according to the rank rule of specifying.
Assuming that a rank rule of specifying carries out rank according to user's favorable comment degree, system N number ofly recommends user by the highest for user's scoring in these restaurants.
Rank rule can consider multiple factor simultaneously, as user evaluates, and discount dynamics, hygienic conditions, distance etc.Consider that the rank rule of multiple factor can be expressed as a place points-scoring system according to many factors.Last rank depend on consider many factors when place scoring.
Show when considering once to change to for a specific public traffic station " station, five buildings " as shown in Figure 3, how system calculates its association website and recommends.The same with the requirement of embodiment 1, the calculating of system needs a Bus information database for inquiring about website, line information.In addition, system also needs a geographic information database to be used for inquiring about the point of interest near certain specified sites.
Assuming that system recommended distance user can only be specified the place in station, departure place three and requires that the place of recommendation is no more than 200 meters from the distance of get-off stop at most, for station, five buildings, system is first by the public transport line of Bus information data base querying through this website.Tentation data storehouse have recorded 723 roads and No. 12 buses pass through this station, so station, building between all distances five of traversal 723 road and No. 12 bus processes is no more than the website (solid black circle) at three stations by system, and in geographic information database, find all points of interest (in website peripheral annular region) near it in 200 meters.In addition, these are also inquired about other public transport line of all these websites of process by system, such as 973 tunnels (the website Fang Zhuanqiao through 723 tunnels stands) as shown in the figure, and to travel through in these road public transport lines the website (solid black circle) that station, building between all distances five is no more than three stations, in geographic information database, then find all points of interest (in website peripheral annular region) near it in 200 meters.All these points of interest found are exactly the association place considering the station, situation Xia Wujian building of once changing to.Other website for each, system is found its association place by similar computation process and is buffered in internal memory by caching system.
Embodiment 2
Based on a location recommendation method for public transport line, it comprises the steps:
Under off-line state, all points of interest (Point Of Interest) that system finds it along the line for each public transport line in geographical data bank, and system is sorted out point of interest according to predefined classification, such as dining room, supermarket, arenas, night shop, bar etc.For convenience of description, in description below, we claim these points of interest to be the association place of this public transport line.This step is more consuming time, but because be off-line operation, completes before online implementing, can not response time of requiring user of influential system.
Same under off-line state, all kinds of association places of each public traffic station by data buffering systems such as Redis or MemoryCatche, are cached in the server memory of system by system; And in the process, can using the title of public transport line or No. ID key as buffer memory (Key), its association Website Hosting can using the data structures such as site object list (List) Hash table (Hash Table) or character string forms as the value (Value) of buffer memory.
The departure place that system is specified according to user, traversal has the public transport line of website nearby; For every bar public transport line, system is directly retrieved its association place and is taken out the classification wherein meeting user and require from the buffer memory of internal memory; Finally, given all association places meeting the user appointed place periphery public traffic station that user requires, and embodiment 1 is similar, system recommends user by a kind of general recommendation sort algorithm a part the highest for rank.
This method is applicable to the situation not considering public transport interchange, because the buffer memory of the system association place of single line, and does not consider the association place of two or more pieces line combination.
Embodiment 3
Based on a location recommendation method for public transport line, it comprises the steps:
Under off-line state, first system is divided into some geographic areas each city, and then each geographic area is to finding the association place of all public traffic stations and sorting out point of interest according to predefined classification, such as dining room, supermarket, arenas, night shop, bar etc.For convenience of description, in description below, we claim the association place of these public traffic stations to be the association place of this geographic area.This step is more consuming time, but because be off-line operation, completes before online implementing, can not response time of requiring user of influential system.
Same under off-line state, all kinds of association places of each geographic area by data buffering systems such as Redis or MemoryCatche, are cached in the server memory of system by system; And in the process, can using the title of geographic area or No. ID key as buffer memory (Key), its association Website Hosting can using the data structures such as site object list (List) Hash table (Hash Table) or character string forms as the value (Value) of buffer memory.
The departure place that system is specified according to user, determines the geographic area belonging to it, and then the classification wherein meeting user and require also is taken out in direct its association place of retrieving from the buffer memory of internal memory; Finally, the association place in given all this geographic areas meeting user's requirement, and embodiment 1 is similar, system recommends user by a kind of existing recommendation sort algorithm a part the highest for rank.
The same with embodiment 1, namely this method is applicable to the situation not considering public transport interchange, is also applicable to the situation considering public transport interchange.But the selection of geographic area affects to some extent on the performance of recommending.Geographic area divides can not be too large, if geographic area division is too large, such as a city is as a geographic area, and wherein most of public traffic station user is difficult to arrive, and recommends just to lose meaning.