Summary of the invention
The object of this invention is to provide a kind of corresponding speed fast, save the place recommend method based on public transport line of system resources in computation.
For achieving the above object, the present invention is by the following technical solutions:
A place recommend method for public transport line, it comprises the steps:
1., under off-line state, system, for each public traffic station, is looked for all public transport lines through this website, then in geographical data bank, finds all points of interest along every common line, and point of interest is sorted out; Described point of interest is also referred to as the associated place of this public traffic station; Or under off-line state, system, for each common line, finds this common line all points of interest along the line, and point of interest is sorted out in geographical data bank; Described point of interest is also referred to as the associated place of this public bus network; Or under off-line state, system, for each geographic area, first finds all bus stations in this region, then finds the associated point of interest in these bus stations in database in the ground, and point of interest is sorted out; Described point of interest is also referred to as the associated place of this geographic area;
2., equally under off-line state, system by each public traffic station or every public bus network or each geographic area all kinds of associated place be cached in the server memory of system;
3., system is screened associated place according to the departure place of user's appointment, if system cache is the associated place of bus station, system is by near public traffic station traversal so, for each traffic website, system is directly retrieved its associated place and is taken out the classification that wherein meets customer requirements from the buffer memory of internal memory; If system cache is the associated place of public bus network, near system traversal, there is so the public transport line of website, then from the buffer memory of internal memory, retrieve its associated place and take out the classification that wherein meets customer requirements; If buffer memory is the associated place of geographic area, system is directly searched the geographic area under it according to the departure place of user's appointment so, and from the buffer memory of internal memory, retrieves its associated place and take out the classification that wherein meets customer requirements; Finally, given all associated places that meet customer requirements, system sends to user the associated place that meets most customer requirements.
Described step 2. in, by public traffic station, or public bus network, or the title of geographic area or No. ID key as buffer memory, the value that its associated stations point set cooperation is buffer memory.
Described step 3. in, utilize bayesian algorithm in the associated place of all user appointed place periphery public traffic stations that meet customer requirements or in all associated places of the public bus network through user appointed place that meet customer requirements or in the associated place of public bus network of all geographic areas, user place that meet customer requirements, calculate the associated place that meets customer requirements most.
Adopt the present invention of technique scheme, do not need too complicated computation process, thereby reaction velocity is fast, can within the short time of trying one's best, find a most suitable public bus network of user, has improved service quality.
Embodiment
Embodiment 1
A place recommend 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 common line, and system sorts 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 the associated place that these points of interest are this public traffic station.This step is more consuming time, but because be off-line operation, before online implementing, completes, and can not affect the response time of system to customer requirements.
2., equally under off-line state, system by data buffering systems such as Redis or MemoryCatche, is cached to all kinds of associated place of each public traffic station in the server memory of system; And in this process, can be using the title of public traffic station or No. ID key as buffer memory (Key), its associated Website Hosting can be usingd certain data structure or the character string forms value (Value) as buffer memory.Above-mentioned data structure can be site object list (List) as Hash table (Hash Table), may be also other data structure that is difficult to enumerate.
3., system is according to the departure place of user's appointment, near public traffic station traversal; For each traffic website, system is directly retrieved its associated place and is taken out the classification that wherein meets customer requirements from the buffer memory of internal memory; Finally, given all associated places that meets the user appointed place periphery public traffic station of customer requirements, system is utilized certain existing recommendation sort algorithm, if bayesian algorithm is in the associated place of all user appointed place periphery public traffic stations that meet customer requirements, calculates the associated place that meets customer requirements most and issue user.In bayesian algorithm, to favorable comment degree, discount/preferential dynamics, bid ranking etc. are comprehensive, analyze, the part that rank is the highest is recommended to user.
As shown in Figure 1, shown in the situation that not considering transfer for station, “Wu Jian building, a specific bus station ", how system is calculated its associated website and is recommended.
First, the calculating of system needs a Bus information database to be used for inquiring about website, line information.In addition, system also needs a geographic information database to be used for inquiring about near the point of interest of certain specified sites.
Suppose that system at most can only recommended distance user be specified the place in three stations, departure place and the place that requires to recommend is no more than 200 meters from the distance of get-off stop, for station, Wu Jian building, system is the public bus network through this website by Bus information data base querying first.He12 road, Liao723 road bus is recorded through this station in tentation data storehouse, all websites (solid black circle) that are no more than three stations apart from station, Wu Jian building that system will traversal 723 He12 road, road bus processes so, and in geographic information database, find near all points of interest (in the peripheral annular section of website) in 200 meters it.These points of interest are exactly the associated place at station, Wu Jian building.Other website for each, system is found its associated place and is buffered in internal memory by caching system by similar computation process.The data structure storage of list object can be used in associated place.The structure of the list object in an associated place as shown in Figure 2.This example has been shown two associated places in list (KFC dining room and the Starbucks coffee Room).
Suppose user Xiao Wang to require system recommendation some convenient made bus from family and go to the restaurant of having a dinner, system first by Bus information data base querying from Xiao Wang family's distance the bus station in 200.Suppose that station, Wu Jian building is unique bus station of 200 meters that is no more than apart from Xiao Wang family, system will recall the associated place that station, buffer memory Nei Wujian building all categories is restaurant and sort according to the rank rule of appointment.
The rank rule of supposing an appointment is to carry out rank according to user's favorable comment degree, and system is recommended user by the highest N that user in these restaurants is marked.
Rank rule can be considered a plurality of factors simultaneously, as user evaluates, and discount dynamics, hygienic conditions, distance is far and near etc.The rank rule of considering a plurality of factors can be expressed as one according to the place points-scoring system of many factors.Last rank depends on the scoring in place in the situation of considering many factors.
Shown as shown in Figure 3 in the situation that considering once transfer for station, “Wu Jian building, a specific bus station ", how system is calculated its associated website and is recommended.The same with the requirement of embodiment 1, the calculating of system needs a Bus information database to be used for inquiring about website, line information.In addition, system also needs a geographic information database to be used for inquiring about near the point of interest of certain specified sites.
Suppose that system at most can only recommended distance user be specified the place in three stations, departure place and the place that requires to recommend is no more than 200 meters from the distance of get-off stop, for station, Wu Jian building, system is the public bus network through this website by Bus information data base querying first.He12 road, Liao723 road bus is recorded through this station in tentation data storehouse, all websites (solid black circle) that are no more than three stations apart from station, Wu Jian building that system will traversal 723 He12 road, road bus processes so, and in geographic information database, find near all points of interest (in the peripheral annular section of website) in 200 meters it.In addition, system is also inquired about these other public bus network of all these websites of process, such as 973 road as shown in the figure (through the website Fang Zhuanqiao station on 723 tunnels), and travel through all websites (solid black circle) that are no more than three stations apart from station, Wu Jian building in these road public bus networks, then in geographic information database, find near all points of interest (in the peripheral annular section of website) in 200 meters it.All these points of interest that find are exactly to consider the once associated place at the station, situation Xia Wujian building of transfer.Other website for each, system is found its associated place and is buffered in internal memory by caching system by similar computation process.
Embodiment 2
A place recommend method for public transport line, it comprises the steps:
Under off-line state, system finds its all points of interest along the line (Point Of Interest) for each common 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 the associated place that these points of interest are this public bus network.This step is more consuming time, but because be off-line operation, before online implementing, completes, and can not affect the response time of system to customer requirements.
Under off-line state, system by data buffering systems such as Redis or MemoryCatche, is cached to all kinds of associated place of each public traffic station in the server memory of system equally; And in this process, can be using the title of public transport line or No. ID key as buffer memory (Key), its associated Website Hosting can be usingd the data structures such as site object list (List) Hash table (Hash Table) or the character string forms value (Value) as buffer memory.
System is according to the departure place of user's appointment, and traversal has the public transport line of website nearby; For every public bus network, system is directly retrieved its associated place and is taken out the classification that wherein meets customer requirements from the buffer memory of internal memory; Finally, given all associated places that meet the user appointed place periphery public traffic station of customer requirements, and embodiment 1 is similar, system is recommended user by a kind of general recommendation sort algorithm the highest part of rank.
This method is applicable to not consider the situation of public transport interchange because the buffer memory of system the associated place of single line, and do not consider the associated place of two or more pieces line combination.
Embodiment 3
A place recommend 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 associated place of all bus stations and according to predefined classification, point of interest being sorted out, such as dining room, supermarket, arenas, night shop, bar etc.For convenience of description, in description below, we claim the associated place of the Wei Gai geographic area, associated place of these bus stations.This step is more consuming time, but because be off-line operation, before online implementing, completes, and can not affect the response time of system to customer requirements.
Under off-line state, system by data buffering systems such as Redis or MemoryCatche, is cached to all kinds of associated place of each geographic area in the server memory of system equally; And in this process, can be using the title of geographic area or No. ID key as buffer memory (Key), its associated Website Hosting can be usingd the data structures such as site object list (List) Hash table (Hash Table) or the character string forms value (Value) as buffer memory.
System, according to the departure place of user's appointment, is determined the geographic area that it is affiliated, then directly from the buffer memory of internal memory, retrieves its associated place and takes out the classification that wherein meets customer requirements; Finally, the associated place in given all these geographic areas that meet customer requirements, and embodiment 1 is similar, system is recommended user by a kind of existing recommendation sort algorithm the highest part of rank.
The same with embodiment 1, this method is applicable to not consider the situation of public transport interchange, is also applicable to consider the situation of public transport interchange.But the selection of geographic area affects to some extent on the performance of recommending.Geographic area is divided can not be too large, if geographic area division is too large, such as a city is as a geographic area, wherein most of bus station user is difficult to arrive, and recommends just to have lost meaning.