Dietary nutrition balance collocation generation method and system based on individualized difference demands, electronic equipment and storage medium
By collecting user information, calculating the basal metabolic rate and energy consumption, and using genetic algorithms and roulette selection algorithms to generate personalized dietary combinations, the problem that the existing technology cannot meet individual different needs is solved, and accurate dietary nutrition guidance and management is achieved .
Patent Information
- Application Number
- CN202411378221.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-30
- Publication Date
- 2025-01-14
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The existing dietary nutrition balance matching methods cannot meet individual differences and special needs, especially for pregnant women, the elderly and patients with chronic diseases. General dietary advice cannot provide personalized and timely nutrition guidance, and existing tools do not fully consider individual differences. and dynamic changes in nutritional needs.
By collecting basic information from users, calculating the basal metabolic rate and daily energy consumption, using genetic algorithms and roulette selection algorithms to generate personalized dietary nutrition combinations, combining the user's health status and allergy history, adjusting the nutrient intake ratio, And build a database of ingredients and nutrients to provide accurate dietary guidance.
It has achieved accurate grasp of users' dynamic nutritional needs, provided more accurate and effective dietary nutrition guidance, helping patients better manage dietary nutrition in the clinical nutrition department, meet individual needs, and consider health status and allergic history.
Smart Images

Figure FT_1 
Figure FT_2 
Figure FT_3
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of clinical nutrition, and in particular to a method, system, electronic device and storage medium for generating balanced dietary nutrition combinations based on individualized difference needs. Background Art
[0002] As people pay more attention to healthy diet, the field of clinical nutrition is facing many technical problems that need to be solved urgently. The pace of modern life is accelerating, and many people lack scientific guidance in their diet choices, leading to nutritional imbalances and the increase of related diseases, such as obesity, cardiovascular disease and metabolic syndrome. Reasonable dietary matching needs to consider not only the type and nutritional content of food, but also individual differences and special needs.
[0003] In the clinical nutrition department of the hospital, the methods for generating balanced dietary nutrition combinations for different groups of people are still insufficient. Especially for special groups such as pregnant women, the elderly and patients with chronic diseases, their nutrient requirements are different, and the existing general dietary recommendations often cannot meet their personalized needs. For example, diabetic patients need to strictly control carbohydrate intake, while kidney patients need to limit protein and sodium intake.
[0004] In addition, many hospitals rely on the expertise of nutritionists when providing nutrition consultations, but due to limited resources, many people are unable to obtain timely and personalized nutrition guidance. This makes users often feel at a loss in their daily diet and do not know how to choose the right food combination to achieve nutritional balance.
[0005] Although there are some dietary analysis tools currently, most of them can only provide basic information and usually provide general nutritional advice without considering individual differences; or, even if there are some dietary nutrition plans that take individual differences into consideration, they are generally based on more conventional matching algorithms, using the personal basic information entered by the user and the dietary nutrition formula of a specific population for simple matching to obtain the corresponding personalized dietary nutrition plan, which fails to fully and deeply analyze individual differences and the dynamic changes in nutritional needs. Summary of the invention
[0006] In view of this, the present invention aims to provide a method, system, electronic device and storage medium for generating dietary nutritional balance based on individualized difference needs, in order to provide users with more accurate and effective dietary nutritional guidance, thereby assisting in improving the management of patient dietary nutrition by clinical nutrition departments.
[0007] In order to achieve the above object, the present invention adopts the following technical scheme: In a first aspect, an embodiment of the present invention provides a method for generating a balanced dietary nutrition combination based on individualized difference needs, comprising: Collect basic information about users, including age, gender, weight, height, daily activity status, health status, and allergy history; The basal metabolic rate of the user is calculated using the human basal metabolic rate formula according to the user's age, gender, weight and height; Calculating the total daily energy consumption required by the user according to the basal metabolic rate and daily activity status; Based on the total daily energy consumption required by the user, preliminarily determine the intake ratio of carbohydrates, proteins, fats, vitamins and minerals to meet the needs of the user in accordance with national or international nutrition standards; According to the health status and allergy history of the user, the intake ratio is adjusted to determine the target intake ratio of carbohydrates, protein and fat; Based on the target intake ratio, the nutritional information of the food is obtained from the food nutritional database, and the optimal dietary nutritional combination is generated using a genetic algorithm.
[0008] Optionally, based on the target intake ratio, obtaining the nutritional information of the food from a food nutritional database, and using a genetic algorithm to generate an optimal dietary nutritional combination, includes: Extract the nutritional information of each ingredient from the ingredient nutritional database, including carbohydrates, proteins, fats, vitamins and minerals; Filter the list of available ingredients suitable for the user based on the user's dietary preferences and allergy history; An objective function is initially set to minimize the gap between the actual nutritional intake of the user and the target intake ratio; the objective function is: ;in, is the ith nutrient actually ingested, is the target intake of the ith nutrient, n is the number of nutrient types, and the objective function represents the degree of deviation between the actual intake and the target intake ratio; Randomly generate a predetermined number of individuals based on the list of available ingredients, each individual representing a meal combination consisting of different ingredients; For each individual, the objective function is used to calculate its fitness; wherein, the lower the fitness, the closer the dietary combination plan is to the target intake ratio.
[0009] Selecting a predetermined proportion of excellent individuals for reproduction based on a roulette wheel selection algorithm and the fitness value; Performing a crossover operation on the selected excellent individuals to generate new target individuals; Changing the weight of the food material contained in the target individual and performing mutation; Set the maximum number of iterations or fitness threshold, stop when the condition is reached, and output an optimal individual; a new individual is generated every iteration; Based on the optimal individual finally obtained, the recommended dietary combination plan is output, including the gram weight of each ingredient and its corresponding nutritional information.
[0010] Optionally, for each individual, using the objective function to calculate its fitness includes: defining a maximum intake limit for each nutrient based on the user's health data and food nutrition data: setting limit parameters for each nutrient based on the stated maximum intake limits; Adding a constraint term to the objective function to detect and process whether the actual intake exceeds the maximum intake limit; The actual intake of each nutrient was compared and the portion exceeding the maximum intake limit was calculated; Adding the penalty term for the portion exceeding the maximum intake limit to the objective function to form a new objective function; The fitness of each individual is calculated according to the new objective function.
[0011] Optionally, the method further comprises: pre-building a food nutrition database, including: determining individualized nutrition requirements of different user group indicators, wherein the user group indicators include age, gender, weight, activity level, health status and allergy history; According to the individualized nutritional requirements, identifying the required nutritional component types, the nutritional component types including: protein, fat, carbohydrates, vitamins and minerals; Collect food nutrition data from various authoritative sources, which should cover common food types; Extracting detailed nutritional information of foods from a selected data source, wherein the detailed nutritional information of each food includes the nutritional content in basic weight units; Organizing the collected detailed nutritional information data into a systematic format, including food name, nutritional ingredients, function and content; Design the structure of the food nutrition database, including table design and field settings, the fields include: food ID, food name, category, nutrition, function and content; Create a database system and enter the sorted data into the database system; Cross-validate the data in the database to check whether the data is accurate and complete; Configure a data update mechanism to regularly check and update food information in the database to reflect the latest food nutritional composition data and changes in food categories.
[0012] Optionally, adjusting the intake ratio according to the health status and allergy history of the user to determine the target intake ratio of carbohydrates, proteins and fats includes: classifying the user into different health categories according to the health status of the user by a preset decision tree classification algorithm, wherein each health category corresponds to a different nutritional requirement adjustment standard; Analyze the user's allergy history information and convert the allergy history information into restriction conditions or adjustment factors, wherein the restriction conditions or adjustment factors are used to limit or adjust the maximum intake of certain nutrients; Depending on the health status category, the intake ratio is adjusted by applying limiting conditions or adjustment factors; the limiting conditions or adjustment factors are derived from expert knowledge and nutritional research.
[0013] Optionally, the selecting a predetermined proportion of excellent individuals for reproduction based on the roulette wheel selection algorithm and the fitness value includes: The fitness value of each individual is normalized and converted into relative probability; the sum of the fitness values of all individuals is 1; Based on the normalized fitness value of each individual, create a roulette wheel diagram, where the size of each sector of the roulette wheel is proportional to the fitness of the individual; Calculate the fitness ratio of each individual on the roulette wheel; Generate a random number between 0 and 1 to simulate the roulette wheel spinning process; The selected individual is determined according to the sector corresponding to the random number, and the selected individual is determined as an excellent individual.
[0014] In a second aspect, the present invention also provides a dietary nutritional balance matching generation system based on individualized difference needs, including: The collection program unit is used to collect basic information of the user, including age, gender, weight, height, daily activity status, health status and allergy history; A first calculation program unit is used to calculate the user's basal metabolic rate using a human basal metabolic rate formula according to the user's age, gender, weight and height; A second calculation program unit, configured to calculate the total daily energy consumption required by the user according to the basal metabolic rate and the daily activity status; A first determination program unit is used to preliminarily determine the intake ratio of carbohydrates, proteins, fats, vitamins and minerals that meets the needs of the user based on the total daily energy consumption required by the user in accordance with national or international nutrition standards; A second determination program unit is used to adjust the intake ratio according to the health status and allergy history of the user to determine the target intake ratio of carbohydrates, proteins and fats; A program generation unit is used to obtain the nutritional information of the food from the food nutritional database based on the target intake ratio, and generate the optimal dietary nutritional combination by using a genetic algorithm.
[0015] Optionally, the generating program unit is specifically used for: Extract the nutritional information of each ingredient from the ingredient nutritional database, including carbohydrates, proteins, fats, vitamins and minerals; Filter the list of available ingredients suitable for the user based on the user's dietary preferences and allergy history; An objective function is initially set to minimize the gap between the actual nutritional intake of the user and the target intake ratio; the objective function is: ;in, is the ith nutrient actually ingested, is the target intake of the ith nutrient, n is the number of nutrient types, and the objective function represents the degree of deviation between the actual intake and the target intake ratio; Randomly generate a predetermined number of individuals based on the list of available ingredients, each individual representing a meal combination consisting of different ingredients; For each individual, the fitness is calculated using the objective function; wherein the lower the fitness, the closer the dietary combination plan is to the target intake ratio; Selecting a predetermined proportion of excellent individuals for reproduction based on a roulette wheel selection algorithm and the fitness value; Performing a crossover operation on the selected excellent individuals to generate new target individuals; Changing the weight of the food material contained in the target individual and performing mutation; Set the maximum number of iterations or fitness threshold, stop when the condition is reached, and output an optimal individual; a new individual is generated every iteration; Based on the optimal individual finally obtained, a recommended dietary combination plan is generated, including the weight of each ingredient and its corresponding nutritional information.
[0016] In a third aspect, the present invention also provides an electronic device in an embodiment, comprising: a housing, a processor, a memory, a circuit board and a power supply circuit, wherein the circuit board is placed inside the space enclosed by the housing, and the processor and the memory are arranged on the circuit board; the power supply circuit is used to supply power to various circuits or devices of the above-mentioned electronic device; the memory is used to store executable program code; the processor runs a program corresponding to the executable program code by reading the executable program code stored in the memory, so as to execute the dietary nutritional balance combination generation method based on individual difference needs as described in any one of the first aspects above.
[0017] In a fourth aspect, an embodiment of the present invention also provides a computer-readable storage medium, wherein the computer-readable storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the method for generating a balanced dietary nutrition combination based on individualized difference needs as described in any one of claims 1 to 6.
[0018] The dietary nutrition balance matching generation method, system, electronic device and storage medium provided by the embodiment of the present invention systematically collects the basic information of the user, comprehensively collects multi-dimensional data including age, gender, weight, height, daily activity status, health status and allergy history, and then calculates the basic metabolic data of the user based on the aforementioned highly personalized data, which can deeply analyze the metabolic needs and health status of the user, and calculate the daily energy consumption based on the daily activity status, so as to achieve a more accurate grasp of the dynamic nutritional needs of the user, and adopt an algorithm to tailor the total energy required daily and the consumption of various nutrients. Based on the total energy consumption required daily by the user, the nutritional needs are accurately and dynamically adjusted according to the health status and allergy history of the user, and the individualized needs are fully and deeply considered. While meeting the personalized needs of the user, the health status and allergy history of the user are also flexibly adjusted. Finally, the optimal dietary nutrition matching combination is generated by using a genetic algorithm, which can provide users with more accurate and effective dietary nutrition guidance, help patients obtain accurate nutrition guidance, and thus assist in improving the management of clinical nutrition departments in patients' dietary nutrition. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0020] Figure 1 This is a flow chart of a method for generating a balanced dietary nutrition combination based on individualized difference needs according to an embodiment of the present invention; Figure 2 This is a schematic diagram of a solution flow in a method for generating balanced dietary nutrition combinations based on individualized difference needs in an embodiment of the present invention; Figure 3 This is a schematic block diagram of the dietary nutritional balance matching generation system architecture based on individualized difference needs of the present invention; Figure 4 The figure is a schematic block diagram of the structure of an electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0021] The embodiments of the present invention are described in detail below with reference to the accompanying drawings.
[0022] It should be clear that the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention. Embodiment 1
[0023] like Figure 1 As shown, this embodiment provides a device 100 for generating a balanced dietary nutrition combination based on individualized difference needs. The device 100 includes a processor 102, a user interface 104, a memory 106, and a communication interface 108. The processor 102 is configured to execute a method for generating a balanced dietary nutrition combination based on individualized difference needs, including the steps of: S110: Collect basic user information.
[0024] The processor 102 is configured to collect basic information of the user, including but not limited to age, gender, weight, height, daily activity status, health status and allergy history, through the user interface 104. The user interface 104 may include a touch screen, a keyboard or other input device, through which the user can enter basic information. For example, the user can enter his daily activity status, such as walking steps and exercise time, on the smartphone application.
[0025] S120. The processor 102 is further configured to calculate the user's basal metabolic rate using a human basal metabolic rate formula according to the user's age, gender, weight and height.
[0026] The calculation formula of basal metabolic rate can be adjusted according to the user's age, gender, weight and height. For example, according to different genders, the general calculation formula of basal metabolic rate BMR is as follows: For men, the basal metabolic rate BMR = 88.362 + (13.397 × body weight (kg)) + (4.799 × height (cm)) - (5.677 × age (years)); For women, the basal metabolic rate BMR = 447.593 + (9.247 × body weight (kg)) + (3.098 × height (cm)) - (4.330 × age (years)); S130. Calculate the user's total daily energy consumption based on the user's basal metabolic rate and daily activity status.
[0027] Daily activity status can be assessed by user-entered activity levels, such as sedentary, light activity, moderate activity, high activity, etc. The total energy expenditure is calculated as follows: Total energy expenditure TDEE = BMR × activity factor; the activity factor is adjusted according to the user's activity level, for example: sedentary: 1.2; light activity: 1.375; moderate activity: 1.55; high activity: 1.725.
[0028] S140. Based on the user's total daily energy consumption, the processor 102 preliminarily determines the user's intake ratio of carbohydrates, proteins, fats, vitamins and minerals according to preset national or international nutrition standards.
[0029] For example, common nutrient ratios are: carbohydrates: 50-60%; protein: 10-20%; fat: 20-30%, etc. The above are just a few examples, and other specific nutrients can be obtained by referring to the relevant national or international nutrition standard database.
[0030] S150. Adjust the initially determined nutrient intake ratio according to the user's health status and allergy history. For example, for diabetic patients, the carbohydrate intake ratio may need to be reduced, while the protein and fat ratios may need to be increased accordingly. For kidney disease patients, protein and sodium intake need to be strictly controlled.
[0031] S160. Based on the adjusted target intake ratio, the nutritional information of the food is obtained from the food nutritional database, and the optimal dietary nutritional combination is generated using a genetic algorithm.
[0032] The method for generating balanced dietary nutrition matching based on individualized difference needs provided by the embodiment of the present invention systematically collects basic information of users, comprehensively collects multi-dimensional data including age, gender, weight, height, daily activity status, health status and allergy history, and then calculates the basic metabolic data of users based on the aforementioned highly personalized data, which can deeply analyze the metabolic needs and health status of users, and calculate daily energy consumption based on daily activity status, so as to achieve a more accurate grasp of the dynamic nutritional needs of users, and adopt an algorithm to tailor the total energy required daily and the consumption of various nutrients. Based on the total energy consumption required daily by the user, the nutritional needs are accurately and dynamically adjusted according to the health status and allergy history of the user, and the individualized difference needs are fully and deeply considered. While meeting the personalized needs of users, the health status and allergy history of users are also flexibly adjusted. Finally, the optimal dietary nutrition matching combination is generated by using a genetic algorithm, which can provide users with more accurate and effective dietary nutrition guidance, help patients obtain accurate nutrition guidance, and thus assist in improving the management of clinical nutrition departments in patients' dietary nutrition.
[0033] See also Figure 2 As shown, in some embodiments, the step of obtaining the nutritional information of the food from the nutritional database of the food based on the adjusted target intake ratio and generating the optimal dietary nutritional combination by using a genetic algorithm (step S160) includes: S161. Extracting nutritional information: extracting nutritional information of each ingredient from an ingredient nutritional database, including carbohydrates, proteins, fats, vitamins and minerals.
[0034] S162. Filter out a list of available ingredients suitable for the user based on the user's dietary preferences and allergy history.
[0035] S162. Preliminarily set an objective function to minimize the difference between the actual nutritional intake of the user and the target intake ratio. The objective function is as follows: ; in, is the ith nutrient actually ingested, is the target intake of the ith nutrient, n is the number of nutrient types, and the objective function represents the degree of deviation between the actual intake and the target intake ratio; S163. Randomly generate a predetermined number of individuals based on the list of available ingredients, each individual representing a dietary combination consisting of different ingredients.
[0036] S164. For each individual, the fitness is calculated using the objective function; wherein, the lower the fitness, the closer the dietary combination plan is to the target intake ratio.
[0037] S165. Select a predetermined proportion of excellent individuals for reproduction based on the roulette wheel selection algorithm and the fitness value.
[0038] S166. Perform a crossover operation on the selected excellent individuals to generate new target individuals.
[0039] S167. Change the weight of the ingredients contained in the target individual and mutate it.
[0040] S168, set the maximum number of iterations or fitness threshold, stop when the condition is reached, and output an optimal individual. A new individual is generated every iteration.
[0041] S169. Based on the optimal individual finally obtained, a recommended dietary plan is output, including the weight of each ingredient and its corresponding nutritional information.
[0042] In this embodiment, by obtaining the nutritional information of the ingredients from the nutritional database of the ingredients based on the target intake ratio, and using a genetic algorithm to generate the best dietary nutrition combination, the optimal solution can be quickly found in a large number of ingredient combinations. By extracting the nutritional information of each ingredient and screening out a list of available ingredients suitable for the user based on the user's dietary preferences and allergy history, it is ensured that the dietary plan meets the nutritional needs while taking into account the user's dietary preferences and safety. The objective function is set to minimize the gap between the actual nutritional intake of the user and the target intake ratio. By generating initial individuals, calculating fitness, selecting excellent individuals, crossover operations and mutation operations, the dietary combination is iteratively optimized, and finally an optimal individual is output, which can improve the scientificity and personalization of the dietary plan generation and provide users with more accurate and effective dietary nutrition guidance.
[0043] In the above-mentioned dietary nutritional balance matching technical solution, when calculating fitness, if only the intake ratio of nutrients is considered, the maximum intake limit of certain nutrients is ignored. This may lead to excessive intake of certain nutrients and affect the health of the user. Therefore, in some embodiments, the use of the objective function to calculate the fitness of each individual (step S164) includes: Based on the user's health data and food nutrition data, the maximum intake limit of each nutrient is defined. For example, based on the user's health condition, the daily limit for the user's sodium intake is no more than 2,300 mg.
[0044] According to the maximum intake limit, a limit parameter is set for each nutrient component. For example, the limit parameter of sodium can be set to 2300 mg.
[0045] A constraint term is added to the objective function to detect and process whether the actual intake exceeds the maximum intake limit. The specific formula 2 is as follows:
[0046] Among them, T j is the jth nutrient actually ingested, C max is the maximum intake limit of the jth nutrient, and m is the number of restricted nutrients.
[0047] And, compare the actual intake of each nutrient component and calculate the portion exceeding the maximum intake limit; the order of this step and the previous step can be interchanged or performed in parallel.
[0048] Adding the penalty term for the portion exceeding the maximum intake limit to the objective function to form a new objective function; The calculation formula of the penalty term is as follows: The penalty term k=0, the condition is: actual intake ≤ maximum intake; Penalty term k = actual intake of j nutrients - maximum intake limit of j nutrients, under the condition that actual intake of j nutrients > maximum intake of j nutrients. Then, the new objective function is: the above-mentioned penalty term is added to the right side of the equal sign in Formula 2.
[0049] For each individual, the new objective function is used to calculate its fitness. The lower the fitness, the closer the dietary combination plan is to the target intake ratio and does not exceed the maximum intake limit.
[0050] In this embodiment, the objective function not only takes into account the intake ratio of nutrients, but also effectively handles the problem of actual intake exceeding the maximum intake limit by adding constraints and penalty terms, ensuring that the generated dietary combination plan is more scientific and healthy.
[0051] Specifically, the method further includes: performing iterative optimization based on the new objective function until a maximum number of iterations or a fitness threshold is reached, and outputting the optimal individual.
[0052] In the implementation of the present invention, a scientific and reasonable dietary nutrition balance matching plan can be generated according to individual difference needs, which solves the problem that some plans ignore the maximum intake limit of individual nutrients to meet the nutritional needs of different groups of people and improve the dietary nutrition and health level of users.
[0053] In order to achieve the expected technical purpose of the technical solution provided by the embodiment of the present invention, a systematic and standardized food nutrition database is a necessary condition. If the traditional method of relying on nutritionists to query is relied on, it is easy to have inaccurate or incomplete data, which is difficult to adapt to individualized nutritional needs.
[0054] In some embodiments, the method further comprises: pre-building a food nutrition database. The specific steps are as follows: Determine individualized nutritional needs for different user group indicators, including age, gender, weight, activity level, health status and allergy history.
[0055] According to the individualized nutritional requirements, the required nutritional component types are identified, and the nutritional component types include protein, fat, carbohydrates, vitamins and minerals.
[0056] Collect food nutrition data from various authoritative sources, which should cover common food types.
[0057] Detailed nutritional information of foods is extracted from selected data sources. The detailed nutritional information of each food includes the nutritional content in basic weight units.
[0058] The collected detailed nutritional information data are organized into a systematic format, including food name, nutritional ingredients, function and its content.
[0059] Design the structure of the food nutrition database, including table design and field setting, the fields include food ID, food name, category, nutrition, function and content.
[0060] Create a database system and enter the sorted data into the database system.
[0061] Cross-validate the data in the database to check whether the data is accurate and complete.
[0062] Configure a data update mechanism to regularly check and update food information in the database to reflect the latest food nutritional composition data and changes in food categories.
[0063] In the embodiment of the present invention, through the above series of steps, a food nutrition database is pre-built, which can systematically and standardizedly manage the nutrition information of the food, improve the accuracy and completeness of the data, and is not only conducive to improving the efficiency of generating dietary nutrition matching plans, but also can better meet individualized nutritional needs.
[0064] In some plans that automatically generate balanced dietary nutrition combinations, the adjustment of nutrient intake ratios is generally based on simple rules or manual adjustments. There is a lack of systematic algorithm support, and it is difficult to accurately reflect the user's health status and allergy history, resulting in insufficient personalization and scientificity of the dietary plan.
[0065] In some embodiments, the intake ratio is adjusted according to the health status and allergy history of the user to determine the target intake ratio of carbohydrates, protein and fat, including: according to the health status of the user, the user is divided into different health categories through a preset decision tree classification algorithm, wherein each health category corresponds to different nutritional requirement adjustment standards.
[0066] Analyze allergy history information: Analyze the user's allergy history information and convert the allergy history information into restriction conditions or adjustment factors, which are used to limit or adjust the maximum intake of certain nutrients.
[0067] Depending on the health status category, the intake ratio is adjusted by applying limiting conditions or adjustment factors; the limiting conditions or adjustment factors are derived from expert knowledge and nutritional research.
[0068] In this embodiment, through the preset decision tree classification algorithm and analysis of the user's allergy history information, it assists in systematically and accurately adjusting the nutrient intake ratio, ensuring the personalization and scientific nature of the dietary plan, and providing users with safe and effective dietary nutrition guidance.
[0069] Specifically, in order to ensure that the selected individuals have a high fitness, in some embodiments, the method of selecting a predetermined proportion of excellent individuals for breeding based on the roulette wheel selection algorithm and the fitness value specifically includes: The fitness value of each individual is normalized and converted into relative probability; the sum of the fitness values of all individuals is 1.
[0070] Based on the normalized fitness value of each individual, a roulette wheel plot is created, where the size of each sector of the roulette wheel is proportional to the fitness of the individual.
[0071] Calculate the fitness share of each individual on the roulette wheel.
[0072] Generate a random number between 0 and 1 to simulate the spinning process of the roulette wheel.
[0073] The selected individual is determined according to the sector corresponding to the random number, and the selected individual is determined as an excellent individual.
[0074] In order to help understand the technical solution and technical effects of this embodiment, examples are given as follows: Suppose there are four individuals, each representing a dietary plan, and their fitness values are: Individual A: fitness value = 20; individual B: fitness value = 30; individual C: fitness value = 10; individual D: fitness value = 40.
[0075] First, the fitness value of each individual is normalized so that the sum of the fitness values of all individuals is 1.
[0076] After normalization, individual A: 0.2, individual B: 0.3, individual C: 0.1, individual D: 0.4.
[0077] Based on the normalized fitness values, a roulette wheel plot is created. The size of each sector of the roulette wheel is proportional to the fitness of the individual.
[0078] Calculate the fitness share of each individual on the roulette wheel, which has been completed in step 2.
[0079] For each individual, individual A accounts for 20%, individual B accounts for 30%, individual C accounts for 10%, and individual D accounts for 40%.
[0080] Generate a random number between 0 and 1 to simulate the spinning process of the roulette wheel.
[0081] In an implementation method of generating a random number, a common pseudo-random number generation algorithm is to use a linear congruential generator (LCG). The specific steps of generating a random number between 0 and 1 are as follows: select an initial seed value, assuming it is X0; Using the linear congruential generator formula: Calculate the first random number; where, is a generated random number sequence, is the seed value, a is the multiplier, c is the increment, and m is the modulus.
[0082] For example, suppose we choose the following parameters: a = 1664525, c = 1013904223, m =
[0083] X 0 = 12345. According to the above formula, calculate the first random number and normalize the generated random number to between 0 and 1. Assume that the first random number generated is 0.65 after normalization.
[0084] After the random number is generated, the selected individual is determined according to the sector corresponding to the random number 0.65. According to the previous calculation, the roulette diagram is as follows: 0.0 - 0.2: individual A; 0.2 - 0.5: individual B; 0.5 - 0.6: individual C; 0.6 - 1.0: individual D.
[0085] The random number 0.65 falls within the range of individual D, so individual D is selected as an excellent individual.
[0086] In this embodiment, by using this roulette wheel selection algorithm to screen the best dietary nutrition combination (excellent individuals), it can be ensured that the probability of each individual being selected is proportional to its fitness, thereby increasing the probability of excellent individuals being selected, and can effectively retain and reproduce individuals with higher fitness for gradually optimizing the dietary nutrition balance combination plan, and can more effectively generate the best dietary nutrition combination. Embodiment 2
[0087] Figure 3 This is a schematic block diagram of a dietary nutritional balance generation system based on individualized difference needs according to an embodiment of the present invention. Figure 3 As shown, based on the same technical concept as the embodiments in the above-mentioned embodiment 1, a dietary nutritional balance matching generation system 200 based on individualized difference needs is also provided, including: The collection program unit 210 is used to collect basic information of the user, including age, gender, weight, height, daily activity status, health status and allergy history; A first calculation program unit 220 is used to calculate the user's basal metabolic rate using a human basal metabolic rate formula according to the user's age, gender, weight and height; A second calculation program unit 230 is used to calculate the total daily energy consumption required by the user according to the basal metabolic rate and the daily activity status; A first determination program unit 240 is used to preliminarily determine the intake ratio of carbohydrates, proteins, fats, vitamins and minerals that satisfies the user according to national or international nutrition standards based on the user's daily total energy consumption; A second determination program unit 260 is used to adjust the intake ratio according to the health status and allergy history of the user to determine the target intake ratio of carbohydrates, proteins and fats; The program generation unit 270 is used to obtain the nutritional information of the food from the food nutritional database based on the target intake ratio, and generate the optimal dietary nutritional combination by using a genetic algorithm.
[0088] In some embodiments, the generating program unit is specifically used to: Extract the nutritional information of each ingredient from the ingredient nutritional database, including carbohydrates, proteins, fats, vitamins and minerals; Filter the list of available ingredients suitable for the user based on the user's dietary preferences and allergy history; An objective function is initially set to minimize the gap between the actual nutritional intake of the user and the target intake ratio; the objective function is: ;in, is the ith nutrient actually ingested, is the target intake of the ith nutrient, n is the number of nutrient types, and the objective function represents the degree of deviation between the actual intake and the target intake ratio; Randomly generate a predetermined number of individuals based on the list of available ingredients, each individual representing a meal combination consisting of different ingredients; For each individual, the fitness is calculated using the objective function; wherein the lower the fitness, the closer the dietary combination plan is to the target intake ratio; Selecting a predetermined proportion of excellent individuals for reproduction based on a roulette wheel selection algorithm and the fitness value; Performing a crossover operation on the selected excellent individuals to generate new target individuals; Changing the weight of the food material contained in the target individual and performing mutation; Set the maximum number of iterations or fitness threshold, stop when the condition is reached, and output an optimal individual; a new individual is generated every iteration; Based on the optimal individual finally obtained, a recommended dietary combination plan is generated, including the weight of each ingredient and its corresponding nutritional information.
[0089] The dietary nutrition balance matching generation system based on individualized difference needs provided by the embodiment of the present invention systematically collects the basic information of the user through the mutual cooperation and synergy of the above-mentioned program modules, comprehensively collects multi-dimensional data including age, gender, weight, height, daily activity status, health status and allergy history, and then calculates the basic metabolic data of the user based on the aforementioned highly personalized data, which can deeply analyze the metabolic needs and health status of the user, and calculate the daily energy consumption based on the daily activity status, so as to achieve a more accurate grasp of the dynamic nutritional needs of the user, and adopt an algorithm to tailor the total energy required daily and the consumption of various nutrients. Based on the total energy consumption required daily by the user, the nutritional needs are accurately and dynamically adjusted according to the health status and allergy history of the user, and the individualized difference needs are fully and deeply considered. While meeting the personalized needs of the user, the health status and allergy history of the user are also flexibly adjusted. Finally, the optimal dietary nutrition matching combination is generated by using a genetic algorithm, which can provide users with more accurate and effective dietary nutrition guidance, help patients obtain accurate nutrition guidance, and thus assist in improving the management of clinical nutrition departments in patients' dietary nutrition.
[0090] If it needs to be explained, the system of this embodiment can also be used to execute the technical solutions of the various method embodiments shown in Example 1. Its implementation principles and technical effects are similar to those of Example 1, which will not be described in detail here and can be referenced by each other.
[0091] The present invention also provides an electronic device in an embodiment, the electronic device comprising: a housing, a processor, a memory, a circuit board and a power supply circuit, wherein the circuit board is placed inside the space enclosed by the housing, and the processor and the memory are arranged on the circuit board; the power supply circuit is used to supply power to various circuits or devices of the above-mentioned electronic device; the memory is used to store executable program code; the processor runs a program corresponding to the executable program code by reading the executable program code stored in the memory, so as to execute the method for generating a balanced dietary nutrition combination based on individualized difference needs as described in any one of the first embodiments.
[0092] Figure 4 FIG. 1 is a schematic diagram of the architecture of an electronic device according to an embodiment of the present invention, which can implement any method described in Embodiment 1 of the present invention, such as Figure 4 As shown, as an optional embodiment, the above-mentioned electronic device may include: a shell 41, a processor 42, a memory 43, a circuit board 44 and a power circuit 45, wherein the circuit board 44 is arranged inside the space enclosed by the shell 41, and the processor 42 and the memory 43 are arranged on the circuit board 44; the power circuit 45 is used to supply power to various circuits or devices of the above-mentioned electronic device; the memory 43 is used to store executable program codes; the processor 42 reads the executable program codes stored in the memory 43 to execute the aforementioned dietary nutritional balance matching generation method based on individual difference needs as described in any of the first embodiments.
[0093] The specific execution process of the above steps by the processor 42 and the steps further executed by the processor 42 by running the executable program code can be found in the description of the aforementioned embodiment 1 of the present invention, which will not be repeated here.
[0094] The electronic device exists in various forms, including but not limited to: (1) Mobile communication devices: These devices are characterized by having mobile communication functions and are mainly aimed at providing voice and data communications. Such terminals include: smart phones, multimedia phones, functional phones, and low-end phones. (2) Ultra-mobile personal computer devices: These devices belong to the category of personal computers, have computing and processing functions, and generally also have mobile Internet access features. Such terminals include: PDA, MID and UMPC devices, such as iPad. (3) Portable entertainment devices: These devices can display and play multimedia content. Such devices include: audio and video playback modules (such as iPod), handheld game consoles, e-books, as well as smart toys and portable car navigation devices. (4) Servers: Devices that provide computing services. The server's composition includes processors, hard disks, memory, system buses, etc. The server is similar to the general computer architecture, but because it needs to provide highly reliable services, it has higher requirements in terms of processing power, stability, reliability, security, scalability, manageability, etc. (5) Other electronic devices with data interaction functions.
[0095] The present invention also provides a computer-readable storage medium in an embodiment, wherein the computer-readable storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the method for generating a balanced dietary nutrition combination based on individualized difference needs as described in any of the above-mentioned embodiments one.
[0096] In summary, according to the description of the above embodiments, the dietary nutrition balance matching generation method, system, electronic device and storage medium disclosed in the embodiments of the present invention based on individualized difference needs, by systematically collecting the basic information of the user, comprehensively collecting multi-dimensional data including age, gender, weight, height, daily activity status, health status and allergy history, and then calculating the user's basal metabolic data based on the aforementioned highly personalized data, which can deeply analyze the user's metabolic needs and health status, and comprehensively calculate the daily energy consumption based on the daily activity status, so as to achieve a more accurate grasp of the user's dynamic nutritional needs, and adopt an algorithm to tailor the total energy required daily and the consumption of various nutrients. Based on the total energy consumption required daily by the user, the nutritional needs are accurately and dynamically adjusted according to the user's health status and allergy history, and the individualized difference needs are fully and deeply considered. While meeting the personalized needs of the user, the user's health status and allergy history are also flexibly adjusted. Finally, the optimal dietary nutrition matching combination is generated by using a genetic algorithm, which can provide users with more accurate and effective dietary nutrition guidance, help patients obtain accurate nutrition guidance, and thus assist in improving the management of clinical nutrition departments in patients' dietary nutrition.
[0097] It is understandable that the description is as concise and clear as possible under the premise of being clear and open. Different embodiments of the present invention are basically consistent with the spirit of the present invention, but the description focuses on different aspects. The schemes and scheme effects can be referenced to each other, and some related contents will not be repeated here.
[0098] It should be noted that, in this article, the terms "upper", "lower", etc., indicating the orientation or positional relationship, are only for the convenience of describing the present invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as limiting the present invention. Unless otherwise clearly specified and limited, the terms "installed", "connected", and "connected" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be directly connected or indirectly connected through an intermediate medium. Relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply that there is any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise", or any other variant thereof are intended to cover non-exclusive inclusion, so that a process, method, article, or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such a process, method, article, or device. In the absence of more restrictions, the elements defined by the phrase "comprising a ..." do not exclude the existence of other identical elements in the process, method, article or device comprising the elements. For ordinary technicians in this field, it can be understood by specific circumstances.
[0099] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed by the present invention should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.
Claims
1. A method for generating a balanced dietary nutrition combination based on individualized difference needs, characterized in that: include: Collect basic information about users, including age, gender, weight, height, daily activity status, health status, and allergy history; The basal metabolic rate of the user is calculated using the human basal metabolic rate formula according to the user's age, gender, weight and height; Calculating the total daily energy consumption required by the user according to the basal metabolic rate and daily activity status; Based on the total daily energy consumption required by the user, preliminarily determine the intake ratio of carbohydrates, proteins, fats, vitamins and minerals to meet the needs of the user in accordance with national or international nutrition standards; According to the health status and allergy history of the user, the intake ratio is adjusted to determine the target intake ratio of carbohydrates, protein and fat; Based on the target intake ratio, the nutritional information of the food is obtained from the food nutritional database, and the optimal dietary nutritional combination is generated using a genetic algorithm.
2. The method for generating a balanced dietary nutrition combination based on individualized difference needs according to claim 1, characterized in that: The method of obtaining the nutritional information of the food from the nutritional database of the food based on the target intake ratio and generating the optimal dietary nutritional combination by using a genetic algorithm includes: Extract the nutritional information of each ingredient from the ingredient nutritional database, including carbohydrates, proteins, fats, vitamins and minerals; Filter the list of available ingredients suitable for the user based on the user's dietary preferences and allergy history; An objective function is initially set to minimize the gap between the actual nutritional intake of the user and the target intake ratio; the objective function is: ;in, is the actual intake of the ith nutrient, is the i-th nutrient component to be taken as target, n is the number of nutrient components, and the objective function represents the degree of deviation between the actual intake and the target intake ratio; Randomly generate a predetermined number of individuals based on the list of available ingredients, each individual representing a meal combination consisting of different ingredients; For each individual, the fitness is calculated using the objective function; wherein the lower the fitness, the closer the dietary combination plan is to the target intake ratio; Selecting a predetermined proportion of excellent individuals for reproduction based on a roulette wheel selection algorithm and the fitness value; Performing a crossover operation on the selected excellent individuals to generate new target individuals; Changing the weight of the food material contained in the target individual and performing mutation; Set the maximum number of iterations or fitness threshold, stop when the condition is reached, and output an optimal individual; a new individual is generated every iteration; Based on the optimal individual finally obtained, the recommended dietary combination plan is output, including the gram weight of each ingredient and its corresponding nutritional information.
3. The method for generating a balanced dietary nutrition combination based on individualized difference needs according to claim 2, characterized in that: For each individual, using the objective function to calculate its fitness includes: based on the user's health data and food nutrition data, defining the maximum intake limit of each nutrient component: setting limit parameters for each nutrient based on the stated maximum intake limits; Adding a constraint term to the objective function to detect and process whether the actual intake exceeds the maximum intake limit; The actual intake of each nutrient was compared and the portion exceeding the maximum intake limit was calculated; Adding the penalty term for the portion exceeding the maximum intake limit to the objective function to form a new objective function; The fitness of each individual is calculated according to the new objective function.
4. The method for generating a balanced dietary nutrition combination based on individualized difference needs according to claim 1, characterized in that: The method further includes: pre-building a food nutrition database, including: determining individualized nutrition requirements of different user group indicators, the user group indicators including age, gender, weight, activity level, health status and allergy history; According to the individualized nutritional requirements, identifying the required nutritional component types, the nutritional component types including: protein, fat, carbohydrates, vitamins and minerals; Collect food nutrition data from various authoritative sources, which should cover common food types; Extracting detailed nutritional information of foods from a selected data source, wherein the detailed nutritional information of each food includes the nutritional content in basic weight units; Organizing the collected detailed nutritional information data into a systematic format, including food name, nutritional ingredients, function and content; Design the structure of the food nutrition database, including table design and field settings, the fields include: food ID, food name, category, nutrition, function and content; Create a database system and enter the sorted data into the database system; Cross-validate the data in the database to check whether the data is accurate and complete; Configure a data update mechanism to regularly check and update food information in the database to reflect the latest food nutritional composition data and changes in food categories.
5. The method for generating balanced dietary nutrition combinations based on individualized difference needs according to claim 1, characterized in that: The adjusting the intake ratio according to the health status and allergy history of the user to determine the target intake ratio of carbohydrates, proteins and fats includes: classifying the user into different health categories according to the health status of the user by a preset decision tree classification algorithm, wherein each health category corresponds to a different nutritional requirement adjustment standard; Analyze the user's allergy history information and convert the allergy history information into restriction conditions or adjustment factors, wherein the restriction conditions or adjustment factors are used to limit or adjust the maximum intake of certain nutrients; Depending on the health status category, the intake ratio is adjusted by applying limiting conditions or adjustment factors; the limiting conditions or adjustment factors are derived from expert knowledge and nutritional research.
6. The method for generating balanced dietary nutrition combinations based on individualized difference needs according to claim 1, characterized in that: The method of selecting a predetermined proportion of excellent individuals for reproduction based on the roulette wheel selection algorithm and the fitness value includes: The fitness value of each individual is normalized and converted into relative probability; the sum of the fitness values of all individuals is 1; Based on the normalized fitness value of each individual, create a roulette wheel diagram, where the size of each sector of the roulette wheel is proportional to the fitness of the individual; Calculate the fitness ratio of each individual on the roulette wheel; Generate a random number between 0 and 1 to simulate the roulette wheel spinning process; The selected individual is determined according to the sector corresponding to the random number, and the selected individual is determined as an excellent individual.
7. A dietary nutritional balance generation system based on individualized needs, characterized in that: include: The collection program unit is used to collect basic information of the user, including age, gender, weight, height, daily activity status, health status and allergy history; A first calculation program unit is used to calculate the user's basal metabolic rate using a human basal metabolic rate formula according to the user's age, gender, weight and height; A second calculation program unit, configured to calculate the total daily energy consumption required by the user according to the basal metabolic rate and the daily activity status; A first determination program unit is used to preliminarily determine the intake ratio of carbohydrates, proteins, fats, vitamins and minerals that meets the needs of the user based on the total daily energy consumption required by the user in accordance with national or international nutrition standards; A second determination program unit is used to adjust the intake ratio according to the health status and allergy history of the user to determine the target intake ratio of carbohydrates, proteins and fats; A program generation unit is used to obtain the nutritional information of the food from the food nutritional database based on the target intake ratio, and generate the optimal dietary nutritional combination by using a genetic algorithm.
8. The dietary nutritional balance matching generation system based on individualized difference needs according to claim 1, characterized in that: The generating program unit is specifically used for: Extract the nutritional information of each ingredient from the ingredient nutritional database, including carbohydrates, proteins, fats, vitamins and minerals; Filter the list of available ingredients suitable for the user based on the user's dietary preferences and allergy history; An objective function is initially set to minimize the gap between the actual nutritional intake of the user and the target intake ratio; the objective function is: ;in, is the ith nutrient actually ingested, is the i-th nutrient component to be taken as target, n is the number of nutrient components, and the objective function represents the degree of deviation between the actual intake and the target intake ratio; Randomly generate a predetermined number of individuals based on the list of available ingredients, each individual representing a meal combination consisting of different ingredients; For each individual, the fitness is calculated using the objective function; wherein the lower the fitness, the closer the dietary combination plan is to the target intake ratio; Selecting a predetermined proportion of excellent individuals for reproduction based on a roulette wheel selection algorithm and the fitness value; Performing a crossover operation on the selected excellent individuals to generate new target individuals; Changing the weight of the food material contained in the target individual and performing mutation; Set the maximum number of iterations or fitness threshold, stop when the condition is reached, and output an optimal individual; a new individual is generated every iteration; Based on the optimal individual finally obtained, a recommended dietary combination plan is generated, including the weight of each ingredient and its corresponding nutritional information.
9. An electronic device, characterized in that: The electronic device comprises: a housing, a processor, a memory, a circuit board and a power supply circuit, wherein the circuit board is placed inside the space enclosed by the housing, and the processor and the memory are arranged on the circuit board; the power supply circuit is used to supply power to various circuits or devices of the above-mentioned electronic device; the memory is used to store executable program codes; the processor runs a program corresponding to the executable program code by reading the executable program code stored in the memory, so as to execute the dietary nutritional balance matching generation method based on individualized difference needs as described in any one of claims 1 to 6.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the method for generating a balanced dietary nutrition combination based on individualized difference needs as described in any one of claims 1 to 6.
Citation Information
Patent Citations
Dietary recommendation method and device, computer equipment and storage medium
CN112148969A
Precise diet management method based on intelligent health data analysis
CN115862814A
Nutrition balanced diet recommendation method and system based on user body health data
CN118430745A
Medical question and answer data recommendation method based on large model
CN118445382A
Meal planning device and method
US20170053551A1
Cited By
Infant feeding demand evaluation method and device
CN121687403A