Diet plan decision-making method, device, computer equipment and storage medium
Through the sequential decision-making model of reinforcement learning, combined with the user's physiological state data, an automated diet execution plan is generated, which solves the problem of low efficiency of existing diet health management tools and achieves efficient diet plan planning and personalized diet suggestions.
Patent Information
- Application Number
- CN202110476903.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-04-29
- Publication Date
- 2024-09-06
- Estimated Expiration
- 2041-04-29
AI Technical Summary
Existing dietary health management tools cannot provide automated and efficient continuous dietary advice, resulting in low automation and low efficiency.
Using the sequential decision-making model of reinforcement learning, by obtaining the user's current and target physiological state data, calculating the physiological state changes under different execution actions, combining the execution actions to generate an execution plan, and selecting the target execution plan based on the reward value, outputting the daily execution Action and physiological state data.
It improves the planning efficiency of diet plans, helps users achieve the goal of achieving target physical status data within the execution cycle, and provides personalized diet plans.
Smart Images

Figure CN113077870B
Abstract
Description
Technical Field
[0001] The present application relates to the field of big data, and in particular to a method, device, computer equipment and storage medium for making decisions on a diet plan. Background Art
[0002] Health is an inevitable requirement for promoting the all-round development of people. People's demand for healthy diet is increasing year by year. The current diet health management tools can only identify and analyze the calories of food once and inform users of the calories of food. The inventors realized that the current diet health management tools cannot provide continuous diet advice, and the degree of automation and efficiency of diet advice are low. Summary of the invention
[0003] The main purpose of this application is to provide a method, device, computer equipment and storage medium for making a diet plan, aiming to solve the problems of low automation and efficiency of current diet recommendations.
[0004] In order to achieve the above-mentioned invention object, the present application proposes a decision-making method for a diet plan, comprising:
[0005] Obtaining the user's current physiological state data and target physiological state data;
[0006] Using the current physiological state data and the target physiological state data as inputs of a sequential decision-making model of reinforcement learning, and outputting a plurality of execution plans and a reward value of each execution plan based on the sequential decision-making model of reinforcement learning;
[0007] An execution plan that meets preset conditions is selected as a target execution plan according to the reward value, and the execution actions and physiological status data of each day included in the target execution plan are output.
[0008] Furthermore, the sequential decision model based on the reinforcement learning outputs a number of execution plans and a reward value for each execution plan, including:
[0009] Using the current physiological state data of the user as the physiological state data of the previous day;
[0010] Obtaining several execution actions from a preset database, and selecting one of the execution actions in turn as the execution action of the previous day;
[0011] The physiological state data of the previous day are calculated sequentially to execute the execution action of the previous day to obtain the physiological state data of the next day; until the execution action of the last day of the execution cycle is executed to obtain the result physiological state data;
[0012] Combining the associated execution actions of each day to generate a plurality of execution plans and result physiological state data corresponding to each of the execution plans;
[0013] The result physiological state data is compared with the target physiological state data to determine the reward values of different execution plans.
[0014] Furthermore, before obtaining a plurality of execution actions from a preset database and selecting one of the execution actions in turn as the execution action of the previous day, the method further includes:
[0015] Obtaining an execution cycle of a pre-output execution plan, and determining the execution difficulty according to the execution cycle;
[0016] According to the execution difficulty, several execution actions that meet the execution difficulty are obtained from a preset database.
[0017] Furthermore, after selecting an execution plan that meets the preset conditions as the target execution plan according to the reward value, the method further includes:
[0018] Match users with target users who have the same target execution plan;
[0019] An association relationship between the user and the target user is established, and based on the association relationship, progress information and reference data information of the target user's target execution plan are pushed to the user.
[0020] Furthermore, the execution action includes diet information, and the diet information includes food types; the output of the execution action for each day included in the target execution plan includes:
[0021] Obtain users’ regional characteristics and eating habits;
[0022] Matching target food types according to the regional characteristics and eating habits;
[0023] The food types in the dietary information of the execution action are replaced with the target food types.
[0024] Further, the execution action includes diet information, the execution action includes diet information, and the diet information includes food types; the output of the execution action for each day included in the target execution plan includes:
[0025] Get the type of food to be replaced selected by the user;
[0026] Matching a target food type with equivalent calorie information according to the calorie information of the food type to be replaced;
[0027] The food type to be replaced in the dietary information of the execution action is replaced with the target food type.
[0028] Furthermore, after selecting an execution plan that meets the preset conditions as a target execution plan according to the reward value, and outputting the execution actions and physiological state data of each day included in the target execution plan, it also includes:
[0029] The target execution plan is sent to a preset supervisor.
[0030] The present application also provides a decision-making device for a diet plan, comprising:
[0031] Data acquisition module: used to obtain the user's current physiological state data and target physiological state data;
[0032] A plan generation module: used to use the current physiological state data and the target physiological state data as inputs of a sequential decision model of reinforcement learning, and output a plurality of execution plans and a reward value of each execution plan based on the sequential decision model of reinforcement learning;
[0033] Plan output module: used to select an execution plan that meets preset conditions as a target execution plan according to the reward value, and output the execution actions and physiological status data of each day included in the target execution plan.
[0034] The present application also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of any of the above-mentioned methods for deciding on a diet plan when executing the computer program.
[0035] The present application also provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the steps of any of the above-mentioned methods for making decisions on a diet plan.
[0036] The present application example provides a decision-making method for a long-term diet plan. In a diet management scenario, the user's current physiological state data and target physiological state data are obtained, and the current physiological state data and target physiological state data are used as inputs of a sequential decision model of reinforcement learning. The sequential decision model of reinforcement learning can calculate the user's physiological state data of the previous day and the physiological state data of the next day under different execution actions, and use this to calculate the physiological state data after executing the execution actions of each day in a preset period, and then combine the different execution actions of each day in the preset period as an execution plan, and use the physiological state data of the last day of an execution plan as the result physiological state data of the execution plan, and then compare the result physiological state data with the target physiological state data to obtain the reward value of each execution plan, select a target execution plan that meets the conditions according to the reward value, and output the execution actions and physiological state data contained in the target execution plan. The user can complete the daily diet according to the execution actions, thereby outputting the diet data of the long-term plan, improving the planning efficiency of the diet plan, and helping the user achieve the purpose of achieving the target body state data within the execution cycle. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] Figure 1 A flowchart of an embodiment of a method for making a decision on a diet plan in the present application;
[0038] Figure 2 A flowchart of another embodiment of the decision-making method for a diet plan of the present application;
[0039] Figure 3 This is a schematic diagram of the structure of an embodiment of a decision-making device for a diet plan of the present application;
[0040] Figure 4 This is a schematic block diagram of the structure of an embodiment of a computer device of the present application.
[0041] The realization of the purpose, functional features and advantages of this application will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0042] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0043] Reference Figure 1 An embodiment of the present application provides a method for making a diet plan, including steps S10-S30. The detailed description of each step of the method for making a diet plan is as follows.
[0044] S10. Obtaining the user's current physiological state data and target physiological state data.
[0045] This embodiment is applied to the scenario of diet management. In the diet management scenario, the user needs to develop from his current physical state to the target physical state, and the physical state is represented by a series of quantifiable data, including height, weight, gender, age, vital capacity, bounce, measurements, body fat percentage and other data, and the physical state is defined by multiple different physiological state data; in one embodiment, the user can input his current physical state information, or obtain the user's current physical state information through a specific measuring tool, and define the current physical state information as current physiological state data, thereby obtaining the user's current physiological state data, for example, by obtaining the user's height, weight, vital capacity, bounce, measurements, body fat percentage and other data measured by the measuring tool, and then generating the user's current physiological state data. In addition, it is also necessary to determine the physical state that the user wants to achieve, that is, to obtain the user's target physiological state data. In one embodiment, the user's target physiological state data can be input by the user himself, and the user enters his own target physiological state data for each item of physiological state data, thereby obtaining the user's target physiological state data; it can also be based on certain items of the user's current physiological state data, and then based on the certain items of current physiological state data, obtain physiological state data that meets the physiological health standards as the target physiological state data, thereby obtaining the user's target physiological state data.
[0046] S20. Using the current physiological state data and the target physiological state data as inputs of a sequential decision-making model of reinforcement learning, and outputting a plurality of execution plans and a reward value for each execution plan based on the sequential decision-making model of reinforcement learning.
[0047] In this embodiment, after obtaining the user's current physiological state data and target physiological state data, it is necessary to generate an execution plan for the user to achieve the target physiological state data based on the current physiological state data and the target physiological state data. Specifically, this embodiment constructs a sequential decision-making model of reinforcement learning, which can simulate the human body performing different execution actions under the physiological state data of the previous day to obtain the physiological state data of the next day.
[0048] The sequential decision model of reinforcement learning is constructed by the following steps, including:
[0049] Acquire physiological indicator state quantities according to the model configuration information, and acquire physiological indicator state quantities of different users as first training data;
[0050] Acquire execution action state quantities according to the model configuration information, and acquire combinations of different execution action state quantities as second training data;
[0051] Substituting the first training data and the second training data into a human metabolism formula to perform model training, calculating human metabolism results under different execution actions, and returning a reward value according to the human metabolism results;
[0052] Iterative optimization is performed based on each reward value, so that the model optimizes learning in the direction of the maximum reward value, generating a sequential decision-making model for reinforcement learning.
[0053] According to the model configuration information, the physiological indicator state quantity and the execution action state quantity are obtained, and the model configuration information includes the definition and quantification standards of different physiological indicators, and also includes the definition and quantification standards of different execution actions. Then, according to the configuration information, the physiological indicator state quantity and the execution action state quantity are defined, and each physiological indicator state is numerically quantified, and each execution action is numerically quantified. After the above elements are defined, the physiological indicator state quantity of different users is obtained as the first training data, and the combination of different execution action state quantities is obtained as the second training data. The first training data and the second training data are substituted into the human body metabolism formula for model training, and the process of multiple human body-environment interactions is simulated. Each time the human body interacts, the human body calculates the human body metabolism results under different execution actions through the model, and returns the reward value according to the human body metabolism result. The best reward value is selected and executed, and iterative optimization is performed based on each reward value, so that the model optimizes learning in the direction of the maximum reward value, and a sequential decision model of reinforcement learning is generated.
[0054] Specifically, the sequential decision model of reinforcement learning first obtains the user's current physiological state data, then obtains several execution actions for each day from a preset database, the several execution actions for each day are different, then calculates the physiological state data of the next day after the user's current physiological state data executes different execution plans, then records the current physiological state data and the physiological state data of the next day, and then uses the "physiological state data of the next day" as the new "current physiological state data", and then obtains several execution actions for each day, calculates the physiological state data of the next day, and so on, when the execution actions of the preset cycle are executed from the current state data, the preset cycle is the preset number of planned days from the current state data to the target state data, different result physiological state data can be obtained, and then the different execution actions of each day in the preset cycle are combined as an execution plan, and then the reward value of the execution plan is determined according to the difference between the result physiological state data and the target physiological state data of each execution plan. When the difference between the result physiological state data and the target physiological state data is smaller, the reward value is larger; when the difference is larger, the reward value is smaller.
[0055] For example, the physiological state data of the user on the first day is A, the execution action obtained is D1, the physiological state data of the second day obtained after executing D1 is A1, and then the execution action D2 is obtained, and the physiological state data of the second day obtained after executing D2 is A2, and all the execution actions of the preset cycle are executed in sequence until the execution action Dx of the last day of the preset cycle is executed, and the result physiological state data Ax is obtained. D1, D2-Dx form an execution plan, and then the result physiological state data Ax is compared with the target physiological state data to determine the reward value of the execution plan. When the difference is smaller, the reward value is larger; when the difference is larger, the reward value is smaller.
[0056] S30, selecting an execution plan that meets preset conditions as a target execution plan according to the reward value, and outputting the execution actions and physiological status data of each day included in the target execution plan.
[0057] In this embodiment, after obtaining several execution plans, an execution plan that meets the preset conditions is selected according to the reward value. The size of the reward value determines the difference between the result physiological state data of different execution plans and the target physiological state data, and then the execution plan whose reward value meets the preset conditions is selected as the target execution plan. In one embodiment, the execution plan with the largest reward value is selected as the target execution plan, and then the execution actions contained in the target execution plan are output. Each execution plan contains the execution actions for each day in the execution cycle. The execution actions include dietary information and dietary execution information, and the physiological state data of the user is also output for each day. After outputting the execution actions and physiological state data for each day contained in the target execution plan, the user can determine his or her own execution actions for each day according to the target execution plan, that is, determine the dietary information and dietary execution information for each day. The dietary information includes ingredients, portions and methods. The dietary execution information includes dietary time points and dietary duration. The user can complete the daily diet combination according to the execution actions, thereby helping the user achieve the purpose of achieving the target physical state data within the execution cycle.
[0058] The present embodiment provides a decision method for a long-term diet plan. In a diet management scenario, the current physiological state data and target physiological state data of the user are obtained, and the current physiological state data and target physiological state data are used as inputs of a sequential decision model of reinforcement learning. The sequential decision model of reinforcement learning can calculate the physiological state data of the user on the previous day and the physiological state data of the next day under different execution actions, and use this to calculate the physiological state data after executing the execution actions of each day in a preset period, and then combine different execution actions of each day in the preset period as an execution plan, and use the physiological state data of the last day of an execution plan as the result physiological state data of the execution plan, and then compare the result physiological state data with the target physiological state data to obtain the reward value of each execution plan, select a target execution plan that meets the conditions according to the reward value, and output the execution actions and physiological state data included in the target execution plan. The user can complete the daily diet according to the execution actions, thereby outputting the diet data of the long-term plan, improving the planning efficiency of the diet plan, and helping the user achieve the purpose of achieving the target body state data within the execution cycle.
[0059] In one embodiment, Figure 2 As shown, the sequential decision model based on the reinforcement learning outputs several execution plans and the reward value of each execution plan, including:
[0060] S21: using the current physiological state data of the user as the physiological state data of the previous day;
[0061] S22: obtaining a plurality of execution actions from a preset database, and selecting one of the execution actions in turn as the execution action of the previous day;
[0062] S23: sequentially calculating the physiological state data of the previous day and executing the execution action of the previous day to obtain the physiological state data of the next day; until the execution action of the last day of the execution cycle is executed to obtain the result physiological state data;
[0063] S24: combining the associated execution actions of each day to generate a plurality of execution plans and result physiological state data corresponding to each of the execution plans;
[0064] S25: Compare the result physiological state data with the target physiological state data to determine the reward values of different execution plans.
[0065] In this embodiment, the sequential decision model of reinforcement learning first obtains the user's current physiological state data, and uses the user's current physiological state data as the physiological state data of the previous day, where the previous day is the day before the next day. Specifically, the user's current physiological state data is used as the physiological state data of the first day, and several execution actions are obtained from a preset database, wherein the several execution actions are all different, and one execution action is selected in turn as the execution action of the previous day, and the physiological state data of the previous day is calculated in turn to execute the execution action of the previous day to obtain the physiological state data of the next day; until the execution action of the last day of the execution cycle is executed to obtain the result physiological state data. Since the execution plan starts from the first day, first select an execution action as the execution action of the first day, then calculate the physiological state data of the first day to execute the execution action of the first day, and obtain the physiological state data of the second day, then select another execution action as the execution action of the second day, calculate the physiological state data of the second day to execute the execution action of the second day, and obtain the physiological state data of the third day; and so on, until the execution action of the last day of the execution cycle is executed to obtain the result physiological state data; then combine the execution actions of each day that are related to each other to generate several execution plans and corresponding result physiological state data, and the execution actions of each day that are related to each other refer to the combination of different execution actions, for example, the execution actions include D1a, D1b, and D1c. After D1a is executed on the first day, D1c is executed on the second day, then D1a and D1c are related execution actions; if D1b is executed on the first day and D1c is executed on the second day, then D1b and D1c are related execution actions.
[0066] Among them, one implementation method of calculating the change of physiological state data after executing the execution action is as follows:
[0067] Total daily energy consumption of the human body = 0.95* daily basal metabolic consumption*PAL;
[0068] Where: Daily basal metabolic energy expenditure = BMR (kcal / m^2 / h)*24H*body surface area;
[0069] PAL (Physical Activity Level) is the total energy consumption in 24 hours divided by the energy consumed by basal metabolism in 24 hours. Basal metabolic rate (BMR) refers to the basal metabolic energy consumed by the human body per square meter of body surface area per unit time. The unit is kcal / m^2 / h. Furthermore, men's basal metabolic rate Men BMR = 66.4730 + (13.7516 x weight in kg) + (5.0033 x height in cm) – (6.7550 x age in years); women's basal metabolic rate Women BMR = 655.0955 + (9.5634 x weight in kg) + (1.8496 x height in cm) – (4.6756 x age in years); body surface area (m^2) = 0.00659 * height (cm) + 0.0126 * weight (kg) - 0.1603; finally: (energy intake by the human body - energy consumption by the human body) / conversion ratio = changes in human physiological state data (weight), the scientifically calculated conversion value is 3889 calories / kg.
[0070] After obtaining each execution plan and its resulting physiological data, the resulting physiological state data is compared with the target physiological state data to determine the reward values of different execution plans. When the difference is smaller, it means that the resulting physiological data is closer to the target physiological state data, and the reward value of this execution plan is larger; when the difference is larger, it means that the gap between the resulting physiological data and the target physiological state data is larger, and the reward value of this execution plan is smaller. By combining different execution actions, the execution plan with the largest reward value within a preset period can be obtained through continuous combination, so that the resulting physiological state data of the execution plan is closer to the target physiological state data.
[0071] In one embodiment, before obtaining a plurality of execution actions from a preset database and selecting one of the execution actions in turn as the execution action of the previous day, the method further includes:
[0072] Obtaining an execution cycle of a pre-output execution plan, and determining the execution difficulty according to the execution cycle;
[0073] According to the execution difficulty, several execution actions that meet the execution difficulty are obtained from a preset database.
[0074] In this embodiment, in a specific application scenario, in order to quickly achieve the physical state to the target physical state data, it is necessary to achieve the physical state to the target physical state data in a shorter execution cycle. At this time, it is necessary to increase the execution difficulty of the execution action, that is, the greater the change value of the physiological state data of each day in the execution plan is from the average value, the higher the execution difficulty of the execution action on that day, and the greater the execution difficulty of the execution plan. Specifically, the execution cycle of the pre-output execution plan is obtained, the execution difficulty of the execution action is determined according to the execution cycle, and then according to the execution difficulty, several execution actions that meet the execution difficulty are obtained from a preset database, so that the selected execution action can meet the execution difficulty, avoiding the execution difficulty difference before and after each execution action in the execution plan is too large, thereby improving the rationality of the execution plan. Furthermore, the execution cycle can be continuously adjusted, but a safety value of the execution cycle is set, and then the reward values of several execution plans under different execution cycles are calculated based on the sequential decision model of reinforcement learning, and the execution plans of different execution cycles are determined, so as to provide the user with a time reference for achieving the target physical state data. For example, in a scenario of a specific weight level, the user needs to reach a certain weight level within a specific time, so the execution cycle of the execution plan can be obtained, and then the execution difficulty of the execution action can be determined, so that the user's physical state data reaches a certain weight level within a specific time.
[0075] In one embodiment, after selecting an execution plan that meets the preset conditions as the target execution plan according to the reward value in step S30, the method further includes:
[0076] Match users with target users who have the same target execution plan;
[0077] An association relationship between the user and the target user is established, and based on the association relationship, progress information and reference data information of the target user's target execution plan are pushed to the user.
[0078] In this embodiment, after the user selects a target execution plan that meets the preset conditions according to the reward value, in order to allow users with the same target execution plan to learn from or motivate each other, the user is matched with a target user with the same target execution plan, and then an association relationship between the user and the target user is established and contact information is pushed. Establishing an association between the user and the target user can enable the user to understand the target user's target plan execution progress. The target users include users who are already carrying out a target execution plan. Based on the association, progress information and reference data information of the target user's target execution plan are pushed to the user. The user can observe the changes in the target user's physical condition data every day after the target user carries out the same target execution plan, and thus understand the changes in his or her own physical condition data in advance based on the target user's reference data information, so that the user can more clearly understand the implementation effect of the target execution plan.
[0079] In one embodiment, the execution action includes diet information, and the diet information includes food types; the output of the execution action for each day included in the target execution plan includes:
[0080] Obtain users’ regional characteristics and eating habits;
[0081] Matching target food types according to the regional characteristics and eating habits;
[0082] The food types in the dietary information of the execution action are replaced with the target food types.
[0083] In this embodiment, the execution action includes dietary information, and the dietary information includes food types, that is, the execution plan includes daily dietary plan information. Considering that users in different regions have different dietary habits, when outputting the target execution plan, the user's regional characteristics and dietary habits are obtained. The user's regional characteristics and dietary habits can be matched through big data, and the dietary habits of users in different regions are determined based on big data. Then, the target food types are matched according to the regional characteristics and dietary habits, and the food types of the execution action in the target execution plan are replaced with the target food types. Different food types can be matched for different users, meeting the needs of users with different regional characteristics and dietary habits, and improving the rationality of dietary data matching. For example, when the lunch calorie content of the dietary information in the execution action is 50K, the target food type matched according to the dietary habits of users in region A is food S1, and the target food type matched for users in region B is food S2.
[0084] In one embodiment, the execution action includes diet information, and the diet information includes food types; the output of the execution action for each day included in the target execution plan includes:
[0085] Get the type of food to be replaced selected by the user;
[0086] Matching a target food type with equivalent calorie information according to the calorie information of the food type to be replaced;
[0087] The food type to be replaced in the dietary information of the execution action is replaced with the target food type.
[0088] In this embodiment, users in different regions or with different dietary habits have different preferences for diet. When outputting the target execution plan and the execution actions for each day contained in the target execution plan, if the user wants to replace a certain type of food, the type of food to be replaced selected by the user is obtained, and then the type of food to be replaced for the execution actions for each day contained in the target execution plan is obtained, and then the target food type with equivalent calorie information is matched according to the calorie information of the food type to be replaced, and the food type to be replaced in the dietary information of the execution action is replaced with the target food type. The food types in the user's dietary information can be replaced according to their own preferences, so that the dietary information in the target execution plan is more personalized and meets the needs of different users. Optionally, after selecting a certain type of food to be replaced, you can choose to replace partly or completely. Partial replacement means selecting a certain time period in the execution plan that contains the food type to be replaced and replacing it with the target type of food, and complete replacement means replacing all the food types to be replaced in the execution plan with the target type of food, so as to meet the dietary needs of different users.
[0089] In one embodiment, the step S30 selects an execution plan that meets preset conditions as a target execution plan according to the reward value, and outputs the execution actions and physiological state data of each day included in the target execution plan, and further includes:
[0090] The target execution plan is sent to a preset supervisor.
[0091] In this embodiment, after obtaining the user's target execution plan, in order to allow the user to better perform daily dietary intake according to the target execution plan, the target execution plan is sent to the preset supervisor, and the preset supervisor is notified to provide the user with diet according to the target execution plan, thereby helping the user to achieve the target physiological state data within the preset period. In an application scenario such as a confinement scenario, after determining the target execution plan based on each user's different current physiological state and target physiological state data, the target execution plan is sent to the preset supervisor, so that the preset supervisor can prepare for the user's daily diet according to the target execution plan, ensuring the dietary regularity and the user's physical state data during the confinement period.
[0092] Reference Figure 3 The present application also provides a dietary plan decision-making device, comprising:
[0093] Data acquisition module 10: used to acquire the user's current physiological state data and target physiological state data;
[0094] A plan generation module 20 is used to use the current physiological state data and the target physiological state data as inputs of a sequential decision model of reinforcement learning, and output a plurality of execution plans and a reward value of each execution plan based on the sequential decision model of reinforcement learning;
[0095] The plan output module 30 is used to select an execution plan that meets the preset conditions as a target execution plan according to the reward value, and output the execution actions and physiological status data of each day included in the target execution plan.
[0096] As described above, it can be understood that the various components of the diet plan decision-making device proposed in the present application can realize the functions of any of the diet plan decision-making methods described above.
[0097] In one embodiment, the plan generation module 20 further includes executing:
[0098] Using the current physiological state data of the user as the physiological state data of the previous day;
[0099] Obtaining several execution actions from a preset database, and selecting one of the execution actions in turn as the execution action of the previous day;
[0100] The physiological state data of the previous day are calculated sequentially to execute the execution action of the previous day to obtain the physiological state data of the next day; until the execution action of the last day of the execution cycle is executed to obtain the result physiological state data;
[0101] Combining the associated execution actions of each day to generate a plurality of execution plans and result physiological state data corresponding to each of the execution plans;
[0102] The result physiological state data is compared with the target physiological state data to determine the reward values of different execution plans.
[0103] In one embodiment, the plan generation module 20 further includes executing:
[0104] Obtaining an execution cycle of a pre-output execution plan, and determining the execution difficulty according to the execution cycle;
[0105] According to the execution difficulty, several execution actions that meet the execution difficulty are obtained from a preset database.
[0106] In one embodiment, the device also includes a matching module for matching a target user with the same target execution plan for the user; establishing an association relationship between the user and the target user, and pushing progress information and reference data information of the target user's target execution plan to the user based on the association relationship.
[0107] In one embodiment, the plan output module 30 further includes executing:
[0108] Obtain users’ regional characteristics and eating habits;
[0109] Matching target food types according to the regional characteristics and eating habits;
[0110] The food types in the dietary information of the execution action are replaced with the target food types.
[0111] In one embodiment, the plan output module 30 further includes executing:
[0112] Get the type of food to be replaced selected by the user;
[0113] Matching a target food type with equivalent calorie information according to the calorie information of the food type to be replaced;
[0114] The food type to be replaced in the dietary information of the execution action is replaced with the target food type.
[0115] In one embodiment, the device further comprises a supervision module for sending the target execution plan to a preset supervisor.
[0116] Reference Figure 4 In the embodiment of the present application, a computer device is also provided. The computer device may be a mobile terminal, and its internal structure may be as follows: Figure 4 As shown. The computer device includes a processor, a memory, a network interface, a display device and an input device connected through a system bus. Among them, the network interface of the computer device is used to communicate with an external terminal through a network connection. The input device of the computer device is used to receive user input. The processor designed by the computer is used to provide computing and control capabilities. The memory of the computer device includes a storage medium. The storage medium stores an operating system, a computer program and a database. The database of the computer device is used to store data. When the computer program is executed by the processor, a decision method for a diet plan is implemented.
[0117] The processor executes the above-mentioned diet plan decision-making method, including: obtaining the user's current physiological state data and target physiological state data; using the current physiological state data and target physiological state data as inputs of a sequential decision model of reinforcement learning, and outputting a number of execution plans and reward values for each execution plan based on the sequential decision model of reinforcement learning; selecting a target execution plan that meets preset conditions according to the reward value, and outputting the execution actions and physiological state data for each day contained in the target execution plan.
[0118] The computer device provides a decision method for a long-term diet plan. In a diet management scenario, the current physiological state data and target physiological state data of the user are obtained, and the current physiological state data and target physiological state data are used as inputs of a sequential decision model of reinforcement learning. The sequential decision model of reinforcement learning can calculate the physiological state data of the user on the previous day and the physiological state data of the next day under different execution actions, and use this to calculate the physiological state data after executing the execution actions of each day in a preset period, and then combine different execution actions of each day in the preset period as an execution plan, and use the physiological state data of the last day of an execution plan as the result physiological state data of the execution plan, and then compare the result physiological state data with the target physiological state data to obtain the reward value of each execution plan, select a target execution plan that meets the conditions according to the reward value, and output the execution actions and physiological state data included in the target execution plan. The user can complete the daily diet according to the execution actions, thereby outputting the diet data of the long-term plan, improving the planning efficiency of the diet plan, and helping the user achieve the purpose of achieving the target body state data within the execution cycle.
[0119] An embodiment of the present application also provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by the processor, a method for making a diet plan decision is implemented, comprising the steps of: obtaining current physiological state data and target physiological state data of a user; using the current physiological state data and target physiological state data as inputs of a sequential decision model of reinforcement learning, and outputting a plurality of execution plans and a reward value for each execution plan based on the sequential decision model of reinforcement learning; selecting a target execution plan that meets preset conditions according to the reward value, and outputting the execution actions and physiological state data for each day contained in the target execution plan.
[0120] The computer-readable storage medium provides a decision-making method for a long-term diet plan. In a diet management scenario, the current physiological state data and target physiological state data of the user are obtained, and the current physiological state data and target physiological state data are used as inputs of a sequential decision model of reinforcement learning. The sequential decision model of reinforcement learning can calculate the physiological state data of the user on the previous day and the physiological state data of the next day under different execution actions, and use this to calculate the physiological state data after executing the execution actions of each day in a preset period, and then combine different execution actions of each day in the preset period as an execution plan, and use the physiological state data of the last day of an execution plan as the result physiological state data of the execution plan, and then compare the result physiological state data with the target physiological state data to obtain the reward value of each execution plan, select a target execution plan that meets the conditions according to the reward value, and output the execution actions and physiological state data contained in the target execution plan. The user can complete the daily diet according to the execution actions, thereby outputting the diet data of the long-term plan, improving the planning efficiency of the diet plan, and helping the user achieve the purpose of achieving the target body state data within the execution cycle.
[0121] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be implemented by instructing related hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods.
[0122] Any reference to memory, storage, database, or other media provided in this application and used in the embodiments may include non-volatile and / or volatile memory.
[0123] Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double-speed data rate SDRAM (SSRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0124] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, device, article or method including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, device, article or method. In the absence of further restrictions, an element defined by the sentence "includes a ..." does not exclude the existence of other identical elements in the process, device, article or method including the element.
[0125] The above description is only a preferred embodiment of the present application and does not limit the patent scope of the present application.
[0126] Any equivalent structure or equivalent process transformation made using the contents of the description and drawings of this application, or directly or indirectly applied in other related technical fields, are similarly included in the scope of patent protection of this application.
Claims
1. A method for making a dietary plan, characterized in that: include: Obtaining the user's current physiological state data and target physiological state data; Using the current physiological state data and the target physiological state data as inputs of a sequential decision-making model of reinforcement learning, and outputting a plurality of execution plans and a reward value of each execution plan based on the sequential decision-making model of reinforcement learning; Selecting an execution plan that meets preset conditions as a target execution plan according to the reward value, and outputting the execution actions and physiological status data of each day included in the target execution plan; The sequential decision model of reinforcement learning is constructed by the following steps, including: Acquire physiological indicator state quantities according to the model configuration information, and acquire physiological indicator state quantities of different users as first training data; Acquire execution action state quantities according to the model configuration information, and acquire combinations of different execution action state quantities as second training data; Substituting the first training data and the second training data into a human metabolism formula to perform model training, calculating human metabolism results under different execution actions, and returning a reward value according to the human metabolism results; Iterative optimization is performed based on each reward value, so that the model optimizes learning in the direction of the maximum reward value, generating a sequential decision model for reinforcement learning; The sequential decision model based on the reinforcement learning outputs a number of execution plans and a reward value for each execution plan, including: Using the current physiological state data of the user as the physiological state data of the previous day; Obtaining several execution actions from a preset database, and selecting one of the execution actions in turn as the execution action of the previous day; The physiological state data of the previous day are calculated sequentially to execute the execution action of the previous day to obtain the physiological state data of the next day; until the execution action of the last day of the execution cycle is executed to obtain the result physiological state data; Combining the associated execution actions of each day to generate a plurality of execution plans and result physiological state data corresponding to each of the execution plans; Comparing the result physiological state data with the target physiological state data to determine the reward values of different execution plans; The execution action includes diet information, and the diet information includes food types; the output of the execution action for each day included in the target execution plan includes: Obtain users’ regional characteristics and eating habits; Matching target food types according to the regional characteristics and eating habits; The food types in the dietary information of the execution action are replaced with the target food types.
2. The method for making a dietary plan according to claim 1, characterized in that: Before obtaining a plurality of execution actions from a preset database and selecting one of the execution actions in turn as the execution action of the previous day, the method further includes: Obtaining an execution cycle of a pre-output execution plan, and determining the execution difficulty according to the execution cycle; According to the execution difficulty, several execution actions that meet the execution difficulty are obtained from a preset database.
3. The method for making a dietary plan according to claim 1, characterized in that: After selecting the execution plan that meets the preset conditions as the target execution plan according to the reward value, the method further includes: Match users with target users who have the same target execution plan; An association relationship between the user and the target user is established, and based on the association relationship, progress information and reference data information of the target user's target execution plan are pushed to the user.
4. The method for making a dietary plan according to claim 1, characterized in that: The execution action includes dietary information, and the dietary information includes food types; The output of the target execution plan includes the following execution actions for each day: Get the type of food to be replaced selected by the user; Matching a target food type with equivalent calorie information according to the calorie information of the food type to be replaced; The food type to be replaced in the dietary information of the execution action is replaced with the target food type.
5. The method for making a dietary plan according to claim 1, characterized in that: The method further includes: selecting an execution plan that meets the preset conditions as a target execution plan according to the reward value, and outputting the execution actions and physiological state data of each day included in the target execution plan. The target execution plan is sent to a preset supervisor.
6. A dietary plan decision-making device, characterized in that: A method for implementing a dietary plan decision according to any one of claims 1 to 5, the device comprising: Data acquisition module: used to obtain the user's current physiological state data and target physiological state data; A plan generation module: used to use the current physiological state data and the target physiological state data as inputs of a sequential decision model of reinforcement learning, and output a plurality of execution plans and a reward value of each execution plan based on the sequential decision model of reinforcement learning; A plan output module is used to select an execution plan that meets preset conditions as a target execution plan according to the reward value, and output the execution actions and physiological state data of each day included in the target execution plan; The sequential decision model of reinforcement learning is constructed by the following steps, including: Acquire physiological indicator state quantities according to the model configuration information, and acquire physiological indicator state quantities of different users as first training data; Acquire execution action state quantities according to the model configuration information, and acquire combinations of different execution action state quantities as second training data; Substituting the first training data and the second training data into a human metabolism formula to perform model training, calculating human metabolism results under different execution actions, and returning a reward value according to the human metabolism results; Iterative optimization is performed based on each reward value, so that the model optimizes learning in the direction of the maximum reward value, generating a sequential decision-making model for reinforcement learning.
7. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: When the processor executes the computer program, the steps of the method for deciding a diet plan according to any one of claims 1 to 5 are implemented.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method for deciding a diet plan according to any one of claims 1 to 5 are implemented.
