A personalized meal energy optimization matching method and system

By acquiring multidimensional user feature data, constructing dynamic nutritional gap and preference weight vectors, and using a multi-objective optimization model to generate personalized dietary plans, the problem of lack of personalization and flexibility in dietary planning in existing technologies is solved, and dynamic and personalized dietary planning is realized.

CN122117254APending Publication Date: 2026-05-29ZHEJIANG YISHAN SMART MEDICAL RES CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
ZHEJIANG YISHAN SMART MEDICAL RES CO LTD
Filing Date
2026-04-29
Publication Date
2026-05-29

AI Technical Summary

Technical Problem

Existing technologies cannot combine users' personal data and health goals, cannot consider the dynamic nutritional consumption of each meal, and do not take into account users' personal taste preferences, resulting in a lack of personalization and flexibility in dietary planning, and a heavy decision-making burden for users.

Method used

By acquiring users' multidimensional feature data, including physiological parameters, health goals, daily nutrient intake data, and historical dietary behavior data, a dynamic nutrient gap vector and preference weight vector are constructed. Multiple candidate dietary plans are generated using a multi-objective optimization model, and historical data is updated based on user selections, forming an intelligent closed loop.

Benefits of technology

It enables dynamic, personalized, and multi-objective optimized dietary planning, which can automatically adjust dietary plans based on users' real-time nutritional status and taste preferences, thereby improving planning efficiency and acceptability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122117254A_ABST
    Figure CN122117254A_ABST
Patent Text Reader

Abstract

The application discloses a kind of personalized meal energy optimization matching method and system, it is related to personalized meal matching field, comprising: obtaining the multidimensional feature data of user, at least including the physiological parameter of user, health goal, daily intake nutrition data and historical dietary behavior data;According to physiological parameter and health goal, the energy requirement target of user all day and the energy supply ratio interval of each nutrient are calculated, and the dynamic nutrition gap vector of meal time to be planned is generated in combination with daily intake nutrition data;According to historical dietary behavior, the preference weight of user to food is constructed;With nutrition gap vector as constraint, with minimizing energy deviation and maximizing user preference as optimization target, multi-objective optimization model is constructed, and multiple candidate meal plans are generated by solving;Output scheme is selected by user, and historical dietary behavior is updated according to selected scheme, for subsequent preference weight iterative optimization.The application solves the technical problem that existing technology cannot realize personalized dynamic accurate meal serving.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of personalized dietary matching, specifically to a personalized dietary energy optimization matching method and system. Background Technology

[0002] With increasing health awareness, daily dietary management has become a lifestyle habit for more and more people. Whether it's office workers looking to control their weight, fitness enthusiasts needing to ensure a balanced diet, or seniors concerned about chronic disease management, everyone wants to have their daily meals scientifically and rationally planned. However, in reality, users not only expect scientific nutritional advice, but also hope that the plans can be tailored to their individual eating habits, taste preferences, and real-time lifestyle. Therefore, how to achieve truly personalized, dynamic, and precise dietary recommendations has become a key issue that urgently needs to be addressed in the field of smart health.

[0003] Existing dietary planning methods primarily focus on template-based recipe recommendations, simple calorie calculations, or rule-based fuzzy suggestions. While template-based recipes can guarantee a basic nutritional structure, users can only passively accept fixed meal plans, unable to flexibly adjust them based on their preferred foods or available ingredients at home. Simple calorie calculations require users to manually input food portions and repeatedly calculate, a cumbersome and inefficient process. Rule-based adjustment suggestions only provide vague directions such as "add meat if protein is insufficient," lacking precise portion guidance. None of these methods incorporate in-depth modeling of the user's individual health goals and dietary preferences, nor do they consider the dynamic nutritional needs of each meal, nor do they use the user's taste preferences as a basis for decision-making. Therefore, there is an urgent need for an intelligent dietary planning method that can comprehensively consider the user's personalized needs, real-time nutritional status, and personal taste preferences. Summary of the Invention

[0004] This application provides a personalized dietary energy optimization matching method and system to solve the problems of existing technologies that are difficult to combine user personal data and health goals, cannot consider the dynamic nutritional consumption of each meal, and do not take into account user personal taste preferences, resulting in a lack of personalization and flexibility in dietary planning and a heavy decision-making burden for users.

[0005] In view of the above problems, this application provides a personalized dietary energy optimization matching method and system, the method comprising: Acquire multidimensional feature data of users, which includes at least the user's physiological parameters, health goals, daily nutrient intake data, and historical dietary behavior data; Based on the physiological parameters and health goals, calculate the user's daily energy requirement target and the energy supply ratio range of each macronutrient, and combine the daily nutrient intake data to generate a dynamic nutrient gap vector for the planned meals. Based on the historical dietary behavior data, construct a weight vector of user preferences for various types of food; Using the dynamic nutritional deficit vector as a constraint, and minimizing energy deviation and maximizing user preference as optimization objectives, a multi-objective optimization model is constructed to generate multiple candidate dietary plans. The multiple candidate dietary plans are output to the user terminal, the target plan selected by the user from the multiple candidate dietary plans is received, and the historical dietary behavior data is updated according to the target plan for subsequent preference weight vector iterative optimization.

[0006] One or more technical solutions provided in this application have at least the following technical effects or advantages: The technical solution of this application obtains the user's multidimensional feature data, calculates the daily energy demand and nutrient energy supply ratio range based on physiological parameters and health goals, generates a dynamic nutrient gap vector by combining the data of daily intake, constructs a preference weight vector based on historical dietary behavior, and constructs a multi-objective optimization model to solve candidate solutions with nutrient gap as constraint and minimizing energy deviation and maximizing preference as objectives. Finally, the solution is output for the user to choose and feedback updates the historical data.

[0007] The present invention provides a personalized dietary energy optimization matching method. First, by acquiring the user's multidimensional feature data, including physiological parameters, health goals, daily nutrient intake data and historical dietary behavior data, it can comprehensively collect key information affecting dietary planning, providing a complete data foundation for subsequent personalized calculations and avoiding the information loss problem caused by relying solely on a single calorie target.

[0008] Furthermore, based on the user's physiological parameters and health goals, the system calculates the daily energy requirements and energy ratio ranges of each macronutrient, and combines this with the daily nutrient intake data to generate a dynamic nutrient gap vector for the planned meals. This allows the dietary plan to be dynamically adjusted according to the user's actual intake on that day, realizing the transformation from static daily goals to dynamic meal planning tasks. This solves the problem that existing technologies cannot accurately identify and fill nutritional gaps based on real-time tracking of nutritional status.

[0009] Furthermore, by constructing a weight vector of user preferences for various types of food based on users' historical dietary behavior data, and learning users' taste preferences through implicit feedback, the system can quantify users' subjective preferences into calculable weight parameters, thus solving the problem that existing technologies rely solely on uniform nutritional standards and ignore individual taste differences, resulting in poor feasibility of the solution.

[0010] Furthermore, a multi-objective optimization model is constructed using a dynamic nutritional deficit vector as a constraint and minimizing energy deviation and maximizing user preference as optimization objectives. Multiple candidate dietary plans are generated by solving the multi-objective optimization algorithm. Under the premise of meeting the hard nutritional constraints, it can automatically balance health goals and taste preferences, freeing users from tedious manual calculations and significantly improving planning efficiency and plan acceptability.

[0011] Finally, multiple candidate dietary plans are output to the user for selection, and historical dietary behavior data is updated according to the user's selected target plan for subsequent iterative optimization of preference weight vector. This forms an intelligent closed loop of perception, decision-making, execution, and learning, enabling the system to continuously optimize the preference model as the user uses it, and achieves the ability of continuous self-evolution in personalized dietary planning.

[0012] In summary, the technical solution of this application achieves dynamic, personalized, and multi-objective optimization of user dietary planning, effectively solving the problems in the prior art that it is difficult to combine user personal data and health goals, cannot consider the dynamic nutritional consumption of each meal, and does not take into account user personal taste preferences, resulting in a lack of personalization, poor flexibility, and heavy decision-making burden for users. Attached Figure Description

[0013] Figure 1 This is a flowchart illustrating the personalized dietary energy optimization and matching method provided in the embodiments of this application.

[0014] Figure 2 This is a schematic diagram of the modules of the personalized dietary energy optimization and matching system provided in the embodiments of this application.

[0015] The components represented by each number in the attached diagram are explained as follows: 11 is the data acquisition module, 12 is the target conversion module, 13 is the preference learning module, 14 is the optimization engine module, and 15 is the solution output module. Detailed Implementation

[0016] This application provides a personalized dietary energy optimization and matching method, specifically addressing the technical problem that existing technologies cannot combine user personal data, dynamic nutritional status, and taste preferences for personalized dietary planning. Specific embodiments are as follows: It should be noted that in the following embodiments, the terms "comprising" and "having" are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or server that includes a series of steps or units is not necessarily limited to those steps or units that are explicitly listed, but may include other steps or modules that are not explicitly listed or that are inherent to these processes, methods, products, or devices.

[0017] Example 1, as Figure 1As shown, this application provides a personalized dietary energy optimization matching method, the method comprising: S100: Obtain the user's multidimensional feature data, which includes at least the user's physiological parameters, health goals, daily nutrient intake data, and historical dietary behavior data. In the field of dietary planning technology, existing technologies typically rely solely on a user's weight and simple calorie goals for program recommendations. For example, they might calculate daily calorie needs based solely on the user's input target weight and then push a fixed template menu. However, a user's dietary needs are influenced by a combination of factors. For instance, physiological parameters such as age, gender, height, and weight determine basal energy expenditure; health goals such as fat loss, muscle gain, or weight maintenance determine differentiated nutritional needs; daily nutrient intake data determines the direction of supplementation for the next meal; and historical eating behavior implies the user's true taste preferences. Existing technologies fail to systematically collect and integrate this multidimensional data, resulting in recommendations lacking a personalized foundation and failing to accurately match the user's real-time status. Therefore, how to comprehensively and accurately acquire users' multidimensional characteristic data to provide a complete data foundation for subsequent personalized dietary planning becomes the primary technical problem to be solved in this step.

[0018] Step S100 in the method provided in this application embodiment includes: Obtain the user's physiological parameters, which include at least age, gender, height, weight, and basal metabolic rate; Obtain the user's health goals, which include at least one of fat loss, muscle gain, or weight maintenance; Obtain the user's daily nutrient intake data, which includes at least the daily calorie intake, protein intake, fat intake, and carbohydrate intake. Obtain the user's historical dietary behavior data, which includes at least the types and amounts of food consumed at each historical meal, as well as the timestamps of consumption. The specific implementation method is as follows.

[0019] In this embodiment, physiological parameters refer to the user's basic physical indicators, including age, gender, height, weight, and basal metabolic rate. Basal Metabolic Rate (BMR) refers to the minimum energy expenditure required for the human body to maintain life at rest, usually measured in kilocalories per day. BMR can be calculated using the Mifflin-St. Jeor formula (Male BMR = 10 × weight (kg) + 6.25 × height (cm) - 5 × age (years) + 5; Female BMR = 10 × weight (kg) + 6.25 × height (cm) - 5 × age (years) - 161).

[0020] Health goals refer to the dietary planning objectives set by users, including fat loss, muscle gain, or weight maintenance. Different health goals correspond to different calorie coefficients and macronutrient energy ratio ranges. Fat loss goals require creating a calorie deficit, muscle gain goals require a calorie surplus, and maintenance goals require maintaining energy balance.

[0021] The daily nutrient intake data refers to the total amount of nutrients a user has consumed before the current meal, including calories (kcal), protein (g), fat (g), and carbohydrates (g). This data is obtained by accumulating the user's meal logs from previous meals and forms the basis for calculating the nutritional deficit for the next meal.

[0022] Historical dietary behavior data refers to a user's dietary check-in records over a period of time. Each record includes at least a user identifier, food identifier, portion size, and meal timestamp.

[0023] This step begins by acquiring the user's physiological parameters. Basic data such as age, gender, height, and weight are collected through the user registration or personal information maintenance interface. Based on this, the user's basal metabolic rate (BMR) is calculated using the Mifflin-St Jeor formula, taking into account their gender, age, height, and weight. The BMR reflects the minimum energy required for the user's body to maintain basic physiological functions and is one of the fundamental bases for subsequently calculating daily energy requirements.

[0024] Furthermore, the system identifies the user's health goals. Through an interface with options, users can choose their dietary planning goals from three options: fat loss, muscle gain, and weight maintenance. Different health goals correspond to different calorie coefficients and macronutrient energy ratio ranges. For example, a fat loss goal requires creating a calorie deficit, thus having a lower calorie coefficient, while the protein energy ratio is relatively increased to maintain muscle mass; a muscle gain goal requires a calorie surplus, thus having a higher calorie coefficient, while the protein energy ratio is also correspondingly increased; and a maintenance goal aims to maintain energy balance.

[0025] Furthermore, the system obtains the user's daily nutrient intake data. By summing the user's meal check-in records from previous meals, it calculates the total calories, protein, fat, and carbohydrates consumed by the user up to the current meal. This data is updated in real time, reflecting the user's daily nutrient intake progress and serving as a key input for subsequent calculations of the dynamic nutrient gap vector. If the user has not checked in for any meals that day, their daily nutrient intake data is 0.

[0026] Finally, historical dietary behavior data of users is obtained. User dietary records over a past period are retrieved from the user profile and log database. These records include the type of meal, food type, portion size, and timestamp of each meal. Historical dietary behavior data is the core data source for constructing the user preference weight vector in the subsequent module five. By analyzing the frequency and amount of different foods consumed, the user's taste preferences can be implicitly learned.

[0027] For example, taking user A as an example, firstly, their physiological parameters are obtained: age 35, gender male, height 175 cm, weight 70 kg. Based on the Mifflin-St Jeor formula, the basal metabolic rate is calculated: male BMR = 10 × weight + 6.25 × height - 5 × age + 5. Substituting these values, we get 10 × 70 + 6.25 × 175 - 5 × 35 + 5 = 1623.75 kcal / day. The health goal is fat loss, and the daily activity level is moderate. The nutritional intake data for the day is up to before lunch. Through breakfast check-in records, we obtain the user's intake of 350 kcal, 18 g of protein, 10 g of fat, and 45 g of carbohydrates. Regarding historical dietary behavior data, we collect the user's dietary records for the past 30 days. For example, the most recent lunch check-in record shows that the user consumed 200 g of chicken breast and 150 g of rice.

[0028] It should be noted that the above values ​​are for illustrative purposes only and do not constitute a limitation on the present invention.

[0029] In summary, this step, by collecting users' physiological parameters, health goals, daily nutrient intake data, and historical dietary behavior data, establishes a complete data foundation for subsequent personalized dietary planning. Compared with existing technologies, this step, by acquiring age, gender, height, and weight and calculating basal metabolic rate, can accurately assess users' energy needs, avoiding the crudeness of estimation based solely on weight; by clarifying health goals, it provides guidance for selecting the nutrient energy ratio range, making planning more targeted; by collecting daily nutrient intake data, it enables real-time tracking of nutritional progress, allowing subsequent planning to dynamically adapt to the actual situation of the day; and by accumulating historical dietary behavior data, it provides an implicit feedback source for learning preference weights. The comprehensive collection of multidimensional data solves the problem of information gaps in existing technologies, providing accurate data support for dynamic nutrient gap calculation, preference weight learning, and multi-objective optimization.

[0030] S200: Based on the physiological parameters and health goals, calculate the user's daily energy requirement target and the energy supply ratio range of each macronutrient, and combine the daily nutrient intake data to generate a dynamic nutrient gap vector for the planned meals. Current dietary planning technologies typically only calculate the total daily calorie target and use this as the sole basis for recipe recommendations, neglecting the scientific ratio between the three macronutrients: protein, fat, and carbohydrates. Different health goals have significantly different requirements for the energy ratio of nutrients. Controlling calories without considering nutritional structure can lead to insufficient protein intake causing muscle loss, or excessive carbohydrate intake hindering fat loss. Furthermore, current technologies provide static daily targets and cannot dynamically adjust based on the user's daily intake. Once a user has eaten some meals, it's impossible to calculate how many calories and nutrients should be supplemented for the next meal, resulting in a disconnect between the planned scheme and reality. Therefore, how to transform health goals into daily targets that include calorie and macronutrient ranges, and dynamically generate precise nutrient gap vectors for planned meals based on daily intake data, becomes the technical problem that needs to be solved in this step.

[0031] Step S200 in the method provided in this application embodiment includes: The total daily calorie requirement is calculated based on the calorie coefficient corresponding to the user's weight and health goals. The calorie coefficient is positively correlated with the user's daily activity level. Based on health goals, query the protein energy ratio range, fat energy ratio range, and carbohydrate energy ratio range from the preset nutrient energy ratio parameter database; The target total daily calorie requirement is multiplied by the respective protein energy ratio range, fat energy ratio range, and carbohydrate energy ratio range, and then divided by the corresponding nutrient's calorie coefficient to obtain the daily protein requirement range, daily fat requirement range, and daily carbohydrate requirement range. The specific implementation method is as follows.

[0032] In this embodiment, the calorie coefficient refers to the daily energy required per unit of body weight (per kilogram), expressed in kcal / kg / day. The calorie coefficient is positively correlated with the user's daily activity level; the higher the activity level, the higher the calorie coefficient. In the client's preset calorie coefficient parameter library, fat loss goals typically correspond to a lower calorie coefficient to create an energy deficit, muscle gain goals correspond to a higher calorie coefficient to provide an energy surplus, and maintenance goals fall somewhere in between.

[0033] The nutrient energy ratio parameter library refers to a database preset by the client, which stores the percentage range of the three macronutrients (protein, fat, and carbohydrates) that should account for in the total daily calories for different health goals.

[0034] A nutrient energy ratio range refers to the percentage of total daily calories provided by a particular macronutrient, expressed as a lower and upper percentage. This range is used to convert calorie targets into nutrient gram targets, ensuring that the nutritional structure meets the scientific requirements of health goals.

[0035] The coefficient of energy (CCE) refers to the amount of heat produced by the oxidation of each gram of nutrient in the body. This coefficient is used to convert calorie values ​​into grams of nutrients and is a basic parameter for converting between calorie units and mass units.

[0036] In this step, the first step is to calculate the target total daily calorie requirement based on the calorie coefficient corresponding to the user's weight and health goals. The user's weight is obtained from the user profile, and the corresponding calorie coefficient is retrieved from the calorie coefficient parameter database based on the user's selected health goals and daily activity level. The calorie coefficient is closely related to activity level; the greater the activity level, the more calories are required. This allows individuals with different exercise habits to obtain suitable calorie goals. The two are multiplied to obtain the target total daily calorie requirement, which serves as the energy basis for subsequent nutritional calculations.

[0037] Furthermore, based on the user's health goals, the system queries a pre-defined nutrient energy ratio parameter library for the energy ratio ranges of protein, fat, and carbohydrates. This library sets scientifically reasonable energy ratio ranges for different health goals. For example, under a fat loss goal, appropriately increasing the protein energy ratio helps maintain muscle mass during calorie control; similarly, a muscle gain goal increases the protein proportion to support muscle growth. Energy ratio ranges are stored as percentages, reflecting the required proportion of different nutrients in total calories.

[0038] Finally, multiply the total daily calorie requirement target by the energy ratio range of each nutrient to obtain the calorie range that nutrient should provide. Since the calories provided per gram of each nutrient are fixed, dividing the calorie range by the corresponding calorie value per gram converts it into the gram range of the nutrient, thus obtaining the daily protein requirement range, the daily fat requirement range, and the daily carbohydrate requirement range. This conversion process transforms the abstract percentage of calories into specific grams, facilitating subsequent subtraction operations with already consumed data.

[0039] Taking user A as an example, their weight is 70kg, their health goal is fat loss, and their daily activity level is moderate. Looking up the calorie coefficient parameter database, the coefficient is 27. The calculated total daily calorie requirement is 70 × 27 = 1890 kcal. Based on the fat loss goal, the nutrient energy ratio parameter database shows a protein energy ratio range of 20%-30%, fat 20%-25%, and carbohydrates 45%-55%. Multiplying the total daily calorie requirement by each nutrient energy ratio range and then dividing by the corresponding nutrient's calorie coefficient (protein 4kcal / g, fat 9kcal / g, carbohydrates 4kcal / g), the calculated daily protein requirement range is [94.5, 141.75] grams, the daily fat requirement range is [42, 52.5] grams, and the daily carbohydrate requirement range is [212.625, 259.875] grams.

[0040] It should be noted that the above values ​​are for illustrative purposes only and do not constitute a limitation on the present invention.

[0041] Step S200 in the method provided in this application embodiment further includes: Obtain the user's daily calorie, protein, fat, and carbohydrate intake; Subtracting the calories already consumed that day from the total daily calorie requirement target yields the calorie deficit value. For protein, the lower limit of the daily protein requirement range is subtracted from the protein already ingested that day to obtain the lower limit of the protein deficit. If the calculation result is negative, it is taken as 0. At the same time, the upper limit of the daily protein requirement range is subtracted from the protein already ingested that day to obtain the upper limit of the protein deficit. For fat, the lower limit of the daily fat requirement range is subtracted from the fat consumed that day to obtain the lower limit of the fat deficit. If the calculation result is negative, it is taken as 0. At the same time, the upper limit of the daily fat requirement range is subtracted from the fat consumed that day to obtain the upper limit of the fat deficit. For carbohydrates, the lower limit of the daily carbohydrate requirement range is subtracted from the carbohydrates consumed that day to obtain the lower limit of the carbohydrate deficit. If the result is negative, it is taken as 0. At the same time, the upper limit of the daily carbohydrate requirement range is subtracted from the carbohydrates consumed that day to obtain the upper limit of the carbohydrate deficit. The calorie deficit value, the lower and upper limits of the protein deficit, the lower and upper limits of the fat deficit, and the lower and upper limits of the carbohydrate deficit are combined to generate a dynamic nutritional deficit vector for the meals to be planned.

[0042] In this embodiment, the calorie deficit refers to the calories needed to be supplemented for the planned meals, calculated by subtracting the calories already consumed that day from the total daily calorie requirement target. If the result is negative, it indicates that the user has exceeded the daily target, and an adjustment should be prompted.

[0043] The lower limit of a nutrient deficit refers to the minimum amount of a certain nutrient that needs to be supplemented in the planned meals. It is calculated by subtracting the amount already consumed that day from the lower limit of the daily requirement range. If the result is negative, it is taken as 0, indicating that the target has been met and no supplementation is needed.

[0044] The upper limit of nutrient deficiency refers to the maximum number of grams of a certain nutrient that can be supplemented in the planned meals. It is calculated by subtracting the amount already ingested that day from the upper limit of the daily requirement range. If the result is negative, it indicates that the limit has been exceeded, and the value should be set to zero and the user should be notified.

[0045] The dynamic nutrient gap vector refers to a vector composed of the calorie gap value, the lower and upper limits of the protein gap, the lower and upper limits of the fat gap, and the lower and upper limits of the carbohydrate gap, which serves as the input constraint for the subsequent optimization model.

[0046] This step first retrieves the user's daily nutritional intake data, including calories, protein, fat, and carbohydrates. This data is maintained in real-time by Module 1 and is automatically accumulated and updated after each check-in.

[0047] The next step is to calculate the calorie deficit, which is the total daily calorie requirement minus the calories already consumed that day. This value serves as the calorie target for the planned meals and is a constant on the right-hand side of the subsequent energy equation constraints.

[0048] Furthermore, calculate the protein, fat, and carbohydrate deficit ranges separately. Taking protein as an example, subtract the protein already ingested that day from the lower limit of the daily protein requirement range to obtain the lower limit of the protein deficit. If the result is negative, take 0, indicating that the target has been met and no further supplementation is needed. Subtract the protein already ingested that day from the upper limit of the daily protein requirement range to obtain the upper limit of the protein deficit. This value represents the maximum amount that can be supplemented without exceeding the daily upper limit. The calculations for fat and carbohydrates are similar.

[0049] Finally, the calorie deficit value, the lower limit and upper limit of the deficit for each nutrient are combined to generate a dynamic nutrient deficit vector. This vector is a key intermediate product connecting the user's health goals and the optimization engine, providing Module 3 with precise, multi-dimensional, and dynamic planning task instructions.

[0050] For example, taking user A as an example, the total daily calorie requirement is 1890 kcal. The user has already consumed 850 kcal that day, resulting in a calorie deficit of 1890 - 850 = 1040 kcal. The daily protein requirement range is [94.5, 141.75] g. The user has already consumed 45 g of protein, so the lower limit of the protein deficit is max(0, 94.5 - 45) = 49.5 g, and the upper limit is 141.75 - 45 = 96.75 g. The daily fat requirement range is [42, 52.5] g. The user has already consumed 20 g of fat, so the lower limit of the fat deficit is max(0, 42 - 20) = 22 g, and the upper limit is 52.5 - 20 = 32.5 g. The daily carbohydrate requirement range is [212.625, 259.875]g. 90g of carbohydrates have already been consumed. The lower limit of the carbohydrate deficit is max(0, 212.625-90) = 122.625g, and the upper limit is 259.875-90 = 169.875g. The generated dynamic nutrient deficit vector is [1040, 49.5, 96.75, 22, 32.5, 122.625, 169.875].

[0051] It should be noted that the above values ​​are for illustrative purposes only and do not constitute a limitation on the present invention.

[0052] In summary, this step transforms the user's health goals into a comprehensive daily target encompassing calorie and macronutrient ranges, and generates a dynamic nutrient gap vector based on daily intake data, providing precise task instructions for the subsequent optimization engine. Compared to existing technologies, this step achieves this by using a positive correlation between the calorie coefficient and activity level, ensuring the calorie target aligns with the user's actual energy expenditure; by introducing an energy ratio range, it enables refined control over the nutritional structure; by using nutrient gap ranges instead of fixed values, it provides a flexible constraint range for the optimization engine; and by deducting daily intake data in real-time, it transforms the plan from a static daily target to a dynamic meal-based task, allowing the plan to dynamically adjust based on the user's real-time progress, truly achieving "gap filling." This step solves the technical problems of existing technologies, such as single, static, and inflexible targets, and the inability to dynamically adapt.

[0053] S300: Based on the historical dietary behavior data, construct a weight vector of user preferences for various types of food; After acquiring users' historical dietary behavior data, the key technical challenge in this step is to extract their true preferences for various foods and quantify them into a computable weight vector. Existing technologies typically employ explicit ratings or simple frequency statistics. However, users rarely rate foods proactively, and simply counting frequency fails to distinguish between occasional consumption and genuine preferences, and cannot handle foods not previously eaten. Furthermore, users' taste preferences are complex and implicit, potentially influenced by various underlying factors, making it difficult for simple statistics to capture these implicit relationships. Therefore, the core technical challenge in this step is to learn a weight vector reflecting users' true preferences from implicit feedback data and to predict preferences for uneaten foods.

[0054] Step S300 in the method provided in this application embodiment includes: Obtain the dietary behavior history of multiple users, which includes at least user identifier, food identifier, frequency of consumption, and portion size; A user-food interaction matrix is ​​constructed using user identifiers and food identifiers as dimensions. The element values ​​in the user-food interaction matrix are the interaction intensity between the user and the food. The interaction intensity is positively correlated with the frequency of consumption and the amount of food consumed. The user-food interaction matrix is ​​decomposed using a matrix factorization algorithm to obtain user latent vectors and food latent vectors. The training objective of the matrix factorization is to minimize the reconstruction error of the user-food interaction matrix. For each type of food to be evaluated, the user's latent vector and the food's latent vector are multiplied by a dot product to obtain the user's preference weights for each type of food, and then combined to generate a preference weight vector.

[0055] In this embodiment, the user-food interaction matrix refers to a two-dimensional matrix with users as rows and food as columns, and matrix elements... This represents the interaction strength between user u and food i. If the user has never eaten the food, the element value is 0.

[0056] Interaction intensity is a quantitative indicator measuring a user's degree of food preference, and it is positively correlated with the frequency and portion size of consumption. Example calculation formula: The standard serving size is set according to the food category.

[0057] Matrix factorization algorithms refer to techniques that approximate the decomposition of an interaction matrix into the product of two low-dimensional matrices. .in For user latent vector matrix, Let be the food latent vector matrix, and d be the dimension of the latent factors.

[0058] User latent vectors A vector of dimension d represents a user's preference features in the latent factor space, such as an abstract dimension like liking high protein or preferring a light diet.

[0059] Food latent vector A vector of dimension d represents the attributes of food in the latent factor space, such as abstract dimensions like high protein and low fat.

[0060] Reconstruction error refers to the difference between the predicted value and the actual interaction strength after decomposition. The training objective is to minimize the weighted squared error loss function: .in β is the confidence weight (a hyperparameter), and λ is the regularization coefficient used to prevent overfitting. This loss function is optimized using the Alternating Least Squares (ALS) method.

[0061] In this step, we first obtain the dietary behavior history records of multiple users. To build a model with collaborative filtering capabilities, we need to utilize the interaction data of all users, not just the current user. We extract the dietary check-in records of all users from Module 1. Each record includes a user identifier, food identifier, frequency of consumption (or portion size per consumption), and timestamp of consumption.

[0062] Furthermore, a user-food interaction matrix is ​​constructed, with user identifiers as rows and food identifiers as columns. The matrix element values ​​are determined by interaction strength, calculated using a non-linear function of consumption frequency and average portion size, to avoid large-portion users dominating the matrix. Interaction strength is positively correlated with consumption frequency and portion size, but smoothing is applied to make the non-zero elements in the sparse matrix more distinctive.

[0063] Furthermore, a matrix factorization algorithm is used to decompose the interaction matrix. The latent factor dimension *d* is set, mapping users and food to the same low-dimensional space. The training objective is to minimize the weighted squared error loss function, where the confidence level... Samples with high interaction intensity are given higher weights, and a regularization term λ is used to prevent overfitting. The user latent vector matrix U and the food latent vector matrix I are obtained through iterative optimization using alternating least squares.

[0064] Finally, for each type of food that the current user needs to evaluate, extract the user's latent vector from U. ,from Extract the latent vector of each food item. The preference weights are obtained by calculating the dot product. The preference weights of all the foods to be evaluated are combined into a vector, which is then used by the optimization engine in Module 3. This vector reflects the user's relative preference for various types of food, and can even provide predictions based on collaborative information for foods never eaten before.

[0065] For example, the client collects the dietary history of all users, including user A (only user A's data is shown here). Based on user A's dietary history over the past 30 days, the interaction intensity is calculated. Taking chicken breast as an example, the frequency of consumption is 12 times, the average serving size is 150g, and the standard serving size is 100g. Similarly, calculate the interaction matrix row vectors for other foods to construct user A's interaction matrix. Simultaneously, interaction matrices of other users are constructed to form a complete matrix R (U×10). Matrix factorization is used, with d=50, β=0.5, and λ=0.1. Through iterative training with ALS, user latent vectors are obtained. and food latent vector Calculate the dot product for candidate foods such as chicken breast and rice: , , , , The combined values ​​yield a preference weight vector [0.85, 0.42, 0.68, 0.62, 0.29].

[0066] It should be noted that the above values ​​are for illustrative purposes only and do not constitute a limitation on the present invention.

[0067] In summary, this step, through matrix factorization, learns preference weights from users' historical dietary behavior, offering the following advantages: Utilizing collaborative filtering and leveraging the interaction information of all users, it can reasonably predict uneaten foods, effectively improving recommendation diversity; by abstracting user preferences and food attributes through low-dimensional latent vectors, it automatically discovers implicit dietary patterns, which is more expressive than simple frequency statistics; the use of weighted loss functions and regularization terms ensures stable training of the model even with sparse data, avoiding overfitting; after training, preference weights can be quickly obtained through dot product operations, making it computationally efficient and meeting real-time response requirements; the model can be incrementally updated periodically, continuously optimizing with the accumulation of user behavior, achieving dynamic evolution of personalized preferences. This step solves the problems of existing technologies being unable to mine implicit preferences and predict uneaten food preferences, providing high-quality personalized input for subsequent multi-objective optimization.

[0068] S400: Using the dynamic nutrient gap vector as a constraint, and minimizing energy deviation and maximizing user preference as optimization objectives, a multi-objective optimization model is constructed to generate multiple candidate dietary plans. After obtaining the dynamic nutritional deficit vector and user preference weight vector, the core technical problem to be solved in this step is how to transform these constraints and objectives into a computable mathematical model and automatically solve for food portion combinations that satisfy all nutritional constraints while also taking into account taste preferences. In existing technologies, users need to manually adjust the portions of various foods and repeatedly try different calculations, a cumbersome process that makes it difficult to find the optimal solution; simple rule suggestions can only provide a vague direction and cannot give precise portions; and schemes that only focus on total calories ignore the scientific ratio between protein, fat, and carbohydrates. Furthermore, multi-objective optimization requires a balance between minimizing calorie deviation and maximizing user preferences. Designing an optimization model that can strictly meet nutritional constraints and solve problems efficiently is a key challenge in this step.

[0069] Step S400 in the method provided in this application embodiment includes: The system retrieves a set of candidate foods that the user can choose from in the current meal and obtains the nutritional data of each candidate food from a pre-built food nutrition knowledge base. The nutritional data includes at least the calories, protein content, fat content, and carbohydrate content per 100 grams. The feasible serving size boundaries for each candidate food are obtained from the food nutrition knowledge base, and the feasible serving size boundaries include at least the minimum serving size and the maximum serving size. Using the portion size of each candidate food as the decision variable, the calorie gap value in the dynamic nutrient gap vector as the equality constraint, the lower and upper limits of the protein gap, the lower and upper limits of the fat gap, and the lower and upper limits of the carbohydrate gap as the inequality constraint, and the feasible portion size boundary of each candidate food as the upper and lower limit constraints of the decision variable, a set of constraint conditions is constructed. A multi-objective optimization model is constructed with the optimization objectives of minimizing calorie deviation and maximizing preference score, wherein the preference score is the sum of the products of the preference weight of each candidate food and its corresponding portion size. The multi-objective optimization model is solved using a multi-objective optimization algorithm to generate multiple candidate solutions. Each candidate solution corresponds to a set of food portion combinations, which serve as candidate dietary plans.

[0070] In this embodiment, the feasible serving size boundary refers to the realistically acceptable serving size range for each food item, consisting of a minimum serving size and a maximum serving size. This boundary is derived from a food nutrition knowledge base to avoid unrealistic recommendations such as 1 gram of rice or 5 kilograms of chicken breast in the optimization results.

[0071] Decision variables refer to the unknowns to be solved, and each decision variable corresponds to the portion size (in 100 grams) of a candidate food. The optimization model finds the optimal combination that satisfies the constraints by adjusting the values ​​of the decision variables.

[0072] A constraint set refers to a group of mathematical conditions consisting of equality constraints, inequality constraints, and upper and lower bound constraints. The calorie deficit is an equality constraint, the deficit ranges of the three macronutrients are inequality constraints, and the food quantity boundaries are upper and lower bound constraints. All constraints must be satisfied simultaneously to form a feasible solution space.

[0073] A multi-objective optimization model is a mathematical model that simultaneously optimizes two conflicting objectives (minimizing heat deviation and maximizing preference score). Since the two objectives cannot be optimal simultaneously, the model aims to find a set of Pareto optimal solutions for users to choose from based on their personal preferences. A Pareto optimal solution is one in which no other solution is superior to it in all objectives. If solution A is superior to solution B in both heat deviation and preference score, then A dominates B; if A is superior to B in some objectives but inferior to B in others, then A and B are not mutually dominant and are both Pareto optimal solutions. The set of Pareto optimal solutions forms a trade-off curve from which users can choose according to their preferences.

[0074] Preference score is a quantitative indicator that measures how well a candidate meal plan suits a user's taste. It is calculated by summing the products of the preference weight of each food item and the portion size of that food. A higher preference score indicates that the plan better matches the user's taste preferences.

[0075] In this step, the first step is to obtain the set of available foods for the current meal from the user's device, and then retrieve the nutritional data (calories, protein, fat, and carbohydrates per 100 grams) and feasible serving boundaries (minimum and maximum edible grams) for each food from a pre-built food nutrition knowledge base. This data provides the basic parameters for subsequent modeling.

[0076] Furthermore, the portion size of each candidate food is defined as a decision variable, and a set of constraints is constructed using the dynamic nutrient gap vector generated in the previous steps as the core constraint: the calorie gap serves as an equality constraint, requiring that the actual total calories be equal to the target calories (allowing the absorption of small deviations through slack variables); the gap ranges of protein, fat, and carbohydrates serve as inequality constraints, requiring that the total amount of each nutrient fall within a specified range; and the feasible portion size boundaries of each food serve as upper and lower limit constraints for the decision variables, ensuring that the solution results conform to real-world eating habits.

[0077] Furthermore, a multi-objective optimization model is constructed with the optimization objectives of minimizing calorie deviation (the absolute difference between actual calories and calorie deficit) and maximizing preference score (the sum of the products of each food preference weight and portion size). These two objectives are mutually balancing: pursuing precise calorie measurement may sacrifice taste preference, while pursuing a high preference score may lead to increased calorie deviation.

[0078] Finally, a multi-objective optimization algorithm is used to solve the model, generating multiple candidate solutions, each corresponding to a specific combination of food portions.

[0079] For example, taking user A as an example, the candidate foods are chicken breast, rice, broccoli, eggs, and olive oil. The decision variables represent the portion sizes (in 100 grams) of each of the five foods. Constraints include: a calorie deficit of 1040 kcal (equal); protein deficits of [49.5, 96.75] grams, fat deficits of [22, 32.5] grams, and carbohydrate deficits of [122.6, 169.9] grams (inequalities); and upper and lower bounds for each food portion size. The optimization objective is to minimize the calorie bias and maximize the preference score. A Pareto optimal solution is obtained: 250g chicken breast, 100g rice, 250g broccoli, 150g eggs, and 15g olive oil, with an actual calorie content of 995 kcal, a calorie bias of 45 kcal, and a preference score of 5.22. This solution achieves a good balance between calorie accuracy and taste preference.

[0080] It should be noted that the above values ​​are for illustrative purposes only and do not constitute a limitation on the present invention.

[0081] Step S400 in the method provided in this application embodiment further includes: Multiple candidate solutions are initialized in the decision variable space, and each candidate solution corresponds to a set of food portion combinations; Calculate the calorie deviation value and preference score for each candidate solution. The calorie deviation value is the absolute value of the difference between the actual calorie content and the calorie deficit value of the candidate solution. The preference score is the sum of the products of each food portion and its corresponding preference weight in the candidate solution. The candidate solutions are hierarchically sorted based on the heat deviation value and preference score to obtain multiple optimal candidate solution sets; The candidate solutions in the optimal candidate solution set are selected, crossovered, and mutated to generate a new generation of candidate solutions; Repeat the hierarchical sorting and evolutionary operations until the preset number of iterations is reached, and output multiple candidate solutions in the optimal candidate solution set as candidate dietary plans.

[0082] In this embodiment, the heat deviation value refers to the absolute difference between the actual total heat of the candidate solution and the heat gap value, i.e., |actual heat - heat gap|. The smaller this value, the closer the solution is to the target heat.

[0083] Hierarchical sorting refers to a Pareto non-dominated sorting method that divides candidate solutions into multiple levels according to dominance relationships. The first level is the set of non-dominated solutions (Pareto front), the second level is the set of solutions dominated by the first level, and so on. Hierarchical sorting is a core operation of multi-objective evolutionary algorithms.

[0084] Selection, crossover, and mutation are the three basic operations of genetic algorithms. Selection refers to choosing superior individuals to enter the next generation based on non-dominated levels and crowding distance; crossover refers to combining the decision variables of two parent solutions to generate offspring; mutation refers to applying random perturbations to the decision variables of the offspring solutions to maintain population diversity.

[0085] The preset number of iterations refers to the algorithm's termination condition, typically set to 200-500 iterations. Too few iterations may lead to non-convergence, while too many will increase computation time.

[0086] This step employs a multi-objective evolutionary algorithm to solve the optimization model. First, multiple candidate solutions are randomly initialized in the decision variable space. Each solution corresponds to a set of food portion combinations and must satisfy feasible portion boundary constraints. The initial population size is typically set to 100-200 to ensure solution diversity.

[0087] Furthermore, the calorie deviation value and preference score are calculated for each candidate solution. The calorie deviation value is the absolute difference between the actual total calories and the calorie deficit value; the preference score is the sum of the products of the preference weights of each food and their portion sizes. These two indicators together serve as the basis for evaluating the quality of the solutions.

[0088] Furthermore, candidate solutions are hierarchically sorted based on heat deviation values ​​and preference scores. The Pareto non-dominated sorting method is used to divide all solutions into multiple frontier layers. The first layer is the non-dominated solution set, which is the current optimal solution set. At the same time, the crowding distance of each solution is calculated to maintain the uniformity of solution distribution within the same frontier layer.

[0089] Furthermore, candidate solutions undergo selection, crossover, and mutation operations: Excellent individuals are selected for the next generation based on non-dominated hierarchy and crowding distance; the selected parent individuals are then subjected to simulated binary crossover or polynomial mutation to generate a new generation of candidate solutions. The crossover and mutation operations must ensure that the offspring solutions still satisfy the feasibility component boundary constraints.

[0090] Finally, the hierarchical sorting and evolutionary operations are repeated until the preset number of iterations is reached. After the iterations are completed, multiple non-dominated solutions from the optimal candidate solution set are output as candidate dietary plans. These plans represent different trade-offs between calorie bias and preference score, allowing users to choose.

[0091] For example, taking user A's candidate foods as an example, the population size is initialized to 100, and each solution corresponds to a five-dimensional decision variable. After calculating the caloric bias and preference score of each solution, non-dominated sorting is performed, and the first-level non-dominated solution set contains multiple solutions. After 200 iterations through selection, crossover, and mutation operations, a typical solution is output: 250g chicken breast, 100g rice, 250g broccoli, 150g egg, and 15g olive oil. This solution has a caloric bias of 45kcal and a preference score of 5.22, which belongs to the preference-first type of solution on the Pareto front, for the user to choose from.

[0092] It should be noted that the above values ​​are for illustrative purposes only and do not constitute a limitation on the present invention.

[0093] In summary, this step, by constructing a multi-objective optimization model and employing an evolutionary algorithm, achieves automatic generation and multi-objective trade-offs in dietary plans. Nutritional constraints are systematically transformed into mathematical constraints, ensuring that candidate plans simultaneously meet hard requirements such as calories, macronutrients, and portion sizes. With the dual objectives of minimizing calorie deviation and maximizing preference scores, a Pareto optimal balance is sought between health and taste, allowing users to choose suitable plans based on their preferences. The multi-objective evolutionary algorithm is used for efficient solution, converging to diverse Pareto fronts within a finite number of iterations. The generated candidate plans cover different trade-off ranges, giving users choice and avoiding the problem of single recommendations failing to meet individual differences. Feasibility portion size constraints automatically avoid unrealistic suggestions, improving the feasibility of the plans. This step solves the problems of tedious manual trial and error, singular optimization objectives, and inability to consider multiple constraints in existing technologies, achieving automated, scientific, and personalized dietary planning.

[0094] S500: Output the multiple candidate dietary plans to the user terminal, receive the target plan selected by the user from the multiple candidate dietary plans, and update the historical dietary behavior data according to the target plan for subsequent preference weight vector iterative optimization.

[0095] After generating multiple candidate dietary plans, the key technical challenge in this step is to present these plans to users in an intuitive and comparable manner, and to ensure that user choices are fed back into the client to form a closed loop of continuous optimization. Existing technologies typically only output a single recommended plan, leaving users with little choice and failing to incorporate actual selections into subsequent model iterations, making it difficult to learn the dynamic changes in user preferences. Furthermore, food nutrition data inherently fluctuates; if only a single predicted value is output, users may mistakenly believe the result is absolutely accurate, and their actual intake may deviate from expectations. Therefore, the crucial step is to quantify uncertainty through probabilistic simulation and feed user choices back into historical data.

[0096] Step S500 in the method provided in this application embodiment includes: The multiple candidate dietary plans are output to the user terminal. Each candidate dietary plan includes at least the type of food, the recommended portion size, and the corresponding predicted values ​​of calories and nutrients. In response to the user's selection operation among the multiple candidate dietary plans, the user's selected target plan is obtained; Add the food types, suggested portion sizes, and current meal timestamp from the target plan to the user's historical dietary behavior data; Based on the updated historical dietary behavior data, the preference weight vector is recalculated for optimized matching of subsequent meals.

[0097] In this embodiment, the candidate dietary plan refers to a set of food portion combinations obtained through multi-objective optimization. Each plan includes food type, suggested portion size, predicted calories and nutrient values, representing different trade-offs between calorie deviation and preference score.

[0098] Historical dietary behavior data updates refer to adding the types, portions, and meal timestamps of the food selected by the user to the user's historical records, which serve as new samples for subsequent iterative optimization of preference weight vectors, enabling the model to dynamically adapt to changes in user tastes.

[0099] In this step, the multiple candidate solutions obtained from the optimization are presented to the user in a clear list. Each solution details which foods are included, the recommended serving size for each food, and the estimated calories, protein, fat, and carbohydrates calculated based on that portion size. This allows users to not only see clearly what and how much they will eat at each meal, but also compare the differences in nutritional data between different solutions and make a choice based on their preferences.

[0100] Furthermore, once a user clicks or swipes to select an option on the interface, the client immediately captures the user's selection and records which option was chosen. This operation requires no additional information from the user; it can be completed with just one click, and the client automatically records the user's selected option as the execution plan for this meal.

[0101] Furthermore, the user's selected meal plan and the current meal time are recorded as a new dietary record and saved to the user's historical dietary behavior database. This record will be combined with all of the user's past dietary records, becoming a new basis for subsequent analysis of the user's taste preferences.

[0102] Finally, because the user's historical food records now include information about the recently completed meal, the client triggers the preference learning module to retrain the model. The new records reflect the user's true preferences, and the updated model generates preference weight vectors that better match the user's actual tastes. These weights are then used in optimizing the next meal or subsequent meals, making the recommendations increasingly aligned with the user's preferences.

[0103] Taking user A as an example, S400 generates three candidate options. Option 3 (250g chicken breast, 100g rice, 250g broccoli, 150g egg, 15g olive oil) has a predicted calorie content of 995kcal and the highest preference score. User A selects option 3 and executes it. The client adds this record (food, portion size, timestamp) to the historical diet data and triggers retraining of the preference model, making subsequent options more closely match their true preferences.

[0104] Step S500 in the method provided in this application embodiment further includes: The nutritional data of each food in the candidate dietary plan were superimposed with random perturbations, and multiple Monte Carlo simulations were performed. The distribution of calories and nutrients in the simulation results was statistically analyzed. Based on the statistical distribution of the simulation results, calculate the calorie confidence interval and nutrient confidence interval for each candidate dietary plan; The calorie confidence interval and nutrient confidence interval are used as reliability indicators of the candidate dietary plan and are output to the user along with the candidate dietary plan.

[0105] In this embodiment, Monte Carlo simulation refers to a method that simulates system uncertainty through a large number of random samples. In this step, random perturbations are superimposed on the nutritional data of each food in the scheme, and the total calories and nutrients are repeatedly calculated to obtain the probability distribution of the results.

[0106] Random perturbation refers to the random variation superimposed on the mean of nutritional data. The standard deviation is usually set at 5% to 10% of the mean to simulate the fluctuations caused by the variety, origin and cooking method of actual ingredients.

[0107] A confidence interval refers to the range within which a population parameter may fall at a given confidence level.

[0108] First, before outputting the solution, the client randomly perturbs the nutritional data of each food item in the solution. This is because the nutritional values ​​stored in the food knowledge base are only theoretical averages, while actual ingredients will fluctuate due to differences in variety, origin, cooking methods, and other factors. The client sets a probability distribution for the nutritional indicators of each food item and performs a large number of repeated calculations according to this fluctuation pattern. Each calculation randomly selects a set of nutritional values ​​and calculates the total calories and total nutrients, thereby obtaining a set of hundreds or thousands of simulation results.

[0109] Furthermore, the client calculates the confidence intervals for calories and nutrients for each candidate dietary plan based on the statistical distribution of the simulation results. After arranging all simulation results in ascending order of value, a certain proportion of values ​​are taken as upper and lower boundaries to form an interval range. This interval reflects that if the user follows the plan, the actual nutritional intake is highly likely to fall within this range, thus transforming the originally singular theoretical prediction value into a reliable fluctuation range, allowing the user to clearly understand the potential deviation of the plan.

[0110] Finally, the client outputs the calculated calorie and nutrient confidence intervals as reliability indicators of the plan, along with the basic information of the candidate dietary plans, to the user. When selecting a plan, users can not only see the expected calorie and nutrient values, but also understand the range of fluctuations these values ​​may experience in actual implementation, thus gaining a more comprehensive understanding of the plan's stability. Narrower intervals indicate a more reliable plan, while wider intervals suggest that users need to pay attention to the consistency of ingredient selection and cooking methods. This output method with reliability indicators significantly enhances the scientific nature of decision-making.

[0111] For example, a Monte Carlo simulation is performed on option 3 selected by user A (250g chicken breast, 100g rice, 250g broccoli, 150g egg, 15g olive oil). Assuming the standard deviation of the calories for each food is 5% of the mean, after 1000 simulations, the total average calorie content is 995kcal, with a 95% confidence interval of [892, 1098]kcal. The client output displays: Predicted calorie 995kcal (95% confidence interval 892–1098kcal), allowing the user to understand that there is a 95% probability that the actual calorie content will fall within this range.

[0112] In summary, this step offers the following benefits: it provides multiple candidate solutions, allowing users to weigh calorie accuracy against taste satisfaction based on their preferences, thus enhancing the acceptability of the solutions; it transforms theoretical predictions into reliability indicators with confidence intervals through Monte Carlo simulation, enabling users to clearly understand the fluctuation range of actual results, avoiding blindly following single-point values, and improving the scientific nature of decision-making; it updates the user-selected solutions to historical data and triggers retraining of the preference model, allowing preference weights to dynamically evolve with user behavior, forming a continuously optimized personalized closed loop; and the confidence intervals can also be used to evaluate the robustness of the solutions, providing a reference for ingredient selection and cooking methods. This step solves the problems of existing technologies, such as single output, lack of uncertainty quantification, and inability to provide closed-loop feedback, giving this method the intelligent characteristic of continuous evolution.

[0113] In summary, the embodiments of this application, through the complete process of steps S100 to S500, achieve the following effects: A personalized data foundation is constructed by collecting users' physiological parameters, health goals, daily nutrient intake, and historical dietary behavior data; health goals are transformed into energy requirements and nutrient ranges, and a meal nutrient gap is dynamically generated based on daily intake; user preferences are learned from historical behavior using matrix factorization to construct a preference weight vector; multiple candidate solutions are automatically solved through multi-objective optimization, with nutrient gap as a constraint and calorie accuracy and taste preference as dual objectives; the solutions are output in the form of confidence intervals, and user feedback is collected, forming a closed-loop iteration. Overall, this solves the problems of existing technologies lacking personalization, unable to dynamically adapt, having single optimization methods, and lacking closed-loop feedback, achieving precise, scientific, and self-evolving dietary planning.

[0114] Example 2, as Figure 2 As shown, this embodiment provides a personalized dietary energy optimization matching system. The system includes a data acquisition module, a target transformation module, a preference learning module, an optimization engine module, and a solution output module. The system includes: Data acquisition module 11 is used to acquire multidimensional feature data of users, including at least the user's physiological parameters, health goals, daily nutrient intake data and historical dietary behavior data. The target conversion module 12 is used to calculate the user's daily energy demand target and the energy supply ratio range of each macronutrient based on the physiological parameters and health goals, and generate a dynamic nutritional gap vector of the meals to be planned by combining the nutritional data already ingested that day. Preference learning module 13 is used to construct a user preference weight vector for various types of food based on the historical dietary behavior data; The optimization engine module 14 is used to construct a multi-objective optimization model with the dynamic nutritional deficit vector as a constraint and the optimization objectives of minimizing energy deviation and maximizing user preference, and solve to generate multiple candidate dietary plans. The solution output module 15 is used to output the multiple candidate dietary solutions to the user terminal, receive the target solution selected by the user from the multiple candidate dietary solutions, and update the historical dietary behavior data according to the target solution for subsequent preference weight vector iterative optimization.

[0115] Data acquisition module 11 is specifically used for: Obtain the user's physiological parameters, which include at least age, gender, height, weight, and basal metabolic rate; Obtain the user's health goals, which include at least one of fat loss, muscle gain, or weight maintenance; Obtain the user's daily nutrient intake data, which includes at least the daily calorie intake, protein intake, fat intake, and carbohydrate intake. Obtain the user's historical dietary behavior data, which includes at least the types of food, portion sizes, and timestamps of each meal throughout the history.

[0116] Target conversion module 12 is specifically used for: The total daily calorie requirement is calculated based on the calorie coefficient corresponding to the user's weight and health goals. The calorie coefficient is positively correlated with the user's daily activity level. Based on health goals, query the protein energy ratio range, fat energy ratio range, and carbohydrate energy ratio range from the preset nutrient energy ratio parameter database; Multiply the target total daily calorie requirement by the protein energy ratio range, fat energy ratio range, and carbohydrate energy ratio range, respectively, and then divide by the corresponding nutrient's calorie coefficient to obtain the daily protein requirement range, daily fat requirement range, and daily carbohydrate requirement range.

[0117] The data on nutrients ingested that day are used to generate a dynamic nutrient gap vector for the planned meals, including: Obtain the user's daily calorie, protein, fat, and carbohydrate intake; Subtracting the calories already consumed that day from the total daily calorie requirement target yields the calorie deficit value. For protein, the lower limit of the daily protein requirement range is subtracted from the protein already ingested that day to obtain the lower limit of the protein deficit. If the calculation result is negative, it is taken as 0. At the same time, the upper limit of the daily protein requirement range is subtracted from the protein already ingested that day to obtain the upper limit of the protein deficit. For fat, the lower limit of the daily fat requirement range is subtracted from the fat consumed that day to obtain the lower limit of the fat deficit. If the calculation result is negative, it is taken as 0. At the same time, the upper limit of the daily fat requirement range is subtracted from the fat consumed that day to obtain the upper limit of the fat deficit. For carbohydrates, the lower limit of the daily carbohydrate requirement range is subtracted from the carbohydrates consumed that day to obtain the lower limit of the carbohydrate deficit. If the result is negative, it is taken as 0. At the same time, the upper limit of the daily carbohydrate requirement range is subtracted from the carbohydrates consumed that day to obtain the upper limit of the carbohydrate deficit. The calorie deficit value, the lower and upper limits of the protein deficit, the lower and upper limits of the fat deficit, and the lower and upper limits of the carbohydrate deficit are combined to generate a dynamic nutritional deficit vector for the meals to be planned.

[0118] Preference learning module 13 is specifically used for: Obtain the dietary behavior history of multiple users, which includes at least user identifier, food identifier, frequency of consumption, and portion size; A user-food interaction matrix is ​​constructed using user identifiers and food identifiers as dimensions. The element values ​​in the user-food interaction matrix are the interaction intensity between the user and the food. The interaction intensity is positively correlated with the frequency of consumption and the amount of food consumed. The user-food interaction matrix is ​​decomposed using a matrix factorization algorithm to obtain user latent vectors and food latent vectors. The training objective of the matrix factorization is to minimize the reconstruction error of the user-food interaction matrix. For each type of food to be evaluated, the user's latent vector and the food's latent vector are multiplied by a dot product to obtain the user's preference weights for each type of food, and then combined to generate a preference weight vector.

[0119] Optimization engine module 14 is specifically used for: The multiple candidate dietary plans are output to the user terminal. Each candidate dietary plan includes at least the type of food, the recommended portion size, and the corresponding predicted values ​​of calories and nutrients. In response to the user's selection operation among the multiple candidate dietary plans, the user's selected target plan is obtained; Add the food types, suggested portion sizes, and current meal timestamp from the target plan to the user's historical dietary behavior data; Based on the updated historical dietary behavior data, the preference weight vector is recalculated for optimized matching of subsequent meals.

[0120] Before outputting the multiple candidate dietary plans to the user, the process also includes: The nutritional data of each food in the candidate dietary plan were superimposed with random perturbations, and multiple Monte Carlo simulations were performed. The distribution of calories and nutrients in the simulation results was statistically analyzed. Based on the statistical distribution of the simulation results, calculate the calorie confidence interval and nutrient confidence interval for each candidate dietary plan; The calorie confidence interval and nutrient confidence interval are used as reliability indicators of the candidate dietary plan and are output to the user along with the candidate dietary plan.

[0121] Through the collaborative operation of the aforementioned modules, the personalized dietary energy optimization and matching system provided in this application can achieve dynamic and accurate dietary recommendations in scenarios such as personal health management, fitness diet planning, and chronic disease nutritional intervention. It can be integrated into mobile applications, smart kitchen equipment, or cloud service platforms, effectively improving the intelligence level of dietary planning. For the specific workflow and optimization details of this system, please refer to Example 1.

[0122] It should be noted that the order of the embodiments described above is merely for descriptive purposes and does not represent the superiority or inferiority of the embodiments. Furthermore, the above description focuses on specific embodiments of this specification. Additionally, the processes depicted in the accompanying drawings do not necessarily require a specific or sequential order to achieve the desired results. In some implementations, multitasking and parallel processing are possible or may be advantageous.

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

[0124] This specification and accompanying drawings are merely illustrative examples of this application and are intended to cover any and all modifications, variations, combinations, or equivalents within the scope of this application. Clearly, those skilled in the art can make various alterations and modifications to this application without departing from its scope. Therefore, if such modifications and modifications fall within the scope of this application and its equivalents, this application intends to include such modifications and modifications.

Claims

1. A personalized dietary energy optimization matching method, characterized in that, The method includes: Acquire multidimensional feature data of users, which includes at least the user's physiological parameters, health goals, daily nutrient intake data, and historical dietary behavior data; Based on the physiological parameters and health goals, calculate the user's daily energy requirement target and the energy supply ratio range of each macronutrient, and combine the daily nutrient intake data to generate a dynamic nutrient gap vector for the planned meals. Based on the historical dietary behavior data, construct a weight vector of user preferences for various types of food; Using the dynamic nutritional deficit vector as a constraint, and minimizing energy deviation and maximizing user preference as optimization objectives, a multi-objective optimization model is constructed to generate multiple candidate dietary plans. The multiple candidate dietary plans are output to the user terminal, the target plan selected by the user from the multiple candidate dietary plans is received, and the historical dietary behavior data is updated according to the target plan for subsequent preference weight vector iterative optimization.

2. The personalized dietary energy optimization matching method according to claim 1, characterized in that, Obtain multidimensional feature data of users, including: Obtain the user's physiological parameters, which include at least age, gender, height, weight, and basal metabolic rate; Obtain the user's health goals, which include at least one of fat loss, muscle gain, or weight maintenance; Obtain the user's daily nutrient intake data, which includes at least the daily calorie intake, protein intake, fat intake, and carbohydrate intake. Obtain the user's historical dietary behavior data, which includes at least the types of food, portion sizes, and timestamps of each meal throughout the history.

3. The personalized dietary energy optimization matching method according to claim 1, characterized in that, Based on the aforementioned physiological parameters and health goals, calculate the user's daily energy requirement target and the energy supply ratio range of each macronutrient, including: The total daily calorie requirement is calculated based on the calorie coefficient corresponding to the user's weight and health goals. The calorie coefficient is positively correlated with the user's daily activity level. Based on health goals, query the protein energy ratio range, fat energy ratio range, and carbohydrate energy ratio range from the preset nutrient energy ratio parameter database; Multiply the target total daily calorie requirement by the protein energy ratio range, fat energy ratio range, and carbohydrate energy ratio range, respectively, and then divide by the corresponding nutrient's calorie coefficient to obtain the daily protein requirement range, daily fat requirement range, and daily carbohydrate requirement range.

4. The personalized dietary energy optimization matching method according to claim 3, characterized in that, Based on the nutritional data ingested that day, a dynamic nutritional deficit vector for the planned meals is generated, including: Obtain the user's daily calorie, protein, fat, and carbohydrate intake; Subtracting the calories already consumed that day from the total daily calorie requirement target yields the calorie deficit value. For protein, the lower limit of the daily protein requirement range is subtracted from the protein already ingested that day to obtain the lower limit of the protein deficit. If the calculation result is negative, it is taken as 0. At the same time, the upper limit of the daily protein requirement range is subtracted from the protein already ingested that day to obtain the upper limit of the protein deficit. For fat, the lower limit of the daily fat requirement range is subtracted from the fat consumed that day to obtain the lower limit of the fat deficit. If the calculation result is negative, it is taken as 0. At the same time, the upper limit of the daily fat requirement range is subtracted from the fat consumed that day to obtain the upper limit of the fat deficit. For carbohydrates, the lower limit of the daily carbohydrate requirement range is subtracted from the carbohydrates consumed that day to obtain the lower limit of the carbohydrate deficit. If the result is negative, it is taken as 0. At the same time, the upper limit of the daily carbohydrate requirement range is subtracted from the carbohydrates consumed that day to obtain the upper limit of the carbohydrate deficit. The calorie deficit value, the lower and upper limits of the protein deficit, the lower and upper limits of the fat deficit, and the lower and upper limits of the carbohydrate deficit are combined to generate a dynamic nutritional deficit vector for the meals to be planned.

5. The personalized dietary energy optimization matching method according to claim 1, characterized in that, Based on the historical dietary behavior data, a user preference weight vector for various types of food is constructed, including: Obtain the dietary behavior history of multiple users, which includes at least user identifier, food identifier, frequency of consumption, and portion size; A user-food interaction matrix is ​​constructed using user identifiers and food identifiers as dimensions. The element values ​​in the user-food interaction matrix are the interaction intensity between the user and the food. The interaction intensity is positively correlated with the frequency of consumption and the amount of food consumed. The user-food interaction matrix is ​​decomposed using a matrix factorization algorithm to obtain user latent vectors and food latent vectors. The training objective of the matrix factorization is to minimize the reconstruction error of the user-food interaction matrix. For each type of food to be evaluated, the user's latent vector and the food's latent vector are multiplied by a dot product to obtain the user's preference weights for each type of food, and then combined to generate a preference weight vector.

6. The personalized dietary energy optimization matching method according to claim 1, characterized in that, Using the dynamic nutrient deficit vector as a constraint, and with the optimization objectives of minimizing energy deviation and maximizing user preference, a multi-objective optimization model is constructed to generate multiple candidate dietary plans, including: The system retrieves a set of candidate foods that the user can choose from in the current meal and obtains the nutritional data of each candidate food from a pre-built food nutrition knowledge base. The nutritional data includes at least the calories, protein content, fat content, and carbohydrate content per 100 grams. The feasible serving size boundaries for each candidate food are obtained from the food nutrition knowledge base, and the feasible serving size boundaries include at least the minimum serving size and the maximum serving size. Using the portion size of each candidate food as the decision variable, the calorie gap value in the dynamic nutrient gap vector as the equality constraint, the lower and upper limits of the protein gap, the lower and upper limits of the fat gap, and the lower and upper limits of the carbohydrate gap as the inequality constraint, and the feasible portion size boundary of each candidate food as the upper and lower limit constraints of the decision variable, a set of constraint conditions is constructed. A multi-objective optimization model is constructed with the optimization objectives of minimizing calorie deviation and maximizing preference score, wherein the preference score is the sum of the products of the preference weight of each candidate food and its corresponding portion size. The multi-objective optimization model is solved using a multi-objective optimization algorithm to generate multiple candidate solutions. Each candidate solution corresponds to a set of food portion combinations, which serve as candidate dietary plans.

7. The personalized dietary energy optimization matching method according to claim 6, characterized in that, The multi-objective optimization model is solved using a multi-objective optimization algorithm to generate multiple candidate solutions, including: Multiple candidate solutions are initialized in the decision variable space, and each candidate solution corresponds to a set of food portion combinations; Calculate the calorie deviation value and preference score for each candidate solution. The calorie deviation value is the absolute value of the difference between the actual calorie content and the calorie deficit value of the candidate solution. The preference score is the sum of the products of each food portion and its corresponding preference weight in the candidate solution. The candidate solutions are hierarchically sorted based on the heat deviation value and preference score to obtain multiple optimal candidate solution sets; The candidate solutions in the optimal candidate solution set are selected, crossovered, and mutated to generate a new generation of candidate solutions; Repeat the hierarchical sorting and evolutionary operations until the preset number of iterations is reached, and output multiple candidate solutions in the optimal candidate solution set as candidate dietary plans.

8. The personalized dietary energy optimization matching method according to claim 1, characterized in that, The system outputs the multiple candidate dietary plans to the user's terminal, receives the target plan selected by the user from the multiple candidate dietary plans, and updates the historical dietary behavior data according to the target plan, including: The multiple candidate dietary plans are output to the user terminal. Each candidate dietary plan includes at least the food type, recommended portion size, and corresponding predicted calorie and nutrient values. In response to the user's selection operation among the multiple candidate dietary plans, the user's selected target plan is obtained; Add the food types, suggested portion sizes, and current meal timestamp from the target plan to the user's historical dietary behavior data; Based on the updated historical dietary behavior data, the preference weight vector is recalculated for optimized matching of subsequent meals.

9. A personalized dietary energy optimization matching method according to claim 8, characterized in that, Before outputting the multiple candidate dietary plans to the user, the process also includes: The nutritional data of each food in the candidate dietary plan were superimposed with random perturbations, and multiple Monte Carlo simulations were performed. The distribution of calories and nutrients in the simulation results was statistically analyzed. Based on the statistical distribution of the simulation results, calculate the calorie confidence interval and nutrient confidence interval for each candidate dietary plan; The calorie confidence interval and nutrient confidence interval are used as reliability indicators of the candidate dietary plan and are output to the user along with the candidate dietary plan.

10. A personalized dietary energy optimization matching system, characterized in that, For implementing the personalized dietary energy optimization matching method according to any one of claims 1-9, the system comprises: The data acquisition module is used to acquire the user's multidimensional feature data, which includes at least the user's physiological parameters, health goals, daily nutrient intake data, and historical dietary behavior data. The target conversion module is used to calculate the user's daily energy demand target and the energy supply ratio range of each macronutrient based on the physiological parameters and health goals, and generate a dynamic nutritional gap vector of the meals to be planned by combining the nutritional data already ingested that day. The preference learning module is used to construct a user's preference weight vector for various types of food based on the historical dietary behavior data. The optimization engine module is used to construct a multi-objective optimization model with the dynamic nutritional deficit vector as a constraint, and with the optimization objectives of minimizing energy deviation and maximizing user preference, to solve and generate multiple candidate dietary plans. The solution output module is used to output the multiple candidate dietary solutions to the user terminal, receive the target solution selected by the user from the multiple candidate dietary solutions, and update the historical dietary behavior data according to the target solution for subsequent preference weight vector iterative optimization.