Next Interest Point Recommendation Method and Device Based on Contrastive Learning and Bilateral Collaboration

Through a method based on contrast learning and bilateral collaboration, a neural network model is constructed to obtain historical data from both the user and POI, which solves the problems of data sparseness and supervised signal sparseness, and improves the accuracy of POI recommendations.

CN114238773BActive Publication Date: 2025-08-01JIANGSU YEYOO E-CLOUD SOFTWARE CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202111603826.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-24
Publication Date
2025-08-01
Estimated Expiration
2041-12-24

AI Technical Summary

Technical Problem

The existing POI recommendation methods are affected by data sparsity and supervised signal sparsity, making it difficult to accurately tap user preferences, and ignore the information on the POI side, resulting in insufficient recommendation accuracy.

Method used

A neural network model is constructed based on contrast learning and bilateral collaboration, and historical data is obtained from both sides of the user side and POI side. Through contrast learning, complementary information is mined, target scoring matrix is generated, and the next point of interest is recommended.

Benefits of technology

Improve the accuracy of recommendations for the next point of interest, and generate a more accurate target scoring matrix by mining the complementary information of users and POI, enhancing the accuracy of recommendations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114238773B_ABST
    Figure CN114238773B_ABST
Patent Text Reader

Abstract

Embodiments of the present invention disclose a next point of interest recommendation method and apparatus based on contrastive learning and bilateral collaboration. The method includes: obtaining historical point of interest sequences of multiple users, where the historical point of interest sequence of each user includes several points of interest visited by the corresponding user; obtaining historical user sequences of the multiple points of interest according to the multiple points of interest included in the historical point of interest sequences of the multiple users; constructing a neural network model based on contrastive learning according to the historical point of interest sequences of the multiple users and the historical user sequences of the multiple points of interest, and generating a target score matrix based on the constructed neural network model; and recommending a next point of interest to a target user selected from the multiple users according to the target score matrix. Based on this method and apparatus, a target score matrix that can accurately reflect user preferences can be generated, thereby improving the accuracy of recommending the next point of interest.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present invention relate to the field of computer technology, and in particular, to a method, device, electronic device, and storage medium for next point of interest recommendation based on contrastive learning and bilateral collaboration. Background Art

[0002] With the increasing popularity of location-based social networks (LBSNs), the recommendation of the next point of interest (POI) also shows important value for location-based service providers and users. Researchers have proposed a variety of POI recommendation methods with high practical value, especially with the explosive growth of deep networks. Liu et al. first applied a deep learning network to POI recommendation and extended the RNN using spatial and temporal information. Yang et al. used spatio-temporal context to search for past hidden states with high predictive ability and proposed a general RNN architecture called Flashback. Some variants of RNN can effectively utilize users' long-term and short-term interests, such as the long short-term memory (LSTM) proposed by Hochreiter et al. and the gated recurrent unit (GRU) proposed by Cho et al. Among them, the attention mechanism has also been successfully applied to sequence recommendation. For example, Feng et al. proposed an attention recurrent network called DeepMove for mobility prediction. Ying et al. proposed a two-layer sequential hierarchical attention network (SHAN) to recommend the next item.

[0003] Although these methods have achieved great success in many deployed real-world applications, the current POI recommendation methods are still subject to some limitations. First, data sparsity makes it difficult to model well, which in turn affects the mining of user preferences. Since users need to physically visit a POI to generate check-in data, POI recommendation data is sparser than other recommendation scenarios (such as e-commerce, movies, etc.). In addition, many existing methods independently predict the next POI based on personal data and hardly use collaborative information, making it difficult for the model to mine clear preferences for each user. Moreover, most recommendation methods only consider the behavior of users visiting POIs themselves and ignore the fact that there is also rich information on the POI side. Second, the acquisition of supervision signals. Most methods use supervised learning to complete the training task. Compared with the entire dataset, the available supervision signals are very sparse, which results in the inability to learn high-quality representations. Summary of the Invention

[0004] An object of the embodiments of the present invention is to solve at least the above problems and / or defects and provide at least the advantages described later.

[0005] An embodiment of the present invention provides a method, apparatus, electronic device, and storage medium for next interest point recommendation based on contrastive learning and bilateral collaboration, which can accurately mine user preferences and improve the accuracy of next interest point recommendation.

[0006] In a first aspect, a method for next interest point recommendation based on contrastive learning and bilateral collaboration is provided, including:

[0007] Obtain historical interest point sequences of multiple users, where the historical interest point sequence of each user includes several interest points visited by the corresponding user;

[0008] According to the multiple interest points included in the historical interest point sequences of the multiple users, obtain the historical user sequences of the multiple interest points, where the historical user sequence of each interest point includes several users who have visited the corresponding interest point;

[0009] Based on contrastive learning, construct a neural network model according to the historical interest point sequences of the multiple users and the historical user sequences of the multiple interest points, and generate a target score matrix based on the constructed neural network model, where the target score matrix includes the scores of each user among the multiple users for each interest point among the multiple interest points;

[0010] Recommend the next interest point to a target user selected from the multiple users according to the target score matrix.

[0011] Optionally, the neural network model includes a first neural network and a second neural network;

[0012] The step of constructing a neural network model based on contrastive learning according to the historical interest point sequences of the multiple users and the historical user sequences of the multiple interest points, and generating a target score matrix based on the constructed neural network model, where the target score matrix includes the scores of each user among the multiple users for each interest point among the multiple interest points, includes:

[0013] Process the historical interest point sequences of the multiple users using the first neural network to obtain the scores of the multiple users for each corresponding interest point, and generate a first score matrix;

[0014] Process the historical user sequences of the multiple interest points using the second neural network to obtain the scores given to the multiple interest points by their corresponding users, and generate a second score matrix;

[0015] Based on the loss function of contrastive learning, compare the first score matrix and the second score matrix, and train the neural network model;

[0016] Based on the updated first scoring matrix output by the trained neural network model, use the updated first scoring matrix as the target scoring matrix.

[0017] Optionally, the first neural network includes a first sub-neural network and a second sub-neural network;

[0018] The process of using the first neural network to process the historical point-of-interest sequences of the multiple users to obtain the scores of the multiple users for each corresponding point of interest and generate a first scoring matrix includes:

[0019] Use the first sub-neural network to process the historical point-of-interest sequences of the multiple users to obtain the feature vectors of each corresponding point of interest for the multiple users;

[0020] Use the second sub-neural network to process the feature vectors of each corresponding point of interest for the multiple users to obtain the scores of the multiple users for each corresponding point of interest and generate a first scoring matrix.

[0021] Optionally, the first sub-neural network includes a GNN;

[0022] The process of using the first sub-neural network to process the historical point-of-interest sequences of the multiple users to obtain the feature vectors of each corresponding point of interest for the multiple users includes:

[0023] Input the historical point-of-interest sequence of each user into the GNN for processing to obtain the vector of each node corresponding to each user in the output layer of the GNN; wherein, each node corresponding to each user in the output layer of the GNN represents each point of interest corresponding to each user;

[0024] Combine the vector of each node corresponding to each user in the output layer of the GNN with the relative position encoding vector of the corresponding node in a non-linear transformation manner to obtain the feature vector of each point of interest corresponding to each user.

[0025] Optionally, the method further includes:

[0026] Determine the similarity of interest preferences between pairs of users among the multiple users according to the historical point-of-interest sequences of the multiple users;

[0027] The process of using the second sub-neural network to process the feature vectors of each corresponding point of interest for the multiple users to obtain the scores of the multiple users for each corresponding point of interest and generate a first scoring matrix includes:

[0028] Input the feature vectors of each point of interest corresponding to each user into the second sub-neural network for processing to obtain the candidate scores of each user for each corresponding point of interest;

[0029] Determine the scores of each user for each corresponding point of interest according to the candidate scores of each user for each corresponding point of interest and the similarity of interest preferences between the corresponding user and other users among the multiple users.

[0030] Optionally, the determining the similarity of interest preferences between every two users among the multiple users according to the historical point-of-interest sequences of the multiple users includes:

[0031] Determine the degree of overlap of the points of interest corresponding to every two users among the multiple users according to the historical point-of-interest sequences of the multiple users;

[0032] Determine the similarity of interest preferences between every two users among the multiple users according to the degree of overlap of the points of interest corresponding to every two users among the multiple users.

[0033] Optionally, the inputting the feature vectors of each point of interest corresponding to each user into the second sub-neural network for processing to obtain the candidate scores of each user for each corresponding point of interest includes:

[0034] Input the feature vectors of each point of interest corresponding to each user into the second sub-neural network for processing to obtain the state vectors of each node corresponding to each user in the hidden layer of the second sub-neural network; wherein, the nodes corresponding to each user in the hidden layer of the second sub-neural network correspond one-to-one to the points of interest corresponding to each user;

[0035] Determine the influence degree of each point of interest in the historical point-of-interest sequence of each user by other points of interest according to the time distance and spatial distance between each point of interest and other points of interest in the historical point-of-interest sequence of each user; wherein, the influence degree of each point of interest in the historical point-of-interest sequence of each user by other points of interest decreases as the time distance and spatial distance between each point of interest and other points of interest increase;

[0036] Determine the output vectors of each node corresponding to each user in the hidden layer of the second sub-neural network according to the influence degree of each point of interest in the historical point-of-interest sequence of each user by other points of interest and the state vectors of each node corresponding to each user in the hidden layer of the second sub-neural network;

[0037] Connect the feature vectors of each user with the output vectors of each node corresponding to each user in the hidden layer of the second sub-neural network to obtain the candidate scores of each user for each corresponding point of interest.

[0038] Optionally, the method further includes:

[0039] Determine the attraction similarity between any two of the multiple points of interest according to the historical user sequences of the multiple points of interest;

[0040] The processing of the historical user sequences of the multiple points of interest by using the second neural network to obtain the scores given to the multiple points of interest by their respective corresponding users, and generating a second score matrix, includes:

[0041] Input the historical user sequence of each point of interest into the second neural network for processing to obtain the candidate scores given to each point of interest by each corresponding user;

[0042] Determine the scores given to each point of interest by their respective corresponding users according to the candidate scores given to each point of interest by each corresponding user and the attraction similarity between the corresponding point of interest and other points of interest among the multiple points of interest.

[0043] Optionally, the determining the attraction similarity between any two of the multiple points of interest according to the historical user sequences of the multiple points of interest includes:

[0044] Determine the overlap degree of the users corresponding to any two of the multiple points of interest according to the historical user sequences of the multiple points of interest;

[0045] Determine the attraction similarity between any two of the multiple points of interest according to the overlap degree of the users corresponding to any two of the multiple points of interest.

[0046] Optionally, the loss function of the contrastive learning is a binary cross-entropy loss function implemented based on a positive sample discriminator and a negative sample discriminator; wherein, the positive sample discriminator is used to calculate the similarity between a pair of positive samples, the negative sample discriminator is used to calculate the similarity between a pair of negative samples, the pair of positive samples is the first score matrix and the second score matrix, and the pair of negative samples is a pair of negative samples constructed for the first score matrix and the second score matrix.

[0047] In a second aspect, there is provided a next point of interest recommendation device based on contrastive learning and bilateral collaboration, including:

[0048] A user data acquisition module, configured to acquire historical point of interest sequences of multiple users, where the historical point of interest sequence of each user includes several points of interest visited by the corresponding user;

[0049] An interest point data acquisition module, configured to obtain historical user sequences of the multiple interest points according to the multiple interest points included in the historical interest point sequences of the multiple users, wherein the historical user sequence of each interest point includes several users who have visited the corresponding interest point;

[0050] A target rating matrix generation module, configured to construct a neural network model based on contrastive learning according to the historical interest point sequences of the multiple users and the historical user sequences of the multiple interest points, and generate a target rating matrix based on the constructed neural network model, wherein the target rating matrix includes ratings of each of the multiple users for each of the multiple interest points;

[0051] An interest point recommendation module, configured to recommend a next interest point to a target user selected from the multiple users according to the target rating matrix.

[0052] In a third aspect, an electronic device is provided, including: at least one processor, and a memory communicatively connected to the at least one processor, wherein the memory stores instructions executable by the at least one processor, and when the instructions are executed by the at least one processor, the at least one processor is caused to execute the method.

[0053] In a fourth aspect, a storage medium is provided, on which a computer program is stored, characterized in that when the program is executed by a processor, the method is implemented.

[0054] The embodiments of the present invention at least include the following beneficial effects:

[0055] The next interest point recommendation method, device, electronic device, and storage medium based on contrast learning and bilateral collaboration provided by the embodiments of the present invention. The method first obtains the historical interest point sequences of multiple users, where the historical interest point sequence of each user includes several interest points visited by the corresponding user. According to the multiple interest points included in the historical interest point sequences of the multiple users, the historical user sequences of the multiple interest points are obtained, where the historical user sequence of each interest point includes several users who have visited the corresponding interest point. Then, based on contrast learning, according to the historical interest point sequences of the multiple users and the historical user sequences of the multiple interest points, a neural network model is constructed, and a target score matrix is generated based on the constructed neural network model, where the target score matrix includes the scores of each user among the multiple users for each interest point among the multiple interest points. Finally, according to the target score matrix, the next interest point is recommended to a target user selected from the multiple users. Based on this method and device, according to the historical interest point sequences of multiple users and the historical user sequences of multiple interest points, a neural network model is constructed from both the user side and the interest point side, and complementary information on both sides is learned through contrast learning, so as to construct a neural network model that can accurately mine user preferences. A target score matrix that can accurately reflect user preferences is generated based on the constructed neural network model, thereby improving the accuracy of the next interest point recommendation.

[0056] Other advantages, objectives, and features of the embodiments of the present invention will be partially reflected by the following description, and partially will be understood by those skilled in the art through the research and practice of the embodiments of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0057] Figure 1 It is a flowchart of the next interest point recommendation method based on contrast learning and bilateral collaboration provided by an embodiment of the present invention;

[0058] Figure 2 It is a schematic structural diagram of the neural network model provided by an embodiment of the present invention;

[0059] Figure 3 It is a schematic structural diagram of the next interest point recommendation device based on contrast learning and bilateral collaboration provided by an embodiment of the present invention;

[0060] Figure 4 It is a schematic structural diagram of the electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0061] The following further describes the embodiments of the present invention in detail with reference to the drawings, so that those skilled in the art can implement them according to the description in the specification.

[0062] The current POI recommendation method has some limitations. First, data sparsity makes it difficult to model well. The reason is that users need to physically visit a POI to generate check-in data, resulting in more sparse POI recommendation data than other recommendation scenarios (such as e-commerce, movies, etc.), and thus it is difficult to accurately mine user preferences. Second, most recommendation methods only consider the behavior of users visiting POIs themselves, that is, they only model based on the user's own historical sequence of interest points and ignore the POI side. In fact, the POI side also has rich information, which will help to mine user preferences. Third, sparse supervision signals lead to the inability to learn high-quality representations. Most methods use supervised learning to complete the training task. Due to the sparsity of POI recommendation data, the supervision signals that can be obtained are very sparse compared to the entire dataset, resulting in the inability to learn high-quality representations. Based on this, the embodiments of the present invention propose a next interest point recommendation method based on contrastive learning and bilateral collaboration. This method aims to construct a neural network model from both the user side and the POI side according to the historical sequences of interest points of multiple users and the historical user sequences of multiple interest points, learn the complementary information on both sides through contrastive learning, thereby constructing a neural network model that can accurately mine user preferences, generate a target score matrix that can accurately reflect user preferences based on the constructed neural network model, and further improve the accuracy of the next interest point recommendation.

[0063] Figure 1 FIG. 4 is a flowchart of the next interest point recommendation method based on contrastive learning and bilateral collaboration provided by the embodiments of the present invention, which is executed by a system with processing capabilities, a server device, or a next interest point recommendation device based on contrastive learning and bilateral collaboration. The method includes:

[0064] Step 110, obtain the historical sequences of interest points of multiple users, where the historical sequence of interest points of each user includes several interest points visited by the corresponding user.

[0065] Step 120, according to the multiple interest points included in the historical sequences of interest points of the multiple users, obtain the historical user sequences of the multiple interest points, where the historical user sequence of each interest point includes several users who have visited the corresponding interest point.

[0066] In step 110, the historical interest point sequence of each user includes a number of interest points visited by the corresponding user. Here, each user visits a number of interest points, and the interest points visited by different users may be partially the same, completely the same, or completely different. However, in order to obtain information on the interest point side to improve the accuracy of user preference mining, in step 120, some or all of the interest points are selected from all the interest points visited by all users, and the historical user sequences of these interest points are obtained. In subsequent steps, based on the historical user sequences of these interest points and the historical interest point sequences of multiple users, a neural network model is constructed through contrastive learning.

[0067] In step 120, the historical user sequence of each interest point includes a number of users who have visited the corresponding interest point. Here, each interest point is visited by a number of users, and different interest points can be visited by exactly the same or partially the same users, or by completely different users. In step 120, all the users included in the "historical user sequences of multiple interest points" can be the same as, or partially the same as, all the users included in the "historical interest point sequences of multiple users" in step 110.

[0068] Step 130: Based on contrastive learning, a neural network model is constructed according to the historical interest point sequences of the multiple users and the historical user sequences of the multiple interest points, and a target rating matrix is generated based on the constructed neural network model, where the target rating matrix includes the ratings of each of the multiple users for each of the multiple interest points.

[0069] In this step, according to the historical interest point sequences of multiple users and the historical user sequences of multiple interest points, a neural network model is constructed from both the user side and the interest point side. By contrastive learning to learn the complementary information on both sides, a neural network model that can accurately mine user preferences can be constructed. Furthermore, a target rating matrix that can accurately reflect user preferences can be generated based on the constructed neural network model, thereby improving the accuracy of the recommendation for the next interest point.

[0070] Let the set U = (u1, u2, …, u M ) be the set of users, and let the set P = (p1, p2, …, p N ) be the set of interest points. The check-in data can be defined as that user u visits interest point p at a certain time point t, which can be represented by , where lon, lat represent the longitude and latitude coordinates in the geographical space information. The historical trajectory information of the user (i.e., the historical interest point sequence of the user) is defined as that given a user u, its trajectory is represented by a sequence of check-in points in chronological order, which can be expressed as where T is the length of the trajectory. Finally, given the historical trajectory of the user, the main goal of the next point of interest recommendation is to recommend the POI that the user is most likely to visit at time t T+1 The time, the POI that is most likely to be visited.

[0071] In some embodiments, the neural network model includes a first neural network and a second neural network. Figure 2 The structural schematic diagram of the neural network model provided by the embodiment of the present invention is shown. The following will be combined with Figure 2 Illustrate the process of constructing a neural network model and generating a target rating matrix. Based on contrastive learning, according to the historical point-of-interest sequences of the multiple users and the historical user sequences of the multiple points of interest, a neural network model is constructed, and a target rating matrix is generated based on the constructed neural network model, where the target rating matrix includes the ratings of each user among the multiple users for each point of interest among the multiple points of interest, including:

[0072] (1) User side

[0073] Use the first neural network to process the historical point-of-interest sequences of the multiple users, obtain the ratings of the multiple users for each corresponding point of interest, and generate a first rating matrix.

[0074] The first neural network can also be understood as a user-side neural network, which is used to explore the user's interest in POIs and mine user preferences by modeling the user's spatio-temporal behavior patterns. Input the user's historical trajectory data (i.e., the historical point-of-interest sequence of the user) into the first neural network model, and output the first rating matrix.

[0075] In some examples, the first neural network includes a first sub-neural network and a second sub-neural network. The step of using the first neural network to process the historical point-of-interest sequences of the multiple users, obtain the ratings of the multiple users for each corresponding point of interest, and generate a first rating matrix includes:

[0076] Step (1) Use the first sub-neural network to process the historical point-of-interest sequences of the multiple users, and obtain the feature vectors of each corresponding point of interest of the multiple users.

[0077] Specifically, the first sub-neural network includes a GNN. The step of using the first sub-neural network to process the historical point-of-interest sequences of the multiple users, and obtain the feature vectors of each corresponding point of interest of the multiple users includes:

[0078] Step 1) Input the historical interest point sequences of each user into the GNN for processing to obtain the vectors of each node corresponding to each user in the output layer of the GNN; where each node corresponding to each user in the output layer of the GNN represents each interest point corresponding to each user.

[0079] Specifically, for the trajectory data of any user, a directed graph can be used to model with POIs as nodes and historical movement trajectories as edges. In the POI directed graph, the historical trajectory data of user u can be represented as G u =(V u , E u ), where the node v u ∈V u represents an interest point p v , and the edge represents that user u has successively visited the (i - 1)-th interest point and the i-th interest point.

[0080] Next, representation learning can be performed on the constructed POI graph to obtain the feature vectors of each interest point corresponding to each user. Specifically, convert the node v u ∈V u to a unified low-dimensional latent space. The node vector g∈G d represents the d-dimensional real-valued latent space vector of the corresponding node v u . For each node of the POI directed graph, according to the connection relationships constructed in the directed graph, the out-degree matrix M O and the in-degree matrix M I can be obtained. Then, using the obtained in-out degree connection matrices M I and M O , an information propagation equation between different nodes is constructed. In the GNN, at time t, the information propagation between different nodes can be formalized as follows:

[0081]

[0082]

[0083] where a t is to extract the information of the neighbor nodes of node v u on the directed graph and aggregate this information to node v u , is the parameter matrix, b I , b O are the bias vectors, and are the t-th rows of each matrix respectively. Then we combine a t and the previous state c t-1As input, it is operated in the GNN. In this way, the output h of the last layer of the GNN t can be calculated by the following formula:

[0084] z t = σ(W z a t + P z c t-1 ),

[0085] r t = σ(W r a t + P r c t-1 ),

[0086]

[0087]

[0088] where W z , W r , W h and P z , P r , P h are all learnable parameter matrices, σ(*) represents the sigmoid function, and the operator · represents element-wise multiplication. z t , r t are the update gate and reset gate in the GNN respectively, determining what information will be retained or discarded.

[0089] After constructing the POI directed graph using the historical interest point sequence of each user and performing operation processing in the GNN, the vector of each node corresponding to each user can be obtained.

[0090] Step 2) Combine the vector of each node corresponding to each user in the output layer of the GNN with the relative position encoding vector of the corresponding node in a non-linear transformation manner to obtain the feature vector of each interest point corresponding to each user.

[0091] where the relative position encoding vectors of all nodes corresponding to each user in the output layer of the GNN can form a position encoding matrix L = [l0, l1, …, l len-1 , for the vector l len-i-1 in the position encoding matrix,

[0092] when len - i - 1 is even, let 2k = len - i - 1, calculate the value of k, and calculate the position encoding vector using the following formula:

[0093] l 2k = sin(k / 10002k / d );

[0094] When len - i - 1 is odd, let 2k + 1 = len - i - 1, calculate the value of k, and use the following formula to calculate the position encoding vector: l 2k+1 = cos(k / 1000 2k / d )

[0095] where d is the dimension of the vector, i represents the position ranking of the point of interest represented by the node in the historical point - of - interest sequence of the corresponding user, i ranges from 0 to len - 1, len is the length of the historical point - of - interest sequence of the corresponding user, that is, the number of points of interest.

[0096] Combine the position encoding information with the vector representation of the nodes in the previous GNN output layer in a non - linear transformation manner. The formula is as follows:

[0097] h tp = tanh(W p [h t ||l len-i-1 +b p ),

[0098] where h tp represents the feature vector of the point of interest represented by the node, W p is a learnable parameter matrix, b p is a bias vector, i represents the position ranking of the point of interest represented by the node in the historical point - of - interest sequence of the corresponding user, i ranges from 0 to len - 1, len is the length of the historical point - of - interest sequence of the corresponding user, that is, the number of points of interest, and l len-i-1 is the relative position encoding vector of the node corresponding to the i - th point of interest in the historical point - of - interest sequence of the user.

[0099] Here, the position encoding adopted is relative position encoding, rather than direct position encoding. Relative position encoding can add the effective information of the sequence length. Therefore, compared with direct position encoding, it can improve the prediction result of the model.

[0100] Based on the above calculation process, the feature vector of each point of interest corresponding to each user can be obtained.

[0101] In some embodiments, according to the historical point - of - interest sequences of the multiple users, determine the interest preference similarity between any two users among the multiple users.

[0102] If only the trajectory sequence of a single user accessing a POI is used for learning and recommendation, it is very likely to result in non-optimal recommendation effects. Therefore, in this embodiment, by mining the interest preferences of similar users, a larger candidate set of POI recommendations is generated. That is to say, for another user with similar preferences to a certain user, the POIs visited by the latter are very likely to be of interest to the former. Therefore, the POIs of the latter can also be included in the candidate set of POI recommendations for the former. Using the similarity of interest preferences between users as user collaborative information helps to enhance data representation, accurately mine user preferences, and thus improve the accuracy of the next POI recommendation.

[0103] In some examples, determining the similarity of interest preferences between pairwise users among the multiple users according to the historical POI sequences of the multiple users includes: determining the degree of overlap of the POIs corresponding to pairwise users among the multiple users according to the historical POI sequences of the multiple users; and determining the similarity of interest preferences between pairwise users among the multiple users according to the degree of overlap of the POIs corresponding to pairwise users among the multiple users.

[0104] Specifically, a user similarity matrix Coll u (The users in the user similarity matrix can be called collaborative users) can be generated to represent the similarity of interests and hobbies between users. First, the number of times the user pair of user M and user N visit the same POI in the same time period After that, it is normalized to obtain a similarity value between 0 and 1 The closer this value is to 1, the stronger the similarity of interest preferences between user M and user N. The calculation formula is as follows:

[0105]

[0106] Among them, represents the similarity of interest preferences between the user pair composed of user M and user N, represents the number of times the user pair composed of user M and user N visit the same POI in the same time period, Times u represents the number of times the user pairs composed of pairwise users among all users visit the same POI in the same time period, min() is to take the minimum value, and max() is to take the maximum value. In the above calculation process, the "same time period" can be set as needed. It is also possible not to limit the time when the user accesses the POI. In this case, only the number of times each user pair visits the same POI needs to be counted, and the calculation of the similarity of user interest preferences can be realized accordingly.

[0107] Based on the interest preference similarities between pairs of users calculated in the above process, the scores of multiple users for each corresponding point of interest can be calculated, and this score will more accurately reflect the interest preferences of each user.

[0108] In step (2), the second sub-neural network is used to process the feature vectors of each point of interest corresponding to each of the multiple users, to obtain the scores of the multiple users for each corresponding point of interest, and generate a first score matrix.

[0109] Further, the using the second sub-neural network to process the feature vectors of each point of interest corresponding to each of the multiple users, to obtain the scores of the multiple users for each corresponding point of interest, and generate a first score matrix, includes:

[0110] Step 1) Input the feature vectors of each point of interest corresponding to each user into the second sub-neural network for processing, to obtain the candidate scores of each user for each corresponding point of interest.

[0111] Specifically, the inputting the feature vectors of each point of interest corresponding to each user into the second sub-neural network for processing, to obtain the candidate scores of each user for each corresponding point of interest, includes:

[0112] Step a) Input the feature vectors of each point of interest corresponding to each user into the second sub-neural network for processing, to obtain the state vectors of each node corresponding to each user in the hidden layer of the second sub-neural network; wherein, the nodes corresponding to each user in the hidden layer of the second sub-neural network correspond one-to-one to the points of interest corresponding to each user.

[0113] In this embodiment, RNN is used to capture the sequence pattern of the POI sequence. Other neural networks such as LSTM and CNN can also be used. The embodiments of the present invention do not make specific limitations on this. The feature vectors of each point of interest corresponding to each user are sequentially put into the RNN as individual RNN units. After the processing of the RNN, the state vectors of each node corresponding to each user in the hidden layer can be obtained, denoted as h i 。

[0114] Step b) According to the time distance and spatial distance between each point of interest and other points of interest in the historical interest point sequence of each user, determine the influence degree of each point of interest in the historical interest point sequence of each user by other points of interest; wherein, the influence degree of each point of interest in the historical interest point sequence of each user by other points of interest decreases as the time distance and spatial distance between each point of interest and other points of interest increase.

[0115] In the historical interest point sequence of a certain user, the closer the time distance and spatial distance between two interest points are, the closer the user's preferences for these two interest points are, and the greater the influence of the scores given by the user to these two interest points on each other. Conversely, when the time distance or spatial distance between two interest points is farther, it means that the user's preferences for these two interest points differ more, and the influence of the scores given by the user to these two interest points on each other is smaller. Therefore, in the process of predicting the scores of interest points, the time distance and spatial distance between each interest point and other interest points in the historical interest point sequence of each user are taken as consideration factors to determine the influence degree of each interest point in the historical interest point sequence of each user by other interest points, and based on this, the output vector of each node corresponding to each user in the hidden layer is determined in step c).

[0116] Step c) determines the output vector of each node corresponding to each user in the hidden layer of the second sub-neural network according to the influence degree of each interest point in the historical interest point sequence of each user by other interest points and the state vector of each node corresponding to each user in the hidden layer of the second sub-neural network.

[0117] Specifically, in this embodiment, the periodic parameter ω(ΔT, ΔD) of the historical interest point sequence of the user is obtained based on the spatio-temporal context information, and the calculation formula is as follows:

[0118]

[0119] where ΔD i,j is the spatial distance between the interest point p i and the interest point p j in the historical interest point sequence of the user, which can be the Euclidean distance calculated according to the GPS position coordinate information of the two interest points. ΔT i,j is the time distance between the interest point p i and the interest point p j in the historical interest point sequence of the user, that is, the time difference between the user accessing the interest point p i and the interest point p j in the historical interest point sequence of the user. β is the spatial decay coefficient, α is the time decay coefficient, and α and β are used to control the change of weights, both of which are custom hyperparameters. When α = 0.1 and β = 100, the optimal solution can be obtained. hvc is the haversine function, which is used to characterize the periodicity of the historical interest point sequence of the user.

[0120] According to the above formula, the periodic parameter ω(ΔT, ΔD) between each interest point in the historical interest point sequence of the user and other interest points can be determined. Since each node corresponding to each user in the hidden layer of the second sub-neural network has a one-to-one correspondence with the interest points in the historical interest point sequence of the corresponding user, therefore, the output vector of each node corresponding to each user in the hidden layer of the second sub-neural network can be further determined in combination with the periodic parameter ω(ΔT, ΔD). For the i-th node corresponding to each user in the hidden layer of the second sub-neural network, its output vector is calculated by the formula:

[0121]

[0122] where h i represents the state vector of the i-th node corresponding to each user in the hidden layer of the second sub-neural network, n represents the number of nodes corresponding to each user in the hidden layer of the second sub-neural network, and ω i,j represents the periodic parameter ω(ΔT, ΔD) between the i-th node and the j-th node corresponding to each user in the hidden layer of the second sub-neural network.

[0123] Step d) Connect the feature vector of each user with the output vector of each node corresponding to each user in the hidden layer of the second sub-neural network to obtain the candidate score of each user for each corresponding interest point.

[0124] To model the interest preference of each user, in this step, the feature vector e u (i.e., user embedding) of the user is connected with the output vector of each node corresponding to each user, and then passed into the fully connected layer to generate the interest point candidate score matrix S u for the user, and the calculation formula is as follows:

[0125] S u = W su [e u ; H u + b su

[0126] where [;] is the connection symbol, W su is a learnable parameter matrix, b su is the bias vector, H u = [h w1 , h w2 , …, h wn , H u is the node output vector matrix corresponding to each user in the hidden layer of the second sub-neural network, S u = [S u1 , S u2, …, S un , candidate scoring matrix S u Each item in it corresponds to the candidate score of the user for each corresponding point of interest, and n represents the number of nodes corresponding to each user in the hidden layer of the second sub-neural network.

[0127] Step 2) Determine the score of each user for each corresponding point of interest according to the candidate score of each user for each corresponding point of interest and the similarity of interest preferences between the corresponding user and other users among the multiple users.

[0128] To more accurately mine the user's interest preferences, the similarity of interest preferences between every two users among the multiple users is combined into the process of calculating the scores of the multiple users for each corresponding point of interest. Specifically, the candidate scoring matrix S of the user's points of interest u is multiplied by the user similarity matrix Coll generated in the previous step u to obtain the adjusted scoring matrix S′ u , and the calculation process is as follows:

[0129] S′ u = Coll u * S u

[0130] S′ u That is, the scoring matrix of a user for each corresponding point of interest.

[0131] By performing the same calculation process on the historical point-of-interest sequences of multiple users using the first neural network, the scores of multiple users for each corresponding point of interest can be obtained, and a first scoring matrix can be generated. It should be noted that when processing the historical point-of-interest sequences of multiple users, the first neural network can be used to process the historical point-of-interest sequences of multiple users synchronously, or the historical point-of-interest sequences of each user can be processed separately, and finally the scores of each user for each corresponding point of interest can be combined to form a first scoring matrix including multiple users. The embodiments of the present invention do not make specific limitations on this.

[0132] (2) On the point-of-interest side

[0133] Use the second neural network to process the historical user sequences of the multiple points of interest to obtain the scores given to the multiple points of interest by their respective corresponding users, and generate a second scoring matrix.

[0134] The second neural network can also be understood as a neural network on the point-of-interest side, which is used to explore the attraction of points of interest to users by modeling the historical user sequences of points of interest. Input the historical user sequences of points of interest into the second neural network, and output the second scoring matrix.

[0135] In some embodiments, the attraction similarity between any two of the multiple points of interest is determined according to the historical user sequences of the multiple points of interest.

[0136] The embedding data of a single POI is usually very small, so the sparsity of the data poses a great challenge to the analysis of the data on the point-of-interest side. If only the access sequence of a single POI is used for modeling, the recommendation effect will not be ideal. However, if similar POIs can be mined, the information of other POI sequences can be used to assist in the recommendation. In other words, POIs with similar attraction degrees may be visited by the same user. Using the attraction similarity between points of interest as the collaborative information of points of interest helps to enhance the data representation, accurately mine user preferences, and thus improve the accuracy of the recommendation for the next point of interest.

[0137] In some examples, the determining the attraction similarity between any two of the multiple points of interest according to the historical user sequences of the multiple points of interest includes: determining the overlap degree of the users corresponding to any two of the multiple points of interest according to the historical user sequences of the multiple points of interest; and determining the attraction similarity between any two of the multiple points of interest according to the overlap degree of the users corresponding to any two of the multiple points of interest.

[0138] Specifically, the number of times that point of interest I and point of interest J are visited by the same user on the same day can be calculated to obtain Times p , and then normalization is performed to obtain the point-of-interest attraction similarity matrix Coll p (the points of interest in the attraction similarity matrix can be called collaborative points of interest). The specific calculation formula is as follows:

[0139]

[0140] Wherein, represents the attraction similarity between the pair of points of interest formed by point of interest I and point of interest J, represents the number of times that the pair of points of interest formed by point of interest I and point of interest J are visited by the same user on the same day, and Times pDenote the number of times that each pair of points of interest among all points of interest are visited by the same user on the same day. min() is used to take the minimum value, and max() is used to take the maximum value. The value range of the attraction similarity between points of interest is 0 - 1. The closer it is to 1, the more similar the two points of interest are, and similar points of interest will attract users with similar hobbies. In the above calculation process, "the same day" can be set as "the same time period". It is also possible not to limit the time when the points of interest are visited. In this case, only the number of times each pair of points of interest are visited by the same user needs to be counted, and the calculation of the attraction similarity between points of interest can be achieved based on this. It is also possible to count the number of users corresponding to each pair of points of interest and achieve the calculation of the attraction similarity between points of interest based on this.

[0141] According to the attraction similarity between each pair of points of interest among the multiple points of interest calculated in the above process, the scores given by each user to the corresponding points of interest can be calculated, and this score will more accurately reflect the interest preferences of each user.

[0142] The processing of the historical user sequence of the multiple points of interest by using the second neural network to obtain the scores given by each user to the corresponding points of interest and generate a second score matrix includes:

[0143] Step (1) Input the historical user sequence of each point of interest into the second neural network for processing to obtain the candidate scores given by each corresponding user to each point of interest.

[0144] Points of interest have the ability to actively attract and select users. The attraction of points of interest usually changes over time. For example, high - end and mid - range restaurants will have more users on Friday or Saturday, while breakfast convenience stores will have more users in the morning of a day. To capture this dynamic attraction of points of interest to users, RNN is used for calculation, and its calculation process is as follows:

[0145] al t =<u, v, s, d>

[0146] h p =RNN([al1, al2, …, al tT′ )

[0147] where u, v, s, d are the user, the point of interest, the time of day, and the day of the week respectively, and al t is another representation of the check - in data, which can be expressed more precisely in terms of time. is the historical visited sequence of this point of interest, that is, the historical user sequence of this point of interest. T′ is the sequence length of this sequence. h pThe potential representation of the sequence obtained after processing by the RNN. This potential representation can be regarded as the attraction of this point of interest to the users in the historical user sequence of the point of interest. It should be noted that the second neural network can also use other neural networks, such as LSTM, CNN and other neural networks. The embodiments of the present invention do not make specific limitations on this.

[0148] Connect the feature vector e v (i.e., the point of interest embedding) of the point of interest with the attraction of the point of interest to each user in the historical user sequence of the point of interest, and after a non-linear transformation, obtain the candidate scoring matrix S P of the point of interest attracting users, and its formula is as follows:

[0149] S p = W sp [e v ; H p ] + b sp

[0150] Among them, [;] is the connection symbol, W sp is a learnable parameter matrix, b sp is the bias vector, H p = [h p1 , h p2 , …, h pm ], H p is the attraction vector matrix of the point of interest to each user in the historical user sequence of the point of interest obtained after being processed by the second neural network, S p = [S p1 , S p2 , …, S pm ], and each item in the candidate scoring matrix S p corresponds to the candidate score given by the point of interest to each corresponding user, and m represents the number of users in the historical user sequence of the point of interest.

[0151] Step (2) Determine the score given by each point of interest to its corresponding user according to the candidate score given by each point of interest to its corresponding user and the attraction similarity between the corresponding point of interest and other points of interest among the multiple points of interest.

[0152] In order to more accurately mine the attraction of the point of interest to the user, the attraction similarity between every two points of interest among the multiple points of interest is combined into the process of calculating the scores of the multiple points of interest for each corresponding user. Specifically, the candidate scoring matrix S P of the point of interest can be multiplied by the point of interest similarity matrix Coll p generated in the previous step to obtain the adjusted scoring matrix S' p , and the calculation process is as follows:

[0153] S′ p = Coll p *S P

[0154] S′ p That is, a rating matrix given by each corresponding user to an interest point.

[0155] By performing the same calculation process on the historical user sequences of multiple interest points using a second neural network, ratings given by each corresponding user to multiple interest points can be obtained, and a second rating matrix can be generated. It should be noted that when processing the historical user sequences of multiple interest points, the second neural network can be used to process the historical user sequences of multiple interest points synchronously, or the historical user sequence of each interest point can be processed separately, and finally the ratings given by each corresponding user to each interest point are combined together to form a second rating matrix containing multiple interest points. The embodiments of the present invention do not make specific limitations on this.

[0156] (3) Contrastive learning

[0157] Based on the loss function of contrastive learning, the first rating matrix and the second rating matrix are compared, and the neural network model is trained.

[0158] Embodiments of the present invention can obtain two rating matrices on the user side and the interest point side. These two rating matrices can be regarded as two representations of different views. In existing methods, most multi-view methods directly fuse the representations obtained from multiple views, which will cause the inherent characteristics of the views to be ignored, and one view knows nothing about the information of another view. In this case, the sparsity of the data on the interest point side itself may affect the effect of bilateral modeling, resulting in non-optimal interest point recommendation results. Based on this, contrastive learning is introduced into the bilateral collaborative network in the embodiments of the present invention to improve the recommendation performance, which is specifically divided into the following two parts:

[0159] Create self-supervised signals. Embodiments of the present invention respectively learn two sets of specific user-interest point rating matrices from the user side and the interest point side, namely the first rating matrix and the second rating matrix. Unilateral encoding can only obtain one matrix. By learning from the user side and the interest point side respectively, two user-interest point rating matrices can be obtained. Since these two rating matrices have the same users and interest points, self-supervised learning can be performed between them.

[0160] Contrastive learning. Two user-interest rating matrices are used as a pair of positive samples, and negative samples are constructed based on the two user-interest rating matrices. Among them, the negative sample matrix can be constructed by modifying and replacing the rating data in the positive sample matrix. For the two user-interest rating matrices, two negative sample matrices are respectively constructed. During the contrastive learning process, it is hoped that a pair of positive sample matrices are as close as possible, and a pair of negative sample matrices are as far away as possible. In some embodiments, the loss function of the contrastive learning is a binary cross-entropy loss function implemented based on a positive sample discriminator and a negative sample discriminator; wherein, the positive sample discriminator is used to calculate the similarity between a pair of positive samples, the negative sample discriminator is used to calculate the similarity between a pair of negative samples, the pair of positive samples are the first rating matrix and the second rating matrix, and the pair of negative samples are a pair of negative samples constructed for the first rating matrix and the second rating matrix.

[0161] Specifically, InfoNCE is used as the learning objective of the contrastive learning loss function.

[0162] There is a standard binary cross-entropy loss between the samples from the ground truth (positive samples) and the samples that are not true (negative samples), which is defined as follows:

[0163]

[0164] Among them, L s is the loss function of this contrastive learning, are two rating matrices trained with positive samples obtained from the ground truth respectively, is the first rating matrix, is the second rating matrix, are the negative sample matrices constructed based on the first rating matrix and the second rating matrix respectively, f D is the discriminator, which is used to calculate the similarity score between the two matrices.

[0165] The discriminator can be implemented by the dot product calculation between two vectors. This method helps to maximize the mutual information learned between the two user-interest rating matrices. The specific implementation formula of the discriminator is:

[0166]

[0167]

[0168] Among them, W D is the parameter matrix, b D is the bias vector.

[0169] The discriminator allows two matrices to obtain collaborative information from each other, enabling users with only a few points of interest to refine the embedding using cross-user information.

[0170] During the process of constructing the neural network model in step 130, new first and second scoring matrices are generated in each round of training as new positive samples. The purpose of training the neural network model is to make the values of the first and second scoring matrices approach each other continuously, so as to maximize the mutual information between the two scoring matrices on the user side and the POI side.

[0171] (4) Generate the target scoring matrix

[0172] Based on the updated first scoring matrix output by the trained neural network model, the updated first scoring matrix is used as the target scoring matrix.

[0173] After several rounds of loops, the neural network model is trained. The mutual information between the first and second scoring matrices output by the trained neural network model has been maximized. Therefore, the updated first scoring matrix can be selected as the target scoring matrix without performing the summation operation of the two scoring matrices.

[0174] Step 140: Recommend the next point of interest to the target user selected from the multiple users according to the target scoring matrix.

[0175] Among them, the target scoring matrix includes the scores of each user among the multiple users for each point of interest among the multiple points of interest. The target user is one of the multiple users, and the target scoring matrix includes the scores of the target user for the multiple points of interest. Therefore, the next point of interest can be recommended to the target user in descending order of the scores of the target user for the multiple points of interest.

[0176] In summary, the embodiment of the present invention provides a method for recommending the next point of interest based on contrastive learning and bilateral collaboration. The method first obtains the historical point-of-interest sequences of multiple users, where the historical point-of-interest sequence of each user includes several points of interest visited by the corresponding user. According to the multiple points of interest included in the historical point-of-interest sequences of the multiple users, the historical user sequences of the multiple points of interest are obtained, where the historical user sequence of each point of interest includes several users who have visited the corresponding point of interest. Then, based on contrastive learning, a neural network model is constructed according to the historical point-of-interest sequences of the multiple users and the historical user sequences of the multiple points of interest, and a target score matrix is generated based on the constructed neural network model, where the target score matrix includes the scores of each user among the multiple users for each point of interest among the multiple points of interest. Finally, according to the target score matrix, the next point of interest is recommended to a target user selected from the multiple users. Based on this method, according to the historical point-of-interest sequences of multiple users and the historical user sequences of multiple points of interest, a neural network model is constructed from both the user side and the point-of-interest side, and complementary information on both sides is learned through contrastive learning, so as to construct a neural network model that can accurately mine user preferences. A target score matrix that can accurately reflect user preferences is generated based on the constructed neural network model, thereby improving the accuracy of recommending the next point of interest.

[0177] Figure 3 FIG. shows a schematic structural diagram of a device for recommending the next point of interest based on contrastive learning and bilateral collaboration provided by an embodiment of the present invention. As Figure 3 shown, the device for recommending the next point of interest based on contrastive learning and bilateral collaboration includes: a user data acquisition module 310, configured to obtain the historical point-of-interest sequences of multiple users, where the historical point-of-interest sequence of each user includes several points of interest visited by the corresponding user; an interest point data acquisition module 320, configured to obtain the historical user sequences of the multiple points of interest according to the multiple points of interest included in the historical point-of-interest sequences of the multiple users, where the historical user sequence of each point of interest includes several users who have visited the corresponding point of interest; a target score matrix generation module 330, configured to construct a neural network model based on contrastive learning according to the historical point-of-interest sequences of the multiple users and the historical user sequences of the multiple points of interest, and generate a target score matrix based on the constructed neural network model, where the target score matrix includes the scores of each user among the multiple users for each point of interest among the multiple points of interest; and an interest point recommendation module 340, configured to recommend the next point of interest to a target user selected from the multiple users according to the target score matrix.

[0178] In some embodiments, the neural network model includes a first neural network and a second neural network; the target score matrix generation module includes:

[0179] The first scoring matrix generation sub-module is used to process the historical point-of-interest sequences of the multiple users by using the first neural network, obtain the scores of each point of interest corresponding to each user, and generate a first scoring matrix;

[0180] The second scoring matrix generation sub-module is used to process the historical user sequences of the multiple points of interest by using the second neural network, obtain the scores given to the multiple points of interest by their corresponding users, and generate a second scoring matrix;

[0181] The neural network model training sub-module is used to compare the first scoring matrix and the second scoring matrix based on a contrastive learning loss function, and train the neural network model;

[0182] The target scoring matrix generation sub-module is used to output an updated first scoring matrix based on the trained neural network model, and use the updated first scoring matrix as the target scoring matrix.

[0183] In some embodiments, the first neural network includes a first sub-neural network and a second sub-neural network; the first scoring matrix generation sub-module includes:

[0184] The point-of-interest feature vector determination unit is used to process the historical point-of-interest sequences of the multiple users by using the first sub-neural network, and obtain the feature vectors of each point of interest corresponding to each user;

[0185] The first scoring matrix generation unit is used to process the feature vectors of each point of interest corresponding to each user by using the second sub-neural network, obtain the scores of each point of interest corresponding to each user, and generate a first scoring matrix.

[0186] In some embodiments, the first sub-neural network includes a GNN; the point-of-interest feature vector determination unit is specifically used for:

[0187] Input the historical point-of-interest sequence of each user into the GNN for processing, and obtain the vector of each node corresponding to each user in the output layer of the GNN; wherein, each node corresponding to each user in the output layer of the GNN represents each point of interest corresponding to each user;

[0188] Combine the vector of each node corresponding to each user in the output layer of the GNN with the relative position encoding vector of the corresponding node in a non-linear transformation manner, and obtain the feature vector of each point of interest corresponding to each user.

[0189] Optionally, the device further includes:

[0190] An interest preference similarity determination module, configured to determine the interest preference similarity between every two users among the multiple users according to the historical interest point sequences of the multiple users;

[0191] The first score matrix generation unit includes:

[0192] A candidate score determination subunit, configured to input the feature vector of each interest point corresponding to each user into the second sub-neural network for processing, and obtain the candidate score of each user for each corresponding interest point;

[0193] A score determination subunit, configured to determine the score of each user for each corresponding interest point according to the candidate score of each user for each corresponding interest point and the interest preference similarity between the corresponding user and other users among the multiple users.

[0194] In some embodiments, the interest preference similarity determination module includes:

[0195] A coincidence degree determination unit, configured to determine the coincidence degree of the interest points corresponding to every two users among the multiple users according to the historical interest point sequences of the multiple users;

[0196] An interest preference similarity determination unit, configured to determine the interest preference similarity between every two users among the multiple users according to the coincidence degree of the interest points corresponding to every two users among the multiple users.

[0197] In some embodiments, the candidate score determination subunit is specifically configured to:

[0198] Input the feature vector of each interest point corresponding to each user into the second sub-neural network for processing, and obtain the state vector of each node corresponding to each user in the hidden layer of the second sub-neural network; wherein, the nodes corresponding to each user in the hidden layer of the second sub-neural network correspond one-to-one with the interest points corresponding to each user;

[0199] Determine the influence degree of each interest point in the historical interest point sequence of each user by other interest points according to the time distance and space distance between each interest point and other interest points in the historical interest point sequence of each user; wherein, the influence degree of each interest point in the historical interest point sequence of each user by other interest points decreases as the time distance and space distance between each interest point and other interest points increase;

[0200] Determine the output vector of each node corresponding to each user in the hidden layer of the second sub-neural network according to the influence degree of each interest point in the historical interest point sequence of each user by other interest points and the state vector of each node corresponding to each user in the hidden layer of the second sub-neural network;

[0201] Connect the feature vector of each user with the output vector of each node corresponding to each user in the hidden layer of the second sub-neural network to obtain the candidate score of each user for each corresponding point of interest.

[0202] In some embodiments, the apparatus further includes:

[0203] An attraction similarity determination module, configured to determine the attraction similarity between any two points of interest among the multiple points of interest according to the historical user sequences of the multiple points of interest;

[0204] The second score matrix generation sub-module includes:

[0205] A candidate score determination unit, configured to input the historical user sequence of each point of interest into the second neural network for processing to obtain the candidate score given by each corresponding user to each point of interest;

[0206] A score determination unit, configured to determine the score given by each corresponding user to each point of interest according to the candidate score given by each corresponding user to each point of interest and the attraction similarity between the corresponding point of interest and other points of interest among the multiple points of interest.

[0207] In some embodiments, the attraction similarity determination module includes:

[0208] A user overlap degree determination unit, configured to determine the overlap degree of users corresponding to any two points of interest among the multiple points of interest according to the historical user sequences of the multiple points of interest;

[0209] An attraction similarity determination unit, configured to determine the attraction similarity between any two points of interest among the multiple points of interest according to the overlap degree of users corresponding to any two points of interest among the multiple points of interest.

[0210] In some embodiments, the loss function of the contrastive learning is a binary cross-entropy loss function implemented based on a positive sample discriminator and a negative sample discriminator; wherein, the positive sample discriminator is used to calculate the similarity between a pair of positive samples, the negative sample discriminator is used to calculate the similarity between a pair of negative samples, the pair of positive samples is the first score matrix and the second score matrix, and the pair of negative samples is a pair of negative samples constructed for the first score matrix and the second score matrix.

[0211] Figure 4 Shows an electronic device according to an embodiment of the present invention. As Figure 4As shown, the electronic device 400 includes: at least one processor 410, and a memory 420 communicatively connected to the at least one processor 410. The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform a method.

[0212] Specifically, the memory 420 and the processor 410 are connected together via a bus 430, and can be a general memory and processor, which are not specifically limited here. When the processor 410 runs the computer program stored in the memory 420, it can perform the various operations and functions described in the embodiments of the present invention in combination with Figures 2 to 3 the described operations and functions.

[0213] In the embodiments of the present invention, the electronic device 400 may include, but is not limited to: personal computers, server computers, workstations, desktop computers, laptop computers, notebook computers, mobile computing devices, smart phones, tablet computers, personal digital assistants (PDAs), handheld devices, messaging devices, wearable computing devices, and the like.

[0214] The embodiments of the present invention also provide a storage medium, on which a computer program is stored. When the program is executed by a processor, a method is implemented. For specific implementation, reference can be made to the method embodiments, which will not be elaborated here. Specifically, a system or device equipped with the storage medium can be provided, and software program code for implementing the functions of any one of the above embodiments is stored on the storage medium, and the computer or processor of the system or device is caused to read and execute the instructions stored in the storage medium. The program code read from the storage medium itself can implement the functions of any one of the above embodiments. Therefore, the machine-readable code and the storage medium storing the machine-readable code constitute a part of the present invention.

[0215] The storage medium includes, but is not limited to: floppy disks, hard disks, magneto-optical disks, optical disks, magnetic tapes, non-volatile memory cards, and ROMs. Program code can also be downloaded from a server computer or the cloud via a communication network.

[0216] It should be noted that in the above-mentioned various processes and system structures, not all steps and modules are necessary, and some steps and units can be ignored according to actual needs. The execution order of the steps is not fixed and can be determined according to needs. The device structures described in the above embodiments can be physical structures or logical structures. A certain module or unit may be implemented by the same physical entity, a certain module or unit may be implemented by multiple physical entities respectively, and a certain module or unit may also be implemented by multiple components in multiple independent devices together.

[0217] Although the embodiments of the present invention have been disclosed above, they are not limited to the applications listed in the specification and embodiments. It can be fully applied to various fields suitable for the embodiments of the present invention. For those familiar with the field, additional modifications can be easily achieved. Therefore, without departing from the general concept defined by the claims and their equivalents, the embodiments of the present invention are not limited to specific details and the examples shown and described herein.

Claims

1. A next interest point recommendation method based on contrastive learning and bilateral collaboration, characterized in that Including: Obtain the historical interest point sequences of multiple users, where the historical interest point sequence of each user includes several interest points visited by the corresponding user; According to the multiple interest points included in the historical interest point sequences of the multiple users, obtain the historical user sequences of the multiple interest points, where the historical user sequence of each interest point includes several users who have visited the corresponding interest point; Based on contrastive learning, according to the historical interest point sequences of the multiple users and the historical user sequences of the multiple interest points, construct a neural network model, and generate a target score matrix based on the constructed neural network model, where the target score matrix includes the scores of each user among the multiple users for each interest point among the multiple interest points; According to the target score matrix, recommend the next interest point to a target user selected from the multiple users; The neural network model includes a first neural network and a second neural network; The step of, based on contrastive learning, according to the historical interest point sequences of the multiple users and the historical user sequences of the multiple interest points, construct a neural network model, and generate a target score matrix based on the constructed neural network model, where the target score matrix includes the scores of each user among the multiple users for each interest point among the multiple interest points, includes: Process the historical interest point sequences of the multiple users using the first neural network to obtain the scores of the multiple users for each corresponding interest point, and generate a first score matrix; Process the historical user sequences of the multiple interest points using the second neural network to obtain the scores given by the multiple users to their corresponding interest points, and generate a second score matrix; Based on the loss function of contrastive learning, compare the first score matrix and the second score matrix, and train the neural network model; Output an updated first score matrix based on the trained neural network model, and use the updated first score matrix as the target score matrix; The method further includes: Determine the attraction similarity between every two interest points among the multiple interest points according to the historical user sequences of the multiple interest points; The step of processing the historical user sequences of the multiple interest points using the second neural network to obtain the scores given by the multiple users to their corresponding interest points, and generate a second score matrix, includes: Input the historical user sequence of each interest point into the second neural network for processing to obtain the candidate scores given by each corresponding user to each interest point; Determine the scores given by each user to their corresponding interest points according to the candidate scores given by each corresponding user to each interest point and the attraction similarity between the corresponding interest point and other interest points among the multiple interest points.

2. The next interest point recommendation method based on contrastive learning and bilateral collaboration according to claim 1, wherein The first neural network includes a first sub - neural network and a second sub - neural network; The step of processing the historical interest point sequences of the multiple users using the first neural network to obtain the scores of the multiple users for each corresponding interest point, and generate a first score matrix, includes: Process the historical point-of-interest sequences of the multiple users using a first sub-neural network to obtain the feature vectors of each point of interest corresponding to each of the multiple users; Process the feature vectors of each point of interest corresponding to each of the multiple users using the second sub-neural network to obtain the scores of each of the multiple users for each point of interest corresponding to them, and generate a first score matrix.

3. The next point of interest recommendation method based on contrastive learning and bilateral collaboration according to claim 2, wherein The first sub-neural network includes a GNN; The process of using the first sub-neural network to process the historical point-of-interest sequences of the multiple users to obtain the feature vectors of each point of interest corresponding to each of the multiple users includes: Input the historical point-of-interest sequence of each user into the GNN for processing to obtain the vectors of each node corresponding to each user in the output layer of the GNN; wherein, each node corresponding to each user in the output layer of the GNN represents each point of interest corresponding to each user; Combine the vectors of each node corresponding to each user in the output layer of the GNN with the relative position encoding vectors of the corresponding nodes in a non-linear transformation manner to obtain the feature vectors of each point of interest corresponding to each user.

4. The next POI recommendation method based on contrastive learning and bilateral collaboration according to claim 2, wherein, The method further includes: Determine the similarity of interest preferences between pairwise users among the multiple users according to the historical point-of-interest sequences of the multiple users; The process of using the second sub-neural network to process the feature vectors of each point of interest corresponding to each of the multiple users to obtain the scores of each of the multiple users for each point of interest corresponding to them and generate a first score matrix includes: Input the feature vectors of each point of interest corresponding to each user into the second sub-neural network for processing to obtain the candidate scores of each user for each corresponding point of interest; Determine the scores of each user for each corresponding point of interest according to the candidate scores of each user for each corresponding point of interest and the similarity of interest preferences between the corresponding user and other users among the multiple users.

5. The next point of interest recommendation method based on contrastive learning and bilateral collaboration according to claim 4, characterized in that, The determination of the similarity of interest preferences between pairwise users among the multiple users according to the historical point-of-interest sequences of the multiple users includes: Determine the degree of overlap of the points of interest corresponding to pairwise users among the multiple users according to the historical point-of-interest sequences of the multiple users; Determine the similarity of interest preferences between pairwise users among the multiple users according to the degree of overlap of the points of interest corresponding to pairwise users among the multiple users.

6. The next point of interest recommendation method based on contrastive learning and bilateral collaboration according to claim 4, characterized in that, The process of inputting the feature vectors of each point of interest corresponding to each user into the second sub-neural network for processing to obtain the candidate scores of each user for each corresponding point of interest includes: Input the feature vectors of each point of interest corresponding to each user into the second sub-neural network for processing to obtain the state vectors of each node corresponding to each user in the hidden layer of the second sub-neural network; wherein, the nodes corresponding to each user in the hidden layer of the second sub-neural network correspond one-to-one with the points of interest corresponding to each user; Determine the influence degree of each interest point in the historical interest point sequence of each user by other interest points according to the time distance and spatial distance between each interest point and other interest points in the historical interest point sequence of each user; wherein, the influence degree of each interest point in the historical interest point sequence of each user by other interest points decreases as the time distance and spatial distance between each interest point and other interest points increase; Determine the output vector of each node corresponding to each user in the hidden layer of the second sub-neural network according to the influence degree of each interest point in the historical interest point sequence of each user by other interest points and the state vector of each node corresponding to each user in the hidden layer of the second sub-neural network; Connect the feature vector of each user with the output vector of each node corresponding to each user in the hidden layer of the second sub-neural network to obtain the candidate score of each user for each corresponding interest point.

7. The next point of interest recommendation method based on contrastive learning and bilateral collaboration according to claim 1, wherein The determining the attraction similarity between two interest points among the multiple interest points according to the historical user sequences of the multiple interest points includes: Determine the overlap degree of the users corresponding to two interest points among the multiple interest points according to the historical user sequences of the multiple interest points; Determine the attraction similarity between two interest points among the multiple interest points according to the overlap degree of the users corresponding to two interest points among the multiple interest points.

8. The next interest point recommendation method based on contrastive learning and bilateral collaboration according to claim 1, wherein The loss function of the contrastive learning is a binary cross-entropy loss function implemented based on a positive sample discriminator and a negative sample discriminator; wherein, the positive sample discriminator is used to calculate the similarity between a pair of positive samples, the negative sample discriminator is used to calculate the similarity between a pair of negative samples, the pair of positive samples is the first score matrix and the second score matrix, and the pair of negative samples is a pair of negative samples constructed for the first score matrix and the second score matrix.

9. A next interest point recommendation device based on contrastive learning and bilateral collaboration, characterized in that Including: A user data acquisition module, configured to acquire the historical interest point sequences of multiple users, wherein the historical interest point sequence of each user includes several interest points visited by the corresponding user; An interest point data acquisition module, configured to acquire the historical user sequences of the multiple interest points according to the multiple interest points included in the historical interest point sequences of the multiple users, wherein the historical user sequence of each interest point includes several users who have visited the corresponding interest point; A target score matrix generation module, configured to construct a neural network model based on contrastive learning according to the historical interest point sequences of the multiple users and the historical user sequences of the multiple interest points, and generate a target score matrix based on the constructed neural network model, wherein the target score matrix includes the scores of each user among the multiple users for each interest point among the multiple interest points; An interest point recommendation module, configured to recommend the next interest point to a target user selected from the multiple users according to the target score matrix; The neural network model includes a first neural network and a second neural network; the target score matrix generation module includes: The first scoring matrix generation sub-module is used to process the historical point-of-interest sequences of the multiple users by using the first neural network, obtain the scores of each of the multiple users for each corresponding point of interest, and generate a first scoring matrix; The second scoring matrix generation sub-module is used to process the historical user sequences of the multiple points of interest by using the second neural network, obtain the scores given to the multiple points of interest by their corresponding users, and generate a second scoring matrix; The neural network model training sub-module is used to compare the first scoring matrix and the second scoring matrix based on a contrastive learning loss function, and train the neural network model; The target scoring matrix generation sub-module is used to output an updated first scoring matrix based on the trained neural network model, and use the updated first scoring matrix as the target scoring matrix; The apparatus further includes: The attraction similarity determination module is used to determine the attraction similarity between any two of the multiple points of interest according to the historical user sequences of the multiple points of interest; The second scoring matrix generation sub-module includes: The candidate score determination unit is used to input the historical user sequence of each point of interest into the second neural network for processing, and obtain the candidate scores given to each point of interest by each corresponding user; The score determination unit is used to determine the scores given to each point of interest by their corresponding users according to the candidate scores given to each point of interest by each corresponding user and the attraction similarity between the corresponding point of interest and other points of interest among the multiple points of interest.

10. An electronic device, characterized in that, including: At least one processor, and a memory communicatively connected to the at least one processor, wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to cause the at least one processor to execute the method according to any one of claims 1-8.

11. A storage medium having a computer program stored thereon, characterized in that, When the program is executed by a processor, the method according to any one of claims 1-8 is implemented.

Citation Information

Patent Citations

  • Interest point recommendation method based on user positive and negative preference learning

    CN110555112A