An intelligent nutritional recipe recommendation system and method
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- HARBIN INST OF PETROLEUM
- Filing Date
- 2026-05-12
- Publication Date
- 2026-08-04
AI Technical Summary
[0005]针对现有技术的不足,本发明提供了一种智能营养食谱推荐系统及方法,解决了上述背景技术中提出的对个体营养需求的评估存在偏差,无法精准计算出热量、蛋白质、脂肪、碳水化合物、维生素及矿物质等具体营养素的真实缺口的问题
[0060] 1. In this invention, by collecting basic information, activity information and dietary intake information of target users and related users, and based on this, performing individual nutritional needs analysis and nutritional difference calculation, individual nutritional gap data reflecting the deficiencies in calories, protein, fat, carbohydrates, vitamins and minerals are generated, thereby achieving an accurate assessment of each user's current nutritional status and laying the foundation for subsequent recommendations.
Smart Images

Figure CN122511490A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of artificial intelligence technology, specifically to an intelligent nutrition recipe recommendation system and method. Background Technology
[0002] A nutritional diet plan is a scientifically designed meal plan that combines foods according to the physiological characteristics and nutritional needs of different groups of people. It aims to meet the nutritional needs of protein, vitamins, minerals and other nutrients through a diverse diet. The nutrients required by organisms include the main elements that make up proteins and store energy, such as hydrogen, oxygen, nitrogen and carbon, as well as a variety of trace elements such as sulfur, phosphorus, calcium and magnesium.
[0003] Currently, in the field of intelligent nutrition recipe recommendation, existing technologies usually rely on limited basic information of users or static dietary records for recommendations. It is difficult to comprehensively and in real time integrate users' comprehensive physical condition, activity level and dynamic dietary intake information, resulting in bias in the assessment of individual nutritional needs and the inability to accurately calculate the true gaps in specific nutrients such as calories, protein, fat, carbohydrates, vitamins and minerals.
[0004] Therefore, an intelligent nutrition recipe recommendation system and method are proposed to solve the above problems. Summary of the Invention
[0005] To address the shortcomings of existing technologies, this invention provides an intelligent nutrition recipe recommendation system and method, which solves the problem mentioned in the background art of biased assessment of individual nutritional needs and the inability to accurately calculate the true nutritional deficiencies of specific nutrients such as calories, protein, fat, carbohydrates, vitamins, and minerals.
[0006] To achieve the above objectives, the present invention provides the following technical solution: an intelligent nutrition recipe recommendation system and method, the method comprising the following steps:
[0007] S1. Collect basic information, activity information, and dietary intake information of target users and related users;
[0008] S2. Based on the basic information and the activity information, perform nutritional needs analysis and processing on the target user and related users to generate individual nutritional needs data;
[0009] S3. Based on the dietary intake information and the individual nutritional requirements data, calculate the nutritional differences between the target user and related users to generate individual nutritional gap data.
[0010] S4. Based on the individual nutritional deficit data and the preset food nutrition knowledge graph, perform food matching and screening to generate candidate food set data;
[0011] S5. Integrate the basic information, the activity information, the individual nutritional gap data, and the candidate food set data into nutritional recommendation feature parameters for the target group;
[0012] S6. Based on the nutritional recommendation feature parameters, perform comprehensive calculation of group nutritional needs and food sorting processing through a pre-trained factorization machine model to generate nutritional recipe recommendation data for the target group.
[0013] S7. Process meal ordering instructions based on the nutritional recipe recommendation data of the target group, and generate and execute meal ordering instruction data.
[0014] Preferably, the collection of basic information, activity information, and dietary intake information of the target user and associated users in step S1 includes the following steps:
[0015] S11. Receive basic information input by the target user through the user terminal device. The basic information includes age, gender, region and personal dietary preferences, and generate target user basic information data.
[0016] S12. Collect the target user's activity information through the user terminal device and associated wearable device. The activity information includes the daily course schedule, estimated energy consumption, daily exercise volume and historical activity records, and generate target user activity information data.
[0017] S13. Receive dietary intake information input by the target user through the user terminal device. The dietary intake information includes the types and quantities of food consumed on the current day and recently, and generate dietary intake information data of the target user.
[0018] S14. In response to the group nutrition recommendation instruction initiated by the target user, obtain the identity identifier of the associated user, and retrieve the associated user's basic information data, associated user activity information data, and associated user dietary intake information data from the system database based on the identity identifier.
[0019] Preferably, the nutritional needs analysis and processing of target users and related users in S2 includes the following steps:
[0020] S21. Obtain the target user's basic information data and the target user's activity information data;
[0021] S22. Based on the age and gender information in the target user's basic information data, query the preset daily recommended intake standard and generate the target user's basic nutritional needs data.
[0022] S23. Based on the daily course schedule, daily exercise volume and historical activity records in the target user activity information data, calculate the target user's dynamic energy consumption adjustment coefficient, and adjust it in conjunction with the target user's basic nutritional requirements data to generate the target user's individual nutritional requirements data.
[0023] S24. For each associated user, repeat steps S21 to S23 to generate individual nutritional requirement data for each associated user, and combine it with the individual nutritional requirement data of the target user to form individual nutritional requirement data.
[0024] Preferably, the nutritional difference calculation and processing of the target user and associated users in S3 includes the following steps:
[0025] S31. Obtain the dietary intake information data of the target user and the individual nutritional requirements data of the target user;
[0026] S32. Call the food nutrition knowledge graph to convert the types and quantities of food in the target user's dietary intake information data into nutritional component data;
[0027] S33. Calculate the difference between the target user's individual nutritional requirements data and the converted nutritional component data to generate the target user's individual nutritional deficit data. The nutritional deficit specifically includes: calorie deficit, protein deficit, fat deficit, carbohydrate deficit, vitamin deficit, and mineral deficit.
[0028] S34. For each associated user, repeat steps S31 to S33 to generate individual nutritional gap data for each associated user, and combine it with the individual nutritional gap data of the target user to form individual nutritional gap data.
[0029] Preferably, the food matching and screening process in S4 includes the following steps:
[0030] S41. Perform aggregate analysis on the individual nutritional deficit data to identify the common nutritional deficits of the target group and the specific nutritional deficits of each user.
[0031] S42. Using the common nutritional gap as the primary matching condition, search the food nutrition knowledge graph for a set of candidate foods that can simultaneously supplement the common nutritional gap, and generate a first candidate food subset data.
[0032] S43. Using the specific nutritional gap as a secondary matching condition, search the food nutrition knowledge graph for foods that can specifically supplement the specific nutritional gap of each user, and filter out foods that conflict with the dietary taboos of any user in the target group to generate a second candidate food subset data.
[0033] S44. Merge the first candidate food subset data and the second candidate food subset data, and remove duplicates to generate candidate food set data.
[0034] Preferably, the nutritional recommendation characteristic parameters for the target group in S5 include the following steps:
[0035] S51. Standardize and vectorize the target user basic information data, the target user activity information data, the target user individual nutritional deficit data, and the various information data corresponding to the associated users.
[0036] S52. Combine and align the standardized and vectorized data with the food feature data in the candidate food set data to construct a feature matrix with users and food as basic units.
[0037] S53. Perform feature engineering on the feature matrix to extract cross features that characterize user attributes, food attributes, and the matching degree between user nutritional gaps and food nutritional supplementation capabilities, and generate nutritional recommendation feature parameters.
[0038] Preferably, the comprehensive calculation of population nutritional requirements and food sorting process in S6 includes the following steps:
[0039] S61. Obtain the nutritional recommendation feature parameters;
[0040] S62. Input the nutrition recommendation feature parameters into a pre-trained factorization machine model. The factorization machine model performs feature cross calculation on the nutrition recommendation feature parameters based on its model parameters to generate a personalized nutrition recommendation score for each user and the food.
[0041] S63. The personalized nutrition recommendation scores of all users in the target group are weighted and aggregated to calculate the comprehensive recommendation score of each food for the target group, where the weighting factor takes into account the priority of the individual user's nutritional gap in the group.
[0042] S64. Based on the comprehensive recommendation score, sort the food in the candidate food set data in descending order, select the top-ranked preset number of food, and combine them into a recipe scheme that meets the nutritional needs of a meal and a day, respectively, to generate nutritional recipe recommendation data for the target group.
[0043] Preferably, the method for constructing and training the pre-trained factorization machine model in S62 includes the following steps:
[0044] S621. Collect historical user group ordering records, corresponding user basic information, activity information and post-meal feedback data to construct a training sample set, wherein the features of each sample include user group features, food features and the group's choice of the food.
[0045] S622. Construct a factorization machine model whose objective function is suitable for predicting the probability that a given user group will choose a particular food when given user group characteristics and food characteristics.
[0046] S623. For different group sizes, the factorization machine model is trained differently using historical group sample data of the corresponding size to obtain multiple sub-models specifically applicable to single, two, four, six and eight group scenarios.
[0047] S624. In the model application stage, based on the actual number of people in the current target group, call the corresponding trained sub-model to execute steps S62 to S64.
[0048] Preferably, the food ordering instruction processing in S7 includes the following steps:
[0049] S71. Push the nutritional recipe recommendation data for the target group to the terminal devices of the target users and associated users for display;
[0050] S72. Receive the final recipe selection instruction confirmed by the target user from the nutritional recipe recommendation data of the target group;
[0051] S73. Based on the final recipe selection instruction, generate meal order data including recipe details, delivery information and payment information;
[0052] S74. Send the meal order data to the meal service system to trigger the meal preparation and delivery process, and complete the execution of the meal order instruction data.
[0053] Preferably, the system includes:
[0054] The user data collection and management module collects terminal interaction data of target users and related users, archives basic information, activity information and dietary intake information through the information storage unit, and outputs basic information data of target users through the data cleaning unit.
[0055] The nutrition requirements analysis and gap calculation module receives the target user's basic information data, parses the individual nutrition requirements through the nutrition requirements calculation unit, generates the current nutrition gap using the gap comparison unit, and outputs the individual nutrition gap data through the data aggregation unit.
[0056] The food screening and feature construction module receives the individual nutritional gap data, filters candidate foods through the knowledge graph query unit, processes food attributes using the feature parameter construction unit, and outputs nutritional recommendation feature parameters through the vectorization processing unit.
[0057] The intelligent recommendation algorithm module receives the nutritional recommendation feature parameters, performs feature cross-calculation through the model inference unit, generates personalized recommendation scores using the ranking strategy unit, and outputs nutritional recipe recommendation data for the target group through the result aggregation unit.
[0058] The recipe recommendation and order execution module receives nutritional recipe recommendation data from the target group, pushes recipe plans through the interface display unit, confirms the user's selection through the instruction receiving unit, and completes the meal ordering process through the order execution unit.
[0059] Compared with the prior art, the present invention provides an intelligent nutrition recipe recommendation system and method, which has the following beneficial effects:
[0060] 1. In this invention, by collecting basic information, activity information and dietary intake information of target users and related users, and based on this, performing individual nutritional needs analysis and nutritional difference calculation, individual nutritional gap data reflecting the deficiencies in calories, protein, fat, carbohydrates, vitamins and minerals are generated, thereby achieving an accurate assessment of each user's current nutritional status and laying the foundation for subsequent recommendations.
[0061] 2. In this invention, user information, nutritional gaps and candidate food features are integrated into nutritional recommendation feature parameters. A pre-trained factorization machine model is used to perform feature cross-calculation and personalized scoring. Then, the scores of all users in the group are weighted, aggregated and sorted. Based on taking into account both the common needs of the group and the specific needs of individuals, an optimized diet plan that meets the overall nutritional needs of the target group is generated.
[0062] 3. In this invention, by pushing the generated nutritional recipe recommendation data for the target group to the user terminal for confirmation, and automatically generating meal order data based on the user's final selection instruction and sending it to the meal preparation system, an end-to-end service loop from personalized nutritional analysis and intelligent recipe recommendation to one-click order completion is realized, improving the practicality and convenience of recipe recommendation. Attached Figure Description
[0063] Figure 1 This is a flowchart of an intelligent nutrition recipe recommendation method according to the present invention;
[0064] Figure 2 This is a schematic diagram of the architecture of an intelligent nutrition recipe recommendation system according to the present invention. Detailed Implementation
[0065] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0066] For specific implementation examples, please refer to: Figures 1-2 A smart nutrition recipe recommendation system and method, the method including the following steps:
[0067] S1. Collect basic information, activity information, and dietary intake information of target users and related users;
[0068] S2. Based on basic information and activity information, analyze and process the nutritional needs of target users and related users to generate individual nutritional requirement data.
[0069] S3. Calculate and process the nutritional differences of target users and related users based on dietary intake information and individual nutritional requirements data to generate individual nutritional gap data.
[0070] S4. Based on individual nutritional deficit data and a preset food nutrition knowledge graph, perform food matching and screening to generate candidate food set data;
[0071] S5. Integrate basic information, activity information, individual nutritional gap data, and candidate food set data into nutritional recommendation feature parameters for the target group;
[0072] S6. Based on the nutritional recommendation feature parameters, a pre-trained factorization machine model is used to perform comprehensive calculation of the nutritional needs of the group and food sorting to generate nutritional recipe recommendation data for the target group.
[0073] S7. Process meal ordering instructions based on the nutritional recipe recommendation data of the target group, and generate and execute meal ordering instruction data.
[0074] S1 collects basic information, activity information, and dietary intake information of the target user and associated users, including the following steps:
[0075] S11. Receive basic information input by the target user through the user terminal device. The basic information includes age, gender, region and personal dietary preferences, and generate basic information data of the target user.
[0076] S12. Collect the target user's activity information through the user terminal device and associated wearable device. The activity information includes the daily course schedule, estimated energy consumption, daily exercise volume and historical activity records, and generate target user activity information data.
[0077] S13. Receive dietary intake information input by the target user through the user terminal device. The dietary intake information includes the types and quantities of food consumed on the current day and recently, and generate dietary intake information data of the target user.
[0078] User terminal devices are smart devices with input functions, such as smartphones, tablets, and personal computers.
[0079] S14. In response to the group nutrition recommendation instruction initiated by the target user, obtain the identity identifier of the associated user, and retrieve the associated user's basic information data, associated user activity information data, and associated user dietary intake information data from the system database based on the identity identifier.
[0080] The nutritional needs analysis and processing of target users and related users in S2 includes the following steps:
[0081] S21. Obtain basic information data and activity information data of the target user;
[0082] S22. Based on the age and gender information in the target user's basic information data, query the preset daily recommended intake standards and generate the target user's basic nutritional needs data.
[0083] S23. Based on the daily course schedule, daily exercise volume and historical activity records in the target user activity information data, calculate the target user's dynamic energy consumption adjustment coefficient, and adjust it in combination with the target user's basic nutritional requirements data to generate the target user's individual nutritional requirements data.
[0084] First, obtain the target user's total steps, resting heart rate, sleep duration, and daily course and schedule intensity scores over the past 24 hours; calculate the basal metabolic rate fluctuation factor using a physiological characteristic weighting formula; calculate the exercise consumption gain coefficient using an exercise intensity mapping function based on the duration of moderate to high intensity exercise recorded by the wearable device; and multiply the basal energy requirement by these two dynamic coefficients to obtain the adjusted energy requirement.
[0085] ;
[0086] ;
[0087] ;
[0088] in This refers to the user's total steps taken in a single day. Resting heart rate For sleep duration, Rate the intensity of the schedule. As a basal metabolic fluctuation factor For moderate to high intensity exercise duration, The coefficient of performance enhancement is the factor for physical exertion. Based on basic energy demand, To adjust energy requirements;
[0089] S24. For each associated user, repeat steps S21 to S23 to generate individual nutritional requirement data for each associated user, and combine it with the individual nutritional requirement data of the target user to form individual nutritional requirement data.
[0090] The nutritional difference calculation and processing for target users and associated users in S3 includes the following steps:
[0091] S31. Obtain dietary intake information data and individual nutritional requirements data of target users;
[0092] S32. Call the food nutrition knowledge graph to convert the types and quantities of food in the target user's dietary intake information into nutritional component data;
[0093] After receiving the user-selected and system-recommended candidate food types and their corresponding weights, the system performs data transformation; it then retrieves the basic nutritional template of the candidate food type from the built-in food nutrition knowledge graph database to obtain the baseline values of macronutrients and micronutrients contained in 100g of food; subsequently, it performs linear proportional conversion based on the input weight to calculate the absolute nutritional composition data of the actual intake; if the food contains multiple ingredients, it iterates through each sub-item and sums them to generate a multidimensional nutritional vector corresponding to the food item.
[0094] ;
[0095] in This is the multidimensional nutrient vector corresponding to this food item. For species category identifiers of food, For the first The weight of each type of food consumed. For the first The first of the food The baseline content of each nutrient per 100 grams;
[0096] S33. Calculate the difference between the target user's individual nutritional requirements data and the converted nutritional component data to generate the target user's individual nutritional deficit data. The nutritional deficit specifically includes: calorie deficit, protein deficit, fat deficit, carbohydrate deficit, vitamin deficit, and mineral deficit.
[0097] ;
[0098] ;
[0099] in To indicate the first Nutritional gap values for various nutrients To indicate the first The basic nutritional requirements for each nutrient. A set of nutritional deficit indicators Logic for constructing sets that meet the filtering criteria;
[0100] S34. For each associated user, repeat steps S31 to S33 to generate individual nutritional gap data for each associated user, and combine it with the individual nutritional gap data of the target user to form individual nutritional gap data.
[0101] The food matching and screening process in S4 includes the following steps:
[0102] S41. Perform aggregate analysis on individual nutritional deficit data to identify common nutritional deficits in the target group and specific nutritional deficits for each user.
[0103] First, the gap vectors of all members are averaged digit by digit to generate the population average gap vector; gaps greater than the population average threshold are defined as common nutrient gaps; second, each member's individual gap vector is compared with the population average vector, and when a member's specific gap value deviates from the population mean, i.e., is greater than twice the standard deviation of the mean, it is marked as a specific nutrient gap and given higher weight in the recommendation.
[0104] ;
[0105] ;
[0106] ;
[0107] in Indicates the first in the target group The average nutritional deficit value of each nutrient This represents the total number of users in the target group. Indicates the first in the group The user on the first Individual nutritional deficit values for each nutrient This represents the total number of users within the group; For the first Whether a nutrient is a binary marker of a common nutritional deficiency For the first The user in the first Are there binary markers for specific nutritional gaps in these nutrients? The preset population gap threshold, Let be the standard deviation of the nutrient deficiency value of the j-th nutrient in the population. Let represent the average nutritional deficit of the j-th nutrient in the target population;
[0108] S42. Using common nutritional gaps as the primary matching condition, search the food nutrition knowledge graph for a set of candidate foods that can simultaneously fill common nutritional gaps, and generate the first candidate food subset data.
[0109] S43. Using specific nutritional gaps as a secondary matching condition, search for foods in the food nutrition knowledge graph that can specifically supplement the specific nutritional gaps of each user, and filter out foods that conflict with the dietary taboos of any user in the target group to generate a second candidate food subset data.
[0110] This step performs hard constraint filtering; the system reads the preset dietary restrictions list of each user in the group; for each food item in the current candidate food set, it checks whether its species category and tag exist in any user's restrictions list. If there is an intersection, the matching probability of the food is forcibly set to zero and it is removed from the recommendation candidate pool to ensure that the recommendation results are safe and usable for all members.
[0111] ;
[0112] in This is a collection of compliant foods obtained after filtering out dietary restrictions. This represents a specific food item in the set. For the first A user's list of dietary restrictions. For food Category For the initial set of candidate foods, To represent an empty set, this section checks whether the food label overlaps with the list of prohibited items;
[0113] S44. Merge the data of the first candidate food subset with the data of the second candidate food subset, and remove duplicates to generate candidate food set data;
[0114] When eliminating duplicates, the cosine similarity of the nutritional components of any two foods in the candidate food set is calculated. If the similarity exceeds the preset duplication threshold, it is considered a duplicate. The items with higher overall scores are retained, and the items with lower scores are deleted, thereby simplifying the candidate list.
[0115] ;
[0116] ;
[0117] in Indicates food With food Cosine similarity between them Indicates food Nutritional component vector, Indicates food nutrient component vector; This indicates whether the similarity between two foods exceeds a preset similarity threshold. , This represents the preset cosine similarity threshold. , Indicates the first , Recommended ratings for each type of food. This represents the independent variable that takes the maximum value among the parameters; that is, the food index corresponding to the larger of the two scores. This means retaining the food item in the subsequent candidate set and removing another redundant food item with high similarity.
[0118] The nutritional recommendation parameters for the target population in S5 include the following steps:
[0119] S51. Standardize and vectorize the target user's basic information data, target user activity information data, target user's individual nutritional deficit data, and various information data corresponding to associated users:
[0120] ;
[0121] ;
[0122] in Indicates the first The standardized values of each feature Indicates the first The original observations of each feature, Indicates the first The mean of each feature across all training samples Indicates the first The standard deviation of each feature across all training samples Represent a 3D eigenvectors Indicates by An ordered array consisting of standardized feature values Represents the total dimension of the features;
[0123] S52. Combine and align the standardized and vectorized data with the food feature data in the candidate food set data to construct a feature matrix with users and food as the basic units.
[0124] First, the user profile features and food features are combined by outer product to generate higher-order interaction features; at the same time, context features are introduced; finally, all samples are arranged into a two-dimensional feature matrix, where each row represents a user-food interaction instance.
[0125] ;
[0126] ;
[0127] in The final feature matrix generated, This is the embedding representation of the first feature factor. This is the embedding representation of the second feature factor. For the bias term vector, The feature matrix of the entire dataset. For the set of real numbers, Let be the dimension of the matrix. For the sample size, For feature dimensions;
[0128] S53. Perform feature engineering on the feature matrix to extract cross features that characterize user attributes, food attributes, and the matching degree between user nutritional gaps and food nutritional supplementation capabilities, and generate nutritional recommendation feature parameters.
[0129] First, discrete categorical features are processed using one-hot encoding; second, logarithmic transformation is applied to continuous features to alleviate long-tailed distribution; finally, the variance inflation factor of each feature is calculated to detect multicollinearity, redundant features with excessively high VIF values are removed, and a refined feature matrix is output.
[0130] ;
[0131] ;
[0132] in For the first The values of each feature after logarithmic transformation For the first The original input values for each feature, For the first The variance inflation factor of each feature. To make the first The coefficient of determination is obtained by performing linear regression fitting with one feature as the dependent variable and all other features as independent variables.
[0133] The comprehensive calculation of population nutritional requirements and food ranking in S6 includes the following steps:
[0134] S61. Obtain nutritional recommendation feature parameters;
[0135] S62. Input the nutrition recommendation feature parameters into the pre-trained factorization machine model. The factorization machine model performs feature cross calculation on the nutrition recommendation feature parameters based on its model parameters to generate a personalized nutrition recommendation score for each user and the food.
[0136] Load the pre-trained factorization machine model parameters, including first-order weights and second-order latent feature vectors; the model receives the processed feature vectors, first calculates the contribution of the linear part, and then calculates the contribution of the non-linear part; the latent vector dot product captures the implicit interaction relationships between features, and finally outputs the user's predicted preference score for food:
[0137] ;
[0138] in For the model to sample The predicted preference score, This is the global bias term of the model. For the sample The total number of features included. For the first The linear weight coefficients of each feature, For the first in the sample The input values for each feature, The first-order linear part is the characteristic. The second-order interaction part is characterized by... For the first The first feature and the first The inner product of the latent vectors of each feature. For the first The first feature and the second The product of features;
[0139] S63. The personalized nutrition recommendation scores of all users in the target group are weighted and aggregated to calculate the comprehensive recommendation score of each food for the target group, where the weighting factor takes into account the priority of the individual user's nutritional gap in the group.
[0140] For each user in the group, the model in S62 is called to calculate the user's preference score for each food in the candidate food set; then, these scores are weighted and summed, with the weights dynamically allocated according to the severity of the specific nutritional deficiency, to obtain the comprehensive recommendation score for the food in the entire group:
[0141] ;
[0142] in For food The overall recommendation score within the entire group The number of users in the group. For the first individual users on food The predicted preference score, For the first The weight coefficients of each user and satisfy the following conditions: ;
[0143] S64. Sort the food in the candidate food set data in descending order according to the comprehensive recommendation score, select the top-ranked preset number of food, and combine them into a recipe plan that meets the nutritional needs of a meal and a day, respectively, to generate nutritional recipe recommendation data for the target group.
[0144] The system collects the comprehensive recommendation scores of all foods in the candidate food set to form a score list. Then, it uses merge sort to arrange the list from high to low scores. The sorted list is the final personalized recipe recommendation order. The system combines the top N foods into the final recommended menu and displays it to the user.
[0145] The construction and training method of the pre-trained factorization machine model in S62 includes the following steps:
[0146] S621. Collect historical user group ordering records, corresponding user basic information, activity information and post-meal feedback data to construct a training sample set, wherein the features of each sample include user group features, food features and the group's choice of the food.
[0147] S622. Construct a factorization machine model whose objective function is suitable for predicting the probability that a given user group will choose a particular food when given user group characteristics and food characteristics.
[0148] The objective function minimized during training of the factorization machine model is:
[0149] ;
[0150] in The overall loss function of the model. For real labels, For the model to sample The predicted preference score, The regularization coefficient is . For first-order linear weights L2 penalty, For second-order interactive latent vectors L2 penalty;
[0151] S623. For different group sizes, the factorization machine model is trained differently using historical group sample data of the corresponding size to obtain multiple sub-models specifically applicable to single, two, four, six and eight group scenarios.
[0152] Considering the differences in data distribution across different scenarios such as single-person casual meals, couple's meals, and large family gatherings, this step implements a divide-and-conquer strategy, dividing the historical dataset into multiple subsets based on the number of diners; for each subset, an independent set of factorization machine model parameters is initialized; during training, gradient descent updates are performed on each subset; to prevent overfitting in small sample scenarios, each small model employs an early stopping mechanism, monitoring the loss function on the validation set, and stopping training when there is no decrease for several consecutive rounds, ultimately retaining the optimal set of model parameters for each scenario;
[0153] ;
[0154] ;
[0155] in Indicates the first The first task After each iteration, the updated state of the model parameters. Indicates the first During the round of iteration, the first Model parameters for each task, Indicates the learning rate. Represents the loss function gradient, It is the gradient operator notation. This represents the parameter point on which the current gradient calculation is based. Indicates the first The training dataset for each task For the final collection of integrated models, This represents an optimal model parameter state saved from historical training. To validate the set loss;
[0156] S624. In the model application stage, based on the actual number of people in the current target group, call the corresponding trained sub-model to execute steps S62 to S64.
[0157] S7 Chinese food order processing includes the following steps:
[0158] S71. Push the nutritional recipe recommendation data for the target group to the terminal devices of the target users and associated users for display;
[0159] S72. Receive the final recipe selection instruction confirmed by the target user from the nutritional recipe recommendation data of the target group;
[0160] S73. Based on the final recipe selection instruction, generate meal order data including recipe details, delivery information and payment information;
[0161] S74. Send the meal order data to the meal service system to trigger the meal preparation and delivery process and complete the execution of the meal order instruction data.
[0162] The system includes:
[0163] The user data collection and management module collects terminal interaction data of target users and related users, archives basic information, activity information and dietary intake information through the information storage unit, and outputs basic information data of target users through the data cleaning unit.
[0164] The nutrition requirements analysis and gap calculation module receives basic information data of the target user, analyzes the individual nutrition requirements through the nutrition requirements calculation unit, generates the current nutrition gap using the gap comparison unit, and outputs the individual nutrition gap data through the data aggregation unit.
[0165] The food screening and feature construction module receives individual nutritional gap data, filters candidate foods through the knowledge graph query unit, processes food attributes through the feature parameter construction unit, and outputs nutritional recommendation feature parameters through the vectorization processing unit.
[0166] The intelligent recommendation algorithm module receives nutritional recommendation feature parameters, performs feature cross-calculation through the model inference unit, generates personalized recommendation scores using the ranking strategy unit, and outputs nutritional recipe recommendation data for the target group through the result aggregation unit.
[0167] The recipe recommendation and order execution module receives nutritional recipe recommendation data from the target group, pushes recipe plans through the interface display unit, confirms the user's selection through the instruction receiving unit, and completes the meal ordering process through the order execution unit.
[0168] The operation steps of an intelligent nutrition recipe recommendation system and method are as follows:
[0169] Step 1: Multi-source user information collection
[0170] First, the system collects basic information, activity information, and dietary intake information input by the target user through the user's terminal device and associated wearable devices, and generates corresponding data. When the target user initiates a group nutrition recommendation command, the system obtains the identity identifier of the associated user and retrieves the corresponding basic information, activity information, and dietary intake information data from the system database.
[0171] Step Two: Individualized Nutritional Needs Analysis
[0172] Based on the collected basic and activity information, the system analyzes and processes the nutritional needs of the target user and related users. Specifically, the system first queries the preset daily recommended intake standard based on the user's age and gender information to generate basic nutritional requirement data. Then, it calculates the dynamic energy consumption adjustment coefficient by combining the user's daily course schedule, exercise volume, and historical activity records to adjust the basic nutritional requirements, thereby generating individual nutritional requirement data.
[0173] Step 3: Calculation of Individual Nutritional Deficit
[0174] Based on the user's dietary intake information and the individual nutritional requirements data generated in the previous step, the system performs nutritional difference calculations. This process calls upon a food nutrition knowledge graph to convert the types and quantities of food the user has consumed into nutritional component data, then calculates the difference between this data and the individual nutritional requirements data, ultimately generating individual nutritional gap data that reflects specific deficiencies in calories, protein, fat, carbohydrates, vitamins, and minerals.
[0175] Step 4: Food matching and filtering based on knowledge graph
[0176] The system performs food matching and screening based on the calculated individual nutritional gap data and a pre-defined food nutrition knowledge graph. First, it aggregates and analyzes the individual nutritional gap data of all users within the group to identify the common nutritional gaps of the target group and the specific nutritional gaps of each user. Then, using the common nutritional gap as the primary matching condition, it searches for foods that can simultaneously fill the gap, generating a first candidate food subset. Next, using the specific nutritional gap as the secondary matching condition, it searches for foods that can specifically fill the specific gaps of each user, filtering out foods that conflict with the dietary restrictions of any user in the group, generating a second candidate food subset. After merging the two subsets and removing duplicates, the final candidate food set data is generated.
[0177] Step 5: Construction of Feature Parameters for Population Nutrition Recommendation
[0178] To enable intelligent recommendations, the system integrates basic information, activity information, individual nutritional gap data, and food feature data from the candidate food set data of the target user and related users. Specifically, it standardizes and vectorizes various types of user information, then aligns it with the food feature data to construct a feature matrix with users and food as basic units. Through feature engineering, it extracts cross features that characterize user attributes, food attributes, and nutritional matching degree, and finally generates nutritional recommendation feature parameters for the target group used in model calculation.
[0179] Step Six: Population-based Comprehensive Recommendation and Ranking Based on Factorization Machine Model
[0180] The system inputs the constructed nutritional recommendation feature parameters into a pre-trained factorization machine model. This model performs cross-calculation on the features based on its parameters, generating personalized nutritional recommendation scores for each user and food. Subsequently, the system weights and aggregates the personalized recommendation scores of all users within the target group to calculate the comprehensive recommendation score for each food item for the target group. Finally, the candidate foods are sorted in descending order based on the comprehensive recommendation scores, and a predetermined number of top-ranked foods are selected to create meal plans that meet the nutritional needs of a single meal and a day, generating nutritional meal plan recommendation data for the target group.
[0181] Step 7: Recipe Confirmation and Meal Order Execution
[0182] The system pushes the generated nutritional recipe recommendations for the target group to the terminal devices of the target users and associated users for display. After receiving the final recipe selection instruction confirmed by the target user, the system generates meal order data containing recipe details, delivery information, and payment information based on the instruction, and sends the order data to the meal preparation service system, thereby triggering the subsequent meal preparation and delivery process and completing the execution of the entire meal order instruction.
[0183] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0184] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.
Claims
1. A method for intelligent nutritional recipe recommendation, characterized in that: The method includes the following steps: S1. Collect basic information, activity information, and dietary intake information of target users and related users; S2. Based on the basic information and the activity information, perform nutritional needs analysis and processing on the target user and related users to generate individual nutritional needs data; S3. Based on the dietary intake information and the individual nutritional requirements data, calculate the nutritional differences between the target user and related users to generate individual nutritional gap data. S4. Based on the individual nutritional deficit data and the preset food nutrition knowledge graph, perform food matching and screening to generate candidate food set data; S5. Integrate the basic information, the activity information, the individual nutritional gap data, and the candidate food set data into nutritional recommendation feature parameters for the target group; S6. Based on the nutritional recommendation feature parameters, perform comprehensive calculation of group nutritional needs and food sorting processing through a pre-trained factorization machine model to generate nutritional recipe recommendation data for the target group. S7. Process meal ordering instructions based on the nutritional recipe recommendation data of the target group, and generate and execute meal ordering instruction data.
2. The intelligent nutrition recipe recommendation method according to claim 1, characterized in that: The S1 step involves collecting basic information, activity information, and dietary intake information of the target user and associated users, including the following steps: S11. Receive basic information input by the target user through the user terminal device. The basic information includes age, gender, region and personal dietary preferences, and generate target user basic information data. S12. Collect the target user's activity information through the user terminal device and associated wearable device. The activity information includes the daily course schedule, estimated energy consumption, daily exercise volume and historical activity records, and generate target user activity information data. S13. Receive dietary intake information input by the target user through the user terminal device. The dietary intake information includes the types and quantities of food consumed on the current day and recently, and generate dietary intake information data of the target user. S14. In response to the group nutrition recommendation instruction initiated by the target user, obtain the identity identifier of the associated user, and retrieve the associated user's basic information data, associated user activity information data, and associated user dietary intake information data from the system database based on the identity identifier.
3. The intelligent nutrition recipe recommendation method according to claim 2, characterized in that: The nutritional needs analysis and processing of target users and related users in S2 includes the following steps: S21. Obtain the target user's basic information data and the target user's activity information data; S22. Based on the age and gender information in the target user's basic information data, query the preset daily recommended intake standard and generate the target user's basic nutritional needs data. S23. Based on the daily course schedule, daily exercise volume and historical activity records in the target user activity information data, calculate the target user's dynamic energy consumption adjustment coefficient, and adjust it in conjunction with the target user's basic nutritional requirements data to generate the target user's individual nutritional requirements data. S24. For each associated user, repeat steps S21 to S23 to generate individual nutritional requirement data for each associated user, and combine it with the individual nutritional requirement data of the target user to form individual nutritional requirement data.
4. The intelligent nutrition recipe recommendation method according to claim 3, characterized in that: The nutritional difference calculation and processing for the target user and associated users in S3 includes the following steps: S31. Obtain the dietary intake information data of the target user and the individual nutritional requirements data of the target user; S32. Call the food nutrition knowledge graph to convert the types and quantities of food in the target user's dietary intake information data into nutritional component data; S33. Calculate the difference between the target user's individual nutritional requirements data and the converted nutritional component data to generate the target user's individual nutritional deficit data. The nutritional deficit specifically includes: calorie deficit, protein deficit, fat deficit, carbohydrate deficit, vitamin deficit, and mineral deficit. S34. For each associated user, repeat steps S31 to S33 to generate individual nutritional gap data for each associated user, and combine it with the individual nutritional gap data of the target user to form individual nutritional gap data.
5. The intelligent nutrition recipe recommendation method according to claim 4, characterized in that: The food matching and screening process in S4 includes the following steps: S41. Perform aggregate analysis on the individual nutritional deficit data to identify the common nutritional deficits of the target group and the specific nutritional deficits of each user. S42. Using the common nutritional gap as the primary matching condition, search the food nutrition knowledge graph for a set of candidate foods that can simultaneously supplement the common nutritional gap, and generate a first candidate food subset data. S43. Using the specific nutritional gap as a secondary matching condition, search the food nutrition knowledge graph for foods that can specifically supplement the specific nutritional gap of each user, and filter out foods that conflict with the dietary taboos of any user in the target group to generate a second candidate food subset data. S44. Merge the first candidate food subset data and the second candidate food subset data, and remove duplicates to generate candidate food set data.
6. The intelligent nutrition recipe recommendation method according to claim 5, characterized in that: The nutritional recommendation characteristic parameters for the target group in S5 include the following steps: S51. Standardize and vectorize the target user basic information data, the target user activity information data, the target user individual nutritional deficit data, and the various information data corresponding to the associated users. S52. Combine and align the standardized and vectorized data with the food feature data in the candidate food set data to construct a feature matrix with users and food as basic units. S53. Perform feature engineering on the feature matrix to extract cross features that characterize user attributes, food attributes, and the matching degree between user nutritional gaps and food nutritional supplementation capabilities, and generate nutritional recommendation feature parameters.
7. The intelligent nutrition recipe recommendation method according to claim 6, characterized in that: The comprehensive calculation of population nutritional requirements and food sorting process in S6 includes the following steps: S61. Obtain the nutritional recommendation feature parameters; S62. Input the nutrition recommendation feature parameters into a pre-trained factorization machine model. The factorization machine model performs feature cross calculation on the nutrition recommendation feature parameters based on its model parameters to generate a personalized nutrition recommendation score for each user and the food. S63. The personalized nutrition recommendation scores of all users in the target group are weighted and aggregated to calculate the comprehensive recommendation score of each food for the target group, where the weighting factor takes into account the priority of the individual user's nutritional gap in the group. S64. Based on the comprehensive recommendation score, sort the food in the candidate food set data in descending order, select the top-ranked preset number of food, and combine them into a recipe scheme that meets the nutritional needs of a meal and a day, respectively, to generate nutritional recipe recommendation data for the target group.
8. The intelligent nutrition recipe recommendation method according to claim 7, characterized in that: The construction and training method of the pre-trained factorization machine model in S62 includes the following steps: S621. Collect historical user group ordering records, corresponding user basic information, activity information and post-meal feedback data to construct a training sample set, wherein the features of each sample include user group features, food features and the group's choice of the food. S622. Construct a factorization machine model whose objective function is suitable for predicting the probability that a given user group will choose a particular food when given user group characteristics and food characteristics. S623. For different group sizes, the factorization machine model is trained differently using historical group sample data of the corresponding size to obtain multiple sub-models specifically applicable to single, two, four, six and eight group scenarios. S624. In the model application stage, based on the actual number of people in the current target group, call the corresponding trained sub-model to execute steps S62 to S64.
9. The intelligent nutrition recipe recommendation method according to claim 8, characterized in that: The S7 food ordering instruction processing includes the following steps: S71. Push the nutritional recipe recommendation data for the target group to the terminal devices of the target users and associated users for display; S72. Receive the final recipe selection instruction confirmed by the target user from the nutritional recipe recommendation data of the target group; S73. Based on the final recipe selection instruction, generate meal order data including recipe details, delivery information and payment information; S74. Send the meal order data to the meal service system to trigger the meal preparation and delivery process, and complete the execution of the meal order instruction data.
10. The intelligent nutrition recipe recommendation system according to claim 1, used to implement the intelligent nutrition recipe recommendation method according to any one of claims 1-9, characterized in that: The system includes: The user data collection and management module collects terminal interaction data of target users and related users, archives basic information, activity information and dietary intake information through the information storage unit, and outputs basic information data of target users through the data cleaning unit. The nutrition requirements analysis and gap calculation module receives the target user's basic information data, parses the individual nutrition requirements through the nutrition requirements calculation unit, generates the current nutrition gap using the gap comparison unit, and outputs the individual nutrition gap data through the data aggregation unit. The food screening and feature construction module receives the individual nutritional gap data, filters candidate foods through the knowledge graph query unit, processes food attributes using the feature parameter construction unit, and outputs nutritional recommendation feature parameters through the vectorization processing unit. The intelligent recommendation algorithm module receives the nutritional recommendation feature parameters, performs feature cross-calculation through the model inference unit, generates personalized recommendation scores using the ranking strategy unit, and outputs nutritional recipe recommendation data for the target group through the result aggregation unit. The recipe recommendation and order execution module receives nutritional recipe recommendation data from the target group, pushes recipe plans through the interface display unit, confirms the user's selection through the instruction receiving unit, and completes the meal ordering process through the order execution unit.