A service recommendation method based on graph differential equations and twin learning

By solving graph differential equations in the service recommendation model and utilizing twin learning, the problem of existing models being difficult to utilize sparse clock data and ignoring changes in user preferences is solved, and more accurate and effective service recommendations are achieved.

CN117313787BActive Publication Date: 2025-03-11HANGZHOU DIANZI UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311199968.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-09-18
Publication Date
2025-03-11
Estimated Expiration
2043-09-18

AI Technical Summary

Technical Problem

The existing service recommendation model is difficult to effectively utilize the sparse information in user check-in data, ignores the continuity in the process of changing user preferences, and fails to make full use of graph and sequence perspectives, limiting the model's ability to capture user preferences.

Method used

By solving the graph differential equations of user interaction behavior, combining the attention mechanism of time graph sequences and perceived intervals, dynamic interest transfer is learned, and twin learning is used to directly learn from the representation of basic truth tags in the recommendation process, and infer the probability of future use of services.

Benefits of technology

The continuous changes in user interests are explicitly exploited, the distribution of the original data is tracked, specific term representations are obtained for prediction, and the accuracy of recommendation is improved through twin learning, showing better recommendation capabilities.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117313787B_ABST
    Figure CN117313787B_ABST
Patent Text Reader

Abstract

The present invention discloses a service recommendation method based on graph differential equations and twin learning, comprising the following steps: inputting historical service interaction data of users; reading and processing historical service interaction data of users; using linear spatiotemporal embedding and embedding-based self-attention module to standardize and generate adaptive embedding; building a model through graph differential equations, and using the attention mechanism of time graph sequence and perceptual interval to learn dynamic interest transfer; twin learning and service recommendation. The above technical scheme firstly solves the graph differential equation of user interaction behavior, explicitly utilizes the continuous change of user interest, and then uses the attention mechanism of time graph sequence and perceptual interval to learn dynamic interest transfer. Finally, twin learning is used in the recommendation process, and learning is directly from the feature representation of the basic truth label. By comparing with positive samples, the probability of future service use is inferred to provide users with more accurate service recommendations.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of data mining and recommendation systems. It analyzes users' preferences for different services through their check-in behaviors, and proposes a service recommendation method based on graph differential equations and twin learning in combination with the characteristics of the services themselves. Background Art

[0002] Nowadays, with the rapid development of information technology and the advent of the big data era, the use of digital services on the Internet has become very common in modern society. Service Recommendation is committed to using the collected user service interaction data to mine implicit user preferences and recommend appropriate services to users to meet their personalized needs. It is an effective way to overcome information overload. However, in most application scenarios, the collected user check-in data is very sparse and it is difficult to reflect the complete and complex behavior patterns of users. The continuous change of user preferences over time also increases the difficulty of predicting the next service that users will visit.

[0003] Recently, many researchers have proposed many sequence- or graph-based recommendation models to capture user preferences for services based on their historical visit records. However, existing methods often construct user preferences from a discrete perspective, ignoring the continuity of user preference changes. Most methods tend to only use one perspective in the graph or sequence to build models, and fail to use both graph and sequence perspectives to help the model more fully explore user preferences. For negative sampling, many models directly use cross entropy to calculate training losses, without distinguishing between different negative samples, ignoring the differences in user preferences for different negative samples, and thus limiting the model's ability to capture user preferences. Summary of the invention

[0004] In response to the above problems, the present invention proposes a service recommendation method (POIGDE) based on graph differential equations and twin learning.

[0005] Specifically, the present invention explicitly exploits the continuous changes in user interests by solving graph differential equations of user interaction behaviors. In order to keep the distribution unchanged when solving graph differential equations, we use time graph sequences and attention mechanisms with perceptual intervals to learn dynamic interest transfers. Restricted to linear processes, this novel update mechanism can track the distribution of the original data. Under this restriction, our model can obtain specific item representations for prediction, which share the same distribution as the services that users interact with. Finally, our model applies twin learning to the recommendation process and learns directly from the representation of the ground truth labels. By comparing with positive samples, the probability of future use of the service can be inferred based on the similarity (i.e., mean square error) between the high-dimensional representations of the corresponding services.

[0006] The present invention provides a service recommendation method based on graph differential equations and twin learning, which specifically includes the following steps:

[0007] Step 1: Input the user's historical service interaction data;

[0008] Step 2: Read and process the user's historical service interaction data

[0009] Sort each user's historical service interaction data by timestamp to obtain each user's behavior sequence file, where each line corresponds to a user's service interaction sequence;

[0010] Step 3: Sequence Modeling and Extraction

[0011] Perform linear spatiotemporal embedding on the service interaction sequence and generate adaptive embedding based on the linear spatiotemporal embedding of the service interaction sequence through the self-attention module;

[0012] Step 4: Construct a GDE model through graph differential equations, and use the attention mechanism of time graph sequence and perception interval to learn dynamic interest transfer;

[0013] Step 5: Twin learning and service recommendation of GDE model.

[0014] Preferably, in step 1, the historical service interaction data includes user ID, service ID, service information and interaction time.

[0015] Preferably, in step 2, in each service interaction sequence, the service IDs and corresponding categories that the corresponding user u has interacted with are sorted in the order of interaction time, separated by commas; the form is S u ={(ID of service 1),(ID of service 2),...,(ID of service n)}={(s u,1 ),(s u,2 ),...,(s u,n )}.

[0016] Preferably, in step 3, the sequence modeling and extraction method:

[0017] 1) Linear space-time embedding:

[0018] In the time dimension, we first embed the minimum time and maximum time to get the minimum time embedding. and maximum temporal embedding Where d is the dimension of the embedding vector, and then a linear strategy is used to interpolate the upper and lower bounds of any given time t to obtain the linear time embedding e t , e t Defined as:

[0019]

[0020] Where sup(t) and inf(t) are the upper and lower bounds of a given time t, respectively, taking into account time information of different granularities. Time is embedded into four granularities: month, week, day, and hour. For each granularity i∈{month,week,day,hour}, its corresponding embedding is calculated. They are then concatenated together to form the complete embedding for a given time t, defined as:

[0021]

[0022] At the same time, in the spatial dimension, the minimum spatial embedding is first obtained by embedding the minimum longitude and latitude and the maximum longitude and latitude and maximum spatial embedding Where d is the dimension of the embedding vector, and then a linear strategy is used to interpolate any given space l using its upper and lower bounds, defined as:

[0023]

[0024] Where sup(l) and inf(l) are the upper and lower bounds of the given space l, respectively, taking into account spatial information of different granularities. The space is embedded into two granularities, longitude (lat) and latitude (lon). For each granularity i∈{lat,lon}, the corresponding embedding is calculated They are then concatenated together to form the complete embedding for a given space l, defined as:

[0025]

[0026] 2) Perform linear space embedding on the input service interaction sequence to obtain e t ∈R d , e l ∈R d , considering the embedding dimension d as a channel, the embedding-based attention module is defined as:

[0027] e * =Softmax((W Q e) T (W K e))(W V e) T

[0028] where e * ∈R d×1 is the adaptive embedding, WQ ∈R d×d , W K ∈R d×d , W V ∈R d×d is a trainable parameter, and softmax is a normalization function; the above formula represents e(time embedding e t ∈R d Or spatial embedding e l ∈R d ) is input to the attention module to obtain adaptive embedding Then concatenate the two to get the adaptive embedding of the service

[0029] Preferably, step 4 includes the following sub-steps:

[0030] Step 4-1: Constructing the time series graph and time series adjacency matrix

[0031] Given a user node u i and a set of service nodes S u ={s j} n , represents the set of n services visited by user u, and the service interaction sequence L u ={s0, s1, ..., s m}, interaction timestamp T i ={t0, t1, ..., t m}. At any timestamp t k , the access history of user u can be represented as a heterogeneous graph G(t k )=(E(t k ), v u , V(t k )), where v u is the user’s node embedding, V(t k ) is the adaptive embedding of the services accessed by the user, E(t k ) is the edge of the set of user-service interactions weighted by access frequency. In a time window of size w, the graph sequence G = {G(t1), G(t2), G(t3), ..., G(t w )}, for each G(t i ) with real time stamp t i , i∈{1, 2, ..., w} expands its representation to form an element G(t i )=(E(t i ), v u , V(t i ), t i ), edge set E i Only records ti Records of previous user-service interactions.

[0032] For a given graph G(t i )=(E(t i ), v u , V(t i ), t i ), first V(t i ) is expanded to a sequence of w visited services, and the edge weight E(t i ) will be degraded to i one-hot vectors, representing the service index of the current interaction in the time window. In order to maintain the graph topology that can identify the same vertex in the sequence, the value of the one-hot vector is assigned to the extended V(t i ) in the same interaction. Then the i-th adjacency matrix can contain the first w-1 adjacency matrices in the first i-1 rows, and add up the interaction records of the selected services in the i-th row. For each row in the matrix, the sum of the weights is equal to the number of rows, representing discrete time; for each column in the matrix, the sum of the weights represents the historical change of the interaction frequency of each service.

[0033] Step 4-2: Constructing GDE model through graphical differential equation

[0034] GDE model: Given a graph G(t) = (E(t), v u , V(t), t), represents the service adaptive embedding set, The one-hot vector of the edges of the set of user-service interactions weighted by access frequency, where n represents the number of nodes, m represents the number of edges, d1 represents the dimension of node embedding, and d2 represents the dimension of edge embedding. The dynamics of graph G can be expressed as:

[0035] where F G is a graph-valued function, using trainable parameters Θ(t) to fit G w.r.t The derivative of time t∈T. By solving the initial value G(0)=G(E(0),v u , V(0), 0), we can get Y=G(t) at any time t, the formula is as follows:

[0036] In order to apply the GDE model to the service recommendation scenario, time is represented as (i.e., in step 3 ), where d t is the embedding dimension of t. The expanded form of GDE is obtained:

[0037]

[0038] It is important to note that although GDE is written in the form of PDE (Partial Differential Equation), it is essentially an ODE (Ordinary Differential Equation).

[0039] Step 4-3: Graph Incremental Approximation Learning

[0040] A real-time interval [T i , T j ] is represented as {t1, t2, ..., t N}, t1 = T i , t N =T j , N is the number of layers of the ODE neural network, representing the interpolation steps required to form continuity between two discrete samples. Given a graph G(t1), predict G(t N )The formula is as follows:

[0041]

[0042] Using the additivity of integrals, we can get a partial discrete form of the equation:

[0043]

[0044] For the period from t1 to t N The graph increment is denoted as The increment Approximately regarded as t i and t i+1 function and replace the derivative notation. The formula is rewritten as:

[0045]

[0046] Among them I G is a graph-valued function.

[0047] Step 4-4: Perception interval map update

[0048] Learning parameter fitting function I through interval-aware update mechanism of sequence graph G First, calculate each G(t i )’s time series adjacency matrix A=[a1,a2,...,a w ] T . Sort the node embeddings in V(t) to obtain a series of adaptive embeddings as where x i represents the adaptive embedding of the i-th accessed service (i.e., ). Given a time series graph The update formula of incremental approximation is as follows:

[0049]

[0050] The updates of X and u can be viewed as a single-layer GCN, where the aggregation weights are calculated by combining the time series adjacency matrix and the cosine similarity weighting parameter λ. The corresponding weights can be calculated by taking the first-order differentiation of the rows (representing the time axis) and adding them to X i Directly multiply to get X i+1 s is the time at which i+1 The weights of each node embedding in the predicted service embedding are obtained through a time-aware attention mechanism.

[0051] For the range [t i , t i+1 ], the attention mechanism is designed as follows:

[0052]

[0053] in are the trainable parameters at the original time point (biases are omitted for simplicity), t i and t i+1 is the linear interpolation embedding of real time t0 and t1, W T is an additional trainable parameter used to activate time t i and t i+1 , ⊙ represents the element-wise product of two matrices.

[0054] With W Q , W K and W V As time goes by, the time-varying weight h can be calculated by the following formula:

[0055]

[0056] in Indicates that at time t i The last service visited is embedded. and are the user and service at time t i The sequential embedding of .

[0057] Preferably, in step 5, P represents the set of all services in the data set, and the learning process is regularized by calculating the cross entropy loss between the recommendation scores obtained by the inner product between the real label and other label embeddings:

[0058]

[0059] in represents the positive sample, that is, the true label, Denotes other negative samples. The twin loss is applied to each prediction in the time window, and the final training loss function is as follows:

[0060]

[0061] Among them, T window represents a set of timestamps in a fixed time window and λ is a tunable hyperparameter used to weight the regularization loss.

[0062] Using the formula Calculate any given time t N The graph sequence G(t N ), this process can be regarded as t1 and t N For the timing diagram G(t N ) is calculated by recursively calculating G(t i ), where t i is the interpolation timestamp. The timing graph G(t) contains a series of historical accesses X w And the user representation vector u that changes over time. Using the combination of the two to make predictions, the recommendation score of the i-th service is calculated by the inner product:

[0063]

[0064] in represents the adaptive embedding of the service last visited at time t, u t is the user at time t i Sequential adaptive embedding, finally select Pred i The top-K services with the highest probability are selected as candidates in the recommendation list.

[0065] The present invention has the beneficial effects: the present invention explicitly utilizes the continuous changes in user interests by solving the graph differential equation of user interaction behavior. In order to keep the distribution unchanged when solving the graph differential equation, the attention mechanism of time graph sequence and perceptual interval is used to learn the dynamic interest transfer. Restricted to the linear process, this novel update mechanism can track the distribution of the original data. Under this restriction, the model can obtain specific item representations for prediction, which share the same distribution with the services interacting with the user. Finally, twin learning is used in the recommendation process to learn directly from the representation of the ground truth label. By comparing with the positive samples, the probability of future access to the service can be inferred based on the similarity (i.e., mean square error) between the high-dimensional representations of the corresponding services. The present invention solves the problem of insufficient utilization of behavior sequence data and difficulty in fusing auxiliary information. The present invention shows through experiments on real data sets that the service modeling and recommendation method based on category-aware graph neural network has better recommendation capabilities than traditional models, and exceeds traditional service recommendation algorithms in multiple indicators (Precision, Recall, etc.). BRIEF DESCRIPTION OF THE DRAWINGS

[0066] Figure 1 A model diagram of an embodiment of a service recommendation method based on graph differential equations and twin learning in the present invention.

[0067] Figure 2 Schematic diagram of the graph differential equation graph network structure for service recommendation in the implementation of the present invention. DETAILED DESCRIPTION

[0068] The service recommendation method based on graph differential equations and twin learning provided by the present invention will be specifically described below. The present invention provides a service recommendation method based on graph differential equations and twin learning, and its model diagram is as follows: Figure 1 As shown, the following steps are included:

[0069] Step 1: Input the user's historical service interaction data, where the interaction data includes user ID, service ID, service information, and interaction time.

[0070] Step 2: Read and process the user's service interaction behavior data; sort the interaction records of each user according to the timestamp to obtain each user behavior sequence file; each behavior is a service interaction sequence of a certain user. In each service interaction sequence, the service IDs and corresponding categories that the corresponding user u has interacted with are sorted in the order of the interaction time, separated by commas; the format is S u ={(ID of service 1),(ID of service 2),...,(ID of service n)}={(s u,1 ), (s u,2 ),...,(s u,n )}.

[0071] Step 3, Sequence Modeling and Extraction: Use linear spatiotemporal embedding and embedding-based self-attention modules to regularize and generate adaptive embeddings. In order to adapt the representation of time and space to our GDE model, spatiotemporal embeddings may be represented in a continuous form, which hinders the traditional gridding method of time and space intervals. Therefore, we adopt upper and lower bounds for spatiotemporal context embedding interpolation. In the time dimension, we first get the minimum time embedding by embedding the minimum time and maximum time. and maximum temporal embedding Where d is the dimension of the embedding vector, and then a linear strategy is used to interpolate the upper and lower bounds of any given time t, defined as Where sup(t) and inf(t) are the upper and lower bounds of a given time t, respectively, taking into account time information of different granularities. Time is embedded in four granularities: month, week, day, and hour. For each granularity i∈{m, w, d, h}, the corresponding embedding is calculated. They are then concatenated together to form the complete embedding at a given time t, defined as Similarly in the spatial dimension, we first get the minimum spatial embedding by embedding the minimum longitude and latitude and the maximum longitude and latitude and maximum spatial embedding Where d is the dimension of the embedding vector, and then a linear strategy is used to interpolate any given space 1 using its upper and lower bounds, defined as: Where sup(l) and inf(l) are the upper and lower bounds of the given space l, respectively, taking into account spatial information of different granularities. The space is embedded in two granularities, longitude and latitude. For each granularity i∈{lat,lon}, the corresponding embedding is calculated They are then concatenated together to form the complete embedding for the given space 1, defined as To better construct our graph differential equation, we introduce an embedding-based attention module to regularize and generate adaptive embeddings, which can greatly help CDE to better capture the content characteristics in POI embeddings. Given a certain embedding e∈R d , considering the embedding dimension d as a channel, the embedding-based attention module is defined as e * =Softmax((W Q e) T (W K e))(W V e) T , where e * is the adaptive embedding, W Q , WK , W V is a trainable parameter, softmax is a normalization function; embed time into e t ∈R d and spatial embedding l ∈R d Substitute e into the above self-attention module formula to get Then combine the two to get the adaptive embedding of the service For example, the adaptive embedding of service s1 is x1.

[0072] Step 4: Build a model through graph differential equations, and use time graph sequences and interval-aware attention mechanisms to learn dynamic interest transfer. The core is to use graph differential equations to infer the number of unrecorded visits between intervals to alleviate the impact of data sparsity in POI recommendation. Figure 2 shown.

[0073] Sub-step 4-1: Construct a time series graph and a time series adjacency matrix. Given a user node u and a set of service nodes S u ={s j} n , indicating that user u has visited n services, and the service interaction sequence L u ={s0, s1, ..., s m}, interaction timestamp T i ={t0, t1, ..., t m}. At any timestamp t k , the user access history can be represented as a heterogeneous graph G(t k )=(E(t k ), v u , V(t k )), where v u is the user’s node embedding, V(t k ) is the service embedding accessed by the user, E(t k ) is the edge of the set of user-service interactions weighted by visit frequency.

[0074] In order to facilitate implementation and limit computing resources, we set a fixed window size to record the history of user-service interactions. Let this window size be w, then the length of the graph sequence is w, and the graph sequence G = {G(t1), G(t2), G(t3), ..., G(t w )}, for each G(t i ) with real time stamp t i Expand its representation and form the element G(t i )=(E(t i ), v u , V(ti ), t i ), edge set E i Only records t i Previous user-service interaction records. Each user's interaction record can build a graph sequence.

[0075] For a given graph G(t i )=(E(t i ), v u , V(t i ), t i ), first V(t i ) is expanded to a sequence of w visited services, and the edge weight E(t i ) will be degraded to i one-hot vectors, representing the service index of the current interaction in the time window. In order to maintain the graph topology that can identify the same vertex in the sequence, the value of the one-hot vector is assigned to the extended V(t i ) in the same interaction. Then the i-th adjacency matrix can contain the first w-1 adjacency matrices in the first i-1 rows, and add up the interaction records of the selected services in the i-th row. For each row in the matrix, the sum of the weights is equal to the number of rows, representing discrete time; for each column in the matrix, the sum of the weights represents the historical change of the interaction frequency of each service.

[0076] Sub-step 4-2: Construct the graph differential equation for service recommendation. Given a graph represents the service adaptive embedding set, The one-hot vector of the edge representing the set of user-service interactions weighted by access frequency, where n represents the number of nodes, m represents the number of edges, d1 represents the dimension of node embedding, and d2 represents the dimension of edge embedding. GDE is expressed as

[0077]

[0078] where F G is a graph-valued function, using trainable parameters Θ(t) to fit G w.r.t The derivative of time t∈T. By solving the initial value G(0)=G(E(0),v u , V(0), 0), we can get Y=G(t) at any time t, the formula is as follows:

[0079] In this embodiment, in order to apply the GDE model to the service recommendation scenario, we should first expand the above formula from the ODE form to the PDE form and adjust it for the high-dimensional representation of time t. Time is represented as where d t is the embedding dimension of t. The expanded form of GDE is obtained:

[0080] It should be noted that although GDE is written in the form of PDE (partial differential equation), it is essentially an ODE (ordinary differential equation).

[0081] Sub-step 4-3, graph incremental approximate learning, in order to alleviate the uneven distribution of user samples, we propose a graph incremental approximate learning method to replace derivative fitting, a real-time interval [T i , T j ] is represented as {t1, t2, ..., t N}, t1 = T i , t N =T j , N is the number of layers of the ODE neural network, representing the interpolation steps required to form continuity between two discrete samples. Given a graph G(t1), predict G(t N )The formula is as follows: Using the additivity of integrals, we can get a partial discrete form of the equation: For the period from t1 to t N The graph increment is denoted as The increment Approximately regarded as t i and t i+1 function and replace the derivative notation. The formula is rewritten as:

[0082] Sub-step 4-4: Fitting function I using learnable parameters G , calculate each G(t i )’s time series adjacency matrix A=[a1,a2,...,a w ] T . Sort the node embeddings in V(t) to obtain a series of adaptive embeddings as where x i represents the adaptive embedding of the i-th visited service. Given a time series graph right The update of X and u can be viewed as a single-layer GCN, where the aggregation weights are calculated by combining the time series adjacency matrix and the cosine similarity weighting parameter λ. The corresponding weights can be calculated by taking the first-order differentiation of the rows (representing the time axis) and adding them to X i Directly multiply to get X i+1 h is at time t i+1The weights of each node embedding in the predicted service embedding are obtained through a time-aware attention mechanism. i , t i+1 ] uses an attention mechanism for each interval, where are the trainable parameters at the original time point (biases are omitted for simplicity), t i and t i+1 is the linear interpolation embedding of real time t0 and t1, W T is an additional trainable parameter used to activate time t i and t i+1 ⊙ represents the element-wise product of two matrices. Q , W K and W V As time goes by, the time-varying weight h can be calculated by the following formula: in Indicates the last accessed service embedding time t i , and are the user and service at time t i The sequential embedding of .

[0083] 6. Step 5: Model training and service recommendation. Using formula Calculate any given time t N The graph sequence G(t N ), this process can be regarded as t1 and t N For the timing diagram G(t N ) is calculated by recursively calculating G(t i ), where t i is the interpolation timestamp. The timing graph G(t) contains a series of historical accesses X w And the user representation vector u that changes over time. Using the combination of the two to make predictions, the recommendation score of the i-th service is calculated by the inner product: Select Pred i The top-K services with the highest probability are selected as candidates in the recommendation list. In the recommendation task, P is represented as the set of all services in the dataset, and the learning process is regularized by calculating the cross entropy loss between the recommendation scores obtained by the inner product between the true label and other label embeddings: in represents the positive sample, that is, the true label, Denotes other negative samples. The twin loss is applied to each prediction in the time window, and the final training loss function is as follows: Where T window represents a set of timestamps in a fixed time window and λ is a tunable hyperparameter used to weight the regularization loss.

[0084] The embodiments of the present invention are described in detail above with reference to the accompanying drawings, but the present invention is not limited to the described embodiments. For those skilled in the art, various changes, modifications, substitutions and variations of these embodiments including components are made without departing from the principles and spirit of the present invention, and still fall within the scope of protection of the present invention.

Claims

1. A service recommendation method based on graph differential equations and twin learning, characterized in that: The following steps are involved: Step 1: Obtain the user's historical service interaction data; Step 2: Sort the historical service interaction data of each user in chronological order according to the timestamp to obtain a behavior sequence file for each user, in which each line corresponds to a service interaction sequence of one user; Step 3: Linear spatiotemporal embedding is performed on the service interaction sequence, and adaptive embedding is generated through a self-attention module based on the linear spatiotemporal embedded service interaction sequence; Step 4: Construct a GDE model through graph differential equations, and use the attention mechanism of time graph sequence and perception interval to learn dynamic interest transfer; Step 4-1: Constructing the time series graph and time series adjacency matrix Given a user node u and a set of service nodes S u ={s j } n , indicating that user u has visited n services, and the service interaction sequence L u ={s0, s1, ..., s m }, interaction timestamp T i ={t0, t1, ..., t m }, at any timestamp t k , the user access history is represented as a heterogeneous graph G(t k )=(E(t k ), v u , V(t k )), where v u is the user’s node embedding, V(t k ) is the adaptive embedding of the services accessed by the user, E(t k ) is the edge of the set of user-service interactions weighted by access frequency. In a time window of size w, the graph sequence G = {G(t1), G(t2), G(t3), ..., G(t w )}, for each G(t i ) with real time stamp t i , i∈{1, 2, ..., w} expands its representation to form an element G(t i )=(E(t i ), v u , V(t i ), t i ), edge set E i Only records t i Records of previous user-service interactions; For a given graph G(t i )=(E(t i ), v u , V(t i ), t i ), first V(t i ) is expanded to a sequence of w visited services, and the edge weight E(t i ) will be degraded to i one-hot vectors, representing the service index of the current interaction in the time window, and the value of the one-hot vector is assigned to the expansion V(t i ), the i-th adjacency matrix can contain the first w-1 adjacency matrices in the first i-1 rows, and add the interaction records of the selected services in the i-th row. For each row in the matrix, the sum of the weights is equal to the number of rows, representing discrete time; for each column in the matrix, the sum of the weights represents the historical change of the interaction frequency of each service; Step 4-2: Build a GDE model for service recommendation scenarios GDE model: Given a graph represents the service adaptive embedding set, Represents the one-hot vector of the edge of the set of user-service interactions weighted by access frequency, where n represents the number of nodes, m represents the number of edges, d1 represents the dimension of node embedding, and d2 represents the dimension of edge embedding. The GDE model is expressed as: where F G is a graph-valued function, using trainable parameters Θ(t) to fit G w.r.t The derivative of time t∈T is d t is the embedding dimension of t, by solving the initial value G(0)=G(E(0),v u , V(0), 0), we can get Y=G(t) at any time t, the formula is as follows: Step 4-3: Graph Incremental Approximation Learning A real-time interval [T i , T j ] is represented as {t1, t2, ..., t N }, t1 = T i , t N =T j , N is the number of layers of the ODE neural network, representing the interpolation steps required to form continuity between two discrete samples. Given a graph G(t1), predict G(t N )The formula is as follows: Using the additivity of integrals, we can get a partial discrete form of the equation: For the period from t1 to t N The graph increment is denoted as ΔG. The increment Approximately regarded as t i and t i+1 function and replace the derivative notation, the formula is rewritten as: Among them I G is a graph-valued function, Step 4-4: Perception interval map update Learning parameter fitting function I through interval-aware update mechanism of sequence graph G , first calculate each G(t i ) time series adjacency matrix Sort the node embeddings in V(t) to obtain a sequence of adaptive embeddings as where x i Represents the adaptive embedding of the i-th visited service, given a time series graph The update formula of incremental approximation is as follows: The updates of X and u are single-layer GCNs, where the aggregation weights are calculated by combining the time series adjacency matrix and the cosine similarity weighting parameter λ. The corresponding weights can be calculated by taking the first-order differentiation of the rows and adding them to X. i Directly multiply to get X i+1 means that s is at time t i+1 The weight of each node embedding in the predicted service embedding; Step 5: Twin learning and service recommendation of GDE model. The learning process is regularized by calculating the cross entropy loss between the recommendation scores obtained by the inner product between the true label and the other label embeddings: in represents the positive sample, that is, the true label, represents other negative samples, P represents the set of all services in the dataset, and the twin loss is applied to each prediction in the time window. The final training loss function is as follows: Among them, T window represents a set of timestamps in a fixed time window, λ is a tunable hyperparameter used to weight the regularization loss, Using the formula Calculate any given time t N The graph sequence G(t N ), this process can be regarded as t1 and t N For the interpolation between the timing diagram G(t N ) is calculated by recursively calculating G(t i ), where t i is the interpolation timestamp, and the timing graph G(t) contains a series of historical accesses X w and the user representation vector u that changes over time. The combination of the two is used to make predictions. The recommendation score of the i-th service is calculated by the inner product: in represents the adaptive embedding of the service last visited at time t, u t is the user at time t i Sequential adaptive embedding, finally select Pred i The top-K services with the highest probability are selected as candidates in the recommendation list.

2. The service recommendation method based on graph differential equations and twin learning according to claim 1, characterized in that: In step 1, the historical service interaction data includes user ID, service ID, service information and interaction time.

3. The service recommendation method based on graph differential equations and twin learning according to claim 1, characterized in that: In step 2, in each service interaction sequence, the service IDs and corresponding categories that the corresponding user u has interacted with are sorted in the order of interaction time, separated by commas; the form is S u ={(ID of service 1),(ID of service 2),...,(ID of service n)}={(s u,1 ), (s u,2 ),...,(s u,n )}.

4. The service recommendation method based on graph differential equations and twin learning according to claim 1, characterized in that: In step 3, the linear space-time embedding method is: In the time dimension, we first embed the minimum time and maximum time to get the minimum time embedding. and maximum temporal embedding Where d is the dimension of the embedding vector, and then a linear strategy is used to interpolate the upper and lower bounds of any given time t to obtain the linear time embedding e t , e t Defined as: Where sup(t) and inF(t) are the upper and lower bounds of a given time t, respectively; In the spatial dimension, we first embed the minimum longitude and latitude and the maximum longitude and latitude to get the minimum spatial embedding. and maximum spatial embedding Where d is the dimension of the embedding vector, and then a linear strategy is used to interpolate any given space using its upper and lower bounds, defined as: Where sup(l) and inf(l) are the upper and lower bounds of the given space, respectively.

5. The service recommendation method based on graph differential equations and twin learning according to claim 4, characterized in that: In step 3, the linear time embedding e t The definition of takes into account time information of different granularities. Time is embedded into four granularities: month, week, day, and hour. For each granularity i∈{month, week, day, hour}, its corresponding embedding is calculated. They are then concatenated together to form the complete embedding for a given time t, defined as:

6. The service recommendation method based on graph differential equations and twin learning according to claim 5, characterized in that: In step 3, the linear space is embedded into e l , considering spatial information of different granularities, the space is embedded into two granularities, namely longitude lat and latitude lon. For each granularity i∈{lat,lon}, the corresponding embedding is calculated They are then concatenated together to form the complete embedding of the given space, defined as:

7. The service recommendation method based on graph differential equations and twin learning according to claim 6, characterized in that: In step 3, the input service interaction sequence is embedded into linear space to obtain e t ∈R d , e l ∈R d , considering the embedding dimension d as a channel, the expression of the self-attention module is: where e * ∈R d×1 is the adaptive embedding, W Q ∈R d×d , W K ∈R d×d , W V ∈R d×d is a trainable parameter, and softmax is a normalization function; Embedding time into e t ∈R d and spatial embedding l ∈R d Substitute e into the above self-attention module formula to get Then concatenate the two to get the adaptive embedding of the service 8. The service recommendation method based on graph differential equations and twin learning according to claim 7, characterized in that: In step 4-4, the weight h is obtained through a time-aware attention mechanism. For the range [t i , t i+1 ], the attention mechanism is as follows: in is the trainable parameter at the original time point, t i and t i+1 is the linear interpolation embedding of real time t0 and t1, W T is an additional trainable parameter used to activate time t i and t i+1 , ⊙ represents the element-wise product of two matrices, With W Q , W K and W V As time goes by, the time-varying weight h is calculated by the following formula: in Indicates that at time t i The service adaptive embedding last visited, and are the user and service at time t i Sequential adaptive embedding of .

Citation Information

Patent Citations

  • Recommendation method based on graph twin network

    CN111881342A

  • Intelligent path recommendation method based on GCN and reinforcement learning

    CN113807578A