Long-tail commodity recommendation method based on dynamic graph neural network
By adopting a long-tail product recommendation method based on dynamic graph neural networks, this paper addresses the technical challenges of dynamic changes in user interests and long-tail product recommendation in existing systems. It achieves continuous-time modeling of user interests and dynamic response of recommendation results, thereby improving the adaptability and accuracy of the recommendation system.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- CHONGQING UNIV OF POSTS & TELECOMM
- Filing Date
- 2026-01-23
- Publication Date
- 2026-04-24
Smart Images

Figure CN121921091A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the interdisciplinary field of artificial intelligence and data mining, and relates to a long-tail product recommendation method based on dynamic graph neural networks. Background Technology
[0002] With the explosive growth of internet information, recommendation systems have become a key technology for alleviating information overload and improving user experience. However, existing recommendation systems still face many technical challenges when dealing with dynamically evolving user interests and long-tail product recommendation scenarios.
[0003] Traditional recommendation methods primarily rely on static user-item interaction data for modeling. These methods often assume that user interests and item popularity remain stable, neglecting the dynamic evolution of user interests and the spatiotemporal dependence of item popularity in real-world scenarios. For example, while collaborative filtering methods can uncover potential associations between users and items to some extent, they are essentially static mining of historical interaction patterns and struggle to adapt to rapidly changing user interests. Similarly, while matrix factorization-based methods can learn latent feature representations of users and items, they lack the ability to effectively model temporal dynamics.
[0004] These problems are particularly pronounced in long-tail recommendation scenarios. Because cold-start products lack sufficient historical interaction data, their interaction patterns with users' short-term interests are often difficult for static models to capture effectively. This results in recommendation results lagging significantly behind users' actual needs and failing to respond promptly to dynamic market changes. Especially in scenarios with high timeliness requirements, such as e-commerce and content distribution, this lag significantly impacts user experience and platform efficiency.
[0005] Furthermore, existing methods, when modeling user-product interactions, typically rely solely on local neighbor information or limited historical interaction data, lacking the ability to jointly model higher-order topological structures and time decay effects in the interaction graph. While graph neural network-based recommendation methods can capture higher-order connectivity, most remain based on static graph assumptions, failing to fully consider the characteristics of interaction relationships evolving over time. This modeling limitation directly restricts the model's ability to dynamically allocate exposure opportunities for long-tail products, causing recommendation results to often favor popular items, further exacerbating the "Matthew effect."
[0006] Another issue of concern is that existing methods for modeling the evolution of user interests often employ discrete-time slices, which struggle to accurately capture the continuous changes in interest. While recurrent neural network-based methods can handle sequential data to some extent, they are essentially still sampling at discrete time points and cannot achieve true continuous-time modeling. This discretization leads to the loss of crucial fine-grained temporal information, impacting the accuracy of predicting short-term shifts in user interests.
[0007] In recent years, although some studies have attempted to incorporate temporal information to improve recommendation performance, most of these methods focus on capturing short-term interests and lack modeling of long-term interest evolution trends. Furthermore, existing methods often require complex post-processing strategies to balance recommendations of popular and long-tail products, which not only increases system complexity but may also compromise the consistency of recommendation results.
[0008] Therefore, there is an urgent need for a comprehensive solution that can simultaneously address dynamic interest modeling, long-tail product recommendation, and time-series effect capture, in order to improve the adaptability and recommendation quality of recommendation systems in real dynamic environments. Summary of the Invention
[0009] To address the aforementioned technical problems, this invention employs a long-tail product recommendation method based on a dynamic graph neural network, comprising: acquiring a user product interaction sequence, inputting the user product interaction sequence into a trained long-tail product recommendation model, and obtaining a recommendation result; the long-tail product recommendation model includes: a graph optimization module, a continuous-time modeling module, and a recommendation score calculation module;
[0010] The training process for a long-tail product recommendation model includes:
[0011] S1. Obtain the user's product interaction sequence and construct a spatiotemporal dynamic graph based on the user's product interaction sequence;
[0012] S2. Divide the long-tail product set according to the user's product interaction sequence; input the spatiotemporal dynamic graph and the long-tail product set into the graph optimization module to obtain the enhanced embedded representation of the user and the product;
[0013] S3. Input the enhanced embedded representations of users and products into the continuous-time modeling module to obtain a representation of the continuous changes in user interests;
[0014] S4. Input the user's continuous interest changes into the recommendation score calculation module to obtain the recommendation score;
[0015] S5. Calculate the loss function value based on the recommendation score, update the parameters of the long-tail product recommendation model based on the loss function value, and obtain the trained long-tail product recommendation model when the loss function value is minimized.
[0016] Beneficial effects:
[0017] 1. This invention constructs a spatiotemporal dynamic graph with time decay weights, using an exponential decay function to weight historical behaviors, thereby strengthening the impact of recent interactions on user interest representation and improving the accuracy of product recommendations; 2. This invention introduces a dynamic restart random walk strategy in the graph propagation stage, explicitly intervening in the information propagation path by restarting to the long-tail product node set with a set probability, improving the structural visibility and sampling probability of long-tail product nodes, and overcoming the degree bias and "rich get richer" phenomenon in traditional graph models; 3. To achieve continuous time modeling of user interests, this invention represents the change process of users' potential interest states as a learnable continuous differential function, capturing the drift and evolution of interest by integrating the interaction event time, thereby achieving dynamic updates of user preferences and short-term trend prediction. Attached Figure Description
[0018] Figure 1 This is a flowchart illustrating a long-tail product recommendation method based on a dynamic graph neural network, as provided in an embodiment of the present invention. Detailed Implementation
[0019] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0020] like Figure 1 As shown, this embodiment of the invention employs a long-tail product recommendation method based on a dynamic graph neural network, comprising: acquiring a user product interaction sequence, inputting the user product interaction sequence into a trained long-tail product recommendation model, and obtaining a recommendation result; the long-tail product recommendation model includes: a graph optimization module, a continuous-time modeling module, and a recommendation score calculation module;
[0021] The training process for a long-tail product recommendation model includes:
[0022] S1. Obtain the user's product interaction sequence and construct a spatiotemporal dynamic graph based on the user's product interaction sequence;
[0023] Construct a spatiotemporal dynamic graph based on the user's product interaction sequence. ;in, Let U be the spatiotemporal dynamic graph of time t, where U is the user set and I is the product set. Let be the set of edges. Let the edge between user u and product i at time t represent the interaction between user u and product i at time t. The edge has a temporal weight. , The time decay coefficient, The last timestamp in the user's product interaction sequence. The time span of the user's product interaction sequence, where t is the time when the interaction occurs.
[0024] Characteristics of each user in the user set Includes: one-hot encoded features of user ID, historical behavior statistics of user before time t: number of interactions with products, average rating, activity level, and user interest initialization vector (can be random).
[0025] Features of each product in the product collection This includes: one-hot encoding features of product ID, product category, tags, attribute features, product popularity (frequency of product interaction with users before time t), and listing time or time encoding;
[0026] Time decay coefficient ;in, Based on the attenuation coefficient, To adjust the parameters, This refers to the interaction frequency of user u in the user product interaction sequence.
[0027] Preferably, for news scenarios: 0.3–0.5, and for e-commerce scenarios (where the long tail is more pronounced): 0.05–0.2.
[0028] S2. Divide the long-tail product set according to the user's product interaction sequence; input the spatiotemporal dynamic graph and the long-tail product set into the graph optimization module to obtain the enhanced embedded representation of the user and the product;
[0029] The long-tail product set is divided according to the user's product interaction sequence, including:
[0030] in, A collection of long-tail products. Let i be the total number of interactions with product i in the user's product interaction sequence. The preset frequency threshold, θ can be tuned using a validation set, with typical values ranging from 3 to 10.
[0031] The graph optimization module includes a graph neural network. The graph optimization module processes spatiotemporal dynamic graphs and long-tail product sets, including:
[0032] Based on the spatiotemporal dynamics diagram at each time t Construct a local spatiotemporal dynamic graph for each long-tail product in the long-tail product set at each time t; perform a dynamic restart random walk on the local spatiotemporal dynamic graph of each long-tail product at each time t to obtain an augmented subgraph for each long-tail product at each time t; input the augmented subgraphs of each long-tail product at each time t into a graph neural network to obtain an augmented embedding representation of each long-tail product at each time t; input the spatiotemporal dynamic graph at each time t into a graph neural network to obtain an augmented embedding representation of the user and the remaining products at each time t.
[0033] Constructing a local spatiotemporal dynamic graph of long-tail products at time t includes: extracting users who interact with long-tail products from the spatiotemporal dynamic graph at time t, further expanding to obtain other products that interact with the extracted users, and assigning corresponding temporal weights to each interaction edge to form a local spatiotemporal dynamic graph for subsequent feature modeling and predictive analysis.
[0034] The process of performing a dynamic restart random walk on the local spatiotemporal dynamic graph of long-tail products at time t to obtain an enhanced subgraph of long-tail products at time t includes: performing multiple random samplings on the local spatiotemporal dynamic graph of long-tail products using a dynamic restart random walk strategy to obtain the access frequency of each node and the path weight of each path in the local spatiotemporal dynamic graph of time t; filtering the local spatiotemporal dynamic graph of time t based on the node access frequency and path weight, retaining nodes and paths with strong correlation to the long-tail products, and constructing an enhanced subgraph of long-tail products at time t based on the filtered nodes and paths.
[0035] Dynamically restarted random walks are an existing technology; this invention only improves the formula for calculating the transition probability. The dynamically restarted random walk strategy includes forcibly restarting to the long-tailed item set with probability r during the walk. For each long-tail item, the transition probability of a dynamically restarted random walk on its local spatiotemporal dynamic graph at time t is:
[0036]
[0037]
[0038] in, From node in the local spatiotemporal dynamic graph at time t To the node The transition probability is given by r, where r is the restart probability. Based on the restart probability, For adjustment coefficients, Let I be the long-tail product set, and I be the product set. For nodes in the local spatiotemporal dynamic graph at time t The time series weights at time t, For nodes in the local spatiotemporal dynamic graph at time t The time series weights at time t, For nodes in the local spatiotemporal dynamic graph at time t The neighbor set at time t.
[0039] Preferably, The value is 0.1–0.3, and 0.2–0.4 is more suitable for long-tail products.
[0040] In one embodiment, the probability r corresponding to user u is adjusted according to the sparsity of user u's interests: ;in, This is the sparsity adjustment coefficient. This represents the number of products that user u has interacted with by the deadline t.
[0041] S3. Input the enhanced embedded representations of users and products into the continuous-time modeling module to obtain a representation of the continuous changes in user interests;
[0042] The continuous-time modeling module includes a state derivative network (multilayer perceptron); specifically, the continuous-time modeling module processes the enhanced embedded representations of users and items, including:
[0043] Compute the augmented embedding representation of each user u at each time t First differential :
[0044]
[0045]
[0046]
[0047] in, It is a learnable multilayer perceptron. For the enhanced embedding representation of user u at time t, Let be the weighting coefficient between user u and product i at time t. Let u be the set of its neighbors at time t. For the enhanced embedding representation of item i at time t; Let be the transformation matrix of the multilayer perceptron. This is the bias for the multilayer perceptron. For activation function, For splicing operations; For learnable attention vectors, Let be the learnable transformation matrix corresponding to user u and item i. Let u be the set of its neighbors at time t. For activation function, For the enhanced embedding representation of user u at time t, , These are the enhanced embedding representations of items i and j at time t, respectively.
[0048] Enhanced embedding representation of each user u at each time t First differential Numerical integration is performed to predict interest at any future time point, resulting in a continuous representation of the interest changes of each user u at each time t. .
[0049] First-order differential The integration interval is ;in, Let t be the current time. This represents the time of user u's most recent interaction with the product before time t.
[0050] S4. Input the user's continuous interest changes into the recommendation score calculation module to obtain the recommendation score;
[0051] The recommendation score calculation module processes the continuous changes in user interests, including:
[0052] in, Let be the recommendation score of user u for product i at time t, and M be a learnable similarity matrix. Let user u's interest change continuously over time t. Let be the learnable biases corresponding to user u and product i, respectively. This is an enhanced embedding representation of item i at time t.
[0053] S5. Calculate the loss function value based on the recommendation score, update the parameters of the long-tail product recommendation model based on the loss function value, and obtain the trained long-tail product recommendation model when the loss function value is minimized.
[0054] An end-to-end optimization approach is adopted, jointly learning the model parameters by minimizing the weighted Bayesian personalized ranking loss function. Loss function L:
[0055]
[0056]
[0057]
[0058] in, This is a positive sample (i.e., user u interacts with product i at time t). This is a negative sample (i.e., user u did not interact with product j at time t). Let u be the recommendation scores for products i and j at time t. Let i be the weighting coefficient for product i. This represents the weighting enhancement factor for long-tail products. A collection of long-tail products. This is the parameter set for the long-tail product recommendation model. The L2 regularization coefficient is... This is the activation function.
[0059] In one embodiment, when a new interaction event When this occurs, an incremental update strategy can be used:
[0060]
[0061]
[0062]
[0063]
[0064] Where η is the online learning rate, enabling real-time recommendation capabilities. For increments, An enhanced embedded representation of the user and product prior to the new interaction time. , Enhanced embedded representation for updated users and products.
[0065] The above-described embodiments further illustrate the purpose, technical solution, and advantages of the present invention. It should be understood that the above-described embodiments are merely preferred embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made to the present invention within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A method for recommending long-tail products based on dynamic graph neural networks, characterized in that, include: Obtain the user's product interaction sequence, input the user's product interaction sequence into the trained long-tail product recommendation model, and obtain the recommendation results; The long-tail product recommendation model includes: a graph optimization module, a continuous-time modeling module, and a recommendation score calculation module; The training process for a long-tail product recommendation model includes: S1. Obtain the user's product interaction sequence and construct a spatiotemporal dynamic graph based on the user's product interaction sequence; S2. Divide the long-tail product set according to the user's product interaction sequence; input the spatiotemporal dynamic graph and the long-tail product set into the graph optimization module to obtain the enhanced embedded representation of the user and the product; S3. Input the enhanced embedded representations of users and products into the continuous-time modeling module to obtain a representation of the continuous changes in user interests; S4. Input the user's continuous interest changes into the recommendation score calculation module to obtain the recommendation score; S5. Calculate the loss function value based on the recommendation score, update the parameters of the long-tail product recommendation model based on the loss function value, and obtain the trained long-tail product recommendation model when the loss function value is minimized.
2. The method for recommending long-tail products based on dynamic graph neural networks according to claim 1, characterized in that, Constructing a spatiotemporal dynamic graph ;in, Let U be the spatiotemporal dynamic graph of time t, where U is the user set and I is the product set. Let be the set of edges. Let the edge between user u and product i at time t represent the interaction between user u and product i at time t. The edge has a temporal weight. , The time decay coefficient, The last timestamp in the user's product interaction sequence. The time span of the user's product interaction sequence, where t is the time when the interaction occurs.
3. The method for recommending long-tail products based on dynamic graph neural networks according to claim 2, characterized in that, Time decay coefficient ;in, Based on the attenuation coefficient, To adjust the parameters, This refers to the interaction frequency of user u in the user product interaction sequence.
4. The method for recommending long-tail products based on a dynamic graph neural network according to claim 2, characterized in that, The graph optimization module includes a graph neural network; The graph optimization module processes spatiotemporal dynamic graphs and long-tail product sets, including: Based on the spatiotemporal dynamic graph of each long-tail product in the long-tail product set at each time t, a local spatiotemporal dynamic graph of each long-tail product at each time t is constructed. A dynamic restart random walk is performed on the local spatiotemporal dynamic graph of each long-tail product at each time t to obtain an augmented subgraph of each long-tail product at each time t. The augmented subgraphs of each long-tail product at each time t are then input into a graph neural network to obtain an augmented embedding representation of each long-tail product at each time t. Finally, the spatiotemporal dynamic graph of each time t is input into a graph neural network to obtain augmented embedding representations of the user and the remaining products at each time t.
5. The method for recommending long-tail products based on a dynamic graph neural network according to claim 4, characterized in that, For each long-tail item, the transition probability of performing a dynamically restarted random walk on its local spatiotemporal dynamic graph at time t is: ; ; in, From node in the local spatiotemporal dynamic graph at time t To the node The transition probability is given by r, where r is the restart probability. Based on the restart probability, For adjustment coefficients, Let I be the long-tail product set, and I be the product set. For nodes in the local spatiotemporal dynamic graph at time t The time series weights at time t, For nodes in the local spatiotemporal dynamic graph at time t The time series weights at time t, For nodes in the local spatiotemporal dynamic graph at time t The neighbor set at time t.
6. The method for recommending long-tail products based on a dynamic graph neural network according to claim 2, characterized in that, The continuous-time modeling module includes a multilayer perceptron; the continuous-time modeling module processes the enhanced embedded representations of users and items, including: Compute the augmented embedding representation of each user u at each time t First differential : ; in, It is a learnable multilayer perceptron. For the enhanced embedding representation of user u at time t, Let be the weighting coefficient between user u and product i at time t. Let u be the set of its neighbors at time t. For the enhanced embedding representation of item i at time t; Enhanced embedding representation of each user u at each time t First differential Integrating, we obtain a representation of the continuous change in interest for each user u at each time t. .
7. The method for recommending long-tail products based on a dynamic graph neural network according to claim 6, characterized in that, The weighting coefficients for user u and product i at time t are: ; in, For learnable attention vectors, Let be the learnable transformation matrix corresponding to user u and item i. This indicates a splicing operation. Let u be the set of its neighbors at time t. For activation function, For the enhanced embedding representation of user u at time t, , This is an enhanced embedding representation for items i and j.
8. The method for recommending long-tail products based on a dynamic graph neural network according to claim 1, characterized in that, The long-tail product set is divided according to the user's product interaction sequence, including: ; in, A collection of long-tail products. This represents the total number of historical interactions with product i in the user's product interaction sequence. I represents the preset frequency threshold and the product set.
9. The method for recommending long-tail products based on a dynamic graph neural network according to claim 1, characterized in that, The recommendation score calculation module processes the continuous changes in user interests, including: ; in, Let be the recommendation score of user u for product i at time t, and M be a learnable similarity matrix. Let user u's interest change continuously over time t. These are the bias terms for user u and product i, respectively. This is an enhanced embedding representation of item i at time t.
10. The method for recommending long-tail products based on a dynamic graph neural network according to claim 1, characterized in that, Loss function L: ; ; ; in, A positive sample means that user u interacts with product i at time t. This is a negative sample, meaning that user u did not interact with product j at time t. Let u be the recommendation scores for products i and j at time t. Let i be the weighting coefficient for product i. This represents the weighting enhancement factor for long-tail products. A collection of long-tail products. This is the parameter set for the long-tail product recommendation model. For coefficients, For activation function, The last timestamp in the user's product interaction sequence. Let U be the time span of the user-product interaction sequence, where U is the user set and I is the product set.