Dynamic Dietary Recommendation Method, System, Electronic Device and Storage Medium
By obtaining user data and recipe solutions and calculating ideal distances, the problem of difficult dietary choices to meet energy balance and health needs is solved, and more scientific dietary recommendations are achieved.
Patent Information
- Application Number
- CN202211257479.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-10-14
- Publication Date
- 2025-07-04
- Estimated Expiration
- 2042-10-14
AI Technical Summary
It is difficult for people to choose energy-balanced and healthy diets, and the existing technology cannot accurately judge the properties, calories and combinations of ingredients, making it difficult for dietary choices to meet scientific health needs.
By obtaining user data and candidate recipe schemes, calculate the ideal distance between each recipe scheme and the ideal solution, output the recommended recipe scheme, consider the importance and content of nutrient indicators, and determine the weight using the TOPSIS algorithm and expert evaluation method.
It achieves a more scientific and accurate dietary recommendation, can comprehensively consider the importance of each nutrient, and recommends recipe plans that are more suitable for users.
Smart Images

Figure CN115588482B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of information processing technologies, and particularly to a dynamic dietary recommendation method, system, electronic device, and storage medium. Background Art
[0002] With the increase in the quantity and variety of foods, the choice of diet has a greater and greater impact on human health and body shape. At present, most families choose foods mainly based on their own tastes or their understanding of dietary health. However, most people are difficult to master a more scientific method of healthy eating, so they are unable to choose a healthy diet with energy balance. Moreover, even if some people have a certain correct understanding of healthy eating, it is difficult for them to accurately judge the properties of each ingredient, the calories of each ingredient, the properties after ingredient combination, and the needs of the human body. It also takes a lot of time to calculate the diet every day. Therefore, it is difficult for people to achieve energy balance and healthy needs in the choice of diet. Summary of the Invention
[0003] The technical problem to be solved by the present invention is to overcome the defect that it is difficult for people to achieve energy balance and healthy needs in the choice of diet in the prior art, and to provide a dynamic dietary recommendation method, system, electronic device, and storage medium.
[0004] The present invention solves the above technical problem through the following technical solutions:
[0005] The present invention provides a dynamic dietary recommendation method, and the steps include:
[0006] Obtain user data and a set of candidate recipe solutions corresponding to the user, where the set of candidate recipes includes several candidate recipe solutions;
[0007] Wherein, the user data includes an ideal recipe solution corresponding to the user, the ideal recipe solution includes several nutrient indexes required by the user and the target nutrient content corresponding to each nutrient index, the user data further includes the nutritional weight of each nutrient index, and the nutritional weight is used to represent the importance of different nutrient indexes to the user;
[0008] Each candidate recipe solution includes the recipe nutrient content corresponding to each nutrient index;
[0009] Based on each nutrient index in each candidate recipe solution, the recipe nutrient content corresponding to each nutrient index, the target nutrient content, and the nutritional weight, calculate the ideal distance between each candidate recipe solution and the ideal recipe solution;
[0010] Output a recommended recipe plan, where the recommended recipe plan includes N recipe plans with the smallest ideal distance among several recipe plans, and N is the threshold of the number of recipe plans.
[0011] Preferably, the user data further includes a preset target nutrient content corresponding to each of the nutrient indicators, and the preset target nutrient content includes an intermediate nutrient content, an interval nutrient content, and an extremely large nutrient content;
[0012] The steps of the dynamic dietary recommendation method further include:
[0013] Convert the corresponding intermediate nutrient content and interval nutrient content into extremely large nutrient contents according to the intermediate nutrient content, the interval nutrient content, and the recipe nutrient content;
[0014] Perform normalization processing on the extremely large nutrient contents obtained through conversion and other extremely large nutrient contents to obtain several target nutrient contents in the user data.
[0015] Preferably, the specific steps of calculating the ideal distance between each candidate recipe plan and the ideal recipe plan based on each nutrient indicator in each candidate recipe plan, the recipe nutrient content corresponding to each nutrient indicator, the target nutrient content, and the nutrient weight include:
[0016] Construct a normalization matrix and calculate the ideal distance corresponding to each candidate recipe plan according to the following formula:
[0017]
[0018] where m is the number of nutrient indicators, i is the ranking of the candidate recipe plan, j is the ranking of the nutrient indicator, w j is the nutrient weight of the nutrient indicator ranked j, is the target nutrient content of the nutrient indicator ranked j, and z ij is the recipe nutrient content of the nutrient indicator ranked j in the candidate recipe plan ranked i.
[0019] Preferably, the steps after obtaining the user data and the set of candidate recipe plans corresponding to the user further include:
[0020] When the number of candidate recipe plans in the candidate recipe set is greater than the threshold of the number of recipe plans, perform the calculation of the ideal distance between each candidate recipe plan and the ideal recipe plan based on each nutrient indicator in each candidate recipe plan, the recipe nutrient content corresponding to each nutrient indicator, the target nutrient content, and the nutrient weight.
[0021] The present invention also provides a dynamic dietary recommendation system, which is characterized by comprising a data acquisition module, an ideal distance calculation module, and a recommended recipe plan output module;
[0022] The data acquisition module is used to acquire user data and a set of candidate recipe plans corresponding to the user, and the candidate recipe set includes a number of candidate recipe plans;
[0023] Among them, the user data includes an ideal recipe plan corresponding to the user, the ideal recipe plan includes a number of nutrient indexes required by the user and the target nutrient content corresponding to each nutrient index, the user data further includes the nutritional weight of each nutrient index, and the nutritional weight is used to characterize the importance of different nutrient indexes to the user;
[0024] Each candidate recipe plan includes the recipe nutrient content corresponding to each nutrient index;
[0025] The ideal distance calculation module is used to calculate the ideal distance between each candidate recipe plan and the ideal recipe plan based on each nutrient index in each candidate recipe plan, the recipe nutrient content corresponding to each nutrient index, the target nutrient content, and the nutritional weight;
[0026] The recommended recipe plan output module is used to output a recommended recipe plan, and the recommended recipe plan includes N recipe plans with the smallest ideal distances, where N is a recipe plan quantity threshold.
[0027] Preferably, the user data further includes the preset target nutrient content corresponding to each nutrient index, and the preset target nutrient content includes intermediate nutrient content, interval nutrient content, and extremely large nutrient content;
[0028] The ideal distance calculation module is further used to convert the corresponding intermediate nutrient content and interval nutrient content into extremely large nutrient content according to the intermediate nutrient content, the interval nutrient content, and the recipe nutrient content;
[0029] The extremely large nutrient content obtained through conversion is subjected to normalization processing with other extremely large nutrient contents to obtain a number of the target nutrient contents in the user data.
[0030] Preferably, the ideal distance calculation module is further used to construct a normalization matrix and calculate the ideal distance corresponding to each candidate recipe plan according to the following formula:
[0031]
[0032] Wherein, m is the number of nutrient indexes, i is the ranking of candidate recipe solutions, j is the ranking of nutrient indexes, and w j is the nutritional weight of the nutrient index ranked j, is the target nutrient content of the nutrient index ranked j, and z ij is the recipe nutrient content of the nutrient index ranked j in the candidate recipe solution ranked i.
[0033] Preferably, when the number of candidate recipe solutions in the candidate recipe set is greater than the recipe solution number threshold, the ideal distance calculation module is further configured to calculate the ideal distance between each candidate recipe solution and the ideal recipe solution based on each nutrient index in each candidate recipe solution, the recipe nutrient content corresponding to each nutrient index, the target nutrient content, and the nutritional weight.
[0034] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the computer program, the dynamic dietary recommendation method of the present invention is implemented.
[0035] The present invention also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the dynamic dietary recommendation method of the present invention is implemented.
[0036] The positive and progressive effects of the present invention are as follows: By calculating the ideal distance to quantify the gap between each candidate recipe solution and the ideal solution, the recommendation of recipe solutions is made more scientific and accurate; By comparing the relationship between the ideal distance and the ideal distance threshold to select the recommended recipe solution, the output solution better meets the user's requirements for the scientific degree of diet; By calculating the ideal distance according to each nutrient index in each candidate recipe solution, the recipe nutrient content corresponding to each nutrient index, the target nutrient content, and the nutritional weight, the ideal threshold can not only consider the recipe nutrient content corresponding to each nutrient index, but also consider the nutritional weight of each nutrient index, so that the calculation result of the ideal distance can comprehensively consider the importance of each nutrient index to the user, and the calculation process is more scientific, thereby being able to recommend a more suitable recipe for the user. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] Figure 1 is a schematic flowchart of a dynamic dietary recommendation method according to Embodiment 1 of the present invention.
[0038] Figure 2 is a schematic diagram of the modules of a dynamic dietary recommendation system according to Embodiment 2 of the present invention.
[0039] Figure 3Schematic diagram of the electronic device according to Embodiment 5 of the present invention. Detailed implementation manners
[0040] The present invention will be further described below by way of embodiments, but the present invention is not limited to the scope of the described embodiments.
[0041] Embodiment 1
[0042] This embodiment provides a dynamic dietary recommendation method. Referring to Figure 1 , based on the TOPSIS algorithm, the dynamic dietary recommendation method includes the following steps:
[0043] S1. Obtain user data and a set of candidate recipe solutions.
[0044] The user data includes an ideal recipe solution corresponding to the user. The ideal recipe solution includes several nutrient indexes required by the user and the target nutrient content corresponding to each nutrient index.
[0045] The set of candidate recipes includes several candidate recipe solutions; each candidate recipe solution includes the recipe nutrient content corresponding to each nutrient index. The set of candidate recipe solutions can be obtained through the following steps:
[0046] First, perform qualitative screening. Exclude recipe solutions with allergic ingredients according to the user's allergen data; based on the Dietary Guidelines for Special Populations, prefer recipe solutions that include the nutritional indexes or types of ingredients required by special populations in the family; and based on the six meridians of traditional Chinese medicine, prefer suitable recipe solutions according to the six-meridian constitution of traditional Chinese medicine.
[0047] Secondly, perform quantitative screening to further screen the recipe solutions obtained by qualitative screening.
[0048] The user's exercise data detected by the electronic device worn by the user, as well as the user's height, weight, age, labor intensity, and gender input or automatically recognized by the user, can be obtained.
[0049] Obtain the daily recommended energy intake E of the user according to the Dietary Reference Intakes for Chinese Residents. Obtain the energy required to achieve the ideal BMI based on the user's BMI (height, weight); then obtain the average energy consumption C of the user's exercise in the past month according to the user's exercise data; calculate the gap between the user's current BMI and the user's ideal BMI to derive the user's reasonable weight loss value (calculate the daily weight gain / loss rate, taking 10% as the standard. For every kilogram of weight loss, 7700 Kcal of static energy should be reduced from the human body system), obtain the energy consumption D of the user per day to achieve the ideal BMI, and finally construct the user's daily energy intake index M = E - (D - C).
[0050] Based on the user's daily energy intake index M, the recipe plans obtained through qualitative screening are screened according to the greedy algorithm to obtain recipe plans where the difference between the energy and the daily energy intake index M does not exceed 10%, thereby obtaining a candidate recipe set.
[0051] S2. Determine whether the number of candidate recipe plans is greater than the recipe plan quantity threshold.
[0052] When the number of candidate recipe plans is less than the recipe plan quantity threshold N, directly go to step S4;
[0053] When the number of candidate recipe plans is greater than the recipe plan quantity threshold N, sequentially go to step S3 and step S4.
[0054] S3. Calculate the ideal distance.
[0055] The ideal distance is the distance between each candidate recipe plan and the ideal plan.
[0056] The user data also includes the nutritional weights of each nutrient index, and the nutritional weights are used to characterize the importance of different nutrient indexes to the user. Since there may be special attention groups among users, such as pregnant women preparing for pregnancy, the folic acid intake should be focused on. Therefore, it is more reasonable to calculate the ideal distance after weighting different nutrient indexes.
[0057] The index weights are generally determined by the entropy weight method or the expert evaluation method. The entropy weight method determines the weights according to the principle of information entropy. The greater the degree of variation (variance) of the data, the greater the amount of information contained in this index, and the more important it is. The weights are calculated from the degree of difference of the index itself. Since the variance of the single nutrient index distribution of recipes in this proposal is of little significance for judgment, the entropy weight method is not applicable. This algorithm recommends giving priority to the expert evaluation method (such as: AHP analytic hierarchy process) to obtain the index weights Wj. Invite a certain number of experts to subjectively assign weights to the importance of different nutrients according to the special population in the user's family. Based on the AHP method (analytic hierarchy process), construct a weight matrix, and use the eigenvector of the weight matrix as the weight vector. Normalize the eigenvector to obtain the index weights.
[0058] Based on each nutrient index in each candidate recipe plan, the recipe nutrient content corresponding to each nutrient index, the target nutrient content, and the nutritional weight, calculate the ideal distance between each candidate recipe plan and the ideal recipe plan. Specifically:
[0059] Construct a dietary standard nutrient index matrix. Assume that there are i candidate recipe plans in the candidate recipe plan set, and there are 30 nutrient indexes according to the Dietary Reference Intakes for Chinese Residents. Select the dietary standards of each index of this user as the ideal plan, then the dimension of this matrix is 30*(i + 1).
[0060] Normalize the matrix. The user data also includes the preset target nutrient content corresponding to each nutrient index, and the preset target nutrient content includes intermediate nutrient content, interval nutrient content, and extremely large nutrient content. Convert the corresponding intermediate nutrient content and interval nutrient content into extremely large nutrient content according to the intermediate nutrient content, interval nutrient content, and recipe nutrient content. Perform standardization processing on the extremely large nutrient content obtained through conversion and other extremely large nutrient content to obtain several target nutrient contents. The calculation formula for the intermediate nutrient index (the expected index value should neither be too large nor too small, and a certain specific value is the best. For example, the best value of energy intake is 1550, and the floating range is set to 1550 ± 10%) is as follows:
[0061]
[0062] x ij is the recipe nutrient content corresponding to the candidate recipe plan ranked i and the nutrient index ranked J. m is the minimum value of the floating range, and M is the maximum value of the floating range. is the target nutrient content.
[0063] For the interval nutrient index (the index value is best within a certain interval. For example, the carbohydrate intake ratio is 50% - 60%), the calculation formula for the interval index is:
[0064]
[0065] a is the minimum value of the interval, and b is the maximum value of the interval.
[0066] Index weighting and matrix standardization, and then standardize all indexes (eliminating the influence of the dimension of different indexes)
[0067] Then standardize all nutrient indexes (eliminating the influence of the dimension of different indexes).
[0068] Suppose there are n objects to be evaluated and k positively transformed evaluation indexes. The constructed positive matrix is as follows:
[0069]
[0070] Then, the aligned standardized matrix is denoted as Z, and each element in Z:
[0071]
[0072] Construct a normalized matrix and calculate the ideal distance between each candidate recipe plan and the ideal plan. The formula is as follows:
[0073]
[0074] S4. Output the recommended recipe plan.
[0075] Sort the candidate recipe plans in ascending order of the ideal distance, and finally select the top N with the smallest ideal distance as the recommended recipe plan, where N is the recipe plan quantity threshold.
[0076] Optionally, finally select the candidate recipe plans with an ideal distance less than the ideal distance threshold as the recommended recipe plan (the ideal distance corresponding to the candidate recipe plan that exceeds and is closest to the recipe plan quantity threshold can be used as the preset ideal distance threshold).
[0077] In this embodiment, the gap between each candidate recipe plan and the ideal plan is quantified by calculating the ideal distance, making the recommendation of the recipe plan more scientific and accurate; the recommended recipe plan is selected by comparing the relationship between the ideal distance and the ideal distance threshold, making the output plan more in line with the user's requirements for the scientific degree of diet; by calculating the ideal distance according to each nutrient index in each candidate recipe plan, the recipe nutrient content corresponding to each nutrient index, the target nutrient content, and the nutrient weight, the ideal threshold can not only consider the recipe nutrient content corresponding to each nutrient index, but also consider the nutrient weight of each nutrient index, making the calculation result of the ideal distance able to comprehensively consider the importance of each nutrient index to the user, and the calculation process is more scientific, and a more suitable recipe for the user can be recommended.
[0078] Embodiment 2
[0079] This embodiment provides a dynamic diet recommendation system. Refer to Figure 2 , this dynamic diet recommendation system includes a data acquisition module 1, an ideal distance calculation module 2, and a recommended recipe plan output module 3.
[0080] The data acquisition module 1 is used to acquire user data and a set of candidate recipe plans.
[0081] The user data includes an ideal recipe plan corresponding to the user, and the ideal recipe plan includes a number of nutrient indexes required by the user and the target nutrient content corresponding to each nutrient index.
[0082] The candidate recipe set includes a number of candidate recipe plans; each candidate recipe plan includes the recipe nutrient content corresponding to each nutrient index. The set of candidate recipe plans can be obtained through the following steps:
[0083] First, conduct qualitative screening. Exclude recipe options with allergic ingredients based on the user's allergen data; based on the Dietary Guidelines for Special Populations, select recipe options that include the nutritional indicators or ingredient types required by special populations in the family; and based on the six channels of traditional Chinese medicine, select suitable recipe options according to the six-channel constitution of traditional Chinese medicine.
[0084] Secondly, conduct quantitative screening, and further screen the recipe options obtained from the qualitative screening.
[0085] It is possible to obtain the user's exercise data detected by the electronic device worn by the user, as well as the user's height, weight, age, labor intensity, and gender input by the user or automatically recognized.
[0086] Obtain the user's daily recommended intake of energy E according to the Dietary Reference Intakes for Chinese Residents. Obtain the energy required to achieve the ideal BMI based on the user's BMI (height, weight); then obtain the average energy consumption C of the user's exercise in the past month based on the user's exercise data; calculate the gap between the user's current BMI and the ideal BMI to derive the user's reasonable weight loss value (calculate the daily weight gain / loss rate, with 10% as the standard. For every one kilogram of weight loss, 7700 Kcal of static energy should be reduced from the human body system), and obtain the energy consumption D of the user to achieve the ideal BMI per day. Finally, construct the user's daily energy intake index M = E - (D - C).
[0087] Based on the user's daily energy intake index M, screen the recipe options obtained from the qualitative screening according to the greedy algorithm to select recipe options whose energy gap with the daily energy intake index M does not exceed 10%, so as to obtain a candidate recipe set.
[0088] The data acquisition module 1 is also used to determine whether the number of candidate recipe options is greater than the recipe option quantity threshold.
[0089] When the number of candidate recipe options is less than the recipe option quantity threshold N, directly call the recommended recipe option output module;
[0090] When the number of candidate recipe options is greater than the recipe option quantity threshold N, sequentially call the ideal distance calculation module and the recommended recipe option output module.
[0091] The ideal distance calculation module 2 is used to calculate the ideal distance.
[0092] The ideal distance is the distance between each candidate recipe option and the ideal option.
[0093] The user data also includes the nutritional weights of each nutrient index, which are used to characterize the importance of different nutrient indexes to the user. Since there may be special attention groups among users, such as pregnant women planning for pregnancy, the folic acid intake should be focused on. Therefore, it is more reasonable to calculate the ideal distance after weighting different nutrient indexes.
[0094] The index weights are generally determined by the entropy weight method or the expert evaluation method. The entropy weight method determines the weight according to the principle of information entropy. The greater the degree of variation (variance) of the data, the greater the amount of information contained in this index, and the more important it is. The weight is calculated from the degree of difference of the index itself. Since the variance of the single nutrient index of the recipes in this proposal has little significance for judgment, the entropy weight method is not applicable. This algorithm recommends giving priority to using the expert evaluation method (such as: AHP - Analytic Hierarchy Process) to obtain the index weight Wj. Invite a certain number of experts to subjectively weight the importance of different nutrients according to the special population in the user's family. Based on the AHP method (Analytic Hierarchy Process), construct a weight matrix, and use the eigenvector of the weight matrix as the weight vector. Normalize the eigenvector to obtain the index weight.
[0095] Based on each nutrient index in each candidate recipe plan, the recipe nutrient content corresponding to each nutrient index, the target nutrient content, and the said nutritional weight, calculate the ideal distance between each said candidate recipe plan and the ideal recipe plan. Specifically:
[0096] Construct a dietary standard nutrient index matrix. Assume that there are i candidate recipe plans in the candidate recipe plan set, and there are 30 nutrient indexes according to the "Dietary Reference Intakes for Chinese Residents". Select the dietary standards of each index of this user as the ideal plan, then the dimension of this matrix is 30*(i + 1).
[0097] Normalize the matrix. The user data also includes the preset target nutrient content corresponding to each nutrient index. The preset target nutrient content includes intermediate - type nutrient content, interval - type nutrient content, and extremely large - type nutrient content. According to the intermediate - type nutrient content, interval - type nutrient content, and recipe nutrient content, transform the corresponding intermediate - type nutrient content and interval - type nutrient content into extremely large - type nutrient content. Standardize the extremely large - type nutrient content obtained after transformation with other extremely large - type nutrient contents to obtain several target nutrient contents. The calculation formula for the intermediate - type nutrient index (the expected index value should neither be too large nor too small, and a certain specific value is the best. For example, the best value of energy intake is 1550, and the floating range is set to 1550 ± 10%) is as follows:
[0098]
[0099] x ijFor the recipe nutrient content corresponding to the candidate recipe solution with sorting i and the nutrient index with sorting J, m is the minimum value of the floating interval, and M is the maximum value of the floating interval. For the target nutrient content.
[0100] Interval-type nutrient index (the index value is best within a certain interval, such as the carbohydrate intake ratio is 50% - 60%). The calculation formula for the interval-type index:
[0101]
[0102] a is the minimum value of the interval, and b is the maximum value of the interval.
[0103] Index weighting and matrix standardization, and then standardize all indexes (eliminating the influence of the dimensions of different indexes)
[0104] Then standardize all nutrient indexes (eliminating the influence of the dimensions of different indexes).
[0105] Suppose there are n objects to be evaluated and k positive-oriented evaluation indexes. The constructed positive-oriented matrix is as follows:
[0106]
[0107] Then, the aligned and standardized matrix is denoted as Z, and each element in Z:
[0108]
[0109] Construct a normalized matrix and calculate the ideal distance between each candidate recipe solution and the ideal solution. The formula is as follows:
[0110]
[0111] For the ideal distance.
[0112] The recommended recipe solution output module 3 is used to output the recommended recipe solution.
[0113] Sort the candidate recipe solutions in ascending order of the ideal distance, and finally select the top N with the smallest ideal distance as the recommended recipe solutions, where N is the recipe solution quantity threshold.
[0114] Optionally, finally select the candidate recipe solutions with an ideal distance less than the ideal distance threshold as the recommended recipe solutions (the ideal distance corresponding to the candidate recipe solutions that exceed and are closest to the recipe solution quantity threshold can be used as the preset ideal distance threshold).
[0115] In this embodiment, the ideal distance is calculated to quantify the gap between each candidate recipe plan and the ideal plan, making the recommendation of recipe plans more scientific and accurate; the recommended recipe plan is selected by comparing the relationship between the ideal distance and the ideal distance threshold, making the output plan more in line with the user's requirements for the scientific degree of diet; by calculating the ideal distance according to each nutrient index in each candidate recipe plan, the corresponding recipe nutrient content for each nutrient index, the target nutrient content, and the nutrient weight, the ideal threshold can not only consider the corresponding recipe nutrient content for each nutrient index, but also consider the nutrient weight of each nutrient index, so that the calculation result of the ideal distance can comprehensively consider the importance of each nutrient index to the user, and the calculation process is more scientific, thus being able to recommend a more suitable recipe for the user.
[0116] Embodiment 3
[0117] Figure 3 FIG. 7 is a schematic structural diagram of an electronic device provided in this embodiment. The electronic device includes a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the program, it implements the dynamic diet recommendation method of Embodiment 1. Figure 3 The displayed electronic device 30 is only an example and should not impose any limitations on the functions and usage scope of the embodiments of the present invention.
[0118] As Figure 3 shown, the electronic device 30 may be presented in the form of a general-purpose computing device, for example, it may be a server device. The components of the electronic device 30 may include, but are not limited to: the at least one processor 31 described above, the at least one memory 32 described above, and a bus 33 connecting different system components (including the memory 32 and the processor 31).
[0119] The bus 33 includes a data bus, an address bus, and a control bus.
[0120] The memory 32 may include volatile memory, such as a random access memory (RAM) 321 and / or a cache memory 322, and may further include a read-only memory (ROM) 323.
[0121] The memory 32 may further include a program / utilities 325 having a set (at least one) of program modules 324. Such program modules 324 include, but are not limited to: an operating system, one or more application programs, other program modules, and program data. Each or some combination of these examples may include the implementation of a network environment.
[0122] The processor 31 executes various functional applications and data processing by running computer programs stored in the memory 32, such as the dynamic dietary recommendation method of Embodiment 1 of the present invention.
[0123] The electronic device 30 can also communicate with one or more external devices 34 (such as a keyboard, a pointing device, etc.). Such communication can be carried out through the input / output (I / O) interface 35. Moreover, the model generation device 30 can also communicate with one or more networks (such as a local area network (LAN), a wide area network (WAN) and / or a public network, such as the Internet) through the network adapter 36. As shown in the figure, the network adapter 36 communicates with other modules of the model generation device 30 through the bus 33. It should be understood that although not shown in the figure, other hardware and / or software modules can be used in combination with the model generation device 30, including but not limited to: microcode, device drivers, redundant processors, external disk drive arrays, RAID (redundant array of independent disks) systems, tape drives, and data backup storage systems, etc.
[0124] It should be noted that although several units / modules or sub-units / modules of the electronic device are mentioned in the above detailed description, this division is merely exemplary and not mandatory. In fact, according to the embodiments of the present invention, the features and functions of two or more units / modules described above can be embodied in one unit / modules. Conversely, the features and functions of one unit / modules described above can be further divided and embodied by multiple units / modules.
[0125] Embodiment 4
[0126] This embodiment provides a computer-readable storage medium, on which a computer program is stored. When the program is executed by a processor, the steps of the dynamic dietary recommendation method of Embodiment 1 are implemented.
[0127] Among them, the more specific readable storage medium can include but is not limited to: portable disks, hard disks, random access memories, read-only memories, erasable programmable read-only memories, optical storage devices, magnetic storage devices, or any suitable combination of the above.
[0128] In a possible implementation manner, the present invention can also be implemented in the form of a program product, which includes program code. When the program product runs on a terminal device, the program code is used to cause the terminal device to execute the steps of implementing the dynamic dietary recommendation method of Embodiment 1.
[0129] Among them, the program code for implementing the present invention can be written in any combination of one or more programming languages, and the program code can be executed entirely on the user device, partially on the user device, executed as an independent software package, partially on the user device and partially on a remote device, or entirely on a remote device.
[0130] Although the specific embodiments of the present invention have been described above, those skilled in the art should understand that this is only an example, and the protection scope of the present invention is defined by the appended claims. Without departing from the principles and essence of the present invention, those skilled in the art can make various changes or modifications to these embodiments, but these changes and modifications all fall within the protection scope of the present invention.
Claims
1. A dynamic dietary recommendation method, characterized in that the steps Including: Obtain user data and a set of candidate recipe plans corresponding to the user, where the set of candidate recipes includes several candidate recipe plans; Among them, the user data includes an ideal recipe plan corresponding to the user, the ideal recipe plan includes several nutrient indexes required by the user and the target nutrient content corresponding to each nutrient index, the user data also includes the nutritional weight of each nutrient index, and the nutritional weight is used to represent the importance of different nutrient indexes to the user; Each candidate recipe plan includes the recipe nutrient content corresponding to each nutrient index; Based on each nutrient index in each candidate recipe plan, the recipe nutrient content corresponding to each nutrient index, the target nutrient content, and the nutritional weight, calculate the ideal distance between each candidate recipe plan and the ideal recipe plan; Output a recommended recipe plan, where the recommended recipe plan includes N recipe plans with the smallest ideal distances among several, and N is a recipe plan quantity threshold.
2. The dynamic dietary recommendation method according to claim 1, characterized in that The user data also includes the preset target nutrient content corresponding to each nutrient index, and the preset target nutrient content includes intermediate nutrient content, interval nutrient content, and extremely large nutrient content; The steps of the dynamic dietary recommendation method also include: According to the intermediate nutrient content, the interval nutrient content, and the recipe nutrient content, convert the corresponding intermediate nutrient content and the interval nutrient content into extremely large nutrient content; Perform normalization processing on the extremely large nutrient content obtained by conversion and other extremely large nutrient contents to obtain several target nutrient contents in the user data.
3. The dynamic dietary recommendation method according to claim 1, wherein, The specific steps of calculating the ideal distance between each candidate recipe plan and the ideal recipe plan based on each nutrient index in each candidate recipe plan, the recipe nutrient content corresponding to each nutrient index, the target nutrient content, and the nutritional weight include: Construct a normalization matrix and calculate the ideal distance corresponding to each candidate recipe plan according to the following formula: Among them, m is the number of nutrient indicators, i is the ranking of candidate recipe plans, j is the ranking of nutrient indicators, and w j is the nutritional weight of the nutrient indicator ranked j, is the target nutrient content of the nutrient indicator ranked j, and z ij is the recipe nutrient content of the nutrient indicator ranked j in the candidate recipe plan ranked i.
4. The dynamic dietary recommendation method according to claim 3, wherein The steps after obtaining the user data and the set of candidate recipe plans corresponding to the user also include: When the number of candidate recipe plans in the set of candidate recipes is greater than the recipe plan quantity threshold, perform the calculation of the ideal distance between each candidate recipe plan and the ideal recipe plan based on each nutrient index in each candidate recipe plan, the recipe nutrient content corresponding to each nutrient index, the target nutrient content, and the nutritional weight.
5. A dynamic dietary recommendation system, characterized in that, Including a data acquisition module, an ideal distance calculation module, and a recommended recipe plan output module; The data acquisition module is used to obtain user data and a set of candidate recipe plans corresponding to the user, where the set of candidate recipes includes several candidate recipe plans; Wherein, the user data includes an ideal recipe plan corresponding to the user, the ideal recipe plan includes a number of nutrient indexes required by the user and target nutrient contents corresponding to each nutrient index, the user data further includes a nutrition weight for each nutrient index, and the nutrition weight is used to represent the importance degree of different nutrient indexes to the user; Each candidate recipe plan includes recipe nutrient contents corresponding to each nutrient index; The ideal distance calculation module is configured to calculate an ideal distance between each candidate recipe plan and the ideal recipe plan based on each nutrient index in each candidate recipe plan, the recipe nutrient content corresponding to each nutrient index, the target nutrient content, and the nutrition weight; The recommended recipe plan output module is configured to output a recommended recipe plan, and the recommended recipe plan includes N recipe plans with the smallest ideal distances, where N is a recipe plan quantity threshold; 6. The dynamic dietary recommendation system according to claim 5, wherein The user data further includes a preset target nutrient content corresponding to each nutrient index, and the preset target nutrient content includes an intermediate nutrient content, an interval nutrient content, and an extremely large nutrient content; The ideal distance calculation module is further configured to convert the corresponding intermediate nutrient content and interval nutrient content into extremely large nutrient contents according to the intermediate nutrient content, the interval nutrient content, and the recipe nutrient content; The extremely large nutrient contents obtained through conversion are subjected to normalization processing with other extremely large nutrient contents to obtain a number of the target nutrient contents in the user data; 7. The dynamic dietary recommendation system according to claim 5, wherein The ideal distance calculation module is further configured to construct a normalization matrix and calculate the ideal distance corresponding to each candidate recipe plan according to the following formula: Among them, m is the number of nutrient indicators, i is the ranking of candidate recipe plans, j is the ranking of nutrient indicators, and w j is the nutritional weight of the nutrient indicator ranked j, is the target nutrient content of the nutrient indicator ranked j, and z ij is the recipe nutrient content of the nutrient indicator ranked j in the candidate recipe plan ranked i.
8. The dynamic dietary recommendation system according to claim 7, wherein When the number of candidate recipe plans in the candidate recipe set is greater than the recipe plan quantity threshold, the ideal distance calculation module is further configured to perform the calculation of the ideal distance between each candidate recipe plan and the ideal recipe plan based on each nutrient index in each candidate recipe plan, the recipe nutrient content corresponding to each nutrient index, the target nutrient content, and the nutrition weight; 9. An electronic device, comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the dynamic dietary recommendation method according to any one of claims 1-4; 10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the steps of the dynamic dietary recommendation method according to any one of claims 1-4.
Citation Information
Patent Citations
Personalized healthy diet recommendation service method
CN105677852A
Intelligent healthy diet recommendation system combined with mobile terminal
CN108899073A