A point of interest recommendation method combining non-continuity and multi-level periodicity

CN117828197BActive Publication Date: 2026-10-27BEIJING UNIV OF TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311756470.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-12-19
Publication Date
2026-10-27
Estimated Expiration
2043-12-19

AI Technical Summary

Technical Problem

[0005]虽然对兴趣点推荐模型进行了大量的研究,并取得了很好的结果,但仍存在几个问题:其一,大多数研究只对用户的签到序列中的连续活动进行建模,然而,用户将要访问的下一个地点受空间距离和时间间隔的影响,会出现非连续的访问地点的情况

Benefits of technology

[0060]针对目前兴趣点推荐缺少对非连续性签到的考虑,以及缺少对多层次周期性和短期偏好的建模,本发明提出了通过在自注意力编码器中加入时空间隔权重信息来考虑非连续签到的影响,捕获非连续性签到的时空影响,同时使用基于用户的可学习参数来自适应调整时间和空间对非连续性签到的影响权重。此外,使用长短期轨迹来分别建模长期偏好和短期偏好,并在长期偏好中,使用短期轨迹的最后一次签到时间和短期偏好的聚合表示来注意长期轨迹,捕获长期轨迹中的多层次周期性。最后使用用户嵌入注意聚合长期轨迹得到长期偏好。结合用户的长期偏好和短期偏好,有效提升了兴趣点推荐的精度。实验数据证明,本方法对比近几年最优秀的3个基线模型,平均提高了14%-31%的预测精度,通过本发明所述的方法可给用户的出行提供推荐;商家根据用户的个性化偏好提供个性化服务,获得良好的经济效益。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117828197B_ABST
    Figure CN117828197B_ABST
Patent Text Reader

Abstract

The application provides a point of interest recommendation method combining non-continuity and multi-level periodicity, comprising the following steps: 1, obtaining the historical check-in records of a user, dividing the historical check-in records of the user into trajectories in units of days, and dividing the trajectories into long-term trajectories and short-term trajectories; 2, inputting the long-term trajectories and the short-term trajectories into a self-attention encoder respectively, and adding the time-space interval information of the trajectories in the encoding process to consider the influence of non-continuous check-in; 3, using self-attention to aggregate the features of the short-term trajectories to obtain a short-term preference; 4, using the last check-in time of the short-term trajectories to pay attention to the check-in records of the long-term trajectories, using the short-term preference to pay attention to the long-term trajectories to consider the multi-level periodicity of the user check-in, and using the user to pay attention to aggregation to obtain a long-term preference; 5, splicing the long-term preference and the short-term preference of the user, and performing point of interest recommendation through a fully connected layer. The application improves the accuracy of point of interest recommendation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of data mining and recommendation system technology, specifically relating to a method for recommending points of interest that combines discontinuity and multi-level periodicity. Background Technology

[0002] In recent years, the widespread adoption of GPS-enabled mobile devices has led to significant advancements in location-based services (LBS). Service providers like Foursquare, Gowalla, and Dianping allow users to share their locations and experiences with friends by checking in at points of interest (e.g., restaurants or shopping malls). The accumulation of vast amounts of spatiotemporal check-in data has created opportunities for research into point-of-interest (POI) recommendations. POI recommendations not only bring commercial value to businesses but also uncover user movement patterns and personalized preferences. For businesses, analyzing user preferences and providing personalized services enhances user experience and platform visibility. For users, understanding movement patterns and personalized preferences provides travel suggestions and convenience, helps them understand their living environment and city, and improves their quality of life. Next POI recommendation can predict the points of interest a user is most likely to visit at a given time, exhibiting strong timeliness and thus attracting widespread attention from industry and academia.

[0003] Existing interest recommendation technologies can be divided into traditional recommendation methods and deep learning-based recommendation methods. Traditional recommendation methods mainly focus on learning the implicit features of users and POIs (i.e., matrix factorization) and sequence transformations (e.g., Markov chains). In recent years, deep learning has been widely applied to point-of-interest (POI) recommendation. Compared with traditional recommendation methods, deep learning can mine deeper structural relationships from data and achieve better performance. For example, inspired by the success of recurrent neural networks (RNNs) in sequential data modeling, methods based on RNNs and their variants have become prevalent in the next field of POI recommendation. However, RNN-based methods are prone to gradient vanishing or gradient exploding problems when dealing with long-term data sequences.

[0004] Because of the significant breakthroughs achieved by the Transformer model in natural language processing, and because the attention mechanism has better long-term sequence modeling capabilities than recurrent neural networks and their variants, researchers have attempted to apply the attention mechanism to interest point recommendation tasks in order to better model users' static and dynamic preferences.

[0005] Although extensive research has been conducted on point-of-interest (POI) recommendation models and good results have been achieved, several problems remain: First, most studies only model continuous activities within a user's check-in sequence. However, the next location a user intends to visit is influenced by spatial distance and time intervals, leading to non-continuous visits. Therefore, modeling should consider not only continuous check-ins but also the impact of non-continuous check-ins. Second, there is a lack of consideration for mining multi-level periodic patterns in users' historical check-in trajectories. Current research methods often focus on the periodic interests of a specific POI or a specific POI category. Multi-level periodicity refers to the periodicity of a user's activities at a specific point in time, and also the periodicity of a user's activities on a given day. When recommending the next location to a user, considering the current time and the current check-in trajectory can improve recommendation accuracy. Third, user preferences change dynamically over time. Most methods can only model long-term stable preferences, ignoring short-term preferences. Summary of the Invention

[0006] To address the key issues that remain unresolved, this invention proposes a point-of-interest recommendation method that combines discontinuity and multi-level periodicity, aiming to overcome the shortcomings of existing technologies and improve the accuracy of recommendations.

[0007] To achieve the above objectives, the present invention adopts the following technical solution:

[0008] A method for recommending points of interest that combines discontinuity and multi-level periodicity includes the following steps:

[0009] Step 1: Input the user's historical check-in data, where each check-in record includes the user's ID, point of interest ID, point of interest category, check-in time, and check-in time pattern;

[0010] Step 2: Sort the user's historical check-in records according to the access time to obtain the user check-in sequence. Divide the user's check-in sequence into a trajectory in days. Divide the user's check-in trajectory into multiple long and short trajectories according to the time window.

[0011] Step 3: Calculate the time interval weight matrix and spatial distance weight matrix for the long-term and short-term trajectories in each long-term and short-term trajectory, respectively;

[0012] Step 4: Input each long and short trajectory and its corresponding spatiotemporal interval information into the self-attention encoder, and adaptively adjust the influence of time and space information to extract the continuity and discontinuity features of the trajectory;

[0013] Step 5: For the encoded short-term trajectory, the user's short-term preferences are obtained through self-attention aggregation;

[0014] Step 6: For the encoded long-term trajectory, firstly, use the last check-in time of the short-term trajectory to aggregate the check-in records of the long-term trajectory; secondly, use the user's short-term preferences to aggregate the long-term trajectory; finally, use the user's attention to aggregate the long-term trajectory to obtain the user's long-term preferences.

[0015] Step 7: Concatenate long-term and short-term preferences, and then pass the concatenation through a fully connected neural network. The function decodes the probability of visiting each point of interest in the next step in the current long and short trajectories.

[0016] Step 8: Train the model using cross-entropy loss to obtain the point of interest recommendation model;

[0017] As a preferred embodiment, the user check-in record in step 1 is in the following format:

[0018]

[0019] in, This indicates the user's check-in record; Indicates the user ID; Indicates the point of interest ID; Indicates the category of points of interest; Indicates the timestamp of the check-in; This indicates the current time pattern. The value is 0 if the current time is a weekday and 1 if the current time is a weekend, which is intended to better extract periodic features.

[0020] Preferably, the data processing steps in step 2 include:

[0021] Step 2-1: Sort the user's historical check-in records by access time to obtain the user's check-in sequence, and divide the user's check-in sequence into trajectories on a daily basis. , Indicates user In the The daily check-in sequence includes... Sign-in record .

[0022] Step 2-2: Clean the check-in trajectory data; if the number of check-ins in a trajectory is less than 3, the trajectory is considered unrepresentative and is deleted; if a user has less than 3 check-in trajectories, the user and their check-in data are considered unrepresentative and are deleted.

[0023] Steps 2-3: Divide the user's trajectory data into multiple long-term and short-term trajectory data according to time windows. Set the time window size to a positive integer, preferably 30, meaning that a long-term or short-term trajectory can contain a maximum of 30 days of check-in records. Each long-term or short-term trajectory data is represented as... ,in This indicates a long-term check-in history. This indicates a short-term check-in history. The number of trajectories in the long-term and short-term trajectories. This represents the user ID.

[0024] As a preferred method, the trajectory spatiotemporal information calculation method in step 3 is as follows:

[0025] Step 3-1: Calculate the time interval weight matrix of the trajectory for a user's check-in trajectory on a certain day. The formula for calculating the time interval between any two check-in records in the trajectory is as follows: , indicating the first The first check-in timestamp and the first The time interval of each check-in timestamp. Next, the time interval is converted into a time interval weight, calculated using the following formula: , indicating the first The first check-in timestamp and the first The weights of each check-in timestamp time interval are used to obtain the time interval weight matrix of the trajectory, which is represented as follows:

[0026]

[0027] in, This represents the number of times a user checks in on that day, with the time interval weight matrix. In This indicates that the matrix is ​​a time interval weight matrix.

[0028] Step 3-2: Calculate the spatial distance weight matrix of the trajectory for a user's check-in trajectory on a certain day. Calculate the spatial distance between any two check-in records in the trajectory, denoted as: , indicating the first The latitude and longitude of each check-in location and the The latitude and longitude of each check-in location Spatial distance, This formula is widely used in various geographic information systems and navigation applications to calculate the distance between two locations on Earth. Next, the spatial distance is converted into spatial distance weights, calculated using the following formula: The spatial distance weight matrix of the trajectory is obtained, and is expressed as:

[0029]

[0030] in, This represents the number of times a user checks in on that day, and the spatial distance weight matrix. In This indicates that the matrix is ​​a spatial distance weight matrix.

[0031] Preferably, step 4, which involves inputting the long- and short-term trajectories and their spatiotemporal information into the self-attention encoder, includes:

[0032] Step 4-1: For a user's long-term and short-term trajectories, the formula for embedding a check-in record from the trajectory is as follows:

[0033]

[0034] in, Indicates the first Sign-in record Embedded representation, Indicates user Embedded representation; Indicate points of interest Embedded representation; Indicates the category of points of interest Embedded representation; Indicates the check-in timestamp Embedded representation; Indicates time pattern Embedded representation, For the size of the embedding dimension, For the concatenation of embedding dimensions, embedding representation refers to representing the real information as a one-hot vector and then passing it through a fully connected neural network layer to form a vector representation. The range of values ​​for a vector or tensor is real numbers. Let be the embedding representation of a certain check-in trajectory, indicating that the check-in trajectory is represented as a vector form through embedding representation, and the embedding trajectory representation Include Embedding of check-in records. The long-term and short-term check-in tracks from steps 2-3 are converted into embedded representations, resulting in... This is an embedded representation of a long-term trajectory. This is an embedded representation of short-term trajectories.

[0035] Step 4-2: Input the embedding representation of each long and short-term trajectory into the self-attention encoder, using the following formula:

[0036]

[0037]

[0038] in, This is represented by the embedded representation of the trajectory obtained in step 4-1. This is the linear transformation matrix of Query, Key, and Value in a self-attention neural network. This represents the self-attention calculation function, which uses scaled dot product attention. F() is a commonly used mathematical function. The function is used to convert a vector into a probability distribution. This is the time interval and spatial distance weight matrix obtained in step 3-2. Since it's a self-attention neural network, it's set to... ,and A transpose operation was performed during the calculation, where Represents the query vector. Represents the key vector. Represents a value vector. For learnable parameters, for each user initialization It should be a positive number, and a value of 1 is recommended. This value should be placed in the Adam optimizer to adaptively adjust the impact of time and space information on non-continuous check-ins. This is the encoded trajectory hiding representation, i.e., the output of the self-attention encoder. The trajectory embedding representation obtained in step 4-1 is input into the self-attention encoder to obtain... The output is the encoded long-term trajectory. The output is a short-term encoded trajectory. Discontinuous features between check-ins are captured by adding time interval and spatial distance information.

[0039] As a preferred embodiment, the method for aggregating short-term trajectories in step 5 is as follows:

[0040]

[0041] in, This is the linear transformation matrix of Query, Key, and Value in a self-attention neural network. This represents the self-attention calculation function, which uses scaled dot product attention. F() is a commonly used mathematical function. The function is used to convert a vector into a probability distribution. This is the hidden representation of the encoded short-term trajectory obtained in step 4-2. This represents the aggregated short-term trajectory, i.e., the user's short-term preferences. Since it's a self-attention neural network, it's set to... ,and A transpose operation was performed during the calculation, where Represents the query vector. Represents the key vector. Represents a value vector. The sum of the last dimension of the tensor, since the dimension has been reduced by one, aggregates short-term trajectory features.

[0042] Preferably, the long-term trajectory aggregation step in step 6 is as follows:

[0043] Step 6-1: Use the embedded attention of the last check-in time of the short-term trajectory to aggregate the check-in records of the long-term trajectory, as shown in the following formula:

[0044]

[0045] in, For a certain trajectory of the long-term trajectory obtained in step 4-2, the first... The hidden representation of a check-in record. The embedding representation represents the last check-in time, and the formula includes a transpose operation. The embedding representation is that the last check-in time is represented as a one-hot vector, and then passed through a fully connected neural network to obtain the vector representation of the check-in time. Indicates the first that has been noted The weighted score of each check-in record is hidden. This indicates the last check-in time after a short-term trajectory. Note the aggregation. The hidden representation of a long-term trajectory, by applying each Perform a weighted summation operation to aggregate the results and obtain the daily neutral value. The most relevant check-in records capture the hourly time cycle characteristics throughout the day. Calculation The formula is function, where The base of the natural logarithm is represented by the exponent, and the value in parentheses is the exponent. In the two summation symbols, and Both represent a check-in record in a long-term trajectory, and this long-term trajectory has a total of One sign-in record.

[0046] Step 6-2: Using the aggregated representation of the short-term trajectory obtained in Step 5. Note the long-term trajectory representation obtained in Step 6-1, the formula is as follows:

[0047]

[0048] in, The first one obtained in step 6-1 The long-term trajectory indicates that, This is a hidden representation of all long-term trajectories within the time window obtained in step 6-1. This is an aggregated representation of the short-term trajectory obtained in step 5, and a transpose operation has been performed in the formula. For the first time after attention Long-term trajectory representation Weighted scores For the aggregation representation of short-term trajectories Note the first The hidden representation of a long-term trajectory is obtained through weighted scores. Multiply by the long-term trajectory This is done to strengthen long-term trajectories most correlated with short-term trajectories and weaken long-term trajectories uncorrelated with short-term trajectories, in order to capture daily cyclical characteristics. (Calculation) The formula is function, where This represents the base of the natural logarithm, with the value in parentheses being the exponent. In the summation notation, This represents a long-term trajectory, and there are a total of n-1 long-term trajectories, with the nth trajectory being a short-term trajectory.

[0049] Step 6-3: Aggregate the long-term trajectory representation obtained in Step 6-2 using user-embedded attention, as shown in the following formula:

[0050]

[0051] in, The first one obtained in step 6-2 The long-term trajectory indicates that, This is the hidden representation of all long-term trajectories within the time window obtained in step 6-2. The embedding representation of the user is given, and the transpose operation is performed in the formula. The so-called embedding representation is to represent the user as a one-hot vector and then pass it through a fully connected neural network to obtain the vector representation of the user. Representation of long-term trajectory after attention The weighted score obtained This is an aggregated representation of long-term trajectories, i.e., users' long-term preferences, achieved by analyzing each long-term trajectory representation. Perform a weighted summation operation to aggregate the results and the user's data. The most relevant long-term preferences enable personalized recommendations for users. (Calculation) The formula is function, where The base of the natural logarithm is represented by the exponent, and the value in parentheses is the exponent. In the two summation symbols, and Each represents a long-term trajectory, and there are a total of n-1 long-term trajectories, with the nth trajectory being a short-term trajectory.

[0052] Preferably, step 7, which involves concatenating the user's long-term and short-term preferences and decoding them through a fully connected layer, includes:

[0053] The user's long-term and short-term preferences are concatenated and represented as follows: The spliced ​​result The input is fed into a fully connected neural network and then... The probability distribution of recommended interest points obtained by the function is as follows:

[0054]

[0055] in, For the transformation matrix, This represents the predicted probability distribution.

[0056] Preferably, the cross-entropy loss function in step 8 is as follows:

[0057]

[0058] in, The training sample set is a set of long-term and short-term trajectories. The predicted probability of the baseline truth for a given training sample. Given a list of points of interest, select the top k most recommended locations.

[0059] Compared with the prior art, the present invention, employing the above technical solution, has the following technical effects:

[0060] To address the current shortcomings in interest point recommendation systems, such as the lack of consideration for discontinuous check-ins and the absence of modeling for multi-level periodicity and short-term preferences, this invention proposes a method that incorporates spatiotemporal interval weights into a self-attention encoder to account for the impact of discontinuous check-ins, capturing their spatiotemporal influence. Simultaneously, learnable parameters based on the user adaptively adjust the weights of temporal and spatial influences on discontinuous check-ins. Furthermore, long-term and short-term trajectories are used to model long-term and short-term preferences respectively. Within the long-term preference framework, the aggregation of the last check-in time of the short-term trajectory and the short-term preference is used to pay attention to the long-term trajectory, capturing its multi-level periodicity. Finally, user-embedded attention is used to aggregate the long-term trajectory to obtain the long-term preference. Combining the user's long-term and short-term preferences effectively improves the accuracy of interest point recommendation. Experimental data demonstrates that this method improves prediction accuracy by an average of 14%-31% compared to the three best baseline models from recent years. The method described in this invention can provide recommendations for users' travel plans; businesses can provide personalized services based on users' individual preferences, achieving significant economic benefits. Attached Figure Description

[0061] Figure 1 The flowchart shows the interest point recommendation method of this invention that combines discontinuity and multi-level periodicity.

[0062] Figure 2 This is a structural diagram of the interest point recommendation method that combines discontinuity and multi-level periodicity of the present invention.

[0063] Figure 3 This is a schematic diagram of the self-attention network structure in this invention;

[0064] Figure 4 This is a schematic diagram illustrating the impact of spatiotemporal interval information on discontinuous check-in in the trajectory in this invention;

[0065] Figure 5 This is a schematic diagram of the experimental results in this invention; Detailed Implementation

[0066] The specific embodiments of the present invention will be described in further detail below with reference to the accompanying drawings and examples. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments.

[0067] like Figure 1 and Figure 2 As shown, the technical route of the present invention mainly includes 6 steps, namely, data division into trajectories, trajectory division into long and short-term trajectories, spatiotemporal information and long and short-term trajectory encoding, short-term trajectory aggregation, long-term trajectory aggregation, long-term preference and short-term preference concatenation for training and recommendation.

[0068] This example uses the NYC and TKY check-in datasets from Foursquare to recommend user check-in locations using the interest point recommendation method of this invention, which combines discontinuity and multi-level periodicity. The following sections will introduce this example from three aspects: data processing and partitioning, model construction and training, and recommendation results.

[0069] 1) Data processing and partitioning

[0070] Step 1.1: Process the data in the dataset into check-in records. In this embodiment, the Foursquare check-in dataset is collected from the daily check-in behavior of users in New York City. Each check-in record includes the username, check-in timestamp, check-in location, location category, and geographical location information such as latitude and longitude coordinates.

[0071] In this embodiment, the set of users who sign in is represented as , The size of the user set represents the number of users who checked in; the set of points of interest is represented as... , The size of the set of points of interest represents the number of points of interest; the set of point of interest categories is represented as... , This represents the size of the set of interest categories, indicating the number of interest points; the set of timestamps for a day is represented as... , It consists of 24 time slots in a day; It is a collection of user activity patterns, including both weekday and weekend activity patterns.

[0072] The check-in records in the dataset are processed into the following format:

[0073]

[0074] in, This indicates the user's check-in record; Indicates the user ID; Indicates the point of interest ID; Indicates the category of points of interest; Indicates the timestamp of the check-in; This indicates the current time pattern. The value is 0 if the current time is a weekday and 1 if the current time is a weekend, which is intended to better extract periodic features.

[0075] Step 1.2: Sort the historical check-in records of the users processed in Step 1 according to the check-in timestamp to obtain the user check-in sequence. Divide the user check-in sequence into multiple trajectories in days. Divide the user check-in trajectory into multiple long and short trajectories according to the time window. One long and short trajectory represents one training sample and is the unit for model training.

[0076] A trajectory with fewer than 3 check-in records is considered unrepresentative and will be removed. Similarly, a user with fewer than 3 trajectories is considered unrepresentative and will have their data removed. Each trajectory represents one day of a user's check-in records. Trajectories are divided into long and short-term trajectories based on a 30-day time window. The time window indicates that the number of a user's check-in trajectories cannot exceed 30 days, and each long and short-term trajectory must contain at least 3 trajectories. Long and short-term trajectories are represented as follows: ,in This indicates a long-term check-in history. This represents the short-term check-in trajectory, where n is the number of trajectories in the short-term and long-term trajectories. This represents the user ID.

[0077] In this embodiment, the data in the Foursquare check-in dataset is filtered according to the steps described above. After processing, the dataset contains 1067 users, 29870 points of interest, 138662 check-in records, and 22136 trajectories.

[0078] Step 1.3: Calculate the spatiotemporal interval weight matrix for long and short trajectories. The purpose of the spatiotemporal interval weight matrix is ​​to assign different weights to the self-attention scores of the trajectories. That is, the smaller the time interval plus the spatial distance, the higher the weight is assigned. When updating the trajectory weights, the influence of continuous and discontinuous check-ins can be taken into account at the same time.

[0079] The time interval weight matrix is ​​used to calculate the trajectory for a user's check-in trajectory on a given day. The formula for calculating the time interval between any two check-in records in the trajectory is as follows: , indicating the first The first check-in timestamp and the first The time interval of each check-in timestamp. Next, the time interval is converted into a time interval weight, calculated using the following formula: , indicating the first The first check-in timestamp and the first The weights of each check-in timestamp time interval are used to obtain the time interval weight matrix of the trajectory, which is represented as follows:

[0080] in, This represents the number of times a user checks in on that day, with the time interval weight matrix. In This indicates that the matrix is ​​a time interval weight matrix.

[0081] Calculate the spatial distance weight matrix of the trajectory for a user's check-in trajectory on a given day. Calculate the spatial distance between any two check-in records in the trajectory, denoted as: , indicating the first The latitude and longitude of each check-in location and the The latitude and longitude of each check-in location Spatial distance, This formula is widely used in various geographic information systems and navigation applications to calculate the distance between two locations on Earth. Next, the spatial distance is converted into spatial distance weights, calculated using the following formula: The spatial distance weight matrix of the trajectory is obtained, and is expressed as:

[0082] in, This represents the number of times a user checks in on that day, and the spatial distance weight matrix. In This indicates that the matrix is ​​a spatial distance weight matrix.

[0083] In this embodiment, the time unit for calculating the time interval is minutes, the distance unit for calculating the spatial distance is hundreds of meters, and finally the spatiotemporal interval weight matrix is ​​obtained, with the weight ranging from 0 to 1.

[0084] 2) Model building and training

[0085] Step 2.1: Feed each training sample, i.e., the long and short trajectories, into the embedding module, such as... Figure 2 As shown, the embedded representation of long and short trajectories is obtained.

[0086] The formula for embedding a check-in record from the trajectory is as follows:

[0087]

[0088] in, Indicates attendance record Embedded representation, Indicates user Embedded representation; Indicate points of interest Embedded representation; Indicates the category of points of interest Embedded representation; Indicates the check-in timestamp Embedded representation; Indicates time pattern Embedded representation, For the size of the embedding dimension, For the concatenation of embedding dimensions, embedding representation refers to representing the real information as a one-hot vector and then passing it through a fully connected neural network layer to form a vector representation. The range of values ​​for a vector or tensor is real numbers.

[0089] go through Figure 2 From the embedded layer in the middle, we can know that An embedded representation of a certain check-in trajectory. This is a hidden representation of the long-term trajectory. This is a hidden representation of short-term trajectories.

[0090] Step 2.2: Input the embedding representation of each long and short trajectory into the self-attention encoder. Figure 3 This is one implementation structure of a self-attention encoder, where the structure can have multiple layers, meaning it can encode multiple times. The implementation formula is as follows:

[0091]

[0092]

[0093] in, This is represented by the embedded representation of the trajectory obtained in step 2.1. This is the linear transformation matrix of Query, Key, and Value in a self-attention neural network. This represents the self-attention calculation function, which uses scaled dot product attention. F() is a commonly used mathematical function. The function is used to convert a vector into a probability distribution. This is the time interval and spatial distance weight matrix obtained in step 1.3. Since it's a self-attention neural network, it's set to... ,and A transpose operation was performed during the calculation, where Represents the query vector. Represents the key vector. Represents a value vector. For learnable parameters, for each user initialization It should be a positive number, and a value of 1 is recommended. This value should be placed in the Adam optimizer to adaptively adjust the impact of time and space information on non-continuous check-ins. This is the encoded trajectory hiding representation, i.e., the output of the self-attention encoder. The trajectory embedding representation obtained in step 2.1 is input into the self-attention encoder to obtain... The output is the encoded long-term trajectory. The output is a coded short-term trajectory. The discontinuous features between check-ins are captured by adding time interval and spatial distance information.

[0094] In this embodiment, the embedding dimension size Set to 60, embed the check-in records after dimension concatenation. Size is 300, self-attention encoder layer number is set to 1, learnable parameters The initial value is set to 1.

[0095] like Figure 4 The image shows a user's check-in trajectory on a certain day. The solid arrows represent actual check-in records, while the dashed arrows represent time intervals plus the shortest spatial distance and the shortest spatial distance, respectively. Since user activities are uncertain, these non-continuous visits also need to be considered. Figure 4 In the example, a user might go from the restaurant to the bar because they might not need to shop and short spatial intervals would affect their visit. Similarly, a user might go from home to the bar, as short geographical distances can influence visitation. This is achieved by adding spatial interval weights to the attention weight score and updating the hidden representation of the trajectory. Figure 4 The example demonstrates the functionality.

[0096] Step 2.3: Aggregate short-term trajectories. Input the embedding representations of the short-term trajectories into the attention aggregation module and aggregate the embedding representations of the short-term trajectories. The method is as follows:

[0097]

[0098] in, This is the linear transformation matrix of Query, Key, and Value in a self-attention neural network. This represents the self-attention calculation function, which uses scaled dot product attention. F() is a commonly used mathematical function. The function is used to convert a vector into a probability distribution. This is the hidden representation of the encoded short-term trajectory obtained in step 2.2. This represents the aggregated short-term trajectory, i.e., the user's short-term preferences. Since it's a self-attention neural network, it's set to... ,and A transpose operation was performed during the calculation, where Represents the query vector. Represents the key vector. Represents a value vector. The sum of the last dimension of the tensor, since the dimension has been reduced by one, aggregates short-term trajectory features.

[0099] In this embodiment, short-term trajectory aggregation The dimension is 300.

[0100] Step 2.4: Use the embedding of the last check-in time of the short-term trajectory to aggregate the check-in records of the long-term trajectory, that is, to aggregate the embedding representation of multiple check-in records in the trajectory, as shown in the following formula:

[0101]

[0102] in, For a certain trajectory of the long-term trajectory obtained in step 2.2, the first... The hidden representation of a check-in record. The embedding representation represents the last check-in time, and the formula includes a transpose operation. The embedding representation is that the last check-in time is represented as a one-hot vector, and then passed through a fully connected neural network to obtain the vector representation of the check-in time. Indicates the first that has been noted The weighted score of each check-in record is hidden. This indicates the last check-in time after a short-term trajectory. Note the aggregation. The hidden representation of a long-term trajectory, by applying each Perform a weighted summation operation to aggregate the results and obtain the daily neutral value. The most relevant check-in records capture the hourly time cycle characteristics throughout the day. Calculation The formula is function, where The base of the natural logarithm is represented by the exponent, and the value in parentheses is the exponent. In the two summation symbols, and Both represent a check-in record in a long-term trajectory, and this long-term trajectory has a total of One sign-in record.

[0103] Step 2.5: Use the aggregated representation of the short-term trajectories obtained in Step 2.3. Note the long-term trajectory representation obtained in Step 2.4. That is, assign higher weights to trajectories in the long-term trajectory that are similar to the short-term trajectory, while assigning lower weights to trajectories that differ significantly from the short-term trajectory features. The reason is that the short-term trajectory represents the user's current preferences. The formula is as follows:

[0104]

[0105] in, The first one obtained in step 2.4 The long-term trajectory indicates that, This is the hidden representation of all long-term trajectories within the time window obtained in step 2.4. This is an aggregated representation of the short-term trajectory obtained in step 2.3, and the transpose operation is performed in the formula. For the first time after attention Long-term trajectory representation Weighted scores For the aggregation representation of short-term trajectories Note the first The hidden representation of a long-term trajectory is obtained through weighted scores. Multiply by the long-term trajectory This is done to strengthen long-term trajectories most correlated with short-term trajectories and weaken long-term trajectories uncorrelated with short-term trajectories, in order to capture daily cyclical characteristics. (Calculation) The formula is function, where This represents the base of the natural logarithm, with the value in parentheses being the exponent. In the summation notation, This represents a long-term trajectory, and there are a total of n-1 long-term trajectories, with the nth trajectory being a short-term trajectory.

[0106] Step 2.6: Aggregate the long-term trajectory representation obtained in Step 2.5 using user-embedded attention. This aggregates the features of the long-term trajectory and simultaneously obtains user-personalized features. The formula is as follows:

[0107]

[0108] in, The first one obtained in step 2.5 The long-term trajectory indicates that, This is the hidden representation of all long-term trajectories within the time window obtained in step 2.5. The embedding representation of the user is given, and the transpose operation is performed in the formula. The so-called embedding representation is to represent the user as a one-hot vector and then pass it through a fully connected neural network to obtain the vector representation of the user. Representation of long-term trajectory after attention The weighted score obtained This is an aggregated representation of long-term trajectories, i.e., users' long-term preferences, achieved by analyzing each long-term trajectory representation. Perform a weighted summation operation to aggregate the results and the user's data. The most relevant long-term preferences enable personalized recommendations for users. (Calculation) The formula is function, where The base of the natural logarithm is represented by the exponent, and the value in parentheses is the exponent. In the two summation symbols, and Each represents a long-term trajectory, and there are a total of n-1 long-term trajectories, with the nth trajectory being a short-term trajectory.

[0109] In this embodiment, the aggregated representation of long-term trajectories The dimension size is 300.

[0110] Step 2.7: Concatenate the user's long-term and short-term preferences to represent them as follows: The spliced ​​result The input is fed into a fully connected neural network and then... The probability distribution of recommended interest points obtained by the function is as follows:

[0111]

[0112] in, For the transformation matrix, This represents the predicted probability distribution.

[0113] In this embodiment, the predicted probability distribution The size is the number of points of interest, i.e., 29870. From the list of 29870 points of interest, the top scorers are selected. Using points of interest as the recommendation result, Points of interest are considered to be the locations where users are most likely to check in next time.

[0114] Step 2.8: Use the cross-entropy loss function as the loss function for model training, as shown in the following formula:

[0115]

[0116] in, The training sample set is a set of long-term and short-term trajectories. The predicted probability of the baseline truth for a given training sample.

[0117] In this embodiment, the training sample set The size is 12700.

[0118] 3) Recommendation Results

[0119] First, recall and normalized depreciation cumulative gain (NDCG) are used to evaluate the model's performance, explained in detail below:

[0120]

[0121]

[0122]

[0123] In the formula, To be before the recommended results The number of points of interest accessed by users in the results. Not recommended The results show that the higher the number of points of interest accessed by users and the higher the recall rate, the better the recommendation performance. Under ideal conditions The ranking Indicates the first The higher the relevance of the items ranked at each position, the higher the normalized discounted cumulative gain, and the better the recommendation performance. Among the two recommendation metrics, recall is calculated before... The ratio of true positive samples among all positive samples in a recommendation. Normalized discounted cumulative gain is used to measure the percentage of true positive samples. The quality of a recommendation's ranking is determined by its ranking; for the same number of correct recommendations, a higher ranking results in a higher score.

[0124] Figure 5 Experimental data demonstrates that, trained and used on the NYC dataset, our model achieves recall@5 of 0.3467 and normalized cumulative gain NDCG@5 of 0.2723. Compared to three of the best models in recent years, including PLSPL, LSTPM, and DeepMove, our model outperforms them by 10.27%–24.22%. On the TKY dataset, our model achieves recall@5 of 0.4320 and normalized cumulative gain NDCG@5 of 0.3584. Compared to three of the best models in recent years, our model outperforms them by 28.23%–48.04%.

[0125] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any person skilled in the art should understand that certain modifications and variations can be made to the present invention without departing from the spirit and substance of the present invention, but these modifications and variations should be covered within the scope of protection of the present invention.

Claims

1. A method for recommending points of interest that combines discontinuity and multi-level periodicity, characterized in that, Includes the following steps: Step 1: Input the user's historical check-in data, where each check-in record includes the user's ID, point of interest ID, point of interest category, check-in time, and check-in time pattern; Step 2: Sort the user's historical check-in records according to the access time to obtain the user check-in sequence. Divide the user's check-in sequence into a trajectory in days. Divide the user's check-in trajectory into multiple long and short trajectories according to the time window. Step 3: Calculate the time interval weight matrix and spatial distance weight matrix for the long-term and short-term trajectories in each long-term and short-term trajectory, respectively; Step 4: Input each long and short trajectory and its corresponding spatiotemporal interval information into the self-attention encoder, and adaptively adjust the influence of time and space information to extract the continuity and discontinuity features of the trajectory; Step 5: For the encoded short-term trajectory, the user's short-term preferences are obtained through self-attention aggregation; Step 6: For the encoded long-term trajectory, firstly, use the last check-in time of the short-term trajectory to aggregate the check-in records of the long-term trajectory; secondly, use the user's short-term preferences to aggregate the long-term trajectory; finally, use the user's attention to aggregate the long-term trajectory to obtain the user's long-term preferences. Step 7: Concatenate long-term and short-term preferences, and then pass the concatenation through a fully connected neural network. The function decodes the probability of visiting each point of interest in the next step in the current long and short trajectories. Step 8: Train the model using cross-entropy loss to obtain the point of interest recommendation model; The method for calculating the trajectory spatiotemporal information in step 3 is as follows: Step 3-1: Calculate the time interval weight matrix of the trajectory for a user's check-in trajectory on a certain day. The formula for calculating the time interval between any two check-in records in the trajectory is as follows: , indicating the first The first check-in timestamp and the first The time interval between each check-in timestamp; Next, the time intervals are converted into time interval weights, calculated using the following formula: , indicating the first The first check-in timestamp and the first The weights of each check-in timestamp time interval are used to obtain the time interval weight matrix of the trajectory, which is represented as follows: ; in, This represents the number of times a user checks in on that day, with the time interval weight matrix. In This indicates that the matrix is ​​a time interval weight matrix; Step 3-2: Calculate the spatial distance weight matrix of the trajectory for a user's check-in trajectory on a certain day. Calculate the spatial distance between any two check-in records in the trajectory, denoted as: , indicating the first The latitude and longitude of each check-in location and the The latitude and longitude of each check-in location Spatial distance, The formula is widely used in various geographic information systems and navigation applications to calculate the distance between two locations on Earth; next, the spatial distance is converted into spatial distance weights, calculated using the following formula: The spatial distance weight matrix of the trajectory is obtained, and is expressed as: ; in, This represents the number of times a user checks in on that day, and the spatial distance weight matrix. In This indicates that the matrix is ​​a spatial distance weight matrix; Step 4 inputs the long- and short-term trajectories and their spatiotemporal information into the self-attention encoder, including: Step 4-1: For a user's long-term and short-term trajectories, the formula for embedding a check-in record from the trajectory is as follows: ; in, Indicates the first Sign-in record Embedded representation, Indicates user Embedded representation; Indicate points of interest Embedded representation; Indicates the category of points of interest Embedded representation; Indicates the check-in timestamp Embedded representation; Indicates time pattern Embedded representation, For the size of the embedding dimension, For the concatenation of embedding dimensions, embedding representation refers to representing the real information as a one-hot vector and then passing it through a fully connected neural network layer to form a vector representation. The range of values ​​for a vector or tensor is real numbers; Let be the embedding representation of a certain check-in trajectory, meaning that the check-in trajectory is represented as a vector form through embedding representation, and the embedding trajectory representation Include Embedding of check-in records; converting the long-term and short-term check-in trajectories from steps 2-3 into embedded representations, resulting in... This is an embedded representation of long-term trajectories. An embedded representation of short-term trajectories; Step 4-2: Input the embedding representation of each trajectory of the long and short trajectories obtained in Step 4-1 into the self-attention encoder, as shown in the formula: ; ; in, This is represented by the embedded representation of the trajectory obtained in step 4-1. This is the linear transformation matrix of Query, Key, and Value in a self-attention neural network. This represents the self-attention calculation function, which uses scaled dot product attention; F() is a commonly used mathematical function. The function is used to convert a vector into a probability distribution. The weight matrix represents the time interval and spatial distance obtained in step 3-2; since it is a self-attention neural network, it is set to... ,and A transpose operation was performed during the calculation, where Represents the query vector. Represents the key vector. Represents a value vector; For learnable parameters, for each user initialization It should be a positive number, and it is recommended to take the value 1 and put it into the Adam optimizer to adaptively adjust the impact of time and space information on non-continuous check-ins; The encoded trajectory hiding representation is the output of the self-attention encoder; the embedded representation of the trajectory obtained in step 4-1 is input into the self-attention encoder to obtain... The output is the encoded long-term trajectory. The output is a short-term encoded trajectory; the discontinuous features between check-ins are captured by adding time interval and spatial distance information.

2. The interest point recommendation method combining discontinuity and multi-level periodicity as described in claim 1, characterized in that, The user check-in record in step 1 is in the following format: ; in, This indicates the user's check-in record; Indicates the user ID; Indicates the point of interest ID; Indicates the category of points of interest; Indicates the timestamp of the check-in; This indicates the current time pattern. The value is 0 if the current time is a weekday and 1 if the current time is a weekend, which is intended to better extract periodic features.

3. The interest point recommendation method combining discontinuity and multi-level periodicity as described in claim 1, characterized in that, The data processing steps in step 2 include: Step 2-1: Sort the user's historical check-in records by access time to obtain the user's check-in sequence, and divide the user's check-in sequence into trajectories on a daily basis. , Indicates user In the The daily check-in sequence includes... Sign-in record ; Step 2-2: Clean the check-in trajectory data; if the number of check-ins in a trajectory is less than 3, the trajectory is considered unrepresentative and is deleted; if a user has less than 3 check-in trajectories, the user and their check-in data are considered unrepresentative and are deleted. Steps 2-3: Divide the user's trajectory data into multiple long-term and short-term trajectory data according to time windows. Set the time window size to a positive integer, preferably 30, meaning that a long-term or short-term trajectory can contain a maximum of 30 days of check-in records. Each long-term or short-term trajectory data is represented as... ,in This indicates a long-term check-in history. This indicates a short-term check-in history. The number of trajectories in the long-term and short-term trajectories. This represents the user ID.

4. The interest point recommendation method combining discontinuity and multi-level periodicity as described in claim 1, characterized in that, Step 5, the method for aggregating short-term trajectories, is as follows: ; in, This is the linear transformation matrix of Query, Key, and Value in a self-attention neural network. This represents the self-attention calculation function, which uses scaled dot product attention; F() is a commonly used mathematical function. The function is used to convert a vector into a probability distribution. This is the hidden representation of the encoded short-term trajectory obtained in step 4-2. This represents the aggregated short-term trajectory, i.e., the user's short-term preferences; since it's a self-attention neural network, it's set to... ,and A transpose operation was performed during the calculation, where Represents the query vector. Represents the key vector. Represents a value vector; The sum of the last dimension of the tensor.

5. The interest point recommendation method combining discontinuity and multi-level periodicity as described in claim 1, characterized in that, Step 6 describes the aggregation of long-term trajectories as follows: Step 6-1: Use the embedding representation of the last check-in time of the short-term trajectory to aggregate the check-in records of the long-term trajectory, as shown in the following formula: ; in, For a certain trajectory of the long-term trajectory obtained in step 4-2, the first... The hidden representation of a check-in record. The embedding representation of the last check-in time is given, and the transpose operation is performed in the formula. The so-called embedding representation is to represent the last check-in time as a one-hot vector, and then pass it through a fully connected neural network to obtain the vector representation of the check-in time. Indicates the first that has been noted The weighted score of each check-in record is hidden. This indicates the last check-in time after a short-term trajectory. Note the aggregation. The hidden representation of a long-term trajectory, by applying each Perform a weighted summation operation to aggregate the results and obtain the daily neutral value. The most relevant check-in records capture the hourly time cycle characteristics throughout the day; calculation The formula is function, where The base of the natural logarithm is represented by the exponent, and the value in parentheses is the exponent; in the two summation symbols, and Both represent a check-in record in a long-term trajectory, and this long-term trajectory has a total of One sign-in record; Step 6-2: Using the aggregated representation of the short-term trajectory obtained in Step 5. Note the long-term trajectory representation obtained in Step 6-1, the formula is as follows: ; in, The first one obtained in step 6-1 The long-term trajectory indicates that, This is a hidden representation of all long-term trajectories within the time window obtained in step 6-1. This is an aggregated representation of the short-term trajectory obtained in step 5, and a transpose operation has been performed in the formula; For the first time after attention Long-term trajectory representation Weighted scores For the aggregation representation of short-term trajectories Note the first The hidden representation of a long-term trajectory is obtained through weighted scores. Multiply by the long-term trajectory To strengthen long-term trajectories most correlated with short-term trajectories and weaken long-term trajectories with low correlation to short-term trajectories, in order to capture daily cyclical characteristics; calculate The formula is function, where The base of the natural logarithm is represented by the exponent, and the value in parentheses is the exponent; in the summation symbol, This represents a long-term trajectory, and there are a total of n-1 long-term trajectories, with the nth trajectory being a short-term trajectory. Step 6-3: Aggregate the long-term trajectory representation obtained in Step 6-2 using user-embedded attention, as shown in the following formula: ; in, The first one obtained in step 6-2 The long-term trajectory indicates that, This is the hidden representation of all long-term trajectories within the time window obtained in step 6-2. The user's embedded representation is given, and the transpose operation is performed in the formula. The so-called embedded representation is to represent the user as a one-hot vector and then pass it through a fully connected neural network to obtain the user's vector representation. Representation of long-term trajectory after attention The weighted score obtained This is an aggregated representation of long-term trajectories, i.e., users' long-term preferences, achieved by analyzing each long-term trajectory representation. Perform a weighted summation operation to aggregate the results and the user's data. The most relevant long-term preferences enable personalized recommendations for users; calculation The formula is function, where The base of the natural logarithm is represented by the exponent, and the value in parentheses is the exponent; in the two summation symbols, and Each represents a long-term trajectory, and there are a total of n-1 long-term trajectories, with the nth trajectory being a short-term trajectory.

6. The interest point recommendation method combining discontinuity and multi-level periodicity as described in claim 1, characterized in that, Step 7, which involves concatenating the user's long-term and short-term preferences and decoding them through a fully connected layer, includes: The user's long-term and short-term preferences are concatenated and represented as: The spliced ​​result The input is fed into a fully connected neural network and then... The probability distribution of recommended interest points obtained by the function is as follows: ; in, For the transformation matrix, This represents the predicted probability distribution.

7. The interest point recommendation method combining discontinuity and multi-level periodicity as described in claim 1, characterized in that, The cross-entropy loss function described in step 8 is as follows: ; in, The training sample set is a set of long-term and short-term trajectories. The predicted probability of the baseline truth for a given training sample. Given a list of points of interest, select the top k most recommended locations.