User behavior sequence recommendation method and system based on graph neural network

By constructing a user and item graph using a graph neural network, and combining an attention mechanism and a Transformer model, this approach addresses the shortcomings of traditional recommendation systems in capturing high-order relationships and temporal dependencies, thereby improving the accuracy and generalization ability of recommendation systems. It is suitable for e-commerce and content platforms.

CN120910345APending Publication Date: 2025-11-07SHAANXI NORMAL UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510966179.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-14
Publication Date
2025-11-07

AI Technical Summary

Technical Problem

Traditional recommendation systems struggle to simultaneously capture the high-order graph structure and temporal dependencies between users and items, cannot effectively utilize auxiliary feature information, and cannot optimize multiple related tasks through joint training during the training process.

Method used

We employ a user behavior sequence recommendation method based on graph neural networks. By combining a gated graph neural network with an attention mechanism and a Transformer encoder-decoder structure with a multilayer perceptron neural network, we construct user and item graphs, capture higher-order relationships and temporal dependencies between users and items, and jointly train click-through rate prediction and sequence prediction tasks.

Benefits of technology

It improves the accuracy of recommendation systems, effectively captures higher-order relationships between users and items, alleviates overfitting, enhances the model's generalization ability, and is suitable for recommendation scenarios in e-commerce and content platforms.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120910345A_ABST
    Figure CN120910345A_ABST
Patent Text Reader

Abstract

The invention discloses a user behavior sequence recommendation method based on a graph neural network, and the method comprises the steps: carrying out the embedding of a target user index, a historical interaction article sequence index and a target article index through employing a gating graph neural network of an attention mechanism, and carrying out the message aggregation, respectively obtaining a user vector, a historical interaction item vector and a target item vector; inputting the historical interaction article vector into a Transform encoder and decoder structure for internal transmission, capturing a sequence dependency relationship, and obtaining an encoded article vector sequence; performing vector splicing and flattening on the encoded historical interaction item vector and the user vector and the target item vector after message aggregation to obtain a total vector sequence, conveying the total vector sequence to a multi-layer perceptron neural network, performing linear transformation to obtain a scalar, performing nonlinear activation on the scalar to obtain a multi-layer perceptron neural network, and performing non-linear activation on the multi-layer perceptron neural network to obtain a multi-layer perceptron neural network; and outputting whether to recommend the article to the user. The method can simultaneously capture a user-article graph structure relationship and a time sequence behavior pattern.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The application belongs to the technical field of artificial intelligence and recommendation system, and particularly relates to a user behavior sequence recommendation method and system based on a graph neural network. BACKGROUND

[0002] Traditional recommendation systems mainly use collaborative filtering or content-based recommendation methods. Collaborative filtering relies on similarity calculation of user-item interaction data, which is prone to recommendation bias due to data sparsity. The content-based method is limited by the quality of feature engineering and is difficult to mine user's potential preferences. These methods have significant shortcomings in modeling user dynamic behavior patterns, handling cold start scenarios, and capturing cross-domain long-term interest evolution. In recent years, deep learning technology has been introduced into recommendation systems through nonlinear representation learning, but there are still technical bottlenecks in key areas: 1. Existing methods are difficult to capture high-order graph structure relationships and temporal dependence relationships between users and items; 2. Most models cannot effectively utilize auxiliary feature information of users and items; 3. The training process often uses a single objective function, which cannot optimize multiple related tasks through joint training. SUMMARY

[0003] To solve the above problems, the application provides a user behavior sequence recommendation method based on a graph neural network, which can capture the graph structure relationship and temporal behavior pattern of users and items, improve the recommendation accuracy through a joint training strategy, and is suitable for recommendation scenarios such as e-commerce and content platforms.

[0004] To achieve the above purpose, in a first aspect, the application provides a user behavior sequence recommendation method based on a graph neural network, comprising the following steps: A gated graph neural network with an attention mechanism is used to embed the target user index, the historical interaction item sequence index, and the target item index for message aggregation, to obtain a user vector, a historical interaction item vector, and a target item vector, respectively; The historical interaction item vector is input into a Transformer encoder and decoder structure for internal transmission to capture sequence dependence relationships and obtain an encoded item vector sequence; The encoded historical interaction item vector and the message-aggregated user vector and target item vector are concatenated and flattened to obtain a total vector sequence, which is input into a multi-layer perceptron neural network, and then linearly transformed to obtain a scalar. The scalar is nonlinearly activated to output a click rate prediction result, i.e., whether to recommend the item to the user.

[0005] Further, the training based on the graph neural network comprises the following steps: Step 1, based on the user dataset and the item dataset, an independent user graph and an item graph are constructed, the user graph contains user nodes and user feature nodes, and the item graph contains item nodes, item feature nodes and the historical interaction item sequence of the target user; Step 2, the target user index, the historical interaction item sequence index and the target item index are embedded by using the attention mechanism of the gated graph neural network to perform message aggregation, and user vectors, historical interaction item vectors and target item vectors are obtained respectively; Step 3, the historical interaction item vectors are input into the Transformer encoder and decoder structure for internal transmission to capture the sequence dependency relationship, and the encoded item vector sequence is obtained; Step 4, the item vector sequence output by the Tansformer encoding is transmitted through a fully connected layer to keep the tensor dimension of the item consistent before encoding; Step 5, the historical interaction item vectors and the to-be-predicted item vectors are combined to establish an auxiliary loss function auxiliaryloss, the auxiliary loss function auxiliaryloss and the click rate prediction loss function BCEloss are jointly optimized, and the model parameters in the Transformer structure and the vector representation of the item itself are iteratively back-propagated; Step 6, the encoded historical interaction item vectors and the message-aggregated user vectors and target item vectors are spliced and flattened to obtain a total vector sequence, the total vector sequence is input into the MLP multi-layer perceptron neural network, and then linearly transformed to obtain a scalar, the scalar is activated nonlinearly to output a click rate prediction result, i.e., whether to recommend the item to the user; Step 7, the click rate prediction result and the actual value establish a cross-entropy loss function, and the auxiliary loss function obtained by joint training is added to obtain a final loss function, which is iteratively back-propagated and optimized by an optimizer, and finally a trained model is obtained.

[0006] Further, in the user graph, the edges represent the relationship between the user and the user feature; in the item graph, the edges represent the relationship between the item and the item feature; the user graph and the item graph are two independent graph structures; in the actual dataset, the user graph and the item graph are composed of the edge set represented by the binary tuple, the user id index is , the user feature id index is , the user index corresponds to the user id, and the user feature index may be the user gender, age, interest, marital status; the item graph includes the item id and the item feature, the item id index is , and the item feature id index is .

[0007] Furthermore, the historical interaction item vectors are input into the Transformer encoder and decoder structure for internal transmission to capture sequence dependencies, resulting in an encoded item vector sequence. This includes: inputting user vectors into the user graph for AGFM graph neural network message aggregation to obtain embedded vectors of a specified dimension; after message transmission through the AGFM graph neural network, the resulting vectors possess local features. The specific implementation process of AGFM is as follows: The formula for user u's AGFM message aggregation layer is as follows:

[0008] in, This represents the message aggregation at user node u, where n represents the number of neighbors of user node u. and Let represent the vectors of the i-th and j-th neighbor nodes of node u, respectively. This represents the attention between node i and node j.

[0009] Furthermore, the historical interaction item vectors are input into the Transformer encoder and decoder structure for internal transmission, capturing sequence dependencies to obtain the encoded item vector sequence. The historical interaction item sequence tensor after message passing through the AGFM graph neural network is represented as follows: The target item is embedded as The historical sequence of interactive items is fed into the Transformer encoder, and position encoding is added. Encode the position The input is fed into a multi-head attention layer to compute the multi-head attention. Based on the query, key, and value of each attention head, calculate the attention output of each head; After the self-attention mechanism, residual and normalization processing is performed, and the data is then input into the feedforward neural network. The representation at each position is nonlinearly transformed, and after residual connection and layer normalization, the encoder outputs the historical item sequence and the embedding of the target item. Then, the tensor output by the Transformer encoder is input into the decoder for transmission. The decoder uses a mask matrix M with multi-head self-attention to mask future information, obtaining the final item sequence and the embedded representation of the target item, i.e., the item vector sequence.

[0010] Furthermore, in step 4, the fully connected layer includes a linear layer and a nonlinear activation layer.

[0011] Further, in step 5, the cross-entropy loss function auxiliaryloss is established as an auxiliary loss function by combining the full connection layer output item sequence vector with the actual item sequence vector, and the cross-entropy loss function auxiliaryloss is as follows:

[0012]

[0013] Wherein, n is the total number of samples, and c is the total number of categories, that is, the total number of items in the recommendation system; Further, in step 6, the user vector aggregated by the AGFM graph neural network , and the item sequence vector trained by the transformer encoder and decoder are subjected to vector splicing operation to obtain a total vector sequence . The total vector sequence is input into the MLP multi-layer perceptron neural network, and a scalar is obtained through several linear transformations. The scalar is subjected to sigmoid linear activation to map to the interval (0, 1) to obtain , and then the probability of the user clicking the item, that is, the user click rate, is obtained.

[0014] Further, in step 7, the cross-entropy loss function BCEloss is established by the click rate obtained by model prediction and the actual value, and the auxiliary loss function auxiliaryloss obtained by joint training is added to obtain the final loss function, and the final trained model is obtained by back propagation iteration optimizer, wherein the cross-entropy loss function BCE is a binary classification model. The weighted loss function loss obtained by joint training is calculated as follows:

[0015] Wherein, is an adjustable hyperparameter.

[0016] In a second aspect, the present application provides a user behavior sequence recommendation system based on a graph neural network, comprising a graph construction module, a message aggregation module, an encoder processing block and a prediction module. The graph construction module is used to construct independent user graphs and item graphs according to a user data set and an item data set, the user graph comprises user nodes and user feature nodes, and the item graph comprises an item graph, item feature nodes and a historical interaction item sequence of a target user. The message aggregation module adopts a gated graph neural network with an attention mechanism to perform message aggregation on embedding of a target user index, a historical interaction item sequence index and a target item index, to obtain a user vector, a historical interaction item vector and a target item vector respectively. The encoder processing block is configured to input the historical interaction item vector into a Transformer encoder and decoder structure for internal transmission, capture sequence dependency and obtain an encoded item vector sequence. The prediction module is configured to perform vector splicing on the encoded historical interaction item vector and the message aggregated user vector and target item vector, flatten the total vector sequence, input the total vector sequence into a multi-layer perception neural network, perform linear transformation, obtain a scalar, perform nonlinear activation on the scalar and output a click rate prediction result, i.e., whether to recommend the item to the user.

[0017] Compared with the prior art, the present application has at least the following beneficial effects: the present application adopts a gated graph neural network (AGFM) with an attention mechanism to enhance feature expression capability through user / item itself and neighbor interaction three-order attention, capture high-order relationship of users and items, accurately model time sequence dependency of user behavior sequence through a Transformer model structure, cooperatively optimize a main task (CTR) and an auxiliary task (sequence prediction), relieve overfitting, improve model generalization capability through training strategy, seamlessly connect a graph network and a Transformer model, uniformly process structure and time sequence information, the method described in the present application has strong interpretability and can identify important user-item interaction patterns. BRIEF DESCRIPTION OF DRAWINGS

[0018] Figure 1 It is a flowchart of a user behavior sequence recommendation method based on a graph neural network. DETAILED DESCRIPTION

[0019] The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor fall within the scope of protection of the present application.

[0020] Embodiment 1, refer to Figure 1 The present application provides a user behavior sequence recommendation method based on a graph neural network, comprising the following steps: The message aggregation module adopts a gated graph neural network with an attention mechanism to perform message aggregation on embedding of a target user index, a historical interaction item sequence index and a target item index, to obtain a user vector, a historical interaction item vector and a target item vector respectively. The historical interaction item vector is input into a Transformer encoder and decoder structure for internal transmission, capturing sequence dependence, to obtain an encoded item vector sequence; The encoded historical interaction item vector, the aggregated user vector and the target item vector after message aggregation are spliced and flattened to obtain a total vector sequence, which is input into a multi-layer perception neural network, and then linearly transformed to obtain a scalar, which is activated nonlinearly to output a click rate prediction result, i.e., whether to recommend the item to the user.

[0021] Embodiment 2, reference Figure 1 The application provides a training process of a graph neural network, specifically including the following steps: Step 1, obtaining a user data set and an item data set, constructing independent user graphs and item graphs, the user graph being composed of user nodes and user feature nodes, and the edges representing the relationship between the user and the user feature. The item graph is composed of item nodes and item feature nodes, and the edges represent the relationship between the item and the item feature. The user graph and the item graph are two independent graph structures; in the actual data set, the user graph and the item graph are composed of an edge set represented by a binary tuple, the user id index being , the user feature id index being , and the edge set in the form of [( , ),( , ),( , ) …] can be obtained after processing. The numbers in the edge set contain user indexes and user feature indexes, the user indexes corresponding to user ids, and the user feature indexes possibly being user gender, age, interest, and marital status. The item graph includes item ids and item features such as categories, titles, and prices, the item id index being , and the item feature id index being The item graph can be obtained after processing, and the edge set is in the form of [( , ),( , ),( , ) …].

[0022] Step 2, initializing the target user index, the historical interaction item sequence index, and the target item index into embedding vectors of a specified dimension; inputting the user vector into the user graph for AGFM graph neural network message aggregation to obtain an embedding vector of a specified dimension, the vector obtained after the message transmission of the AGFM graph neural network message aggregation having global features, which can effectively capture high-order relationships between users and items. The specific implementation process of the AGFM graph neural network message aggregation is as follows: For user u, the formula of AGFM graph neural network message aggregation layer is as follows:

[0023] wherein, denotes the message aggregation at the user node u, and n represents the number of neighbors of the user node u. and denote the i-th and j-th neighbor node vectors of the node u, respectively. denotes the attention between the node i and the node j. If the user itself is considered, the corresponding graph neural network aggregation layer formula can be adjusted as:

[0024] wherein, u is the target user self vector. The calculation formula of the above attention is as follows:

[0025] wherein, and are linear transformation matrices, is a bias term. The formula of the AGFM message aggregation layer of the item v is as follows:

[0026] wherein, denotes the message aggregation at the item node v, and n represents the number of neighbors of the item node u. and denote the i-th and j-th neighbor node vectors of the node v, respectively. denotes the attention between the node i and the node j. If the item itself is considered, the corresponding graph neural network aggregation layer formula can be adjusted as:

[0027] wherein, v is the target user self vector. The calculation formula of the above attention is as follows:

[0028] wherein, and are linear transformation matrices, is a bias term. Step 3 is specifically as follows. The historical interaction item sequence tensor after the message passing of the AGFM graph neural network is represented as , and the target item embedding is represented as The historical interaction item sequence is input into a Transformer encoder, with position encoding added :

[0029] where, is a position encoding matrix, usually generated using sine and cosine functions.

[0030] The position encoding is then input into a multi-head attention layer, which computes multi-head attention as follows:

[0031] where, is a linear transformation matrix of the output, is the number of heads of attention; For each attention head i, the query (Query), key (Key) and value (Value) are computed as:

[0032] where, is a learnable weight matrix; The attention output for each head is computed as:

[0033] After the multi-head self-attention mechanism is processed, residual connection and normalization processing are performed; the normalization operation is calculated as:

[0034] where, and are the mean and variance of the input, respectively, and are learnable parameters, is a small constant; After the neural network is transmitted, the initial vector is added to complete the residual connection. The residual connection and layer normalization can be finally expressed as:

[0035] The result after residual connection and normalization is input into a feedforward neural network to perform a nonlinear transformation on the representation of each position. The feedforward neural network includes two fully connected layers, with a ReLU activation function used in between; The calculation formula of the feedforward neural network is:

[0036] where, is a learnable weight matrix; After residual connection and layer normalization, the Transformer encoder output is obtained, and the embedding representation of the historical interaction item sequence and the target item of the Transformer encoder output is The dependence in the sequence has been captured, and then the tensor output by the Transformer encoder is input into the decoder for transmission; The structure of the decoder is similar to that of the encoder, but a masked multi-head self-attention mechanism is added to prevent the decoder from seeing future information when generating the sequence. First, position encoding is performed: position information is added to capture the sequence order; the first layer of the decoder is a masked multi-head self-attention mechanism, which ensures that only the information of the first j-1 items can be seen when the jth item is generated; the masked multi-head self-attention mechanism uses a mask matrix M to mask future information:

[0037] The calculation of each attention head is as follows:

[0038] The mask matrix M is an upper triangular matrix, and the elements on and below the diagonal are 0, and the elements above the diagonal are After residual connection and normalization, the subsequent operation is the same as that of the encoder, and the embedding representation of the final item sequence and the target item is , that is, the item tensor; Step 4: The item vector sequence output by the Transformer encoder and decoder is transmitted through a fully connected layer to keep the same dimension as the tensor before encoding; wherein the fully connected layer is composed of a linear layer and a nonlinear activation layer, and the formula of the linear layer is:

[0039] Where x is the input vector, W is the weight matrix, b is the bias vector, and z is the output vector. The nonlinear activation layer is:

[0040] Where, is the activation function, is the final output. The item sequence vector output by the fully connected layer is , and the dimension of the item sequence vector is consistent with the dimension of the vector before the Transformer encoding. Step 5 is as follows: the item sequence vector output by the fully connected layer is , and the actual item sequence vector is An auxiliary loss function auxiliaryloss is established as an auxiliary loss function for subsequent model iteration optimization, and the calculation formula of auxiliaryloss is as follows:

[0041]

[0042] Wherein, n is the total number of samples, and c is the total number of categories, that is, the total number of items in the recommendation system; Step 6 is as follows, the user vector aggregated by the graph neural network AGFM , the item sequence vector composed of the historical interaction items and the target items trained by the joint training of the transformer encoder and the decoder Perform vector splicing operation to obtain a total vector sequence ;

[0043] The total vector sequence Is input into the MLP multilayer perceptron neural network, and after a plurality of linear transformations, a scalar is obtained. The MLP multilayer perceptron neural network is composed of an input layer, a hidden layer and an output layer, each layer contains a plurality of neurons, and the layers are fully connected. Let the input of the l-th layer be , and the output be The forward propagation formula is:

[0044] Wherein, is the weight matrix of the l-th layer, is the activation function, is the bias term.

[0045] Finally, the sigmoid linear activation is performed to map the scalar to the interval (0, 1), and the mathematical expression is:

[0046] The probability of the user clicking the item, that is, the click-through rate CTR, is finally obtained, and the calculation formula is as follows;

[0047] Step 7, the cross-entropy loss function BCEloss is established between the CTR click rate obtained by model prediction and the actual value, and the auxiliary loss function auxiliaryloss obtained by joint training is added to obtain the final loss function. The back propagation iteration optimizer is used to finally obtain the trained model; Wherein, the cross-entropy loss function BCEloss is a binary classification model, and the calculation formula is as follows:

[0048] wherein, is the true label, is the probability predicted by the model, and N is the number of samples; The weighted loss function loss obtained through joint training is calculated as follows:

[0049] wherein, is an adjustable hyperparameter.

[0050] Based on the concept of the user behavior sequence recommendation method based on the graph neural network described above, the application further provides a user behavior sequence recommendation system based on a graph neural network, comprising a graph construction module, a message aggregation module, an encoder processing block and a prediction module. The graph construction module is used to construct independent user graphs and item graphs according to a user data set and an item data set, the user graph comprises user nodes and user feature nodes, and the item graph comprises an item graph, item feature nodes and a historical interaction item sequence of a target user. The message aggregation module adopts a gated graph neural network with an attention mechanism to perform message aggregation on embedding of a target user index, a historical interaction item sequence index and a target item index, and obtains a user vector, a historical interaction item vector and a target item vector, respectively. The encoder processing block is used to input the historical interaction item vector into a Transformer encoder and decoder structure for internal transmission, so as to capture sequence dependency and obtain an encoded item vector sequence. The prediction module is used to perform vector splicing on the encoded historical interaction item vector and the message aggregated user vector and target item vector, and then flatten the vector to obtain a total vector sequence, the total vector sequence is sent to a multi-layer perception neural network, and then linearly transformed to obtain a scalar, the scalar is subjected to nonlinear activation to output a click rate prediction result, that is, whether to recommend the item to the user.

[0051] To sum up, the user behavior sequence recommendation method based on the graph neural network provided by the application constructs a user relationship network graph and an item relationship network graph; a gate graph neural network with an attention mechanism enhances the feature expression capability through three-order attention of the user / item itself and neighbor interaction, effectively capturing high-order relationships of the user and the item; a Transformer encoder and decoder model are used to process a historical interaction sequence, modeling timing dependence; a click rate prediction and sequence prediction task are jointly trained to relieve overfitting, and a training strategy is used to improve the generalization capability of the model; and user and item representations are spliced to obtain a final prediction result. The application can simultaneously capture the graph structure relationship and timing behavior pattern of the user-item, improve the recommendation accuracy through a joint training strategy, and is suitable for recommendation scenarios such as e-commerce and content platforms.

[0052] The above merely describes preferred embodiments of the application, but the protection scope of the application is not limited thereto, and any person skilled in the art can make equivalent replacements or changes to the technical solutions and inventive concepts of the application within the technical scope disclosed by the application, and all of the above should be covered within the protection scope of the application.

Claims

1. A method for recommending a user behavior sequence based on a graph neural network, characterized in that, The method comprises the following steps: The target user index, the historical interaction item sequence index, and the target item index are embedded by using the attention mechanism-based gate graph neural network to perform message aggregation, and user vectors, historical interaction item vectors, and target item vectors are obtained respectively; The historical interaction item vectors are input into a Transformer encoder and decoder structure for internal transmission to capture sequence dependency, and encoded item vector sequences are obtained; The encoded historical interaction item vectors, the message-aggregated user vectors, and the target item vectors are spliced and flattened to obtain a total vector sequence, the total vector sequence is input into a multi-layer perceptron neural network, and then linear transformation is performed to obtain a scalar, the scalar is subjected to nonlinear activation to output a click rate prediction result, i.e., whether the item is recommended to the user.

2. The user behavior sequence recommendation method based on a graph neural network according to claim 1, characterized in that, Training based on the graph neural network comprises the following steps: Step 1: Construct independent user graphs and item graphs based on a user dataset and an item dataset, the user graphs include user nodes and user feature nodes, and the item graphs include item graphs, item feature nodes, and a historical interaction item sequence of a target user; Step 2: The target user index, the historical interaction item sequence index, and the target item index are embedded by using the attention mechanism-based gate graph neural network to perform message aggregation, and user vectors, historical interaction item vectors, and target item vectors are obtained respectively; Step 3: The historical interaction item vectors are input into a Transformer encoder and decoder structure for internal transmission to capture sequence dependency, and encoded item vector sequences are obtained; Step 4: The item vector sequences output by the Transformer after encoding are transmitted through a fully connected layer to keep the tensor dimension of the item consistent before encoding; Step 5: An auxiliary loss function auxiliaryloss is established in combination with the historical interaction item vectors and the to-be-predicted item vectors, the auxiliary loss function auxiliaryloss and a click rate prediction loss function BCEloss are jointly optimized, and model parameters in the Transformer structure and vector representations of the items are iteratively back-propagated and updated; Step 6: The encoded historical interaction item vectors, the message-aggregated user vectors, and the target item vectors are spliced and flattened to obtain a total vector sequence, the total vector sequence is input into a multi-layer perceptron neural network, and then linear transformation is performed to obtain a scalar, the scalar is subjected to nonlinear activation to output a click rate prediction result, i.e., whether the item is recommended to the user; Step 7: A cross-entropy loss function is established in combination with the click rate prediction result and an actual value, the cross-entropy loss function and an auxiliary loss function obtained through joint training are added to obtain a final loss function, and an optimizer is iteratively back-propagated and updated to obtain a trained model.

3. The user behavior sequence recommendation method based on a graph neural network according to claim 2, characterized in that, In the user graph, the edges represent the relationship between users and user features; in the item graph, the edges represent the relationship between items and item features; the user graph and the item graph are two independent graph structures; in the actual data set, the user graph and the item graph are composed of the edge set represented by the binary tuple, the user id index is , the user feature id index is , the user index corresponds to the user id, and the user feature index may be the user gender, age, interest, marital status; the item graph includes the item id and the item feature, the item id index is , and the item feature id index is .

4. The user behavior sequence recommendation method based on a graph neural network according to claim 1 or 2, characterized in that, The AGFM graph neural network with an attention mechanism performs message aggregation on the embedding of the target user index, the historical interaction item sequence index and the target item index, including: passing the user vector into the user graph for AGFM graph neural network message aggregation to obtain an embedding vector of a specified dimension, and performing message passing on the AGFM graph neural network to obtain a vector with local features, and the specific implementation process of the AGFM is as follows: The formula of the AGFM message aggregation layer of the user u is as follows: wherein, denotes the message aggregation at user node u, n represents the number of neighbors of user node u, with denotes the i-th and j-th neighbor node vector of node u, respectively, denotes the attention between node i and node j.

5. The user behavior sequence recommendation method based on a graph neural network according to claim 1 or 2, characterized in that, The historical interaction item vector is input into a Transformer encoder and decoder structure for internal transmission, captures sequence dependence, obtains an encoded item vector sequence, and the historical interaction item sequence tensor after message passing of an AGFM graph neural network is represented as , and the target item embedding is represented as The historical interaction item sequence is input into a Transformer encoder, and position encoding is added The position encoding is input into a multi-head attention layer, and multi-head attention is calculated According to the query, key and value of each attention head, the attention output of each head is calculated. After the self-attention mechanism, residual connection and normalization processing, the input is input into a feedforward neural network to perform nonlinear transformation on the representation of each position, and then the residual connection and layer normalization are performed again, and the encoder outputs the embedding of the historical item sequence and the target item, and then the tensor output by the Transformer encoder is input into the decoder for transmission. The decoder shields future information through the mask matrix M of the masked multi-head self-attention to obtain the embedding representation of the final item sequence and the target item, that is, the item vector sequence.

6. The user behavior sequence recommendation method based on a graph neural network according to claim 1, characterized in that, In step 4, the full connection layer includes a linear layer and a nonlinear activation layer.

7. The user behavior sequence recommendation method based on a graph neural network according to claim 1, characterized in that, In step 5, the cross-entropy loss function auxiliaryloss is established as an auxiliary loss function by combining the item sequence vector output by the full connection layer with the actual item sequence vector, and the cross-entropy loss function auxiliaryloss is as follows: Wherein, n is the total number of samples, and c is the total number of categories, that is, the total number of items in the recommendation system.

8. The user behavior sequence recommendation method based on a graph neural network according to claim 2, characterized in that, In step 6, the user vector aggregated by the AGFM graph neural network , the item sequence vector trained by the transformer encoder and decoder is subjected to a vector splicing operation to obtain a total vector sequence ; Total vector sequence The total vector sequence is fed into a MLP multi-layer perceptron neural network, which undergoes several linear transformations to obtain a scalar; The scalar is subjected to sigmoid linear activation, mapped to the interval (0, 1), to obtain and then the probability of the user clicking the item, i.e. the user click rate, is obtained.

9. The user behavior sequence recommendation method based on a graph neural network according to claim 1, characterized in that, In step 7, the click rate predicted by the model and the actual value establish a cross-entropy loss function BCEloss, and the auxiliary loss function auxiliaryloss obtained by joint training is added to obtain the final loss function, and the iterative optimizer is back propagated to obtain the trained model, wherein the cross-entropy loss function BCE is a binary classification model; The weighted loss function loss obtained by joint training is calculated as follows: wherein, are adjustable hyperparameters.

10. A graph neural network-based user behavior sequence recommendation system, characterized in that, The model includes a graph construction module, a message aggregation module, an encoder processing block and a prediction module. The graph construction module is used to construct independent user graphs and item graphs according to a user data set and an item data set, the user graph includes user nodes and user feature nodes, and the item graph includes item graphs, item feature nodes and historical interaction item sequences of a target user; The message aggregation module uses the AGFM graph neural network with an attention mechanism to perform message aggregation on the embedding of the target user index, the historical interaction item sequence index and the target item index to obtain user vectors, historical interaction item vectors and target item vectors, respectively; The encoder processing block is used to input the historical interaction item vector into a Transformer encoder and a decoder structure for internal transmission to capture sequence dependency to obtain an encoded item vector sequence; The prediction module is used to perform vector splicing on the encoded historical interaction item vector and the user vector and the target item vector after message aggregation, flatten the total vector sequence, input the total vector sequence into a multi-layer perception neural network, perform linear transformation, obtain a scalar, perform nonlinear activation on the scalar, and output a click rate prediction result, that is, whether to recommend the item to the user.