Diversified diet recommendation method and system based on health requirements
By calculating the basal metabolic rate and iteratively adjusting the feasible domain projector to generate meal portions, the problem that the existing system is difficult to take into account multiple disease restrictions and regionalized eating habits is solved, and safe, diverse and executable dietary recommendations are achieved.
Patent Information
- Application Number
- CN202511172877.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-21
- Publication Date
- 2025-10-21
AI Technical Summary
The existing personalized dietary recommendation system finds it difficult to simultaneously take into account multiple disease restrictions, energy consistency and users' regional eating habits, resulting in insufficient executability and compliance, and a lack of directly implementable meal sub-ingredient plans and equivalent substitution lists.
By obtaining user data to calculate basal metabolism and daily energy requirements, a feasible domain projector is established for iterative adjustment, meal portions are generated, and executable, replaceable, and regionalized ingredient-level solutions are output to ensure disease safety and dietary diversity.
It has achieved the goal of improving dietary diversity and actual availability while meeting disease safety and energy goals, generating explainable, traceable, and practical dietary recommendation plans that can adapt to the coexistence of multiple diseases and real dining scenarios.
Smart Images

Figure CN120823962A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of health management technology, and in particular to a method and system for recommending diverse diets based on health needs. Background Art
[0002] With the widespread adoption of online nutrition databases, personalized dietary recommendations are gradually shifting from average recipes to energy and nutrient rations tailored to specific populations. However, existing plans often rely on static rules or single-symptom experience, often using fixed ratios or simple calorie conversions. These strategies struggle to address multi-symptom restrictions, energy consistency, and regional dietary habits, leading to limited implementation and compliance.
[0003] In recent years, there have been attempts to use algorithms to balance multiple objectives, but these typically employ a fixed-weighted summation approach, conflating disease safety, energy balance, and dietary diversity. This can lead to mutually exclusive goals: either clinical safety is sacrificed for diversity, or dietary monotony results in energy requirements. Furthermore, many systems remain at the daily total level, lacking readily implementable meal-level ingredient plans and equivalent substitution lists, making it difficult to account for real-world ingredient availability and taste variations.
[0004] To this end, there is an urgent need for a sequential approach that prioritizes disease safety and enhances diversity while meeting energy targets. It can also steadily break down daily portions into three meals and output executable, replaceable, and regionalized food-level solutions, thereby improving the clinical rationality and practical usability of recommendations. Summary of the Invention
[0005] In view of the above-mentioned problems, the present invention is proposed.
[0006] To solve the above technical problems, the present invention provides the following technical solutions: a method for recommending a diverse diet based on health needs, comprising: obtaining user data, calculating basal metabolic rate and daily energy requirements based on the user data, and calculating a daily energy target, and generating a basic portion of each food category based on the daily energy target; On the premise of meeting the daily energy target, taking into account the nutritional risks associated with dietary diversity and disease, a feasible domain projector is established to iteratively adjust the basic share to form a share plan; The portion plan is broken down into meal portions, and specific dietary recommendations for each meal are generated based on user data and meal portions. The daily energy goal, portion plan, meal portions, and specific dietary recommendations are output.
[0007] As a preferred embodiment of the method for recommending a diverse diet based on health needs of the present invention, the user data includes basic data, health data, and diet data, wherein the basic data includes the user's age, gender, height, weight, and place of residence; The health data includes health goals, activity index, disease data, allergy data and dietary restrictions; The dietary data include regional dietary structure, disease intervention data on nutrition and food nutritional composition data.
[0008] As a preferred embodiment of the method for recommending a diverse diet based on health needs described in the present invention, the calculation of the daily energy target includes calculating the basal metabolic rate based on the user's height, weight, and age, and multiplying the basal metabolic rate by the activity coefficient to obtain the daily energy requirement; Calculate daily energy goals based on health goals and disease data, and retrieve the energy coefficient range, energy addition and subtraction range, disease severity, and evidence level corresponding weights from dietary data; For the energy coefficient interval, take the logarithm of the upper and lower limit coefficients, perform linear weighting according to the severity of the disease in the logarithmic domain, and then restore the exponential to the original domain to obtain the target energy coefficient; For the energy addition and subtraction interval, linear weighting is performed between the upper and lower limits according to the severity of the disease to obtain the target energy addition and subtraction amount; When there are multiple disease data, the weights are normalized according to the corresponding weights of disease severity and evidence level, and then the target energy coefficient is synthesized by weighted geometric mean, and the target energy addition or subtraction is synthesized by weighted sum; The daily energy requirement is corrected according to the target energy coefficient and the target energy addition or subtraction, and is limited by the clip function. The limited result is rounded according to a fixed step size to output the daily energy target.
[0009] As a preferred embodiment of the method for recommending a diverse diet based on health needs according to the present invention, generating a basic portion of each food category based on the daily energy target includes reading the energy distribution ratio and the upper and lower limits of the recommended portion of each food category based on user data and regional dietary structure; Based on food nutritional data, retrieve the standard portion weight and energy benchmark for each food category; Break down the daily energy target into each food group according to the energy distribution ratio, and convert the allocated energy into the initial share of each food group based on the energy basis per serving; The initial share is limited according to the upper and lower limits of the recommended share, and fine-tuning is performed within the major food categories that have not reached the upper and lower limits of the recommended share, so that the total energy corresponding to the major food category shares after fine-tuning is consistent with the daily energy target, and the basic share of each major food category is obtained.
[0010] As a preferred embodiment of the method for recommending a diverse diet based on health needs described in the present invention, the feasible domain projector includes a disease constraint modeling based on disease-based nutritional intervention data, wherein the disease constraint includes: Nutrient constraints, for each nutrient k, calculate the supply: ; and constrain ,in, represents the total daily supply of nutrient k under the share q; g represents the index of the food category; represents the share of food category g; Indicates the amount of nutrient K provided per serving of food group G; Indicates the lower daily limit of nutrient K; The upper daily limit of nutrient K; Ratio constraints restrict the relative proportions of nutrients and are given in the form of intervals; Disease taboo constraints, setting the upper limit of food categories or specific foods containing disease taboo ingredients to zero; Energy consistency constraint: the deviation between the daily total energy and the daily energy target cannot exceed the deviation tolerance ; Taking the basic share q of each food category as the initial solution, a discrete micro-operation library is constructed. The micro-operations include: Same-type replacement: within the same category, replace δ parts of subclass A with subclass B, and use swapping and compensation to maintain the same total energy before and after replacement; Cross-category micro-movement: transfer δ portions between two major food groups, and use swaps and compensation to maintain the same total energy; The swap is an equal energy swap, which reduces n portions of the source category while increasing m portions of the receiving category. The energy of n portions of the source category is equal to the energy of m portions of the receiving category. The compensation is energy balancing, which involves transferring δ portions between the two categories and then converting n portions of food from other food categories to balance the energy difference. Each micro-operation sets a minimum share and a maximum share, and the δ shares are integer multiples of the minimum share and do not exceed the maximum share.
[0011] As a preferred embodiment of the method for recommending a diverse diet based on health needs described in the present invention, the feasible domain projector further includes iteratively adjusting the basic share and generating candidate solutions q' from the micro-operation library in a heuristic order. The heuristic order is to first perform operations to address the symptoms and then perform operations to improve diversity, and perform sequential acceptance on each candidate solution: First-level acceptance: if any symptom constraint is not satisfied, the system will proceed to the repair operation. If it is satisfied, the system will be temporarily recorded as an acceptable candidate and the second-level acceptance will be performed; Second level acceptance, if the first level acceptance is met, , enter the third level acceptance, if , then enter the repair operation, where represents the share of food category g in candidate solution q`; represents the energy per serving of the food group g, and E represents the daily energy goal; Level 3 acceptance: When both level 1 and level 2 acceptance are met, the diversity indicators are compared, including food subcategory coverage, duplicate counts, and Shannon index. If the diversity indicator improves, the initial solution is accepted and updated. After multiple iterations, the final solution is output to form a share plan; The repair operation is to repair q' with the minimum amount of changes in the established order, and obtain ,include: Lower limit repair: If , then priority is given to the food category that provides the most K and the content is reduced in proportion ,like , then the content in the food category that provides K increases in proportion ; Ratio and energy supply ratio repair: adopt two-way adjustment, simultaneously reduce the share of major food categories on the numerator side of the ratio and increase the share of major food categories on the denominator side, and restore to the compliance range with the smallest share movement; Equal energy normalization: Energy balancing is performed without destroying the lower limit repair and ratio and energy supply ratio repair results; like After repair, if the first level acceptance and second level acceptance are met, Replace q` and perform the third-level acceptance again; if it still fails to meet the first-level acceptance or the second-level acceptance, reject the candidate solution q` and execute the next micro-operation; If the repair operation is triggered three times in a row and is rejected, the adjustment share δ of the micro-operation is halved and the micro-operation library is called again to generate candidate solutions in a heuristic order.
[0012] As a preferred embodiment of the method for recommending a diverse diet based on health needs described in the present invention, generating specific dietary recommendations for each meal includes allocating the daily energy target into meal targets based on the energy ratio of each meal according to the portion plan, obtaining a meal splitting coefficient based on the regional dietary structure, discretizing the portion plan of each food category into each meal, and correcting the portion of each meal using minimum granularity rounding and maximum remainder method; Under the condition of meeting the disease constraints, the system uses swapping and compensation to complete the balancing within and across meals, and outputs specific dietary recommendations for each meal.
[0013] A diverse diet recommendation system based on health needs using any of the methods described in the present invention, wherein: a collection module obtains user data, calculates basal metabolism and daily energy requirements based on the user data, calculates a daily energy target, and generates a basic portion of each food category based on the daily energy target; The calculation module, under the premise of meeting the daily energy target, considers dietary diversity and nutritional risks related to diseases, establishes a feasible domain projector, iteratively adjusts the basic share, and forms a share plan; The output module breaks down the portion plan into meal portions, generates specific dietary recommendations for each meal based on user data and meal portions, and outputs daily energy goals, portion plans, meal portions, and specific dietary recommendations.
[0014] The beneficial effects of the present invention are as follows: This invention prioritizes sequential feasible domain projections for disease safety, immediately verifying and correcting nutrient upper and lower limits, ratios, and contraindications after each portion adjustment to ensure clinical safety. Simultaneously, isoenergetic micro-operations and energy tolerance control ensure that total energy remains stable and matches the target. Dietary diversity is further enhanced within the feasible domain, and daily portions are discretized into three meals based on regional dietary structures, generating ingredient-level solutions with equal-energy substitutions. The present method is interpretable, traceable, and highly practical, adapting to the coexistence of multiple diseases and real-world dining scenarios. It leverages a database for continuous updates and personalized optimization. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. 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 any creative work.
[0016] Figure 1 This is an overall flow chart of a method for recommending diverse diets based on health needs provided in Example 1 of the present invention. DETAILED DESCRIPTION
[0017] To make the above-mentioned objects, features, and advantages of the present invention more clearly understood, the following detailed description of the specific embodiments of the present invention is given in conjunction with the accompanying drawings. It is obvious that the described embodiments are only part of the embodiments of the present invention, not all of them. Based on the embodiments of the present invention, all other embodiments obtained by ordinary persons in this field without creative work should fall within the scope of protection of the present invention.
[0018] Example 1, with reference to Figure 1 , as one embodiment of the present invention, provides a method for recommending a diverse diet based on health needs, comprising: S1: Obtain user data, calculate basal metabolism and daily energy requirements based on the user data, calculate daily energy goals, and generate basic shares of each food category based on the daily energy goals.
[0019] Furthermore, this invention employs a layered data acquisition architecture with front-end collection and back-end loading. Users proactively provide personalized information through the client panel, while the system automatically retrieves objective reference data from a standardized knowledge base. The former establishes individual needs and constraints, while the latter provides the basic parameters required for energy conversion, nutritional constraints, and regional recommendations. Both are bound together on the back-end using a single collection snapshot, ensuring a reproducible and auditable calculation process.
[0020] Specifically, the data entered into the client panel includes basic data and health data. Basic data is directly reported by the user, including age, gender, height, weight, and place of residence. Health data is selected or filled in by the user based on their actual situation, including health goals (such as weight control, sugar control, fat control, muscle gain, etc.), activity level (sedentary, light physical activity, moderate, heavy physical activity, or very heavy physical activity), symptom data (selected from a standardized symptom list with an optional stage / severity description), allergy data (such as nuts, seafood, dairy, gluten, etc.), and dietary restrictions (such as vegetarian, halal, low sodium, low fat, etc.). User input constitutes the sole trusted source for subsequent basal metabolic rate and daily energy requirement estimation, generation of symptom-related nutritional constraints, application of contraindication / exclusion rules, and regionalized meal segmentation.
[0021] The data obtained from the back-end system database is automatically loaded by the system as a read-only reference library, without the need for manual input by the user. It mainly includes three categories: the first is regional dietary structure data, which is used to match regional meal energy ratios, common ingredient structures and typical cooking methods; the second is the intervention data of disease on nutrition, which is used to generate nutrient upper and lower limits, ratio / energy supply ratio intervals, and taboo / exclusion rules, and provide a basis for adjusting the total energy of disease; the third is food nutritional composition data, which is used for lookup and calculation of standard portion weight, energy per portion and key nutrient content of each major / subcategory of food. The above reference data is maintained in a versioned manner. When loading, the system marks the version tag for this call and writes it into the user portrait library together with the user input to form a collection snapshot, ensuring that subsequent results can be played back and reviewed by time point.
[0022] It should be noted that the data sources in the backend system database of this invention are all scientifically based: the regional dietary structure data are based on publicly available authoritative sources such as national or regional dietary guidelines, nutrition and health surveys, and statistical yearbooks; the nutritional intervention data for disease conditions are referenced from authoritative medical research results such as the World Health Organization (WHO), the National Kidney Foundation (NKF), the Chinese Nutrition Society (CNS), and clinical practice guidelines (including the KDOQI guidelines); and the food nutrient content data are derived from publicly verified food composition databases such as the "Chinese Food Composition Table" and the United States Department of Agriculture (USDA) FoodData Central. By incorporating standardized data published by these authoritative organizations, the raw data used in this invention has a foundation in evidence-based medicine and nutritional science, ensuring that the dietary recommendations generated by the system are fully scientific and reliable.
[0023] After the user completes filling in and selecting the aforementioned fields on the client side, the data is transmitted to the backend via an encrypted channel. The backend then standardizes the coding for symptoms and allergies, resolves the place of residence into a region code, and uses this to pull corresponding reference data from the regional dietary structure database, disease intervention data on nutrition, and food nutrient composition tables. The system unifies all externally loaded data and verifies logical consistency (such as whether portion size and energy conversion match, and whether taboos conflict with the ingredient pool). It then archives the user input and reference data version information as a collection snapshot. If a user's dietary restrictions are detected to be significantly inconsistent with common regional dishes, the system will only provide prompts and optional guidance on the front end and will not automatically rewrite the user's input to ensure that the user's declaration is the final word.
[0024] Furthermore, after the user completes the basic data collection (gender, age, height, weight and daily activity level), a standardized formula is used to calculate the basal metabolic rate and daily energy requirements without introducing any diseases, weight corrections or other coefficients.
[0025] The Mifflin-StJeor formula calculates the basal metabolic rate (BMR, kcal / day) based on the user's height, weight, and age. The user's activity level selected in the app is then mapped to a physical activity level (PAL): sedentary 1.20, light 1.375, moderate 1.55, heavy 1.725, and very heavy 1.90. After determining the BMR and PAL, the daily energy requirement (TDEE) is calculated as: TDEE = BMR × PAL (kcal / day).
[0026] The previously obtained daily energy requirement TDEE is used as input, and the set of symptoms D related to the target user is retrieved from the disease intervention data on nutrition. For any disease d in the set, the library provides two types of interval parameters related to energy adjustment: one is the multiplicative coefficient interval, which is used to characterize the proportional impact of the disease on the overall energy demand; the other is the addition / subtraction interval, which is used to characterize the absolute energy increase or decrease caused by the disease. In addition, the library also provides a quantitative value of the severity of the disease ∈[0, 1] (0 for mild, 1 for severe) and the weight of evidence mapped according to the level of evidence are used to assign synthetic weights in the case of coexisting diseases.
[0027] For the quantification of individual symptoms, the multiplicative coefficients were determined using log-linear interpolation: ; in, Indicates symptoms The target energy coefficient; Represents exponential operation; A quantitative value indicating the severity of the condition; Represents the mathematical function natural logarithm; Indicates symptoms The minimum energy coefficient; Indicates symptoms The maximum energy coefficient of logarithmic domain linear interpolation can transform the multiplication effect into an additive combination, which ensures that the The monotonicity of the method can be maintained, and it can also provide isometric solutions in the sense of proportion between the upper and lower limits, thus avoiding the systematic deviation of multiplicative parameters caused by direct arithmetic interpolation.
[0028] In contrast, the addition / subtraction of absolute energy is determined by linear interpolation in the original domain: ; in, Expressed as a symptom Target addition / subtraction amount; Indicates symptoms The lower limit of the target plus / minus amount; Indicates symptoms The interpolation follows the linear superposition property of additive quantities, making the absolute caloric dimension of different severities change in equal steps, which is convenient for clinical interpretation and engineering implementation.
[0029] In the case of multiple symptoms coexisting, in order to avoid excessive amplification / cancellation caused by direct multiplication or simple addition, the present invention first calculates the normalized weight of each symptom based on severity and strength of evidence, expressed as: ; in, represents the normalized weight of disease d; represents the weight of evidence for condition d; Indicates the index of symptoms; Represents a collection of symptoms; represents the weight of evidence for condition j; represents the weight of evidence for disease j. When the denominator is zero, The multiplicative parts are then synthesized using weighted geometric averaging: ; The addition / subtraction part is synthesized by weighted summation: ; in, It represents the total multiplicative coefficient after the combination of multiple diseases; Indicates the total addition / subtraction after the synthesis of multiple diseases; Represents the normalized weight The multiplicative coefficient under ; Represents a continuous multiplication operation.
[0030] The above combination method is consistent with the physical meaning of the parameters: the proportional effect is additive in the logarithmic domain, so the multiplicative synthesis of the weighted contributions of each disease is achieved by geometric mean, and the result is strictly constrained within each Within the range of , the value is stable and interpretable; the increase or decrease of absolute energy naturally obeys linear superposition, so the weighted sum is used to express the comprehensive effect of different diseases at the quota level. Give higher priority to "more serious illnesses and recommendations with stronger evidence" to avoid the stacking effect of weak evidence dominating the results.
[0031] To ensure both medical safety and engineering robustness, the present invention imposes relative boundary limits on the synthesized energy. The system configures lower and upper boundary coefficients, which are multiplied by the baseline energy to obtain the allowable range. Based on this, the disease-corrected energy is calculated and limited: ; in, It represents the intermediate energy after correction and limiting by symptoms; represents daily energy requirements; represents the clipping operator; Indicates the minimum target energy allowed; Indicates the maximum target energy allowed; The function is limited to avoid excessively low or high energy targets caused by extreme parameters or input errors. To facilitate subsequent execution based on food portions and kitchen measurements, the final output daily energy target uses engineering rounding: ; in, Indicates daily energy goal; Indicates the rounding step size (e.g. 25kcal); Indicates a rounding function. All energy dimensions are unified as kcal / day, and all coefficients are dimensionless real numbers. When only multiplicative intervals or only plus / minus intervals are provided for a disease, the missing items are taken as neutral values. or , to ensure the closure and consistency of the calculation chain; when When it is empty, directly The step size is rounded to the integer result.
[0032] From the above description, it can be seen that this technical solution takes the logarithmic linearity of multiplicative effects, the original domain linearity of additive effects, the weighted synthesis of concurrent effects, and the rounding of results as core principles, and provides a daily energy target that is consistent with the disease limitation or strengthening requirements and has medical rationality and engineering feasibility.
[0033] Furthermore, the present invention is useful in achieving daily energy goals. (Actually , for the convenience of expression, it is recorded as ), first locate the corresponding group in the dietary structure table based on the user's age and gender, recorded as (a, s). For each food category g∈G (such as cereals and tubers, vegetables, fruits, milk, livestock, poultry, fish and eggs, soybeans and nuts, oils and fats, etc.), read the energy distribution ratio from the group At the same time, combine the food nutrition information table to obtain the standard portion weight and energy density of the category, and calculate the energy per portion of the category accordingly. , then the total daily energy is broken down into the allocated energy for each major category according to the ratios stated and converted into the original number of servings.
[0034] Taking into account that the dietary structure table usually gives the recommended minimum and maximum number of portions for each major category, the system will first limit the original number of portions and discretize it according to the kitchen execution granularity. In order to ensure the consistency of the shares of each major category and the target energy after rounding and limiting, the present invention calculates the summary energy and energy error corresponding to the basic share, and performs a one-time energy correction according to the preset adjustable weights within the set of major categories that have not reached the upper and lower limits. The energy gap is converted into an increase or decrease in the number of portions and distributed to each adjustable major category, and the limiting and step rounding are performed again to obtain the final basic share.
[0035] Through this calculation process, the system unifies the energy proportions for age / sex groups and the energy standards per serving into a common energy framework. This generates robust and directly implementable basic portions for each food category, while meeting recommended upper and lower limits and ensuring granularity within the kitchen. A lightweight correction for energy consistency ensures that deviations from the target E are under control. All energy dimensions are in kcal, and servings are measured in "servings / day."
[0036] S2: Under the premise of meeting the daily energy target, considering the nutritional risks associated with dietary diversity and disease, a feasible domain projector is established to iteratively adjust the basic share to form a share plan; Furthermore, after obtaining the daily energy target and the basic share of each food category, the present invention sequentially optimizes and regulates the share vector, taking disease-related nutritional safety as the primary goal, maintaining energy consistency without reducing clinical safety, and further improving dietary diversity.
[0037] To this end, the system first generates a "disease feasible domain" based on the disease's nutritional intervention data. This converts the restrictions or reinforcement requirements related to the user's disease into a verifiable set of constraints, including: daily supply range constraints for nutrients such as sodium, potassium, protein, saturated fatty acids, and calcium; interval constraints on proportions or ratio indicators such as fat energy supply ratio and Na / K ratio; and taboo or exclusion rules (including upper limits for specific categories or subcategories). Specifically, disease constraints include: Nutrient constraints, for each nutrient k, calculate the supply: ; and constrain ,in, represents the total daily supply of nutrient k under the share q; g represents the index of the food category; represents the share of food category g; Indicates the amount of nutrient K provided per serving of food group G; Indicates the lower daily limit of nutrient K; The upper daily limit of nutrient K; Ratio constraints restrict the relative proportions of nutrients and are given in the form of intervals; Disease taboo constraints, setting the upper limit of food categories or specific foods containing disease taboo ingredients to zero; Energy consistency constraint: the deviation between the daily total energy and the daily energy target cannot exceed the deviation tolerance .
[0038] The above constraints are implemented in the lexicographic priority order of disease safety > energy consistency > diversity: any adjustment that causes disease indicators to degrade will not be adopted, energy consistency is maintained under the premise that disease safety remains unchanged, and diversity is only optimized when the first two levels are met.
[0039] To ensure that the adjustment actions are explainable and feasible, the system base share q is used as the initial solution, and a discretized micro-operation library is constructed as candidate changes in the iterative process. Micro-operations include at least: similar replacement, within the same category, replacing δ parts of subcategory A with subcategory B, using swaps and compensation before and after the replacement to maintain the same total energy; within the same category, replacing low-nutrient-density subcategories with high-nutrient-density subcategories with equal or nearly equal energy, or vice versa to reduce the risk of exceeding the standard; Cross-category micro-movement: transfer δ portions between two major food groups, and use swaps and compensation to maintain approximately the same total energy; The swap is an equal energy swap, reducing n portions of the source category while increasing m portions of the receiving category. The energy of n portions of the source category is equal to the energy of m portions of the receiving category. The swap is only performed when both categories are within the adjustable range (not reaching the upper and lower limits / contraindications) and the disease-related nutrients will not be pulled out of the feasible domain by this swap. The compensation is energy balancing, after transferring δ portions between the two categories, the energy difference is balanced by transferring n portions from other food categories. Each micro-operation sets a minimum share and a maximum share, and the δ shares are integer multiples of the minimum share and do not exceed the maximum share.
[0040] It should be noted that when a key nutrient approaches its lower or upper limit, priority is given to adding, subtracting, or replacing categories with high or low "unit energy supply efficiency" for that nutrient. Each micro-operation has a minimum execution granularity and maximum step size, and its impact on key nutrients and total energy is annotated during generation for subsequent sorting and screening.
[0041] The optimization process is carried out using a step-by-step trial and sequential acceptance mechanism. Following the heuristic order of "fixing symptoms and weaknesses first, then improving diversity," the system sequentially extracts candidate operations from the micro-operation library and forms candidate share vectors. It then performs three levels of testing in sequence: First-level acceptance: if any symptom constraint is not satisfied, the system will proceed to the repair operation. If it is satisfied, the system will be temporarily recorded as an acceptable candidate and the second-level acceptance will be performed; Second level acceptance, if the first level acceptance is met, , enter the third level acceptance, if , then enter the repair operation, where represents the share of food category g in candidate solution q`; represents the energy per serving of the food group g, and E represents the daily energy goal; Level 3 acceptance: When both the first and second level acceptances are met, the diversity indicators are compared, including food subcategory coverage, duplicate counts, and Shannon index. If the diversity indicators are improved, the initial solution is accepted and updated. After multiple iterations, the final solution is output to form a share plan.
[0042] The repair operation is to repair q' with the minimum amount of changes in the established order, and obtain ,include: Lower limit repair: If , then priority is given to the food category that provides the most K and the content is reduced in proportion ,like , then the content in the food category that provides K increases in proportion ; Ratio and energy supply ratio repair: adopt two-way adjustment, simultaneously reduce the share of major food categories on the numerator side of the ratio and increase the share of major food categories on the denominator side, and restore to the compliance range with the smallest share movement; Equal energy normalization: Energy balancing is performed without destroying the lower limit repair and ratio and energy supply ratio repair results; like After repair, if the first level acceptance and second level acceptance are met, Replace q` and perform the third-level acceptance again; if it still fails to meet the first-level acceptance or the second-level acceptance, reject the candidate solution q` and execute the next micro-operation; If the repair operation is triggered three times in a row and is rejected, the adjustment share δ of the micro-operation is halved and the micro-operation library is called again to generate candidate solutions in a heuristic order.
[0043] Iteration stops when any of the following conditions are met: all disease-related hard constraints are met and stable, the energy deviation is within the tolerance, the diversity is not effectively improved within the set rounds, or the iteration limit is reached. The system outputs the final share vector and the corresponding disease index and energy verification results, and records the micro-operation sequence executed in this round, the projection type and repair amplitude of each trigger, and the data version and parameters used to facilitate auditing and reproduction. Through the above process, the present invention achieves priority satisfaction of disease requirements with the minimum necessary changes within the feasible domain, and maximizes dietary diversity without sacrificing energy consistency, taking into account clinical safety, engineering robustness and user feasibility.
[0044] S3: Decompose the portion plan into meal portions, generate specific dietary recommendations for each meal based on user data and meal portions, and output daily energy goals, portion plans, meal portions, and specific dietary recommendations.
[0045] After determining the daily energy goal and the daily portion of each food category, the system allocates the daily energy across meals based on the user's daily routine and regional template. Without violating the existing disease feasibility domain and energy consistency constraints, the system consistently assigns the daily portion to each meal, ultimately generating specific ingredient-level recommendations and a list of equivalent replacements. Specifically, the system first reads the set of meal ratios for the selected template from the meal energy ratio library (the sum of all meal ratios is 1), based on the user's region and daily routine. This information is then used to determine the energy goal for each meal.
[0046] Based on this, the meal splitting matrix is used to break down the daily portion of each food category into individual meals. If the split result is a decimal, it is rounded down to the specified granularity (e.g., 0.5 servings), and the remainder is recorded. The remainder is then allocated to the corresponding food category and meal using the maximum remainder method, ensuring that the final sum of the meal portions equals the daily portion and meets the upper and lower limits for meal times.
[0047] After the split is complete, the current energy of each meal is calculated and compared to the target energy. If the deviation exceeds the tolerance range, energy balancing is performed between adjustable categories. During balancing, priority is given to food categories that have less impact on disease restrictions, and equal energy swaps are performed between energy reduction and energy increase to maintain energy balance within the meal.
[0048] During cross-meal inspections, if the total meal portion of a major food category differs from the daily portion, fine-tuning will be made between meals without exceeding the meal limit and disease constraints, while maintaining the energy of each meal close to the target value through equal energy compensation.
[0049] Next, within each meal, specific ingredients are selected for each food group. Ingredients are selected from a candidate list within the regional dietary database that matches that food group and does not have any medical contraindications. Cooking methods are screened based on common regional practices and medical restrictions (e.g., salt and oil restrictions). Ingredients are combined according to a target weight (calculated by multiplying the meal portion by the standard serving weight), with a small weight tolerance (e.g., ±10 grams) to accommodate ingredient specifications.
[0050] To enhance flexibility, each food category offers at least two equal-energy substitutions, each with a set energy difference within a set tolerance (e.g., no more than ±20 kcal). This allows users to make substitutions when ingredients are unavailable or require a temporary change. Recommendations can also include disease-related tips, such as a high-calcium meal or a low-sodium meal.
[0051] The final output includes, but is not limited to, a total daily energy goal, daily portion plans, meal portion plans, and detailed dietary recommendations for each meal (including ingredient names, grams or servings, cooking methods, and substitutions). Energy consistency checks and condition constraint validation are performed at each step throughout the process to ensure that the generated recommendations meet energy, nutritional, and condition management requirements.
[0052] Example 2. In an exemplary embodiment, a diverse diet recommendation system based on health needs is also provided, including a collection module for obtaining user data, calculating basal metabolism and daily energy requirements based on the user data, and calculating daily energy targets, and generating basic shares of each major food category based on the daily energy targets.
[0053] The calculation module, under the premise of meeting the daily energy target, considers the nutritional risks related to dietary diversity and diseases, establishes a feasible domain projector, iteratively adjusts the basic share, and forms a share plan.
[0054] The output module breaks down the portion plan into meal portions, generates specific dietary recommendations for each meal based on user data and meal portions, and outputs daily energy goals, portion plans, meal portions, and specific dietary recommendations.
[0055] If the above functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the portion that contributes to the prior art, or the portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes various media that can store program code, such as USB flash drives, mobile hard drives, read-only memories (ROMs), random access memories (RAMs), magnetic disks, or optical disks.
[0056] The logic and / or steps represented in the flowcharts or otherwise described herein, for example, can be considered as a sequenced list of executable instructions for implementing the logical functions, and can be embodied in any computer-readable medium for use by, or in conjunction with, an instruction execution system, apparatus, or device (e.g., a computer-based system, a system including a processor, or other system that can fetch and execute instructions from an instruction execution system, apparatus, or device). For purposes of this specification, a "computer-readable medium" can be any device that can contain, store, communicate, propagate, or transport a program for use by, or in conjunction with, an instruction execution system, apparatus, or device.
[0057] More specific examples (a non-exhaustive list) of computer-readable media include the following: an electrical connection with one or more wires (electronic devices), a portable computer disk cartridge (magnetic devices), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disc read-only memory (CDROM). In addition, the computer-readable medium may even be paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium, and then editing, interpreting, or processing in another suitable manner as necessary, and then storing it in a computer memory.
[0058] It should be understood that various components of the present invention may be implemented using hardware, software, firmware, or a combination thereof. In the above-described embodiments, multiple steps or methods may be implemented using software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented using hardware, as in another embodiment, any one of the following technologies known in the art or a combination thereof may be used: a discrete logic circuit having logic gate circuits for implementing logic functions on data signals, an application-specific integrated circuit having suitable combinational logic gate circuits, a programmable gate array (PGA), a field-programmable gate array (FPGA), etc.
[0059] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit the present invention. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solutions of the present invention may be modified or replaced by equivalents without departing from the spirit and scope of the technical solutions of the present invention, which should all be included in the scope of the claims of the present invention.
Claims
1. A method for recommending a diverse diet based on health needs, characterized in that: include: Obtain user data, calculate basal metabolism and daily energy requirements based on the user data, calculate daily energy goals, and generate basic shares of each food category based on the daily energy goals; On the premise of meeting the daily energy target, taking into account the nutritional risks associated with dietary diversity and disease, a feasible domain projector is established to iteratively adjust the basic share to form a share plan; The portion plan is broken down into meal portions, and specific dietary recommendations for each meal are generated based on user data and meal portions. The daily energy goal, portion plan, meal portions, and specific dietary recommendations are output.
2. The method for recommending a diverse diet based on health needs according to claim 1, wherein: The user data includes basic data, health data and diet data. The basic data includes the user's age, gender, height, weight and place of residence; The health data includes health goals, activity index, disease data, allergy data and dietary restrictions; The dietary data include regional dietary structure, disease intervention data on nutrition and food nutritional composition data.
3. The method for recommending a diverse diet based on health needs according to claim 2, wherein: Calculating the daily energy goal includes calculating the basal metabolic rate based on the user's height, weight, and age, and multiplying the basal metabolic rate by the activity coefficient to obtain the daily energy requirement; Calculate daily energy goals based on health goals and disease data, and retrieve the energy coefficient range, energy addition and subtraction range, disease severity, and evidence level corresponding weights from dietary data; For the energy coefficient interval, take the logarithm of the upper and lower limit coefficients, perform linear weighting according to the severity of the disease in the logarithmic domain, and then restore the exponential to the original domain to obtain the target energy coefficient; For the energy addition and subtraction interval, linear weighting is performed between the upper and lower limits according to the severity of the disease to obtain the target energy addition and subtraction amount; When there are multiple disease data, the weights are normalized according to the corresponding weights of disease severity and evidence level, and then the target energy coefficient is synthesized by weighted geometric mean, and the target energy addition or subtraction is synthesized by weighted sum; The daily energy requirement is corrected according to the target energy coefficient and the target energy addition or subtraction, and is limited by the clip function. The limited result is rounded according to a fixed step size to output the daily energy target.
4. The method for recommending a diverse diet based on health needs according to claim 3, wherein: Generating the basic share of each food category based on the daily energy goal includes reading the energy distribution ratio and the upper and lower limits of the recommended share of each food category based on user data and regional dietary structure; Based on food nutritional data, retrieve the standard portion weight and energy benchmark for each food category; Break down the daily energy target into each food group according to the energy distribution ratio, and convert the allocated energy into the initial share of each food group based on the energy basis per serving; The initial share is limited according to the upper and lower limits of the recommended share, and fine-tuning is performed within the major food categories that have not reached the upper and lower limits of the recommended share, so that the total energy corresponding to the major food category shares after fine-tuning is consistent with the daily energy target, and the basic share of each major food category is obtained.
5. The method for recommending a diverse diet based on health needs according to claim 4, wherein: The feasible domain projector includes performing symptom constraint modeling on nutrition intervention data based on symptoms, where the symptom constraints include: Nutrient constraints, for each nutrient k, calculate the supply: ; and constrain ,in, represents the total daily supply of nutrient k under the share q; g represents the index of the food category; represents the share of food category g; Indicates the amount of nutrient K provided per serving of food group G; Indicates the lower daily limit of nutrient K; The upper daily limit of nutrient K; Ratio constraints restrict the relative proportions of nutrients and are given in the form of intervals; Disease taboo constraints, setting the upper limit of food categories or specific foods containing disease taboo ingredients to zero; Energy consistency constraint: the deviation between the daily total energy and the daily energy target cannot exceed the deviation tolerance ; Taking the basic share q of each food category as the initial solution, a discrete micro-operation library is constructed. The micro-operations include: Same-type replacement: within the same category, replace δ parts of subclass A with subclass B, and use swapping and compensation to maintain the same total energy before and after replacement; Cross-category micro-movement: transfer δ portions between two major food groups, and use swaps and compensation to maintain the same total energy; The swap is an equal energy swap, which reduces n portions of the source category while increasing m portions of the receiving category. The energy of n portions of the source category is equal to the energy of m portions of the receiving category. The compensation is energy balancing, which involves transferring δ portions between the two categories and then converting n portions of food from other food categories to balance the energy difference. Each micro-operation sets a minimum share and a maximum share, and the δ shares are integer multiples of the minimum share and do not exceed the maximum share.
6. The method for recommending a diverse diet based on health needs according to claim 5, wherein: The feasible domain projector further includes iteratively adjusting the basic share, generating candidate solutions q' from the micro-operation library in a heuristic order, wherein the heuristic order is to first perform operations that address the symptoms and shortcomings, and then perform operations that increase diversity, and perform sequential acceptance on each candidate solution: First-level acceptance: if any symptom constraint is not satisfied, the system will proceed to the repair operation. If it is satisfied, the system will be temporarily recorded as an acceptable candidate and the second-level acceptance will be performed; Second level acceptance, if the first level acceptance is met, , enter the third level acceptance, if , then enter the repair operation, where represents the share of food category g in candidate solution q`; represents the energy per serving of the food group g, and E represents the daily energy goal; Level 3 acceptance: When both level 1 and level 2 acceptance are met, the diversity indicators are compared, including food subcategory coverage, duplicate counts, and Shannon index. If the diversity indicator improves, the initial solution is accepted and updated. After multiple iterations, the final solution is output to form a share plan; The repair operation is to repair q' with the minimum amount of changes in the established order, and obtain ,include: Lower limit repair: If , then priority is given to the food category that provides the most K and the content is reduced in proportion ,like , then the content in the food category that provides K increases in proportion ; Ratio and energy supply ratio repair: adopt two-way adjustment, simultaneously reduce the share of major food categories on the numerator side of the ratio and increase the share of major food categories on the denominator side, and restore to the compliance range with the smallest share movement; Equal energy normalization: Energy balancing is performed without destroying the lower limit repair and ratio and energy supply ratio repair results; like After repair, if the first level acceptance and second level acceptance are met, Replace q` and perform the third-level acceptance again; if it still fails to meet the first-level acceptance or the second-level acceptance, reject the candidate solution q` and execute the next micro-operation; If the repair operation is triggered three times in a row and is rejected, the adjustment share δ of the micro-operation is halved and the micro-operation library is called again to generate candidate solutions in a heuristic order.
7. The method for recommending a diverse diet based on health needs according to claim 6, wherein: Generating specific dietary recommendations for each meal includes allocating the daily energy target into meal targets based on the meal energy ratio according to the portion plan, obtaining a meal splitting coefficient based on the regional dietary structure, discretizing the portion plan of each food category into each meal, and correcting the portion of each meal using minimum granularity rounding and maximum remainder method; Under the condition of meeting the disease constraints, the system uses swapping and compensation to complete the balancing within and across meals, and outputs specific dietary recommendations for each meal.
8. A diverse diet recommendation system based on health needs, applied to a diverse diet recommendation method based on health needs according to any one of claims 1 to 7, characterized in that: include, The collection module obtains user data, calculates basal metabolism and daily energy requirements based on the user data, calculates daily energy goals, and generates basic shares of each food category based on the daily energy goals; The calculation module, under the premise of meeting the daily energy target, considers dietary diversity and nutritional risks related to diseases, establishes a feasible domain projector, iteratively adjusts the basic share, and forms a share plan; The output module breaks down the portion plan into meal portions, generates specific dietary recommendations for each meal based on user data and meal portions, and outputs daily energy goals, portion plans, meal portions, and specific dietary recommendations.