Itinerary matching method and system
By performing multiple screening and filtering of candidate trips, the similarity and path degree are calculated using the departure time, fence range, straight line distance and inclination angle, the problem of inefficient travel matching on the hitchhiking platform is solved, and efficient and accurate travel matching is achieved.
Patent Information
- Application Number
- CN202210103533.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-01-27
- Publication Date
- 2025-01-17
- Estimated Expiration
- 2042-01-27
AI Technical Summary
The prior art is difficult to achieve accurate and efficient travel matching on the hitchhiking platform, resulting in low matching efficiency and insufficient accuracy.
By performing multiple filtering of candidate trips, including calculating similarity and path-by-path based on departure time, fence range, straight line distance and inclination angle, a list of recommended candidate trips is generated to improve matching efficiency and accuracy.
It achieves the accuracy and efficiency of itinerary matching, ensures high efficiency in matching candidate itineraries, and reduces path planning costs.
Smart Images

Figure CN114493010B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of itinerary planning, and in particular to an itinerary matching method and system. Background Art
[0002] Hitchhiking is a mutual assistance behavior between passengers and car owners, and is increasingly favored by office workers for commuting. First, passengers can enjoy the ride experience with less money; second, car owners do not aim to make money, but can get a certain amount of money as compensation for each order; further, the promotion of hitchhiking can reduce traffic congestion, improve road traffic efficiency, and reduce pollution. Therefore, it is very important to build an accurate and efficient online hitchhiking platform through the integration of mutual assistance and the Internet. Summary of the invention
[0003] In view of this, the present invention provides an itinerary matching method and system, which can ensure accuracy and improve matching efficiency by screening and filtering candidate itineraries multiple times.
[0004] In a first aspect, the present invention provides a trip matching method, comprising:
[0005] Generate a first candidate itinerary list according to the itinerary to be matched;
[0006] Filtering the first candidate itinerary list according to the similarity between the to-be-matched itinerary and each candidate itinerary in the first candidate itinerary to obtain a second candidate itinerary list;
[0007] At least one recommended candidate itinerary is obtained by screening according to the to-be-matched itinerary and the convenience of each candidate itinerary in the second candidate itinerary list.
[0008] The step of generating a first candidate itinerary list according to the itinerary to be matched includes:
[0009] Get multiple candidate trips;
[0010] The candidate itineraries are filtered according to the departure time and / or fence range to obtain a first candidate itinerary list.
[0011] Among them, the candidate trips are screened according to the fence range, including:
[0012] A fence is drawn with the starting point and / or end point of the to-be-matched trip as the center and the trip matching fence range as the radius, and candidate trips within the fence are screened out to form a first candidate list.
[0013] The filtering of the first candidate itinerary list according to the similarity between the to-be-matched itinerary and the first candidate itinerary includes:
[0014] Calculating the straight-line distance between the to-be-matched trip and each candidate trip in the first candidate trip list;
[0015] Calculating the similarity between the to-be-matched trip and each candidate trip in the first candidate trip list according to the straight-line distance;
[0016] The candidate itineraries whose similarity with the to-be-matched itinerary is greater than or equal to a similarity threshold are screened to form a second candidate itinerary list.
[0017] The formula for calculating the direct distance between the to-be-matched trip and each candidate trip in the first candidate trip list is:
[0018] dist s (1,2)=r*arcos[cos(lat_s_1)*cos(lat_s_2)*cos(lng_s_1-lng_s_2)+sin(lat_s_1)*sin(lat_s_2)]
[0019] In the formula, dist s (1,2) is the straight-line distance between the starting point of the trip to be matched and the starting point of the candidate trip; r is the radius of the earth, which is 6371 km; lat_s_1 is the latitude of the starting point of the trip to be matched; lat_s_2 is the latitude of the starting point of the candidate trip; lng_s_1 is the longitude of the starting point of the trip to be matched; lng_s_2 is the longitude of the starting point of the candidate trip.
[0020] The formula for calculating the similarity between the to-be-matched trip and each candidate trip in the first candidate trip list according to the straight-line distance is:
[0021]
[0022] Where sim(1,2) is the similarity between the trip to be matched and the candidate trip; dist e (1,2) is the straight-line distance between the end point of the trip to be matched and the end point of the candidate trip; α is the straight-line distance coefficient of the starting point, β is the straight-line distance coefficient of the end point, θ is the inclination angle difference coefficient, α+β+θ=1; base_s_d is the starting point distance base; base_e_d is the end point distance base; base_k is the inclination angle difference base; k1 is the inclination angle of the trip to be matched; k2 is the inclination angle of the candidate trip.
[0023] The step of obtaining at least one recommended candidate itinerary based on the convenience of the to-be-matched itinerary and each candidate itinerary in the second candidate itinerary list includes:
[0024] A first planned distance and a first planned time obtained according to the to-be-matched itinerary;
[0025] The starting point and the end point of the candidate trip are the first intermediate point and the second intermediate point respectively, and a second planned distance and a second planned time are obtained according to a path formed by the starting point, the first intermediate point, the second intermediate point and the end point of the trip to be matched;
[0026] Obtaining the degree of convenience between the to-be-matched itinerary and the candidate itinerary according to the first planned distance, the first planned time, the second planned distance, the second planned time and the similarity;
[0027] The candidate trips are sorted according to the degree of convenience to obtain at least one recommended candidate trip.
[0028] The formula for obtaining the convenience between the to-be-matched trip and the candidate trip according to the first planned distance, the first planned time, the second planned distance, the second planned time and the similarity is:
[0029]
[0030] Where rate(1,2) is the degree of convenience between the to-be-matched trip and the candidate trip; planning_dist is the first planned distance; planning_dist(1,2) is the second planned distance; planning_time is the first planned time; planning_time(1,2) is the second planned time; x is the planned distance difference coefficient, y is the planned time difference coefficient, z is the similarity coefficient, x+y+z=1; base_d is the distance difference base, and base_t is the time difference base.
[0031] Before generating the first candidate itinerary list according to the itinerary to be matched, the method further includes:
[0032] The corresponding tilt angle is calculated according to the latitude and longitude of the starting and ending points of the to-be-matched trip and / or the candidate trip, and the formula is:
[0033]
[0034] Where k is the inclination angle; lat_e is the latitude of the end point; lat_s is the latitude of the starting point; lng_e is the longitude of the end point; lng_s is the longitude of the starting point.
[0035] In a second aspect, the present invention further provides a trip matching system, including a map calculation module, a path planning module and a trip matching interface;
[0036] The itinerary matching interface is used to generate a first candidate itinerary list according to the itinerary to be matched;
[0037] The map calculation module is used to filter the first candidate itinerary list according to the similarity between the to-be-matched itinerary and each candidate itinerary in the first candidate itinerary to obtain a second candidate itinerary list;
[0038] The route planning module is used to filter and obtain at least one recommended candidate itinerary according to the to-be-matched itinerary and the convenience of each candidate itinerary in the second candidate itinerary list.
[0039] In summary, the present invention provides a trip matching method and system, the method comprising: generating a first candidate trip list according to the trip to be matched; filtering the first candidate trip list according to the similarity between the trip to be matched and each candidate trip in the first candidate trip to obtain a second candidate trip list; and recommending a candidate trip according to the convenience between the trip to be matched and each candidate trip in the second candidate trip list. The present invention can ensure accuracy and improve matching efficiency by performing multiple screening and filtering on the candidate trips.
[0040] The above description is only an overview of the technical solution of the present invention. In order to more clearly understand the technical means of the present invention, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the present invention more obvious and easy to understand, the following specifically cites a preferred embodiment and describes it in detail with the accompanying drawings as follows. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] Figure 1 A schematic diagram of a flow chart of a trip matching method according to an embodiment of the present invention;
[0042] Figure 2 A schematic diagram of a specific flow chart of a trip matching method according to an embodiment of the present invention;
[0043] Figure 3 A schematic diagram of a map road network of a fence range according to an embodiment of the present invention;
[0044] Figure 4 A schematic diagram of a map road network showing an inclination angle according to an embodiment of the present invention;
[0045] Figure 5 A schematic diagram of a map road network for itinerary planning according to an embodiment of the present invention;
[0046] Figure 6 A schematic diagram of a process flow of a pre-processing step according to an embodiment of the present invention;
[0047] Figure 7 FIG. 4 is a schematic diagram of the architecture of a trip matching system according to an embodiment of the present invention. DETAILED DESCRIPTION
[0048] In order to further explain the technical means and effects adopted by the present invention to achieve the predetermined invention purpose, the present invention is described in detail below in conjunction with the accompanying drawings and preferred embodiments.
[0049] First embodiment
[0050] Figure 1 FIG. 1 is a flow chart of a trip matching method according to an embodiment of the present invention. Figure 1 As shown, an embodiment of the present invention provides a trip matching method, including:
[0051] Step 201: Generate a first candidate itinerary list according to the itinerary to be matched;
[0052] Step 202: Filter the first candidate itinerary list according to the similarity between the to-be-matched itinerary and each candidate itinerary in the first candidate itinerary to obtain a second candidate itinerary list;
[0053] Step 203: Filter and obtain at least one recommended candidate itinerary based on the to-be-matched itinerary and the convenience of each candidate itinerary in the second candidate itinerary list.
[0054] In this embodiment, the passenger or the car owner uses the itinerary published by himself as the itinerary to be matched and calls the itinerary matching interface in the itinerary matching engine to match the passenger itinerary with the car owner's itinerary list, and the car owner's itinerary with the passenger's itinerary list.
[0055] In one embodiment, generating a first candidate itinerary list according to the itinerary to be matched includes:
[0056] Get candidate itineraries;
[0057] The candidate itineraries are filtered according to the departure time and / or fence range to obtain a first candidate itinerary list.
[0058] Please refer to Figure 2 First, all the candidate trips in progress are preliminarily filtered to obtain the first candidate trip. The filtering conditions can be the departure time and / or the fence range. When filtering the candidate trips by departure time, if the creator of the trip to be matched is a passenger, the trips that match the departure time of the trip to be matched are filtered from the pre-processed trips in the owner's trip pool as the candidate trip list candidate_route_list, and the candidate list stores the route_id of the candidate trip; if the creator of the trip to be matched is the owner, the departure time is filtered from the passenger trip pool to generate the candidate trip list candidate_route_list.
[0059] It can be understood that the departure time matching referred to in this embodiment means that the time difference between the departure time of the to-be-matched trip and the departure time of the candidate trip is within a preset time range, and the preset time range can be set by the system by default or by the user. For example, when the preset time range is 1 hour, if the departure time of the to-be-matched trip is 8:00 and the departure time of the candidate trip is 9:00, the candidate trip can be added to the first candidate trip list.
[0060] In one implementation, screening candidate trips according to fence ranges includes:
[0061] A fence is drawn with the starting point and / or end point of the to-be-matched trip as the center and the trip matching fence range as the radius, and candidate trips within the fence are screened out to form a first candidate list.
[0062] Please refer to Figure 3 , when screening candidate trips according to the fence range, first read the trip matching fence range R, which can be set by the system default or by the user, for example, 1 to 3 kilometers. The starting longitude and latitude of all trips in the candidate list candidate_route_list fall into the map road network, and the starting point of the trip to be matched also falls into the road network. With the starting point of the trip to be matched as the center and the trip matching fence range R as the radius, a fence is drawn using map calculation, and the trips in the list are filtered out of the fence to obtain the starting point candidate list start_candidate_route_list. The end longitude and latitude of all trips in the candidate list candidate_route_list fall into the map road network, and the end point of the trip to be matched also falls into the road network. With the end point of the trip to be matched as the center and the trip matching fence range R as the radius, a fence is drawn using map calculation, and the trips in the list are filtered out of the fence to obtain the end point candidate list end_candidate_route_list. The union of start_candidate_route_list and end_candidate_route_list is obtained to obtain a new candidate list candidate_route_list.
[0063] In one embodiment, filtering the first candidate itinerary list according to the similarity between the to-be-matched itinerary and the first candidate itinerary includes:
[0064] Calculate the straight-line distance between the to-be-matched trip and each candidate trip in the first candidate trip list;
[0065] Calculate the similarity between the to-be-matched trip and each candidate trip in the first candidate trip list according to the straight-line distance;
[0066] The candidate trips whose similarity with the trip to be matched is greater than or equal to the similarity threshold are screened to form a second candidate trip list.
[0067] In one embodiment, the formula for calculating the direct distance between the to-be-matched trip and each candidate trip in the first candidate trip list is:
[0068] dist s (1,2)=r*arcos[cos(lat_s_1)*cos(lat_s_2)*cos(lng_s_1-lng_s_2)
[0069] +sin(lat_s_1)*sin(lat_s_2)]
[0070] In the formula, dist s (1,2) is the straight-line distance between the starting point of the trip to be matched and the starting point of the candidate trip; r is the radius of the earth, which is 6371 km; lat_s_1 is the latitude of the starting point of the trip to be matched; lat_s_2 is the latitude of the starting point of the candidate trip; lng_s_1 is the longitude of the starting point of the trip to be matched; lng_s_2 is the longitude of the starting point of the candidate trip.
[0071] In one embodiment, the formula for calculating the similarity between the to-be-matched trip and each candidate trip in the first candidate trip list according to the straight-line distance is:
[0072]
[0073] Where sim(1,2) is the similarity between the trip to be matched and the candidate trip; dist e (1,2) is the straight-line distance between the end point of the trip to be matched and the end point of the candidate trip; α is the straight-line distance coefficient of the starting point, β is the straight-line distance coefficient of the end point, θ is the inclination angle difference coefficient, α+β+θ=1; base_s_d is the starting point distance base; base_e_d is the end point distance base; base_k is the inclination angle difference base; k1 is the inclination angle of the trip to be matched; k2 is the inclination angle of the candidate trip.
[0074] In this embodiment, the similarity between the trips in the candidate trip list and the trip to be matched is calculated. First, the data table data is retrieved from the cache according to the route_id of the trip to be matched. A trip number route_id is taken from the candidate list, and the trip data is retrieved from the cache according to the route_id. The data content is shown in the following table:
[0075] Passenger itinerary data table
[0076] Trip Number Departure Time Starting point longitude Starting point latitude End point longitude End point latitude Tilt Angle route_id start_time lng_s lat_s lng_e lat_e k
[0077] Owner trip data table
[0078]
[0079] Please refer to Figure 4 , establish an x-axis parallel to the latitude and a y-axis parallel to the longitude, and the inclination angle of the to-be-matched itinerary is the angle between the line connecting the starting point and the end point of the to-be-matched itinerary and the x-axis. Before generating the first candidate itinerary list according to the to-be-matched itinerary, it also includes:
[0080] The corresponding tilt angle is calculated according to the latitude and longitude of the starting and ending points of the to-be-matched trip and / or the candidate trip, and the formula is:
[0081]
[0082] Where k is the inclination angle; lat_e is the latitude of the end point; lat_s is the latitude of the starting point; lng_e is the longitude of the end point; lng_s is the longitude of the starting point.
[0083] Assume that the trip to be matched is trip 1 and the candidate trip is trip 2. The latitude and longitude of the starting points of the two trips, lat_s and lng_s, are used to call the map calculation module to calculate the straight-line distance between the two starting points, which is recorded as dist s (1,2), similarly calculate the straight-line distance between the two end points and record it as dist e (1,2).
[0084] Next, take out the configuration for similarity calculation from the configuration center, and respectively substitute the inclination angle and straight-line distance of the to-be-matched trip and the candidate trip into the similarity calculation formula to calculate the similarity of the two trips. The specific formula is as follows:
[0085]
[0086] It should be noted that α is the coefficient of the straight-line distance from the starting point, β is the coefficient of the straight-line distance from the end point, and θ is the coefficient of the tilt angle difference. α+β+θ=1. The coefficient represents the weight of each item. If you want to give more weight to the tilt angle, you can increase the weight of θ. base_s_d is the base of the starting distance, base_e_d is the base of the end distance, and base_k is the base of the tilt angle difference. The base is the maximum value calculated for each item. For example, if base_s_d=3km, it means that if the starting distance is exactly 3km, then this item If the distance is less than 3 km, the item is positive, which can increase the similarity value. If it is greater than 3 km, the item is negative, which can lower the similarity value. For example: Assume that α, β, and θ are 0.3, 0.3, and 0.4 respectively, base_s_d is 4 km, base_e_d is 5 km, and base_k is 40 degrees. If the calculated dist s (1,2)=1km,dist e (1,2) = 1km, the inclination angle k1 of trip 1 is 130 degrees, and the inclination angle k2 of trip 2 is 140 degrees.
[0087] Calculate the similarity between all candidate trips in the first candidate list and the trip to be matched, and filter out the trips with low similarity according to the similarity threshold. Specifically, read the similarity threshold sim_t from the dynamic configuration table, filter out all trips where sim(route_id1,route_id2) < sim_t, and obtain a new candidate trip list candidate_route_list as the second candidate trip list. Then, store the similarity between all candidate trips in the second candidate list and the trip to be matched in the cache, with route_id1:route_id2 as the key and the value of sim(route_id1,route_id2) as the value.
[0088] In one embodiment, screening at least one recommended candidate trip according to the degree of going the same way between the trip to be matched and each candidate trip in the second candidate trip list includes:
[0089] The first planned distance and the first planned time obtained according to the trip to be matched;
[0090] Taking the starting point and the ending point of the candidate trip as the first intermediate point and the second intermediate point respectively, and obtaining the second planned distance and the second planned time according to the path formed by the starting point of the trip to be matched, the first intermediate point, the second intermediate point, and the ending point of the trip to be matched;
[0091] Obtain the degree of going the same way between the trip to be matched and the candidate trip according to the first planned distance, the first planned time, the second planned distance, the second planned time, and the similarity;
[0092] Sort the candidate trips according to the degree of going the same way to obtain at least one recommended candidate trip.
[0093] In one embodiment, the formula for obtaining the degree of going the same way between the trip to be matched and the candidate trip according to the first planned distance, the first planned time, the second planned distance, the second planned time, and the similarity is:
[0094]
[0095] In the formula, rate(1,2) is the degree of going the same way between the trip to be matched and the candidate trip; planning_dist is the first planned distance; planning_dist(1,2) is the second planned distance; planning_time is the first planned time; planning_time(1,2) is the second planned time; x is the planned distance difference coefficient, y is the planned time difference coefficient, z is the similarity coefficient, and x + y + z = 1; base_d is the distance difference base number, and base_t is the time difference base number.
[0096] In this embodiment, when the car owner's itinerary to be matched is calculated with the passenger's candidate itinerary, the data table data is taken out from the cache according to the route_id1 of the car owner's itinerary, and the longitude and latitude of the starting and ending points, the path planning distance planning_dist, and the path planning time planning_time are taken out. A trip number route_id2 is taken out from the second candidate list, and the corresponding trip similarity sim(route_id1,route_id2) is taken out from the cache according to the key value of route_id1:route_id2, and the data table is taken out from the cache according to route_id1 to obtain the longitude and latitude of the starting / ending points.
[0097] Please refer to Figure 5 , taking the starting and ending points of the owner's trip route_id1 as the starting and ending points, and the starting and ending points of the candidate trip route_id2 as the middle points, call the map service provider to plan the entire route, and obtain the entire planned distance planning_dist(route_id1, route_id2), and the entire planned time planning_time(route_id1, route_id2). Substitute the above planning time and similarity into the formula to calculate the degree of convenience, and calculate the degree of convenience of all candidate trips in the second candidate list with the trip to be matched. It should be noted that in the similarity formula, 1 represents route1 and 2 represents route2; x is the planned distance difference coefficient, y is the planned time difference coefficient, and z is the similarity coefficient, x+y+z=1, which can be adjusted dynamically. If the distance difference needs to have a greater impact on the convenience, the value of x can be increased; base_d is the distance difference base, and base_t is the time difference base, which is consistent with the meaning of the base in the similarity calculation. The formula can be explained as follows: if the difference between the planned distance of the entire journey and the planned distance of the driver is smaller, the degree of convenience is greater; if the difference between the planned time of the entire journey and the planned time of the driver is smaller, the degree of convenience is greater; if the similarity between the two trips is greater, the degree of convenience is greater.
[0098] When calculating the convenience of the passenger's to-be-matched trip and the driver's candidate trip, take out the data table data from the cache according to the route_id1 of the passenger's trip, and take out the latitude and longitude of the start / end point. Take out a driver's trip route_id2 from the second candidate list, take out the latitude and longitude of the start and end point and the planning distance planning_dist and planning time planning_time from the cache according to route_id2, and take out the similarity sim(route_id1,route_id2) from the cache according to route_id1:route_id2. Then calculate the convenience of all candidate trips in the second candidate list and the to-be-matched trip.
[0099] All the trips in the candidate list are sorted from largest to smallest according to their convenience, and the candidate trip with the highest convenience or the top few candidate trips are recommended to the user.
[0100] In one embodiment, before screening candidate trips, a pre-processing step of the trip data is also included. Figure 6 , the car owner and the passenger publish their trips and enter the pending trip module in their respective trip pools. Set up scheduled tasks to pre-process passenger trips and car owner trips respectively.
[0101] Specifically, firstly, take out the unprocessed trips in the passenger trip pool. Call the map calculation module to bring the starting and ending longitudes and latitudes of each trip into the inclination angle calculation formula to calculate the trip inclination angle k. Fill the passenger trip related information into the passenger trip data table, and store it in the cache with the trip code route_id as the key and the data table data as the value. Store the passenger trip data table data in the database for persistent storage.
[0102] When the scheduled task preprocesses the owner's itinerary, in addition to the preprocessing steps consistent with the passenger itinerary, it is also necessary to pass the latitude and longitude of the starting and ending points of the owner's itinerary to the itinerary matching engine path planning module, call the map service provider's path planning service, and obtain the planned distance planning_dist and planned time planning_time of the itinerary. Then fill the owner's itinerary related data into the owner's itinerary data table, and use the itinerary code route_id as the key and the data table data as the value to store it in the cache, and store the owner's itinerary data table in the database for persistent storage.
[0103] Next, the preprocessed trips are moved from the non-preprocessed module in the trip pool to the preprocessed module. The scheduled task repeats the above preprocessing steps at a certain time interval to timely process the non-preprocessed trips in the trip pool.
[0104] The itinerary matching method of the embodiment of the present invention includes: generating a first candidate itinerary list according to the itinerary to be matched; filtering the first candidate itinerary list according to the similarity between the itinerary to be matched and each candidate itinerary in the first candidate itinerary to obtain a second candidate itinerary list; and recommending a candidate itinerary according to the degree of convenience between the itinerary to be matched and each candidate itinerary in the second candidate itinerary list. The present invention can ensure accuracy and improve matching efficiency by performing multiple screening and filtering on the candidate itinerary.
[0105] Second embodiment
[0106] The embodiment of the present invention also provides a trip matching system, including a map calculation module, a path planning module and a trip matching interface;
[0107] A trip matching interface, used to generate a first candidate trip list according to the trip to be matched;
[0108] A map calculation module, used for filtering the first candidate itinerary list according to the similarity between the to-be-matched itinerary and each candidate itinerary in the first candidate itinerary, to obtain a second candidate itinerary list;
[0109] The route planning module is used to filter and obtain at least one recommended candidate itinerary according to the to-be-matched itinerary and the convenience of each candidate itinerary in the second candidate itinerary list.
[0110] Please refer to Figure 7 ,The itinerary matching system specifically includes the following modules:
[0111] 1. User side:
[0112] The user end consists of APP, mini program, H5, and vehicle terminal. Passengers can publish and match itineraries on APP, mini program, and H5. Car owners can publish and match itineraries not only on APP, mini program, and H5, but also on the vehicle terminal of the car owner.
[0113] 2. Itinerary pool:
[0114] It is divided into passenger trip pool and car owner trip pool. The trips posted by passengers go into the passenger trip pool, and the trips posted by car owners go into the car owner trip pool. Each trip pool is divided into two areas, one for unprocessed trips and the other for preprocessed trips.
[0115] 3. Trip matching engine:
[0116] It includes map calculation module, path planning module, dynamic configuration module, scheduled task module and itinerary matching interface;
[0117] The map calculation module calculates the straight-line distance, trip inclination angle, etc. according to the latitude and longitude of the starting and ending points of the trip;
[0118] The route planning module function calls the route planning capability of the map service provider to obtain the actual planned distance and time of the trip;
[0119] The function of the dynamic configuration module is to centrally manage the coefficients, thresholds and other configurations in the itinerary matching process and can dynamically modify them according to operational needs to improve the accuracy of itinerary matching;
[0120] The function of the scheduled task module is to pre-process the itineraries in the itinerary pool and put the processed results into the cache to improve the efficiency of itinerary matching;
[0121] The itinerary matching interface is a general interface provided to the user side for itinerary matching.
[0122] 4. Cache module:
[0123] It is used to store the result data after preprocessing by the scheduled task, which can greatly improve the efficiency of the itinerary matching calculation.
[0124] 5. Database persistence module:
[0125] Used to persist itinerary-related information and ensure the security of user itinerary data.
[0126] The embodiments of the present invention have the following beneficial effects:
[0127] First, we designed a new itinerary matching architecture by combining the advantages of high map computing efficiency and high path planning accuracy;
[0128] Second, using scheduled tasks to pre-process the itinerary greatly reduces the amount of calculation during itinerary matching and improves efficiency. At the same time, using cache to store itinerary data can further improve calculation efficiency.
[0129] Third, by filtering by fences and similarity calculations, a candidate list with a high degree of match is obtained, eliminating the need to perform path planning calculations on all trips, thus reducing path planning costs and improving efficiency.
[0130] Fourthly, similarity calculation formulas and on-the-way calculation formulas were designed, and the coefficients and cardins of the formulas can be adjusted through dynamic configuration, which improves the accuracy of itinerary matching. At the same time, with the accumulation of historical itinerary data, big data algorithms can be used to train the coefficients and cardins to further improve the accuracy.
[0131] An embodiment of the present invention also provides a terminal, comprising at least one processor; and at least one memory, wherein the at least one memory is coupled to the at least one processor and stores instructions for execution by the at least one processor, and when the instructions are executed by the at least one processor, the system executes the itinerary matching method as described above.
[0132] The specific process of executing the above method steps in this embodiment is detailed in the relevant description of the above embodiment, which will not be repeated here.
[0133] An embodiment of the present invention further provides a readable storage medium, on which computer program instructions are stored; when the computer program instructions are executed by a processor, the above-mentioned itinerary matching method is implemented.
[0134] The specific process of executing the above method steps in this embodiment is detailed in the relevant description of the above embodiment, which will not be repeated here.
[0135] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0136] In this document, the terms "comprises," "comprising," or any other variations thereof, are intended to cover a non-exclusive inclusion of elements other than those listed and may also include additional elements not expressly listed.
[0137] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.
Claims
1. A trip matching method, characterized in that: include: Generate a first candidate itinerary list according to the itinerary to be matched; Filtering the first candidate itinerary list according to the similarity between the to-be-matched itinerary and each candidate itinerary in the first candidate itinerary to obtain a second candidate itinerary list; At least one recommended candidate itinerary is obtained by screening the to-be-matched itinerary and the convenience of each candidate itinerary in the second candidate itinerary list; The filtering the first candidate itinerary list according to the similarity between the to-be-matched itinerary and the first candidate itinerary includes: Calculating the straight-line distance between the to-be-matched trip and each candidate trip in the first candidate trip list; Calculate the similarity between the to-be-matched trip and each candidate trip in the first candidate trip list according to the straight-line distance, wherein the similarity is determined based on the straight-line distance between the starting point and the ending point of the to-be-matched trip and the inclination angle between the first candidate trip and the first candidate trip, wherein the inclination angle is the angle between the line connecting the starting point and the ending point of the target trip and the straight line where the latitude is located; Select candidate trips whose similarity with the trip to be matched is greater than or equal to a similarity threshold to form a second candidate trip list; The step of obtaining at least one recommended candidate itinerary based on the convenience of the to-be-matched itinerary and each candidate itinerary in the second candidate itinerary list includes: A first planned distance and a first planned time obtained according to the to-be-matched itinerary; The starting point and the end point of the candidate trip are the first intermediate point and the second intermediate point respectively, and a second planned distance and a second planned time are obtained according to a path formed by the starting point, the first intermediate point, the second intermediate point and the end point of the trip to be matched; Obtaining the degree of convenience between the to-be-matched itinerary and the candidate itinerary according to the first planned distance, the first planned time, the second planned distance, the second planned time and the similarity; The candidate trips are sorted according to the degree of convenience to obtain at least one recommended candidate trip.
2. The itinerary matching method according to claim 1, characterized in that: The step of generating a first candidate itinerary list according to the itinerary to be matched includes: Get candidate itineraries; The candidate itineraries are filtered according to the departure time and / or fence range to obtain a first candidate itinerary list.
3. The itinerary matching method according to claim 2, characterized in that: The candidate trips are filtered according to the fence range, including: A fence is drawn with the starting point and / or end point of the to-be-matched trip as the center and the trip matching fence range as the radius, and candidate trips within the fence are screened out to form a first candidate list.
4. The itinerary matching method according to claim 1, characterized in that: The formula for calculating the straight-line distance between the to-be-matched trip and each candidate trip in the first candidate trip list is: dist s (1,2)=r*arcos[cos(lat_s_1)*cos(lat_s_2)*cos(lng_s_1-lng_s_2) +sin(lat_s_1)*sin(lat_s_2)] In the formula, dist s (1,2) is the straight-line distance between the starting point of the trip to be matched and the starting point of the candidate trip; r is the radius of the earth, which is 6371 km; lat_s_1 is the latitude of the starting point of the trip to be matched; lat_s_2 is the latitude of the starting point of the candidate trip; lng_s_1 is the longitude of the starting point of the trip to be matched; lng_s_2 is the longitude of the starting point of the candidate trip.
5. The itinerary matching method according to claim 1 or 4, characterized in that: The formula for calculating the similarity between the to-be-matched trip and each candidate trip in the first candidate trip list according to the straight-line distance is: Where sim(1,2) is the similarity between the trip to be matched and the candidate trip; dist e (1,2) is the straight-line distance between the end point of the trip to be matched and the end point of the candidate trip; α is the straight-line distance coefficient of the starting point, β is the straight-line distance coefficient of the end point, θ is the inclination angle difference coefficient, α+β+θ=1; base_s_d is the starting point distance base; base_e_d is the end point distance base; base_k is the inclination angle difference base; k1 is the inclination angle of the trip to be matched; k2 is the inclination angle of the candidate trip.
6. The itinerary matching method according to claim 1, characterized in that: The formula for obtaining the degree of convenience between the to-be-matched trip and the candidate trip according to the first planned distance, the first planned time, the second planned distance, the second planned time and the similarity is: Where rate(1,2) is the convenience between the to-be-matched trip and the candidate trip; planning_dist is the first planning distance; planning_dist(1,2) is the second planning distance; planning_time is the first planning time; planning_time(1,2) is the second planning time; x is the planned distance difference coefficient, y is the planned time difference coefficient, z is the similarity coefficient, x+y+z=1; base_d is the distance difference base, and base_t is the time difference base.
7. The itinerary matching method according to claim 1, characterized in that: Before generating the first candidate itinerary list according to the itinerary to be matched, the method further includes: The corresponding tilt angle is calculated according to the latitude and longitude of the starting and ending points of the to-be-matched trip and / or the candidate trip, and the formula is: Where k is the inclination angle; lat_e is the latitude of the end point; lat_s is the latitude of the starting point; lng_e is the longitude of the end point; lng_s is the longitude of the starting point.
8. A trip matching system, characterized in that: Includes map calculation module, path planning module and itinerary matching interface; The itinerary matching interface is used to generate a first candidate itinerary list according to the itinerary to be matched; The map calculation module is used to filter the first candidate itinerary list according to the similarity between the to-be-matched itinerary and each candidate itinerary in the first candidate itinerary to obtain a second candidate itinerary list; The route planning module is used to filter and obtain at least one recommended candidate itinerary according to the to-be-matched itinerary and the convenience of each candidate itinerary in the second candidate itinerary list; The filtering the first candidate itinerary list according to the similarity between the to-be-matched itinerary and the first candidate itinerary includes: Calculating the straight-line distance between the to-be-matched trip and each candidate trip in the first candidate trip list; Calculate the similarity between the to-be-matched trip and each candidate trip in the first candidate trip list according to the straight-line distance, wherein the similarity is determined based on the straight-line distance between the starting point and the ending point of the to-be-matched trip and the inclination angle between the first candidate trip and the first candidate trip, wherein the inclination angle is the angle between the line connecting the starting point and the ending point of the target trip and the straight line where the latitude is located; Select candidate trips whose similarity with the trip to be matched is greater than or equal to a similarity threshold to form a second candidate trip list; The step of obtaining at least one recommended candidate itinerary based on the convenience of the to-be-matched itinerary and each candidate itinerary in the second candidate itinerary list includes: A first planned distance and a first planned time obtained according to the to-be-matched itinerary; The starting point and the end point of the candidate trip are the first intermediate point and the second intermediate point respectively, and a second planned distance and a second planned time are obtained according to a path formed by the starting point, the first intermediate point, the second intermediate point and the end point of the trip to be matched; Obtaining the degree of convenience between the to-be-matched itinerary and the candidate itinerary according to the first planned distance, the first planned time, the second planned distance, the second planned time and the similarity; The candidate trips are sorted according to the degree of convenience to obtain at least one recommended candidate trip.
Citation Information
Patent Citations
Car-hailing information display method, device, system and equipment
CN109993329A