Location recommendation method and device based on multi-scale graph learning and electronic equipment
By employing a multi-scale graph learning method, combined with spectral analysis and random walk diffusion, an isomorphic graph of users and locations is constructed, which solves the problem of insufficient accuracy in existing point-of-interest recommendations and achieves more accurate location recommendations.
Patent Information
- Application Number
- CN202611261620.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-19
- Publication Date
- 2026-11-03
AI Technical Summary
In existing technologies, interest point recommendation methods are insufficient in accuracy, mainly due to the limitations of graph representation capabilities and finite receptive fields that restrict the discovery of potential interest matches, resulting in low recommendation accuracy.
We employ a multi-scale graph learning approach, combining spectral analysis and random walk diffusion, to construct user-user and location-location isomorphic graphs. By iteratively executing local message passing and global dependency modeling, we obtain global structural representations of users and locations, and improve the robustness of feature representations through fine-grained learning.
It significantly improves the performance of location recommendation systems, enabling more accurate prediction of locations users are likely to visit, and enhancing the accuracy and personalization of recommendations.
Smart Images

Figure CN123030816A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of recommendation method technology, specifically relating to a location recommendation method, device, and electronic device based on multi-scale graph learning. Background Technology
[0002] Point-of-Interest (POI) recommendations aim to predict users' future access behaviors by analyzing their historical check-in records. By predicting and recommending the next location a user is likely to visit, POI recommendations can support personalized route planning, shorten travel time, and improve the convenience of daily life.
[0003] Thanks to the collaborative nature of user-location interactions, Graph Neural Networks (GNNs) have achieved excellent performance in POI recommendation tasks by mining collaborative signals between nodes. However, user-location interaction data typically contains a wealth of information, but existing graph representation capabilities are insufficient. Many methods only use binary edges and general node embeddings. This simplified approach ignores the rich semantic information behind the interactions and the complex high-order connection patterns in the graph, thus exacerbating the data sparsity problem and limiting the model's generalization ability.
[0004] Meanwhile, the limited receptive field restricts the discovery of potential interest matches. Although multi-hop messaging can capture local interaction patterns, it is difficult to model long-range dependencies across multiple hops. Therefore, it is easy to miss potential recommendations from similar users or nearby locations that are far apart in the graph, resulting in low accuracy when recommending locations to users. Summary of the Invention
[0005] The technical problem to be solved by the present invention is that the accuracy of the above-mentioned methods commonly used in the prior art is low when recommending locations to users. In order to solve the above problem, the present invention provides a location recommendation method, device and electronic device based on multi-scale graph learning.
[0006] The content of this invention includes: In a first aspect, embodiments of the present invention provide a location recommendation method based on multi-scale graph learning, comprising: Based on historical interaction data of multiple users and multiple locations, the initial feature representations of the users and the initial feature representations of the locations are obtained, and user-user isomorphic graphs and location-location isomorphic graphs are constructed, wherein the locations are used to represent locations that can be displayed on the map and are accessible to users; By combining spectral analysis and random walk diffusion, the overall structural information of the user-user isomorphism graph and the location-location isomorphism graph is learned respectively, so as to obtain the global structural representation of the user and the global structural representation of the location; Based on the global structural representations of the users and the locations, iterative execution is performed on the user-user isomorphism graph and the location-location isomorphism graph, respectively. The next fine-grained learning operation yields the final feature representations of the user and the location. This fine-grained learning operation uses parallel execution of local message passing and global dependency modeling to obtain fine-grained local and global feature representations. The feature representation output by this current fine-grained learning operation is obtained by fusing these two representations. The feature representation output by the second-fine-grained learning operation is the final feature representation. It is a positive integer; Based on the final feature representation of the user and the final feature representation of the location, a predicted rating between the user and the location is determined; The location recommended to the user is determined based on the predicted score.
[0007] Optionally, the first target isomorphism graph is either the user-user isomorphism graph or the location-location isomorphism graph. Combining spectral analysis and random walk diffusion, the overall structural information of the first target isomorphism graph is learned to obtain a global structural representation of the target, including: The first target isomorphism graph is input into the spectral analysis branch and the random walk branch respectively for encoding processing to obtain the first encoded representation and the second encoded representation; The first encoding representation and the second encoding representation are fused using an attention mechanism to obtain the target global structure representation; Wherein, when the first target isomorphic graph is the user-user isomorphic graph, the target global structure representation is the global structure representation of the user; when the first target isomorphic graph is the location-location isomorphic graph, the target global structure representation is the global structure representation of the location. Wherein, the first encoding represents and the second encoding representation They are respectively: ; ; in, The nontrivial eigenvectors obtained from the normalized Laplacian matrix decomposition of the graph. Let be the landing probability eigenvector of a multi-step random walk on the graph transition matrix. Used to characterize the positive sign-invariant multilayer perceptron mapping function. Used to characterize the negative sign-invariant multilayer perceptron mapping function. Used to characterize the coding function of a multilayer perceptron.
[0008] Optionally, the second target isomorphic graph is the user-user isomorphic graph or the location-location isomorphic graph. Based on the global structural representation of the user and the global structural representation of the location, the fine-grained learning operation is performed on the second target isomorphic graph, including: A gated graph convolutional network is used to model the fine-grained local interaction patterns in the second target isomorphic graph, resulting in fine-grained local feature representations. In this representation, nodes in the second target isomorphic graph... Fine-grained local feature representation for: ; ; ; in, For nodes The output feature representation after aggregating neighbor information For nodes and nodes The gating weights between them For nodes Feature representation, For nodes Feature representation, For nodes and nodes Edge characteristics of the connecting edges between them. 、 and They are respectively , and The corresponding linear transformation matrix, Used to characterize the Sigmoid function To prevent the denominator from being divided by a constant; The nodes in the second target isomorphic graph are sorted based on their importance scores to obtain the sorted node features. The sorted node features are processed based on the Mamba model to obtain a fine-grained global feature representation, wherein the node... Fine-grained global feature representation for: ; in, This is a sequence of node features sorted by node importance score. Used to characterize the Mamba model; The fine-grained local feature representation and the fine-grained global feature representation are fused to generate the feature representation output by the current execution of the fine-grained learning operation, wherein the node output by the current execution of the fine-grained learning operation... Feature representation for: ; ; ; in, Used to characterize batch normalization processing Used to characterize the ReLU activation function and Here are the weight matrix and biases for the first feedforward network. and Here are the weight matrix and biases for the second feedforward network. For nodes The first intermediate embedding, For nodes The second intermediate embedding.
[0009] Optionally, the step of obtaining initial feature representations of the users and locations based on historical interaction data from multiple users and multiple locations, and constructing user-user isomorphic graphs and location-location isomorphic graphs, includes: Based on the historical interaction data, obtain the initial feature representation of the user and the initial feature representation of the location; Based on the initial feature representations of the users and the initial feature representations of the locations, for each user, a user-location heterogeneous graph centered on the user is constructed, and for each location, a location-user heterogeneous graph centered on the location is constructed. Feature learning is performed based on the user-location heterogeneous graph corresponding to the user to obtain the enhanced feature representation of the user; and feature learning is performed based on the location-user heterogeneous graph corresponding to the location to obtain the enhanced feature representation of the location. Based on the enhanced feature representations of the users and the enhanced feature representations of the locations, the user-user isomorphism graph and the location-location isomorphism graph are constructed respectively.
[0010] Optionally, the global structural representation based on the user and the global structural representation based on the location are iteratively executed on the user-user isomorphism graph and the location-location isomorphism graph, respectively. The next finer-grained learning operation yields the final feature representations for the user and the location, including: The global structural representation of the user is concatenated with the enhanced feature representation of the user to obtain the fused feature representation of the user; the global structural representation of the location is concatenated with the enhanced feature representation of the location to obtain the fused feature representation of the location. Based on the fusion feature representations of the users and the fusion feature representations of the locations, iterative execution is performed on the user-user isomorphism graph and the location-location isomorphism graph, respectively. The next finer-grained learning operation yields the final feature representations of the user and the location.
[0011] Optionally, the target heterogeneous graph is the user-location heterogeneous graph or the location-user heterogeneous graph. Feature learning is performed based on the target heterogeneous graph corresponding to the target object to obtain a target-enhanced feature representation, including: A gating fusion mechanism is used to fuse the initial feature representation of the target neighbor node with the edge feature of the target edge to obtain the aggregate feature representation of the target neighbor node. The target neighbor node is the node connected to the target object in the target heterogeneous graph, and the target edge is the edge between the target neighbor node and the target object. An attention mechanism is used to aggregate the aggregated feature representations of the target neighbor nodes to obtain the target enhanced feature representation of the target object; Wherein, when the target object is a user and the target heterogeneous graph is a user-location heterogeneous graph corresponding to the user, the target augmented feature representation is the augmented feature representation of the user; when the target node is a location and the target heterogeneous graph is a location-user heterogeneous graph corresponding to the location, the target augmented feature representation is the augmented feature representation of the location.
[0012] Optionally, the edge features of the connection edge between the first user and the second user in the user-user isomorphic graph include at least one of the number of common interactions between the users and the rating similarity between the users. The number of common interactions between the users is determined based on the total number of interactions between the first user and the second user and a common location. The common location is a location that has been visited by both the first user and the second user. The rating similarity between the users is determined based on the similarity of the ratings between the first user and the second user for the common location. The first user and the second user are any two connected users in the user-user isomorphic graph, and / or. The edge features of the connection between the first location and the second location in the location-location isomorphism graph include at least one of the following: the number of common interactions between the locations, the rating similarity between the locations, and the geographical relevance. The number of common interactions between the locations is determined based on the total number of interactions between the first location and the second location and a common user. The common user is a user who has visited both the first location and the second location. The rating similarity between the locations is determined based on the similarity of the ratings given by the common user to the first location and the second location. The first location and the second location are any two connected locations in the location-location isomorphism graph.
[0013] Secondly, embodiments of the present invention also provide a location recommendation device based on multi-scale graph learning, comprising: The construction module is used to obtain the initial feature representation of the user and the initial feature representation of the location based on the historical interaction data of multiple users and multiple locations, and to construct the user-user isomorphic graph and the location-location isomorphic graph, wherein the location is used to represent the location that can be displayed on the map and is accessible to the user; The coarse-grained learning module is used to combine spectral analysis and random walk diffusion to learn the overall structural information of the user-user isomorphism graph and the location-location isomorphism graph, respectively, to obtain the global structural representation of the user and the global structural representation of the location; The fine-grained learning module is used to iteratively perform operations on the user-user isomorphism graph and the location-location isomorphism graph, respectively, based on the global structural representation of the user and the global structural representation of the location. The next fine-grained learning operation yields the final feature representations of the user and the location. This fine-grained learning operation uses parallel execution of local message passing and global dependency modeling to obtain fine-grained local and global feature representations. The feature representation output by this current fine-grained learning operation is obtained by fusing these two representations. The feature representation output by the second-fine-grained learning operation is the final feature representation. It is a positive integer; The first determining module is used to determine a predicted score between the user and the location based on the user's final feature representation and the location's final feature representation; The second determining module is used to determine the location to recommend to the user based on the predicted score.
[0014] Thirdly, embodiments of the present invention provide an electronic device, including: a memory, a processor, and a program stored in the memory and executable on the processor; the processor is configured to read the program in the memory to implement the steps in the location recommendation method based on multi-scale graph learning as described in the first aspect.
[0015] Fourthly, embodiments of the present invention provide a readable storage medium for storing a program, which, when executed by a processor, implements the steps of the location recommendation method based on multi-scale graph learning as described in the first aspect.
[0016] The beneficial effects of this invention are as follows: In its embodiments, on the one hand, it combines spectral analysis and random walk diffusion to construct a global structural representation of users and locations. This coarse-grained global structural learning allows the model to move beyond direct interaction data and uncover the macroscopic roles of users and locations within the overall network. On the other hand, by iteratively performing L fine-grained learning operations on the isomorphic graph, the final feature representation retains both accurate local semantics and deep global structural information, significantly improving the robustness and discriminative power of the feature representation. This method, by fusing spectral analysis, random walks, and parallel local-global fine-grained learning mechanisms, can obtain a more accurate and comprehensive final feature representation, thereby significantly improving the overall performance of the location recommendation system. It can more accurately predict the locations a user might visit based on their historical interaction data, thus more accurately recommending locations that the user might be interested in. Attached Figure Description
[0017] Figure 1 This is one of the flowcharts for a location recommendation method based on multi-scale graph learning provided in an embodiment of the present invention; Figure 2a This is a schematic diagram illustrating the process of multi-source feature initialization, heterogeneous graph learning, and isogeneous graph learning provided in an embodiment of the present invention; Figure 2b A schematic diagram illustrating the process of coarse-scale structural representation learning, fine-scale local-global fusion learning, and location recommendation provided in an embodiment of the present invention; Figure 2c A schematic diagram of the global long-distance dependency provided in an embodiment of the present invention; Figure 3 A schematic diagram of a location recommendation device based on multi-scale graph learning provided in an embodiment of the present invention; Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention. Detailed Implementation
[0018] In the embodiments of this application, the term "and / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. The character " / " generally indicates that the preceding and following related objects have an "or" relationship. In the embodiments of this application, the term "multiple" refers to two or more, and other quantifiers are similar. The terms "first," "second," etc., in the specification of this application are used to distinguish similar objects and are not used to describe a specific order or sequence. It should be understood that such terms can be interchanged where appropriate so that embodiments of this application can be implemented in orders other than those illustrated or described herein, and the objects distinguished by "first" and "second" are usually of the same class, without limiting the number of objects. For example, the first object can be one or multiple.
[0019] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of the embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.
[0020] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing embodiments of this application only and is not intended to limit this application.
[0021] This application provides a location recommendation method, apparatus, and electronic device based on multi-scale graph learning, aiming to improve the accuracy of location recommendations to users.
[0022] Please see Figure 1 , Figure 1 This is a flowchart illustrating the location recommendation method based on multi-scale graph learning provided in an embodiment of the present invention. The method specifically includes the following steps: Step 101: Based on historical interaction data of multiple users and multiple locations, obtain the initial feature representation of the user and the initial feature representation of the location, and construct a user-user isomorphic graph and a location-location isomorphic graph, wherein the location is used to represent a location that can be displayed on the map and is accessible to the user; Step 102: Combining spectral analysis and random walk diffusion, the overall structural information of the user-user isomorphism graph and the location-location isomorphism graph is learned respectively to obtain the global structural representation of the user and the global structural representation of the location; Step 103: Based on the global structure representation of the user and the global structure representation of the location, iteratively execute on the user-user isomorphism graph and the location-location isomorphism graph, respectively. The next fine-grained learning operation yields the final feature representations of the user and the location. This fine-grained learning operation uses parallel execution of local message passing and global dependency modeling to obtain fine-grained local and global feature representations. The feature representation output by this current fine-grained learning operation is obtained by fusing these two representations. The feature representation output by the second-fine-grained learning operation is the final feature representation. It is a positive integer; Step 104: Based on the final feature representation of the user and the final feature representation of the location, determine the predicted score between the user and the location; Step 105: Determine the location to recommend to the user based on the predicted score.
[0023] In this embodiment, any location that can be displayed on the map and is accessible to the user can be used as a POI to be recommended. For example, the location can be a restaurant, hotel, attraction, station, merchant, gas station, park, or other geographical location or public facility. Specific details are not listed here.
[0024] Both the number of users and the number of locations are multiple. In some embodiments, the historical interaction data between multiple users and multiple locations includes user metadata, location metadata, and user-location interaction information. Specifically, in some embodiments, user metadata includes user identifiers (IDs), user activity levels, and user comments on locations they have visited. Location metadata includes location IDs, location popularity, and overall location ratings. User-location interaction information includes whether a user has visited the location, the time and number of times a user visited the location, and the user's initial rating of the location.
[0025] like Figure 2a As shown, in some embodiments, unlike methods that rely solely on general embeddings, multi-source feature initialization is used to generate high-quality and personalized initial feature representations of the user and location. Specifically, the user ID and user activity are first encoded using an embedding layer to obtain the user identity embedding. Embedded with user activity Similarly, by using the embedding layer to encode the location ID, location popularity, and overall location score, a location identity embedding is obtained. Location popularity embedding and location-based comprehensive score embedding .
[0026] For user-written reviews of visited locations, the review text is fed into a pre-trained Bidirectional Encoder Representations from Transformers (BERT) model for processing. Average pooling is then used to obtain sentence-level vectors corresponding to the review text. , means as follows: ; in, Indicates the number of tokens. Let be the representation of the i-th token. This is obtained through the above method. It can explicitly capture users' subjective perception of a location, thereby providing more personalized interactive information and improving the ability of initial feature representation to represent user information.
[0027] Finally, by embedding user identity User activity embedding Sentence-level vectors corresponding to comment text By concatenating the data, we obtain the user's initial feature representation. By embedding location identity Location popularity embedding and location-based comprehensive score embedding By splicing the data, we obtain the initial feature representation of the location. : ; ; in, Used to characterize splicing operations.
[0028] Optionally, in some embodiments, step 101 includes: Based on the historical interaction data, obtain the initial feature representation of the user and the initial feature representation of the location; Based on the initial feature representations of the users and the initial feature representations of the locations, for each user, a user-location heterogeneous graph centered on the user is constructed, and for each location, a location-user heterogeneous graph centered on the location is constructed. Feature learning is performed based on the user-location heterogeneous graph corresponding to the user to obtain the enhanced feature representation of the user; and feature learning is performed based on the location-user heterogeneous graph corresponding to the location to obtain the enhanced feature representation of the location. Based on the enhanced feature representations of the users and the enhanced feature representations of the locations, the user-user isomorphism graph and the location-location isomorphism graph are constructed respectively.
[0029] In this embodiment, in order to model the complex interaction relationship between users and points of interest, two complementary heterogeneous graphs are constructed: one centered on each user and the other on the user. Location heterogeneity graphs and location-user heterogeneity graphs centered at each location, wherein the feature representation of user nodes in the heterogeneity graph is the user's initial feature representation. The feature representation of a location node is the initial feature representation of the location. .
[0030] In this embodiment, constructing location-location isomorphic graphs explicitly models the functional associations and semantic similarities between locations, thereby effectively mining potential patterns and contextual dependencies in physical space. Through this approach, the graph structure not only reflects geographical proximity but also implies user behavior-driven functional similarities. This location association modeling based on collaborative access patterns effectively captures higher-order semantic relationships between locations, such as functional complementarity, scene consistency, or topic relevance, thus enriching the contextual representation of locations. These two types of isomorphic graphs enable the model to simultaneously capture user group effects and location associations, providing richer information on relationships between similar entities for subsequent multi-scale learning.
[0031] It should be understood that, for each user, in the user-location heterogeneous graph constructed with that user as the center, nodes are used to represent the user and all the locations that the user has visited. The user is connected to the locations they have visited, and the edge features of the connection edges are determined based on the interaction information between the user and the location.
[0032] Specifically, for each user, a corresponding user group is constructed with that user as the center. Location heterogeneity map. Based on user... User-centric architecture Location Heterogeneity Map In the middle, user nodes Connected to all locations it has historically interacted with, the user Location Heterogeneity Map The formal definition is as follows: ; in, Indicates to users A collection of locations where interactions have taken place. Indicates from user node The set of directed edges pointing to these locations, where, Indicates user and location The connecting edges between them express Visited .
[0033] Unlike traditional graphs that only characterize the existence of edges, in some embodiments, the constructed user Location heterogeneous graphs incorporate rich interaction information along their connecting edges to capture fine-grained relationship patterns, ultimately forming four-dimensional edge features, among which... The edge features can be represented as: .
[0034] Rating Intensity (RI) quantifies the strength of a user's preference for a location by normalizing the user's raw rating to the [0,1] range. Specifically, the user... Location Rating intensity for: ; in, For users Location The original rating, Used to characterize normalization operations.
[0035] Rating deviation (RD) measures the difference between a user's rating of a location and the average rating of that location, in order to characterize personalized preferences. Specifically, users... Location Scoring bias for: ; in, For location Average rating The maximum value of the rating scale. The maximum and minimum values of the rating scale are used to limit the range of user ratings for a location. For example, in some embodiments, the maximum value of the rating scale is 10 and the minimum value is 0. In other embodiments, the maximum value of the rating scale is 5 and the minimum value is 0.
[0036] Temporal relevance (TR) is used to assign higher values to more recent interactions to highlight dynamic changes in user preferences. In some implementations, temporal relevance is obtained by normalizing the time of a user's visit to a location. Specifically, the user... Location Time correlation for: ; in, For users Visiting locations The time scale can be set and adjusted according to actual needs. For example, in some embodiments, the time is the date the user visits the location, while in other embodiments, the time is used to characterize the specific moment the user visits the location.
[0037] Interaction Rarity (IR) is determined based on the number of locations a user has interacted with. In some embodiments, logarithmic inverse scaling is used to determine interaction rarity to highlight rare interactions. Specifically, the user... Location Interaction rarity for: ; in, For users The number of locations interacted with.
[0038] It should be understood that, for each location, in the location-user heterogeneous graph constructed with that location as the center, nodes are used to represent that location and all users who have visited that location. The location is connected to the users who have visited it, and the edge features of the connection edges are determined based on the interaction information between the location and the user.
[0039] For each location, construct its corresponding location-user heterogeneous graph centered on that location. Location-User Heterogeneous Graph Built Around the Center In the middle, location nodes Connected to all users who have visited it. Location-User Heterogeneity Graph The formal definition is as follows: ; in, Indicates location The collection of users who have interacted with the platform. Indicates from the location node The set of directed edges pointing to these user nodes, where, Indicate location and users The edge between, express quilt Visited.
[0040] Similarly, the location-user heterogeneous graph constructed in this embodiment incorporates rich interaction information on the edges to capture fine-grained relationship patterns, ultimately forming four-dimensional edge features, where, The edge features can be represented as: .
[0041] Specifically, users Location Rating intensity for: ; in, For users Location The original rating, Used to characterize normalization operations.
[0042] Specifically, users Location Scoring bias for: ; in, For users The given average rating, specifically, by users The average rating given by users The average of the raw ratings given to the places they visited. The maximum value of the rating scale. This represents the minimum value of the scoring scale.
[0043] Specifically, users Location Time correlation for: ; in, For users Visiting locations The time.
[0044] Specifically, users Location Interaction rarity for: ; in, For users The number of locations interacted with.
[0045] In some embodiments, to optimize the contribution weights of each dimension of the edge features, a learnable weight adjustment mechanism is applied to all edge features. The weighted edge features are calculated as follows: ; ; in, It is a learnable vector, whose values are learned through backpropagation training of the model. Used to characterize the softmax function It is a binary mask that marks the effective feature dimensions. For the feature of the k-th feature dimension, Let be the weight corresponding to the k-th dimension, where the feature of the first feature dimension is rating intensity, the feature of the second feature dimension is rating bias, the feature of the third feature dimension is time relevance, and the feature of the fourth feature dimension is interaction sparseness.
[0046] Optionally, in some embodiments, the target heterogeneous graph is the user-location heterogeneous graph or the location-user heterogeneous graph. Feature learning is performed based on the target heterogeneous graph corresponding to the target object to obtain a target-enhanced feature representation, including: A gating fusion mechanism is used to fuse the initial feature representation of the target neighbor node with the edge feature of the target edge to obtain the aggregate feature representation of the target neighbor node. The target neighbor node is the node connected to the target object in the target heterogeneous graph, and the target edge is the edge between the target neighbor node and the target object. An attention mechanism is used to aggregate the aggregated feature representations of the target neighbor nodes to obtain the target enhanced feature representation of the target object; Wherein, when the target object is a user and the target heterogeneous graph is a user-location heterogeneous graph corresponding to the user, the target augmented feature representation is the augmented feature representation of the user; when the target node is a location and the target heterogeneous graph is a location-user heterogeneous graph corresponding to the location, the target augmented feature representation is the augmented feature representation of the location.
[0047] In this embodiment, through the user The construction of location heterogeneous graphs and location-user heterogeneous graphs makes the feature learning processes of users and locations independent and complementary. Users enhance their own representation by aggregating the features of the locations they have visited, while locations also enhance their own representation by aggregating the features of the users who have visited them.
[0048] Specifically, a gating fusion mechanism is first employed to fuse the special representations of nodes and edge features in heterogeneous graphs. middle and Corresponding gating weights The calculation is as follows: ; in, Used to represent the sigmoid function. Location node The initial feature representation, Weighted adjustment edge features, The first weight matrix, For the first bias term, and All of these are learnable parameters.
[0049] After fusion, the result is Aggregation feature representation for: ; in, For the second weight matrix, For the second bias term, and All of these are learnable parameters.
[0050] Similarly, for By applying the same mechanism symmetrically, the gating weights are obtained. With aggregated feature representation . and All retain multi-source information and incorporate interaction information adjusted by edge features. Specifically, middle and Corresponding gating weights The calculation is as follows: ; in, Used to represent the sigmoid function. For user nodes The initial feature representation, Weighted adjustment edge features, For the third weight matrix, For the third bias term, and All of these are learnable parameters.
[0051] The result after fusion Aggregation feature representation for: ; in, The fourth weight matrix, This is the fourth bias term. and All of these are learnable parameters.
[0052] In this embodiment, the initial feature representations of neighboring nodes are non-linearly fused with the edge features of the corresponding connecting edges to generate aggregated feature representations rich in contextual information. This design allows the model to consider not only the node's own attributes when judging the importance of neighbors, but also dynamically combine the specific interaction relationship between them, thereby generating a more fine-grained and semantically rich intermediate representation, effectively improving the accuracy of feature expression.
[0053] Furthermore, for both user-location heterogeneous graphs and location-user heterogeneous graphs, an attention mechanism is applied to selectively focus on the most informative neighbors for neighbor aggregation. In this way, higher weights are automatically assigned to frequently visited or highly rated locations, while suppressing interference from noisy or low-relevance neighbors. This adaptive weight allocation mechanism greatly enhances the robustness of the model, enabling it to capture potential complex dependencies in the data.
[0054] Specifically, regarding the diagram users in Assigning locations to neighbors Attention weight calculation as follows: ; in, Used to characterize the tanh function Used to characterize exponential operations. This is the first attention weight matrix. This is the second attention weight matrix. and These are learnable parameters.
[0055] Enhanced users Enhanced feature representation The calculation is as follows: ; Similarly, for Location in Assigned to neighboring users Attention weight calculation as follows: ; in, This is the third attention weight matrix. This is the fourth attention weight matrix. and These are learnable parameters. Enhanced location. Enhanced feature representation The calculation is as follows: .
[0056] In this embodiment, by incorporating edge features into the attention calculation process, the model can effectively distinguish the semantic differences between different interaction behaviors. This refined feature learning approach directly improves the accuracy of user interest prediction, making the recommendation results more aligned with the user's personalized needs. Especially in scenarios with sparse data, it can still maintain high recommendation quality by mining strongly correlated neighbors.
[0057] To characterize the relationships between similar entities, user-user isomorphic graphs and location-location isomorphic graphs are constructed based on the enhanced feature representations of the users and the locations, respectively. Nodes in the user-user isomorphic graph represent all users. If any two users have visited at least one common location, then the nodes corresponding to these two users are connected; otherwise, they are not connected.
[0058] It should be understood that the feature representation of a node in the user-user isomorphism graph is the feature representation of the user obtained in the preceding steps. For example, in some embodiments, the feature representation of a node in the user-user isomorphism graph is the initial feature representation of the user. In other embodiments, the feature representation of a node in the user-user isomorphism graph is an enhanced feature representation of the user.
[0059] In this embodiment, a user-user isomorphic graph is constructed. This is to model the similarity relationships between users. If users With users If you have visited at least one common location, then in Add edges .
[0060] Optionally, in some embodiments, the edge features of the connection edge between the first user and the second user in the user-user isomorphism graph include at least one of the number of common interactions between the users and the rating similarity between the users. The number of common interactions between the users is determined based on the total number of interactions between the first user and the second user and a common location. The common location is a location that has been visited by both the first user and the second user. The rating similarity between the users is determined based on the similarity of the ratings between the first user and the second user for the common location. The first user and the second user are any two connected users in the user-user isomorphism graph.
[0061] Specifically, users and users The edge characteristics of the connecting edges are: To explicitly quantify the similarity between users, as follows: The Common Interaction Count (CI) is determined based on the total number of interactions between two users and their shared interests, reflecting the strength of their shared interests. With users Number of common interactions The definition is as follows: ; in, Indicates user With location The number of interactions between them Indicates user With location The number of interactions between them Indicates user and A collection of locations that have all interacted with each other.
[0062] Rating Similarity (RS) measures the consistency between two users' ratings of a common location. With users similarity of ratings Defined as: ; in, and Representing users respectively and Location The rating. The higher the value, the better for the user. and The more consistent the preferences, Used to represent The number of locations in the middle.
[0063] In this embodiment, by constructing a user-user isomorphic graph, higher-order collaborative relationships between users can be explicitly modeled, thereby effectively uncovering potential user community structures and similar interests and preferences. Simultaneously, edge features constructed based on the number of shared interactions and rating similarity can quantify the degree of behavioral overlap and preference consistency among users. This allows the model to not only identify who is related to the target user when aggregating neighbor user information, but also accurately distinguish the strength and consistency of this correlation.
[0064] It should be understood that nodes in a location-location isomorphism graph represent all locations. If a first location and a second location have been visited by at least one of the same users, then the first and second locations are connected; otherwise, they are not connected. The first and second locations can be any two locations. The feature representation of a node in a location-location isomorphism graph is the feature representation of the location obtained in the preceding steps. For example, in some embodiments, the feature representation of a node in a location-location isomorphism graph is the initial feature representation of the location. In other embodiments, the feature representation of a node in a location-location isomorphism graph is an enhanced feature representation of the location.
[0065] For location-location isomorphism If two locations have been visited by at least one common user, an edge is established between them. Optionally, in some embodiments, the edge features of the connection edge between the first location and the second location in the location-location isomorphism graph include at least one of the following: the number of common interactions between the locations, the rating similarity between the locations, and geographical relevance. The number of common interactions between the locations is determined based on the total number of interactions between the first location and the second location and the common user, where the common user is a user who has visited both the first location and the second location. The rating similarity between the locations is determined based on the similarity of the ratings given by the common user to the first location and the second location. The first location and the second location are any two connected locations in the location-location isomorphism graph.
[0066] specifically, location and location The edge characteristics of the connecting edges are: The details are as follows: The number of shared interactions between locations measures the total number of interactions between two shared locations by users, reflecting the shared visit pattern of the locations. With location Number of common interactions The definition is as follows: ; in, Indicates user With location The number of interactions between them Indicates user With location The number of interactions between them Indicate location With location A collection of users who have interacted with each other.
[0067] Location rating similarity is used to capture the consistency of ratings given to two locations by common users, thus reflecting the similarity of locations in terms of function or quality. With location similarity of ratings The definition is as follows: ; in, and Representing users respectively Location and location The rating. The higher the value, the more accurate the location. With location The more consistent the functions or similarities, the better. Used to represent The number of users in China.
[0068] Geographic Relevance (GR) quantifies spatial correlation by inverting the normalized Harvard sinus distance between locations. With location Geographical relevance The definition is as follows: ; in, Used to characterize the straight-line distance in spherical space between two locations. for latitude coordinates for longitude coordinates for latitude coordinates for The longitude coordinates.
[0069] In some embodiments, by jointly optimizing two types of isomorphic graphs and two types of heteromorphic graphs, cross-graph information interaction and feature fusion can be achieved, so that the final generated feature representation not only contains its own attribute information, but also integrates its structural role and functional positioning in the geospatial network, which significantly improves the scene adaptability and semantic accuracy of the recommendation results.
[0070] Optionally, in some embodiments, the first target isomorphism graph is the user-user isomorphism graph or the location-location isomorphism graph. Combining spectral analysis and random walk diffusion, the overall structural information of the first target isomorphism graph is learned to obtain a global structural representation of the target, including: The first target isomorphism graph is input into the spectral analysis branch and the random walk branch respectively for encoding processing to obtain the first encoded representation and the second encoded representation; The first encoding representation and the second encoding representation are fused using an attention mechanism to obtain the target global structure representation; Wherein, when the first target isomorphic graph is the user-user isomorphic graph, the target global structure representation is the global structure representation of the user; and when the first target isomorphic graph is the location-location isomorphic graph, the target global structure representation is the global structure representation of the location.
[0071] The SpectroWalk encoder is a bi-branch structural feature extractor designed specifically for graph data. Its core objective is to capture the overall topological structure information of the graph beyond local neighbors, thereby learning the role and connection patterns of nodes in the macroscopic network. To capture the overall structural information of isomorphic graphs, in some embodiments, the SpectroWalk encoder is used to learn the overall structural information of user-user isomorphic graphs and location-location isomorphic graphs separately, obtaining global structural representations of users and locations. This method combines spectral analysis and random walk diffusion; this coarse-grained processing focuses on macroscopic roles and connection patterns, rather than local interactions.
[0072] like Figure 2b As shown, specifically, the SpectroWalk encoder contains two parallel branches: a spectral analysis branch and a random walk branch, used to extract complementary structural features. The spectral analysis branch extracts the minimum nontrivial eigenvector from the normalized Laplacian matrix and passes it through a two-layer multilayer perceptron (MLP) with sign invariance (denoted as...). and Encoding is performed, and the first encoded representation is extracted from the spectral analysis branch. for: ; in, This represents the nontrivial eigenvectors obtained from the normalized Laplacian matrix decomposition of the graph. Used to characterize the positive sign-invariant multilayer perceptron mapping function. This is used to characterize the negative sign-invariant multilayer perceptron mapping function. It should be understood that in some embodiments, the normalized Laplacian matrix is constructed based on the degree matrix and adjacency matrix of the isomorphic graph; the specific construction method will not be elaborated here.
[0073] In this embodiment, the first encoding representation obtained through spectral analysis branch naturally possesses the physical meaning of graph segmentation, and can reveal potential clustering structures and connectivity bottlenecks in the graph. This is achieved by designing a sign-invariant dual-path MLP (...). and By encoding feature vectors, the model can retain and learn the relative position information of nodes in graph partitioning (such as whether they are in the core or boundary of a community), thereby gaining a deep understanding of the macroscopic algebraic structure of the graph.
[0074] Random walk branch in the transition matrix Upper simulation Perform a random walk, record the probability of loop landing at each step, and form a feature vector. The second encoded representation is then obtained through encoding. : ; in, Used to characterize the nonlinear coding function of a multilayer perceptron. Let be the landing probability eigenvector of a multi-step random walk on the graph transition matrix. It is the inverse of the graph degree matrix. Let be the adjacency matrix of the graph.
[0075] Furthermore, to integrate the two structural perspectives, the outputs of the two branches are fused through an attention mechanism to obtain a global structural representation of the target. Specifically, adaptive fusion weights... The calculation is as follows: ; in, Used to characterize linear transformations.
[0076] In this embodiment, extracting the second encoding representation through random walk branches can effectively capture the dynamic paths of information propagation and the reachability patterns of nodes in the graph, reflecting the influence and centrality of nodes in the global diffusion process. Compared with static adjacency relationships, the second encoding representation better reflects the functional role and context of nodes in complex networks.
[0077] The fused target global structure representation for: ; In the specific implementation, the SpectroWalk encoder described above is applied to user-user isomorphic graphs respectively. Location-location isomorphism To extract the global structure representation of each user. and the global structure representation of each location The global structural representation obtained through the above extraction captures higher-order collaborative signals beyond local interactions (such as the implicit hierarchy of user communities and the functional partitioning of location networks), effectively compensating for the global contextual information that may be missed by local feature aggregation.
[0078] In this embodiment, the global structural representation primarily encodes the macroscopic role and long-range dependencies of nodes within the overall graph topology. It not only reflects the structural position of nodes in the network and captures indirect dependencies between nodes, but also identifies node pairs that are closely linked through multi-hop paths despite lacking direct connections. By introducing an attention mechanism to adaptively fuse the encoding results of the two branches to obtain the global structural representation, the model can generate the optimal target global structural representation based on the specific task requirements. This fusion strategy not only enhances the model's expressive power but also improves its adaptability to changes in graph structure across different scenarios.
[0079] In some embodiments, the global structural representation of the user is concatenated with the initial feature representation of the user to obtain the fused feature representation of the user, and the global structural representation of the location is concatenated with the initial feature representation of the location to obtain the fused feature representation of the location; Based on the fusion feature representations of the users and the fusion feature representations of the locations, iterative execution is performed on the user-user isomorphism graph and the location-location isomorphism graph, respectively. The next finer-grained learning operation yields the final feature representations of the user and the location.
[0080] Optionally, in other embodiments, step 103 includes: concatenating the global structural representation of the user with the enhanced feature representation of the user to obtain the fused feature representation of the user, and concatenating the global structural representation of the location with the enhanced feature representation of the location to obtain the fused feature representation of the location; Based on the fusion feature representations of the users and the fusion feature representations of the locations, iterative execution is performed on the user-user isomorphism graph and the location-location isomorphism graph, respectively. The next finer-grained learning operation yields the final feature representations of the user and the location.
[0081] In this embodiment, the global structure representation is concatenated with the feature representation from the heterogeneous graph, and aligned through a linear transformation to obtain the fused feature representation. : ; Specifically, the user's global structural representation and the user's enhanced feature representation are concatenated to obtain the user's fused feature representation. By concatenating the global structural representation of a location with its enhanced feature representation, a fused feature representation of the location can be obtained. By performing the above operations on each user and each location, the fused feature representations for each user and each location can be obtained.
[0082] The concatenation operation directly combines the two features along the vector dimension, preserving the original distribution and independence of each feature and avoiding numerical interference or overlap between features from different sources. Through this method, the final fused feature representation possesses both a macroscopic structural perspective and microscopic semantic precision, thereby achieving comprehensive modeling of complex real-world scenes.
[0083] In this embodiment, the fine-grained learning stage includes The layered structure performs a fine-grained learning operation at each layer, and performs local message passing and global dependency modeling in parallel on the isomorphic graph, gradually refining the node representation to capture fine-grained structural information.
[0084] It should be understood that the input to the fine-grained learning stage is the feature representation of the nodes in the isomorphic graph obtained in the aforementioned steps. For example, in some embodiments, the fused feature representation of the user and the fused feature representation of the location are obtained through the SpectroWalk encoder, and the feature representation of the nodes in the isomorphic graph input to the fine-grained learning stage is the fused feature representation obtained in the aforementioned steps. In other embodiments, the feature representation of the nodes in the isomorphic graph input to the fine-grained learning stage is the global feature representation obtained in the aforementioned steps, which will not be elaborated here.
[0085] The process of local message passing is explained below. In this embodiment, a gated graph convolutional network is used to model the graph separately. and This involves fine-grained local interaction patterns. First, adaptive weights are learned from edge features to regulate the message passing process, and then user preferences are differentiated during aggregation. (Node) and nodes Gating weights between The calculation is as follows: ; in, 、 and They are respectively , and The corresponding linear transformation matrix, Used to characterize the Sigmoid function For nodes Feature representation, For nodes The features are specifically represented in some embodiments. For nodes The fusion feature representation, For nodes The fusion feature representation, For nodes and nodes The edge characteristics of the connecting edges between nodes. During the aggregation process, nodes... Receive the weighted neighbor information and obtain the output feature representation. : ; in, To prevent the constant from being divided by zero in the denominator, its value is usually a local minimum. Used to characterize nodes The set of neighboring nodes.
[0086] Subsequently, a fine-grained local feature representation of the output is obtained through residual connections. : ; The above methods can accurately capture the local relationships between similar nodes.
[0087] like Figure 2c As shown, to adapt graph data for sequence processing, this embodiment prioritizes nodes based on their importance. This strategy combines Laplacian eigenvectors. Node degree and entity-specific indicators (Such as user activity or location popularity), place key nodes at the end of the sequence to improve context access efficiency.
[0088] Mamba is a novel neural network architecture based on the Selective State Space Model (Selective SSM), designed to address the computational inefficiency of traditional Transformer models when processing long sequences. Mamba's selective state update mechanism ensures that key nodes receive richer contextual information, thereby enhancing processing performance. Node importance scores are obtained based on a predefined node importance scoring strategy. The calculation is as follows: ; As a specific implementation method, the serialized and sorted node feature sequence The data will be fed into the Mamba model to capture long-range dependencies and obtain fine-grained global feature representations. : ; Subsequently, after the Mamba model processes the output, the node features are reordered to restore the original node order and added to the fused feature representation of the nodes to obtain a feature representation with global awareness. In each layer, fine-grained local feature representations are fused with fine-grained global feature representations to generate a refined first intermediate embedding. : ; First intermediate embedding A second intermediate embedding will be obtained by introducing a nonlinear transformation through a two-layer feedforward network. : ; Finally, the embedding is stabilized through residual connections and batch normalization to obtain the feature representation of the current layer output. : ; in, Used to characterize Mamba model processing Used to characterize batch normalization processing Used to characterize the ReLU activation function and Here are the weight matrix and biases for the first feedforward network. and Here are the weight matrix and bias for the second feedforward network.
[0089] In practice, the above process is repeated for both user-user isomorphic graphs and location-location isomorphic graphs. This process gradually refines the node representation, the first... The feature representation output by the layer is the final feature representation of the node. It should be noted that, in the case where the second target isomorphic graph is a user-user isomorphic graph, the node... and nodes Used to characterize users and users The fine-grained local feature representation for each user can be obtained through the above method. and fine-grained global feature representation for each user The two are then combined to generate the user's final feature representation. Similarly, when the second target isomorphism is a location-to-location isomorphism, the nodes... and nodes Used to characterize location and location The fine-grained local feature representation for each location can be obtained through the above method. and fine-grained global feature representation for each location The two are then merged to generate the final feature representation of the location. .
[0090] By using the above method, based on the final feature representation of the user and the final feature representation of the location, each user is traversed, the predicted score corresponding to the user and each location is calculated, and the location recommended to the user is determined based on the predicted score, thus realizing personalized location recommendation for each user.
[0091] Optionally, in some embodiments, the second target isomorphic graph is the user-user isomorphic graph or the location-location isomorphic graph. Based on the global structural representation of the user and the global structural representation of the location, the fine-grained learning operation is performed on the second target isomorphic graph, including: A gated graph convolutional network is used to model the fine-grained local interaction patterns in the second target isomorphic graph, resulting in a fine-grained local feature representation. In this representation, nodes in the second target isomorphic graph... Fine-grained local feature representation for: ; ; ; in, For nodes The output feature representation after aggregating neighbor information, For nodes and nodes The gating weights between them For nodes Feature representation, For nodes Feature representation, For nodes and nodes Edge characteristics of the connecting edges between them. 、 and They are respectively , and The corresponding linear transformation matrix, Used to characterize the Sigmoid function To prevent the denominator from being divided by a constant; The nodes in the second target isomorphic graph are sorted based on the node importance score to obtain the sorted node features; The sorted node features are processed based on the Mamba model to obtain a fine-grained global feature representation, wherein the node... Fine-grained global feature representation for: ; in, This is a sequence of node features sorted by node importance score. Used to characterize the Mamba model; The fine-grained local feature representation and the fine-grained global feature representation are fused to generate the feature representation output by the current execution of the fine-grained learning operation, wherein the node output by the current execution of the fine-grained learning operation... Feature representation for: ; ; ; in, Used to characterize batch normalization processing Used to characterize the ReLU activation function and Here are the weight matrix and biases for the first feedforward network. and Here are the weight matrix and biases for the second feedforward network. For nodes The first intermediate embedding, For nodes The second intermediate embedding.
[0092] As a specific example, the user and location Corresponding predicted score Through users The final feature representation and location The inner product of the final feature representation is calculated as follows: ; in, For users The final characteristic representation, For location The final characteristic representation, Used to characterize the transpose operation.
[0093] The more similar the final feature representations of users and locations are, the higher the corresponding predicted score, which matches user preferences. In some embodiments, for any user, locations with predicted scores greater than a preset value are identified as the user's target locations and recommended to the user. In other embodiments, the top N locations with predicted scores ranked from highest to lowest are identified as the user's target locations and recommended to the user; the specific implementation is not limited.
[0094] In some embodiments, mean squared error is used as the primary objective function during training to measure the difference between the predicted and actual scores. This method imposes a stronger penalty on larger errors, improving prediction accuracy and ensuring numerical stability. Loss function The definition is as follows:
[0095] in, It is a collection of user-location interactions in the training set. for The number of elements in User Location Real ratings Represents all learnable parameters. It is the L2 regularization coefficient. Used to represent L2 regularization.
[0096] In this embodiment, to characterize the complex interactions between users and locations, an enhanced heterogeneous graph and a homogeneous graph with information-rich node embeddings and edge features are constructed. At a coarse-grained level, spectral analysis and random walk diffusion are fused to extract global structural patterns; at a fine-grained level, edge features are used to model user preference strengths, while an importance-based ranking mechanism enables Mamba to discover potential interest matches across multiple hops.
[0097] like Figure 3 As shown, this embodiment of the invention also provides a location recommendation device 300 based on multi-scale graph learning, comprising: The construction module 301 is used to obtain the initial feature representation of the user and the initial feature representation of the location based on the historical interaction data of multiple users and multiple locations, and to construct a user-user isomorphic graph and a location-location isomorphic graph, wherein the location is used to represent a location that can be displayed on the map and is accessible to the user; The coarse-grained learning module 302 is used to combine spectral analysis and random walk diffusion to learn the overall structural information of the user-user isomorphism graph and the location-location isomorphism graph, respectively, to obtain the global structural representation of the user and the global structural representation of the location; Fine-grained learning module 303 is used to iteratively perform operations on the user-user isomorphism graph and the location-location isomorphism graph, respectively, based on the global structural representation of the user and the global structural representation of the location. The next fine-grained learning operation yields the final feature representations of the user and the location. This fine-grained learning operation uses parallel execution of local message passing and global dependency modeling to obtain fine-grained local and global feature representations. The feature representation output by this current fine-grained learning operation is obtained by fusing these two representations. The feature representation output by the second-fine-grained learning operation is the final feature representation. It is a positive integer; The first determining module 304 is used to determine a predicted score between the user and the location based on the user's final feature representation and the location's final feature representation; The second determining module 305 is used to determine the location to recommend to the user based on the predicted score.
[0098] Optionally, the first target isomorphism graph is either the user-user isomorphism graph or the location-location isomorphism graph. Combining spectral analysis and random walk diffusion, the overall structural information of the first target isomorphism graph is learned to obtain a global structural representation of the target, including: The first target isomorphism graph is input into the spectral analysis branch and the random walk branch respectively for encoding processing to obtain the first encoded representation and the second encoded representation; The first encoding representation and the second encoding representation are fused using an attention mechanism to obtain the target global structure representation; Wherein, when the first target isomorphic graph is the user-user isomorphic graph, the target global structure representation is the global structure representation of the user; when the first target isomorphic graph is the location-location isomorphic graph, the target global structure representation is the global structure representation of the location. Wherein, the first encoding represents and the second encoding representation They are respectively: ; ; in, The nontrivial eigenvectors obtained from the normalized Laplacian matrix decomposition of the graph. Let be the landing probability eigenvector of a multi-step random walk on the graph transition matrix. Used to characterize the positive sign-invariant multilayer perceptron mapping function. Used to characterize the negative sign-invariant multilayer perceptron mapping function. Used to characterize the coding function of a multilayer perceptron.
[0099] Optionally, the second target isomorphic graph is the user-user isomorphic graph or the location-location isomorphic graph. Based on the global structural representation of the user and the global structural representation of the location, the fine-grained learning operation is performed on the second target isomorphic graph, including: A gated graph convolutional network is used to model the fine-grained local interaction patterns in the second target isomorphic graph, resulting in a fine-grained local feature representation. In this representation, nodes in the second target isomorphic graph... Fine-grained local feature representation for: ; ; ; in, For nodes The output feature representation after aggregating neighbor information, For nodes and nodes The gating weights between them For nodes Feature representation, For nodes Feature representation, For nodes and nodes Edge characteristics of the connecting edges between them. 、 and They are respectively , and The corresponding linear transformation matrix, Used to characterize the Sigmoid function To prevent the denominator from being divided by a constant; The nodes in the second target isomorphic graph are sorted based on the node importance score to obtain the sorted node features; The sorted node features are processed based on the Mamba model to obtain a fine-grained global feature representation, wherein the node... Fine-grained global feature representation for: ; in, This is a sequence of node features sorted by node importance score. Used to characterize the Mamba model; The fine-grained local feature representation and the fine-grained global feature representation are fused to generate the feature representation output by the current execution of the fine-grained learning operation, wherein the node output by the current execution of the fine-grained learning operation... Feature representation for: ; ; ; in, Used to characterize batch normalization processing Used to characterize the ReLU activation function and Here are the weight matrix and biases for the first feedforward network. and Here are the weight matrix and biases for the second feedforward network. For nodes The first intermediate embedding, For nodes The second intermediate embedding.
[0100] Optionally, the construction module 301 includes: The acquisition unit is used to acquire the initial feature representation of the user and the initial feature representation of the location based on the historical interaction data; The first construction unit is configured to, based on the initial feature representation of the user and the initial feature representation of the location, construct a user-location heterogeneous graph centered on the user for each user, and construct a location-user heterogeneous graph centered on the location for each location; The feature learning unit is used to perform feature learning based on the user-location heterogeneous graph corresponding to the user to obtain the enhanced feature representation of the user, and to perform feature learning based on the location-user heterogeneous graph corresponding to the location to obtain the enhanced feature representation of the location; The second construction unit is used to construct the user-user isomorphic graph and the location-location isomorphic graph based on the enhanced feature representation of the user and the enhanced feature representation of the location, respectively.
[0101] Optionally, the fine-grained learning module 303 includes: The splicing unit is used to splice the global structural representation of the user with the enhanced feature representation of the user to obtain the fused feature representation of the user, and to splice the global structural representation of the location with the enhanced feature representation of the location to obtain the fused feature representation of the location; Fine-grained learning units are used to iteratively execute on the user-user isomorphism graph and the location-location isomorphism graph, respectively, based on the fused feature representation of the user and the fused feature representation of the location. The next finer-grained learning operation yields the final feature representations of the user and the location.
[0102] Optionally, the target heterogeneous graph is the user-location heterogeneous graph or the location-user heterogeneous graph. Feature learning is performed based on the target heterogeneous graph corresponding to the target object to obtain a target-enhanced feature representation, including: A gating fusion mechanism is used to fuse the initial feature representation of the target neighbor node with the edge feature of the target edge to obtain the aggregate feature representation of the target neighbor node. The target neighbor node is the node connected to the target object in the target heterogeneous graph, and the target edge is the edge between the target neighbor node and the target object. An attention mechanism is used to aggregate the aggregated feature representations of the target neighbor nodes to obtain the target enhanced feature representation of the target object; Wherein, when the target object is a user and the target heterogeneous graph is a user-location heterogeneous graph corresponding to the user, the target augmented feature representation is the augmented feature representation of the user; when the target node is a location and the target heterogeneous graph is a location-user heterogeneous graph corresponding to the location, the target augmented feature representation is the augmented feature representation of the location.
[0103] Optionally, the edge features of the connection edge between the first user and the second user in the user-user isomorphic graph include at least one of the number of common interactions between the users and the rating similarity between the users. The number of common interactions between the users is determined based on the total number of interactions between the first user and the second user and a common location. The common location is a location that has been visited by both the first user and the second user. The rating similarity between the users is determined based on the similarity of the ratings between the first user and the second user for the common location. The first user and the second user are any two connected users in the user-user isomorphic graph, and / or. The edge features of the connection between the first location and the second location in the location-location isomorphism graph include at least one of the following: the number of common interactions between the locations, the rating similarity between the locations, and the geographical relevance. The number of common interactions between the locations is determined based on the total number of interactions between the first location and the second location and a common user. The common user is a user who has visited both the first location and the second location. The rating similarity between the locations is determined based on the similarity of the ratings given by the common user to the first location and the second location. The first location and the second location are any two connected locations in the location-location isomorphism graph.
[0104] The location recommendation device 300 based on multi-scale graph learning provided in this application embodiment can execute the above method embodiment, and its implementation principle and technical effect are similar, so it will not be described again here.
[0105] It should be noted that the division of units in the embodiments of this application is illustrative and only represents one logical functional division. In actual implementation, other division methods may be used. Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated units described above can be implemented in hardware or as software functional units.
[0106] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a processor-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0107] like Figure 4 As shown, this application embodiment provides an electronic device 400, including: a memory 402, a processor 401, and a program stored in the memory 402 and executable on the processor 401; the processor 401 is used to read the program in the memory 402 to implement the steps in the location recommendation method based on multi-scale graph learning as described above.
[0108] This application also provides a readable storage medium storing a program that, when executed by a processor, implements the various processes of the above-described location recommendation method based on multi-scale graph learning, and achieves the same technical effect. To avoid repetition, it will not be described again here. The readable storage medium can be any available medium or data storage device that the processor can access, including but not limited to magnetic storage (such as floppy disks, hard disks, magnetic tapes, magneto-optical disks (MOs), etc.), optical storage (such as compact disks (CDs), digital video discs (DVDs), Blu-ray discs (BDs), high-definition versatile discs (HVDs), etc.), and semiconductor storage (such as read-only memory (ROMs), erasable programmable read-only memory (EPROMs), electrically erasable programmable read-only memory (EEPROMs), non-volatile memory (NAND flash), solid-state drives (SSDs)).
[0109] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.
[0110] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, disk, optical disk) and includes several instructions to cause a terminal (which may be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in the various embodiments of this application.
[0111] The embodiments of this application have been described above with reference to the accompanying drawings. However, this application is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other modifications under the guidance of this application without departing from its spirit, and all of these modifications are within the scope of protection of this application.
Claims
1. A location recommendation method based on multi-scale graph learning, characterized in that, include: Based on historical interaction data of multiple users and multiple locations, the initial feature representations of the users and the initial feature representations of the locations are obtained, and user-user isomorphic graphs and location-location isomorphic graphs are constructed, wherein the locations are used to represent locations that can be displayed on the map and are accessible to users; By combining spectral analysis and random walk diffusion, the overall structural information of the user-user isomorphism graph and the location-location isomorphism graph is learned respectively, so as to obtain the global structural representation of the user and the global structural representation of the location; Based on the global structural representations of the users and the locations, iterative execution is performed on the user-user isomorphism graph and the location-location isomorphism graph, respectively. The next fine-grained learning operation yields the final feature representations of the user and the location. This fine-grained learning operation uses parallel execution of local message passing and global dependency modeling to obtain fine-grained local and global feature representations. The feature representation output by this current fine-grained learning operation is obtained by fusing these two representations. The feature representation output by the second-fine-grained learning operation is the final feature representation. It is a positive integer; Based on the final feature representation of the user and the final feature representation of the location, a predicted rating between the user and the location is determined; The location recommended to the user is determined based on the predicted score.
2. The location recommendation method based on multi-scale graph learning according to claim 1, characterized in that, The first target isomorphic graph is either the user-user isomorphic graph or the location-location isomorphic graph. Combining spectral analysis and random walk diffusion, the overall structural information of the first target isomorphic graph is learned to obtain a global structural representation of the target, including: The first target isomorphism graph is input into the spectral analysis branch and the random walk branch respectively for encoding processing to obtain the first encoded representation and the second encoded representation; The first encoding representation and the second encoding representation are fused using an attention mechanism to obtain the target global structure representation; Wherein, when the first target isomorphic graph is the user-user isomorphic graph, the target global structure representation is the global structure representation of the user; when the first target isomorphic graph is the location-location isomorphic graph, the target global structure representation is the global structure representation of the location. Wherein, the first encoding represents and the second encoding representation They are respectively: ; ; in, The nontrivial eigenvectors obtained from the normalized Laplacian matrix decomposition of the graph. Let be the landing probability eigenvector of a multi-step random walk on the graph transition matrix. Used to characterize the mapping function of a positive sign-invariant multilayer perceptron. Used to characterize the negative sign-invariant mapping function of a multilayer perceptron. Used to characterize the coding function of a multilayer perceptron.
3. The location recommendation method based on multi-scale graph learning according to claim 1, characterized in that, The second target isomorphic graph is either the user-user isomorphic graph or the location-location isomorphic graph. Based on the global structural representation of the user and the global structural representation of the location, the fine-grained learning operation is performed on the second target isomorphic graph, including: A gated graph convolutional network is used to model the fine-grained local interaction patterns in the second target isomorphic graph, resulting in a fine-grained local feature representation. In this representation, nodes in the second target isomorphic graph... Fine-grained local feature representation for: ; ; ; in, For nodes The output feature representation after aggregating neighbor information For nodes and nodes The gating weights between them For nodes Feature representation, For nodes Feature representation, For nodes and nodes Edge characteristics of the connecting edges between them. 、 and They are respectively , and The corresponding linear transformation matrix, Used to characterize the Sigmoid function To prevent the denominator from being divided by a constant; The nodes in the second target isomorphic graph are sorted based on their importance scores to obtain the sorted node features. The sorted node features are processed based on the Mamba model to obtain a fine-grained global feature representation, wherein the node... Fine-grained global feature representation for: ; in, This is a sequence of node features sorted by node importance score. Used to characterize the Mamba model; The fine-grained local feature representation and the fine-grained global feature representation are fused to generate the feature representation output by the current execution of the fine-grained learning operation, wherein the node output by the current execution of the fine-grained learning operation... Feature representation for: ; ; ; in, Used to characterize batch normalization processing Used to characterize the ReLU activation function and Here are the weight matrix and biases for the first feedforward network. and Here are the weight matrix and biases for the second feedforward network. For nodes The first intermediate embedding, For nodes The second intermediate embedding.
4. The location recommendation method based on multi-scale graph learning according to claim 1, characterized in that, The process of obtaining initial feature representations of users and locations based on historical interaction data from multiple users and multiple locations, and constructing user-user isomorphic graphs and location-location isomorphic graphs, includes: Based on the historical interaction data, the initial feature representation of the user and the initial feature representation of the location are obtained; Based on the initial feature representations of the users and the initial feature representations of the locations, for each user, a user-location heterogeneous graph centered on the user is constructed, and for each location, a location-user heterogeneous graph centered on the location is constructed. Feature learning is performed based on the user-location heterogeneous graph corresponding to the user to obtain the enhanced feature representation of the user; and feature learning is performed based on the location-user heterogeneous graph corresponding to the location to obtain the enhanced feature representation of the location. Based on the enhanced feature representations of the users and the enhanced feature representations of the locations, the user-user isomorphism graph and the location-location isomorphism graph are constructed respectively.
5. The location recommendation method based on multi-scale graph learning according to claim 4, characterized in that, The global structure representation based on the user and the global structure representation based on the location are iteratively executed on the user-user isomorphism graph and the location-location isomorphism graph, respectively. The next finer-grained learning operation yields the final feature representations for the user and the location, including: The global structural representation of the user is concatenated with the enhanced feature representation of the user to obtain the fused feature representation of the user; the global structural representation of the location is concatenated with the enhanced feature representation of the location to obtain the fused feature representation of the location. Based on the fusion feature representations of the users and the fusion feature representations of the locations, iterative execution is performed on the user-user isomorphism graph and the location-location isomorphism graph, respectively. The next finer-grained learning operation yields the final feature representations of the user and the location.
6. The location recommendation method based on multi-scale graph learning according to claim 4, characterized in that, The target heterogeneous graph is either the user-location heterogeneous graph or the location-user heterogeneous graph. Feature learning is performed based on the target heterogeneous graph corresponding to the target object to obtain a target-enhanced feature representation, including: A gating fusion mechanism is used to fuse the initial feature representation of the target neighbor node with the edge feature of the target edge to obtain the aggregate feature representation of the target neighbor node. The target neighbor node is the node connected to the target object in the target heterogeneous graph, and the target edge is the edge between the target neighbor node and the target object. An attention mechanism is used to aggregate the aggregated feature representations of the target neighbor nodes to obtain the target enhanced feature representation of the target object; Wherein, when the target object is a user and the target heterogeneous graph is a user-location heterogeneous graph corresponding to the user, the target augmented feature representation is the augmented feature representation of the user; when the target node is a location and the target heterogeneous graph is a location-user heterogeneous graph corresponding to the location, the target augmented feature representation is the augmented feature representation of the location.
7. The location recommendation method based on multi-scale graph learning according to claim 1, characterized in that, The edge features of the connection between the first user and the second user in the user-user isomorphic graph include at least one of the number of common interactions between the users and the rating similarity between the users. The number of common interactions between the users is determined based on the total number of interactions between the first user and the second user with a common location. The common location is a location that has been visited by both the first user and the second user. The rating similarity between the users is determined based on the similarity of the ratings between the first user and the second user for the common location. The first user and the second user are any two connected users in the user-user isomorphic graph, and / or. The edge features of the connection between the first location and the second location in the location-location isomorphism graph include at least one of the following: the number of common interactions between the locations, the rating similarity between the locations, and the geographical relevance. The number of common interactions between the locations is determined based on the total number of interactions between the first location and the second location and a common user. The common user is a user who has visited both the first location and the second location. The rating similarity between the locations is determined based on the similarity of the ratings given by the common user to the first location and the second location. The first location and the second location are any two connected locations in the location-location isomorphism graph.
8. A location recommendation device based on multi-scale graph learning, characterized in that, include: The construction module is used to obtain the initial feature representation of the user and the initial feature representation of the location based on the historical interaction data of multiple users and multiple locations, and to construct the user-user isomorphic graph and the location-location isomorphic graph, wherein the location is used to represent the location that can be displayed on the map and is accessible to the user; The coarse-grained learning module is used to combine spectral analysis and random walk diffusion to learn the overall structural information of the user-user isomorphism graph and the location-location isomorphism graph, respectively, to obtain the global structural representation of the user and the global structural representation of the location; The fine-grained learning module is used to iteratively perform operations on the user-user isomorphism graph and the location-location isomorphism graph, respectively, based on the global structural representation of the user and the global structural representation of the location. The next fine-grained learning operation yields the final feature representations of the user and the location. This fine-grained learning operation uses parallel execution of local message passing and global dependency modeling to obtain fine-grained local and global feature representations. The feature representation output by this current fine-grained learning operation is obtained by fusing these two representations. The feature representation output by the second-fine-grained learning operation is the final feature representation. It is a positive integer; The first determining module is used to determine a predicted score between the user and the location based on the user's final feature representation and the location's final feature representation; The second determining module is used to determine the location to recommend to the user based on the predicted score.
9. An electronic device, comprising: A memory, a processor, and a program stored in the memory and executable on the processor; characterized in that the processor is configured to read the program from the memory to implement the steps of the location recommendation method based on multi-scale graph learning as claimed in any one of claims 1 to 7.
10. A readable storage medium for storing a program, characterized in that, When the program is executed by the processor, it implements the steps in the location recommendation method based on multi-scale graph learning as described in any one of claims 1 to 7.
