A POI recommendation method and device for distinguishing user exploratory mode and spatiotemporal revisit mode
By distinguishing the user's exploratory mode and the time-space re-access mode, and using the self-attention network to calculate the POI score and conversion probability, the problem of insufficient recommendation performance in the existing technology is solved, more accurate POI recommendation is achieved, and user experience and decision support capabilities are improved.
Patent Information
- Application Number
- CN202210719348.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-23
- Publication Date
- 2025-08-12
- Estimated Expiration
- 2042-06-23
AI Technical Summary
The existing POI recommendation technology fails to effectively distinguish between user's exploratory mode and space-time re-access mode, resulting in insufficient recommendation performance.
By modeling the user's exploratory mode and space-time re-access mode, the POI score and conversion probability are calculated using the self-attention network, and the space-time correlation coefficient is calculated in combination with time and space intervals to generate the final POI recommendation score.
It improves the scientificity and effectiveness of POI recommendations, can more accurately recommend users’ travel locations at the next moment, improve user experience, and provide decision-making support for urban development planning and building site selection.
Smart Images

Figure CN115130018B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of travel recommendation, and in particular to a POI recommendation method and device for distinguishing between a user's exploratory mode and a spatiotemporal revisit mode. Background Art
[0002] Many internet companies are using next point of interest (POI) recommendations to enhance users' travel experiences. Companies like ride-hailing platforms and travel recommendation platforms have accumulated vast amounts of user check-in data. This check-in data includes the latitude and longitude of the check-in location, check-in timestamps, and user information. With the rapid development of deep learning and big data technologies, intelligent recommendation systems that model user preferences based on historical check-in data have also seen new advancements and breakthroughs.
[0003] Generally speaking, user check-in behavior can be categorized into exploratory preferences and revisit intentions. For example, users enjoy exploring a selection of food-themed POIs on weekends, or they frequently select their company as their next destination on ride-hailing platforms during rush hour. Modeling a user's historical check-in behavior can predict user behavior and uncover their travel patterns. This helps travel platforms better serve users, enhance the travel experience, and provide decision support for building site selection and urban development planning.
[0004] During the process of implementing the present invention, the inventors of this application discovered that the methods of the prior art have at least the following technical problems:
[0005] Existing POI recommendation technologies simply model user preferences and have not yet distinguished between user exploratory behavior and revisit behavior. Therefore, the POI recommendation performance cannot further break through the bottleneck. Summary of the Invention
[0006] The present invention provides a POI recommendation method and device that distinguishes between user exploratory patterns and spatiotemporal revisit patterns, so as to solve or at least partially solve the technical problem of poor recommendation performance in the prior art.
[0007] In order to solve the above technical problems, the first aspect of the present invention provides a POI recommendation method that distinguishes between user exploratory patterns and spatiotemporal revisit patterns, comprising:
[0008] S1: Obtain historical check-in data of all users, where the user's historical check-in data includes user ID, check-in time, POI ID, and POI spatial location;
[0009] S2: Randomly initialize the user embedding vector, POI embedding vector and spatial embedding vector according to the user ID, POI ID and spatial location of the POI in the user's historical check-in data, and generate the embedding vector e based on the user embedding vector, POI embedding vector and spatial embedding vector q 、e k 、e v ;
[0010] S3: Modeling the user's exploratory mode preference, inputting the user's sequence representation E into the self-attention network for learning, and outputting a new sequence representation, where the last vector in the new sequence representation is the user's exploratory model preference, outputting the ratings of all POIs in the POI candidate set in the exploratory mode, and the user's sequence representation is based on the embedding vector e q 、e k 、e v Obtain,the POI candidate set based on the historical check-in data of all users;
[0011] S4: Model the user's spatiotemporal revisit pattern preference, calculate the spatiotemporal similarity coefficient, and calculate the scores of all POIs in the POI candidate set under the spatiotemporal revisit pattern based on the input spatiotemporal similarity coefficient, the new sequence representation, and the last vector in the new sequence representation;
[0012] S5: Calculate the transition probability of the exploratory mode and the transition probability of the spatiotemporal revisit mode based on the spatiotemporal similarity coefficient, the new sequence representation and the last vector in the new sequence representation;
[0013] S6: Calculate the final score of POI recommendation based on the scores of all POIs in the POI candidate set in the exploratory mode, the transition probability of the exploratory mode, the scores of all POIs in the POI candidate set in the spatiotemporal revisit mode, and the transition probability of the spatiotemporal revisit mode;
[0014] S7: Sort the final scores of the POI recommendations, and recommend the POIs corresponding to the N highest final scores.
[0015] In one embodiment, the spatial location of the POI in S1 includes the longitude and latitude of the POI.
[0016] In one embodiment, step S2 includes:
[0017] S2.1: Fix the user's historical check-in data into a sequence of length m;
[0018] S2.2: Randomly initialize the user embedding vector, POI embedding vector and space embedding vector, defined as e user 、e poi and e spatial ;
[0019] S2.3: Generate an embedding vector e based on the user embedding vector, POI embedding vector, and spatial embedding vector q 、e k 、e v , where the embedding vector e q Represented as e q =e user +e poi +e spatial , embedding vector e k Represented as e k =e user +e poi +e spatial , embedding vector e v Represented as e v =e poi +e spatial .
[0020] In one embodiment, step S3 includes:
[0021] S3.1: Take the user’s sequence representation E as the input of the self-attention network, where E = {e1, e2, …, e m}, the τth sequence e τ = <e q ,e k ,e v >, for e q ,e k ,e v Perform linear transformation to generate new embedding vectors Q, K and V, Q = e q W Q ,K=e k W K ,V=e v W V , W Q ,W K , is a learnable parameter;
[0022] S3.2: Input Q, K, and V into the self-attention mechanism for calculation. The formula is as follows:
[0023] SA(Q,K,V)=softmax(QK T )V
[0024] E′=FFN(O)=ReLU((SA(Q,K,V)W 1 +b 1 )W 2 +b 2 )
[0025] Among them, W1 ,W 2 is the learnable matrix, b 1 ,b 2 is the bias value, output E′={e′1,e′2,…,e′ m}, e′ m Represent the last vector in E′ as the new sequence;
[0026] S3.3: Use the dot product operation to calculate the exploratory mode recommendation score p of all POIs in the POI candidate set I. The POI embedding vector in the POI candidate set is the POI embedding vector e corresponding to the POI number. poi , the formula for p is as follows:
[0027]
[0028] in, is the embedding vector of the i-th POI in the POI candidate set, and T is the embedding vector Transpose, e′ m is the last vector in the new sequence representation.
[0029] In one embodiment, step S4 includes:
[0030] S4.1: Obtain the user check-in sequence based on the user's historical check-in data, and use the time interval Δ between user check-ins t and the spatial interval Δ s , calculate the time similarity coefficient and spatial similarity coefficient The final spatiotemporal similarity coefficient Δ is obtained by adding the two together, and the formula is as follows:
[0031]
[0032] in, and are learnable parameters, and the max(·) and min(·) distributions represent the maximum and minimum values of the time interval and spacetime interval in the computation sequence;
[0033] S4.2: Calculate the recommendation score a of the τth POI that appears in the user's historical check-in sequence τ , the formula is as follows:
[0034]
[0035] Among them, V1, W1, W2 are learnable parameters, e′ τ is the τth embedding vector in E′, Δ is the spatiotemporal similarity coefficient, which enables the calculation of recommendation scores to take into account the spatiotemporal behavior characteristics of users, τ∈[1,m];
[0036] S4.3: For POIs that do not appear in the user's historical check-in sequence, the corresponding recommendation score is set to 0. The recommendation score r formula for the complete spatiotemporal revisit pattern is as follows:
[0037]
[0038] Among them, S u is the user's historical check-in sequence, l τ is the τth POI that appeared in the user's historical check-in sequence.
[0039] In one embodiment, step S5 includes:
[0040] S5.1: Input the new sequence representation E′ and the last vector e′ in the new sequence representation m And the spatiotemporal similarity coefficient Δ, calculate the spatiotemporal conversion coefficient K, the formula is as follows:
[0041]
[0042] Among them, V2, W3, W4 are learnable parameters, and tanh is the Tanh activation function;
[0043] S5.2: Input K into a linear transformation and softmax function to calculate the transition probability K of the spatiotemporal revisit pattern I and the transition probability K of the exploratory mode P , the formula is as follows:
[0044]
[0045] in are learnable parameters.
[0046] In one embodiment, step S6 includes:
[0047] S6.1: Calculate the final recommendation score of the exploratory mode and the final recommendation score of the spatiotemporal revisit mode using the following formula:
[0048] P=K P *p
[0049] R=K I *r
[0050] Among them, K I is the transition probability of the spatiotemporal revisit pattern, K P is the transition probability of the exploratory mode, P is the final recommendation score of the exploratory mode, and R is the final recommendation score of the spatiotemporal revisit mode;
[0051] S6.2: Calculate the final score of POI recommendation using the following formula:
[0052] score=P+R
[0053] Among them, score is the final score of POI recommendation.
[0054] Based on the same inventive concept, a second aspect of the present invention provides a POI recommendation device that distinguishes between a user's exploratory mode and a spatiotemporal revisit mode, comprising:
[0055] The data acquisition module is used to obtain the historical check-in data of all users, where the user's historical check-in data includes user ID, check-in time, POI ID, and spatial location of the POI;
[0056] The embedding vector generation module is used to randomly initialize the user embedding vector, POI embedding vector and spatial embedding vector according to the user number, POI number and spatial position of the POI in the user's historical check-in data, and generate the embedding vector e based on the user embedding vector, POI embedding vector and spatial embedding vector q 、e k 、e v ;
[0057] The exploratory mode preference modeling module is used to model the user's exploratory mode preference. It inputs the user's sequence representation E into the self-attention network for learning and outputs a new sequence representation. The last vector in the new sequence representation is the user's exploratory model preference. The module also outputs the ratings of all POIs in the POI candidate set under exploratory mode. The user's sequence representation E is obtained based on the embedding vectors q, k, and v. The POI candidate set is obtained based on the historical check-in data of all users.
[0058] The spatiotemporal revisit mode preference modeling module is used to model the user's exploratory mode preference. The user's sequence representation E is input into the self-attention network for learning, and a new sequence representation is output. The last vector in the new sequence representation is the preference of the user's exploratory model. The ratings of all POIs in the POI candidate set in the exploratory mode are output. The user's sequence representation E is based on the embedding vector e q 、e k 、e v Obtain,the POI candidate set based on the historical check-in data of all users;
[0059] a transition probability calculation module, used to calculate the transition probability of the exploratory mode and the transition probability of the spatiotemporal revisit mode according to the spatiotemporal similarity coefficient, the new sequence representation and the last vector in the new sequence representation;
[0060] The final score calculation module of the recommendation is used to calculate the final score of the POI recommendation based on the scores of all POIs in the POI candidate set in the exploratory mode, the transition probability of the exploratory mode, the scores of all POIs in the POI candidate set in the spatiotemporal revisit mode, and the transition probability of the spatiotemporal revisit mode;
[0061] The POI recommendation module is used to sort the final scores of the POI recommendations and recommend the POIs corresponding to the N highest final scores.
[0062] Based on the same inventive concept, the third aspect of the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed, implements the method described in the first aspect.
[0063] Based on the same inventive concept, the fourth aspect of the present invention provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method described in the first aspect when executing the program.
[0064] Compared with the prior art, the advantages and beneficial technical effects of the present invention are as follows:
[0065] The present invention provides a POI recommendation method that distinguishes between user exploratory patterns and spatiotemporal revisit patterns. The method models user preferences for exploratory patterns and spatiotemporal revisit patterns, calculates spatiotemporal correlation coefficients using time intervals and spatial intervals, and calculates scores for all POIs in the POI candidate set under the two modes. The method then calculates transition probabilities under the two modes. Finally, the method combines the POI scores and transition probabilities under the two modes to calculate a final POI recommendation score. The final POI recommendation scores are then ranked and selected, with the top N POIs with the highest scores being recommended. This method can more scientifically, effectively, and accurately recommend a user's next travel destination. It addresses the issue of traditional POI recommendation methods that fail to distinguish between user exploratory patterns and spatiotemporal revisit patterns, improves POI recommendation performance, and, in specific applications, facilitates further analysis and provides decision support for development planning, building site selection, and other areas. BRIEF DESCRIPTION OF THE DRAWINGS
[0066] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0067] Figure 12 is an overall framework diagram of a POI recommendation method for distinguishing between user exploratory patterns and spatiotemporal revisit patterns in an embodiment of the present invention. DETAILED DESCRIPTION
[0068] The present invention provides a POI recommendation method that distinguishes between user exploratory patterns and spatiotemporal revisit patterns. Taking into full consideration the user's preference for exploring new POIs and the intention to repeatedly visit fixed locations, the self-attention model is designed and improved, solving the problem that traditional POI recommendation methods do not distinguish between user exploratory patterns and spatiotemporal revisit patterns, thereby achieving the purpose of improving the performance of POI recommendation.
[0069] In order to achieve the above object, the main concepts of the present invention are as follows:
[0070] First, we modeled user preferences in exploratory mode and in spatiotemporal revisit mode, calculating the spatiotemporal correlation coefficient using time intervals and spatial intervals. We then calculated the scores of all POIs in the POI candidate set for both modes. We then calculated the transition probabilities between exploratory mode and spatiotemporal revisit mode. Finally, we combined the POI scores and transition probabilities for both modes to calculate the final POI recommendation score. The final POI recommendation scores were then ranked and selected, recommending the top N POIs with the highest scores. This method offers efficient POI recommendation capabilities and can be used by platforms such as ride-hailing and travel recommendations to enhance the user travel experience.
[0071] To make the objectives, technical solutions, and advantages of the embodiments of the present invention more clear, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts shall fall within the scope of protection of the present invention.
[0072] Example 1
[0073] An embodiment of the present invention provides a POI recommendation method that distinguishes between user exploratory patterns and spatiotemporal revisit patterns, including:
[0074] S1: Obtain historical check-in data of all users, where the user's historical check-in data includes user ID, check-in time, POI ID, and POI spatial location;
[0075] S2: Randomly initialize the user embedding vector, POI embedding vector and spatial embedding vector according to the user ID, POI ID and spatial location of the POI in the user's historical check-in data, and generate the embedding vector e based on the user embedding vector, POI embedding vector and spatial embedding vector q 、ek 、e v ;
[0076] S3: Modeling the user's exploratory mode preference, inputting the user's sequence representation E into the self-attention network for learning, and outputting a new sequence representation, where the last vector in the new sequence representation is the user's exploratory model preference, outputting the ratings of all POIs in the POI candidate set in the exploratory mode, and the user's sequence representation is based on the embedding vector e q 、e k 、e v Obtain,the POI candidate set based on the historical check-in data of all users;
[0077] S4: Model the user's spatiotemporal revisit pattern preference, calculate the spatiotemporal similarity coefficient, and calculate the scores of all POIs in the POI candidate set under the spatiotemporal revisit pattern based on the input spatiotemporal similarity coefficient, the new sequence representation, and the last vector in the new sequence representation;
[0078] S5: Calculate the transition probability of the exploratory mode and the transition probability of the spatiotemporal revisit mode based on the spatiotemporal similarity coefficient, the new sequence representation and the last vector in the new sequence representation;
[0079] S6: Calculate the final score of POI recommendation based on the scores of all POIs in the POI candidate set in the exploratory mode, the transition probability of the exploratory mode, the scores of all POIs in the POI candidate set in the spatiotemporal revisit mode, and the transition probability of the spatiotemporal revisit mode;
[0080] S7: Sort the final scores of the POI recommendations, and recommend the POIs corresponding to the N highest final scores.
[0081] See Figure 1 , which is an overall framework diagram of a POI recommendation method for distinguishing between user exploratory patterns and spatiotemporal revisit patterns in an embodiment of the present invention.
[0082] In the specific implementation process, the historical check-in data of all users is obtained, where the POI set is L = l1, l2, ..., l |L|}, the user set is U={u1,u2,…,u |U|}; l1, l |L| Represent the first POI and the |L|th POI, u1, u |U| denote the first user and the |U|th user respectively, |L| and |U| are the number of POIs and users respectively. For user u∈U, the sequence of its historical check-ins can be expressed as in is the POI that the user checked in, P i =(loni ,lat i ) is the location The corresponding longitude and latitude coordinates of is the timestamp of user check-in, n is the length of the historical check-in sequence, and the recommendation goal of the model is to predict the user u in POIs visited at any time.
[0083] In step S2, define the embedding vector e q and the embedding vector e k The embedding vector e is defined as the sum of the spatial embedding vector, the user embedding vector and the POI embedding vector. v It is the result of adding the spatial embedding vector and the POI embedding vector.
[0084] The scores of all POIs in the POI candidate set in the exploration mode indicate the likelihood of the corresponding POI being recommended in the exploration mode. Similarly, the scores of all POIs in the POI candidate set in the spatiotemporal revisit mode indicate the likelihood of the corresponding POI being recommended in the spatiotemporal revisit mode.
[0085] The transition probability of the exploratory mode and the transition probability of the spatiotemporal revisit mode in step S5 are used to represent the extent to which the user's next visit behavior tends to explore new POIs and revisit historical POIs, respectively.
[0086] In one embodiment, the spatial location of the POI in S1 includes the longitude and latitude of the POI.
[0087] In one embodiment, step S2 includes:
[0088] S2.1: Fix the user's historical check-in data into a sequence of length m;
[0089] S2.2: Randomly initialize the user embedding vector, POI embedding vector and space embedding vector, defined as e user 、e poi and e spatial ;
[0090] S2.3: Generate an embedding vector e based on the user embedding vector, POI embedding vector, and spatial embedding vector q 、e k 、e v , where the embedding vector e q Represented as e q =e user +e poi +e spatial , embedding vector e k Represented as e k =e user +epoi +e spatial , embedding vector e v Represented as e v =e poi +e spatial .
[0091] Specifically, if the user's historical check-in count is less than m, the left side of the historical check-in sequence is padded with zeros until the sequence length equals m. If the user's historical check-in count is greater than m, only the most recent m user check-ins are retained. The above operation uses two masks to block sequence positions that affect attention calculations. The first mask blocks future check-in behaviors relative to the predicted POI. The other mask is used to adapt to user login sequences of varying lengths, that is, to block the zero-padding length on the left side of the sequence.
[0092] In one embodiment, step S3 includes:
[0093] S3.1: Take the user’s sequence representation E as the input of the self-attention network, where E = {e1, e2, …, e m}, the τth sequence e τ = <e q ,e k ,e v >, for e q ,e k ,e v Perform linear transformation to generate new embedding vectors Q, K and V, Q = e q W Q ,K=e k W K ,V=e v W V , W Q ,W K , is a learnable parameter;
[0094] S3.2: Input Q, K, and V into the self-attention mechanism for calculation. The formula is as follows:
[0095] SA(Q,K,V)=softmax(QK T )V
[0096] E′=FFN(O)=ReLU((SA(Q,K,V)W 1 +b 1 )W 2 +b 2 )
[0097] Among them, W 1 ,W 2 is the learnable matrix, b 1 ,b 2is the bias value, output E′={e′1,e′2,…,e′ m}, e′ m Represent the last vector in E′ as the new sequence;
[0098] S3.3: Use the dot product operation to calculate the exploratory mode recommendation score p of all POIs in the POI candidate set. The POI embedding vector in the POI candidate set is the POI embedding vector e corresponding to the POI number. poi , the formula for p is as follows:
[0099]
[0100] in, is the embedding vector of the i-th POI in the POI candidate set, and T is the embedding vector Transpose, e′ m is the last vector in the new sequence representation.
[0101] Specifically, SA(Q, K, V) refers to self-attention calculation with Q, K, and V as input, FFN is a feedforward neural network, O represents the output result of the self-attention calculation, and FFN(O) represents feedforward neural network calculation with O as input.
[0102] The POI candidate set is the complete POI set L = {l1,l2,…,l |L|}.
[0103] In one embodiment, step S4 includes:
[0104] S4.1: Obtain the user check-in sequence based on the user's historical check-in data, and use the time interval Δ between user check-ins t and the spatial interval Δ s , calculate the time similarity coefficient and spatial similarity coefficient The final spatiotemporal similarity coefficient Δ is obtained by adding the two together, and the formula is as follows:
[0105]
[0106] in, and are learnable parameters, and the max(·) and min(·) distributions represent the maximum and minimum values of the time interval and spacetime interval in the computation sequence;
[0107] S4.2: Calculate the recommendation score a of the τth POI that appears in the user's historical check-in sequence τ , the formula is as follows:
[0108]
[0109] Among them, V1, W1, W2 are learnable parameters, e′ τ is the τth embedding vector in E′, Δ is the spatiotemporal similarity coefficient, which enables the calculation of recommendation scores to take into account the spatiotemporal behavior characteristics of users, τ∈[1,m];
[0110] S4.3: For POIs that do not appear in the user's historical check-in sequence, the corresponding recommendation score is set to 0. The recommendation score r formula for the complete spatiotemporal revisit pattern is as follows:
[0111]
[0112] Among them, S u For the user's historical check-in sequence, τ is the τth POI that appeared in the user's historical check-in sequence.
[0113] In one embodiment, step S5 includes:
[0114] S5.1: Input the new sequence representation E′ and the last vector e′ in the new sequence representation m And the spatiotemporal similarity coefficient Δ, calculate the spatiotemporal conversion coefficient K, the formula is as follows:
[0115]
[0116] Among them, V2, W3, W4 are learnable parameters, and tanh is the Tanh activation function;
[0117] S5.2: Input K into a linear transformation and softmax function to calculate the transition probability K of the spatiotemporal revisit pattern I and the transition probability K of the exploratory mode P , the formula is as follows:
[0118]
[0119] in are learnable parameters.
[0120] In one embodiment, step S6 includes:
[0121] S6.1: Calculate the final recommendation score of the exploratory mode and the final recommendation score of the spatiotemporal revisit mode using the following formula:
[0122] P=K P *p
[0123] R=K I *r
[0124] Among them, K I is the transition probability of the spatiotemporal revisit pattern, KP is the transition probability of the exploratory mode, P is the final recommendation score of the exploratory mode, and R is the final recommendation score of the spatiotemporal revisit mode;
[0125] S6.2: Calculate the final score of POI recommendation using the following formula:
[0126] score=P+R
[0127] Among them, score is the final score of POI recommendation. P With K I The sum of is 1.
[0128] This invention addresses the problem of traditional POI recommendation methods failing to distinguish between user exploration patterns and spatiotemporal revisit patterns, further improving POI recommendation performance. Simultaneously modeling both user exploration patterns and spatiotemporal revisit patterns allows for a better understanding of user travel intentions, enabling more scientific, effective, and authentic recommendations for next travel locations. This analysis facilitates decision-making support for development planning, building site selection, and more.
[0129] Example 2
[0130] Based on the same inventive concept, this embodiment provides a POI recommendation device that distinguishes between user exploratory patterns and spatiotemporal revisit patterns, including:
[0131] The data acquisition module is used to obtain the historical check-in data of all users, where the user's historical check-in data includes user ID, check-in time, POI ID, and spatial location of the POI;
[0132] The embedding vector generation module is used to randomly initialize the user embedding vector, POI embedding vector and spatial embedding vector according to the user number, POI number and spatial position of the POI in the user's historical check-in data, and generate the embedding vector e based on the user embedding vector, POI embedding vector and spatial embedding vector q 、e k 、e v ;
[0133] The exploratory mode preference modeling module is used to model the user's exploratory mode preference. It inputs the user's sequence representation E into the self-attention network for learning and outputs a new sequence representation. The last vector in the new sequence representation is the user's exploratory model preference. The module also outputs the ratings of all POIs in the POI candidate set under exploratory mode. The user's sequence representation E is obtained based on the embedding vectors q, k, and v. The POI candidate set is obtained based on the historical check-in data of all users.
[0134] The spatiotemporal revisit mode preference modeling module is used to model the user's exploratory mode preference. The user's sequence representation E is input into the self-attention network for learning, and a new sequence representation is output. The last vector in the new sequence representation is the preference of the user's exploratory model. The ratings of all POIs in the POI candidate set in the exploratory mode are output. The user's sequence representation E is based on the embedding vector e q 、e k 、e v Obtain,the POI candidate set based on the historical check-in data of all users;
[0135] a transition probability calculation module, used to calculate the transition probability of the exploratory mode and the transition probability of the spatiotemporal revisit mode according to the spatiotemporal similarity coefficient, the new sequence representation and the last vector in the new sequence representation;
[0136] The final score calculation module of the recommendation is used to calculate the final score of the POI recommendation based on the scores of all POIs in the POI candidate set in the exploratory mode, the transition probability of the exploratory mode, the scores of all POIs in the POI candidate set in the spatiotemporal revisit mode, and the transition probability of the spatiotemporal revisit mode;
[0137] The POI recommendation module is used to sort the final scores of the POI recommendations and recommend the POIs corresponding to the N highest final scores.
[0138] Since the apparatus described in Example 2 of the present invention is used to implement the POI recommendation method for distinguishing between user exploratory patterns and spatiotemporal revisit patterns described in Example 1 of the present invention, the specific structure and variations of the apparatus are readily apparent to those skilled in the art based on the method described in Example 1 of the present invention, and thus will not be further described here. All apparatuses used in the method described in Example 1 of the present invention are within the scope of protection of the present invention.
[0139] Example 3
[0140] Based on the same inventive concept, the present invention further provides a computer-readable storage medium on which a computer program is stored. When the program is executed, the method described in the first embodiment is implemented.
[0141] Since the computer-readable storage medium described in Example 3 of the present invention is used to implement the POI recommendation method for distinguishing between user exploratory patterns and spatiotemporal revisit patterns described in Example 1 of the present invention, the specific structure and variations of this computer-readable storage medium are readily apparent to those skilled in the art based on the method described in Example 1 of the present invention, and thus will not be further described here. Any computer-readable storage medium used in the method of Example 1 of the present invention falls within the scope of protection of the present invention.
[0142] Example 4
[0143] Based on the same inventive concept, the present application also provides a computer device, including storage, a processor, and a computer program stored in the storage and executable on the processor. When the processor executes the program, the method in the first embodiment is implemented.
[0144] Since the computer device described in Example 4 of the present invention is used to implement the POI recommendation method for distinguishing between user exploratory patterns and spatiotemporal revisit patterns described in Example 1 of the present invention, the specific structure and variations of this computer device are readily apparent to those skilled in the art based on the method described in Example 1 of the present invention, and thus will not be further described here. All computer devices used in the method described in Example 1 of the present invention fall within the scope of protection of the present invention.
[0145] It will be understood by those skilled in the art that embodiments of the present invention may be provided as methods, systems, or computer program products. Thus, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware. Furthermore, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0146] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowcharts and / or block diagrams, as well as combinations of processes and / or blocks in the flowcharts and / or block diagrams, 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 device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowcharts and / or block diagrams. 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.
[0147] Although the preferred embodiments of the present invention 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 present invention.
[0148] Obviously, those skilled in the art may make various changes and modifications to the embodiments of the present invention without departing from the spirit and scope of the embodiments of the present invention. Thus, if such changes and modifications of the embodiments of the present invention fall within the scope of the claims and their equivalents, the present invention is intended to include such changes and modifications.
Claims
1. A POI recommendation method that distinguishes between user exploration patterns and spatiotemporal revisit patterns, characterized in that: include: S1: Obtain historical check-in data of all users, where the user's historical check-in data includes user ID, check-in time, POI ID, and POI spatial location; S2: Randomly initialize the user embedding vector, POI embedding vector and spatial embedding vector according to the user ID, POI ID and spatial location of the POI in the user's historical check-in data, and generate the embedding vector e based on the user embedding vector, POI embedding vector and spatial embedding vector q 、e k 、e v ; S3: Modeling the user's exploratory mode preference, inputting the user's sequence representation E into the self-attention network for learning, and outputting a new sequence representation, where the last vector in the new sequence representation is the user's exploratory model preference, outputting the ratings of all POIs in the POI candidate set in the exploratory mode, and the user's sequence representation is based on the embedding vector e q 、e k 、e v Obtain,the POI candidate set based on the historical check-in data of all users; S4: Model the user's spatiotemporal revisit pattern preference, calculate the spatiotemporal similarity coefficient, and calculate the scores of all POIs in the POI candidate set under the spatiotemporal revisit pattern based on the input spatiotemporal similarity coefficient, the new sequence representation, and the last vector in the new sequence representation; S5: Calculate the transition probability of the exploratory mode and the transition probability of the spatiotemporal revisit mode based on the spatiotemporal similarity coefficient, the new sequence representation and the last vector in the new sequence representation; S6: Calculate the final score of POI recommendation based on the scores of all POIs in the POI candidate set in the exploratory mode, the transition probability of the exploratory mode, the scores of all POIs in the POI candidate set in the spatiotemporal revisit mode, and the transition probability of the spatiotemporal revisit mode; S7: Sort the final scores of the POI recommendations, and recommend the POIs corresponding to the N highest final scores.
2. The POI recommendation method for distinguishing between user exploratory patterns and spatiotemporal revisit patterns according to claim 1, wherein: The spatial location of the POI in S1 includes the longitude and latitude of the POI.
3. The POI recommendation method for distinguishing between user exploratory patterns and spatiotemporal revisit patterns according to claim 1, wherein: Step S2 includes: S2.1: Fix the user's historical check-in data into a sequence of length m; S2.2: Randomly initialize the user embedding vector, POI embedding vector and space embedding vector, defined as e user 、e poi and e spatial ; S2.3: Generate an embedding vector e based on the user embedding vector, POI embedding vector, and spatial embedding vector q 、e k 、e v , where the embedding vector e q Represented as e q =e user +e poi +e spatial , embedding vector e k Represented as e k =e user +e poi +e spatial , embedding vector e v Represented as e v =e poi +e spatial .
4. The POI recommendation method for distinguishing between user exploratory patterns and spatiotemporal revisit patterns according to claim 1, wherein: Step S3 includes: S3.1: Take the user’s sequence representation E as the input of the self-attention network, where E = {e1, e2, ..., e m }, the τth sequence e τ = <e q , e k , e v >, for e q , e k , e v Perform linear transformation to generate new embedding vectors Q, K and V, Q = e q W Q , K=e k W K , V=e v W V , is a learnable parameter; S3.2: Input Q, K, and V into the self-attention mechanism for calculation. The formula is as follows: SA(Q,K,V)=softmax(QK T )V E′=FFN(O)=ReLU((SA(Q,K,V)W 1 +b 1 )W 2 +b 2 ) Among them, W 1 , W 2 is the learnable matrix, b 1 , b 2 is the bias value, output E′={e′1,e′2,...,e′ m }, e′ m Represent the last vector in E′ as the new sequence; S3.3: Use the dot product operation to calculate the exploratory mode recommendation score p of all POIs in the POI candidate set I. The POI embedding vector in the POI candidate set is the POI embedding vector e corresponding to the POI number. poi , the formula for p is as follows: in, is the embedding vector of the i-th POI in the POI candidate set, and T is the embedding vector Transpose, e′ m is the last vector in the new sequence representation.
5. The POI recommendation method for distinguishing between user exploratory patterns and spatiotemporal revisit patterns according to claim 1, wherein: Step S4 includes: S4.1: Obtain the user check-in sequence based on the user's historical check-in data, and use the time interval Δ between user check-ins t and the spatial interval Δ s , calculate the time similarity coefficient and spatial similarity coefficient The final spatiotemporal similarity coefficient Δ is obtained by adding the two together, and the formula is as follows: in, and are learnable parameters, and the max(·) and min(·) distributions represent the maximum and minimum values of the time interval and spacetime interval in the computation sequence; S4.2: Calculate the recommendation score a of the τth POI that appears in the user's historical check-in sequence τ , the formula is as follows: Among them, V1, W1, W2 are learnable parameters, e′ τ is the τth embedding vector in E′, Δ is the spatiotemporal similarity coefficient, which enables the calculation of recommendation scores to take into account the spatiotemporal behavior characteristics of users, τ∈[1,m]; S4.3: For POIs that do not appear in the user's historical check-in sequence, the corresponding recommendation score is set to 0. The recommendation score r formula for the complete spatiotemporal revisit pattern is as follows: Among them, S u is the user's historical check-in sequence, l τ is the τth POI that appeared in the user's historical check-in sequence.
6. The POI recommendation method for distinguishing between user exploratory patterns and spatiotemporal revisit patterns according to claim 1, wherein: Step S5 includes: S5.1: Input the new sequence representation E′ and the last vector e′ in the new sequence representation m And the spatiotemporal similarity coefficient Δ, calculate the spatiotemporal conversion coefficient K, the formula is as follows: Among them, V2, W3, W4 are learnable parameters, and tanh is the Tanh activation function; S5.2: Input K into a linear transformation and softmax function to calculate the transition probability K of the spatiotemporal revisit pattern I and the transition probability K of the exploratory mode P , the formula is as follows: in are learnable parameters.
7. The POI recommendation method for distinguishing between user exploration mode and spatiotemporal revisit mode according to claim 1, wherein: Step S6 includes: S6.1: Calculate the final recommendation score of the exploratory mode and the final recommendation score of the spatiotemporal revisit mode using the following formula: P=K P *p R=K I *r Among them, K I is the transition probability of the spatiotemporal revisit pattern, K P is the transition probability of the exploratory mode, P is the final recommendation score of the exploratory mode, and R is the final recommendation score of the spatiotemporal revisit mode; S6.2: Calculate the final score of POI recommendation using the following formula: score=P+R Among them, score is the final score of POI recommendation.
8. A POI recommendation device that distinguishes between user exploratory patterns and spatiotemporal revisit patterns, characterized in that: include: The data acquisition module is used to obtain the historical check-in data of all users, where the user's historical check-in data includes user ID, check-in time, POI ID, and spatial location of the POI; The embedding vector generation module is used to randomly initialize the user embedding vector, POI embedding vector and spatial embedding vector according to the user number, POI number and spatial position of the POI in the user's historical check-in data, and generate the embedding vector e based on the user embedding vector, POI embedding vector and spatial embedding vector q 、e k 、e v ; The exploratory mode preference modeling module is used to model the user's exploratory mode preference. It inputs the user's sequence representation E into the self-attention network for learning and outputs a new sequence representation. The last vector in the new sequence representation is the user's exploratory model preference. The module also outputs the ratings of all POIs in the POI candidate set under exploratory mode. The user's sequence representation E is obtained based on the embedding vectors q, k, and v. The POI candidate set is obtained based on the historical check-in data of all users. The spatiotemporal revisit mode preference modeling module is used to model the user's exploratory mode preference. The user's sequence representation E is input into the self-attention network for learning, and a new sequence representation is output. The last vector in the new sequence representation is the preference of the user's exploratory model. The ratings of all POIs in the POI candidate set in the exploratory mode are output. The user's sequence representation E is based on the embedding vector e q 、e k 、e v Obtain,the POI candidate set based on the historical check-in data of all users; a transition probability calculation module, used to calculate the transition probability of the exploratory mode and the transition probability of the spatiotemporal revisit mode according to the spatiotemporal similarity coefficient, the new sequence representation and the last vector in the new sequence representation; The final score calculation module of the recommendation is used to calculate the final score of the POI recommendation based on the scores of all POIs in the POI candidate set in the exploratory mode, the transition probability of the exploratory mode, the scores of all POIs in the POI candidate set in the spatiotemporal revisit mode, and the transition probability of the spatiotemporal revisit mode; The POI recommendation module is used to sort the final scores of the POI recommendations and recommend the POIs corresponding to the N highest final scores.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed, the method according to any one of claims 1 to 7 is implemented.
10. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the method according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Method for establishing dynamic instant recommendation service model under mobile spatio-temporal awareness
CN107562947A
POI recommendation method based on user personalized life mode
CN114065024A