Sequence recommendation method and device and medium

By building a Top-k global item map and using graph convolution network, long-term and short-term interest information in user interaction sequences is extracted, and the problem of insufficient accuracy and real-time accuracy of sequence recommendation systems in the prior art is solved, and more accurate and personalized recommendation effects are achieved.

CN120070872AActive Publication Date: 2025-05-30ZHEJIANG NORMAL UNIV +1
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202510533837.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-27
Publication Date
2025-05-30
Estimated Expiration
2045-04-27

AI Technical Summary

Technical Problem

The existing sequence recommendation system has not fully tapped the potential of graph neural networks in processing user behavior sequences and extracting sequences, resulting in insufficient accuracy and real-time recommendations.

Method used

By constructing the Top-k global item map, using graph convolutional networks and convolutional neural networks, dynamic graphs are generated based on user interaction sequences, long-term interest information and short-term interest information are extracted, and personalized item sequence recommendations are provided.

Benefits of technology

It improves the accuracy and real-timeness of sequence recommendations, enhances the timeliness and relevance of user interests, improves the ability to capture long-term and short-term interests, and improves the personalized service capabilities and timeliness recommendations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120070872A_ABST
    Figure CN120070872A_ABST
Patent Text Reader

Abstract

The invention discloses a sequence recommendation method and device and a medium, and relates to the field of electronic digital data processing, and the method comprises the steps: constructing a Top-k global item graph based on the correlation between items in a user interaction sequence; generating a dynamic graph based on the user interaction sequence; adopting a graph convolutional network and a convolutional neural network to obtain long-term interest information and short-term interest information based on the dynamic graph; based on the Top-k global article graph, extracting article features related to articles currently interested by the user; and obtaining article sequence recommendation information based on article characteristics related to the current interested article of the user, the long-term interest information and the short-term interest information. According to the invention, the accuracy and real-time performance of sequence recommendation can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of electronic digital data processing, and particularly to a sequence recommendation method, device, and medium. Background Art

[0002] With the rapid development of Internet, Internet of Things, and mobile information technologies, the progress of information technology and the Internet has not only accelerated information dissemination but also brought about information explosion, entering an era of information overload. Although the vast amount of information provides users with more choices, it also makes it extremely difficult for users to quickly find the content they need among numerous information. Against this background, recommendation systems have emerged as an important tool to solve the problem of information overload. By combining users' personal characteristics (such as geographical location, gender, age, etc.), item feature information (such as category, time, origin, etc.), and historical interaction data (such as clicks, favorites, etc.), recommendation systems accurately model users' preferences to achieve personalized recommendations. By filtering out irrelevant information, recommendation systems can improve user satisfaction and platform retention rate, help information seekers quickly find the content they need, and achieve a win-win situation for information providers and users.

[0003] A sequence recommendation system is a recommendation technology that predicts users' next interests based on users' historical interaction behaviors (such as browsing, clicking, favoriting, purchasing, etc.), and is particularly suitable for scenarios such as e-commerce, video platforms, and online education. Different from traditional recommendation methods, sequence recommendation systems can not only mine users' long-term preferences but also capture the dynamic changes of short-term interests. For example, on an e-commerce platform, if a user frequently browses items of a certain category within a short period of time, the sequence recommendation system can identify and timely recommend items of that category.

[0004] Different from traditional static recommendation systems, sequential recommendation systems learn dynamic feature embeddings by leveraging users' interaction sequences, enabling more accurate predictions. Initially, sequential recommendation identified changes in users' interests by capturing patterns in the user behavior sequences. With the advancement of deep learning, methods based on recurrent neural networks (RNNs) became popular, effectively capturing users' dynamic interests by modeling the temporal dependencies in the sequences. With the introduction of self-attention mechanisms and Transformer models, sequential recommendation systems began to better capture the complex dependencies between items in the sequence, further improving the accuracy of recommendations. In recent years, graph neural networks (GNNs) have been introduced into the sequential recommendation task, allowing models to more effectively utilize the complex relationships and higher-order connectivity between users and items. The historical interaction behaviors of users can be constructed as a user-item bipartite graph. GNNs have significant advantages in capturing relationships between nodes and representing graph data. By introducing GNNs, the higher-order connectivity in the user-item bipartite graph can be better utilized to generate more accurate user and item embedding representations. Sequential recommendation systems based on graph neural networks can improve the accuracy and quality of recommendations by learning about items, users, and the relationships between them, thus providing more personalized recommendations for users.

[0005] In recent years, significant progress has been made in sequential recommendation techniques based on graph neural networks. However, overall, the research on combining graph neural networks with sequential recommendation tasks is still in the exploratory stage, and the potential of graph neural networks in processing user behavior sequences and extracting collaborative information between sequences has not been fully exploited. Summary of the Invention

[0006] The objective of this application is to provide a sequential recommendation method, device, and medium that can improve the accuracy and real-time performance of sequential recommendations.

[0007] To achieve the above objective, this application provides the following solutions: In a first aspect, this application provides a sequential recommendation method, including: Constructing a Top-k global item graph based on the relevance between items in the user interaction sequence; the user interaction sequence is a sequence formed by the interaction information between users and items; Generating a dynamic graph based on the user interaction sequence; Using a graph convolutional network and a convolutional neural network, obtaining long-term interest information and short-term interest information based on the dynamic graph; the long-term interest information refers to the stable and continuous interests or preferences of users within a first set time, as well as the effective characteristics of the items themselves; the short-term interest information is the real-time impact on their own characteristics caused by users and items being affected by the current environment, situation, or behavior within a second set time; the first set time is greater than the second set time; Extract item features related to the item currently of interest to the user based on the Top-k global item graph; Obtain item sequence recommendation information based on the item features related to the item currently of interest to the user, the long-term interest information, and the short-term interest information.

[0008] Optionally, constructing a Top-k global item graph based on the relevance between items in the user interaction sequence includes: Construct an initial global item graph based on the user interaction sequence, and construct a global item graph based on the initial global item graph using the shortest path algorithm; Retain the first edges with the greatest relevance for each item in the global item graph to obtain the Top-k global item graph.

[0009] Optionally, in the process of constructing an initial global item graph based on the user interaction sequence and constructing a global item graph based on the initial global item graph using the shortest path algorithm, use the number of times the end node of each directed edge is clicked after the start node as the weight of the directed edge; Introduce a filtering mechanism to filter out directed edges with weights lower than the set threshold parameter to obtain the directed weighted graph.

[0010] Optionally, constructing an initial global item graph based on the user interaction sequence and constructing a global item graph based on the initial global item graph using the shortest path algorithm includes: In the user interaction sequence, use the number of times an item is clicked after another item as the weight of the edge between this item and the other item; When an item is adjacent to another item in the user interaction sequence, increase the weight of the edge between this item and the other item by 1 to generate the initial global item graph; Determine the cost value of the edge based on the weight of the edge between an item and another item in the initial global item graph; Use the shortest path algorithm to determine the minimum cost from each item to other items based on the cost value to generate a shortest path graph; In the shortest path graph, determine the weight of the edge between an item and another item based on the minimum cost from the item to the other item, and combine the weight of the edge between this item and the other item with the maximum weight of the edges in the shortest path graph to obtain the relevance between this item and the other item until the relevance between all items and other items in the shortest path graph is obtained to generate the global item graph.

[0011] Optionally, generating a dynamic graph based on the user interaction sequence includes: In the user interaction sequence, use the click relationship between the user and the item as the edge between the user and the item, and obtain the time point when the user clicks on the item; Use the time point as the attribute interaction timestamp of the edge between the user and the item, and generate a user-item bipartite graph; Dynamically sample from the user-item bipartite graph to establish a user dynamic subgraph and a dynamic item subgraph centered on the user and the item; Generate the dynamic graph based on the user dynamic subgraph and the dynamic item subgraph.

[0012] Optionally, use a graph convolutional network and a convolutional neural network to obtain long-term interest information and short-term interest information based on the dynamic graph, including: Use the graph convolutional network to obtain user long-term interest information based on the user dynamic subgraph; Use the graph convolutional network to obtain item long-term interest information based on the dynamic item subgraph; Obtain the long-term interest information based on the user long-term interest information and the item long-term interest information; The interaction information between the user and the item within a set time with the current time as the end time point, and input the user dynamic subgraph corresponding to this interaction information into the convolutional neural network to obtain the short-term interest information.

[0013] Optionally, extract item features related to the item currently of interest to the user based on the Top-k global item graph, including: Apply graph convolutional network operations to extract the relevant features of the nodes connected to an item in the Top-k global item graph; Obtain the item features related to the item currently of interest to the user based on the relevant features.

[0014] Optionally, obtain item sequence recommendation information based on the item features related to the item currently of interest to the user, the long-term interest information, and the short-term interest information, including: Generate the embedding of the user at the current time and the embedding of the item at the current time based on the item features related to the item currently of interest to the user, the long-term interest information, and the short-term interest information; Determine the user preference score of the candidate item for the next time based on the embedding of the user at the current time and the embedding of the item at the current time; Retain the candidate item information with the user preference score exceeding the set score threshold to generate the item sequence recommendation information.

[0015] In a second aspect, the present application provides a computer device, including: a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the sequence recommendation method provided above.

[0016] In a third aspect, the present application provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the sequence recommendation method provided above are implemented.

[0017] According to the specific embodiments provided by the present application, the present application has the following technical effects: The present application provides a sequence recommendation method, device, and medium. By constructing a Top-k global item graph based on the relevance between items in the user interaction sequence, personalized recommendations can be provided, improving the accuracy and real-time performance of sequence recommendations. Moreover, by using a graph convolutional network and a convolutional neural network to obtain long-term interest information and short-term interest information, the timeliness and relevance of user interests can be enhanced, thereby enhancing the expressiveness of user features and improving the recommendation accuracy. At the same time, by combining the advantages of the graph convolutional network and the convolutional neural network, the complex relationship between users and items can be better modeled, not only improving the ability to capture long-term and short-term interests, but also enhancing the response speed of sequence recommendations in rapidly changing user interaction behaviors, thereby enhancing the personalized service ability and timeliness of sequence recommendations. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings required for use in the embodiments. Obviously, the drawings in the following description are only some embodiments of the present application, and those of ordinary skill in the art can obtain other drawings without creative efforts based on these drawings.

[0019] Figure 1 It is a flowchart of a sequence recommendation method provided by an embodiment of the present application; Figure 2 It is an initial global item graph provided by an embodiment of the present application; Figure 3 It is a global item graph provided by an embodiment of the present application; Figure 4 It is a flowchart of converting a user interaction sequence into a user-item bipartite graph provided by an embodiment of the present application; Figure 5 It is a schematic diagram of dynamic subgraph sampling provided by an embodiment of the present application; Figure 6 It is a user-item bipartite graph provided by another embodiment of the present application; Figure 7Schematic diagram of the dynamic graph convolution process provided by another embodiment of the present application; Figure 8 Schematic diagram of the user short-term interest extraction process provided by an embodiment of the present application; Figure 9 Schematic diagram of the item feature extraction provided by an embodiment of the present application; Figure 10 Flowchart of the overall model implementation provided by an embodiment of the present application. Detailed implementation manners

[0020] Next, the technical solutions in the embodiments of the present application will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments of the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present application.

[0021] To make the above objects, features, and advantages of the present application more obvious and understandable, the present application will be further described in detail below in conjunction with the accompanying drawings and specific implementation manners.

[0022] In an exemplary embodiment, the present application provides a sequence recommendation method, which is executed by a computer device. Specifically, it can be executed independently by a computer device such as a terminal or a server, or jointly executed by a terminal and a server. In the embodiments of the present application, this method is described by taking the application to a server as an example. As Figure 1 shown, this method includes: Step 100: Construct a Top-k global item graph based on the relevance between items in the user interaction sequence. The user interaction sequence is a sequence formed by the interaction information between the user and the item.

[0023] Step 101: Generate a dynamic graph based on the user interaction sequence. Among them, the dynamic graph is derived from the user interaction sequence, with the current user and item as the central nodes, capturing the interaction patterns of the time series.

[0024] Step 102: Use a graph convolutional network and a convolutional neural network to obtain long-term interest information and short-term interest information based on the dynamic graph. The long-term interest information refers to the stable and continuous interests or preferences of the user within the first set time (i.e., a relatively long time), as well as the characteristics of the item that are effective for a long time. The short-term interest information is the real-time impact on the characteristics of the user and the item caused by the current environment, situation, or behavior within the second set time (i.e., recent behavior).

[0025] Step 103: Extract item features related to the item currently of interest to the user based on the Top-k global item graph. Among them, extract the item features most relevant to the current item to enrich the item representation and obtain context information from the relevant items.

[0026] Step 104: Obtain item sequence recommendation information based on the item features related to the item currently of interest to the user, long-term interest information, and short-term interest information. Among them, the long-term and short-term interest information can be integrated into a unified preference profile to predict the next item with which the user is most likely to interact.

[0027] In another exemplary embodiment of the present application, in traditional sequence recommendation methods, the relationship between items often only depends on the user's interaction history, and an item graph is constructed by establishing connection edges between adjacent items. However, this method may ignore the situation where some strongly related items are not directly connected, thus affecting the comprehensiveness of item relevance modeling. To solve this problem, the present application introduces a shortest path algorithm to quantify the global relevance between items to construct a Top-k global item graph. Specifically, using the shortest path algorithm, the shortest distance between items can be calculated, and then those item pairs that are indirectly related but may affect user preferences can be identified. To enhance the accuracy of recommendations, the embedding representations of users and items can be further optimized by introducing the top-k most relevant items, thereby effectively supplementing the missing relationships in the item graph, fully mining the collaborative information between sequences, and effectively alleviating the data sparsity problem. At the same time, by adopting the Top-k global item graph, a graph representation learning method based on global item perception, the potential relationships between items can be captured more comprehensively, improving the accuracy and robustness of sequence recommendations.

[0028] In this embodiment, the implementation process of step 100 given above in the present application can be to construct a Top-k global item graph based on the user interaction sequence to capture the relationship between items. Calculate the relevance value between items through the shortest path algorithm, and retain the top-k most relevant items for each node. Based on this, the implementation process of step 100 includes: Step 1001: Construct an initial global item graph based on the user interaction sequence, and use the shortest path algorithm to construct a global item graph based on the initial global item graph. Among them: (1) In the user interaction sequence, the number of times an item is clicked by the user after another item is used as the weight of the edge between this item and another item.

[0029] (2) When an item is adjacent to another item in the user interaction sequence, the weight of the edge between this item and another item is increased by 1 to generate an initial global item graph.

[0030] (3) In the initial global item graph, introduce a filtering mechanism to filter out the edges with weights lower than the set threshold, and then determine the cost value of the edge based on the weight of the edge between one item and another in the directed weighted graph obtained after filtering.

[0031] (4) Adopt the shortest path algorithm. Based on the cost value, determine the minimum cost from each item to other items and generate the shortest path graph.

[0032] (5) In the shortest path graph, determine the weight of the edge between one item and another based on the minimum cost from one item to another, and obtain the correlation between this item and another item by combining the weight of the edge between this item and another item with the maximum weight of the edges in the shortest path graph, until the correlations between all items and other items in the shortest path graph are obtained to generate the global item graph.

[0033] Step 1002. Retain the first edges with the greatest correlation for each item in the global item graph to obtain the Top-k global item graph.

[0034] In the actual application process, for example, in the sequence recommendation task, let and represent the sets of all users and items respectively. For each user , their interaction sequence with items is represented as = ([[]] , , , …, ), where . The corresponding interaction timestamp sequence is represented as . Let represent the set of interaction sequences of all users. The goal of sequence recommendation is to predict the next item that the user is most likely to interact with based on the user's interaction history up to time . Each user and item is represented by a low-dimensional embedding vector, , where is the dimension of the embedding space, , . The user embedding matrix is represented as , and the item embedding matrix is represented as .

[0035] The global item graph is denoted as , which is represented as a directed weighted graph. In the global item graph , the shortest path algorithm is used to determine the correlation between each item and other items. For each item , based on these calculation results, identify the top An item is taken, and the edges of these items are retained to construct a Top-k global item graph. The first embedding vectors of the most relevant items can provide rich context information to help the item learn its features more effectively.

[0036] As Figure 2 shown, given a user interaction sequence =( , , ,…, ), if item immediately follows item in the sequence (i.e., the user clicks and then immediately clicks ), then it is assumed that there is a significant correlation between them. Therefore, the weight of the edge from item to item is increased by 1. More generally, the weight of each edge in the global item graph represents the number of times item is clicked after item in all user sequences in the dataset. A higher edge weight indicates a stronger correlation between item and item .

[0037] To mitigate the impact of noise caused by accidental user clicks and avoid irrelevant edges affecting prediction accuracy, this application introduces a filtering mechanism. This mechanism uses a threshold parameter to remove low-weight edges that may represent accidental clicks rather than meaningful interactions. Edges with weights lower than the threshold are filtered out from the global item graph , thereby enhancing the reliability of the constructed graph. Among them, the weight is defined as: .

[0038] In the global item graph , edges only connect adjacent items in the user sequence, which poses a significant limitation. For example, although there may be a correlation between item and item in the user sequence, this relationship is not explicitly represented in . Instead, the correlation between item and item can only be represented through intermediate edges and is inferred indirectly. To overcome this constraint, a shortest path algorithm is introduced, which evaluates the correlation between two nodes without a direct edge by considering the cumulative edge weights on the indirect path. For example, the algorithm can determine the correlation between item and by evaluating the path formed by them to determine the correlation between item and item . The following also explains how to calculate the correlation between two non - adjacent items using the shortest path algorithm.

[0039] First, a cost value is assigned to each edge in the global item graph , which is calculated based on its weight to facilitate the calculation of the global shortest path graph. The cost value of edge is defined as : .

[0040] where represents the maximum edge weight in the global item graph . A higher edge weight indicates a stronger correlation between item and item , resulting in a lower cost value, reflecting this correlation. Using these cost values, the shortest path algorithm is applied to calculate the minimum cost required for each item to reach all other items, obtaining the shortest path graph . In the shortest path graph , a lower path cost from item to item indicates a stronger inferred correlation between items. To simplify subsequent calculations, the weights of the edges in the shortest path graph are processed as follows: .

[0041] .

[0042] where represents the maximum edge weight in the shortest path graph . represents the weight of the edge between item and item in the shortest path graph. represents the correlation between item and item .

[0043] By performing logarithmic transformation and inversion calculation on the edge weights, the correlation between two items can be effectively captured. Then, each item can focus on a limited number of highly relevant items. Items with smaller values are considered weakly correlated. Therefore, edge pruning is performed on the shortest path graph , and only the top strongest-correlated edges of each item are retained. This process ultimately constructs the Top-k global item graph. Among them, corresponding to the Figure 2 shown initial global item graph, the global item graph as shown in Figure 3 can be obtained.

[0044] In another exemplary embodiment of the present application, in order to improve the accuracy and real-time performance of sequence recommendation, the dynamic graph in step 101 can be obtained by constructing a dynamic subgraph based on the user-item bipartite graph to capture the dynamic changes in the user behavior sequence. Based on this, in this embodiment, the implementation process of step 101 includes: Step 1011: Regarding the click relationship between the user and the item in the user interaction sequence as the edge between the user and the item, and obtaining the time point when the user clicks on the item.

[0045] Step 1012: Using the time point as the attribute interaction timestamp of the edge between the user and the item, and generating a user-item bipartite graph.

[0046] Step 1013: Dynamically sample from the user-item bipartite graph to establish a user dynamic subgraph and a dynamic item subgraph centered on the user and the item.

[0047] Step 1014: Generating a dynamic graph based on the user dynamic subgraph and the dynamic item subgraph.

[0048] Through the above process, all user interaction sequences can be converted into a user-item bipartite graph , and a user dynamic subgraph and a dynamic item subgraph centered on the user and the item are sampled around any given user-item interaction. Among them, the user dynamic subgraph sampled with the user as the core node at time is denoted as , and the dynamic item subgraph is denoted as .

[0049] When the user clicks on the item at time , an edge will be established between the item and the user , and then a user-item bipartite graph as shown in Figure 4 is formed. Among them, taking the time As an edge of the attribute interaction timestamp.

[0050] The user-item bipartite graph effectively integrates the interaction sequences of different users. To better capture the temporal evolution of user and item embeddings, reduce computational overhead, and mitigate noise from other user sequences, a dynamic subgraph centered on users and items is sampled from the user-item bipartite graph. Suppose we want to predict the click of user at time . Then, a user dynamic subgraph rooted at user is constructed. The items most recently visited by user are considered first-order neighbors, where is a hyperparameter that determines the number of neighbor nodes in the current layer. Then, these items are used as root nodes for a new round of sampling. Each item on edge has a timestamp . The users who visited item earliest before timestamp

[0051] are added as second-order neighbors to the user dynamic subgraph. For example, suppose user , , , , ) visited items( , , , , ) at timestamps( . To predict the items that the user will visit at , a user dynamic subgraph and need to be set. First, consider user as the root node and determine the items( ) most recently visited at time , , , , ). Since , items , , , are added as first-order neighbors to the dynamic subgraph. Next, using these items ,​​​​ , , ) As the root node for a new round of sampling. For example, consider item , the user who recently visited it is , and the timestamps are ([[]] , , , , ). Determine the users who visited item before the timestamp . These users exactly match . Therefore, add these four users as second-order neighbors to the user dynamic subgraph . This method ensures capturing the features of node at the moment because the features evolve over time. Set the hyperparameter to control the number of layers of the dynamic subgraph. If third-layer nodes are needed, use the nodes in the second layer as new root nodes for sampling and continue with deep-level sampling. Usually, the default setting is .

[0052] Further, to improve the learning of item features and enhance the prediction accuracy, a dynamic item subgraph is also constructed for the items of user interest . The process of constructing the dynamic item subgraph is similar to that of constructing the user dynamic subgraph . Starting from item , when it is visited at time , determine its first-order neighbors, and then use these neighbors as new root nodes for further sampling. For the dynamic item subgraph , the settings of the hyperparameters and are kept consistent with those of the user dynamic subgraph . Among them, the process of dynamic subgraph sampling is as shown in Figure 5 . Figure 5 is obtained by sampling centered on user Figure 4 and item at time on the user-item bipartite graph shown in . Figure 5 The light blue area in is the item dynamic subgraph , and the light orange area is the user dynamic subgraph

[0053] With the advancement of graph neural network technology, more and more sequential recommendation models adopt graph convolution to model the complex relationships between users and items. However, the stacking of multiple graph convolution layers often leads to over-smoothing of information, weakening the discriminability between node features and limiting the ability to capture long-range semantic relationships. Therefore, most existing methods limit graph convolution to two layers, which restricts the scale of the dynamic graph and hinders the ability to capture long-range semantic relationships between distantly related items. In addition, there are no direct connections between many semantically related items in the user-item bipartite graph directly used by these models, and there is a limit on the number of graph convolution layers in the sequential recommendation algorithm based on graph neural networks, making it unable to effectively capture long-range semantic relationships, so information cannot be transmitted between many distantly related items.

[0054] Figure 6 shows the two-hop neighborhood dynamic graph around the item , which only represents a small part of the user-item interaction network. Figure 6 The nodes of type i in (i.e., ) represent item nodes item, and nodes of type i with different numbers represent different items. Similarly, nodes of type u (i.e., ) represent user nodes user. The on the edge represents time. For example, the edge between has the attribute of , representing that user accessed item at time. Different represent different timestamps. Figure 6 The area marked by the light green box in represents the dynamic item subgraph centered on item . Although the maximum shortest path length (or diameter) of the dynamic graph is limited to four, the datasets in practical applications usually have diameters far exceeding this value, possibly covering dozens or even hundreds of nodes. This limited range means that node information from outside the local graph is often ignored, which may have a negative impact on the accuracy of node embeddings. Taking the user node located outside the dynamic graph as an example, whose purchase history is mainly composed of luxury goods. The embedding of user node may significantly affect the representations of item , item , and thus affect the user node and item node Recommendations. These limitations highlight the need for a dynamic graph that makes more full use of cross-sequence collaboration information to capture more comprehensive user interaction sequence (the sequence formed by the interaction behavior between users and items) information. To address these issues, this application proposes a Top-k global item graph. Through the shortest path algorithm, an edge can be established between long-distance related items, enabling more full utilization of cross-sequence collaboration information.

[0055] As user behavior becomes more diverse and interests change dynamically, the user interests extracted from the complete interaction sequence often cannot fully reflect the user's short-term interests. In contrast, considering the items recently purchased by the user can provide more information about the user's current preferences, which can better capture the user's interest fluctuations and purchase trends. For example, on an e-commerce platform, if a user frequently purchases items of a certain category in a short period of time, it may indicate that the user's interest in that category of items is increasing. However, analyzing only the item purchased most recently when analyzing the user's short-term interests often cannot accurately reflect the user's immediate interests. By analyzing the items purchased multiple times, these short-term interests can be captured more precisely, thus providing more personalized and timely recommendations. This method has been proven to be superior to recommendation systems that rely only on single purchase records and can effectively improve the recommendation accuracy and user experience.

[0056] To address the above problems, in this embodiment, step 102 can use a graph convolutional network to extract long-term interests from the dynamic subgraph centered on users and items, providing insights into the user's long-term preferences and item associations. A convolutional neural network is used to capture the short-term user interests from the most recent m interactions, supplement the long-term preferences, and provide immediate behavior clues. Based on this, the implementation process of step 102 can include: Step 1021: Use a graph convolutional network to obtain user long-term interest information based on the user dynamic subgraph.

[0057] Step 1022: Use a graph convolutional network to obtain item long-term interest information based on the dynamic item subgraph.

[0058] Step 1023: Obtain long-term interest information based on the user long-term interest information and the item long-term interest information.

[0059] Step 1024: The interaction information between the user and the item within the set time with the current time as the termination time point, and input the user dynamic subgraph corresponding to this interaction information into the convolutional neural network to obtain short-term user short-term interest information.

[0060] In the actual application process, in combination with the description of the previous embodiment, it can be obtained from the user dynamic subgraph and the dynamic item subgraph Extract the long-term features of users and items. Based on this, the implementation process of step 102 above includes: Step 1021: Use a graph convolutional network to obtain user long-term interest information based on the user dynamic subgraph.

[0061] Step 1022: Use a graph convolutional network to obtain item long-term interest information based on the dynamic item subgraph.

[0062] Step 1023: Obtain long-term interest information based on the user long-term interest information and the item long-term interest information.

[0063] Step 1024: The interaction information between the user and the item within the set time with the current time as the end time point, and input the user dynamic subgraph corresponding to this interaction information into the convolutional neural network to obtain short-term interest information.

[0064] In the actual application process, the extraction process of the above long-term and short-term interest information can be described as: In the process of encoding user and item features to extract valuable information, each user and item is represented by a dimensional feature vector, the user embedding matrix is denoted as and the item embedding matrix is denoted as .

[0065] To integrate and update node features in these subgraphs, a graph convolutional network is used. Conceptually, both dynamic subgraphs can be regarded as a tree with layers, where the root node or is located in the layer, and the layer consists of hop neighbors obtained through the th subsampling process. To achieve complete information transfer, each user dynamic subgraph and the dynamic item subgraph have to perform graph convolution operations, and the number of layers of the graph convolutional network is . Among them, the dynamic graph convolution is as shown in Figure 7 .

[0066] Furthermore, to better capture the sequential relationship in the user interaction sequence and the impact of the interaction time on the long-term preference features of users and items, time and position embeddings are introduced in this embodiment. The time embedding reflects the time difference between a node and its neighbor nodes, indicating when the user interacts with a specific item, or when the item is accessed by the user. To effectively represent time features, the formula Discretize the time value. This logarithmic transformation scales the time value starting from . The embedding matrix of the time scale is denoted as , and the default setting is time scales.

[0067] In the actual application process, a GCN aggregator based on the self-attention mechanism can be used as the graph convolutional network to more effectively capture the sequential and temporal influences of neighbor nodes. This aggregator contains two multi-head self-attention layers followed by a feed-forward layer. Below, taking the user node as an example, the process of aggregating the long-term preferences of users from the user dynamic subgraph is used to illustrate the implementation process of extracting long-term interest information. Among them: (1) The first self-attention layer calculates the weighted sum of the item embedding, time embedding, and position embedding, which is expressed as: .

[0068] .

[0069] Among them, , . represents the embedding matrix of the neighbor nodes of user , represents the neighborhood of user in the user dynamic subgraph . represents the item embedding, which is the embedding of item after the layer of graph convolution. represents the feature embedding, represents the shape of the vector matrix, represents the time embedding of the neighbor nodes, represents the position information embedding of the neighbor nodes. The multi-head attention mechanism used in this embodiment is a method provided by the pytorch framework, is the parameter matrix to be passed in.

[0070] (2) The second self-attention layer is used to model the interest preferences of users based on the neighbor nodes of the users, and there is: .

[0071] .

[0072] Among them, represents the user embedding, which is the embedding of user after the layer of graph convolution. represents the user interest preference calculated through the second-layer self-attention mechanism, Represents the multi-head self-attention mechanism method, Represents the attention score matrix obtained from the first self-attention mechanism calculation.

[0073] Next, the concept of a residual network is introduced to integrate the long-term interests of users, thereby avoiding common problems in deep neural networks such as overfitting and gradient vanishing.

[0074] .

[0075] Among them, , , and respectively represent different fully connected layer matrices, represents the long-term preference of the user, represents the activation function.

[0076] By the same steps of aggregating the long-term preference of the user from the user dynamic subgraph , the long-term preference of the item can be aggregated from the dynamic item subgraph . .

[0077] In this embodiment, a GCN aggregator based on the self-attention mechanism is used to obtain the long-term preference of the user and the long-term preference of the item .

[0078] Furthermore, although many existing studies only focus on the most recent interaction to determine short-term interests, this method may not comprehensively capture the immediate preferences of users. In contrast, this application uses the user's most recent interactions ) to better represent short-term interests (i.e., short-term interest information). Among them, the process of extracting the short-term interests of the user is as shown in Figure 8 , and this process can be expressed as: .

[0079] .

[0080] .

[0081] Among them, represents the matrix composed of the embeddings of the items in the most recent interactions, represents the items that the user has clicked most recently. represents the matrix splicing operation, such as the concat operation in pytorch. The result and the result are obtained through a convolutional operation with a stride of 1, and are respectively used and as horizontal and vertical convolutional kernels. Each group of convolutional kernels includes 8 horizontal convolutional kernels and 4 vertical convolutional kernels of the same shape. After the outputs obtained through these convolutional operations are processed by pooling and concatenation, the results and result are obtained as follows: .

[0082] .

[0083] Finally, result and result are fused to generate the user's short-term interest vector, denoted as: .

[0084] In the formula, represents the user's short-term interest vector, and MLP represents the fusion operation using a multi-layer perceptron.

[0085] In another exemplary embodiment of the present application, the feature vectors of related items should have a certain similarity to generate item embeddings that can support effective modeling. Based on this, the implementation process of step 103 in the present application can be described as follows: Step 1031: Apply graph convolutional network operations to extract the relevant features of the nodes connected to an item in the Top-k global item graph.

[0086] Step 1032: Obtain the item features related to the item currently of interest to the user based on the relevant features. Among them, the extraction process of the relevant item features is as Figure 9 shown.

[0087] Based on the description in the above embodiments, the present application uses the shortest path algorithm to identify the first related items for each item and constructs the Top-k global item graph . In the Top-k global item graph , for the nodes connected to the node apply GCN operations to extract relevant features. These extracted features are calculated according to the following formula: .

[0088] .

[0089] Among them, represents the neighborhood of the item of interest to the user, represents the final feature vector of related items, represents the attention score obtained by regularization calculation, represents the regularization calculation function, Representation of project dependencies in a shortest path based graph Medium Items Neighborhood of Represents the embedding vector of item j.

[0090] In another exemplary embodiment of the present application, the implementation process of step 104 may include: Step 1041: Generate an embedding of the user at the current time and an embedding of the item at the current time based on item features, long-term interest information, and short-term interest information related to the item that the user is currently interested in.

[0091] Step 1042: Determine the user preference score of the candidate item at the next time based on the embedding of the user at the current time and the embedding of the item at the current time.

[0092] Step 1043: retain candidate item information whose user preference scores exceed the set score threshold, and generate item sequence recommendation information.

[0093] In actual application, combined with the above-mentioned long-term user preferences 、Long-term preference for items , the user's short-term interest vector And the related item feature vector Get up and form users in time Embed , and the corresponding items at time Embed , expressed as: .

[0094] .

[0095] In the formula, , , and They all represent different fully connected layer matrices.

[0096] To predict user At the next time step The possible items to interact with are: For each candidate item , the user is The preference score of is calculated as follows: In the formula, Indicates preference rating, Denotes the vector transpose.

[0097] Furthermore, in the actual application process, the entire implementation process of the above steps 100 - 104 can be used as a model. Among them, the overall implementation process of this model is as Figure 10 shown. To further improve the accuracy of sequence recommendation, the cross-entropy loss function can be used to train the model parameters. The cross-entropy loss function is expressed as: .

[0098] Among them, denotes the loss function value, denotes the true label of the candidate item, is the user 's preference score vector for all candidate items, denotes the cross-entropy loss function.

[0099] In another exemplary embodiment of the present application, in order to evaluate the effectiveness of the method provided by the present application, in this embodiment, three datasets from the real world are tested. These datasets can be publicly obtained on the Internet and are widely used to evaluate sequence recommendation methods. The Amazon dataset is a large-scale dataset widely used in sequence recommendation research. It contains interaction information such as user purchases, browsing, ratings, and reviews from the Amazon e-commerce platform. Three data subsets, namely Amazon-CDs, Amazon-Games, and Amazon-Beauty, are cited from it. The Amazon dataset is known for its high sparsity and variability.

[0100] All of these datasets contain user-item interactions. Each dataset records the user ID, item ID, and the timestamp corresponding to the interaction. For all datasets, all interactions are sorted in ascending order of the timestamp, and users and items (as items) with fewer than five interactions are discarded. For all datasets, the leave-one-out method is sampled to divide the training set and the test set. For the interaction sequence of each user, the last interaction is used for testing, and the remaining data is used as the training data.

[0101] In addition, a sequence segmentation method is adopted to enhance the data. Each sequence is segmented to generate multiple subsequences , where the last item of each sequence is the corresponding label.

[0102] To prove the effectiveness of the method model provided by the present application, the following models will be used as comparison methods for effectiveness comparison: 1. Recurrent Neural Network for Session-based Recommendation with Top-k Gain (GRU4Rec+): This is a model based on the gated recurrent unit (GRU) and is an improved version of the session-based recurrent neural network recommendation (GRU4Rec). Compared with GRU4Rec, it adopts a new loss function and sampling strategy.

[0103] 2. Personalized Top-N Sequential Recommendation with Convolutional Sequence Embedding (Caser): This is a model that combines convolutional neural networks and embedding methods to capture information from user interaction sequences.

[0104] 3. Self-Attention Sequential Recommendation (SASRec): This is a model based on the self-attention mechanism that can capture semantic information from the user's interaction sequence for predicting the next item.

[0105] 4. Session-based Recommendation with Graph Neural Networks (SR-GNN): This is a GNN-based recommendation model that combines an attention network to obtain accurate item embeddings.

[0106] 5. Hierarchical Gated Network-based Sequential Recommendation (HGN): This is a model that integrates Bayesian Personalized Ranking (BPR) with a hierarchical gated structure and can be used for sequential recommendation tasks.

[0107] 6. Self-Attention Sequential Recommendation Considering Time Intervals (TiSASRec): This is an improved method based on the self-attention-based sequential recommendation model (SASRec), which models the absolute position of items and the time intervals between items in the sequence to optimize the model.

[0108] 7. Session-based Recommendation with Graph Neural Networks Enhanced by Global Context (GCE-GNN): This is a GNN-based recommendation model that aggregates the item representations learned from the session graph and the global graph through a soft attention mechanism to help the model make predictions.

[0109] 8. Efficient and Effective Social Recommendation Session-based Recommendation Framework (SERec): This is a GNN-based model that uses a heterogeneous graph neural network to learn user and item representations with knowledge from the social network.

[0110] 9. Next Item Recommendation Based on Sequential Hypergraph (HyperRec): This is a model based on the hypergraph structure that uses the hypergraph to capture the high-order connectivity between users and items to handle the recommendation problem.

[0111] 10. Sequential Recommendation with Dynamic Graph Neural Networks (DGSR): This is a GNN-based model that creates a dynamic graph connecting different user sequences to capture the dynamic collaborative signals between different user sequences for prediction.

[0112] 11. Position-Enhanced and Time-Aware Graph Convolutional Network for Sequential Recommendation (PTGCN), which is a GNN-based model that performs graph convolution on the high-order connected graph of users and items, and helps learn the dynamic representations of users and items through position enhancement and time awareness.

[0113] To evaluate the performance of the above model, two widely used metrics, Hit@K and NDCG@K, are adopted to quantify the recommendation performance. The Hit@K metric measures whether the top K recommended items contain the items that the user is really interested in. For each user, if the top K recommended items contain the items that the user is interested in, it is recorded as a hit, and Hit@K calculates the average hit rate of all users. NDCG@K is a metric that comprehensively considers the hit rate and position of the recommendation results. A higher Normalized Discounted Cumulative Gain (NDCG) value means that the items that the user is interested in are in a more forward position among the top K recommended items. For each set of test samples, 100 negative samples are randomly selected, and these negative samples and 1 real item are ranked. The metrics Hit@K and NDCG@K are evaluated based on these 101 items. By default, K = 10 is set.

[0114] Table 1 Evaluation Results of Each Model

[0115] Based on the evaluation results shown in Table 1, the model proposed in this application achieves the best results in two evaluation metrics in two of the three datasets compared with the 11 comparison models given above.

[0116] In summary, this application captures the dynamic changes in the user behavior sequence by constructing a dynamic subgraph based on the user-item bipartite graph, calculates the correlation between global items based on the global item graph and introduces the shortest path algorithm to help extract the collaborative information between sequences for feature learning, thereby improving the accuracy and real-time performance of sequential recommendation. Through the advantages of graph neural networks, it better models the complex relationship between users and items, further improving the sequential recommendation accuracy and personalized service ability.

[0117] In an exemplary embodiment, a computer device is provided. The computer device may be a server or a terminal. The computer device includes a processor, a memory, an input / output interface (I / O), and a communication interface. Among them, the processor, the memory, and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store sequence recommendation data. The input / output interface of the computer device is used to exchange information between the processor and external devices. The communication interface of the computer device is used to communicate with external terminals through a network connection. When the computer program is executed by the processor, a sequence recommendation method is implemented.

[0118] In an exemplary embodiment, a computer device is provided, including a memory and a processor. A computer program is stored in the memory. When the processor executes the computer program, the steps in the above method embodiments are implemented.

[0119] In an exemplary embodiment, a computer-readable storage medium is provided, storing a computer program. When the computer program is executed by the processor, the steps in the above method embodiments are implemented.

[0120] In an exemplary embodiment, a computer program product is provided, including a computer program. When the computer program is executed by the processor, the steps in the above method embodiments are implemented.

[0121] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use, and processing of relevant data need to comply with relevant regulations.

[0122] Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be completed by instructing relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above methods. Among them, any reference to a memory, database, or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memories. Non-volatile memories can include read-only memory (ROM), magnetic tapes, floppy disks, flash memories, optical memories, high-density embedded non-volatile memories, resistive random-access memories (ReRAM), magnetoresistive random-access memories (MRAM), ferroelectric memories (FRAM), phase change memories (PCM), graphene memories, etc. Volatile memories can include random access memory (RAM) or external cache memories, etc. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc.

[0123] The databases involved in the embodiments provided in the present application can include at least one of relational databases and non-relational databases. Non-relational databases can include distributed databases based on blockchain, etc., without limitation. The processors involved in the embodiments provided in the present application can be general-purpose processors, central processors, graphics processors, digital signal processors, programmable logics, data processing logics based on quantum computing, etc., without limitation.

[0124] The technical features of the above embodiments can be combined arbitrarily. For the sake of brevity of description, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, it should be considered to be within the scope described in this specification.

[0125] Specific examples are used in this article to elaborate on the principles and implementation manners of the present application. The description of the above embodiments is only used to help understand the method and its core idea of the present application; at the same time, for those of ordinary skill in the art, according to the idea of the present application, there will be changes in the specific implementation manners and application scopes. In summary, the content of this specification should not be construed as a limitation to the present application.

Claims

1. A sequence recommendation method, characterized in that: include: Constructing a Top-k global item graph based on the correlation between items in a user interaction sequence; the user interaction sequence is a sequence formed by the interaction information between the user and the item; generating a dynamic graph based on the user interaction sequence; Using graph convolutional networks and convolutional neural networks, based on the dynamic graph, long-term interest information and short-term interest information are obtained; the long-term interest information refers to the stable and continuous interests or preferences of the user within a first set time, as well as the effective characteristics of the item itself; the short-term interest information refers to the real-time impact of the user and the item on their own characteristics due to the current environment, situation or behavior within a second set time; the first set time is greater than the second set time; Extracting item features related to the items currently of interest to the user based on the Top-k global item graph; Item sequence recommendation information is obtained based on item features related to the item currently of interest to the user, the long-term interest information, and the short-term interest information.

2. The sequence recommendation method according to claim 1, characterized in that: Construct a Top-k global item graph based on the correlation between items in the user interaction sequence, including: Constructing an initial global item graph based on the user interaction sequence, and constructing a global item graph based on the initial global item graph using a shortest path algorithm; Keep the previous list of each item in the global item graph The edges with the greatest correlation are obtained to obtain the Top-k global item graph.

3. The sequence recommendation method according to claim 2, characterized in that: In the process of constructing an initial global item graph based on the user interaction sequence and using the shortest path algorithm to construct a global item graph based on the initial global item graph, the number of times the terminal node in each directed edge is clicked after the starting node is used as the weight of the directed edge; A filtering mechanism is introduced to filter out the directed edges whose weights are lower than a set threshold parameter to obtain the global item graph.

4. The sequence recommendation method according to claim 2, characterized in that: An initial global item graph is constructed based on the user interaction sequence, and a global item graph is constructed based on the initial global item graph using a shortest path algorithm, including: In the user interaction sequence, the number of times an item is clicked by a user after another item is used as the weight of the edge between the item and the other item; When an item is adjacent to another item in the user interaction sequence, the weight of the edge between the item and the other item is increased by 1 to generate the initial global item graph; Determining a cost value of an edge between an item and another item in the initial global item graph based on a weight of the edge; Using the shortest path algorithm, based on the cost value, determine the minimum cost from each item to other items, and generate a shortest path graph; In the shortest path graph, the weight of the edge between one item and another item is determined based on the minimum cost from one item to another item, and the correlation between this item and another item is obtained based on the weight of the edge between this item and another item combined with the maximum weight of the edge in the shortest path graph, until the correlation between all items in the shortest path graph and other items is obtained to generate the global item graph.

5. The sequence recommendation method according to claim 1, characterized in that: Generating a dynamic graph based on the user interaction sequence includes: The click relationship between the user and the item in the user interaction sequence is used as the edge between the user and the item, and the time point when the user clicks the item is obtained; The time point is used as the attribute interaction timestamp of the edge between the user and the item to generate a user-item bipartite graph; Dynamically sample from the user-item bipartite graph to build user dynamic subgraphs and dynamic item subgraphs centered on users and items; The dynamic graph is generated based on the user dynamic sub-graph and the dynamic item sub-graph.

6. The sequence recommendation method according to claim 5, characterized in that: Using a graph convolutional network and a convolutional neural network, based on the dynamic graph, long-term interest information and short-term interest information are obtained, including: Using the graph convolutional network, obtaining user long-term interest information based on the user dynamic subgraph; Using the graph convolutional network, obtaining long-term interest information of items based on the dynamic item subgraph; Obtaining the long-term interest information based on the user long-term interest information and the item long-term interest information; The interaction information between the user and the item within a set time with the current time as the end time point, and the user dynamic subgraph corresponding to the interaction information is input into the convolutional neural network to obtain the short-term interest information.

7. The sequence recommendation method according to claim 1, characterized in that: Item features related to the items currently of interest to the user are extracted based on the Top-k global item graph, including: Apply graph convolutional network operations to extract the top-k global item graphs connected to an item. The relevant features of each node; Item features related to the item currently of interest to the user are obtained based on the related features.

8. The sequence recommendation method according to claim 1, characterized in that: Obtaining item sequence recommendation information based on item features related to the item currently of interest to the user, the long-term interest information, and the short-term interest information, including: Generate an embedding of the user at the current time and an embedding of the item at the current time based on item features related to the item currently of interest to the user, the long-term interest information, and the short-term interest information; Determine a user preference score for a candidate item at a next time based on the embedding of the user at the current time and the embedding of the item at the current time; The candidate item information whose user preference score exceeds a set score threshold is retained to generate the item sequence recommendation information.

9. A computer device comprising: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the sequence recommendation method according to any one of claims 1 to 8.

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

Citation Information

Patent Citations

  • Self-supervised sequence recommendation method based on long-term and short-term interests of user

    CN114528490A

  • Recommendation method based on dynamic difference graph

    CN115878884A

  • Social recommendation method based on dynamic hypergraph representation learning

    CN116204723A

  • Article delivery system, method and device

    CN119624284A

  • Method, device, computer equipment and storage medium for identifying illegal commodity

    US20240331425A1