Diet recommendation method and system based on linear programming optimization and disease principle retrieval

By combining linear programming optimization with disease principle retrieval, this study solves the problems of insufficient automatic integration of disease nutrition therapy principles and inadequate nutrition optimization in existing dietary recommendation systems. It achieves medical rationality and nutritional accuracy in personalized dietary recommendations and provides interpretable recommendation results.

CN122135891APending Publication Date: 2026-06-02CAS SUZHOU INSTITUTE OF INTELLIGENT COMPUTING TECHNOLOGY +1

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
CAS SUZHOU INSTITUTE OF INTELLIGENT COMPUTING TECHNOLOGY
Filing Date
2026-02-26
Publication Date
2026-06-02

AI Technical Summary

Technical Problem

Existing dietary recommendation systems struggle to automatically integrate disease nutrition therapy principles with nutritional optimization, lack multidimensional dynamic constraints, and their recommendation results lack interpretability, thus affecting their credibility and usability.

Method used

By combining linear programming optimization with disease-based retrieval, user information and menu data are obtained, a nutritional target and constraint matrix is ​​constructed, semantic matching and optimization are performed, and structured recommendation results are generated.

Benefits of technology

It achieves medical rationality and nutritional accuracy in personalized dietary recommendations, provides explainable reasons for recommendations, and improves the system's operability and user trust.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122135891A_ABST
    Figure CN122135891A_ABST
Patent Text Reader

Abstract

This invention discloses a dietary recommendation method and system based on linear programming optimization and disease principle retrieval, comprising the following steps: acquiring user input information and a set of recommended dishes, as well as acquiring multi-source nutrition-related data; performing reading and structured preprocessing on the multi-source nutrition-related data to form a dish nutrition dataset and a disease nutrition and treatment principle knowledge base; determining the basal metabolic rate and daily total energy consumption, and constructing a single-meal nutrition target and single-meal nutrition constraint matrix according to a preset meal ratio; performing cleaning and word segmentation on disease information, performing similarity matching in the disease nutrition and treatment principle knowledge base to determine the disease nutrition and treatment principle set; constructing a linear programming optimization model, performing constraint solving to obtain the optimal dish weight result, and generating recommended dish combinations that satisfy the nutrition target and disease constraints; and outputting the dietary recommendation result. This invention achieves medically rational, nutritionally accurate, and interpretable dietary recommendations.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The application belongs to the technical field of intelligent health management and personalized nutrition recommendation, and particularly relates to a diet recommendation method and system based on linear programming optimization and disease principle retrieval. BACKGROUND

[0002] With the integration of artificial intelligence technology, nutrition science and personalized health management, diet recommendation systems have gradually become an important direction of smart medical care and health intervention. Existing diet recommendation schemes are mostly based on calorie calculation or general nutrition proportion allocation models, which are suitable for the general population, but when it comes to people with chronic diseases such as diabetes, hypertension and hyperlipidemia, they often need to meet more complex disease control goals and nutrition balance requirements. At the same time, retrieval enhancement technologies (such as BM25) can extract disease-related nutrition principles from medical guidelines or disease knowledge bases, and optimization algorithms (such as linear programming) can calculate and solve nutrient intake constraints, but existing schemes usually stay in a single dimension of "recommendation", "retrieval" or "optimization", and rarely achieve deep integration of the three. As a result, firstly, disease nutrition treatment principles are difficult to automatically match and enter the recommended constraints; secondly, the nutrition optimization dimension is insufficient, making it difficult to simultaneously consider macro and micronutrients and disease restrictions; thirdly, the recommended results lack explanation ability, making it difficult to explain the basis and taboo reasons for the recommendation, affecting credibility and usability. SUMMARY

[0003] The present application aims to provide a diet recommendation method and system based on linear programming optimization and disease principle retrieval enhancement, to solve the problems of difficulty in automatically integrating disease nutrition principles, lack of multi-dimensional dynamic constraints in nutrition proportion optimization, and uninterpretable recommended results in the prior art, and to achieve personalized diet recommendation that takes into account medical rationality, nutritional accuracy and interpretability.

[0004] To achieve the above-mentioned purpose, a specific embodiment of the present application provides a diet recommendation method based on linear programming optimization and disease principle retrieval, the method comprising: obtaining user input information and a set of dishes to be recommended, wherein the user input information at least includes gender, age, height, weight, activity level and disease information;

[0005] Obtaining multi-source nutrition-related data, and forming a dish nutrition data set and a disease nutrition treatment principle knowledge base by performing reading and structured preprocessing on the multi-source nutrition-related data; Performing metabolism and energy demand calculation on the user input information to determine the basal metabolic rate and total daily energy consumption, and constructing single meal nutrition targets and single meal nutrition constraint matrices according to a preset meal proportion; The disease principle retrieval mode is deployed to clean and segment the disease information, and similarity matching is performed in the disease nutrition and therapy principle knowledge base based on semantic retrieval to determine the set of disease nutrition and therapy principles. The single-meal nutritional constraint matrix and the set of disease nutritional therapy principles are imported into the nutrition optimization engine to construct a linear programming optimization model with dish weights as decision variables. The constraint solution is executed to obtain the optimal dish weight result and generate a recommended dish combination that meets the nutritional goals and disease constraints. Output dietary recommendations, which include at least the dish name, corresponding weight, and a nutritional summary of the whole meal.

[0006] This embodiment integrates user-individual information-driven nutritional goal calculation, BM25 disease principle retrieval, and linear programming-based menu weight optimization into a streamlined process. This ensures that the recommendation results simultaneously meet the constraints of multidimensional nutrition in a single meal and the constraints of disease-specific nutritional therapy principles, fundamentally improving the medical rationality and nutritional accuracy of dietary recommendations. Furthermore, the weighted output enhances the operability of the plan.

[0007] In one or more embodiments of the present invention, metabolic and energy requirement calculations are performed on the user input information to determine the basal metabolic rate (BMR) and total daily energy expenditure (TDEE), and a single-meal nutritional target and single-meal nutritional constraint matrix are constructed based on a preset meal ratio, including: Determine the activity coefficient Af corresponding to the activity level, and calculate the total daily energy consumption TDEE based on TDEE=BMR×Af; Based on the preset ratio coefficients of breakfast, lunch and dinner, the daily nutritional needs are allocated into single-meal nutritional targets, and a corresponding single-meal nutritional constraint matrix is ​​generated.

[0008] This embodiment introduces an activity coefficient and breaks down TDEE and nutritional requirements according to a fixed meal ratio. This enables the stable formation of single-meal-level goals and constraints under different user activity levels and energy requirements. This makes the constraint inputs for subsequent optimization solutions closer to real eating scenarios, improving the daily executability and consistency of the recommendation results.

[0009] In one or more embodiments of the present invention, the deployment of the disease principle retrieval mode includes: The disease information is input standardized, delimiters are unified, and cleaning is performed. The standardized disease names are segmented to obtain a set of disease query terms; Semantic retrieval is triggered based on the set of disease query terms to obtain a set of disease nutrition and treatment principles corresponding to the disease information.

[0010] This embodiment cleanses, standardizes, and segments disease names, which can reduce retrieval noise caused by differences in user input (aliases, separators, colloquialisms), improve the searchability and stability of disease query terms, and thus improve the accuracy and robustness of matching disease nutritional therapy principles.

[0011] In one or more embodiments of the present invention, similarity matching based on semantic retrieval in the disease nutrition therapy principle knowledge base includes: The nutritional therapy principle entries in the disease nutritional therapy principle knowledge base are segmented into words, a semantic retrieval corpus is constructed, and an inverted index is created. The similarity score between the disease query term set and each nutritional therapy principle item is calculated; Select one or more nutritional therapy principles with the highest scores as the set of nutritional therapy principles for the disease.

[0012] This embodiment achieves rapid and highly relevant retrieval of disease names and disease knowledge base entries by establishing an inverted index and calculating similarity scores using BM25. This enables the system to automatically obtain authoritative disease nutrition principles without manual mapping and use them as a structured recommendation basis, thereby improving the automation and scalability of the recommendation process.

[0013] In one or more embodiments of the present invention, when the disease information includes multiple diseases, the deployment of the disease principle retrieval mode further includes: Semantic retrieval is performed for each disease to obtain the correspondence between "disease-nutritional therapy principle set"; The nutritional therapy principles for different diseases are structured and organized, and each nutritional therapy principle is labeled with a disease identifier and a constraint attribute tag. The constraint attribute tag includes at least one or more of the following: restrict intake, encourage intake, use with caution, avoid high salt, and control total energy.

[0014] This embodiment searches for multiple disease scenarios separately and adds disease identifiers and constraint attribute tags to principles, transforming disease constraints from "text suggestions" into "structured constraint elements." This provides a unified interface input for subsequent optimization models and interpretation generation, thereby significantly enhancing the system's adaptability and computability under complex health states.

[0015] In one or more embodiments of the present invention, the structured organization of nutritional therapy principles for different diseases further includes the identification of potential conflicting terms, including: For nutritional therapy principles for various diseases, consistency checks should be performed on the constraints related to the same nutrient or the same food category. When the constraints are inconsistent, the corresponding nutrient or food category will be marked as a potential conflict. Nutritional therapy principles involving potential conflicts are sorted or marked according to preset disease safety priority rules.

[0016] This embodiment checks the consistency of constraints on the same nutrient / food category and marks potential conflicts. Then, it sorts or marks the constraints in combination with safety priority rules. This reduces the risk of recommendation distortion caused by constraint conflicts when multiple diseases coexist. The final recommendation is more safety- and controllable, and the reliability of the system in the context of concurrent chronic diseases is improved.

[0017] In one or more embodiments of the present invention, the single-meal nutritional constraint matrix and the set of disease nutritional therapy principles are imported into a nutritional optimization engine to construct a linear programming optimization model, and constraint solving is performed to obtain the optimal dish weight result, including: The weight of each dish is used as the decision variable; A comprehensive nutritional score for a dish is constructed based on the density of key nutrients in the dish, and the objective function is to maximize the overall nutritional value of the dish combination in the whole meal. The upper and lower limits of intake for energy, protein, fat, carbohydrates, and preset micronutrients are used as multidimensional nutritional constraints. Weighted normalization constraints and minimum weight constraints are added to obtain an operable recommended solution.

[0018] This embodiment uses dish weights as decision variables and introduces comprehensive nutrition scores as the objective function. It performs linear programming under multi-dimensional upper and lower limits constraints of energy, macronutrients, and micronutrients, which can obtain globally optimal feasible dish combinations. At the same time, it avoids extreme solutions and the "all zero / single dish" problem by normalization and minimum weight constraints, thereby improving the balance and feasibility of the recommendation results.

[0019] In one or more embodiments of the present invention, the output dietary recommendation result includes: Based on the optimal dish weight result, the dishes are classified into recommendation levels, wherein the recommendation levels include at least strongly recommended, recommended, moderate consumption, and small-scale trial. Output a complete meal nutrition summary and a comparison of user nutritional needs; The dietary recommendations will be output in structured JSON format.

[0020] This embodiment outputs a weighted recommendation level classification and a comparison with the nutritional summary / requirements of the whole meal, and returns the results in a structured JSON format. This makes the recommendation results not only "understandable" but also directly parsed and reused by external medical platforms or health management systems, thereby improving the system's interactivity, engineering integrability, and application promotion value.

[0021] In one or more embodiments of the present invention, after outputting the dietary recommendation results, the method further includes generating a recommendation interpretation, including: Construct a structured prompt that includes user information, nutritional constraints for a single meal, nutritional information and corresponding weights for dishes, nutritional treatment principles for diseases, and task instructions; The large language model is invoked to infer and generate the structured prompt word Prompt, and the reasons for recommending or not recommending each dish are output. When the disease information includes multiple diseases, a corresponding recommendation reason is first generated for each disease. Then, semantic integration is performed based on potential conflict item tags and disease safety priority rules to output the final recommendation explanation. This embodiment uses a structured Prompt to uniformly input user information, nutritional constraints, food nutrition, and disease principles into a large language model to generate recommendation reasons. It performs step-by-step generation and semantic integration in multiple disease scenarios, enabling the recommendation results to have the explanatory ability of "verifiable reasons and traceable basis", which significantly improves user trust and usability in clinical / nutrition consultation scenarios.

[0022] In another aspect of the present invention, a dietary recommendation system based on linear programming optimization and disease principle retrieval is provided, applying a dietary recommendation method based on linear programming optimization and disease principle retrieval. The dietary recommendation system based on linear programming optimization and disease principle retrieval includes: The data processing module is used to acquire user input information and a set of dishes to be recommended, wherein the user input information includes at least gender, age, height, weight, activity level and disease information; The nutrition target construction module is used to acquire multi-source nutrition-related data, and to form a food nutrition dataset and a knowledge base of disease nutrition therapy principles by reading and preprocessing the multi-source nutrition-related data. The disease principle retrieval module is used to deploy a disease principle retrieval mode to perform cleaning and word segmentation processing on the disease information, and to perform similarity matching in the disease nutrition and therapy principle knowledge base based on semantic retrieval to determine the set of disease nutrition and therapy principles. The nutrition target and constraint module is used to perform metabolic and energy requirement calculations on the user input information, determine the basal metabolic rate and daily total energy consumption, and construct a single-meal nutrition target and single-meal nutrition constraint matrix according to the preset meal ratio. The nutrition optimization calculation module is used to import the single-meal nutrition constraint matrix and the set of disease nutrition treatment principles into the nutrition optimization engine, construct a linear programming optimization model with dish weights as decision variables, perform constraint solving to obtain the optimal dish weight results, and generate recommended dish combinations that meet the nutritional goals and disease constraints. The results output module is used to output dietary recommendation results, wherein the dietary recommendation results include at least the dish name, corresponding weight, and a nutritional summary of the whole meal. Attached Figure Description

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

[0024] Figure 1 This is a flowchart of a dietary recommendation method based on linear programming optimization and disease principle retrieval according to an embodiment of the present invention; Figure 2 This is a flowchart illustrating a dietary recommendation method based on linear programming optimization and disease principle retrieval according to one embodiment of the present invention. Figure 3 This is a logical flowchart of the recommended explanation of the generation steps in one embodiment of the present invention; Figure 4 This is a schematic diagram illustrating an example of user basic information in one embodiment of the present invention; Figure 5 This is a schematic diagram illustrating the complete recommended explanation generated in one embodiment of the present invention; Figure 6 This is a schematic diagram of the structure of a diet recommendation system based on linear programming optimization and disease principle retrieval in one embodiment of the present invention. Detailed Implementation

[0025] To enable those skilled in the art to better understand the technical solutions of this invention, the technical solutions of the embodiments of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are merely some embodiments of this invention, and not all embodiments. Based on the embodiments of this invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of this invention.

[0026] In response to the problems in the background technology, such as Figures 1-3 As shown, this invention provides a dietary recommendation method based on linear programming optimization and disease principle retrieval, comprising the following steps: Step 1: Obtain user input information and a set of dishes to be recommended, wherein the user input information includes at least gender, age, height, weight, activity level, and disease information; Specifically, the system obtains user input information and a set of dishes to be recommended. The user input information includes at least gender, age, height, weight, activity level, and disease information. The set of dishes to be recommended is a set of candidate dishes selected from a menu.

[0027] In one implementation, such as Figure 4 As shown, user input information is collected by the client-side interface and validated by the server before being stored in the database. Activity levels are represented by preset levels, including one or more of sedentary, light, moderate, and heavy activity levels. Disease information supports input of single or multiple diseases. The set of recommended dishes can be initially screened based on user preferences, available ingredients, meal type, regional tastes, or time costs to reduce the scale of subsequent optimization and improve efficiency.

[0028] Step 2: Obtain multi-source nutrition-related data, and perform reading and structured preprocessing on the multi-source nutrition-related data to form a food nutrition dataset and a knowledge base of disease nutrition therapy principles; Specifically, the system acquires multi-source nutrition-related data and performs reading, cleaning, standardization, and structured preprocessing on the multi-source nutrition-related data to form a dish nutrition dataset and a disease nutrition treatment principle knowledge base for recommendation calculation.

[0029] In one implementation, the nutritional dataset for a dish includes at least: dish identifier, dish name, standard serving size, energy, protein, fat, carbohydrates, and content fields for one or more of the following micronutrients: sodium, potassium, dietary fiber, cholesterol, saturated fat, vitamins, and minerals. Nutritional data from different sources are aligned by mapping to fields with the same name using a unified unit of measurement. For example, the unified unit for energy is kcal, and the unified unit for sodium is mg. Nutritional values ​​are converted based on the standard serving size to ensure comparability.

[0030] The Disease Nutritional Therapy Principles Knowledge Base stores disease-related nutritional intervention principles in the form of entries. Each principle entry must include at least the following fields: the name or alternative name of the applicable disease, the text of the principle, the nutrient / food category involved, the direction of the constraint, and the strength of the recommendation.

[0031] Step 3: Perform metabolic and energy requirement calculations on the user input information to determine the basal metabolic rate and total daily energy consumption, and construct a single-meal nutritional target and single-meal nutritional constraint matrix based on the preset meal ratio; Specifically, the system calculates the basal metabolic rate (BMR) based on the user's gender, age, height, and weight, and determines the activity coefficient (Af) based on the activity level. Then, it calculates the total daily energy expenditure (TDEE) based on TDEE = BMR × Af. Subsequently, it breaks down the daily nutritional needs into individual meals according to the preset meal ratio, constructs the nutritional goals for each meal, and generates the corresponding nutritional constraint matrix for each meal.

[0032] In one implementation, the preset proportions for breakfast, lunch, and dinner are 30%, 40%, and 30%, respectively. The system converts the daily dietary intake (TDEE) and daily nutrient requirements into target values ​​for each meal according to these proportions, and establishes a single-meal nutritional constraint matrix based on this. This matrix includes at least upper and lower limits for energy, protein, fat, carbohydrates, and preset micronutrient intake, used to provide calculable constraints on subsequent meal combinations. Using these micronutrients as constraint indicators, the nutritional constraint value for each meal is calculated by multiplying the daily requirement by the meal proportion. ; in, α meal This represents the meal proportion coefficient. The upper and lower limits of the single-meal nutritional constraint matrix can be generated from dietary guidelines, clinical nutrition standards, or platform-preset safety thresholds, and can be dynamically tightened or loosened based on the user's disease type. This system adopts the "Chinese Dietary Reference Intakes (DRIs)".

[0033] Step 4: Deploy the disease principle retrieval mode to perform cleaning and word segmentation on the disease information, and perform similarity matching based on semantic retrieval in the disease nutrition therapy principle knowledge base to determine the set of disease nutrition therapy principles; Specifically, the system deploys a disease principle retrieval mode, performs input standardization on the disease information, unifies the delimiters and completes the cleaning process; performs word segmentation on the standardized disease names to obtain a set of disease query terms; and triggers semantic retrieval based on the set of disease query terms to obtain a set of disease nutritional therapy principles corresponding to the disease information.

[0034] In one implementation, disease input standardization includes: removing parentheses and comments, removing redundant symbols, correcting common aliases and abbreviations, and unifying uppercase and lowercase letters and full-width and half-width characters; word segmentation can be performed by combining dictionary-based word segmentation and statistical word segmentation to improve the segmentation accuracy of compound disease names (such as "type 2 diabetes" and "hypertension"), thereby improving retrieval recall and precision.

[0035] Step 5: Import the single-meal nutritional constraint matrix and the set of disease nutritional therapy principles into the nutrition optimization engine, construct a linear programming optimization model with dish weights as decision variables, perform constraint solving to obtain the optimal dish weight results, and generate recommended dish combinations that meet nutritional goals and disease constraints. The system performs word segmentation on the nutritional therapy principle entries in the disease nutritional therapy principle knowledge base, constructs a semantic retrieval corpus and establishes an inverted index; calculates the similarity score between the disease query term set and each nutritional therapy principle entry; and selects one or more nutritional therapy principle entries with the highest scores as the disease nutritional therapy principle set.

[0036] In one implementation, similarity calculation uses the BM25 retrieval model. BM25 comprehensively evaluates the matching degree between query terms and principle entries through term frequency, inverse document frequency, and document length normalization, thus obtaining stable high-relevance principle entry outputs even when disease aliases, synonyms, or input noise are present. The selection strategy can be Top-1, Top-k, or a score threshold strategy to adapt to different knowledge base sizes and business accuracy requirements.

[0037] When the disease information includes multiple diseases, the system performs semantic retrieval for each disease to obtain the correspondence between "disease-nutritional therapy principle set"; the nutritional therapy principles for different diseases are structured and organized, and disease identifiers and constraint attribute tags are added to each nutritional therapy principle. The constraint attribute tags include at least one or more of the following: restrict intake, encourage intake, use with caution, avoid high salt, and control total energy.

[0038] In one implementation, the system further performs potential conflict item identification: For nutritional therapy principles for multiple diseases, consistency checks are performed on the constraint directions involving the same nutrient or the same food category; when the constraint directions are inconsistent, the corresponding nutrient or food category is marked as a potential conflict item; nutritional therapy principles involving potential conflicts are sorted or marked according to preset disease safety priority rules.

[0039] Among them, the disease safety priority rules can be set according to the principle of risk control priority, such as giving priority to constraints that have a more direct impact on vital signs (such as sodium restriction for hypertension and carbohydrate control for diabetes) to ensure the safety and feasibility of the recommended plan.

[0040] The system imports the single-meal nutritional constraint matrix and the set of disease nutritional treatment principles into the nutrition optimization engine, constructs a linear programming optimization model with dish weights as decision variables, performs constraint solving to obtain the optimal dish weight results, and generates recommended dish combinations that meet nutritional goals and disease constraints.

[0041] In one implementation, the construction of the linear programming model includes: assigning weights to each dish. w i As decision variables; construct a comprehensive nutritional score for dishes based on the density of key nutrients in the dishes. S iThe objective function is to maximize the overall nutritional value of the meal's combination of dishes. The upper and lower limits of energy, protein, fat, carbohydrates, and preset micronutrient intake are used as multidimensional nutritional constraints, with weight normalization and minimum weight constraints added to obtain an operable recommended solution. A linear programming model is constructed with the objective function of maximizing nutritional balance, as follows: max Z To maximize the overall nutritional value of the meal's combination of dishes, S i For the first i The overall nutritional score of a dish is used to quantify how much the dish contributes to the user's nutritional goals for a single meal.

[0042] Furthermore, the constraints are set as follows: ,in, N ij Indicates the first i The first dish j The content of various nutrients.

[0043] Meanwhile, to ensure the operability of the recommendation results, the model incorporates the following normalization and feasibility constraints: ;in, β This represents the minimum overall weight in the recommended combination, used to avoid all dishes being excessively undervalued; gamma The minimum weight is assigned to each dish to avoid the extreme case of a weight of zero. Using this model, the system calculates the optimal recommended proportion of each dish while satisfying nutritional constraints. Weight normalization constraints ensure the rationality of the total portion size, while minimum weight constraints prevent "symbolic recommendations" with extremely low weights that are impractical, thus improving the executability of the recommendation results.

[0044] Furthermore, the principles of disease-based nutritional therapy can be mapped to computable constraints: for example, "avoiding high salt intake" can be mapped to tightening the upper limit of sodium intake, "controlling total energy" can be mapped to tightening the upper limit of energy intake, and "restricting fat intake" can be mapped to controlling the upper limit of fat or saturated fat intake, etc., so as to achieve the direct constraint-driven optimization model by the disease principles.

[0045] The content is used to generate explanations that follow the nutritional constraints and dietary restrictions for the corresponding diseases. The final prompt word combination structure is as follows: Prompt includes user information, nutritional constraints, nutritional data of dishes, disease treatment principles, and task instructions.

[0046] When a user only inquires about a single disease or health condition, the system generates a complete recommendation explanation through a single model call. The model is assigned a "nutritionist" role and receives the aforementioned prompts as input.

[0047] Step 6: Output dietary recommendation results, wherein the dietary recommendation results include at least the dish name, corresponding weight, and a nutritional summary of the whole meal.

[0048] In one implementation, the system assigns a recommendation level to dishes based on the optimal dish weight result. The recommendation level includes at least strongly recommended, recommended, moderate consumption, and small-scale trial. The system also outputs a nutritional summary of the entire meal and a comparison of the user's nutritional needs. The dietary recommendation results are output in structured JSON format for easy front-end display and third-party system access.

[0049] The overall meal nutrition summary should include at least the total energy of the meal, the percentage of the three macronutrients, the total intake of key micronutrients, and the deviation from the target value for a single meal. This helps users understand the nutritional structure of the recommended meal plan. The generated target includes two types of information: recommendation judgment (whether to recommend) and the reasons for the recommendation (based on nutritional balance, disease constraints, and dish characteristics). The output format is structured JSON, such as... Figure 5 As shown.

[0050] like Figure 2 As shown, this invention discloses a dietary recommendation method based on linear programming optimization and disease principle retrieval. This method first obtains user input containing gender, age, height, weight, activity level, and disease information, along with a set of recommended dishes. It then reads and performs structured preprocessing on multi-source nutrition-related data to form a dish nutrition dataset and a disease nutrition and treatment principle knowledge base. Subsequently, it calculates the user's basal metabolic rate and daily total energy consumption, constructing a single-meal nutrition target and constraint matrix according to a 30% ratio for breakfast, lunch, and dinner (40% for breakfast, 30% for lunch, and 30% for dinner). Disease information cleaning, word segmentation, and semantic retrieval are used to match disease nutrition and treatment principles (potential constraint conflicts are identified and prioritized in multi-disease scenarios). Finally, the nutrition constraint matrix and disease treatment principles are imported into a nutrition optimization engine to construct a linear programming model with dish weights as decision variables and maximizing comprehensive nutritional value as the objective. The solution outputs a result containing dish names, weights, and a summary of the entire meal's nutrition. Furthermore, it uses structured prompts to call a large language model to generate recommendation explanations, adapting to both single-disease and multi-disease scenarios.

[0051] like Figure 3The dietary recommendation system corresponding to this method includes modules for data processing, nutritional goal construction, disease principle retrieval, nutritional goals and constraints, nutritional optimization calculation, and result output. These modules work together to support the implementation of the method. This method and system address the problems of existing dietary recommendation schemes, such as the difficulty in automatically integrating disease-based nutritional principles, insufficient nutritional optimization dimensions, and uninterpretable recommendation results. By deeply integrating the calculation of individual user nutritional goals, BM25 disease principle retrieval, and linear programming optimization, and taking into account both macro- and micronutrient constraints and disease treatment needs, the recommendation results not only possess medical rationality and nutritional accuracy but also improve operability and user trust through recommendation level classification, structured output, and natural language interpretation. It is suitable for the general population and individuals with chronic diseases such as diabetes and hypertension, and is particularly capable of handling complex scenarios involving multiple concurrent diseases.

[0052] like Figure 6 As shown, a system for implementing a dietary recommendation method based on linear programming optimization and disease principle retrieval according to a specific embodiment of the present invention is described. The system includes: The data processing module is used to acquire user input information and a set of dishes to be recommended, wherein the user input information includes at least gender, age, height, weight, activity level and disease information; The nutrition target construction module is used to acquire multi-source nutrition-related data, and to form a food nutrition dataset and a knowledge base of disease nutrition therapy principles by reading and preprocessing the multi-source nutrition-related data. The disease principle retrieval module is used to deploy a disease principle retrieval mode to perform cleaning and word segmentation processing on the disease information, and to perform similarity matching in the disease nutrition and therapy principle knowledge base based on semantic retrieval to determine the set of disease nutrition and therapy principles. The nutrition target and constraint module is used to perform metabolic and energy requirement calculations on the user input information, determine the basal metabolic rate and daily total energy consumption, and construct a single-meal nutrition target and single-meal nutrition constraint matrix according to the preset meal ratio. The nutrition optimization calculation module is used to import the single-meal nutrition constraint matrix and the set of disease nutrition treatment principles into the nutrition optimization engine, construct a linear programming optimization model with dish weights as decision variables, perform constraint solving to obtain the optimal dish weight results, and generate recommended dish combinations that meet the nutritional goals and disease constraints. The results output module is used to output dietary recommendation results, wherein the dietary recommendation results include at least the dish name, corresponding weight, and a nutritional summary of the whole meal.

[0053] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0054] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A system that specifies functions in one or more boxes.

[0055] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including an instruction set implemented in a process. Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0056] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0057] It will be apparent to those skilled in the art that the present invention is not limited to the details of the exemplary embodiments described above, and that the invention can be implemented in other specific forms without departing from its spirit or essential characteristics. Therefore, the embodiments should be considered in all respects as exemplary and non-limiting, and the scope of the invention is defined by the appended claims rather than the foregoing description. Thus, all variations falling within the meaning and scope of equivalents of the claims are intended to be included within the present invention. No reference numerals in the claims should be construed as limiting the scope of the claims.

[0058] Furthermore, it should be understood that although this specification describes embodiments, not every embodiment contains only one independent technical solution. This narrative style is merely for clarity. Those skilled in the art should consider the specification as a whole, and the technical solutions in each embodiment can also be appropriately combined to form other embodiments that can be understood by those skilled in the art.

Claims

1. A dietary recommendation method based on linear programming optimization and disease principle retrieval, characterized in that, Includes the following steps: Obtain user input information and a set of dishes to be recommended, wherein the user input information includes at least gender, age, height, weight, activity level, and disease information; Acquire multi-source nutrition-related data, and perform reading and structured preprocessing on the multi-source nutrition-related data to form a food nutrition dataset and a knowledge base of disease nutrition therapy principles; The metabolic and energy requirements are calculated based on the user input information to determine the basal metabolic rate and total daily energy consumption, and a single-meal nutritional target and single-meal nutritional constraint matrix is ​​constructed based on the preset meal ratio. The disease principle retrieval mode is deployed to clean and segment the disease information, and similarity matching is performed in the disease nutrition and therapy principle knowledge base based on semantic retrieval to determine the set of disease nutrition and therapy principles. The single-meal nutritional constraint matrix and the set of disease nutritional therapy principles are imported into the nutrition optimization engine to construct a linear programming optimization model with dish weights as decision variables. The constraint solution is executed to obtain the optimal dish weight result and generate a recommended dish combination that meets the nutritional goals and disease constraints. Output dietary recommendations, which include at least the dish name, corresponding weight, and a nutritional summary of the whole meal.

2. The dietary recommendation method based on linear programming optimization and disease principle retrieval according to claim 1, characterized in that, The user input information is used to perform metabolic and energy requirement calculations to determine the basal metabolic rate (BMR) and total daily energy expenditure (TDEE). A single-meal nutritional target and single-meal nutritional constraint matrix is ​​constructed based on preset meal proportions, including: Determine the activity coefficient Af corresponding to the activity level, and calculate the total daily energy consumption TDEE based on TDEE=BMR×Af; Based on the preset ratio coefficients of breakfast, lunch and dinner, the daily nutritional needs are allocated into single-meal nutritional targets, and a corresponding single-meal nutritional constraint matrix is ​​generated.

3. The dietary recommendation method based on linear programming optimization and disease principle retrieval according to claim 1, characterized in that, The deployment of disease principle retrieval modes includes: The disease information is input standardized, delimiters are unified, and cleaning is performed. The standardized disease names are segmented to obtain a set of disease query terms; Semantic retrieval is triggered based on the set of disease query terms to obtain a set of disease nutrition and treatment principles corresponding to the disease information.

4. The dietary recommendation method based on linear programming optimization and disease principle retrieval according to claim 3, characterized in that, Based on semantic retrieval, similarity matching is performed in the knowledge base of disease nutritional therapy principles, including: The nutritional therapy principle entries in the disease nutritional therapy principle knowledge base are segmented into words, a semantic retrieval corpus is constructed, and an inverted index is created. The similarity score between the disease query term set and each nutritional therapy principle item is calculated; Select one or more nutritional therapy principles with the highest scores as the set of nutritional therapy principles for the disease.

5. The dietary recommendation method based on linear programming optimization and disease principle retrieval according to claim 1, characterized in that, When the disease information includes multiple diseases, the deployment of the disease principle retrieval mode further includes: Semantic retrieval is performed for each disease to obtain the correspondence between "disease-nutritional therapy principle set"; The nutritional therapy principles for different diseases are structured and organized, and each nutritional therapy principle is labeled with a disease identifier and a constraint attribute tag. The constraint attribute tag includes at least one or more of the following: restrict intake, encourage intake, use with caution, avoid high salt, and control total energy.

6. The dietary recommendation method based on linear programming optimization and disease principle retrieval according to claim 5, characterized in that, The structured organization of nutritional therapy principles for different diseases also includes the identification of potential conflicts, including: For nutritional therapy principles for various diseases, consistency checks should be performed on the constraints related to the same nutrient or the same food category. When the constraints are inconsistent, the corresponding nutrient or food category will be marked as a potential conflict. Nutritional therapy principles involving potential conflicts are sorted or marked according to preset disease safety priority rules.

7. The dietary recommendation method based on linear programming optimization and disease principle retrieval according to claim 1, characterized in that, The single-meal nutritional constraint matrix and the set of disease nutritional therapy principles are imported into a nutritional optimization engine to construct a linear programming optimization model. Constraint solving is then performed to obtain the optimal dish weights, including: The weight of each dish is used as the decision variable; A comprehensive nutritional score for a dish is constructed based on the density of key nutrients in the dish, and the objective function is to maximize the overall nutritional value of the dish combination in the whole meal. The upper and lower limits of intake for energy, protein, fat, carbohydrates, and preset micronutrients are used as multidimensional nutritional constraints. Weighted normalization constraints and minimum weight constraints are added to obtain an operable recommended solution.

8. The dietary recommendation method based on linear programming optimization and disease principle retrieval according to claim 1, characterized in that, The output dietary recommendations include: Based on the optimal dish weight result, the dishes are classified into recommendation levels, wherein the recommendation levels include at least strongly recommended, recommended, moderate consumption, and small-scale trial. Output a complete meal nutrition summary and a comparison of user nutritional needs; The dietary recommendations will be output in structured JSON format.

9. The dietary recommendation method based on linear programming optimization and disease principle retrieval according to claim 1, characterized in that, Following the output of the dietary recommendations, the system also includes the generation of a recommendation explanation, including: Construct a structured prompt that includes user information, nutritional constraints for a single meal, nutritional information and corresponding weights for dishes, nutritional treatment principles for diseases, and task instructions; The large language model is invoked to infer and generate the structured prompt word Prompt, and the reasons for recommending or not recommending each dish are output. When the disease information includes multiple diseases, a corresponding recommendation reason is first generated for each disease, and then semantic integration is performed based on the potential conflict item markers and disease safety priority rules to output the final recommendation explanation.

10. A dietary recommendation system based on linear programming optimization and disease principle retrieval, employing the dietary recommendation method based on linear programming optimization and disease principle retrieval as described in any one of claims 1 to 9, characterized in that, The dietary recommendation system based on linear programming optimization and disease principle retrieval includes: The data processing module is used to acquire user input information and a set of dishes to be recommended, wherein the user input information includes at least gender, age, height, weight, activity level and disease information; The nutrition target construction module is used to acquire multi-source nutrition-related data, and to form a food nutrition dataset and a knowledge base of disease nutrition therapy principles by reading and preprocessing the multi-source nutrition-related data. The disease principle retrieval module is used to deploy a disease principle retrieval mode to perform cleaning and word segmentation processing on the disease information, and to perform similarity matching in the disease nutrition and therapy principle knowledge base based on semantic retrieval to determine the set of disease nutrition and therapy principles. The nutrition target and constraint module is used to perform metabolic and energy requirement calculations on the user input information, determine the basal metabolic rate and daily total energy consumption, and construct a single-meal nutrition target and single-meal nutrition constraint matrix according to the preset meal ratio. The nutrition optimization calculation module is used to import the single-meal nutrition constraint matrix and the set of disease nutrition treatment principles into the nutrition optimization engine, construct a linear programming optimization model with dish weights as decision variables, perform constraint solving to obtain the optimal dish weight results, and generate recommended dish combinations that meet the nutritional goals and disease constraints. The results output module is used to output dietary recommendation results, wherein the dietary recommendation results include at least the dish name, corresponding weight, and a nutritional summary of the whole meal.