Diet scheme recommendation method based on space-time knowledge graph and user future state guidance

By building a user's space-time knowledge graph and combining deep learning methods, the user's space-time and future state characteristics are extracted, and the existing dietary recommendation system is difficult to utilize space-time information and future state, and a higher personalized and accurate dietary recommendation is achieved.

CN119626457APending Publication Date: 2025-03-14BEIJING UNIV OF TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411812605.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-10
Publication Date
2025-03-14

AI Technical Summary

Technical Problem

The existing dietary recommendation system is difficult to make full use of the spatial and temporal information and the evolution of user's future status, resulting in poor personalized recommendations.

Method used

By constructing the user's time and space knowledge graph, using graph convolution neural network and graph attention mechanism to extract spatial features, combining two-way long and short-term memory networks to extract temporal features, and finding dishes similar to users through comparative learning methods to generate personalized dietary recommendations.

Benefits of technology

It improves the accuracy and personalization of diet recommendations, and can provide more relevant and forward-looking dietary advice based on dynamic changes in user behavior and future status predictions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119626457A_ABST
    Figure CN119626457A_ABST
Patent Text Reader

Abstract

The invention discloses a diet scheme recommendation method based on a space-time mapping knowledge domain and user future state guidance, and belongs to the field of mapping knowledge domains. The technologies of deep learning, a graph convolutional neural network, a graph self-attention mechanism, comparative learning and the like are specifically designed. According to the method, firstly, spatial information of users and dishes is modeled by using a graph convolutional neural network and a graph self-attention mechanism; and then modeling the spatial information obtained by modeling by using a bidirectional long short-term memory network (BiLSTM) to obtain spatio-temporal information of the user and the dishes. On the basis, the health state of the user is calculated through a full connection layer, and the health state is combined with the spatio-temporal information. And finally, by using a comparative learning method, the system can screen out a recommendation scheme which most meets the personalized demand of the user from a large number of diet schemes.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Based on deep learning technology, the present invention proposes a diet plan recommendation method that combines user spatiotemporal knowledge graph and future health status prediction. First, the spatial information of users and dishes is modeled using graph convolutional neural network and graph self-attention mechanism. Then, the spatial information obtained by modeling is modeled using a long short-term memory network (LSTM) to obtain the spatiotemporal information of users and dishes. On this basis, the user's health status is calculated through a fully connected layer and merged with the spatiotemporal information. Finally, using the comparative learning method, the system can filter out the recommended plan that best meets the user's personalized needs from a large number of diet plans. The present invention belongs to the field of knowledge graphs, and specifically designs deep learning, comparative learning and other technologies. Background Art

[0002] Solution recommendation technology provides personalized solutions by analyzing user needs, historical behaviors and related data, and has been widely used in many fields. In the medical field, personalized treatment plans based on the patient's medical history, genetic data and lifestyle can improve treatment effects and reduce the waste of medical resources; in economic management, analyzing the company's financial and market environment to recommend the optimal investment portfolio and management strategy can help companies make more rational decisions under complex market conditions; in the transportation field, intelligently recommend the safest traffic emergency plan, optimize traffic management, reduce accident rates, and improve travel safety. Diet recommendation technology is also an important application field for solution recommendation. Based on information such as the user's health status, eating habits, nutritional needs, etc., the diet recommendation system can provide personalized diet plans to help users improve their health and prevent diseases.

[0003] Early diet recommendation systems mainly relied on the experience and knowledge of nutrition experts, and usually used preset rules to guide the choice of diet plans. These rules are formulated by experts based on their long-term practical experience and can provide effective help for common dietary needs and health conditions. Expert knowledge has important reference value for standardized diet plans. However, such rule-based systems have some limitations, especially the lack of systematicity and flexibility in dealing with complex individual differences. These systems are often difficult to expand and cannot adapt to changes in new or complex situations, resulting in poor performance in providing personalized diet plans. For example, individuals' dietary preferences, health goals, and responses to food may vary greatly, and rule-based systems often find it difficult to accurately adapt to these personalized needs. Therefore, traditional rule-based diet recommendation methods are difficult to meet the needs of modern society for personalized and dynamic dietary advice.

[0004] With the rapid development of artificial intelligence technology, especially the innovation of deep learning in recent years, personalized recommendation systems have been widely used in many fields. The food field is no exception. Existing studies represent dish entities and their relationships in two different low-dimensional continuous vector spaces, calculate the semantic similarity between dishes, and incorporate the semantic similarity into collaborative filtering recommendations for recommendation. Others further introduce multi-dimensional factors such as season, region, and age to more comprehensively meet user needs. It can be seen that many studies on food recommendation systems based on deep learning have demonstrated their feasibility and have achieved remarkable results in practical applications.

[0005] Most existing diet recommendation systems focus on users' immediate needs and historical preferences, but often fail to make full use of spatiotemporal information, and do not consider the evolution of users' future states, which limits the improvement of personalized recommendation effects. The present invention introduces spatiotemporal information to help the recommendation system better capture the dynamic changes of user behavior, thereby improving the accuracy and personalization of recommendations. Based on users' behavior patterns and preferences at different times and places, the recommendation system can provide more relevant diet recommendations and enhance user experience. At the same time, the present invention combines the prediction of users' future states to further enhance the long-term adaptability of the recommendation system. By predicting users' future states, the system can not only meet current needs, but also provide users with forward-looking dietary advice to help them make healthier dietary choices.

[0006] In order to further improve the effect of spatiotemporal information and future state prediction, the present invention introduces a spatiotemporal knowledge graph and combines it with a deep learning method to recommend solutions. Specifically, the present invention proposes a diet recommendation method based on a spatiotemporal knowledge graph and user future state guidance. First, based on user profile data, a spatiotemporal knowledge graph of the user at different times and places is constructed. Then, a graph convolutional neural network (GCN) and a graph attention network (GAT) are used to extract spatial features in the spatiotemporal graph. Next, a bidirectional long short-term memory network (BiLSTM) is used to extract temporal change features. Based on these features, a classifier is constructed to predict the user's future dietary needs. Next, combining the user's future state features with the temporal change features, comparative learning is used to identify the dishes closest to the current user, and the dishes are sorted according to similarity, and finally the diet plan that best meets the user's needs is recommended to the user.

[0007] With this approach, the system can not only provide personalized immediate dietary recommendations, but also dynamically adjust the recommendations based on user changes over the long term, ensuring that the dietary recommendation system remains effective in a changing environment. Summary of the invention

[0008] The present invention mainly solves how to use the spatiotemporal characteristics of objects in solution recommendation to better provide personalized services. Specifically, the present invention proposes an intelligent recommendation method based on spatiotemporal knowledge graph and system future state guidance. First, by analyzing user profile data, the spatiotemporal knowledge graph of users at different times is constructed. Next, the graph convolutional neural network (GCN) and the graph attention network (GAT) are used to extract the spatial features of the spatiotemporal knowledge graph at each moment. Subsequently, the bidirectional long short-term memory network (BiLSTM) is used to extract the temporal change features at different time points, and a classifier is constructed using a fully connected layer based on these features to predict the user's future state features. Next, the user's future state features are combined with the user's temporal change features and input into the similarity archive retrieval module to find dishes similar to the current user by comparative learning. Finally, the user's dishes are sorted according to their closeness to each other, and the N dishes closest to the current user are selected to generate a personalized solution recommended to the current user.

[0009] Through the above steps, the present invention effectively integrates multiple feature information and constructs a high-quality knowledge graph, providing a solid foundation for subsequent decision support and recommendation systems, aiming to enhance the intelligence and practicality of the system.

[0010] Step 1: Data preprocessing and knowledge graph construction

[0011] The purpose of knowledge graph preprocessing is: ① unify data format and structure; ② improve data quality and consistency. When constructing a knowledge graph, data usually comes from multiple heterogeneous sources, such as user profiles, recipe libraries, health records, etc., and may have different formats (such as RDF, OWL, JSON, etc.) and structures (such as attribute-value pairs, triples). Especially when data comes from different moments, heterogeneity and time differences can easily lead to data inconsistency, which affects subsequent knowledge reasoning and recommendation results. Therefore, it is very important to unify data formats and structures, which ensures the effective integration of different data sources and improves the availability and query efficiency of knowledge graphs. In addition, the data in the knowledge graph often contains missing values ​​and noise, especially user behavior data, preference information, and health indicators, which will affect the overall quality of the graph. For example, information such as the user's age, eating habits, and allergy history may be incomplete or erroneous, resulting in a decrease in the accuracy of recommendations. Through data cleaning and filling, redundant and erroneous records can be removed to ensure the accuracy and completeness of information in the graph, especially when dynamically updating and recording data at different moments. Improving data quality and consistency can not only reduce the interference of external factors on the reasoning process, but also enable the recommendation system to better capture the semantic relationship between users and between users and dishes, thereby improving the effect of personalized diet recommendations.

[0012] Step 2: Spatial feature extraction

[0013] This step extracts spatial features from preprocessed data to effectively model the relationships between nodes, thereby obtaining a richer graph structure representation.

[0014] Step 2.1 Two-layer graph convolutional network (GCN): In this part, the preprocessed user and dish data are input into the two-layer graph convolutional neural network. The features of each node include the user's basic information, taste preferences, dietary history, and current dietary choices. The features of the dish node include information such as the category of the dish and the composition of ingredients. GCN combines the features of each node with the features of its neighboring nodes through convolution operations to capture the spatial relationship between nodes. For example, a user's health condition may affect his or her preference for low-salt and low-fat dishes, and GCN can effectively model this relationship. Through the multi-layer GCN structure, the method can extract spatial features with contextual information. These features not only reflect the characteristics of each node itself, but also take into account the relationship with other nodes (such as similar users or similar dishes), thereby enhancing the expressive power of the features.

[0015] Step 2.2 Graph Attention Network (GAT): In this part, the features extracted by GCN are input into the Graph Attention Network (GAT). GAT uses the attention mechanism to calculate the attention weights of each node with its neighboring nodes. For a diet recommendation system, some nodes (such as a user's health status) may have a great influence on the recommendation results, while other nodes (such as similar dishes) may have less influence on the user. GAT dynamically adjusts the influence of neighbor nodes and pays more attention to neighbor nodes that are important in a specific context. For example, a user's taste preference in a certain season may be different from other seasons. GAT can adaptively adjust the focused features according to time and context, thereby improving the accuracy and relevance of spatial features. This flexibility enables the method to provide more accurate recommendations based on the specific needs of each user. By combining these two steps, a more comprehensive spatial feature representation can be obtained, preparing for subsequent temporal feature extraction and recommendation schemes.

[0016] Step 3: Temporal feature extraction

[0017] This step extracts temporal features by combining spatial features and users' temporal changes to obtain a complete representation of spatiotemporal information.

[0018] Step 3.1 LSTM time series change feature extraction: The spatial features extracted by the graph convolutional network and the graph attention mechanism are input into the bidirectional long short-term memory network (BiLSTM) for processing. BiLSTM can effectively capture the temporal dependency in time series data, taking into account the past and future contextual information, thereby extracting rich temporal features to reflect the dynamic changes of the solution.

[0019] Step 3.2: Build a classifier: Based on the time features extracted from BiLSTM, a user status classifier is built using a fully connected layer to predict the user's future health status. Through this classifier, the extracted health status features can be converted into prediction results, helping the system to provide personalized recipe recommendations for users. This process not only considers the user's immediate needs, but also predicts possible changes in their dietary preferences in the future, thereby providing more accurate recipe selection in subsequent recommendations and improving user satisfaction and recommendation results.

[0020] Step 3.3 Combining future state features with the user's temporal change features: Combine the predicted future state features with the user's temporal change features to form a complete spatiotemporal information representation of each user profile. This representation combines the characteristics of the user's health status and other time and space dimensions, providing a comprehensive information basis for subsequent recipe recommendations. Through this stage of processing, the system can gain an in-depth understanding of the user's dietary needs and preference changes at different times, thereby providing users with more personalized and accurate recipe recommendations, improving the effectiveness of the recommendation system and user experience. Through this stage of processing, the spatiotemporal features can be fully utilized to provide stronger support for personalized solution recommendations.

[0021] Step 4: Similar file search

[0022] In this stage, the similarity calculation of recipes in the recipe recommendation system is optimized through contrastive learning to improve the recommendation performance. Using the spatiotemporal feature representation extracted from BiLSTM, we hope that the feature distance between users and the dishes they have praised is as small as possible, and we also hope that the feature distance between users and the dishes they have not praised is as large as possible. To this end, a contrastive loss function is introduced. The model weights are continuously adjusted through the back-propagation algorithm to minimize the loss, thereby improving the discriminative ability of the method. This process enables the system to better capture the complex relationships between different recipes, and ultimately provide users with more personalized and accurate recipe recommendations.

[0023] Step 5: Personalized recommendation generation

[0024] In this stage, the similarity score between the current user and historical recipes is calculated based on the optimized features. First, the historical recipes are sorted according to the similarity score to identify the recipes that are most similar to the current user's taste, health status, and other relevant preferences. Then, relevant information is extracted from each Top-K similar recipe to provide reference for the user. Finally, based on the selected Top-K recipes, their historical feedback and effects are extracted to generate a personalized recipe recommendation for the current user. This process ensures the accuracy and practicality of the recommendation results, allowing the recommendation system to provide more targeted recipe suggestions based on the user's specific needs and preferences.

[0025] Compared with the prior art, the present invention has the following beneficial effects:

[0026] 1. Comprehensive consideration of spatiotemporal features: The system extracts spatial features through graph convolutional networks and graph attention mechanisms, and uses bidirectional long short-term memory networks to extract temporal features to ensure that the recommendation scheme can reflect dynamic changes.

[0027] 2. Combined with predicted sequence scoring: Integrate the predicted future state into the recommendation process so that the recommendation scheme is not only based on the similarity of historical cases, but also fully considers the user's future state information, thereby enhancing the applicability of the recommendation scheme.

[0028] 3. Optimize similarity calculation: The contrastive learning method is used to optimize the calculation of object similarity, which improves the method's ability to discern complex relationships between individuals, thereby improving the accuracy and practicality of recommendations.

[0029] The combination of these innovations gives the present invention a significant advantage in recipe recommendation, which can better meet the individual needs of users and improve the user experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] Figure 1 It is the overall step flow chart of the present invention DETAILED DESCRIPTION

[0031] In order to enable persons skilled in the art to better understand the solutions of the embodiments of the present invention, the embodiments of the present invention are further described in detail below in conjunction with the accompanying drawings and implementation modes.

[0032] According to the above description, the following is a specific implementation process, but the scope of protection of this patent is not limited to this implementation process.

[0033] The specific steps include:

[0034] Step 1: Data preprocessing and knowledge graph construction

[0035] In this study, a detailed analysis of user and dish characteristics was conducted, with the main purpose of building a knowledge graph that can reflect the personalized needs of users and the characteristics of recipes. Since the characteristics of users and dishes are relatively rich, the traditional static information is emphasized when designing the knowledge graph, using age, gender, interests, user dish ratings, and location as static features, and also adding current health status and time as features. For dishes, ingredients, difficulty, and cuisine are used as features. In order to better establish the connection between users and dishes, these relationships are established through the user's "interaction records". The interactive relationship connects users and dishes through ratings, and the ratings are used as edge weights to indicate the user's preference for the dishes. Two types of data are extracted from the JSON data source: user data and dish data, and integrated into a structure suitable for building a knowledge graph. The characteristics of user nodes and dish nodes are passed to the graph through the ndata and edata attributes, and the weights of the edges in the graph are set through the user dish ratings. DGL is used to implement the construction and processing of the graph structure. Finally, a heterograph method is used to construct a heterogeneous graph containing two types of nodes: users and dishes. Node features and edge weights are passed in the graph. These structured data operations provide a solid foundation for subsequent graph neural network analysis. The final matrix can be expressed by the following formula:

[0036] A∈R (N+M)*(N+M) , G={X u , X p , A}

[0037] Where X u represents the user feature matrix, N is the number of users, assuming 3000 users (this number is for example, the number of users in actual applications can vary according to needs). D1 represents the user feature dimension, which is 128 dimensions here, X p represents the dish feature matrix, M is the number of dishes, assuming 400 dishes (this number is for example, the number of dishes in actual applications can vary according to demand), D2 represents the dish feature dimension, here is 128 dimensions. A represents the user's evaluation matrix of the dish, missing values ​​are replaced by 0, and G represents the entire feature map

[0038] Step 2: Spatial feature extraction

[0039] This step is divided into two parts. Rich spatial features are extracted through graph convolution and graph self-attention mechanism to enhance the expressive power of the knowledge graph.

[0040] Step 2.1: Graph Convolutional Network (GCN): In this study, different convolution kernels are used for users and dishes to process the features of user and dish nodes. The user and dish features are concatenated to construct an overall feature matrix:

[0041]

[0042] X represents the overall feature matrix. Perform graph convolution on the overall feature matrix:

[0043]

[0044] in Add self-loops to the adjacency matrix of A. for The degree matrix of (diagonal matrix, the elements are the degrees of the nodes). is the learnable weight matrix of the first layer, and f1 represents the dimension of the output features of the first layer. Here, f1 is set to 128. is the feature matrix of the first layer output. For the second layer of convolution, we have:

[0045]

[0046] in Here f2 represents the dimension of the second layer output feature, which is 64. (2) is the feature matrix of the second layer.

[0047] Step 2.2 Graph Attention Network (GAT): In this part, the extracted features are input into the graph self-attention network to further aggregate neighborhood information and improve feature expression capabilities. (2) Perform a linear transformation, project it into the new feature space, and generate the Z matrix:

[0048] Z=H (2) W (3)

[0049] in f3 is the output feature number, here it is 32, Represents the matrix after linear transformation. Calculate the attention score between each pair of nodes i and j and splice their features together and calculate the attention weight through a weight matrix, and then use the softmax function to normalize the features of each pair of nodes. Finally, the final matrix is ​​obtained by weighted average Step 3: Temporal feature extraction

[0050] This step extracts temporal features by combining spatial features and users' temporal changes to obtain a complete representation of spatiotemporal information.

[0051] Step 3.1: LSTM time series feature extraction: In this part, the spatial feature H (3)Input into the Bidirectional Long Short-Term Memory Network (BiLSTM) for processing to extract time series change features:

[0052] h LSTM =BiLSTM(H (3) )

[0053] in f4 is the number of BiLSTM output nodes, which is 512 here, and the number of BiLSTM hidden layers is 1.

[0054] Step 3.2 Build the classifier:

[0055] From h LSTM Separate dish information and user information in:

[0056] X' u =h LSTM [:N,:],X' p =[N:,:]

[0057] Get X' u and X' p . And the user matrix is ​​used to classify the user status through the fully connected layer to obtain the user's future status prediction result:

[0058] X future =FullConnect(X' u )

[0059] in f5 represents the number of types of future states, assuming there are 5 states (this number is for example, the number of states in actual applications can vary according to needs)

[0060] Step 3.3 combines the future state characteristics with the user's temporal change characteristics:

[0061] The predicted future state feature X future The time series variation feature X' u Combined to form the final output vector H final

[0062] X final_u =Concate(X future , X' u )

[0063] The concatenation operation means concatenating two vectors on the same dimension. Specifically, the 512 dimension of the first vector and the f5 dimension of the second vector are combined to obtain

[0064] Step 4: Similar file search

[0065] In this stage, the contrast loss function is used to optimize the similarity calculation between individual features to improve the individual similarity discrimination ability of the method. If two users have a high similarity and they both give positive comments on certain dishes, it is hoped that the features of these dishes can be clustered together so that these dishes can be recommended to similar users in the recommendation system. At the same time, similar users should give similar ratings to similar dishes.

[0066] Step 4.1 Dish feature conversion and similarity calculation:

[0067] First, use the fully connected layer to transform the dish features:

[0068] X final_p =Fullconnect(X' p )

[0069] .in

[0070] Then the Euclidean distance is used to measure the similarity. The Euclidean distance formula is: Distance(u i , p j )=||U i -P j ||2

[0071] in,

[0072] represents the feature vector of user i, Represents the feature vector of dish j.

[0073] Step 4.2 defines the loss function:

[0074] Use contrastive loss to minimize the feature distance between similar users and dishes they have rated, and maximize the feature distance between users and dishes they have not rated:

[0075]

[0076] Among them U i represents the feature vector of user i, P j represents the feature vector of dish j. A[i,j] represents the rating of dish j by user i. A positive value indicates a favorable rating, and 0 or negative value indicates a negative rating. Δ represents a threshold value used to control the distance between positive and negative samples. Here, it is 0.4.

[0077] Step 4.3 Loss optimization:

[0078] By optimizing the contrast loss function, the distance between similar individuals can be effectively reduced, while the distance between dissimilar individuals can be increased. This optimization process helps the method to more accurately identify individual similarities. This optimization process calculates the gradient of the loss function to the method parameters through the back-propagation algorithm, and uses the Adam optimization algorithm to update the method parameters to minimize the contrast loss. The optimized individual similarity representation will provide a reliable basis for subsequent personalized solution recommendations.

[0079] Step 5: Personalized recommendation generation

[0080] In personalized recommendation systems, Top-K sampling methods are widely used to select the most relevant items from candidate recommendation sets or historical data. In this study, the goal of Top-K sampling is to select the best dishes from the recommended dishes of historical users based on the similarities between individuals and generate personalized recommendations for the current user. Through Top-K sampling, the system can generate a personalized list of dish recommendations, ultimately satisfying the user's preferences and needs.

[0081] In order to generate personalized dish recommendations for users, we first need to calculate the similarity between the current user and each dish. The Euclidean distance is calculated using the feature vectors between the user and the dish. Based on the similarity score of each dish, a candidate dish pool is constructed, which contains the similarity information of all dishes. The similarity scores of all dishes are sorted in descending order. Select the K dishes with the highest similarity to the current user from the recommendation pool. K is a hyperparameter, and 3 is selected here. These dishes are the candidate dishes recommended to the current user. The recommended dishes not only take into account the similarity between the user and the dish, but also provide the most suitable options based on the user's personalized characteristics (such as age, gender, health status, etc.). The recommendation system provides accurate personalized recommendations to the current user based on his needs and interests.

[0082] The reference data of the present invention is mainly the spatiotemporal knowledge graph data of users and dishes, which may contain complex node relationships, obvious temporal features, inconsistent features, etc. Through a multi-level feature extraction method, the spatial features of the nodes are first extracted using a graph convolutional neural network (GCN), and then the nodes are dynamically weighted in combination with a graph attention mechanism (GAT). Then, a bidirectional long short-term memory network (BiLSTM) is used to extract the temporal change features at different time points, and a classifier is constructed using a fully connected layer based on these features to predict the user's future state features. Then, the user's future state features are combined with the user's temporal change features, and the dish information similar to the current user is found by comparative learning. Finally, the dishes are sorted according to their similarity, and the N dishes most similar to the current user are selected, thereby generating personalized dishes recommended to the current user. Although the specific implementation steps in the invention can be adjusted according to different needs, the basic architecture of the system does not deviate from the core concept of the present invention. Therefore, the current embodiment should be regarded as exemplary rather than restrictive, and the scope of the present invention is defined by the attached claims rather than the above description.

Claims

1. A diet plan recommendation method based on spatiotemporal knowledge graph and user future state guidance, characterized in that: The following steps are involved: Step 1: Data preprocessing and knowledge graph construction When designing the knowledge graph, age, gender, interest, user dish rating, location are used as static features, and time is also added as a feature; for dishes, ingredients, difficulty, and cuisine are used as features; in order to establish the connection between users and dishes, these relationships are established through the user's "interaction record"; the interactive relationship connects users and dishes through ratings, and the ratings are used as the weight of the edge to indicate the user's preference for the dish; two types of data are extracted from the JSON data source: user data and dish data, which are integrated into a structure suitable for building a knowledge graph; the features of user nodes and dish nodes are passed to the graph through the ndata and edata attributes, and the weights of the edges in the graph are set through the user's dish ratings; DGL is used to implement the construction and processing of the graph structure; finally, a heterograph method is used to construct a heterogeneous graph containing two types of nodes: users and dishes; and node features and edge weights are passed in the graph; through these data structured operations, the resulting matrix is ​​represented by the following formula: Where X u represents the user feature matrix, N is the number of users, D1 represents the user feature dimension, which is 128 here, and X p represents the dish feature matrix, M is the number of dishes, D2 represents the dish feature dimension, which is 128 dimensions here; A represents the user's evaluation matrix of the dishes, missing values ​​are replaced by 0, and G represents the entire feature graph; Step 2: Spatial feature extraction This step is divided into two parts; Step 2.1: Graph Convolutional Network (GCN): Use different convolution kernels for users and dishes to process the features of user and dish nodes; concatenate the user and dish features to construct an overall feature matrix: X represents the overall feature matrix; perform graph convolution on the overall feature matrix: in Add self-loops to the adjacency matrix of A. for The degree matrix of is a diagonal matrix, and its elements are the degrees of the nodes; is the learnable weight matrix of the first layer, and f1 represents the dimension of the output features of the first layer; here f1 is taken as 128; is the feature matrix of the first layer output; and for the second layer of convolution, there are: in Here f2 represents the dimension of the second layer output feature, which is 64; H( 2 ) is the feature matrix of the second layer; Step 2.2 Graph Attention Network GAT: In this part, the extracted features are input into the graph self-attention network, and the input features H( 2 ) is linearly transformed and projected into the new feature space to generate the Z matrix: Z=H (2) W (3) in f3 is the output feature number, here it is 32, Represents the matrix after linear transformation; Calculate the attention score between each pair of nodes i and j, concatenate their features together and calculate the attention weight through a weight matrix, then use the softmax function to normalize each pair of node features; finally, get the final matrix by weighted average Step 3: Temporal feature extraction Step 3.1: LSTM time series feature extraction: In this part, the spatial feature H (3) Input into the Bidirectional Long Short-Term Memory Network (BiLSTM) for processing to extract time series change features: h LSTM =BiLSTM(H (3) ) in f4 is the number of BiLSTM output nodes, which is 512 here, and the number of BiLSTM hidden layers is 1; Step 3.2 Build the classifier: From h LSTM Separate dish information and user information in: X' u =h LSTM [:N,:],X' p =[N:,:] Get X' u and X' p ; And use the user matrix to classify the user status through the fully connected layer to obtain the user's future status prediction result: X future =FullConnect(X' u ) in f5 represents the number of future states, which is set to 5 states; Step 3.3 combines the future state characteristics with the user's temporal change characteristics: The predicted future state feature X future The time series variation feature X' u Combined to form the final output vector H final X final_u =Concate(X future ,X' u ) The Concate operation means concatenating two vectors on the same dimension; merging the 512 dimension of the first vector and the f5 dimension of the second vector, we get Step 4: Similar file search Step 4.1 Dish feature conversion and similarity calculation: First, use the fully connected layer to transform the dish features: X final_p =Fullconnect(X' p ) in Then the Euclidean distance is used to measure the similarity; the Euclidean distance formula is: Distance(u i , p j )=||U i -P j ||2 in, represents the feature vector of user i, The feature vector representing dish j; Step 4.2 defines the loss function: Use contrastive loss to minimize the feature distance between similar users and dishes they have rated, and maximize the feature distance between users and dishes they have not rated: Among them U i represents the feature vector of user i, P j represents the feature vector of dish j; A[i,j] represents the rating of dish j by user i, where a positive value indicates a favorable rating and a 0 or negative value indicates a negative rating; Δ represents a threshold used to control the distance between positive and negative samples; here it is 0.4; Step 4.3 Loss optimization: This optimization process calculates the gradient of the loss function to the method parameters through the back-propagation algorithm, and updates the method parameters using the Adam optimization algorithm to minimize the contrast loss; Step 5: Personalized recommendation generation The goal of Top-K sampling is to select the best dishes from the recommended dishes of historical users based on the similarities between individuals and generate personalized recommendations for the current user.