Food material recommendation method, controller, food material recommendation system, and storage medium
Patent Information
- Application Number
- CN202211107864.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-13
- Publication Date
- 2026-10-09
- Estimated Expiration
- 2042-09-13
AI Technical Summary
[0002]目前,随着现代社会科学技术发展,以及人们对于生活质量的要求越来越高,合理搭配膳食成为了大多数人的日常需求,而随着工作节奏加快,导致人们常常无暇研究如何搭配出营养均衡的膳食;
[0011]The food recommendation method according to a first aspect of the present invention has at least the following beneficial effects: The method obtains user information representing a user's dietary preferences; determines a target dietary plan from preset dietary plans based on the user information; obtains multiple pre-selected ingredients from a preset food pre-selection list based on the target dietary plan; each pre-selected ingredient corresponds to at least one pre-selection tag, which represents the recommendation type of the pre-selected ingredient and includes user-preferred ingredient tags and similar ingredient tags. The multiple pre-selected ingredients are sorted according to the pre-selection tags to obtain a food recommendation list. Obtaining multiple pre-selected ingredients from the preset food pre-selection list based on the target dietary plan effectively increases the number of pre-selected ingredients corresponding to the target dietary plan, thus making the recommendation results more accurate even without sufficient user data. Sorting the multiple pre-selected ingredients based on the pre-selection tags to obtain the food recommendation list makes the recommendation results more diverse, recommending personalized food plans to users and improving the user experience.
Smart Images

Figure CN117747057B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of intelligent recommendation technology, specifically to a food recommendation method, controller, food recommendation system, and storage medium. Background Technology
[0002] Currently, with the development of modern science and technology and people's increasing demands for quality of life, a balanced diet has become a daily need for most people. However, with the fast pace of work, people often have no time to study how to create a nutritionally balanced diet.
[0003] In related technologies, there are food recommendation methods that can select a recommended option from preset options based on the user's needs and recommend the corresponding food to the user. However, the existing food recommendation methods have a limited number of recommended options that correspond to a limited number of food items. Without a large amount of user data and with too few recommended options that correspond to a limited number of food items, a cold start problem will be encountered, affecting the accuracy and diversity of the recommendation results and impacting the user experience. Summary of the Invention
[0004] The following is an overview of the topics described in detail in this article.
[0005] This application provides a food recommendation method, controller, food recommendation system, and storage medium. At least, it can ensure that the method can more effectively recall the pre-selected foods corresponding to the target dietary plan through a preset food pre-selection list and pre-selection tags, increase the amount of pre-selected foods corresponding to the target dietary plan, and thus obtain more accurate and diverse food recommendation results even without sufficient user data.
[0006] A first aspect of the present invention provides a method for recommending food ingredients, the method comprising:
[0007] Obtain user information that characterizes users' dietary preferences;
[0008] The target dietary plan is determined from the preset dietary plan based on the user information;
[0009] According to the target dietary plan, multiple pre-selected ingredients are obtained from a preset ingredient pre-selection list. Each pre-selected ingredient corresponds to at least one pre-selection tag. The pre-selection tag represents the recommendation type of the pre-selected ingredient. The pre-selection tag includes user-preferred ingredient tags and similar ingredient tags of user-preferred ingredients.
[0010] The multiple pre-selected ingredients are sorted according to the pre-selected tags to obtain a recommended ingredient list.
[0011] The food recommendation method according to a first aspect of the present invention has at least the following beneficial effects: The method obtains user information representing a user's dietary preferences; determines a target dietary plan from preset dietary plans based on the user information; obtains multiple pre-selected ingredients from a preset food pre-selection list based on the target dietary plan; each pre-selected ingredient corresponds to at least one pre-selection tag, which represents the recommendation type of the pre-selected ingredient and includes user-preferred ingredient tags and similar ingredient tags. The multiple pre-selected ingredients are sorted according to the pre-selection tags to obtain a food recommendation list. Obtaining multiple pre-selected ingredients from the preset food pre-selection list based on the target dietary plan effectively increases the number of pre-selected ingredients corresponding to the target dietary plan, thus making the recommendation results more accurate even without sufficient user data. Sorting the multiple pre-selected ingredients based on the pre-selection tags to obtain the food recommendation list makes the recommendation results more diverse, recommending personalized food plans to users and improving the user experience.
[0012] In some embodiments, obtaining multiple pre-selected ingredients from a preset ingredient pre-selection list according to the target dietary plan includes:
[0013] At least one ingredient feature label is obtained based on the target dietary plan;
[0014] Based on the pre-selected ingredient list, obtain the user-preferred ingredient tags and similar ingredient tags corresponding to the ingredient feature tags;
[0015] Multiple pre-selected ingredients are obtained from the ingredient pre-selection list based on the user's preferred ingredient tags and the similar ingredient tags.
[0016] In some embodiments, obtaining multiple pre-selected ingredients from the ingredient pre-selection list based on the user-preferred ingredient tags and the similar ingredient tags includes:
[0017] Calculate the similarity between the user's preferred ingredients and multiple pre-selected ingredients in the ingredient pre-selection list;
[0018] Based on the similarity of the ingredients, similar ingredients corresponding to the similar ingredient tags are obtained from the pre-selected list of ingredients.
[0019] In some embodiments, calculating the similarity between user-preferred ingredients and multiple pre-selected ingredients in the ingredient pre-selection list includes:
[0020] Calculate the similarity of food types based on the user's preferred food and the food type information of the pre-selected food;
[0021] Calculate the nutritional similarity of ingredients based on the nutritional information of the user's preferred ingredients and the pre-selected ingredients;
[0022] Based on the food suitability information of the user's preferred food and the pre-selected food, the food suitability information is calculated, whereby the food suitability information indicates whether the user's preferred food and the pre-selected food can be eaten at the same time.
[0023] The similarity of ingredients is obtained by calculating the similarity of ingredient types, calculating the similarity of ingredients nutrition, and calculating the suitability of ingredients.
[0024] In some embodiments, the step of sorting multiple pre-selected ingredients according to pre-selected tags to obtain an ingredient recommendation list includes:
[0025] The weight coefficients corresponding to the pre-selected labels are obtained according to the preset weight list;
[0026] The recommendation score for the pre-selected ingredients is obtained based on the pre-selected tags corresponding to the pre-selected ingredients and the weight coefficients corresponding to the pre-selected tags.
[0027] The pre-selected ingredients are sorted according to the recommended scores to obtain a recommended ingredient list.
[0028] In some embodiments, obtaining the recommendation score for the pre-selected ingredients based on the pre-selected labels corresponding to the pre-selected ingredients and the weighting coefficients corresponding to the pre-selected labels includes:
[0029] When a single pre-selected ingredient corresponds to multiple pre-selected tags, the sum of the weight coefficients corresponding to the multiple pre-selected tags is determined as the recommendation score of the pre-selected ingredient.
[0030] In some embodiments, after obtaining user information, the method further includes:
[0031] Conflicting ingredients are determined based on the user's personal health information;
[0032] The conflicting ingredients are hidden from the ingredient pre-selection list.
[0033] In some embodiments, when the pre-selected ingredients correspond to multiple pre-selected tags, the pre-selected tag with the highest preset weight coefficient is designated as the target tag for the pre-selected ingredients. The step of sorting the multiple pre-selected ingredients according to the pre-selected tags to obtain an ingredient recommendation list includes:
[0034] The multiple pre-selected ingredients are sorted according to the pre-selected labels to obtain a pre-selected ingredient sequence;
[0035] Based on the pre-selected ingredient sequence and the preset number of recommended ingredients, an ingredient recommendation list is obtained, wherein the ingredient recommendation list includes at least two pre-selected ingredients with different target tags.
[0036] In some embodiments, the pre-selected labels may include at least one of the following: seasonal ingredients labels, popular ingredients labels, and historically recommended ingredients labels.
[0037] An embodiment of the second aspect of the present invention provides a controller, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the food recommendation method as described in any of the embodiments of the first aspect above.
[0038] A third aspect of the present invention provides a food recommendation system, comprising a controller as described in the second aspect of the present invention.
[0039] An embodiment of the fourth aspect of the present invention provides a computer-readable storage medium storing computer-executable instructions for performing the ingredient recommendation method as described in any of the embodiments of the first aspect above.
[0040] Other features and advantages of the invention will be set forth in the following description, and will be apparent in part from the description, or may be learned by practicing the invention. The objects and other advantages of the invention may be realized and obtained by means of the structures particularly pointed out in the description and the drawings. Attached Figure Description
[0041] Figure 1 This is a flowchart of the food ingredient recommendation method provided in the embodiments of the present invention;
[0042] Figure 2 This is a flowchart illustrating how a method for recommending ingredients, according to a target dietary plan, obtains pre-selected ingredients with multiple pre-selected tags from a preset list of ingredients.
[0043] Figure 3 This is a flowchart illustrating how the method for recommending ingredients in this invention generates similar ingredient tags for user-preferred ingredients based on user-preferred ingredient tags and a pre-selected ingredient list.
[0044] Figure 4 This is a flowchart illustrating the process of calculating the similarity between user-preferred food tags and multiple pre-selected food items in the food recommendation method provided in this embodiment of the invention.
[0045] Figure 5 This is a flowchart of the food recommendation method provided in this embodiment of the invention, which sorts multiple pre-selected food ingredients according to pre-selected tags to obtain a food recommendation list;
[0046] Figure 6 This is an additional flowchart of the steps after obtaining user information in the food recommendation method provided in this embodiment of the invention;
[0047] Figure 7 This is a flowchart of the food recommendation method provided in this embodiment of the invention, which sorts multiple pre-selected food ingredients according to pre-selected tags to obtain a food recommendation list;
[0048] Figure 8 This is a schematic diagram of the structure of the food recommendation system provided in an embodiment of the present invention;
[0049] Figure 9 This is a schematic diagram of the terminal interface of the food recommendation system provided in an embodiment of the present invention.
[0050] Figure 10 This is a schematic diagram of the controller provided in an embodiment of the present invention. Detailed Implementation
[0051] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention. Furthermore, the features, operations, or characteristics described in the specification can be combined in any suitable manner to form various implementations. Simultaneously, the steps or actions in the method description can be rearranged or adjusted in a manner readily apparent to those skilled in the art. Therefore, the various orders in the specification and drawings are merely for the clear description of a particular embodiment and do not imply a mandatory order, unless otherwise stated that a particular order must be followed.
[0052] In the description of this invention, "several" means one or more, "more than" means two or more, "greater than," "less than," and "exceeding" are understood to exclude the stated number, while "above," "below," and "within" are understood to include the stated number. The use of "first" and "second" in the description is merely for distinguishing technical features and should not be construed as indicating or implying relative importance, or implicitly indicating the number of indicated technical features, or implicitly indicating the order of the indicated technical features.
[0053] The serial numbers assigned to components in this document, such as "first" and "second," are used only to distinguish the described objects and have no sequential or technical meaning. Unless otherwise specified, the terms "connection" and "linkage" used in this application include both direct and indirect connections.
[0054] In the description of this invention, unless otherwise explicitly defined, terms such as "set up," "install," and "connect" should be interpreted broadly, and those skilled in the art can reasonably determine the specific meaning of the above terms in this invention in conjunction with the specific content of the technical solution.
[0055] Currently, there are food recommendation methods in related technologies. These methods allow users to select from preset options based on their needs and recommend corresponding ingredients. However, current recommendation algorithms for dietary directions are mostly applied to recipes, rather than the ingredients themselves. Furthermore, most recommendation algorithms encounter a cold start problem when first built due to a lack of user data. Moreover, with a large amount of user data, they easily become trapped in "information cocoons," affecting the diversity, accuracy, and overall user experience of the recommendations.
[0056] Based on the above, embodiments of the present invention provide a food recommendation method, a controller, a food recommendation system, and a computer-readable storage medium. The food recommendation method of this application is applied to a food recommendation system. This method can acquire user information representing a user's dietary preferences, determine a target dietary plan from preset dietary plans based on the user information, and obtain multiple pre-selected ingredients from a preset food pre-selection list based on the target dietary plan. Each pre-selected ingredient corresponds to at least one pre-selection tag, which represents the recommendation type of the pre-selected ingredient. The pre-selection tags include user-preferred ingredient tags and similar ingredient tags. The multiple pre-selected ingredients are sorted according to the pre-selection tags to obtain a food recommendation list. Obtaining multiple pre-selected ingredients from the preset food pre-selection list based on the target dietary plan effectively increases the number of pre-selected ingredients corresponding to the target dietary plan, thus making the recommendation results more accurate even without sufficient user data. Sorting the multiple pre-selected ingredients using pre-selection tags to obtain the food recommendation list makes the recommendation results more diverse, recommending personalized food plans to users and improving the user experience.
[0057] The embodiments of the present invention will be further described below with reference to the accompanying drawings.
[0058] like Figure 1 As shown, Figure 1 This is a flowchart of a food recommendation method provided in an embodiment of the present invention. The food recommendation method in this embodiment includes, but is not limited to, steps S110, S120, S130 and S140.
[0059] Step S110: Obtain user information representing the user's dietary preferences;
[0060] In some embodiments, user information includes, but is not limited to, the user's personal health information, ingredients that the user is interested in, historical food storage records obtained by the user through food recommendation methods, and user dietary preference data such as ingredients that the user cannot eat. Based on the above user dietary preference data, a target dietary plan that meets the user's needs can be obtained, and then corresponding ingredients can be recommended to the user in subsequent steps.
[0061] In some embodiments, user information includes user ID and other identifying data that can identify the user, user's personal health information, ingredients that the user is interested in, historical ingredient storage records obtained by the user through the ingredient recommendation method, and user dietary preference data such as ingredients that the user cannot eat. This information can be pre-stored in a cloud server. The cloud server establishes a mapping table between user information and user dietary preference data in advance. When the identifying data that can identify the user is obtained from the user information, the ingredient recommendation system applying the ingredient recommendation method of this application can send the identifying data to the cloud server. The cloud server responds to the identifying data and sends the corresponding user dietary preference data to the ingredient recommendation system through the mapping table, thereby enabling the ingredient recommendation system to obtain user information that represents the user's dietary preferences.
[0062] In some embodiments, obtaining user information characterizing a user's dietary preferences includes user information characterizing a user's dietary preferences obtained directly from user input by the terminal system applying the food recommendation method, and user information characterizing a user's dietary preferences obtained from historical food recommendation data of the terminal system applying the food recommendation method.
[0063] Step S120: Determine the target dietary plan from the preset dietary plans based on the user information;
[0064] In some embodiments, a target dietary plan is determined from preset dietary plans based on user information, including but not limited to the user's personal health information, ingredients that the user is interested in, historical food storage records obtained by the user through food recommendation methods, and food that the user cannot eat, as well as other user dietary preference data. The target dietary plan is determined from preset dietary plans based on the user's dietary preference data, and then the corresponding ingredients for the target dietary plan are recalled and added to the recommended food pre-selection list as candidates.
[0065] In some embodiments, a target dietary plan is determined from preset dietary plans based on user information. Different preset dietary plans correspond to different dietary needs, such as dietary plans for health maintenance, regulating blood pressure, blood sugar, and cholesterol, and weight loss. Different dietary plans correspond to different pre-selected ingredients. At the same time, multiple preset dietary plans can be combined to expand the richness of preset dietary plans, thereby effectively increasing the variety of dietary plans. This makes the recommendation results more diverse even without sufficient user data, recommending personalized food plans to users and improving the user experience.
[0066] In some embodiments, a target dietary plan is formed based on user information including but not limited to the user's personal health information, ingredients that the user is interested in, and any multiple ingredients from the historical ingredient storage records obtained by the user through the ingredient recommendation method. This allows for the recommendation of personalized ingredient plans to the user, improving the user experience. After the recommendation is completed, the newly added ingredient plan is saved to the database of the terminal using the ingredient recommendation method or a cloud database. This allows the user to be provided with historical dietary plans generated based on user information when they use the ingredient recommendation method again, further improving the user experience.
[0067] In some embodiments, the specific process of determining a target dietary plan from preset dietary plans based on user information includes: firstly, summarizing and categorizing several groups of people who are most concerned about dietary health as dietary plans, such as: health-conscious individuals, those who regulate blood pressure, blood sugar, and cholesterol, and those who want to lose weight and reduce fat; then mapping these groups to relevant topics, such as: health-conscious individuals corresponding to: anti-aging, longevity, the elderly, and boosting immunity; and each topic corresponding to different nutritional labels, such as: boosting immunity corresponding to: high vitamin A, high vitamin C, high selenium, high zinc, and high protein; and ingredients with the corresponding nutritional labels can be screened out through these labels. During use, dietary plans that meet the conditions derived from the user's personal information are first designated as recommended plans, and users can also choose plans of interest to combine; then, based on the mapping, the ingredients corresponding to the final dietary plan are recalled and added to the recommended ingredient pre-selection list as candidates.
[0068] Step S130: Based on the target dietary plan, obtain multiple pre-selected ingredients from the preset ingredient pre-selection list. Each pre-selected ingredient corresponds to at least one pre-selection tag. The pre-selection tag represents the recommendation type of the pre-selected ingredient. The pre-selection tag includes user-preferred ingredient tags and similar ingredient tags of user-preferred ingredients.
[0069] In some embodiments, the user-preferred ingredients are pre-selected ingredients corresponding to the user-preferred ingredient tags. This application obtains multiple pre-selected ingredients from a preset ingredient pre-selection list according to the target dietary plan. Each pre-selected ingredient corresponds to at least one pre-selection tag. The pre-selection tag represents the recommendation type of the pre-selected ingredient. The pre-selection tag includes the user-preferred ingredient tag and the similar ingredient tag of the user-preferred ingredient. The pre-selection tag represents the recall source of the recalled pre-selected ingredients. For example, the user-preferred ingredients corresponding to the user-preferred ingredient tags are pre-selected ingredients corresponding to the target dietary plan based on the user's dietary preferences according to the user information, and pre-selected ingredients corresponding to user dietary preference data such as the user's personal health information, ingredients that the user is interested in, and historical ingredient storage records obtained by the user through the ingredient recommendation method.
[0070] In some embodiments, the user's preferred ingredients are the preset ingredients corresponding to the user's personal information tags. These are pre-selected ingredients that can be directly determined through the target dietary plan. Each ingredient belongs to a fixed category, has certain nutritional attributes, and is suitable for certain health topics. Therefore, certain ingredient features can be extracted based on these attributes. Similarity relationships between ingredients can be constructed based on these features to obtain similar ingredients to the user's preferred ingredients. By recalling similar ingredients to the user's preferred ingredients through the preset ingredient pre-selection list, the number of pre-selected ingredients corresponding to the target dietary plan can be effectively increased. This results in more accurate and diverse ingredient recommendation results even without sufficient user data, allowing users to obtain the recommended results in the simplest way.
[0071] In some embodiments, the richer the sources of the pre-selected ingredients, the more data the pre-selected ingredients can generate, thereby solving the cold start problem of the recommendation algorithm and providing appropriate recommendation results when there is not enough user data. The pre-selected tags also include at least one of the following: seasonal ingredients, popular ingredients, and historically recommended ingredients. That is, in addition to the two recall methods of user-preferred ingredients and similar ingredients in the above embodiments, which are pre-selected ingredients corresponding to the target dietary plan based on the user's dietary preferences according to user information, the food recommendation method of this application will also recall all users' storage records to extract the most popular ingredients stored in the current month, the seasonal ingredients of the current month, and the historical stored ingredients of the current user as supplementary items to be added to the candidate list of recommended ingredients to improve the diversity of the recommendation algorithm. Among them, historically stored ingredients include usable ingredients currently stored by the user, such as food stored at home or in a warehouse. Historically stored ingredients also include historically recommended ingredients, that is, historically recommended ingredients obtained by the user through the food recommendation method.
[0072] In some embodiments, seasonal ingredients include, but are not limited to, foods that grow and mature at the current time or solar term, and things that are available for sale according to the current season or solar term; popular ingredients include, but are not limited to, popular ingredients that have attracted widespread attention and discussion, obtained by the ingredient recommendation system using the ingredient recommendation method of this application through the network, and popular ingredients that have been recommended many times by the current ingredient recommendation system, obtained by the ingredient recommendation system using the ingredient recommendation method of this application through historical data.
[0073] Step S140: Sort multiple pre-selected ingredients according to the pre-selected tags to obtain a recommended ingredient list.
[0074] In some embodiments, multiple pre-selected ingredients are sorted according to pre-selected tags to obtain an ingredient recommendation list. The pre-selected tags represent the main recall sources of the pre-selected ingredients. The recommendation degree of pre-selected ingredients from different recall sources is different. Therefore, sorting multiple pre-selected ingredients according to pre-selected tags can effectively improve the accuracy of the recommendation results in the ingredient recommendation list, thereby enabling the ingredient recommendation list to better meet user needs. Specifically, when the pre-selected tags include user-preferred ingredient tags, similar ingredient tags of user-preferred ingredients, seasonal ingredient tags, popular ingredient tags, and historically recommended ingredient tags, the weight ranking of different sources is: user-preferred ingredient tags > similar ingredient tags of user-preferred ingredients > seasonal ingredient tags > popular ingredient tags = historically recommended ingredient tags. Sorting multiple pre-selected ingredients according to the above weight ranking can obtain more accurate and diverse ingredient recommendation results even without sufficient user data.
[0075] In some embodiments, multiple pre-selected ingredients are sorted according to pre-selected tags to obtain an ingredient recommendation list. The pre-selected tags represent the main recall sources of the pre-selected ingredients. Each pre-selected ingredient corresponds to multiple pre-selected tags. When a single pre-selected ingredient corresponds to multiple pre-selected tags, the sum of the weight coefficients corresponding to the multiple pre-selected tags is determined as the recommendation score of the pre-selected ingredient. The recommendation degree of pre-selected ingredients from different recall sources is different. Therefore, sorting multiple pre-selected ingredients according to pre-selected tags can effectively improve the accuracy of the recommendation results in the ingredient recommendation list, thereby enabling the ingredient recommendation list to better meet user needs. Specifically, when the pre-selected tags include user-preferred ingredient tags, similar ingredient tags of user-preferred ingredients, seasonal ingredients, popular ingredients, and historically recommended ingredients, the weight ranking of different sources is: user-preferred ingredient tags > similar ingredient tags of user-preferred ingredients > seasonal ingredient tags > popular ingredient tags = historically recommended ingredient tags. The recommendation score of multiple pre-selected ingredients is calculated based on the above weight ranking, and sorting is performed according to the recommendation score, which can further improve the accuracy and effectiveness of the ingredient recommendation results.
[0076] In some embodiments, multiple pre-selected ingredients are sorted according to pre-selected tags to obtain an ingredient recommendation list. By using a preset ingredient pre-selection list and pre-selected tags, the pre-selected ingredients corresponding to the target dietary plan can be recalled more effectively, increasing the amount of pre-selected ingredients corresponding to the target dietary plan, and thus obtaining more accurate and diverse ingredient recommendation results even without sufficient user data.
[0077] In some embodiments, the food recommendation method of this application establishes a mapping relationship between personal information, dietary plans, and food lists in advance, and constructs food tags and similarity relationships between tags before recommending food to users. Once personal information and historical food storage records are obtained, food is recalled through mapping and similarity relationships to construct a pre-selected list of recommended foods. Foods with user-defined allergies and unsuitable foods from various topic tags (i.e., those conflicting with the pre-selected list) are removed. Foods from different sources are weighted and scored, and then sorted according to the final total score to obtain a sorted pre-selected list. The top n foods are selected based on different needs. Finally, to prevent the main tag of the recommended food from being too singular (i.e., the tag with the highest score), if the main source of the top n-1 foods is the same, the last food to be recommended is pushed forward sequentially. Multiple pre-selected foods are then sorted according to their pre-selected tags to obtain a recommended food list. This effectively increases the number of pre-selected foods corresponding to the target dietary plan, making the recommendation results more accurate even without sufficient user data. The resulting food recommendation list makes the recommendation results more diverse, allowing for personalized food recommendations and improving the user experience. Furthermore, since the pre-selected list is pre-set, the response speed of the food recommendation method can be further improved, obtaining recommendation results quickly with lower time costs.
[0078] In some embodiments, this patent proposes a food recommendation method based on user information and food characteristics. By utilizing pre-constructed mapping relationships and food similarity relationships, it improves computational speed compared to large-scale models, not only solving the common cold-start problem in recommendation systems but also incorporating multiple influencing factors into the recommendation algorithm, thus enhancing the diversity of recommendation results. Compared to some existing solutions, the proposed solution is more targeted, and the pre-deployed model algorithm offers higher real-time performance. Furthermore, this solution meets complex user needs, providing users with a scientifically effective and personalized food recommendation method, addressing user pain points.
[0079] like Figure 2 As shown, Figure 2 This is a flowchart of a method for recommending ingredients according to a target dietary plan, in which multiple pre-selected ingredients with pre-selected labels are obtained from a preset list of ingredients. The method for recommending ingredients according to an embodiment of the present invention includes, but is not limited to, steps S210, S220 and S230.
[0080] Step S210: Obtain at least one ingredient feature label based on the target dietary plan;
[0081] Step S220: Obtain the user preference food tags and similar food tags corresponding to the food feature tags based on the food pre-selection list;
[0082] Step S230: Obtain multiple pre-selected ingredients from the ingredient pre-selection list based on the user's preferred ingredient tags and similar ingredient tags.
[0083] In some embodiments, the ingredient feature label corresponds to the ingredient feature. This application can obtain one or more ingredient features based on the target dietary plan, including obtaining multiple ingredient nutritional features based on the target dietary plan. There can be multiple target dietary plans. Specifically, based on user needs such as health-preserving, regulating blood pressure, blood sugar, and cholesterol, and weight loss, these target dietary plans are mapped to related ingredient effects. For example, the health-preserving dietary plan corresponds to the effects of anti-aging, longevity, easy consumption by the elderly, and enhanced immunity. Each ingredient effect corresponds to different ingredient nutritional features. For example, the effect of enhancing immunity corresponds to the nutritional features of high vitamin A, high vitamin C, high selenium, high zinc, and high protein. Ingredients with such nutritional features can be screened out through the ingredient nutritional features. Ingredients with such nutritional features are the user-preferred ingredients corresponding to the user's personal tags.
[0084] In some embodiments, user-preferred ingredients are obtained based on ingredient characteristics and a pre-selected ingredient list. The pre-selected ingredient list includes a mapping relationship between ingredient characteristics and user-preferred ingredients. User-preferred ingredients can be effectively obtained from the pre-selected ingredient list based on this mapping relationship. The pre-selected ingredient list is preset in advance, which can further improve the response speed of the ingredient recommendation method and obtain recommendation results quickly within a low time cost.
[0085] In some embodiments, similar ingredients to the user's preferred ingredients are obtained based on the user's preferred ingredients and a pre-selected list of ingredients. The pre-selected list of ingredients includes a mapping relationship between the user's preferred ingredients and similar ingredients. Based on this mapping relationship, similar ingredients to the user's preferred ingredients can be effectively obtained from the pre-selected list of ingredients. The pre-selected list of ingredients is preset in advance, which can further improve the response speed of the ingredient recommendation method and obtain recommendation results quickly within a low time cost.
[0086] In some embodiments, user-preferred ingredient tags are obtained based on ingredient characteristics and a pre-selected ingredient list. In cases where the pre-selected ingredient list includes only multiple pre-selected lists, the ingredient recommendation system of the nutritional ingredient recommendation method traverses each ingredient and calculates the similarity of each ingredient to obtain user-preferred ingredient tags and similar ingredient tags.
[0087] like Figure 3 As shown, Figure 3 This is a flowchart of the food recommendation method provided in the embodiments of the present invention, in which multiple pre-selected foods are obtained from the food pre-selection list based on user preference food tags and similar food tags. The food recommendation method in the embodiments of the present invention includes, but is not limited to, steps S310 and S320.
[0088] Step S310: Calculate the similarity between the user's preferred ingredients and multiple pre-selected ingredients in the ingredient pre-selection list;
[0089] Step S320: Obtain similar ingredients to the user's preferred ingredients from the ingredient pre-selection list based on ingredient similarity.
[0090] In some embodiments, food similarity can be calculated by traversing multiple pre-selected foods in a food pre-selection list and then calculating the food similarity between the multiple pre-selected foods and the user-preferred foods. The method for calculating food similarity includes, but is not limited to, vectorizing the preset foods according to their food type and nutritional information to obtain the user-preferred food vector and the pre-selected food vector, calculating the cosine similarity between the multiple food vectors, and sorting the pre-selected foods according to the cosine similarity to obtain the similar food sequence of the user-preferred foods.
[0091] In some embodiments, similar ingredients to the user's preferred ingredients are obtained based on the user's preferred ingredients and a pre-selected list of ingredients. This includes calculating the similarity between the user's preferred ingredients and multiple pre-selected ingredients in the pre-selected list, and obtaining similar ingredients to the user's preferred ingredients from the pre-selected list based on the similarity. Specifically, each ingredient belongs to a fixed category, has certain nutritional attributes, and has an attribute of suitability for certain health topics. Therefore, certain ingredient features can be extracted based on these attributes, and a similarity relationship between ingredients can be constructed based on these features. Similar ingredients to the user's preferred ingredients can then be obtained from the pre-selected list of ingredients.
[0092] like Figure 4 As shown, Figure 4 This is a flowchart illustrating the process of calculating the similarity between user-preferred ingredients and multiple pre-selected ingredients in the ingredient recommendation method provided in this embodiment of the invention. The ingredient recommendation method in this embodiment of the invention includes, but is not limited to, steps S410, S420, S430, and S440.
[0093] Step S410: Calculate the similarity of ingredient types based on the ingredient type information of the user's preferred ingredients and the pre-selected ingredients;
[0094] Step S420: Calculate the nutritional similarity of ingredients based on the nutritional information of the user's preferred ingredients and the pre-selected ingredients;
[0095] Step S430: Calculate the suitability of ingredients based on the suitability information of the user's preferred ingredients and the pre-selected ingredients. The suitability information indicates whether the user's preferred ingredients and the pre-selected ingredients can be eaten at the same time.
[0096] Step S440: Obtain the ingredient similarity based on the similarity of ingredient types, the similarity of ingredient nutrition, and the suitability of ingredient.
[0097] In some embodiments, the labels of the pre-selected ingredients include, but are not limited to, category labels, nutrition labels, and suitability attributes. Regarding the category labels of the pre-selected ingredients, considering the hierarchical relationship between category labels, the more identical category labels there are among ingredients, the slower the score increases. Therefore, utilizing the convex upward property of the square root of the fraction, the calculation formula is as follows:
[0098]
[0099] For nutrition labels on food ingredients, considering that nutrition labels are independent of each other, the more identical nutrition labels there are among different ingredients, the faster the integral increases. Utilizing the concave property of the square of a fraction, the calculation formula is as follows:
[0100]
[0101] For the suitability attribute of health topics, the scoring method is the same as that of the nutrition label of food; if the suitable food label of food i appears in the unsuitable food label of food j, a penalty item needs to be added, where weight represents the corresponding weight coefficient and card represents the nutrition label item.
[0102] In some embodiments, the similarity of food types is calculated based on the food type information of the user's preferred food and the pre-selected food; the similarity of food nutrition is calculated based on the food nutrition information of the user's preferred food and the pre-selected food; and the suitability of food is calculated based on the food suitability information of the user's preferred food and the pre-selected food. Food suitability information indicates whether the user's preferred food and the pre-selected food can be eaten at the same time. The food similarity is obtained by calculating the food type similarity, the food nutrition similarity, and the food suitability. Finally, the food is sorted by the sum of the scores of each item to construct a list of foods most similar to a single food. When the user uses the food recommendation function, the user's food storage record is read, and the food most similar to the historically stored food is recalled and added to the candidate list of recommended food pre-selection items.
[0103] like Figure 5 As shown, Figure 5 This is a flowchart of the food recommendation method provided in the embodiment of the present invention, which sorts multiple pre-selected food ingredients according to pre-selected tags to obtain a food recommendation list. The food recommendation method in the embodiment of the present invention includes, but is not limited to, steps S510, S520 and S530.
[0104] Step S510: Obtain the weight coefficients corresponding to the pre-selected labels according to the preset weight list;
[0105] Step S520: Obtain the recommendation score of the pre-selected ingredients based on the pre-selected labels corresponding to the pre-selected ingredients and the weight coefficients corresponding to the pre-selected labels;
[0106] Step S530: Sort the pre-selected ingredients according to the recommendation scores to obtain a recommended ingredient list.
[0107] In some embodiments, this food recommendation method may also recall all users' storage records to extract the most popular food items stored in the current month, seasonal food items for the current month, and historical food items stored by the current user, and add them as supplementary items to the candidate list of recommended food items to improve the diversity of the recommendation algorithm.
[0108] In some embodiments, the weight coefficients corresponding to pre-selected tags are obtained according to a preset weight list, and the pre-selected ingredients are weighted and re-sorted accordingly. When a single pre-selected ingredient corresponds to multiple pre-selected tags, the sum of the weight coefficients corresponding to the multiple pre-selected tags is determined as the recommendation score of the pre-selected ingredient. Specifically, when a candidate ingredient is added to the recommended ingredient pre-selection list, it carries the tag of its recall source and the corresponding score, and the tag corresponding to its highest score is the main tag displayed on the front end. Different recall sources have different score calculation methods and weights. For recall sources with personal information tags, there is some overlap in the nutrition tags of different topics. Foods with nutrition tags will have the frequency of the final nutrition tag appearance as the score for that tag. Different dietary plans correspond to different weights; for example, pregnant women, infants, and those who need special attention for regulating high blood pressure, high cholesterol, and high blood sugar, their scores are increased. For the recall of similar and popular ingredients, the ranking decreases from 1 successively according to their similarity and popularity. For ingredients recalled from historical storage records and seasonal ingredients, their scores are all 1.
[0109] In some embodiments, the weighted ranking of different sources is: personal information tags > similar ingredient tags > seasonal ingredients > popular ingredients = historical stored records. The final ingredient score is the sum of the scores from different sources multiplied by their respective weights. The ingredients are then sorted based on their final scores to obtain more accurate and diverse ingredient recommendations even without sufficient user data.
[0110] like Figure 6 As shown, Figure 6 This is an additional flowchart of the steps after obtaining user information in the food recommendation method provided in this embodiment of the invention. The food recommendation method in this embodiment of the invention includes, but is not limited to, steps S610 and S620.
[0111] Step S610: Obtain conflicting ingredients based on the user's personal health information;
[0112] Step S620: Filter out conflicting ingredients from the ingredient pre-selection list.
[0113] In some embodiments, when personal information and historical food storage records are obtained, food is recalled through mapping and similarity relationships. After constructing a recommended food pre-selection list, food allergies set by the user and unsuitable food from each topic tag that conflicts with the food in the pre-selection list are removed to ensure user safety and improve user experience.
[0114] like Figure 7 As shown, Figure 7 This is a flowchart of the food recommendation method provided in the embodiment of the present invention, which sorts multiple pre-selected food ingredients according to pre-selected tags to obtain a food recommendation list. The food recommendation method in the embodiment of the present invention includes, but is not limited to, steps S710 and S720.
[0115] Step S710: Sort multiple pre-selected ingredients according to the pre-selected labels to obtain a pre-selected ingredient sequence;
[0116] Step S720: Based on the pre-selected ingredient sequence and the preset number of recommended ingredients, obtain an ingredient recommendation list. The ingredient recommendation list shall include at least two pre-selected ingredients with different target tags.
[0117] In some embodiments, multiple pre-selected ingredients are sorted according to pre-selected tags to obtain a pre-selected ingredient sequence. Based on the pre-selected ingredient sequence and a preset number of recommended ingredients, an ingredient recommendation list is obtained. The ingredient recommendation list includes at least two pre-selected ingredients with different target tags. Ingredients from different sources are weighted and scored, and sorted according to the final total score to obtain a sorted ingredient pre-selection list. The top n ingredients are selected according to different needs. Finally, to prevent the main tag of the recommended ingredients (i.e., the tag with the highest score) from being too singular, if the main sources of the top n-1 ingredients are all the same, the last ingredient to be recommended is sequentially postponed to the next ingredient.
[0118] Specifically, when multiple pre-selected tags correspond to pre-selected ingredients, the pre-selected tag with the highest pre-selected weight coefficient is preset as the target tag of the pre-selected ingredient. The multiple pre-selected ingredients are sorted according to the pre-selected tags. Specifically, when the ingredient recommendation list is obtained, if the first n ingredients are all with the same tag, the first n-1 ingredients are taken, and then the list is extended to the (n+1)th ingredient until an ingredient with a different main tag from the first n-1 ingredients is taken as the last ingredient. This ensures the diversity of recommended ingredients and avoids the problem of easily falling into an "information cocoon" when there is too much user data, which affects the diversity of recommendation results.
[0119] like Figure 8 As shown, Figure 8 This is a schematic diagram of the food recommendation system provided in an embodiment of the present invention.
[0120] In some embodiments, once the relationship between personal information, dietary plans, and ingredient lists is established, the algorithm model is loaded into memory to improve processing speed. The algorithm model is deployed in the cloud via an application interface, allowing various online devices or apps to access it. This enables these devices or apps to quickly obtain recommendation results at a lower time cost, improving user experience. Furthermore, the algorithm model requires relatively little training data and has relatively low hardware performance requirements, allowing for the construction of an algorithm model with sufficient accuracy to meet practical needs at a relatively low development cost.
[0121] In some embodiments, after the user inputs information into the application interface, the application interface's background program imports the Flask Web application framework of the Gunicorn HTTP server through an Nginx load balancer, thereby completing the service deployment of the food recommendation process. The Flask Web application framework includes a food retrieval module, a food filtering module, a weighted sorting module, and a re-sorting module corresponding to the food recommendation method in the above embodiments. The food retrieval module retrieves data including food items corresponding to personal information tags (user-preferred food items), seasonal food items, popular food items, food items corresponding to historical storage records, and similar food items. Food filtering corresponds to the step in the above embodiments of obtaining conflicting food items based on the user's personal health information and removing conflicting food items from the food pre-selection list. Weighted sorting corresponds to the step in the above embodiments of sorting multiple pre-selected food items according to pre-selected tags to obtain a food recommendation list. Re-sorting corresponds to the step in the above embodiments of obtaining a food recommendation list based on a pre-selected food sequence and a preset number of food recommendations, ensuring that the food recommendation list includes at least two pre-selected food items with different target tags.
[0122] like Figure 9 As shown, Figure 9 This is a schematic diagram of the terminal interface of the food recommendation system provided in this embodiment of the invention. When a user needs food recommendations, they can fill in their personal health information or select a dietary theme they are interested in through any interactive interface, and then see the recommended food. This allows users to obtain the recommendation results in the simplest way.
[0123] like Figure 10 As shown, Figure 10 This is a schematic diagram of the controller provided in an embodiment of the present invention.
[0124] refer to Figure 10 Some embodiments of the present invention provide a controller, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the food recommendation method of any of the above embodiments, for example, performing the above-described... Figure 2 Method steps S110 to S140, Figure 2 Method steps S210 to S230, Figure 3 Method steps S310 to S320, Figure 4 Method steps S410 to S440 Figure 5 Method steps S510 to S530, Figure 6 Method steps S610 to S620 Figure 7 Method steps S710 to S720.
[0125] The controller 1000 of this embodiment includes one or more processors 1001 and a memory 1002. Figure 10 The example uses a processor 1001 and a memory 1002.
[0126] Processor 1001 and memory 1002 can be connected via a bus or other means. Figure 8 Taking the example of a connection between China and Israel via a bus.
[0127] Memory 1002, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs and non-transitory computer-executable programs. Furthermore, memory 1002 may include high-speed random access memory, and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some embodiments, memory 1002 may optionally include memory 1002 remotely located relative to processor 1001. These remote memories can be connected to controller 1000 via a network, and examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
[0128] In some embodiments, when the processor executes a computer program, it executes the food recommendation method of any of the above embodiments at preset intervals.
[0129] Those skilled in the art will understand that Figure 10 The device structure shown does not constitute a limitation on the controller 1000 and may include more or fewer components than shown, or combine certain components, or have different component arrangements.
[0130] exist Figure 10 In the controller 1000 shown, the processor 1001 can be used to call the control program of the food recommendation system stored in the memory 1002, thereby realizing the food recommendation method.
[0131] Based on the hardware structure of the controller 1000 described above, various embodiments of the food recommendation system of the present invention are proposed.
[0132] The non-transitory software program and instructions required to implement the food recommendation method of the above embodiments are stored in memory. When executed by the processor, the food recommendation method of the above embodiments is executed.
[0133] Furthermore, embodiments of the present invention also provide a food recommendation system, which includes the controller described above.
[0134] In some embodiments, since the food recommendation system of the present invention has the controller of the above embodiments, and the controller of the above embodiments is capable of executing the food recommendation method of the above embodiments, the specific implementation and technical effects of the food recommendation system of the present invention can refer to the specific implementation and technical effects of the food recommendation method of any of the above embodiments.
[0135] This invention also provides a computer-readable storage medium storing computer-executable instructions for performing the above-described ingredient recommendation method. For example, the computer-executable instructions can cause one or more processors to perform the ingredient recommendation method described above, such as executing the methods described above. Figure 2 Method steps S110 to S140, Figure 2 Method steps S210 to S230, Figure 3 Method steps S310 to S320, Figure 4 Method steps S410 to S440 Figure 5 Method steps S510 to S530, Figure 6 Method steps S610 to S620 Figure 7 Method steps S710 to S720.
[0136] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate; that is, they may be located in one place or distributed across multiple network nodes. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.
[0137] Those skilled in the art will understand that all or some of the steps and systems in the methods disclosed above can be implemented as software, firmware, hardware, and suitable combinations thereof. Some or all of the physical components can be implemented as software executed by a processor, such as a central processing unit, digital signal processor, or microprocessor, or as hardware, or as an integrated circuit, such as an application-specific integrated circuit. Such software can be distributed on a computer-readable medium, which can include computer-readable storage media (or non-transitory media) and communication media (or transient media). As is known to those skilled in the art, the term computer-readable storage media includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules, or other data). Computer-readable storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technologies, CD-ROM, digital versatile disc (DVD) or other optical disc storage, magnetic cartridges, magnetic tape, disk storage or other magnetic storage devices, or any other medium that can be used to store desired information and is accessible to a computer. Furthermore, as is known to those skilled in the art, communication media typically contain computer-readable instructions, data structures, program modules, or other data in modulated data signals such as carrier waves or other transmission mechanisms, and may include any information delivery medium.
[0138] The above is a detailed description of the preferred embodiments of this application. However, this application is not limited to the above embodiments. Those skilled in the art can make various equivalent modifications or substitutions without departing from the spirit of this application. All such equivalent modifications or substitutions are included within the scope defined by the claims of this application.
Claims
1. A method for recommending ingredients, characterized in that, The method includes: Obtain user information that characterizes users' dietary preferences; The target dietary plan is determined from the preset dietary plan based on the user information; According to the target dietary plan, multiple pre-selected ingredients are obtained from a preset ingredient pre-selection list. Each pre-selected ingredient corresponds to at least one pre-selection tag. The pre-selection tag represents the recommendation type of the pre-selected ingredient. The pre-selection tag includes user-preferred ingredient tags and similar ingredient tags of user-preferred ingredients. The multiple pre-selected ingredients are sorted according to the pre-selected tags to obtain a recommended ingredient list; Wherein, when the pre-selected ingredients correspond to multiple pre-selected tags, the pre-selected tag with the largest preset weight coefficient is the target tag of the pre-selected ingredients, and the step of sorting the multiple pre-selected ingredients according to the pre-selected tags to obtain an ingredient recommendation list includes: The multiple pre-selected ingredients are sorted according to the pre-selected labels to obtain a pre-selected ingredient sequence; Based on the pre-selected ingredient sequence and the preset number of recommended ingredients, an ingredient recommendation list is obtained, wherein the ingredient recommendation list includes at least two pre-selected ingredients with different target tags.
2. The food ingredient recommendation method according to claim 1, characterized in that, The step involves obtaining multiple pre-selected ingredients from a preset ingredient pre-selection list based on the target dietary plan, including: At least one ingredient feature label is obtained based on the target dietary plan; Based on the pre-selected ingredient list, obtain the user-preferred ingredient tags and similar ingredient tags corresponding to the ingredient feature tags; Multiple pre-selected ingredients are obtained from the ingredient pre-selection list based on the user's preferred ingredient tags and the similar ingredient tags.
3. The food ingredient recommendation method according to claim 2, characterized in that, The step of obtaining multiple pre-selected ingredients from the ingredient pre-selection list based on the user's preferred ingredient tags and the similar ingredient tags includes: Calculate the similarity between the user's preferred ingredients and multiple pre-selected ingredients in the ingredient pre-selection list; Based on the similarity of the ingredients, similar ingredients corresponding to the similar ingredient tags are obtained from the pre-selected list of ingredients.
4. The food ingredient recommendation method according to claim 3, characterized in that, The calculation of the similarity between the user's preferred ingredients and multiple pre-selected ingredients in the ingredient pre-selection list includes: Calculate the similarity of food types based on the user's preferred food and the food type information of the pre-selected food; Calculate the nutritional similarity of ingredients based on the nutritional information of the user's preferred ingredients and the pre-selected ingredients; Based on the food suitability information of the user's preferred food and the pre-selected food, the food suitability information is calculated, whereby the food suitability information indicates whether the user's preferred food and the pre-selected food can be eaten at the same time. The similarity of ingredients is obtained by calculating the similarity of ingredient types, calculating the similarity of ingredients nutrition, and calculating the suitability of ingredients.
5. The food ingredient recommendation method according to claim 1, characterized in that, The step of sorting multiple pre-selected ingredients according to the pre-selected tags to obtain an ingredient recommendation list includes: The weight coefficients corresponding to the pre-selected labels are obtained according to the preset weight list; The recommendation score for the pre-selected ingredients is obtained based on the pre-selected tags corresponding to the pre-selected ingredients and the weight coefficients corresponding to the pre-selected tags. The pre-selected ingredients are sorted according to the recommended scores to obtain a recommended ingredient list.
6. The food ingredient recommendation method according to claim 5, characterized in that, The step of obtaining the recommendation score for the pre-selected ingredients based on the pre-selected tags corresponding to the pre-selected ingredients and the weight coefficients corresponding to the pre-selected tags includes: When a single pre-selected ingredient corresponds to multiple pre-selected tags, the sum of the weight coefficients corresponding to the multiple pre-selected tags is determined as the recommendation score of the pre-selected ingredient.
7. The food ingredient recommendation method according to claim 1, characterized in that, After obtaining user information, the process also includes: Conflicting ingredients are determined based on the user's personal health information; The conflicting ingredients are hidden from the ingredient pre-selection list.
8. The method for recommending ingredients according to claim 1, characterized in that, The pre-selected labels also include at least one of the following: seasonal ingredients labels, popular ingredients labels, and historically recommended ingredients labels.
9. A controller, characterized in that, The device includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the computer program, implements the food recommendation method as described in any one of claims 1 to 8.
10. A food recommendation system, characterized in that, Includes the controller as described in claim 9.
11. A computer-readable storage medium, characterized in that, The device stores computer-executable instructions for performing the ingredient recommendation method as described in any one of claims 1 to 8.
Citation Information
Patent Citations
Food material recommending method and device, household electrical appliance and machine readable memory medium
CN110021403A
Dietary recommendation system
CN111261260A
Health management method and system, electronic equipment and a storage medium
CN111640484A