Diet recommendation method and system based on knowledge graph

By using a knowledge graph-based diet recommendation method that combines user health data and eating habits, the system calculates the health benefits and user acceptance of ingredients, solving the problem that traditional diet recommendation systems fail to consider user taste preferences and habits, and achieving personalized and healthy diet recommendation results.

CN120878075APending Publication Date: 2025-10-31DONGYING YIYUE ZHIHUI DIGITAL TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511032191.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-25
Publication Date
2025-10-31

AI Technical Summary

Technical Problem

Traditional food recommendation systems fail to adequately consider users' taste preferences and eating habits, resulting in poor recommendation performance and low user acceptance.

Method used

The knowledge graph-based food recommendation method analyzes users' health data, taste preferences, and eating habits, combined with the nutrient content of ingredients and differences in cooking methods, to calculate the health benefits and user acceptance of ingredients, and recommends personalized ingredients.

Benefits of technology

It enables personalized and healthy dietary recommendations, improves the interpretability of the recommendations and user acceptance, and is suitable for health management and personalized dining scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120878075A_ABST
    Figure CN120878075A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of knowledge fusion, in particular to a food recommendation method and system based on a knowledge graph, and the method comprises the steps: obtaining the knowledge graph of a user, a dish library knowledge graph and the content of various nutrients in various food materials; screening out an abnormal entity from the knowledge graph of the user, obtaining the abnormal degree of the abnormal entity, and obtaining the health beneficial degree of each food material to each user by combining the content of each nutrient in each food material; and according to the dish library knowledge graph, in combination with preference food materials and repellent food materials in the knowledge graphs of different users, obtaining the acceptance degree of each user for each food material, and in combination with the health benefit degree of each food material for each user, obtaining the recommendation degree of each food material for each user so as to recommend each food material for each user. Various food materials are recommended to the user by analyzing the body health information of the user and the taste preferences of different users, so that the food materials which are beneficial to health and accord with the taste of the user are recommended.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of knowledge fusion technology, specifically to a diet recommendation method and system based on knowledge graphs. Background Technology

[0002] Diet is the foundation of human health. A reasonable intake of nutrients helps support growth and development, enhance immune function, and promote metabolism. Conversely, poor eating habits may lead to chronic diseases such as obesity, diabetes, hypertension, and cardiovascular disease. Therefore, a scientific diet can prevent disease, improve quality of life, and maintain human health.

[0003] However, due to differences in individual taste preferences, eating habits, and health status, traditional food recommendation systems often simply match ingredients that meet nutritional needs based solely on the user's health status, such as weight, blood sugar levels, or blood lipid levels. This ignores the user's taste preferences and long-standing eating habits, and fails to fully consider the user's unique needs for the flavor of ingredients and cooking methods, thereby reducing the effectiveness of recommendations and the user's willingness to continue using the system. Summary of the Invention

[0004] This invention provides a knowledge graph-based diet recommendation method and system to solve existing problems: traditional methods that rely on users' health status to recommend various ingredients do not take into account users' taste preferences and eating habits, resulting in the ingredients recommended by traditional diet recommendation methods being unacceptable to users.

[0005] The knowledge graph-based diet recommendation method and system of the present invention adopts the following technical solution:

[0006] One embodiment of the present invention provides a knowledge graph-based diet recommendation method, which includes the following steps:

[0007] Obtain the user's knowledge graph, the recipe knowledge graph, and the content of various nutrients in various ingredients;

[0008] Based on user health data, abnormal entities are filtered from the user's knowledge graph, and the degree of abnormality of the abnormal entities is obtained; combined with the content of various nutrients in various foods, the degree of health benefits of various foods to each user is obtained.

[0009] Based on the food knowledge graph, the degree of difference between various ingredients is obtained. Combining the preferred and undesirable ingredients in the knowledge graphs of different users, several matching pairs between different users are obtained. Based on the preferred and undesirable ingredients of all users, the uniqueness weight of each matching pair between different users is obtained. Based on each matching pair between different users and its unique weight, the difference factor of each matching pair between different users is obtained. Based on the difference factor of all matching pairs between different users, the taste similarity between different users is obtained. Combining the preferred and undesirable ingredients of all users, the acceptance of each user for various ingredients is obtained.

[0010] Based on the degree to which various ingredients are beneficial to the health of each user and the user's acceptance of various ingredients, the recommendation level of each ingredient is obtained for each user, and various ingredients are recommended to each user accordingly.

[0011] Preferably, the specific method for filtering abnormal entities from the user's knowledge graph based on the user's physical health data and obtaining the degree of abnormality of the abnormal entities includes:

[0012] Use entities in the user's knowledge graph that represent the user's physical health data as state entities; for the first... The first user's The nth state entity, obtain the nth state entity. The first user's The normal range corresponding to the nth state entity, if the nth state entity The first user's If the first state entity is not within its corresponding normal range, then the second state entity will be... The first user's Each state entity is denoted as an abnormal entity;

[0013] For the The first user's The first abnormal entity will be the first The first user's The distance between the anomalous entity and its normal range is greater than that of the previous one. The ratio of the interval length of the normal range corresponding to the first abnormal entity is used as the ratio of the interval length of the second abnormal entity to the interval length of the third abnormal entity. The first user's The degree of abnormality of an abnormal entity.

[0014] Preferably, the specific method for obtaining the degree of health benefits of various ingredients to each user includes:

[0015] For the The first user's The first abnormal entity, if the first... The first user's The number of abnormal entities is higher than its normal range, obtain the first... The first user's The various nutrients required when an abnormal entity's levels are higher than its normal range are denoted as the [number]. The first user's Each beneficial nutrient of each abnormal entity; if the first The first user's The number of abnormal entities is below its normal range, obtain the first... The first user's The various nutrients required when an abnormal entity's levels are below their normal range are denoted as the [number]. The first user's Each beneficial nutrient of an abnormal entity;

[0016] For the The first ingredient and the second The user, according to the number The degree of anomalousness of each anomalous entity of each user, combined with the first The first type of ingredient The content of each beneficial nutrient for all abnormal entities of a user is obtained. The first ingredient The degree of health benefit for each user.

[0017] Preferably, the acquisition of the first The first ingredient The specific methods used to assess the health benefits of an individual user include:

[0018] For the The first ingredient and the second The first user's Any beneficial nutrient of the first abnormal entity will... The first user's The degree of anomalousness of the first anomalous entity is related to the first... The first type of ingredient The first user's The product of the beneficial nutrient content of each abnormal entity is used as the first... The first ingredient The first user's Beneficial factors of the beneficial nutrients of the abnormal entity;

[0019] The first The first ingredient The first user's The sum of all beneficial factors of all beneficial nutrients of an abnormal entity, as the first... The first ingredient The first user's The beneficial contribution of each anomalous entity;

[0020] For the The first ingredient The sum of the beneficial contributions of all anomalous entities of each user is linearly normalized to obtain the result of the first step. The first ingredient The degree of health benefit for each user.

[0021] Preferably, the specific method for obtaining the degree of difference between various ingredients based on the food knowledge graph includes:

[0022] For the One type of ingredient; the recipe library contains the first type of ingredient. Dishes made with a certain type of ingredient are designated as the first. A superior dish made from a variety of ingredients;

[0023] For the The first type of ingredient The top-tier dishes and the first The first type of ingredient The first superior dish; will be the first The first type of ingredient Among the top-tier dishes, the first The content of the first ingredient and the second The first type of ingredient Among the top-tier dishes, the first The product of the content of each ingredient is greater than the product of the content of the first ingredient in the food knowledge graph. The first type of ingredient The top-tier dishes and the first The first type of ingredient The embedding distance between the superior dishes is obtained as the first... The first type of ingredient The top-tier dishes and the first The first type of ingredient The similarity between the top-tier dishes;

[0024] For the first Each ingredient in a top-tier dish is related to the first The similarity between each superior dish of the ingredient is summed and negatively correlated and normalized. The result of the negative correlation normalization is used as the first... species and first The degree of difference between different ingredients.

[0025] Preferably, the specific method for obtaining several matching pairs between different users is as follows:

[0026] Using the degree of difference between ingredients as the matching distance, for the first Each user's preferred ingredients and the first KM matching is performed on each user's preferred ingredients to obtain the first... The user and the first Matching several preferred ingredients for a single user;

[0027] For the first Each user's dietary restrictions and the first KM matching is performed on each user's dietary restrictions to obtain the first... The user and the first Matching a user's dietary restrictions with a list of foods they cannot eat;

[0028] For the first Each user's preferred ingredients and the first KM matching is performed on each user's dietary restrictions to obtain the first... The user's preferred ingredients and the first Several matching pairs between the food items that a user cannot eat;

[0029] For the first Each user's dietary restrictions and the first KM matching is performed on each user's preferred ingredients to obtain the first... The user's dietary restrictions and the first Several matching pairs between a user's preferred ingredients.

[0030] Preferably, the method for obtaining the unique weight of each matching pair between different users based on the preferred and unpreferred ingredients of all users includes:

[0031]

[0032] In the formula, This represents the uniqueness weight of the matched pair; This indicates the total quantity of all ingredients in the total ingredient set; This indicates the frequency of the first ingredient in the matching pair in the total ingredient set; This indicates the frequency of the second ingredient in the matching pair in the total ingredient set; Represents the logarithmic function with the natural constant as the base; This represents the function that takes the absolute value.

[0033] Preferably, the specific method for obtaining the difference factor of each matching pair between different users based on each matching pair and its unique weight; obtaining the taste similarity between different users based on the difference factors of all matching pairs between different users; and obtaining each user's acceptance of various ingredients by combining the preferred and unpreferred ingredients of all users, includes:

[0034] For the The user and the first Match any preferred ingredients of a user to a pair, and the first user will be matched with the second user. The user and the first The degree of difference between the two ingredients in the preferred ingredient pair of each user, multiplied by the first... The user and the first The product of the uniqueness weights of the preferred food matching pairs of each user is used as the first... The user and the first The difference factors of the preferred food matching pairs of each user;

[0035] For the The user and the first The mean of the difference factors for all preferred food matching pairs of each user is negatively correlated and normalized. The result of the negative correlation normalization is then used as the first... The user and the first Similarity of food preferences among individual users;

[0036] According to the The user and the first Match all the food taboos of each user to get the first... The user and the first Similarity of dietary restrictions among individual users;

[0037] According to the The user's preferred ingredients and the first Several matching pairs between the food taboos of each user are used to obtain the first... The user's preferred ingredients and the first The similarity between the foods that individual users avoid;

[0038] According to the The user's dietary restrictions and the first Several matching pairs between the preferred ingredients of each user are obtained to get the first... The user's dietary restrictions and the first The similarity between users' preferred ingredients;

[0039] For the The user and the first The user will be the first The user and the first Similarity of preferred ingredients among individual users and the first The user and the first The product of the similarity of the dietary restrictions among users is greater than the product of the previous one. The user's preferred ingredients and the first The similarity between the food taboos of individual users and the first The user's dietary restrictions and the first The product of the similarity between the preferred ingredients of each user yields the product of the similarity between the preferred ingredients of each user. The user and the first Similarity of tastes among users.

[0040] Preferably, the specific method for obtaining the recommendation level of various ingredients for each user based on the degree of health benefits of various ingredients to each user and the user's acceptance of various ingredients includes:

[0041] For the The user and the first One type of ingredient, the first The first ingredient The health benefits of individual users and the first The user on the first The product of the acceptance rates of each ingredient is used as the first... The first ingredient The degree of recommendation from each user;

[0042] Categorize all ingredients into grains and tubers, vegetables and fruits, meats, and soybeans and nuts; and preset a recommended quantity. For the first For each user, obtain the data for each ingredient in each category. The degree of recommendation from each user; [and] the recommendation level of each type of food for the [number]th [user]. The top user recommendation Recommended ingredients to users.

[0043] Another embodiment of the present invention provides a knowledge graph-based diet recommendation system, including 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 steps of any of the above-described knowledge graph-based diet recommendation methods.

[0044] The beneficial effects of the technical solution of the present invention are as follows: This application analyzes the user's knowledge graph, the food database knowledge graph, and the content of various nutrients in various ingredients; it filters out abnormal entities from the user's knowledge graph and obtains the degree of abnormality of the abnormal entities. The greater the degree of abnormality of the abnormal entity, the more food rich in the corresponding beneficial nutrients should be recommended to the patient so that the body parameters corresponding to the abnormal entity of the user can be restored to normal. Furthermore, by combining the content of various nutrients in various ingredients, the degree of health benefit of various ingredients to each user can be obtained. The greater the degree of health benefit of an ingredient to each user, the more beneficial it is for the user to consume that ingredient.

[0045] Since users typically consume dishes cooked with ingredients rather than directly consuming the ingredients themselves, this study uses a food knowledge graph to determine the degree of difference between various ingredients. This is combined with users' preferred and undesirable ingredients from their knowledge graphs to generate several matching pairs between different users. Because the more unique a user's preferred ingredients are, the more personalized their taste preferences are, the study assigns unique weights to each matching pair based on all users' preferred and undesirable ingredients. Based on each matching pair and its unique weights, the study obtains the difference factors for each matching pair. Finally, based on the difference factors of all matching pairs, the study obtains the taste similarity between users. Combining all users' preferred and undesirable ingredients, the study assesses each user's acceptance of various ingredients. Finally, the study considers the health benefits of each ingredient to determine its recommendation level for each user. This approach recommends various ingredients to users, ensuring that the recommended ingredients are both beneficial to their health and acceptable to them. Attached Figure Description

[0046] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0047] Figure 1 This is a flowchart illustrating the steps of the knowledge graph-based diet recommendation method of the present invention. Detailed Implementation

[0048] To further illustrate the technical means and effects adopted by the present invention to achieve its intended purpose, the following, in conjunction with the accompanying drawings and preferred embodiments, details the specific implementation, structure, features, and effects of the knowledge graph-based dietary recommendation method and system proposed according to the present invention. In the following description, different "one embodiment" or "another embodiment" do not necessarily refer to the same embodiment. Furthermore, specific features, structures, or characteristics in one or more embodiments can be combined in any suitable form.

[0049] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains.

[0050] The following description, in conjunction with the accompanying drawings, details the specific scheme of the knowledge graph-based dietary recommendation method and system provided by this invention.

[0051] Please see Figure 1The diagram illustrates a flowchart of a knowledge graph-based diet recommendation method according to an embodiment of the present invention, which includes the following steps:

[0052] Step S001: Obtain the user's knowledge graph, the recipe knowledge graph, and the content of various nutrients in various ingredients.

[0053] It should be noted that traditional methods of recommending ingredients based solely on a user's health status fail to consider taste preferences and dietary habits, resulting in a lack of scientific dietary recommendations. In contrast, knowledge graph-based dietary recommendations effectively integrate multi-dimensional information such as a user's health status, taste preferences, food nutrients, and similarity to the user's preferred foods, expressing complex relationships to achieve personalized and healthy recommendations. Compared to traditional methods, knowledge graphs not only improve interpretability and alleviate the problem of insufficient historical data for reasonable dietary recommendations, but also facilitate the integration of external nutritional and medical knowledge, supporting more comprehensive and intelligent dietary decisions. This is particularly suitable for scenarios such as health management, disease intervention, and personalized catering. Therefore, this implementation proposes a knowledge graph-based dietary recommendation method, which requires obtaining each user's knowledge graph, a food knowledge graph, and the nutrient content of each ingredient.

[0054] Specifically, a knowledge graph is constructed for each user, and the entities in the user's knowledge graph include, but are not limited to: the user's blood pressure, blood sugar, BMI, preferred foods, and foods to avoid.

[0055] Furthermore, a recipe library is pre-constructed, which contains several commonly used dishes. The proportion of various ingredients in each commonly used dish is obtained, and a knowledge graph of the recipe library is constructed. The entities in the knowledge graph of the recipe library include, but are not limited to: cuisine, dish itself, ingredients that constitute the dish itself, etc. The content of various nutrients in each ingredient is obtained according to the "Chinese Food Composition Table Standard Edition 6".

[0056] At this point, we have obtained the knowledge graph for each user, the knowledge graph for the recipe database, and the content of various nutrients in each ingredient.

[0057] Step S002: Based on the user's physical health data, filter out abnormal entities from the user's knowledge graph and obtain the degree of abnormality of the abnormal entities; combine the content of various nutrients in various foods to obtain the degree of health benefits of various foods to each user.

[0058] It should be noted that this embodiment, as a knowledge graph-based dietary recommendation method, not only needs to consider the user's preferred ingredients when recommending food, but also needs to specifically recommend ingredients that are beneficial to the user's health based on the user's various physical data. Therefore, it is necessary to obtain the degree of health benefits of each ingredient based on the user's various physical data. Based on the degree of health benefits of each ingredient, the recommendation degree of each ingredient can be obtained by combining the user's acceptance of various ingredients, so as to recommend ingredients that are beneficial to the user's health. Therefore, it is first necessary to obtain the degree of health benefits of each ingredient.

[0059] Specifically, entities in the user's knowledge graph that represent the user's health data are used as state entities (e.g., blood pressure, blood sugar, BMI). For the first... The first user's The nth state entity, obtain the nth state entity. The first user's The normal range corresponding to the nth state entity, if the nth state entity The first user's If the first state entity is not within its corresponding normal range, then the second state entity will be... The first user's Each state entity is denoted as an abnormal entity;

[0060] For the The first user's The first abnormal entity will be the first The first user's The distance between the anomalous entity and its normal range is greater than that of the previous one. The ratio of the interval length of the normal range corresponding to the first abnormal entity is used as the ratio of the interval length of the second abnormal entity to the interval length of the third abnormal entity. The first user's The degree of abnormality of an abnormal entity.

[0061] It should be noted that the more abnormal the status entity, the more necessary it is to guide the user to consume the corresponding beneficial nutrients; that is, the more necessary it is to recommend foods rich in the corresponding beneficial nutrients to the patient. Therefore, the degree of health benefits of each food can be obtained based on the degree of abnormality of each user's status entity, combined with the label of each status entity and the content of various nutrients in each food.

[0062] Furthermore, if the first The first user's The number of abnormal entities was higher than its normal range, and the first abnormal entity was obtained according to the "Chinese Dietary Reference Intakes (DRIs)". The first user's The various nutrients required when an abnormal entity's blood pressure is above its normal range (e.g., when blood pressure is above the normal range, nutrients such as potassium, magnesium, and calcium are needed to improve electrolyte balance and enhance vascular elasticity) are denoted as the [number]th. The first user's Each beneficial nutrient of each abnormal entity; if the first The first user's The number of abnormal entities is below their normal range, obtained from the 6th edition of the "Chinese Food Composition Table Standard Edition". The first user's The various nutrients required when an abnormal entity's levels are below their normal range are denoted as the [number]. The first user's Each beneficial nutrient of an abnormal entity;

[0063] For the The first ingredient and the second The first user's Any beneficial nutrient of the first abnormal entity will... The first user's The degree of anomalousness of the first anomalous entity is related to the first... The first type of ingredient The first user's The product of the beneficial nutrient content of each abnormal entity is used as the first... The first ingredient The first user's Beneficial factors of the beneficial nutrients of the abnormal entity;

[0064] The first The first ingredient The first user's The sum of all beneficial factors of all beneficial nutrients of an abnormal entity, as the first... The first ingredient The first user's The beneficial contribution of each anomalous entity;

[0065] Furthermore, regarding the first The first ingredient The sum of the beneficial contributions of all anomalous entities of each user is linearly normalized (the linear normalization range is the sum of the beneficial contributions of each ingredient to the first user). The sum of the beneficial contributions of all anomalous entities of each user, as the first... The first ingredient The degree of health benefit for each user.

[0066] As an example, obtaining the first The first ingredient The specific formula for calculating the health benefits for an individual user is as follows:

[0067]

[0068] In the formula, Indicates the first The first ingredient The degree of health benefit for each user; Indicates the first The number of abnormal state entities for each user; Indicates the first The first user's The number of beneficial nutrients in an abnormal entity; Indicates the first The first user's The degree of abnormality of an abnormal entity; Indicates the first The first type of ingredient The first user's The first abnormal entity Content of various beneficial nutrients.

[0069] It should be noted that the greater the distance between a user's abnormal entity and its normal range, the more the user should consume nutrients that nourish that entity. In other words, the more the user should consume foods rich in nutrients beneficial to that entity. The nutrients contained in various foods are weighted and calculated based on the degree of abnormality of the user's abnormal entity. This quantifies the degree of benefit of each food to the user's health. The greater the degree of benefit of a food to the user's health, the more it helps improve the user's health status when consumed.

[0070] This allows us to determine the health benefits of various ingredients for each user.

[0071] Step S003: Based on the food knowledge graph, obtain the degree of difference between various ingredients; combine the preferred and undesirable ingredients in the knowledge graphs of different users to obtain several matching pairs between different users; based on the preferred and undesirable ingredients of all users, obtain the uniqueness weight of each matching pair between different users; based on each matching pair between different users and its uniqueness weight, obtain the difference factor of each matching pair between different users; based on the difference factor of all matching pairs between different users, obtain the taste similarity between different users; and combine the preferred and undesirable ingredients of all users to obtain the acceptance of each user for various ingredients.

[0072] It should be noted that since this embodiment is a knowledge graph-based food recommendation method, the recommended ingredients need to be acceptable to the user. Therefore, it is necessary to recommend ingredients that are as similar as possible to the user's preferred ingredients. Thus, it is necessary to assess the degree of difference between various ingredients. However, users usually do not directly eat the ingredients, but rather the dishes cooked with them. Therefore, the degree of difference between ingredients cannot be obtained directly based on the attributes of the ingredients. Instead, it is necessary to combine the dishes that can be cooked with the ingredients and quantify the degree of difference between ingredients according to the differences between dishes. After obtaining the degree of difference between ingredients, the user's acceptance of various ingredients can be obtained based on all users' preferred and unsuitable ingredients, thereby making the recommended ingredients more acceptable to the user.

[0073] Preferably, in a specific embodiment of the present invention, for the first One type of ingredient; the recipe library contains the first type of ingredient. Dishes made with a certain type of ingredient are designated as the first. A superior dish made from a variety of ingredients;

[0074] For the The first type of ingredient The top-tier dishes and the first The first type of ingredient The first superior dish; will be the first The first type of ingredient Among the top-tier dishes, the first The content of the first ingredient and the second The first type of ingredient Among the top-tier dishes, the first The product of the content of each ingredient is greater than the product of the content of the first ingredient in the food knowledge graph. The first type of ingredient The top-tier dishes and the first The first type of ingredient The embedding distance between the superior dishes is obtained as the first... The first type of ingredient The top-tier dishes and the first The first type of ingredient The similarity between the top-tier dishes;

[0075] Furthermore, regarding the first Each ingredient in a superior dish is related to the first The similarity between each superior dish of the ingredient is summed and negatively correlated and normalized. The result of the negative correlation normalization is used as the first... species and first The degree of difference between different ingredients.

[0076] As an example, the specific calculation formula is as follows:

[0077]

[0078] In the formula, Indicates the first species and first The degree of difference between various ingredients; Indicates the first The first type of ingredient Among the top-tier dishes, the first The content of each ingredient; Indicates the first The first type of ingredient Among the top-tier dishes, the first The content of each ingredient; The first in the food database knowledge graph The first type of ingredient The top-tier dishes and the first The first type of ingredient The embedding distance between each superior dish; Indicates the first The number of superior dishes made from a single ingredient; Indicates the first The number of superior dishes made from a single ingredient; This represents a linear normalization function, whose specific normalization range is between all different ingredients. .

[0079] It's important to note that in the knowledge graph of the recipe database, the smaller the embedding distance between recipes, the more similar they are. The more similar the recipes, the more similar their ingredients. However, since the quantities of various ingredients used in cooking differ, a larger ingredient quantity indicates that it is the main ingredient and should be given a higher computational weight to accurately determine the degree of difference between ingredients. After obtaining the degree of difference between different ingredients, the similarity of taste among different users can be determined by combining this with each user's preferred and avoided ingredients.

[0080] Preferably, in a specific embodiment of the present invention, for the first The user and the first For each user, the matching distance is based on the degree of difference between ingredients. Each user's preferred ingredients and the first KM matching is performed on each user's preferred ingredients to obtain the first... The user and the first The matching of several preferred ingredients for each user will not be elaborated in this embodiment since KM matching is a well-known existing technology. The matching rule is that the smaller the matching distance, the better the match.

[0081] Similarly, for the first Each user's dietary restrictions and the first KM matching is performed on each user's dietary restrictions to obtain the first... The user and the first Matching a user's dietary restrictions with a list of foods they cannot eat;

[0082] For the Each user's preferred ingredients and the first KM matching is performed on each user's dietary restrictions to obtain the first... The user's preferred ingredients and the first Several matching pairs between the food items that a user cannot eat;

[0083] For the Each user's dietary restrictions and the first KM matching is performed on each user's preferred ingredients to obtain the first... The user's dietary restrictions and the first Several matching pairs between a user's preferred ingredients.

[0084] It should be noted that when the first The user and the first All preferred ingredient pairs for each user, and the first user's... The user and the first The more similar the ingredients in the matching pairs of a user's dietary restrictions, the better. The user and the first The more similar the tastes of the users, the more similar they are; when the first... The user's preferred ingredients and the first Several matching pairs between the food taboos of each user, and the first The user's dietary restrictions and the first The more similar the ingredients in several matching pairs among the preferred ingredients of each user, the better. The user and the first The more dissimilar the tastes of individual users, the better the similarity of tastes among different users can be obtained.

[0085] It's important to further explain that the more unique a user's preferred ingredients, the more personalized their taste preferences become. Therefore, the rarer and less common an ingredient, the higher its information entropy and recognizability. Compared to common ingredients like eggs and rice, which are less effective at differentiating users, rarer and less common ingredients are more easily identifiable. For example, users who like houttuynia cordata or buckwheat have stronger individual preferences. Therefore, based on the... The user and the first When calculating the similarity between users for each pair of ingredients in a user's preferred ingredients, a calculation weight should be assigned to each pair based on the uniqueness of the ingredients within each pair to accurately measure the taste similarity between different users.

[0086] Preferably, in a specific embodiment of the present invention, all preferred and forbidden ingredients of all users are grouped into a total ingredient set; for any matching pair, the uniqueness weight of the matching pair is obtained based on the frequency of the two ingredients in the total ingredient set, and the specific calculation formula is as follows:

[0087]

[0088] In the formula, This represents the uniqueness weight of the matched pair; This indicates the total quantity of all ingredients in the total ingredient set; This indicates the frequency of the first ingredient in the matching pair in the total ingredient set; This indicates the frequency of the second ingredient in the matching pair in the total ingredient set; Represents the logarithmic function with the natural constant as the base; This represents the function that takes the absolute value.

[0089] It should be noted that, This represents the uniqueness of the first ingredient in a matching pair. A higher value indicates fewer people prefer that ingredient. The more regionally uncommon and rare the ingredient, the more easily it can be identified and distinguished by users. Therefore, when quantifying the similarity of taste preferences among different users by analyzing the differences between ingredients in all matching pairs, a weight should be assigned based on the discriminative power of each matching pair. Calculating the weight by taking the logarithm of the frequency can more effectively compress the influence of high-frequency terms on the calculation results, while strengthening the weight of low-frequency terms corresponding to ingredients that express user preferences, thus improving the overall stability and robustness of the model. After obtaining the discriminative weight of each matching pair, it can be further combined with the differences between ingredients in each matching pair to obtain the taste similarity between different users.

[0090] Preferably, in a specific embodiment of the present invention, for the first The user and the first Match any preferred ingredients of a user to a pair, and the first user will be matched with the second user. The user and the first The degree of difference between the two ingredients in the preferred ingredient pair of each user, multiplied by the first... The user and the first The product of the uniqueness weights of the preferred food matching pairs of each user is used as the first... The user and the first The difference factors of the preferred food matching pairs of each user;

[0091] Furthermore, regarding the first The user and the first The mean of the difference factors of all preferred food matching pairs of each user is negatively correlated and normalized (in this embodiment, it is taken as...). The function is normalized for negative correlation. The function is an exponential function with the natural constant as the base, and the normalized result of the negative correlation is taken as the first... The user and the first Similarity of food preferences among individual users;

[0092] Similarly, according to the first The user and the first Match all the food taboos of each user to get the first... The user and the first Similarity of dietary restrictions among individual users;

[0093] According to the The user's preferred ingredients and the first Several matching pairs between the food taboos of each user are used to obtain the first... The user's preferred ingredients and the first The similarity between the foods that individual users avoid;

[0094] According to the The user's dietary restrictions and the first Several matching pairs between the preferred ingredients of each user are obtained to get the first... The user's dietary restrictions and the first The similarity between the preferred ingredients of individual users.

[0095] It should be noted that the higher the similarity of preferred and forbidden foods among different users, and the lower the similarity between preferred and forbidden foods, the more similar the tastes of different users are. Therefore, this can be used to quantify the similarity of tastes among different users.

[0096] Specifically, for the first The user and the first The user will be the first The user and the first Similarity of preferred ingredients among individual users and the first The user and the first The product of the similarity of the dietary restrictions among users is greater than the product of the previous one. The user's preferred ingredients and the first The similarity between the food taboos of individual users and the first The user's dietary restrictions and the first The product of the similarity between the preferred ingredients of each user yields the product of the similarity between the preferred ingredients of each user. The user and the first Similarity of tastes among users.

[0097] As an example, obtaining the first The user and the first The specific formula for calculating the similarity of tastes among users is as follows:

[0098]

[0099] In the formula, Indicates the first The user and the first Similarity of tastes among individual users; Indicates the first The user and the first Similarity of food preferences among individual users; Indicates the first The user and the first Similarity of dietary restrictions among individual users; Indicates the first The user's preferred ingredients and the first The similarity between the foods that individual users avoid; Indicates the first The user's dietary restrictions and the first The similarity between the preferred ingredients of individual users.

[0100] It should be noted that the higher the similarity in preferred and avoided foods among different users, the more similar their tastes will be. The higher the value, the greater the similarity of tastes among different users; since the higher the similarity between users' preferred and avoided foods, the less similar their tastes are. The larger the value, the lower the similarity of tastes among different users. The higher the value, the greater the similarity of tastes among different users; further, by combining each user's preferred and undesirable ingredients, we can obtain the user's acceptance of various ingredients.

[0101] Preferably, in a specific embodiment of the present invention, for the first The user and the first The first type of food, including the preferred food. Users who consume certain ingredients are recorded as positive feedback users, and the list of foods to avoid includes the first one. Users who provide this type of food item will be recorded as negative feedback users, and the first... The mean similarity of taste preferences between the first user and all positive feedback users, compared with the first user's... The ratio of the mean similarity of taste preferences between the current user and all negative feedback users is used as the first... The user on the first The acceptability of this type of ingredient, for the first The user on the first The acceptability of each ingredient is linearly normalized (its linear normalization range is all the first...). (The acceptability of each ingredient to each user), to obtain the first... The user on the first The acceptance of this type of ingredient.

[0102] It should be noted that when you like the first Users of this type of ingredient and the first The higher the similarity of tastes among users, and the less they like the first one... Users of this type of ingredient and the first The lower the similarity of tastes among users, the better. The more users like it, the more likely it is to be the first. The first ingredient, namely the The user on the first The higher the acceptance of a particular ingredient.

[0103] This allows us to determine each user's acceptance of various ingredients.

[0104] Step S004: Based on the degree of health benefits of various ingredients to each user and the user's acceptance of various ingredients, obtain the recommendation level of various ingredients for each user, and recommend various ingredients to each user accordingly.

[0105] It should be noted that after obtaining the degree of health benefits of various ingredients to each user and the user's acceptance of various ingredients through steps S002 and S003 respectively, the recommendation degree of each ingredient to each user can be obtained based on the degree of health benefits of various ingredients to each user and the user's acceptance of various ingredients, and various healthy and palatable ingredients can be recommended to each user.

[0106] Preferably, in a specific embodiment of the present invention, for the first The user and the first One type of ingredient, the first The first ingredient The health benefits of individual users and the first The user on the first The product of the acceptance rates of each ingredient is used as the first... The first ingredient The degree of recommendation from each user.

[0107] Furthermore, all ingredients are categorized into grains and tubers, vegetables and fruits, meats, soybeans, and nuts; and a recommended quantity is preset. The The specific value can be set according to the actual situation. This embodiment does not make a hard requirement. In this embodiment, it is used as... Let's take an example to illustrate;

[0108] For the For each user, obtain the data for each ingredient in each category. The degree of recommendation from each user; [and] the recommendation level of each type of food for the [number]th [user]. The top user recommendation level We recommend certain ingredients to users in a way that is both beneficial to their health and acceptable to them.

[0109] Another embodiment of the present invention provides a knowledge graph-based diet recommendation system, including 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 knowledge graph-based diet recommendation method in steps S001 to S004.

[0110] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the principles of the present invention should be included within the protection scope of the present invention.

Claims

1. A knowledge graph-based diet recommendation method, characterized in that, The method includes the following steps: Obtain the user's knowledge graph, the recipe knowledge graph, and the content of various nutrients in various ingredients; Based on user health data, abnormal entities are filtered from the user's knowledge graph, and the degree of abnormality of the abnormal entities is obtained; combined with the content of various nutrients in various foods, the degree of health benefits of various foods to each user is obtained. Based on the food knowledge graph, the degree of difference between various ingredients is obtained. Combining the preferred and undesirable ingredients in the knowledge graphs of different users, several matching pairs between different users are obtained. Based on the preferred and undesirable ingredients of all users, the uniqueness weight of each matching pair between different users is obtained. Based on each matching pair between different users and its unique weight, the difference factor of each matching pair between different users is obtained. Based on the difference factor of all matching pairs between different users, the taste similarity between different users is obtained. Combining the preferred and undesirable ingredients of all users, the acceptance of each user for various ingredients is obtained. Based on the degree to which various ingredients are beneficial to the health of each user and the user's acceptance of various ingredients, the recommendation level of each ingredient is obtained for each user, and various ingredients are recommended to each user accordingly.

2. The knowledge graph-based diet recommendation method according to claim 1, characterized in that, The specific methods for filtering abnormal entities from the user's knowledge graph based on the user's physical health data and obtaining the degree of abnormality of the abnormal entities include: Use entities in the user's knowledge graph that represent the user's physical health data as state entities; for the first... The first user's The nth state entity, obtain the nth state entity. The first user's The normal range corresponding to the nth state entity, if the nth state entity The first user's If the first state entity is not within its corresponding normal range, then the second state entity will be... The first user's Each state entity is denoted as an abnormal entity; For the The first user's The first abnormal entity will be the first The first user's The distance between the anomalous entity and its normal range is greater than that of the previous one. The ratio of the interval length of the normal range corresponding to the first abnormal entity is used as the ratio of the interval length of the second abnormal entity to the interval length of the third abnormal entity. The first user's The degree of abnormality of an abnormal entity.

3. The knowledge graph-based diet recommendation method according to claim 1, characterized in that, The specific methods for determining the health benefits of various ingredients to different users include: For the The first user's The first abnormal entity, if the first... The first user's The number of abnormal entities is higher than its normal range, obtain the first... The first user's The various nutrients required when an abnormal entity's levels are higher than its normal range are denoted as the [number]. The first user's Each beneficial nutrient of each abnormal entity; if the first The first user's The number of abnormal entities is below its normal range, obtain the first... The first user's The various nutrients required when an abnormal entity's levels are below their normal range are denoted as the [number]. The first user's Each beneficial nutrient of an abnormal entity; For the The first ingredient and the second The user, according to the number The degree of anomalousness of each anomalous entity of each user, combined with the first The first type of ingredient The content of each beneficial nutrient for all abnormal entities of a user is obtained. The first ingredient The degree of health benefit for each user.

4. The knowledge graph-based diet recommendation method according to claim 3, characterized in that, The acquisition of the first The first ingredient The specific methods used to assess the health benefits of an individual user include: For the The first ingredient and the second The first user's Any beneficial nutrient of the first abnormal entity will... The first user's The degree of anomalousness of the first anomalous entity is related to the first... The first type of ingredient The first user's The product of the beneficial nutrient content of each abnormal entity is used as the first... The first ingredient The first user's Beneficial factors of the beneficial nutrients of the abnormal entity; The first The first ingredient The first user's The sum of all beneficial factors of all beneficial nutrients of an abnormal entity, as the first... The first ingredient The first user's The beneficial contribution of each anomalous entity; For the The first ingredient The sum of the beneficial contributions of all anomalous entities of each user is linearly normalized to obtain the result of the first step. The first ingredient The degree of health benefit for each user.

5. The knowledge graph-based diet recommendation method according to claim 1, characterized in that, The specific methods for obtaining the degree of difference between various ingredients based on the food knowledge graph include: For the One type of ingredient; the recipe library contains the first type of ingredient. Dishes made with a certain type of ingredient are designated as the first. A superior dish made from a variety of ingredients; For the The first type of ingredient The top-tier dishes and the first The first type of ingredient The first superior dish; will be the first The first type of ingredient Among the top-tier dishes, the first The content of the first ingredient and the second The first type of ingredient Among the top-tier dishes, the first The product of the content of each ingredient is greater than the product of the content of the first ingredient in the food knowledge graph. The first type of ingredient The top-tier dishes and the first The first type of ingredient The embedding distance between the superior dishes is obtained as the first... The first type of ingredient The top-tier dishes and the first The first type of ingredient The similarity between the top-tier dishes; For the Each ingredient in a superior dish is related to the first The similarity between each superior dish of the ingredient is summed and negatively correlated and normalized. The result of the negative correlation normalization is used as the first... species and first The degree of difference between different ingredients.

6. The knowledge graph-based diet recommendation method according to claim 1, characterized in that, The specific method for obtaining several matching pairs between different users is as follows: Using the degree of difference between ingredients as the matching distance, for the first Each user's preferred ingredients and the first KM matching is performed on each user's preferred ingredients to obtain the first... The user and the first Matching several preferred ingredients for a single user; For the Each user's dietary restrictions and the first KM matching is performed on each user's dietary restrictions to obtain the first... The user and the first Matching a user's dietary restrictions with a list of foods they cannot eat; For the Each user's preferred ingredients and the first KM matching is performed on each user's dietary restrictions to obtain the first... The user's preferred ingredients and the first Several matching pairs between the food items that a user cannot eat; For the Each user's dietary restrictions and the first KM matching is performed on each user's preferred ingredients to obtain the first... The user's dietary restrictions and the first Several matching pairs between a user's preferred ingredients.

7. The knowledge graph-based diet recommendation method according to claim 1, characterized in that, The method for obtaining the unique weight of each matching pair between different users based on all users' preferred and unpreferred ingredients includes: In the formula, This represents the uniqueness weight of the matched pair; This indicates the total quantity of all ingredients in the total ingredient set; This indicates the frequency of the first ingredient in the matching pair in the total ingredient set; This indicates the frequency of the second ingredient in the matching pair in the total ingredient set; Represents the logarithmic function with the natural constant as the base; This represents the function that takes the absolute value.

8. The knowledge graph-based diet recommendation method according to claim 6, characterized in that, The method for obtaining the difference factor of each matching pair between different users based on each matching pair and its unique weight; obtaining the taste similarity between different users based on the difference factor of all matching pairs between different users; and obtaining each user's acceptance of various foods by combining the preferred and unpreferred foods of all users, includes the following specific methods: For the The user and the first Match any preferred ingredients of a user to a pair, and the first user will be matched with the second user. The user and the first The degree of difference between the two ingredients in the preferred ingredient pair of each user, multiplied by the first... The user and the first The product of the uniqueness weights of the preferred food matching pairs of each user is used as the first... The user and the first The difference factors of the preferred food matching pairs of each user; For the The user and the first The mean of the difference factors for all preferred food matching pairs of each user is negatively correlated and normalized. The result of the negative correlation normalization is then used as the first... The user and the first Similarity of food preferences among individual users; According to the The user and the first Match all the food taboos of each user to get the first... The user and the first Similarity of dietary restrictions among individual users; According to the The user's preferred ingredients and the first Several matching pairs between the food taboos of each user are used to obtain the first... The user's preferred ingredients and the first The similarity between the foods that individual users avoid; According to the The user's dietary restrictions and the first Several matching pairs between the preferred ingredients of each user are obtained to get the first... The user's dietary restrictions and the first The similarity between users' preferred ingredients; For the The user and the first The user will be the first The user and the first Similarity of preferred ingredients among individual users and the first The user and the first The product of the similarity of the dietary restrictions among users is greater than the product of the previous one. The user's preferred ingredients and the first The similarity between the food taboos of individual users and the first The user's dietary restrictions and the first The product of the similarity between the preferred ingredients of each user yields the product of the similarity between the preferred ingredients of each user. The user and the first Similarity of tastes among users.

9. The knowledge graph-based diet recommendation method according to claim 1, characterized in that, The method for obtaining the recommendation level of various ingredients for each user based on the degree of health benefits of various ingredients to each user and the user's acceptance of various ingredients includes: For the The user and the first One type of ingredient, the first The first ingredient The health benefits of individual users and the first The user on the first The product of the acceptance rates of each ingredient is used as the first... The first ingredient The degree of recommendation from each user; Categorize all ingredients into grains and tubers, vegetables and fruits, meats, and soybeans and nuts; and preset a recommended quantity. For the first For each user, obtain the data for each ingredient in each category. The degree of recommendation from each user; For each type of food, the first The top user recommendation level Recommended ingredients to users.

10. A knowledge graph-based diet recommendation system, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the computer program is executed by a processor, it implements the steps of the knowledge graph-based diet recommendation method as described in any one of claims 1-9.