CN109918567A - Trip mode recommended method and device - Google Patents

Trip mode recommended method and device Download PDF

Info

Publication number
CN109918567A
CN109918567A CN201910163898.7A CN201910163898A CN109918567A CN 109918567 A CN109918567 A CN 109918567A CN 201910163898 A CN201910163898 A CN 201910163898A CN 109918567 A CN109918567 A CN 109918567A
Authority
CN
China
Prior art keywords
node
trip mode
trip
user
terminus
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201910163898.7A
Other languages
Chinese (zh)
Other versions
CN109918567B (en
Inventor
刘浩
胡仁君
熊辉
李婷
傅衍杰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Baidu Online Network Technology Beijing Co Ltd
Beijing Baidu Netcom Science and Technology Co Ltd
Original Assignee
Beijing Baidu Netcom Science and Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Baidu Netcom Science and Technology Co Ltd filed Critical Beijing Baidu Netcom Science and Technology Co Ltd
Priority to CN201910163898.7A priority Critical patent/CN109918567B/en
Publication of CN109918567A publication Critical patent/CN109918567A/en
Application granted granted Critical
Publication of CN109918567B publication Critical patent/CN109918567B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The present invention proposes a kind of trip mode recommended method and device, and wherein method includes: to obtain history trip data;According to history trip data, structure figures incorporation model;It include: user node, terminus node and trip mode node in figure incorporation model;User node, terminus node are connect with trip mode node by side respectively, and the weight on side is the frequency that user node or terminus node select trip mode node;According to the initial token vector of each node and the weight on each side, objective optimization function is constructed;The initial token vector of each node is adjusted, until objective function is less than preset threshold;Trip mode recommendation is carried out according to vector is characterized after the adjustment of each node, wherein, it characterizes after vector is adjusted according to history trip data and obtains after the adjustment of each node, with history trip data than more consistent, so as to the trip preference of Efficient Characterization user and terminus, improves trip mode and recommend accuracy and recommend efficiency.

Description

Trip mode recommended method and device
Technical field
The present invention relates to Internet technical field more particularly to a kind of trip mode recommended method and devices.
Background technique
There are mainly two types of current multi-modal trip mode proposed algorithms, and one is manually formulated according to history trip experience Recommendation rules, such as rainy day do not recommend cycling etc., it is difficult in view of the trip preference of each user and terminus;Another kind is knot The conjunction time, weather, terminus distance, user uses trip mode ratio in history, is carried out using Multiple regression model etc. Trip mode recommend, however in this method trip mode ratio come indicate user go on a journey preference be it is inaccurate, cause recommend Trip mode is not necessarily the trip mode that user wants, and recommends accuracy and recommends inefficient.
Summary of the invention
The present invention is directed to solve at least some of the technical problems in related technologies.
For this purpose, the first purpose of this invention is to propose a kind of trip mode recommended method, for solving the prior art Middle trip mode recommends accuracy and recommends inefficient problem.
Second object of the present invention is to propose a kind of trip mode recommendation apparatus.
Third object of the present invention is to propose another trip mode recommendation apparatus.
Fourth object of the present invention is to propose a kind of non-transitorycomputer readable storage medium.
5th purpose of the invention is to propose a kind of computer program product.
In order to achieve the above object, first aspect present invention embodiment proposes a kind of trip mode recommended method, comprising:
Obtain history trip data;
According to the history trip data, structure figures incorporation model;Include: user node in the figure incorporation model, rise Peripheral node and trip mode node;The user node, the terminus node pass through with the trip mode node respectively Side connection, the weight on side are the frequency that the user node or the terminus node select trip mode node;
According to the initial token vector of each node and the weight on each side, objective optimization function is constructed;
The initial token vector of each node is adjusted, until objective function is less than preset threshold, obtains each section Vector is characterized after the adjustment of point;
Trip mode recommendation is carried out according to vector is characterized after the adjustment of each node.
Further, described according to the initial token vector of each node and the weight on each side, construct objective optimization Function, comprising:
For each user node, the user node is calculated to the conditional probability and experience of each trip mode node Probability;
For each terminus node, calculate the terminus node to the conditional probability of each trip mode node and Empirical probability;
According to each user node to the conditional probability and empirical probability of each trip mode node and each start and end Point node constructs objective optimization function to the conditional probability and empirical probability of each trip mode node.
Further, each user node is to the calculation formula of the conditional probability of each trip mode node,
Wherein, p (mj|ui) it is conditional probability of i-th of user node to j-th of trip mode node;Go out for j-th The characterization vector of line mode node;For the characterization vector of i-th of user node.
Further, each user node is to the calculation formula of the empirical probability of each trip mode node,
Wherein,It is i-th of user node to the empirical probability of j-th of trip mode node;wijIt is used for i-th The weight on side between family node and j-th of trip mode node;It is total in history trip data for i-th of user node The trip frequency.
Further, the calculation formula of objective optimization function is,
Wherein,Between i-th of user node and each trip mode node the weight on side and;It is k-th Between peripheral node and each trip mode node the weight on side and;D is distance metric.
Further, described according to the initial token vector of each node and the weight on each side, construct objective optimization Function, comprising:
For each pair of user node and trip mode node, according to the table of the user node and the trip mode node Levy inner product of vectors and the user node and out of, the node sampled out is born in other trip mode nodes characterization vector Product calculates the first subfunction;
For each pair of terminus node and trip mode node, according to the terminus node and the trip mode node Characterization inner product of vectors and the terminus node with born from other trip mode nodes the characterization of node that samples out to Inner product is measured, the second subfunction is calculated;
First subfunction and the second subfunction are synthesized, objective optimization function is obtained.
Further, the calculation formula of the first subfunction is,
Wherein, oijFor the first subfunction of i-th of user node and j-th of trip mode node pair.
Further, for each pair of user node and trip mode node, each trip side in other trip mode nodes Formula node is by the probability of negative sampling, and the weight on side is directlyed proportional between each trip mode node and user node;
For each pair of terminus node and trip mode node, each trip mode node quilt in other trip mode nodes The probability of negative sampling, the weight on side is directlyed proportional between each trip mode node and terminus node.
Further, vector is characterized after the adjustment according to each node carry out trip mode recommendation, comprising:
The trip mode inquiry request of user is obtained, includes: user's section to be checked in the trip mode inquiry request Point and terminus node;
According to the characterization vector of user node to be checked, the characterization vector of terminus node to be checked and each The characterization vector of trip mode node determines the score of each trip mode node;
By the trip mode of the maximum trip mode node of corresponding score, it is determined as trip mode to be recommended, and push away It recommends to the user.
The trip mode recommended method of the embodiment of the present invention, by obtaining history trip data;According to history trip data, Structure figures incorporation model;It include: user node, terminus node and trip mode node in figure incorporation model;User node rises Peripheral node is connect with trip mode node by side respectively, and the weight on side is that user node or terminus node select trip The frequency of mode node;According to the initial token vector of each node and the weight on each side, objective optimization function is constructed; The initial token vector of each node is adjusted, until objective function is less than preset threshold, obtains the adjustment of each node After characterize vector;Trip mode recommendation is carried out according to vector is characterized after the adjustment of each node, so that the table of each node Sign vector is capable of the trip preference of Efficient Characterization user and terminus, recommends accuracy to improve trip mode and recommends effect Rate.
In order to achieve the above object, second aspect of the present invention embodiment proposes a kind of trip mode recommendation apparatus, comprising:
Module is obtained, for obtaining history trip data;
Module is constructed, for according to the history trip data, structure figures incorporation model;It is wrapped in the figure incorporation model It includes: user node, terminus node and trip mode node;The user node, the terminus node respectively with it is described go out Line mode node is connected by side, and the weight on side is that the user node or the terminus node select trip mode node The frequency;
The building module is also used to the initial token vector according to each node and the weight on each side, constructs mesh Mark majorized function;
Recommending module carries out trip mode recommendation for characterizing vector after the adjustment according to each node.
Further, the building module is specifically used for,
For each user node, the user node is calculated to the conditional probability and experience of each trip mode node Probability;
For each terminus node, calculate the terminus node to the conditional probability of each trip mode node and Empirical probability;
According to each user node to the conditional probability and empirical probability of each trip mode node and each start and end Point node constructs objective optimization function to the conditional probability and empirical probability of each trip mode node.
Further, each user node is to the calculation formula of the conditional probability of each trip mode node,
Wherein, p (mj|ui) it is conditional probability of i-th of user node to j-th of trip mode node;Go out for j-th The characterization vector of line mode node;For the characterization vector of i-th of user node.
Further, each user node is to the calculation formula of the empirical probability of each trip mode node,
Wherein,It is i-th of user node to the empirical probability of j-th of trip mode node;wijIt is used for i-th The weight on side between family node and j-th of trip mode node;It is total in history trip data for i-th of user node The trip frequency.
Further, the calculation formula of objective optimization function is,
Wherein,Between i-th of user node and each trip mode node the weight on side and;It is k-th Between peripheral node and each trip mode node the weight on side and;D is distance metric.
Further, the building module is specifically used for,
For each pair of user node and trip mode node, according to the table of the user node and the trip mode node Levy inner product of vectors and the user node and out of, the node sampled out is born in other trip mode nodes characterization vector Product calculates the first subfunction;
For each pair of terminus node and trip mode node, according to the terminus node and the trip mode node Characterization inner product of vectors and the terminus node with born from other trip mode nodes the characterization of node that samples out to Inner product is measured, the second subfunction is calculated;
First subfunction and the second subfunction are synthesized, objective optimization function is obtained.
Further, the calculation formula of the first subfunction is,
Wherein, oijFor the first subfunction of i-th of user node and j-th of trip mode node pair.
Further, for each pair of user node and trip mode node, each trip side in other trip mode nodes Formula node is by the probability of negative sampling, and the weight on side is directlyed proportional between each trip mode node and user node;
For each pair of terminus node and trip mode node, each trip mode node quilt in other trip mode nodes The probability of negative sampling, the weight on side is directlyed proportional between each trip mode node and terminus node.
Further, the recommending module is specifically used for,
The trip mode inquiry request of user is obtained, includes: user's section to be checked in the trip mode inquiry request Point and terminus node;
According to the characterization vector of user node to be checked, the characterization vector of terminus node to be checked and each The characterization vector of trip mode node determines the score of each trip mode node;
By the trip mode of the maximum trip mode node of corresponding score, it is determined as trip mode to be recommended, and push away It recommends to the user.
The trip mode recommendation apparatus of the embodiment of the present invention, by obtaining history trip data;According to history trip data, Structure figures incorporation model;It include: user node, terminus node and trip mode node in figure incorporation model;User node rises Peripheral node is connect with trip mode node by side respectively, and the weight on side is that user node or terminus node select trip The frequency of mode node;According to the initial token vector of each node and the weight on each side, objective optimization function is constructed; The initial token vector of each node is adjusted, until objective function is less than preset threshold, obtains the adjustment of each node After characterize vector;Trip mode recommendation is carried out according to vector is characterized after the adjustment of each node, so that the table of each node Sign vector is capable of the trip preference of Efficient Characterization user and terminus, recommends accuracy to improve trip mode and recommends effect Rate.
In order to achieve the above object, third aspect present invention embodiment proposes another trip mode recommendation apparatus, comprising: deposit Reservoir, processor and storage are on a memory and the computer program that can run on a processor, which is characterized in that the processing Device realizes trip mode recommended method as described above when executing described program.
To achieve the goals above, fourth aspect present invention embodiment proposes a kind of computer readable storage medium, On be stored with computer program, which realizes trip mode recommended method as described above when being executed by processor.
To achieve the goals above, fifth aspect present invention embodiment proposes a kind of computer program product, when described When instruction processing unit in computer program product executes, trip mode recommended method as described above is realized.
The additional aspect of the present invention and advantage will be set forth in part in the description, and will partially become from the following description Obviously, or practice through the invention is recognized.
Detailed description of the invention
Above-mentioned and/or additional aspect and advantage of the invention will become from the following description of the accompanying drawings of embodiments Obviously and it is readily appreciated that, in which:
Fig. 1 is a kind of flow diagram of trip mode recommended method provided in an embodiment of the present invention;
Fig. 2 is the schematic diagram of figure incorporation model;
Fig. 3 is a kind of structural schematic diagram of trip mode recommendation apparatus provided in an embodiment of the present invention;
Fig. 4 is the structural schematic diagram of another trip mode recommendation apparatus provided in an embodiment of the present invention.
Specific embodiment
The embodiment of the present invention is described below in detail, examples of the embodiments are shown in the accompanying drawings, wherein from beginning to end Same or similar label indicates same or similar element or element with the same or similar functions.Below with reference to attached The embodiment of figure description is exemplary, it is intended to is used to explain the present invention, and is not considered as limiting the invention.
Below with reference to the accompanying drawings the trip mode recommended method and device of the embodiment of the present invention are described.
Fig. 1 is a kind of flow diagram of trip mode recommended method provided in an embodiment of the present invention.As shown in Figure 1, should Trip mode recommended method the following steps are included:
S101, history trip data is obtained.
The executing subject of trip mode recommended method provided by the invention is trip mode recommendation apparatus, and trip mode is recommended Device can be the hardware devices such as terminal device, server, or the software to install on hardware device.In the present embodiment, go through It include: at least one history trip record in history trip data.It include: selected of user, user in history trip record Terminal, the selected trip mode of user.Wherein, terminus refers to start position and final position.Trip mode is for example It can be that bus trip (bus), trip (taxi) of calling a taxi, drive trip (car), ride trip (bicycle) and walking trip (walk) etc..
S102, according to history trip data, structure figures incorporation model;It include: user node, terminus in figure incorporation model Node and trip mode node;User node, terminus node are connect with trip mode node by side respectively, and the weight on side is User node or terminus node select the frequency of trip mode node.
In the present embodiment, the Pictorial examples of figure incorporation model such as can with as shown in Fig. 2, in Fig. 2, u indicates user node, M indicates that trip mode node, od indicate terminus node.Wherein, user node selects the frequency of trip mode node, refers to User node selects trip mode degree of node in history trip data, for example, user selects time of bus trip mode Number, user select the number for trip mode of calling a taxi, user to select number of walking trip mode etc..
S103, according to the initial token vector of each node and the weight on each side, construct objective optimization function.
Wherein, the initial token vector of each node, refer to the characterization being randomly assigned when initialization for each node to Amount.In the present embodiment, in the first implement scene, the process that trip mode recommendation apparatus executes step 103 is specifically as follows, For each user node, user node is calculated to the conditional probability and empirical probability of each trip mode node;For every A terminus node calculates terminus node to the conditional probability and empirical probability of each trip mode node;According to each User node is to the conditional probability and empirical probability of each trip mode node and each terminus node to each trip The conditional probability and empirical probability of mode node construct objective optimization function.
In this implement scene, each user node can be as to the calculation formula of the conditional probability of each trip mode node Shown in following formula (1),
Wherein, p (mj|ui) it is conditional probability of i-th of user node to j-th of trip mode node;Go out for j-th The characterization vector of line mode node;For the characterization vector of i-th of user node.
In this implement scene, each user node can be as to the calculation formula of the empirical probability of each trip mode node Shown in following formula (2),
Wherein,It is i-th of user node to the empirical probability of j-th of trip mode node;wijIt is used for i-th The weight on side between family node and j-th of trip mode node;It is total in history trip data for i-th of user node The trip frequency.
In this implement scene, each terminus node can be with to the calculation formula of the conditional probability of each trip mode node As shown in following formula (3),
Wherein, p (mj|odk) it is conditional probability of k-th of terminus node to j-th of trip mode node;For kth The characterization vector of a terminus node.
In this implement scene, each terminus node can be with to the calculation formula of the empirical probability of each trip mode node As shown in following formula (4),
Wherein,It is k-th of terminus node to the empirical probability of j-th of trip mode node;wkjFor kth The weight on side between a terminus node and j-th of trip mode node;Go out line number in history for k-th of terminus node Total trip frequency in.
In this implement scene, the calculation formula of objective optimization function can be as shown in following formula (5).
Wherein,Between i-th of user node and each trip mode node the weight on side and;It is k-th Between peripheral node and each trip mode node the weight on side and;D is distance metric.
Wherein, distance metric for example can measure warp using KL divergence (Kullback-Leibler Divergence) The distance between probability and conditional probability are tested, the optimization purpose of objective optimization function is to the user node and start and end in Fig. 2 Point node, so that more closer better at a distance from empirical probability according to the conditional probability that characterization vector calculates.Wherein, KL is dissipated The calculation formula of degree substitutes into formula (5) and eliminates available following formula (6) after constant term abbreviation.
Further, in second of implement scene, in order to reduce the calculation amount in conditional probability calculating process, trip side The process that formula recommendation apparatus executes step 103 specifically can also be, for each pair of user node and trip mode node, according to The characterization inner product of vectors and user node of family node and trip mode node sample out with negative from other trip mode nodes Node characterization inner product of vectors, calculate the first subfunction;For each pair of terminus node and trip mode node, according to start and end The characterization inner product of vectors and terminus node of point node and trip mode node and sampling negative from other trip mode nodes The characterization inner product of vectors of node out calculates the second subfunction;First subfunction and the second subfunction are synthesized, mesh is obtained Mark majorized function.
In this implement scene, for each pair of user node and trip mode node, the calculation formula of the first subfunction can be with As shown in following formula (7),
Wherein, oijFor the first subfunction of i-th of user node and j-th of trip mode node pair.
In this implement scene, for each pair of terminus node and trip mode node, the calculation formula of the second subfunction can With shown in such as following formula (8),
Wherein, okjFor the second subfunction of k-th of terminus node and j-th of trip mode node pair.
Wherein, in formula (7) and formula (8), σ (x)=1/ (1+exp (- x)) is sigmoid function.The side clothes of negative sampling From being uniformly distributed, that is to say, that be directed to i-th of user node and j-th of trip mode node pair, then from the trip mode of non-j Trip mode node k is uniformly chosen in node, the side of i-th of user node and trip mode node k is excellent as negative side progress Change.
For formula (7) and formula (8), the method solution formula (7) and formula that are declined in the present embodiment using gradient (8).By taking i-th of user node and j-th of trip mode node pair as an example, then the first subfunction aboutGradient can such as with Shown in lower formula (9).
Wherein, the calculation formula of gradient can be as shown in following formula (10).
Wherein, mnFor the negative side obtained by uniform sampling.
Wherein, in the biggish situation of side right weight, if assigning biggish sample rate, gradient can become very little.On the contrary, working as In the lesser situation of side right weight, if assigning biggish sample rate, gradient explosion will lead to, therefore, in order to avoid gradient explosion And ensure learning rate, and for each pair of user node and trip mode node, each trip mode in other trip mode nodes Node is by the probability of negative sampling, and the weight on side is directlyed proportional between each trip mode node and user node;For each pair of Peripheral node and trip mode node, each trip mode node is and every by the probability of negative sampling in other trip mode nodes The weight on side is directly proportional between a trip mode node and terminus node.
S104, the initial token vector of each node is adjusted, until objective function is less than preset threshold, is obtained each Vector is characterized after the adjustment of a node.
Wherein, the process being adjusted to the initial token vector of each node is exactly the algorithm pair using gradient decline The process that objective optimization function is solved, is no longer described in detail herein.
S105, trip mode recommendation is carried out according to characterization vector after the adjustment of each node.
In the present embodiment, the process that trip mode recommendation apparatus executes step 105 is specifically as follows, and obtains the trip of user Mode inquiry request includes: user node and terminus node to be checked in trip mode inquiry request;According to be checked User node characterization vector, the characterization of the characterization vector of terminus node to be checked and each trip mode node Vector determines the score of each trip mode node;By the trip mode of the maximum trip mode node of corresponding score, determine For trip mode to be recommended, and recommend user.
Wherein, the calculation formula of score can be as shown in following formula (11).
Wherein, mkFor the score of k-th of trip mode node;γ is predetermined coefficient.
The trip mode recommended method of the embodiment of the present invention, by obtaining history trip data;According to history trip data, Structure figures incorporation model;It include: user node, terminus node and trip mode node in figure incorporation model;User node rises Peripheral node is connect with trip mode node by side respectively, and the weight on side is that user node or terminus node select trip The frequency of mode node;According to the initial token vector of each node and the weight on each side, objective optimization function is constructed; The initial token vector of each node is adjusted, until objective function is less than preset threshold, obtains the adjustment of each node After characterize vector;Trip mode recommendation is carried out according to vector is characterized after the adjustment of each node, wherein after the adjustment of each node Characterization vector obtains after being adjusted according to history trip data, with history trip data than more consistent, so as to effective table It takes over the trip preference at family and terminus for use, improves trip mode and recommend accuracy and recommend efficiency.
Fig. 3 is a kind of structural schematic diagram of trip mode recommendation apparatus provided in an embodiment of the present invention.As shown in figure 3, packet It includes: obtaining module 31, building module 32 and recommending module 33.
Wherein, module 31 is obtained, for obtaining history trip data;
Module 32 is constructed, for according to the history trip data, structure figures incorporation model;It is wrapped in the figure incorporation model It includes: user node, terminus node and trip mode node;The user node, the terminus node respectively with it is described go out Line mode node is connected by side, and the weight on side is that the user node or the terminus node select trip mode node The frequency;
The building module 32 is also used to the initial token vector according to each node and the weight on each side, building Objective optimization function;
Recommending module 33 carries out trip mode recommendation for characterizing vector after the adjustment according to each node.
Trip mode recommendation apparatus provided by the invention can be the hardware devices such as terminal device, server, or be hard The software installed in part equipment.It include: at least one history trip record in the present embodiment, in history trip data.History goes out It include: user, the selected terminus of user, the selected trip mode of user in row record.Wherein, terminus has referred to Point position and final position.Trip mode for example can be that bus trip (bus), drives to go on a journey at trip (taxi) of calling a taxi (car), it rides trip (bicycle) and walking trip (walk) etc..
In the present embodiment, the Pictorial examples of figure incorporation model such as can with as shown in Fig. 2, in Fig. 2, u indicates user node, M indicates that trip mode node, od indicate terminus node.Wherein, user node selects the frequency of trip mode node, refers to User node selects trip mode degree of node in history trip data, for example, user selects time of bus trip mode Number, user select the number for trip mode of calling a taxi, user to select number of walking trip mode etc..
Wherein, the initial token vector of each node, refer to the characterization being randomly assigned when initialization for each node to Amount.In the present embodiment, in the first implement scene, building module 32 specifically can be used for, and for each user node, calculate Conditional probability and empirical probability of the user node to each trip mode node;For each terminus node, start and end are calculated Conditional probability and empirical probability of the point node to each trip mode node;According to each user node to each trip mode The conditional probability and empirical probability of node and each terminus node to the conditional probability of each trip mode node and Empirical probability constructs objective optimization function.
In this implement scene, each user node can be as to the calculation formula of the conditional probability of each trip mode node Shown in following formula (1),
Wherein, p (mj|ui) it is conditional probability of i-th of user node to j-th of trip mode node;Go out for j-th The characterization vector of line mode node;For the characterization vector of i-th of user node.
In this implement scene, each user node can be as to the calculation formula of the empirical probability of each trip mode node Shown in following formula (2),
Wherein,It is i-th of user node to the empirical probability of j-th of trip mode node;wijIt is used for i-th The weight on side between family node and j-th of trip mode node;It is total in history trip data for i-th of user node The trip frequency.
In this implement scene, each terminus node can be with to the calculation formula of the conditional probability of each trip mode node As shown in following formula (3),
Wherein, p (mj|odk) it is conditional probability of k-th of terminus node to j-th of trip mode node;For kth The characterization vector of a terminus node.
In this implement scene, each terminus node can be with to the calculation formula of the empirical probability of each trip mode node As shown in following formula (4),
Wherein,It is k-th of terminus node to the empirical probability of j-th of trip mode node;wkjFor kth The weight on side between a terminus node and j-th of trip mode node;Go out line number in history for k-th of terminus node Total trip frequency in.
In this implement scene, the calculation formula of objective optimization function can be as shown in following formula (5).
Wherein,Between i-th of user node and each trip mode node the weight on side and;It is k-th Between peripheral node and each trip mode node the weight on side and;D is distance metric.
Wherein, distance metric for example can measure warp using KL divergence (Kullback-Leibler Divergence) The distance between probability and conditional probability are tested, the optimization purpose of objective optimization function is to the user node and start and end in Fig. 2 Point node, so that more closer better at a distance from empirical probability according to the conditional probability that characterization vector calculates.Wherein, KL is dissipated The calculation formula of degree substitutes into formula (5) and eliminates available following formula (6) after constant term abbreviation.
Further, in second of implement scene, in order to reduce the calculation amount in conditional probability calculating process, mould is constructed Block 32 specifically can be used for, for each pair of user node and trip mode node, according to user node and trip mode node The characterization inner product of vectors of characterization inner product of vectors and user node and the node sampled out negative from other trip mode nodes, Calculate the first subfunction;For each pair of terminus node and trip mode node, according to terminus node and trip mode node Characterization inner product of vectors and terminus node with from being born in other trip mode nodes in the characterization vector of node sampled out Product calculates the second subfunction;First subfunction and the second subfunction are synthesized, objective optimization function is obtained.
In this implement scene, for each pair of user node and trip mode node, the calculation formula of the first subfunction can be with As shown in following formula (7),
Wherein, oijFor the first subfunction of i-th of user node and j-th of trip mode node pair.
In this implement scene, for each pair of terminus node and trip mode node, the calculation formula of the second subfunction can With shown in such as following formula (8),
Wherein, okjFor the second subfunction of k-th of terminus node and j-th of trip mode node pair.
Wherein, in formula (7) and formula (8), σ (x)=1/ (1+exp (- x)) is sigmoid function.The side clothes of negative sampling From being uniformly distributed, that is to say, that be directed to i-th of user node and j-th of trip mode node pair, then from the trip mode of non-j Trip mode node k is uniformly chosen in node, the side of i-th of user node and trip mode node k is excellent as negative side progress Change.
For formula (7) and formula (8), the method solution formula (7) and formula that are declined in the present embodiment using gradient (8).By taking i-th of user node and j-th of trip mode node pair as an example, then the first subfunction aboutGradient can such as with Shown in lower formula (9).
Wherein, the calculation formula of gradient can be as shown in following formula (10).
Wherein, mnFor the negative side obtained by uniform sampling.
Wherein, in the biggish situation of side right weight, if assigning biggish sample rate, gradient can become very little.On the contrary, working as In the lesser situation of side right weight, if assigning biggish sample rate, gradient explosion will lead to, therefore, in order to avoid gradient explosion And ensure learning rate, and for each pair of user node and trip mode node, each trip mode in other trip mode nodes Node is by the probability of negative sampling, and the weight on side is directlyed proportional between each trip mode node and user node;For each pair of Peripheral node and trip mode node, each trip mode node is and every by the probability of negative sampling in other trip mode nodes The weight on side is directly proportional between a trip mode node and terminus node.
Further, on the basis of the above embodiments, recommending module 33 specifically can be used for, and obtain the trip side of user Formula inquiry request includes: user node and terminus node to be checked in trip mode inquiry request;According to be checked The characterization of the characterization vector of user node, the characterization vector of terminus node to be checked and each trip mode node to Amount, determines the score of each trip mode node;By the trip mode of the maximum trip mode node of corresponding score, it is determined as Trip mode to be recommended, and recommend user.
Wherein, the calculation formula of score can be as shown in following formula (11).
Wherein, mkFor the score of k-th of trip mode node;γ is predetermined coefficient.
The trip mode recommendation apparatus of the embodiment of the present invention, by obtaining history trip data;According to history trip data, Structure figures incorporation model;It include: user node, terminus node and trip mode node in figure incorporation model;User node rises Peripheral node is connect with trip mode node by side respectively, and the weight on side is that user node or terminus node select trip The frequency of mode node;According to the initial token vector of each node and the weight on each side, objective optimization function is constructed; The initial token vector of each node is adjusted, until objective function is less than preset threshold, obtains the adjustment of each node After characterize vector;Trip mode recommendation is carried out according to vector is characterized after the adjustment of each node, wherein after the adjustment of each node Characterization vector obtains after being adjusted according to history trip data, with history trip data than more consistent, so as to effective table It takes over the trip preference at family and terminus for use, improves trip mode and recommend accuracy and recommend efficiency.
Fig. 4 is the structural schematic diagram of another trip mode recommendation apparatus provided in an embodiment of the present invention.The trip mode Recommendation apparatus includes:
Memory 1001, processor 1002 and it is stored in the calculating that can be run on memory 1001 and on processor 1002 Machine program.
Processor 1002 realizes the trip mode recommended method provided in above-described embodiment when executing described program.
Further, trip mode recommendation apparatus further include:
Communication interface 1003, for the communication between memory 1001 and processor 1002.
Memory 1001, for storing the computer program that can be run on processor 1002.
Memory 1001 may include high speed RAM memory, it is also possible to further include nonvolatile memory (non- Volatile memory), a for example, at least magnetic disk storage.
Processor 1002 realizes trip mode recommended method described in above-described embodiment when for executing described program.
If memory 1001, processor 1002 and the independent realization of communication interface 1003, communication interface 1003, memory 1001 and processor 1002 can be connected with each other by bus and complete mutual communication.The bus can be industrial standard Architecture (Industry Standard Architecture, referred to as ISA) bus, external equipment interconnection (Peripheral Component, referred to as PCI) bus or extended industry-standard architecture (Extended Industry Standard Architecture, referred to as EISA) bus etc..The bus can be divided into address bus, data/address bus, control Bus processed etc..Only to be indicated with a thick line in Fig. 4, it is not intended that an only bus or a type of convenient for indicating Bus.
Optionally, in specific implementation, if memory 1001, processor 1002 and communication interface 1003, are integrated in one It is realized on block chip, then memory 1001, processor 1002 and communication interface 1003 can be completed mutual by internal interface Communication.
Processor 1002 may be a central processing unit (Central Processing Unit, referred to as CPU), or Person is specific integrated circuit (Application Specific Integrated Circuit, referred to as ASIC) or quilt It is configured to implement one or more integrated circuits of the embodiment of the present invention.
The present invention also provides a kind of non-transitorycomputer readable storage mediums, are stored thereon with computer program, the journey Trip mode recommended method as described above is realized when sequence is executed by processor.
The present invention also provides a kind of computer program products, when the instruction processing unit in the computer program product executes When, realize trip mode recommended method as described above.
In the description of this specification, reference term " one embodiment ", " some embodiments ", " example ", " specifically show The description of example " or " some examples " etc. means specific features, structure, material or spy described in conjunction with this embodiment or example Point is included at least one embodiment or example of the invention.In the present specification, schematic expression of the above terms are not It must be directed to identical embodiment or example.Moreover, particular features, structures, materials, or characteristics described can be in office It can be combined in any suitable manner in one or more embodiment or examples.In addition, without conflicting with each other, the skill of this field Art personnel can tie the feature of different embodiments or examples described in this specification and different embodiments or examples It closes and combines.
In addition, term " first ", " second " are used for descriptive purposes only and cannot be understood as indicating or suggesting relative importance Or implicitly indicate the quantity of indicated technical characteristic.Define " first " as a result, the feature of " second " can be expressed or Implicitly include at least one this feature.In the description of the present invention, the meaning of " plurality " is at least two, such as two, three It is a etc., unless otherwise specifically defined.
Any process described otherwise above or method description are construed as in flow chart or herein, and expression includes It is one or more for realizing custom logic function or process the step of executable instruction code module, segment or portion Point, and the range of the preferred embodiment of the present invention includes other realization, wherein can not press shown or discussed suitable Sequence, including according to related function by it is basic simultaneously in the way of or in the opposite order, Lai Zhihang function, this should be of the invention Embodiment person of ordinary skill in the field understood.
Expression or logic and/or step described otherwise above herein in flow charts, for example, being considered use In the order list for the executable instruction for realizing logic function, may be embodied in any computer-readable medium, for Instruction execution system, device or equipment (such as computer based system, including the system of processor or other can be held from instruction The instruction fetch of row system, device or equipment and the system executed instruction) it uses, or combine these instruction execution systems, device or set It is standby and use.For the purpose of this specification, " computer-readable medium ", which can be, any may include, stores, communicates, propagates or pass Defeated program is for instruction execution system, device or equipment or the dress used in conjunction with these instruction execution systems, device or equipment It sets.The more specific example (non-exhaustive list) of computer-readable medium include the following: there is the electricity of one or more wirings Interconnecting piece (electronic device), portable computer diskette box (magnetic device), random access memory (RAM), read-only memory (ROM), erasable edit read-only storage (EPROM or flash memory), fiber device and portable optic disk is read-only deposits Reservoir (CDROM).In addition, computer-readable medium can even is that the paper that can print described program on it or other are suitable Medium, because can then be edited, be interpreted or when necessary with it for example by carrying out optical scanner to paper or other media His suitable method is handled electronically to obtain described program, is then stored in computer storage.
It should be appreciated that each section of the invention can be realized with hardware, software, firmware or their combination.Above-mentioned In embodiment, software that multiple steps or method can be executed in memory and by suitable instruction execution system with storage Or firmware is realized.Such as, if realized with hardware in another embodiment, following skill well known in the art can be used Any one of art or their combination are realized: have for data-signal is realized the logic gates of logic function from Logic circuit is dissipated, the specific integrated circuit with suitable combinational logic gate circuit, programmable gate array (PGA), scene can compile Journey gate array (FPGA) etc..
Those skilled in the art are understood that realize all or part of step that above-described embodiment method carries It suddenly is that relevant hardware can be instructed to complete by program, the program can store in a kind of computer-readable storage medium In matter, which when being executed, includes the steps that one or a combination set of embodiment of the method.
It, can also be in addition, each functional unit in each embodiment of the present invention can integrate in a processing module It is that each unit physically exists alone, can also be integrated in two or more units in a module.Above-mentioned integrated mould Block both can take the form of hardware realization, can also be realized in the form of software function module.The integrated module is such as Fruit is realized and when sold or used as an independent product in the form of software function module, also can store in a computer In read/write memory medium.
Storage medium mentioned above can be read-only memory, disk or CD etc..Although having been shown and retouching above The embodiment of the present invention is stated, it is to be understood that above-described embodiment is exemplary, and should not be understood as to limit of the invention System, those skilled in the art can be changed above-described embodiment, modify, replace and become within the scope of the invention Type.

Claims (21)

1. a kind of trip mode recommended method characterized by comprising
Obtain history trip data;
According to the history trip data, structure figures incorporation model;It include: user node, terminus in the figure incorporation model Node and trip mode node;The user node, the terminus node are connected with the trip mode node by side respectively It connects, the weight on side is the frequency that the user node or the terminus node select trip mode node;
According to the initial token vector of each node and the weight on each side, objective optimization function is constructed;
The initial token vector of each node is adjusted, until objective function is less than preset threshold, obtains each node Vector is characterized after adjustment;
Trip mode recommendation is carried out according to vector is characterized after the adjustment of each node.
2. the method according to claim 1, wherein the initial token vector according to each node, and The weight on each side constructs objective optimization function, comprising:
For each user node, it is general to the conditional probability and experience of each trip mode node to calculate the user node Rate;
For each terminus node, the terminus node is calculated to the conditional probability and experience of each trip mode node Probability;
Conditional probability and empirical probability and each terminus section according to each user node to each trip mode node Point constructs objective optimization function to the conditional probability and empirical probability of each trip mode node.
3. according to the method described in claim 2, it is characterized in that, each user node is to the condition of each trip mode node The calculation formula of probability is,
Wherein, p (mj|ui) it is conditional probability of i-th of user node to j-th of trip mode node;For j-th of trip side The characterization vector of formula node;For the characterization vector of i-th of user node.
4. according to the method described in claim 2, it is characterized in that, each user node is to the experience of each trip mode node The calculation formula of probability is,
Wherein,It is i-th of user node to the empirical probability of j-th of trip mode node;wijIt is saved for i-th of user The weight on side between point and j-th of trip mode node;Being i-th of user node always goes out line frequency in history trip data It is secondary.
5. according to the method described in claim 2, it is characterized in that, the calculation formula of objective optimization function is,
Wherein,Between i-th of user node and each trip mode node the weight on side and;For k-th of terminus section Point each trip mode node between side weight and;D is distance metric.
6. the method according to claim 1, wherein the initial token vector according to each node, and The weight on each side constructs objective optimization function, comprising:
For each pair of user node and trip mode node, according to the characterization of the user node and the trip mode node to Amount inner product and the user node and the characterization inner product of vectors that the node sampled out is born from other trip mode nodes, are counted Calculate the first subfunction;
For each pair of terminus node and trip mode node, according to the table of the terminus node and the trip mode node Levy inner product of vectors and the terminus node and out of, the node sampled out is born in other trip mode nodes characterization vector Product calculates the second subfunction;
First subfunction and the second subfunction are synthesized, objective optimization function is obtained.
7. according to the method described in claim 6, it is characterized in that, the calculation formula of the first subfunction is,
Wherein, oijFor the first subfunction of i-th of user node and j-th of trip mode node pair.
8. the method according to the description of claim 7 is characterized in that be directed to each pair of user node and trip mode node, other Each trip mode node is by the probability of negative sampling in trip mode node, between each trip mode node and user node The weight on side is directly proportional;
For each pair of terminus node and trip mode node, each trip mode node is adopted by negative in other trip mode nodes The probability of sample, the weight on side is directlyed proportional between each trip mode node and terminus node.
9. being carried out the method according to claim 1, wherein characterizing vector after the adjustment according to each node Trip mode is recommended, comprising:
The trip mode inquiry request for obtaining user includes: user node to be checked in the trip mode inquiry request with And terminus node;
According to the characterization vector of user node to be checked, the characterization vector of terminus node to be checked and each trip The characterization vector of mode node determines the score of each trip mode node;
By the trip mode of the maximum trip mode node of corresponding score, it is determined as trip mode to be recommended, and recommend The user.
10. a kind of trip mode recommendation apparatus characterized by comprising
Module is obtained, for obtaining history trip data;
Module is constructed, for according to the history trip data, structure figures incorporation model;It include: use in the figure incorporation model Family node, terminus node and trip mode node;The user node, the terminus node respectively with the trip mode Node is connected by side, and the weight on side is the frequency that the user node or the terminus node select trip mode node It is secondary;
The building module, is also used to the initial token vector according to each node and the weight on each side, and building target is excellent Change function;
Recommending module carries out trip mode recommendation for characterizing vector after the adjustment according to each node.
11. device according to claim 10, which is characterized in that the building module is specifically used for,
For each user node, it is general to the conditional probability and experience of each trip mode node to calculate the user node Rate;
For each terminus node, the terminus node is calculated to the conditional probability and experience of each trip mode node Probability;
Conditional probability and empirical probability and each terminus section according to each user node to each trip mode node Point constructs objective optimization function to the conditional probability and empirical probability of each trip mode node.
12. device according to claim 11, which is characterized in that item of each user node to each trip mode node The calculation formula of part probability is,
Wherein, p (mj|ui) it is conditional probability of i-th of user node to j-th of trip mode node;For j-th of trip side The characterization vector of formula node;For the characterization vector of i-th of user node.
13. device according to claim 11, which is characterized in that warp of each user node to each trip mode node The calculation formula for testing probability is,
Wherein,It is i-th of user node to the empirical probability of j-th of trip mode node;wijIt is saved for i-th of user The weight on side between point and j-th of trip mode node;Being i-th of user node always goes out line frequency in history trip data It is secondary.
14. device according to claim 11, which is characterized in that the calculation formula of objective optimization function is,
Wherein,Between i-th of user node and each trip mode node the weight on side and;For k-th of terminus section Point each trip mode node between side weight and;D is distance metric.
15. device according to claim 10, which is characterized in that the building module is specifically used for,
For each pair of user node and trip mode node, according to the characterization of the user node and the trip mode node to Amount inner product and the user node and the characterization inner product of vectors that the node sampled out is born from other trip mode nodes, are counted Calculate the first subfunction;
For each pair of terminus node and trip mode node, according to the table of the terminus node and the trip mode node Levy inner product of vectors and the terminus node and out of, the node sampled out is born in other trip mode nodes characterization vector Product calculates the second subfunction;
First subfunction and the second subfunction are synthesized, objective optimization function is obtained.
16. device according to claim 15, which is characterized in that the calculation formula of the first subfunction is,
Wherein, oijFor the first subfunction of i-th of user node and j-th of trip mode node pair.
17. device according to claim 16, which is characterized in that it is directed to each pair of user node and trip mode node, Each trip mode node is by the probability of negative sampling in his trip mode node, with each trip mode node and user node it Between side weight it is directly proportional;
For each pair of terminus node and trip mode node, each trip mode node is adopted by negative in other trip mode nodes The probability of sample, the weight on side is directlyed proportional between each trip mode node and terminus node.
18. device according to claim 10, which is characterized in that the recommending module is specifically used for,
The trip mode inquiry request for obtaining user includes: user node to be checked in the trip mode inquiry request with And terminus node;
According to the characterization vector of user node to be checked, the characterization vector of terminus node to be checked and each trip The characterization vector of mode node determines the score of each trip mode node;
By the trip mode of the maximum trip mode node of corresponding score, it is determined as trip mode to be recommended, and recommend The user.
19. a kind of trip mode recommendation apparatus characterized by comprising
Memory, processor and storage are on a memory and the computer program that can run on a processor, which is characterized in that institute State the trip mode recommended method realized as described in any in claim 1-9 when processor executes described program.
20. a kind of non-transitorycomputer readable storage medium, is stored thereon with computer program, which is characterized in that the program The trip mode recommended method as described in any in claim 1-9 is realized when being executed by processor.
21. a kind of computer program product realizes such as right when the instruction processing unit in the computer program product executes It is required that any trip mode recommended method in 1-9.
CN201910163898.7A 2019-03-05 2019-03-05 Travel mode recommendation method and device Active CN109918567B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910163898.7A CN109918567B (en) 2019-03-05 2019-03-05 Travel mode recommendation method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910163898.7A CN109918567B (en) 2019-03-05 2019-03-05 Travel mode recommendation method and device

Publications (2)

Publication Number Publication Date
CN109918567A true CN109918567A (en) 2019-06-21
CN109918567B CN109918567B (en) 2021-08-17

Family

ID=66963289

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910163898.7A Active CN109918567B (en) 2019-03-05 2019-03-05 Travel mode recommendation method and device

Country Status (1)

Country Link
CN (1) CN109918567B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113536128A (en) * 2021-07-22 2021-10-22 青岛海信网络科技股份有限公司 Recommendation method for transportation hub transfer mode and electronic equipment
CN114387042A (en) * 2022-03-22 2022-04-22 北京骑胜科技有限公司 Travel demand determination method and device

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100211308A1 (en) * 2009-02-19 2010-08-19 Microsoft Corporation Identifying interesting locations
CN105277189A (en) * 2014-06-30 2016-01-27 高德软件有限公司 Route pushing method and device
US20160092532A1 (en) * 2014-09-29 2016-03-31 Facebook, Inc. Load-balancing inbound real-time data updates for a social networking system
CN107944611A (en) * 2017-11-17 2018-04-20 北京工业大学 Towards the cross-module formula combined travel planing method of personalized trip requirements
CN108629457A (en) * 2018-05-09 2018-10-09 西南交通大学 The method and apparatus predicted trip mode and build prediction model

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100211308A1 (en) * 2009-02-19 2010-08-19 Microsoft Corporation Identifying interesting locations
CN105277189A (en) * 2014-06-30 2016-01-27 高德软件有限公司 Route pushing method and device
US20160092532A1 (en) * 2014-09-29 2016-03-31 Facebook, Inc. Load-balancing inbound real-time data updates for a social networking system
CN107944611A (en) * 2017-11-17 2018-04-20 北京工业大学 Towards the cross-module formula combined travel planing method of personalized trip requirements
CN108629457A (en) * 2018-05-09 2018-10-09 西南交通大学 The method and apparatus predicted trip mode and build prediction model

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113536128A (en) * 2021-07-22 2021-10-22 青岛海信网络科技股份有限公司 Recommendation method for transportation hub transfer mode and electronic equipment
CN114387042A (en) * 2022-03-22 2022-04-22 北京骑胜科技有限公司 Travel demand determination method and device
CN114387042B (en) * 2022-03-22 2022-06-10 北京骑胜科技有限公司 Travel demand determination method and device

Also Published As

Publication number Publication date
CN109918567B (en) 2021-08-17

Similar Documents

Publication Publication Date Title
CN109255126A (en) Article recommended method and device
CN104915734B (en) Commodity popularity prediction method based on time sequence and system thereof
CN108491529A (en) Information recommendation method and device
JP2018535497A5 (en)
CN110276446A (en) The method and apparatus of model training and selection recommendation information
CN108875013A (en) Handle the method and device of map datum
US20190108640A1 (en) Image crop suggestion and evaluation using deep-learning
CN110263821A (en) Transaction feature generates the generation method and device of the training of model, transaction feature
CN109918567A (en) Trip mode recommended method and device
CN110188350A (en) Text coherence calculation method and device
CN109614615A (en) Methodology for Entities Matching, device and electronic equipment
CN109598264A (en) Grasping body method and device
CN107203611A (en) Information providing method and device based on picture content
CN107748802A (en) Polymerizable clc method and device
CN110362648A (en) Update method and device, storage medium, the computer equipment of questionnaire survey topic
US20110219143A1 (en) Path calculation order deciding method, program and calculating apparatus
CN110189372A (en) Depth map model training method and device
CN114419378A (en) Image classification method and device, electronic equipment and medium
CN112115752A (en) Method and device for training quality detection model and method and device for detecting quality
CN110111382A (en) Irregular area area computation method, device, computer equipment and storage medium
CN109359966A (en) A kind of method and apparatus of detection logistics package charging exception
CN107748801A (en) News recommends method, apparatus, terminal device and computer-readable recording medium
CN110196920A (en) The treating method and apparatus and storage medium and electronic device of text data
CN109784406A (en) A kind of user draws a portrait method, apparatus, readable storage medium storing program for executing and terminal device
CN109886299A (en) A kind of user draws a portrait method, apparatus, readable storage medium storing program for executing and terminal device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant