A method, device, electronic device and storage medium for recommending a location
By combining the click rate characteristics and travel habit characteristics, the destination prediction method is optimized, solving the problem of low prediction accuracy caused by the inability to consider user travel habits and low frequency in the existing technology, and achieving higher prediction accuracy.
Patent Information
- Application Number
- CN202011004220.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-09-22
- Publication Date
- 2024-10-18
- Estimated Expiration
- 2040-09-22
AI Technical Summary
Existing destination prediction methods cannot effectively consider the user's travel habits when estimating the user's travel destination, and when the user travels less frequently, the probability function prediction model cannot satisfy the modeling requirements, resulting in low prediction accuracy.
By obtaining the departure location and departure time of the target user, combined with the click rate characteristics and travel habit characteristics in historical orders, the location recommendation model is input to determine the probability of candidate locations, optimizing the interpretability of the results and improving the prediction accuracy.
It significantly improves the accuracy of destination prediction, can better reflect users' travel habits, and is suitable for situations where users travel less frequently.
Smart Images

Figure CN112182430B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of data processing technology, and in particular, to a method, device, electronic device, and storage medium for recommending a location. Background Art
[0002] Destination prediction means predicting the destination of a user's trip given the user's location and travel time. Destination prediction is widely used in many situations. For example, in a taxi-hailing scenario, when a user logs in to a taxi-hailing platform, the taxi-hailing platform predicts and recommends the user's travel destination, which can help the user to quickly hail a taxi, effectively improve the user's taxi-hailing experience, and bring more revenue to the platform.
[0003] In the related art, there are two main ways to predict the destination. Method 1: Use a click rate prediction model to predict the user's click rate for a limited number of candidate destinations, and then determine the destination with the highest click rate as the destination that the user is currently going to travel to. Method 2: Use a probability function prediction model to estimate the probability of the user traveling to each destination, and then determine the destination with the highest probability as the destination that the user is currently going to travel to.
[0004] However, both of the above methods have certain shortcomings. For method one, when making an estimate based on the click-through rate prediction model, since the model is a discriminant model, it directly models the conditional probability P(y|x) and does not care about the data distribution P(x, y), so the model cannot summarize the user's behavior habits. For example, the click-through rate prediction model can predict that the probability of user A traveling to M at 8 pm is the highest, but the model cannot extract the travel habits of user A traveling to M at 8 pm. For method two, the probability function estimation model models the user's destination level. If the frequency of the user's travel to the destination is low and cannot meet the model modeling, then the probability of the user's travel to the destination cannot be predicted. Therefore, this method has high requirements on the number of user orders. Summary of the invention
[0005] The embodiments of the present application provide a method, device, electronic device and storage medium for location recommendation, which can effectively improve the accuracy of destination prediction.
[0006] A first aspect of an embodiment of the present application provides a method for recommending a location, the method comprising:
[0007] Obtaining a recommended location acquisition request initiated by a target user terminal, wherein the recommended location acquisition request carries a departure location and a departure time of the target user terminal;
[0008] Determine a click rate feature according to the departure location and the departure time and the historical orders of the target user terminal, wherein the click rate feature at least includes the distance between the historical location in the historical orders of the target user terminal and the departure location, the historical common travel time and the travel frequency of the historical location;
[0009] Input the departure location and the departure time into the travel habit model of the target user terminal to determine a travel habit feature, wherein the travel habit feature represents the probability that the target user terminal travels with the departure time as the historical departure time and the departure location as the historical departure location;
[0010] The travel habit feature and the click rate feature are combined and input into a location recommendation model to obtain the probability corresponding to each of the multiple candidate locations;
[0011] Determine the location to be recommended according to the probabilities corresponding to the multiple candidate locations;
[0012] The location to be recommended is pushed to the target user terminal.
[0013] Optionally, the travel habit model of the target user terminal is obtained according to the following steps:
[0014] Based on the historical location, the multiple historical orders of the target user terminal are divided into multiple categories of historical orders, where each historical order in a category of historical orders corresponds to the same historical location;
[0015] For each type of historical order, a mixed Gaussian distribution curve of the historical location is fitted according to the number of times the target user terminal goes to the historical location corresponding to the historical order at each historical departure time, and the number of times the target user terminal goes to the historical location corresponding to the historical order from each historical departure location;
[0016] The mixed Gaussian distribution curves of multiple historical locations are fitted to obtain the travel habit model of the target user terminal.
[0017] Optionally, the location recommendation model is trained according to the following steps:
[0018] Taking each historical order of the sample user terminal as a sample order, determining the sample click rate feature of the sample user terminal according to the sample departure time and the sample departure location in the sample order and a plurality of historical orders before the sample order is generated;
[0019] Determining a sample travel habit model of the sample user terminal according to a plurality of historical orders of the sample user terminal;
[0020] Inputting the sample departure time and the sample departure location in the sample order of the sample user terminal into the travel habit model of the sample user terminal to determine the sample travel habit characteristics of the sample user terminal;
[0021] splicing the sample click rate features and sample travel habit features of the sample user terminals to obtain training samples;
[0022] The click rate prediction model is trained using a plurality of the training samples to obtain the location recommendation model.
[0023] Optionally, after obtaining the probabilities corresponding to the multiple candidate locations, the method further includes:
[0024] When a location input operation of the target user terminal is detected, the multiple candidate locations are sent to the target user terminal as candidate input locations in descending order of probability, so that the target user terminal displays the multiple candidate locations in sequence.
[0025] Optionally, after pushing the to-be-recommended location to the target user terminal, the method further includes:
[0026] Determine the drop-off point to be recommended based on the historical orders of the location to be recommended;
[0027] The recommended alighting point is pushed to the target user terminal and / or the driver terminal, and prompt information is sent to the target user terminal and / or the driver terminal to prompt the user of the target user terminal to alight at the recommended alighting point.
[0028] A second aspect of an embodiment of the present application provides a device for location recommendation, the device comprising:
[0029] An acquisition module, configured to acquire a recommended location acquisition request initiated by a target user terminal, wherein the recommended location acquisition request carries a departure location and a departure time of the target user terminal;
[0030] A first determination module is used to determine a click rate feature according to the departure location and the departure time and the historical orders of the target user terminal, wherein the click rate feature at least includes a distance between a historical location in the historical orders of the target user terminal and the departure location, a historical common travel time and a travel frequency of the historical location;
[0031] A first input module, configured to input the departure location and the departure time into a travel habit model of the target user terminal, and determine a travel habit feature, wherein the travel habit feature represents a probability that the target user terminal travels with the departure time as a historical departure time and the departure location as a historical departure location;
[0032] A second input module is used to splice the travel habit feature and the click rate feature and input them into a location recommendation model to obtain the probability corresponding to each of the multiple candidate locations;
[0033] A second determination module is used to determine the location to be recommended according to the probabilities corresponding to the multiple candidate locations;
[0034] The first push module is used to push the location to be recommended to the target user terminal.
[0035] Optionally, the device further comprises:
[0036] A division module, used to divide the multiple historical orders of the target user terminal into multiple categories of historical orders based on the historical location, where each historical order in a category corresponds to the same historical location;
[0037] A first fitting module is used to fit a mixed Gaussian distribution curve of each type of historical order according to the number of times the target user terminal goes to the historical location corresponding to the type of historical order at each historical departure time and the number of times the target user terminal goes to the historical location corresponding to the type of historical order from each historical departure location;
[0038] The second fitting module is used to fit the mixed Gaussian distribution curves of multiple historical locations to obtain the travel habit model of the target user terminal.
[0039] Optionally, the device further comprises:
[0040] A second determination module is used to take each historical order of the sample user terminal as a sample order, and determine the sample click rate characteristics of the sample user terminal according to the sample departure time and sample departure location in the sample order and multiple historical orders before the sample order is generated;
[0041] A third determination module, configured to determine a sample travel habit model of the sample user terminal according to a plurality of historical orders of the sample user terminal;
[0042] a fourth determination module, configured to input the sample departure time and the sample departure location in the sample order of the sample user terminal into the travel habit model of the sample user terminal to determine the sample travel habit characteristics of the sample user terminal;
[0043] A splicing module, used to splice the sample click rate features and sample travel habit features of the sample user terminals to obtain training samples;
[0044] The training module is used to train the click rate prediction model using a plurality of the training samples to obtain the location recommendation model.
[0045] Optionally, the device further comprises:
[0046] A sending module is used to, after obtaining the probabilities corresponding to each of the multiple candidate locations, send the multiple candidate locations as candidate input locations to the target user terminal in order of probability from high to low when a location input operation of the target user terminal is detected, so that the target user terminal displays the multiple candidate locations in sequence.
[0047] Optionally, the device further comprises:
[0048] A fifth determination module, configured to determine a get-off point to be recommended according to historical orders of the place to be recommended after the place to be recommended is pushed to the target user terminal;
[0049] The second push module is used to push the to-be-recommended alighting point to the target user terminal and / or the driver terminal after pushing the to-be-recommended location to the target user terminal, and send prompt information to the target user terminal and / or the driver terminal to prompt the user of the target user terminal to get off at the to-be-recommended alighting point.
[0050] A third aspect of an embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps in the method for location recommendation as described in the first aspect of the present application.
[0051] A fourth aspect of an embodiment of the present application provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executed, implements the steps in the location recommendation described in the first aspect of the present application.
[0052] According to the location recommendation method of the present application, a recommended location acquisition request initiated by a target user terminal is first obtained, and the recommended location acquisition request carries the departure location and departure time of the target user terminal. Then, according to the departure location and departure time and the historical orders of the target user terminal, a click rate feature is determined, and the click rate feature at least includes the distance between the historical location and the departure location in the historical orders of the target user terminal, the historical common travel time, and the travel frequency of the historical location. Then, the departure location and departure time are input into the travel habit model of the target user terminal to determine the travel habit feature, and the travel habit feature represents the probability that the target user terminal travels with the departure time as the historical departure time and the departure location as the historical departure location. Then, the travel habit feature and the click rate feature are spliced and input into the location recommendation model to obtain the corresponding probabilities of multiple candidate locations, and the location to be recommended is determined according to the corresponding probabilities of multiple candidate locations. Finally, the location to be recommended is pushed to the target user terminal. The method constructs the click rate feature and the travel habit feature at the same time, and obtains the most likely destination of the user through the two features. Since the probabilistic feature of travel habit is added, it can not only optimize the interpretability of the result, but also significantly improve the accuracy of destination prediction. BRIEF DESCRIPTION OF THE DRAWINGS
[0053] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the description of the embodiments of the present application will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0054] Figure 1 This is a schematic diagram of an implementation scenario shown in an embodiment of the present application;
[0055] Figure 2 is a flow chart of a method for location recommendation shown in an embodiment of the present application;
[0056] Figure 3 is a flow chart of a method for obtaining a travel habit model shown in an embodiment of the present application;
[0057] Figure 4 It is a departure time-travel probability distribution curve diagram shown in an embodiment of the present application;
[0058] Figure 5 It is a departure location-travel probability distribution surface diagram shown in an embodiment of the present application;
[0059] Figure 6 It is a departure time and departure location-travel probability distribution diagram shown in an embodiment of the present application;
[0060] Figure 7 is a flow chart of a method for obtaining a location recommendation model shown in an embodiment of the present application;
[0061] Figure 8 is a schematic diagram of an offline model training process shown in an embodiment of the present application;
[0062] Fig. 9 is a schematic diagram of an offline Gaussian model training process shown in an embodiment of the present application;
[0063] Fig.10 This is a schematic diagram of a LightGBM model training process shown in an embodiment of the present application;
[0064] Fig.11 is a schematic diagram of an online model prediction shown in an embodiment of the present application;
[0065] Fig.12 is a structural block diagram of a location recommendation device shown in an embodiment of the present application;
[0066] Fig.13 It is a schematic diagram of an electronic device shown in an embodiment of the present application. DETAILED DESCRIPTION
[0067] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0068] Figure 1 This is a schematic diagram of an implementation scenario shown in an embodiment of the present application. Figure 1 In the example, the destination prediction platform is connected to multiple user terminals (including user terminal 1-user terminal N) in communication. After receiving a recommended location acquisition request initiated by a user terminal, the destination prediction platform predicts the destination that the user terminal is about to travel to and sends the prediction result to the user terminal. For example, the destination prediction platform can be a taxi-hailing platform, and the user terminal can be the terminal used by the user who is about to take a taxi to log in to the taxi-hailing platform.
[0069] This application provides a method for location recommendation, which is applied to Figure 1 Destination prediction platform in . Figure 2 is a flow chart of a method for recommending a location according to an embodiment of the present application. Figure 2 The method recommended by the present application includes the following steps:
[0070] Step S11: obtaining a recommended location acquisition request initiated by a target user terminal, wherein the recommended location acquisition request carries a departure location and departure time of the target user terminal.
[0071] In this embodiment, when the user terminal detects that the user meets the preset location recommendation conditions, it sends a recommended location acquisition request to the destination prediction platform. There can be many location recommendation conditions, such as the user logging into the destination prediction platform, the user inputting specified characters, the user initiating a destination query, etc. The location recommendation conditions can be set according to actual needs, and this embodiment does not impose specific restrictions on the location recommendation conditions. One user corresponds to one user terminal.
[0072] The departure location refers to the longitude and latitude of the user terminal when the location recommendation condition is met, and the departure time refers to the time when the location recommendation condition is met.
[0073] Step S12: Determine click-through rate characteristics based on the departure location and the departure time as well as the historical orders of the target user terminal, wherein the click-through rate characteristics at least include the distance between the historical locations in the historical orders of the target user terminal and the departure location, the historical commonly used travel times, and the travel frequency of the historical locations.
[0074] In this embodiment, the user's historical orders are analyzed to obtain the user's historical travel records, including: historical departure places-historical destinations, travel times, arrival times, etc. After the destination prediction platform receives the recommended location acquisition request, it obtains the user's current departure place and departure time from the recommended location acquisition request. Then, the departure place, departure time and historical travel records are analyzed to obtain the user's click-through rate characteristics, including: the distance between the current departure place and each historical destination in the historical order, the commonly used historical travel times, the travel frequency of historical locations, etc. Of course, the click-through rate characteristics can also include many other types, which can be set according to actual needs, and this application does not limit this. Among them, the historical places in the historical orders are the historical destinations in the historical orders.
[0075] Step S13: Input the departure location and the departure time into the travel habit model of the target user terminal to determine travel habit characteristics, wherein the travel habit characteristics represent the probability that the target user terminal travels with the departure time as the historical departure time and the departure location as the historical departure location.
[0076] In this embodiment, the travel habit model is obtained by pre-training, and the departure location and departure time are input into the travel habit model to obtain travel habit features, wherein the travel habit features represent the probability of the user traveling from the departure location at the departure time.
[0077] Step S14: The travel habit feature and the click rate feature are combined and input into a location recommendation model to obtain the probabilities corresponding to the multiple candidate locations.
[0078] In this embodiment, the travel habit features and click rate features are input into the pre-trained location recommendation model, and the probability of traveling from the departure location to each candidate destination at the departure time can be output. When the travel habit features and click rate features are input into the location recommendation model, the travel habit features and the click rate features can be first spliced according to the preset splicing rules, and the splicing result can be used as the input of the model. The preset splicing rules can be set according to actual needs, and this embodiment does not impose specific restrictions on this.
[0079] The candidate destinations are all the historical destinations in the user's historical orders.
[0080] Step S15: Determine the location to be recommended according to the probabilities corresponding to the multiple candidate locations.
[0081] In this embodiment, after obtaining the probability of the user traveling from the departure point to each candidate destination at the departure time, the candidate destination with the highest probability can be used as the place to be recommended, indicating the destination to which the user is most likely to travel.
[0082] Step S16: Pushing the location to be recommended to the target user terminal.
[0083] In this embodiment, the recommended location is pushed to the target user terminal to facilitate the user's operation. For example, when the user wants to go to city X, city X is recommended to the user as a recommended location. The user can directly select the option and perform related operations without having to enter information such as "city X" again.
[0084] In this embodiment, the travel habit model can be obtained by training a probability model. The probability model can be, for example, a Markov model, a Gaussian model, a mixed Gaussian model, a Bayesian model, etc., and this embodiment does not specifically limit this. The user's travel habit characteristics, that is, the probability characteristics of the user traveling to the destination, can be obtained through the travel habit model.
[0085] For example, when user A wants to go to location Y at time X, he logs in to taxi platform Z through his mobile phone. Taxi platform Z detects that user A needs to take a taxi at this time, and sends a recommended location acquisition request to the background server. The background server obtains time X and location Y from the recommended location acquisition request, and then analyzes time X, location Y and user A's historical orders to obtain the probability of user A going to each historical destination in the historical orders, for example, location L-10%, location M-30%, location N-20%, and location Y-40%. Since location Y has the highest recommendation probability of 40%, taxi platform Z recommends location Y to user A to facilitate user operation.
[0086] According to the location recommendation method of this embodiment, a recommended location acquisition request initiated by a target user terminal is first obtained, and the recommended location acquisition request carries the departure location and departure time of the target user terminal. Then, according to the departure location and departure time and the historical orders of the target user terminal, a click rate feature is determined, and the click rate feature at least includes the distance between the historical location and the departure location in the historical orders of the target user terminal, the historical common travel time, and the travel frequency of the historical location. Then, the departure location and departure time are input into the travel habit model of the target user terminal to determine the travel habit feature, and the travel habit feature represents the probability that the target user terminal travels with the departure time as the historical departure time and the departure location as the historical departure location. Then, the travel habit feature and the click rate feature are spliced and input into the location recommendation model to obtain the corresponding probabilities of multiple candidate locations, and the location to be recommended is determined according to the corresponding probabilities of multiple candidate locations. Finally, the location to be recommended is pushed to the target user terminal. This method constructs the click rate feature and the travel habit feature at the same time, and obtains the most likely destination of the user through the two features. Since the probabilistic feature of travel habit is added, it can not only optimize the interpretability of the result, but also improve the accuracy of destination prediction.
[0087] In combination with the above embodiments, in one implementation, the present application also provides a method for obtaining a travel habit model. Figure 3 FIG. 1 is a flow chart of a method for obtaining a travel habit model according to an embodiment of the present application. Figure 3 , the travel habit model can be obtained by following the steps below:
[0088] Step S21: Based on the historical location as a dimension, the multiple historical orders of the target user terminal are divided into multiple categories of historical orders, and each historical order included in a category of historical orders corresponds to the same historical location.
[0089] In this embodiment, each user may generate multiple historical orders. By analyzing the historical orders, all historical travel destinations of each user within a certain period of time can be counted. Based on the historical destinations, each user's historical orders can be divided into multiple categories of historical orders.
[0090] In this embodiment, since the number of historical orders of each user is accumulated over time, when dividing the historical orders, the historical orders within a preset time period can be obtained first. The preset time period can be set according to actual needs, and this embodiment does not specifically limit this.
[0091] For example, user A has 30 historical orders in a preset time period, of which 10 orders have a historical destination of location 1, 5 orders have a historical destination of location 2, 3 orders have a historical destination of location 3, 2 orders have a historical destination of location 4, and 10 orders have a historical destination of location 5. Then, user A's historical orders in the preset time period can be divided into 5 categories, with the dimensions being location 1, location 2, location 3, location 4, and location 5. Among them, the number of historical orders corresponding to location 1 is 10, the number of historical orders corresponding to location 2 is 5, the number of historical orders corresponding to location 3 is 3, the number of historical orders corresponding to location 4 is 2, and the number of historical orders corresponding to location 4 is 10.
[0092] Step S22: For each type of historical order, a mixed Gaussian distribution curve of the historical location is fitted based on the number of times the target user terminal goes to the historical location corresponding to the historical order at each historical departure time, and the number of times the target user terminal goes from each historical departure location to the historical location corresponding to the historical order.
[0093] In this embodiment, the probability model may adopt a Gaussian model. Each user terminal may have multiple historical destinations, each historical destination may have multiple types of Gaussian distribution curves, and a mixed Gaussian model is a model composed of multiple groups of Gaussian distributions. The probability density function of the mixed Gaussian model is the linear superposition of the probability densities of multiple Gaussian distributions.
[0094] In this embodiment, each historical destination has at least the following three types of Gaussian distribution curves:
[0095] 1. Departure time-travel probability distribution curve
[0096] Figure 4 is a departure time-travel probability distribution curve diagram shown in an embodiment of the present application. Figure 4 In the figure, the horizontal axis represents the travel time of the day, and the vertical axis represents the travel probability corresponding to each travel time. Figure 4Two curves are shown in FIG. 1 . At the peak, the higher curve is a Gaussian distribution curve and the lower curve represents a mixed Gaussian distribution curve.
[0097] For each historical destination, by counting the departure times of multiple historical orders corresponding to it, we can obtain the number of times the user went to the historical destination at each historical departure time. Finally, the ratio of the number of trips corresponding to each historical departure time to the sum of the number of trips corresponding to all historical departure times is taken as the probability that the user travels to the historical destination at the departure time.
[0098] 2. Departure location-travel probability distribution surface
[0099] Figure 5 is a departure location-travel probability distribution surface diagram shown in an embodiment of the present application. Figure 5 In the figure, the horizontal plane is the latitude and longitude information of each departure point, and the coordinate values on the mesh plane perpendicular to the horizontal plane represent the travel probability corresponding to each departure point. For example, according to the departure point-travel probability distribution surface diagram, it can be known that when a user goes to place A, the probability of starting from the longitude and latitude (116.470932, 40.021655) is higher, and the probability of starting from the longitude and latitude (116.471055, 40.020734) is lower.
[0100] For each historical destination, by counting the departure locations of multiple historical orders corresponding to it, we can obtain the number of times the user went to the historical destination from each historical departure location. Finally, the ratio of the number of trips corresponding to each historical departure location to the sum of the number of trips corresponding to all historical departure locations is taken as the probability that the user travels from the departure location to the historical destination.
[0101] 3. Departure time and departure location - travel probability distribution map
[0102] Figure 6 This is a departure time and departure location-travel probability distribution diagram shown in an embodiment of the present application. Figure 6 In the diagram, since the probability distribution diagram is a 3D ellipsoid, for intuitive observation, this application uses a cross-sectional diagram to represent the probability distribution. The closer to the center of the sphere at longitude and latitude (116.470932, 40.021655, 9), the higher the probability value, and the farther away, the lower the probability value. For example, according to the departure time and departure location-travel probability distribution diagram, it can be known that when a user goes to place A, the probability of departing from (116.470932, 40.021655) at 9 am is higher.
[0103] For each historical destination, the historical departure time and historical departure location are considered as a whole. By counting the departure locations of multiple historical orders corresponding to it, the number of times the user went to the historical destination at each historical departure time and historical departure location can be obtained. Finally, the ratio of the number of trips corresponding to each historical departure time and historical departure location to the sum of the number of trips corresponding to all historical departure times and historical departure locations is taken as the probability that the user travels to the historical destination at the departure time and departure location.
[0104] Step S23: Fitting the mixed Gaussian distribution curves of multiple historical locations to obtain a travel habit model of the target user terminal.
[0105] In this embodiment, multiple mixed Gaussian distribution curves of each user are fitted to obtain a travel habit model for the user. When it is necessary to predict the user's current possible travel destination, it is only necessary to input the user's current latitude and longitude and the current time into the travel habit model corresponding to the user.
[0106] In this embodiment, the probability model may also adopt a Markov model, a mixed Gaussian model, a Bayesian model, etc., which will not be described in detail in this embodiment.
[0107] In this embodiment, using the Gaussian model as the probability model and obtaining the travel habit model based on the training has the following effects:
[0108] 1. The Gaussian model used is a generative model, which is a probability model related to the data distribution P(x,y), so the output result has good interpretability.
[0109] Second, the probability model can summarize the user's behavior habits based on the user's historical travel orders. Therefore, the travel habit model trained based on the probability model can more conveniently observe the user's travel habits for each destination.
[0110] 3. The probability value output by the travel habit model has a high accuracy, which makes the obtained travel habit characteristics have a high accuracy. Therefore, after the travel habit characteristics and click-through rate characteristics are input into the location recommendation model, a more accurate probability can be output, thereby improving the accuracy of predicting the recommended locations.
[0111] In combination with the above embodiments, in one implementation, the present application also provides a method for obtaining a location recommendation model. Figure 7 is a flow chart of a method for obtaining a location recommendation model according to an embodiment of the present application. Figure 7 , this application can take the following steps to obtain a location recommendation model:
[0112] Step S31: Taking each historical order of the sample user terminal as a sample order, according to the sample departure time and sample departure location in the sample order and multiple historical orders before the sample order is generated, determine the sample click rate characteristics of the sample user terminal.
[0113] In this embodiment, each user can generate multiple historical orders. The user who generates the historical orders is called a sample user, the terminal used by the sample user is called a sample user terminal, and the historical orders generated by the sample user are called sample orders. For each sample order of each user, the sample departure time, sample departure location and multiple historical orders before the sample order are generated in the sample order can be analyzed to obtain the click rate characteristics for the sample order.
[0114] For example, user A generates 10 orders within a preset time period (orders X1-X10 in order of generation time). If user A is taken as a sample user and the latest order X10 is taken as a sample order X10, the sample departure time, sample departure location, and historical orders before sample order X10 (i.e., orders X1-X9) in sample order X10 can be analyzed to obtain the click-through rate characteristics for sample order X10. Similarly, if order X9 is to be taken as a sample order X9, the sample departure time, sample departure location, and historical orders before sample order X9 (i.e., orders X1-X9) in sample order X9 can be analyzed to obtain the click-through rate characteristics for sample order X9.
[0115] Step S32: Determine a sample travel habit model of the sample user terminal according to a plurality of historical orders of the sample user terminal.
[0116] In this embodiment, each user (or sample user terminal) has a corresponding sample travel habit model. Therefore, the destination prediction platform can determine which sample travel habit model should be used to obtain the sample travel habit characteristics of the sample user based on the user corresponding to the historical orders.
[0117] Step S33: inputting the sample departure time and the sample departure location in the sample order of the sample user terminal into the travel habit model of the sample user terminal to determine the sample travel habit characteristics of the sample user terminal.
[0118] In this embodiment, when training the location recommendation model, not only the click rate feature is needed, but also the travel habit feature is needed. Therefore, the sample departure time and sample departure location in the sample order need to be input into the travel habit model corresponding to the sample user to determine the sample travel habit feature of the sample user.
[0119] For example, following the embodiment in step S31 above, when order X10 is the sample order of sample user A, the sample departure time and sample departure location of sample order X10 can be input into the travel habit model corresponding to sample user A to obtain the travel habit features of sample user A for sample order X10. Similarly, when order X9 is the sample order of sample user A, the sample departure time and sample departure location of sample order X9 can be input into the travel habit model corresponding to sample user A to obtain the travel habit features of sample user A for sample order X9.
[0120] Step S34: concatenate the sample click rate features and sample travel habit features of the sample user terminals to obtain training samples.
[0121] In this embodiment, the sample travel habit feature and the sample click rate feature can be firstly spliced according to the preset splicing rule, and the splicing result can be used as the input of the model. Among them, the splicing rule can be a direct splicing of vectors, for example, the travel habit feature is an M-dimensional vector, and the sample click rate feature is an N-dimensional vector, and the splicing results in an M+N-dimensional vector. The preset splicing rule can be set according to actual needs, and this embodiment does not impose specific restrictions on this.
[0122] For example, following the embodiment in the above step S31 and step S33, the click rate feature of the sample order X10 and the travel habit feature of the sample order X10 can be spliced to obtain a training sample, and the click rate feature of the sample order X9 and the travel habit feature of the sample order X9 can be spliced to obtain another training sample. According to a similar principle, multiple training samples can be obtained.
[0123] Step S35: using the plurality of training samples to train the click rate prediction model to obtain the location recommendation model.
[0124] In this embodiment, after obtaining multiple training samples, the click rate prediction model can be trained using the multiple training samples to obtain a location recommendation model. The click rate prediction model can use traditional machine learning models such as Logistic Model (LogisticRegression), XGBoost Model (Extreme Gradient Boosting), LightGBM (Light Gradient Boosting Machine), or deep learning models such as DNN (Deep Neural Networks), Wide&Deep, DIN (Deep Interest Network), etc., and this embodiment does not impose specific restrictions on this.
[0125] In this embodiment, the destination prediction task is modeled as counting the click rate characteristics and travel habit characteristics of each destination among a limited number of candidate destinations based on historical travel orders, and then the click rate characteristics and travel habit characteristics are used to predict the probability of users clicking on each candidate destination through a click rate prediction model.
[0126] In this embodiment, when performing destination prediction, not only the commonly used click-through rate prediction features are constructed, but also the probability function features output by the probability model are spliced, and then the spliced features are used as the input of the click-through rate prediction model to finally predict the probability of the user traveling to each destination. If a candidate destination does not have a probability function due to the scarcity of orders, the probability function features are filled with zero values. In this way, the characteristic of the click-through rate prediction model that requires few orders is fully utilized, and for the prediction of destinations with sufficient order frequency, additional probability function features are added, which not only optimizes the interpretability of the results, but also improves the accuracy of destination prediction.
[0127] In combination with the above embodiments, in one implementation, the present application further provides an application scenario of the predicted probabilities of each candidate location. Specifically, after obtaining the probabilities corresponding to each of the multiple candidate locations, the method of the present application further includes:
[0128] When a location input operation of the target user terminal is detected, the multiple candidate locations are sent to the target user terminal as candidate input locations in descending order of probability, so that the target user terminal displays the multiple candidate locations in sequence.
[0129] In this embodiment, after the destination prediction platform predicts the probability of the target user traveling to each candidate location, if the target user triggers a location input operation on the target user terminal, the destination prediction platform sends multiple candidate locations as candidate input locations to the target user terminal in order of probability from high to low for the target user to select.
[0130] In this embodiment, candidate locations are recommended to the user based on the predicted probabilities, so that the user can select a location to be input from a plurality of recommended candidate locations according to actual needs, thereby effectively enhancing the user's experience.
[0131] In combination with the above embodiments, in one implementation, the present application also provides another application scenario of the predicted probability of each candidate location. Specifically, after pushing the location to be recommended to the target user terminal, the method of the present application further includes:
[0132] Determine the drop-off point to be recommended based on the historical orders of the location to be recommended;
[0133] The recommended alighting point is pushed to the target user terminal and / or the driver terminal, and prompt information is sent to the target user terminal and / or the driver terminal to prompt the user of the target user terminal to alight at the recommended alighting point.
[0134] This embodiment provides a method for using the predicted recommended location in a taxi-hailing scenario. After the recommended location is pushed to the target user terminal, if the user selects the recommended location as the destination, the destination prediction platform can also send the recommended alighting point to the target user terminal and / or the driver terminal, and send prompt information to the target user terminal and / or the driver terminal to prompt the user of the target user terminal to get off at the recommended alighting point, thereby preventing the target user from missing the alighting point, and effectively improving the user's experience.
[0135] The location recommendation method of the present application will be described in detail with a specific embodiment below.
[0136] In this embodiment, a Gaussian model is used as a probability model, and a LightGBM model is used as a click rate prediction model. The whole process includes: offline model training and online model prediction.
[0137] 1. Offline model training
[0138] Offline model training includes offline Gaussian model training and LightGBM model training, such as Figure 8 shown. Figure 8 Schematic diagram of an offline model training process shown in an embodiment of the present application. Figure 8 In the process, the mixed Gaussian model is first trained using historical orders, and then the trained mixed Gaussian model is stored in the mixed Gaussian model library. Then, the LightGBM model is trained based on the historical orders and the output values of the mixed Gaussian model to obtain the LightGBM model.
[0139] 1. Offline Gaussian model training
[0140] Fig. 9 Schematic diagram of an offline Gaussian model training process shown in an embodiment of the present application. Fig. 9 , the following steps can be used for offline Gaussian model training:
[0141] Step 1: Cluster the user's historical orders according to the user dimension and the destination dimension, and classify all historical orders of the same user and the same destination into one category. For example, for user 1, orders to destination A can be classified into one category, namely "User 1, destination A", orders to destination B can be classified into one category, namely "User 1, destination B", and orders to destination C can be classified into one category, namely "User 1, destination C".
[0142] Step 2: Use the departure time and departure location information of all historical orders in a category to fit a mixed Gaussian model of the destination. For example, based on the historical orders in "User 1, destination A", the mixed Gaussian model "User 1, destination A mixed Gaussian model" is fitted; based on the historical orders in "User 1, destination B", the mixed Gaussian model "User 1, destination B mixed Gaussian model" is fitted; based on the historical orders in "User 1, destination C", the mixed Gaussian model "User 1, destination C mixed Gaussian model" is fitted.
[0143] Step 3: Store the trained Gaussian mixture models of all users persistently in the model database.
[0144] 2. LightGBM model training
[0145] Fig.10 This is a schematic diagram of a LightGBM model training process shown in an embodiment of the present application. Fig.10 , the following steps can be used to train the LightGBM model:
[0146] Step 1: Use the user's historical orders to generate click-through rate features, that is, use historical orders to generate CTR feature training data.
[0147] Step 2: Use the user's historical orders to query the user's mixed Gaussian model, add the output value of the probability function to each historical order as a probability feature, that is, use the historical order query mixed Gaussian model to generate probability feature training data.
[0148] Step 3: Combine the click rate feature and the probability feature to obtain the training data of the LightGBM model.
[0149] Step 4: Use the merged training data to train the LightGBM model to obtain the LightGBM model.
[0150] 2. Online Model Prediction
[0151] Fig.11 is a schematic diagram of an online model prediction shown in an embodiment of the present application. Fig.11 , the following steps can be used for online model prediction:
[0152] Step 1: Upon receiving the destination prediction request from the target user, obtain the requested time t and longitude and latitude information.
[0153] Step 2: Obtain all Gaussian mixture models of the target user.
[0154] Step 3: Use the mixed Gaussian model to estimate the probability of the destination and obtain the probability characteristics. For example, "destination A, probability characteristics" is obtained through "destination A, mixed Gaussian model", "destination B, probability characteristics" is obtained through "destination B, mixed Gaussian model", and "destination C, probability characteristics" is obtained through "destination C, mixed Gaussian model".
[0155] Step 4: Construct click rate features according to time t and longitude and latitude information, for example, construct "destination A, CTR feature", "destination B, CTR feature" and "destination C, CTR feature".
[0156] Step 5: Combine the probability feature and the click-through rate feature, and use the LightGBM model to predict the destination travel probability. For example, you can predict "destination A, travel probability", "destination B, travel probability", and "destination C, travel probability".
[0157] Step 6: Take the destination with the highest probability as the destination prediction result.
[0158] In this embodiment, the probability function selects to use the Gaussian mixture model (GMM, Gaussian mixture model) output model. The Gaussian mixture model is a model composed of multiple groups of Gaussian distributions, each Gaussian distribution is called a component, and the peak of each user's travel can be described by one or more components. The probability density function of the Gaussian mixture model is the linear superposition of the probability densities of multiple Gaussian distributions, so it can better fit the multi-peak situation. The Gaussian mixture model is a smooth and continuous curve, so there is no critical transition in the recommendation result. Moreover, by setting the number of hyperparameter components, it can degenerate into a unimodal Gaussian distribution when the user's order history is small.
[0159] This embodiment adds the feature of the historical order fitting mixed Gaussian model in the scenario of solving the destination click rate prediction through the LightGBM model. Since the mixed Gaussian model has the advantage of being able to fit the multi-peak travel habits of users and can depict the diverse travel habits of users for a certain destination, it increases the interpretability of the model prediction results, improves the accuracy of the destination prediction scenario, and alleviates the requirement for the number of orders simply using the probability function to estimate. Even if there is no probability function for the destination, LightGBM can still make a reasonable travel probability estimate for the destination and improve the recall rate of the destination prediction scenario.
[0160] Based on the same inventive concept, an embodiment of the present application provides a location recommendation device 1200. Fig.12 , Fig.12 FIG. 1 is a structural block diagram of a location recommendation device shown in an embodiment of the present application. Fig.12 As shown, the device 1200 recommended for this location includes:
[0161] The obtaining module 1201 is used to obtain a recommended location obtaining request initiated by a target user terminal, wherein the recommended location obtaining request carries a departure location and a departure time of the target user terminal;
[0162] A first determining module 1202 is used to determine a click rate feature according to the departure location and the departure time and the historical orders of the target user terminal, wherein the click rate feature at least includes a distance between a historical location in the historical orders of the target user terminal and the departure location, a historical common travel time, and a travel frequency of the historical location;
[0163] A first input module 1203 is used to input the departure location and the departure time into the travel habit model of the target user terminal to determine a travel habit feature, wherein the travel habit feature represents the probability that the target user terminal travels with the departure time as the historical departure time and the departure location as the historical departure location;
[0164] The second input module 1204 is used to combine the travel habit feature and the click rate feature and input them into a location recommendation model to obtain the probability corresponding to each of the multiple candidate locations;
[0165] The second determination module 1205 is used to determine the location to be recommended according to the probabilities corresponding to the multiple candidate locations;
[0166] The first push module 1206 is used to push the to-be-recommended location to the target user terminal.
[0167] Optionally, the device 1200 further includes:
[0168] A division module, used to divide the multiple historical orders of the target user terminal into multiple categories of historical orders based on the historical location, where each historical order in a category corresponds to the same historical location;
[0169] A first fitting module is used to fit a mixed Gaussian distribution curve of each type of historical order according to the number of times the target user terminal goes to the historical location corresponding to the type of historical order at each historical departure time and the number of times the target user terminal goes to the historical location corresponding to the type of historical order from each historical departure location;
[0170] The second fitting module is used to fit the mixed Gaussian distribution curves of multiple historical locations to obtain the travel habit model of the target user terminal.
[0171] Optionally, the device 1200 further includes:
[0172] A second determination module is used to take each historical order of the sample user terminal as a sample order, and determine the sample click rate characteristics of the sample user terminal according to the sample departure time and sample departure location in the sample order and multiple historical orders before the sample order is generated;
[0173] A third determination module, configured to determine a sample travel habit model of the sample user terminal according to a plurality of historical orders of the sample user terminal;
[0174] a fourth determination module, configured to input the sample departure time and the sample departure location in the sample order of the sample user terminal into the travel habit model of the sample user terminal to determine the sample travel habit characteristics of the sample user terminal;
[0175] A splicing module, used to splice the sample click rate features and sample travel habit features of the sample user terminals to obtain training samples;
[0176] The training module is used to train the click rate prediction model using a plurality of the training samples to obtain the location recommendation model.
[0177] Optionally, the device 1200 further includes:
[0178] A sending module is used to, after obtaining the probabilities corresponding to each of the multiple candidate locations, send the multiple candidate locations as candidate input locations to the target user terminal in order of probability from high to low when a location input operation of the target user terminal is detected, so that the target user terminal displays the multiple candidate locations in sequence.
[0179] Optionally, the device 1200 further includes:
[0180] A fifth determination module, configured to determine a get-off point to be recommended according to historical orders of the place to be recommended after the place to be recommended is pushed to the target user terminal;
[0181] The second push module is used to push the to-be-recommended alighting point to the target user terminal and / or the driver terminal after pushing the to-be-recommended location to the target user terminal, and send prompt information to the target user terminal and / or the driver terminal to prompt the user of the target user terminal to get off at the to-be-recommended alighting point.
[0182] Based on the same inventive concept, another embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps in the location recommendation method as described in any of the above embodiments of the present application.
[0183] Based on the same inventive concept, another embodiment of the present application provides an electronic device 1300, such as Fig.13 shown. Fig.13 1 is a schematic diagram of an electronic device shown in an embodiment of the present application. The electronic device includes a memory 1302, a processor 1301, and a computer program stored in the memory and executable on the processor, and when executed by the processor, the steps in the location recommendation method described in any of the above embodiments of the present application are implemented.
[0184] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0185] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.
[0186] Those skilled in the art will appreciate that the embodiments of the present application can be provided as methods, devices, or computer program products. Therefore, the present application can adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application can adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0187] The embodiments of the present application are described with reference to the flowcharts and / or block diagrams of the methods, terminal devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing terminal device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0188] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing terminal device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0189] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device so that a series of operating steps are executed on the computer or other programmable terminal device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable terminal device to implement the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0190] Although the preferred embodiments of the present application have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the embodiments of the present application.
[0191] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or terminal device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or terminal device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or terminal device including the elements.
[0192] The above is a detailed introduction to a method, device, electronic device and storage medium for location recommendation provided by the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea; at the same time, for general technical personnel in this field, according to the idea of the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.
Claims
1. A method for location recommendation, characterized in that: The method comprises: Obtaining a recommended location acquisition request initiated by a target user terminal, wherein the recommended location acquisition request carries a departure location and a departure time of the target user terminal; Determine a click rate feature according to the departure location and the departure time and the historical orders of the target user terminal, wherein the click rate feature at least includes the distance between the historical location in the historical orders of the target user terminal and the departure location, the historical common travel time and the travel frequency of the historical location; Input the departure location and the departure time into the travel habit model of the target user terminal to determine a travel habit feature, wherein the travel habit feature represents the probability that the target user terminal travels with the departure time as the historical departure time and the departure location as the historical departure location; The travel habit feature and the click rate feature are combined and input into a location recommendation model to obtain the probability corresponding to each of the multiple candidate locations; Determine the location to be recommended according to the probabilities corresponding to the multiple candidate locations; Pushing the location to be recommended to the target user terminal; The travel habit model of the target user terminal is obtained according to the following steps: Based on the historical location, the multiple historical orders of the target user terminal are divided into multiple categories of historical orders, where each historical order in a category of historical orders corresponds to the same historical location; For each type of historical order, a mixed Gaussian distribution curve of the historical location is fitted according to the number of times the target user terminal goes to the historical location corresponding to the historical order at each historical departure time, and the number of times the target user terminal goes to the historical location corresponding to the historical order from each historical departure location; Fitting mixed Gaussian distribution curves of multiple historical locations to obtain a travel habit model of the target user terminal; Each historical destination has at least three types of Gaussian distribution curves, the departure time-travel probability distribution curve, the departure location-travel probability distribution surface, and the departure time and departure location-travel probability distribution graph.
2. The method according to claim 1, characterized in that The location recommendation model is trained according to the following steps: Taking each historical order of the sample user terminal as a sample order, determining the sample click rate feature of the sample user terminal according to the sample departure time and the sample departure location in the sample order and a plurality of historical orders before the sample order is generated; Determining a sample travel habit model of the sample user terminal according to a plurality of historical orders of the sample user terminal; Inputting the sample departure time and the sample departure location in the sample order of the sample user terminal into the travel habit model of the sample user terminal to determine the sample travel habit characteristics of the sample user terminal; splicing the sample click rate features and sample travel habit features of each of the sample user terminals to obtain a training sample; The click rate prediction model is trained using a plurality of the training samples to obtain the location recommendation model.
3. The method according to any one of claims 1 to 2, characterized in that: After obtaining the probabilities corresponding to the plurality of candidate locations, the method further includes: When a location input operation of the target user terminal is detected, the multiple candidate locations are sent to the target user terminal as candidate input locations in descending order of probability, so that the target user terminal displays the multiple candidate locations in sequence.
4. The method according to any one of claims 1 to 2, characterized in that: After pushing the location to be recommended to the target user terminal, the method further includes: Determine the drop-off point to be recommended based on the historical orders of the location to be recommended; The recommended alighting point is pushed to the target user terminal and / or the driver terminal, and prompt information is sent to the target user terminal and / or the driver terminal to prompt the user of the target user terminal to alight at the recommended alighting point.
5. A device for recommending a location, characterized in that: The device comprises: An acquisition module, configured to acquire a recommended location acquisition request initiated by a target user terminal, wherein the recommended location acquisition request carries a departure location and a departure time of the target user terminal; A first determination module is used to determine a click rate feature according to the departure location and the departure time and the historical orders of the target user terminal, wherein the click rate feature at least includes a distance between a historical location in the historical orders of the target user terminal and the departure location, a historical common travel time and a travel frequency of the historical location; A first input module, configured to input the departure location and the departure time into a travel habit model of the target user terminal, and determine a travel habit feature, wherein the travel habit feature represents a probability that the target user terminal travels with the departure time as a historical departure time and the departure location as a historical departure location; A second input module is used to splice the travel habit feature and the click rate feature and input them into a location recommendation model to obtain the probability corresponding to each of the multiple candidate locations; A second determination module is used to determine the location to be recommended according to the probabilities corresponding to the multiple candidate locations; A first push module, used for pushing the location to be recommended to the target user terminal; The travel habit model of the target user terminal is obtained according to the following steps: Based on the historical location, the multiple historical orders of the target user terminal are divided into multiple categories of historical orders, and each historical order in a category of historical orders corresponds to the same historical location; For each type of historical order, a mixed Gaussian distribution curve of the historical location is fitted according to the number of times the target user terminal goes to the historical location corresponding to the historical order at each historical departure time, and the number of times the target user terminal goes to the historical location corresponding to the historical order from each historical departure location; Fitting mixed Gaussian distribution curves of multiple historical locations to obtain a travel habit model of the target user terminal; Each historical destination has at least three types of Gaussian distribution curves, the departure time-travel probability distribution curve, the departure location-travel probability distribution surface, and the departure time and departure location-travel probability distribution graph.
6. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the steps in the location recommendation method according to any one of claims 1 to 4 are implemented.
7. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When executed, the processor implements the steps in the location recommendation method according to any one of claims 1 to 4.
Citation Information
Patent Citations
Trip destination recommending device and method
CN107402931A
Destination pushing method and device
CN110020216A
