WO2020147558A1 - Method and device for pushing food information, and storage medium - Google Patents
Method and device for pushing food information, and storage medium Download PDFInfo
- Publication number
- WO2020147558A1 WO2020147558A1 PCT/CN2019/129427 CN2019129427W WO2020147558A1 WO 2020147558 A1 WO2020147558 A1 WO 2020147558A1 CN 2019129427 W CN2019129427 W CN 2019129427W WO 2020147558 A1 WO2020147558 A1 WO 2020147558A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- food
- combination
- recommended amount
- adjusted
- food combination
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Ceased
Links
Images
Classifications
-
- G—PHYSICS
- G16—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR SPECIFIC APPLICATION FIELDS
- G16H—HEALTHCARE INFORMATICS, i.e. INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR THE HANDLING OR PROCESSING OF MEDICAL OR HEALTHCARE DATA
- G16H20/00—ICT specially adapted for therapies or health-improving plans, e.g. for handling prescriptions, for steering therapy or for monitoring patient compliance
- G16H20/60—ICT specially adapted for therapies or health-improving plans, e.g. for handling prescriptions, for steering therapy or for monitoring patient compliance relating to nutrition control, e.g. diets
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/50—Network services
- H04L67/55—Push-based network services
Definitions
- This application relates to the field of diet, and specifically to a method and device for pushing food information, and a storage medium.
- the embodiments of the present application provide a method, a device, and a storage medium for pushing food information, so as to at least solve the problem in the related art that the intake of calories and nutrients cannot be taken into consideration at the same time for food matching.
- a method for pushing food information includes: obtaining a first recommended amount of calories required by a target object per unit time and a second recommended amount of nutrients required by the target object; The set determines a target food combination that matches the first recommended amount and the second recommended amount; and pushes the target food combination to a target terminal.
- a food information pushing device including: a first acquisition module configured to acquire the first recommended amount of calories required by a target object per unit time and the first recommended amount of nutrients required 2. Recommended amount; a determining module, configured to determine a target food combination matching the first recommended amount and the second recommended amount in the food information collection; a pushing module, configured to push the target food combination to a target terminal.
- a storage medium in which a computer program is stored, wherein the computer program is configured to execute the method described in the method for pushing food information when running.
- the first recommended amount of calories required by the target object per unit time and the second recommended amount of nutrients needed are obtained, and then the first recommended amount and the second recommended amount are determined according to the predetermined food information set Match the target food combination, and push the target food combination to the target terminal, that is, the pushed target food combination is obtained according to the first recommended amount of calories and the second recommended amount of nutrients, so that it can push more for the target object Reasonable food combination, rather than choosing the corresponding food according to personal preference, solves the problem that related technologies fail to take into account the intake of calories and nutrients at the same time to consider food matching, and achieves the effect of making the user's diet more reasonable.
- Fig. 1 is a flowchart of a method for pushing diet information according to an embodiment of the present application
- Fig. 2 is a flowchart of a method for displaying diet information according to an embodiment of the present application
- Fig. 3 is a schematic structural diagram of a device for pushing diet information according to an embodiment of the present application
- Fig. 4 is a schematic diagram of the results of the display device for diet information according to an embodiment of the present application.
- the food information collection described in this application refers to a collection that contains a variety of food names and categories of various foods; further, the food information collection may also include the origin, price, time of sale, and efficacy of various foods (such as lowering blood pressure, lowering blood fat, lowering cholesterol, etc.), purine content, glycemic index and other information.
- FIG. 1 is a flowchart of a method for pushing diet information according to an embodiment of the present application. As shown in FIG. 1, the process includes the following steps:
- Step S102 obtaining the first recommended amount of calories required by the target object per unit time and the second recommended amount of nutrients required by the target object;
- Step S104 Determine a target food combination matching the first recommended amount and the second recommended amount according to the predetermined food information set;
- Step S106 Push the target food combination to the target terminal.
- the first recommended amount of calories required by the target object per unit time and the second recommended amount of nutrients needed are obtained, and then the sum of the first recommended amount and the first recommended amount are determined according to the predetermined food information set.
- the target food combination that matches the second recommended amount and push the target food combination to the target terminal, that is, the pushed target food combination is obtained according to the first recommended amount of calories and the second recommended amount of nutrients, so that it can be
- the target object pushes a more reasonable food combination, rather than choosing the corresponding food according to personal preferences, thus solving the problem of not taking into account the intake of calories and nutrients at the same time in the related technology to consider food matching, and achieving a more reasonable diet for users effect.
- the execution subject of the method steps involved in this embodiment may be a server or a terminal, where the terminal includes: a mobile phone, a tablet computer, and other devices.
- the first recommended amount of heat required per unit time involved in step S102 of this embodiment can be obtained according to an anthropometric method in an optional implementation of this embodiment.
- an anthropometric method is based on the target The subject’s personal information and estimated exercise intensity are obtained.
- the anthropometric method uses 1 day as an example. The specific method is as follows:
- the personal information of the target object includes but is not limited to: age, gender, height, weight, estimated exercise intensity; the personal information of the target object may further include characteristic information, including but not limited to current season, hometown, and usual residence , Current location, taste, physical condition, price requirements, etc.; the physical condition includes, but is not limited to: whether you have chronic diseases such as gout, diabetes, and/or hypertension.
- the anthropometric method includes the following formula:
- the first recommended amount (kcal) BMR* estimated exercise intensity (or exercise coefficient) Equation 3
- exercise intensity or exercise coefficient can be as shown in Table 1;
- the first relationship is used to indicate the relationship between different calorie requirements and the calories that different food types should provide.
- the first relationship may be a preset diet standard, and then the type of food corresponding to the first recommended amount and the required calories can be obtained, where the diet standard includes but is not limited to: Shu Diet, Healthy Vegetarian Diet, Chinese Resident Dietary Guidelines-Diet Pagoda (for example, 2016 edition), Mediterranean diet.
- Table 2 is only a preferred embodiment of the food types corresponding to the first recommended amount in this application and the required calories, and this application is not limited to the first relationship corresponding to the above table 2 , The corresponding relationship indicated by the first relationship may still be in other forms.
- Table 3 specifically records the corresponding relationship between the weight of various foods and different energy intake levels. This relationship can be calculated by converting the average energy density of various foods into the first relationship described in the application, that is, indicating different calorie requirements and different The corresponding relationship between the calories that should be provided by the food types.
- the first recommended amount in this application may be a range value or a fixed point value. Under the condition that the first recommended amount remains unchanged, it means that the calories provided by each specific food combination are within the range of the first recommended amount, or the calories provided by each specific food combination are all the first recommended amount The corresponding point value, or the calories provided by each specific food combination, fall around the point value corresponding to the first recommended amount (for example: plus or minus 5% or plus or minus 10%).
- first relationship and the second relationship may be stored on the terminal side or the server side at the same time or separately.
- the method steps of this embodiment may further include:
- Step S108 obtaining food types; where the number of food types is N, and N is a positive integer;
- this step S108 can be performed before or after any of the above steps S102 to S106.
- the food type N involved in this step S108 can refer to all existing food types. It can be part of all food types, such as the 13 types of food in Table 2. In other words, the food category can be obtained according to the actual situation.
- the target food combination mode that matches the first recommended amount and the second recommended amount in the food information set involved in step S104 in this embodiment may be:
- Step S104-11 Preliminarily determine the first food combination according to the food type and the first recommended amount
- the first food combination can be preliminarily determined after the food type and the first recommended amount are determined.
- the preliminarily determined calories provided by various foods in the first food combination are: fruits 267.0kcal; starchy vegetables 41.7kcal; other vegetables 41.2kcal; red orange and purple vegetables 10.0kcal; dark green vegetables 25.7kcal; Beans and peas; 151.9kcal; whole grains 299.4kcal; refined grains 276.2kcal; meat and eggs 269.9kcal; seafood 116.8kcal; nut seeds and soybeans 67.6kcal; edible oil 264.8kcal; dairy products 167.8kcal.
- the first food combination can be randomly obtained, as shown in Table 5.
- the above is the first food combination randomly selected when the first recommended amount is 2000kcal/day, and when the first recommended amount is other values, in specific application scenarios, the above table 2 and The energy density of each specific food determines other first food combinations.
- Step S104-12 Under the condition that the first recommended amount remains unchanged, the food in the first food combination and the corresponding food amount are adjusted through heuristic search or random search to determine the second recommended amount Matching target food combination;
- the second recommended amount of required nutrients includes the third recommended amount respectively corresponding to different required nutrients. That is to say, the second recommended amount involved in this embodiment includes the third recommended amount corresponding to each specific nutrient.
- the first recommended amount is In the case of 2000kcal/day, the second recommended amount includes the third recommended amount of each specific nutrient, for example, protein is 89g; carbohydrate is 259g; fiber food is 31g and so on.
- the random search method is simple and easy to implement; the heuristic search method is relatively random search scheme, in the case of food types, nutrient quantities, and specific foods under each food type, it can greatly improve the determination of the target The efficiency of food combinations.
- step S104-12 in an optional implementation of this embodiment, it may be:
- Step A adjustment step: replace the first food in the first food combination with foods in the food information set that belong to the same food category as the first food in the first food combination, and adjust the amount of food replaced each time, Obtain the score of each adjusted food combination; wherein, the score of the adjusted food combination is obtained according to the comparison result of the nutrient content in each adjusted food combination with the second recommended amount.
- the first food combination of this embodiment there are 13 types of food in the first food combination of this embodiment.
- one of the food types is selected as the adjustment object, for example, select
- the food category of is 13 kinds of fruits, and the food in this fruit category includes one or more specific fruits (such as grapes, bananas, apples, pears, etc.), that is to say, only the first food combination Foods belonging to fruits are adjusted, and foods other than fruits are not replaced.
- the specific replacement method is as follows: randomly or in a certain order from the food information set, replace the fruits in the first food combination with specific fruits, such as replacing the grapes in the first food combination with lychees, and combine them simultaneously To determine the amount of lychees in the first food combination after the replacement, or to replace the bananas in the first food combination with watermelon, and combine the original food
- the calories required by the fruit in a food combination, the energy density of the watermelon, the amount of watermelon in the first food combination after replacement, and so on are determined.
- the score of the adjusted food combination is obtained based on the comparison between the nutrient content after each adjustment and the second recommended amount. This means that the content of each nutrient after each adjustment is corresponding to the first recommended amount. Three recommended amounts are compared to obtain the score of each nutrient, and the score of each nutrient is synthesized to obtain the adjusted food combination score.
- the third recommended amount in this embodiment can be a range value or a fixed point value; however, in this embodiment, it is preferably a range value; each nutrient has a corresponding The third recommended amount; based on this, there are many ways to obtain the score of each nutrient by comparing the content of each nutrient after each replacement with the corresponding third recommended amount, such as method (1) Determine after each replacement Whether the content of each nutrient falls within the value range indicated by the corresponding third recommended amount, the nutrient falling within the value range gets the corresponding score, and the nutrient that does not fall within the value range is zero.
- Method (2) Determine whether the content of each nutrient of the food combination after each replacement falls within the value range indicated by the corresponding third recommended amount, and the nutrients falling into the value range get the corresponding score, and then calculate The ratio between the nutrient content that does not fall into the value range and the corresponding third recommended amount, and the corresponding score is obtained according to the ratio. It should be noted that the above method is only an example to illustrate the method of comparing the third recommended amount of each nutrient content after each adjustment to obtain the score of each nutrient. The same is true for other methods of obtaining scores based on comparison. Within the protection scope of this application.
- the adjusted nutrients fall within the value range indicated by the third recommended amount and count 1 point (of course, other scoring systems can also be used)
- the nutrients that do not fall into 0 points are 16. Therefore, the sum of the scores of the nutrients after the statistical adjustment is used as the score of the food combination, that is, the score of the food combination is 20 points.
- each nutrient in the first food combination and the adjusted food combination is calculated based on the amount of each specific food in the corresponding food combination and the density of each nutrient of each specific food.
- Step B random step: arrange the scores of all food combinations in the previous step A in order, and give corresponding indexes to each food combination in the order of arrangement, and perform the scores of all the food combinations in the previous step A The sum is calculated to obtain the total, and the obtained total is a random range, a random value is randomly generated within the random range, and the food combination corresponding to the index corresponding to the random value is used as the adjusted food combination.
- the sequential arrangement is preferably arranged in the order of replacement, or arranged according to the score value, or arranged randomly, etc.; all the food combinations in the previous step A refer to before the step B All the food combinations that occurred in the most recent step A, or all the food combinations that occurred in the most recent step A before the step B, except for the first food combination; preferably, the most recent food combination before the step B For all the food combinations that appeared in step A at one time, this preferred solution can further improve the efficiency of obtaining the target food combination.
- the step B is preferably: normalize the scores of all food combinations in the previous step A, and arrange the normalized results in order, and give each food combination in the order of arrangement.
- the corresponding index is calculated by summing all the normalized results in the current step B to obtain the total number.
- the total number obtained is the random range, and a random value is randomly selected within the random range.
- the random value is determined by the random value.
- the food combination corresponding to the corresponding index is used as the adjusted food group.
- normalization there are many ways of normalization, including but not limited to normalization according to the sum as a certain number, or normalization according to the maximum number as a certain number, and so on.
- step B the scores of each food combination in the random step are processed according to the following preferred methods, and then the corresponding steps are executed:
- the step B is specifically:
- the preset value is between 1.1-30, more preferably between 2-20.
- processing the scores of each food combination by the above-mentioned optimization method can increase the gap between the scores of each food combination and increase the scores of the food combinations obtained through random numerical correspondence to a higher score. The probability of the value interval, thereby further improving the efficiency of obtaining the target food combination.
- the normalization process can be: the sum of the calculation results obtained after all food replacements is normalized to 1, and each time the food is replaced according to its index value, and the order of the food is adjusted from Sort in order from 0 to 1; and then a random number R between 0-1, and the food combination corresponding to the index value of R is determined as the adjusted food combination.
- Step C the first cycle step: the adjusted food combination obtained in the previous step B is used as the first food combination in the next step A, and the food type of the first food to be replaced in the process of performing step A again is replaced
- steps A to B are repeated until all N foods in the first food combination have been adjusted from step A to step B.
- the adjusted food combination after adjusting a fixed specified type of food, use the adjusted food combination as the object of the next adjustment, and continue to adjust the other types of food in the first food combination until all N types are adjusted. Have been adjusted. For example, after all fruit foods are replaced, it is necessary to adjust other foods in the first food combination, such as seafood foods.
- the replacement method is the same as the fruit replacement method. A variety of (fish, shrimp, clams, scallops, etc.), the specific seafood foods are replaced in turn, and the amount of specific seafood foods after replacement is calculated according to the caloric density of the corresponding foods, and the adjusted food combination is obtained until All types of food in the first food combination have been replaced.
- Step D the second cycle step: repeat the above steps A to C until the target food combination that meets the preset conditions is obtained.
- step D after replacing all the foods for the first time, the above-mentioned replacement operation can be repeated again until the target food combination that meets the preset conditions appears.
- the preset conditions include at least one of the following:
- the preset number of times can be in the range of 10 to 30 times.
- this is only an example.
- the range of other preset times is possible, and the corresponding can be done according to the actual situation.
- the setting is not limited in this application.
- Vitamin B1 saturated fatty acid 2 phosphorus 4 Vitamin B2 4 Monounsaturated fatty acid 3 Potassium 4 Vitamin B3 4 Polyunsaturated fatty acid 3 sodium 4 Vitamin B6 4 Linoleic acid 3 Zinc 4 Vitamin B12 4 Linolenic acid 3 copper 4 choline 4 EPA 3 manganese 4 Vitamin K 4 DHA 3 selenium 4 Vitamin B9 4
- the priority is represented by numbers from 1 to 4.
- the first order nutrients involved in this embodiment include: protein, carbohydrate, dietary fiber, Total fat.
- the above-mentioned nutrients in the first order are just examples, and adjustments can also be made according to the actual situation of each person. For example, if a person is relatively deficient in vitamins, set the vitamin-related nutrients as the first Nutrients in order. That is, the above method (2) is only for illustration. For the preset condition, only some of the high priority nutrients are required to meet the range indicated by the second recommended amount, and then the adjusted food combination can be used as the target food Combination, without all nutrients meeting the range indicated by the second recommended amount.
- the first preset range may be greater than or equal to 30 and less than or equal to 35, or greater than or equal to 28 and less than or equal to 33.
- the first preset range can also be valued according to actual conditions, which is not limited in this application.
- the food with a glycemic index higher than a first preset value is removed from the food information set, and then the adjusted food information set determines A target food combination that matches the first recommended amount and the second recommended amount.
- a first preset value for example, 65
- the food with purine content higher than the second preset value (for example, 180mg/100g) is removed from the food information set, and then the adjusted food information set is determined A target food combination that matches the first recommended amount and the second recommended amount is calculated.
- This embodiment can provide a more personalized target food combination suitable for the target object.
- FIG. 2 is a flowchart of the method for displaying food information according to an embodiment of the present application. As shown in FIG. 2, the steps of the method include:
- Step S202 obtaining the first recommended amount of calories required by the target object per unit time and the second recommended amount of nutrients required by the target object;
- Step S204 Obtain the target food combination that matches the first recommended amount and the second recommended amount determined in the food information set;
- Step S206 Display the target food combination on the target terminal.
- the first recommended amount of calories needed by the target object per unit time and the second recommended amount of nutrients needed are obtained, and then the sum of the first recommended amount and the first recommended amount are determined according to the predetermined food information set.
- the target food combination that matches the second recommended amount, and the target food combination is displayed on the target terminal, that is, the displayed target food combination is obtained based on the first recommended amount of calories and the second recommended amount of nutrients, so that Show a more reasonable food combination for the target object, instead of choosing the corresponding food according to personal preference, so as to solve the problem of not taking into account the intake of calories and nutrients at the same time in the related technology to consider the food matching problem, and achieve a more reasonable diet for users Effect.
- the execution subject of the method steps involved in this embodiment may be a terminal, where the terminal includes: mobile phones, tablet computers and other devices.
- the first recommended amount of heat required per unit time involved in step S202 of this embodiment can be obtained according to an anthropometric method in an optional implementation of this embodiment, of course, this is only an example. Other ways to obtain the first recommended amount are also within the scope of protection of this application.
- the following takes an anthropometric method as an example to illustrate how to obtain the first recommended amount. This anthropometric method is based on the target The subject’s personal information and estimated exercise intensity are obtained. In addition, the anthropometric method uses 1 day as an example. The specific method is as follows:
- the personal information of the target object includes but is not limited to: age, gender, height, weight, estimated exercise intensity; the personal information of the target object may further include characteristic information, including but not limited to current season, hometown, and usual residence , Current location, taste, physical condition, price requirements, etc.; the physical condition includes but is not limited to whether it includes chronic diseases such as gout, diabetes, and/or hypertension.
- the anthropometric method is consistent with the thermal body measurement method in Example 1, that is, the anthropometric method in this embodiment includes Formula 1 to Formula 3, which will not be repeated here.
- the first relationship is used to indicate the relationship between different calorie requirements and the calories that different food types should provide.
- the first relationship may be a preset diet standard, and then the type of food corresponding to the first recommended amount and the required calories can be obtained, where the diet standard includes but is not limited to: Shu Diet Method, Healthy Vegetarian Diet Method, Chinese Resident Diet Guide Edition-Diet Pagoda (for example, 2016 version), Mediterranean diet method.
- the Mediterranean diet as an example, according to the 200kcal increment, it is divided into 11 calorie categories from 1000-3200kcal, and the formation of the caloric value required for 13 types of food is shown in Table 2 or Table 3.
- the method steps of this embodiment may further include:
- Step S208 obtaining food types; wherein the number of food types is N, and N is a positive integer;
- this step S208 can be performed before or after any of the above steps S202 to S206.
- the food type N involved in this step S208 can refer to all existing food types. It can be part of all food types, such as the 13 types of food in Table 2. In other words, the food category can be obtained according to the actual situation.
- the method of obtaining the target food combination determined in the food information set that matches the first recommended amount and the second recommended amount involved in step S204 of this embodiment includes:
- Step S204-11 Preliminarily determine the first food combination according to the food type and the first recommended amount
- the first food combination can be preliminarily determined after the food type and the first recommended amount are determined.
- the preliminarily determined calories provided by various foods in the first food combination are: fruits 267.0kcal; starchy vegetables 41.7kcal; other vegetables 41.2kcal; red orange and purple vegetables 10.0kcal; dark green vegetables 25.7kcal; Beans and peas; 151.9kcal; whole grains 299.4kcal; refined grains 276.2kcal; meat and eggs 269.9kcal; seafood 116.8kcal; nuts seed soybeans 67.6kcal; edible oils 264.8kcal; dairy products 167.8kcal.
- the first food combination can be randomly obtained, as shown in Table 5.
- Step S204-12 Under the condition that the first recommended amount remains unchanged, the food in the first food combination and the corresponding food amount are adjusted through heuristic search or random search to determine the second recommended amount The matched target food combination; wherein, there are multiple required nutrients; the second recommended amount of required nutrients includes the third recommended amount respectively corresponding to different required nutrients.
- the second recommended amount of required nutrients includes the third recommended amount respectively corresponding to different required nutrients. That is to say, the second recommended amount involved in this embodiment includes the third recommended amount corresponding to each specific nutrient.
- the first recommended amount is In the case of 2000kcal/day, the second recommended amount includes the third recommended amount of each specific nutrient, for example, protein is 89g; carbohydrate is 259g; fiber food is 31g and so on.
- the random search method is simple and easy to implement; the heuristic search method is relatively random search scheme, in the case of food types, nutrient quantities, and specific foods under each food type, it can greatly improve the determination of the target The efficiency of food combinations.
- step S204-13 in an optional implementation manner of this embodiment, it may be:
- Step A adjustment step: replace the first food in the first food combination with foods in the food information set that belong to the same food category as the first food in the first food combination, and adjust the amount of food replaced each time, Obtain the score of each adjusted food combination; wherein, the score of the adjusted food combination is obtained based on the comparison result of the nutrient content in each adjusted food combination with the second recommended amount;
- the first food combination of this embodiment there are 13 types of food in the first food combination of this embodiment.
- one of the food types is selected as the adjustment object, for example, select
- the food category of is 13 kinds of fruits, and the food in this fruit category includes one or more specific fruits (such as grapes, bananas, apples, pears, etc.), that is to say, only the first food combination Foods that belong to the fruit category are adjusted, and other types of foods except fruits are not replaced.
- the specific replacement method is as follows: randomly or in a certain order from the food information set, replace the fruits in the first food combination with specific fruits, such as replacing the grapes in the first food combination with lychees, and combine them simultaneously To determine the amount of lychees in the first food combination after the replacement, or to replace the bananas in the first food combination with watermelon, and combine the original food
- the calories required by the fruit in a food combination, the energy density of the watermelon, the amount of watermelon in the first food combination after replacement, and so on are determined.
- the score of the adjusted food combination is obtained based on the comparison between the nutrient content after each adjustment and the second recommended amount. This means that the content of each nutrient after each adjustment is corresponding to the first recommended amount. Three recommended amounts are compared to obtain the score of each nutrient, and the score of each nutrient is synthesized to obtain the adjusted food combination score.
- the third recommended amount in this embodiment can be a range value or a fixed point value; however, in this embodiment, it is preferably a range value; each nutrient has a corresponding The third recommended amount; based on this, there are many ways to obtain the score of each nutrient by comparing the content of each nutrient after each replacement with the corresponding third recommended amount, such as method (1) Determine after each replacement Whether the content of each nutrient falls within the value range indicated by the corresponding third recommended amount, the nutrient falling within the value range gets the corresponding score, and the nutrient that does not fall within the value range is zero.
- Method (2) Determine whether the content of each nutrient of the food combination after each replacement falls within the value range indicated by the corresponding third recommended amount, and the nutrients falling into the value range get the corresponding score, and then calculate The ratio between the nutrient content that does not fall into the value range and the corresponding third recommended amount, and the corresponding score is obtained according to the ratio. It should be noted that the above method is only an example to illustrate the method of comparing the third recommended amount of each nutrient content after each adjustment to obtain the score of each nutrient. The same is true for other methods of obtaining scores based on comparison. Within the protection scope of this application, take mode (1) as an example.
- the adjusted nutrients fall within the value range indicated by the second recommended amount and count as 1 point ( Of course, it can also be other scoring system) There are 20 nutrients, and the nutrients that do not fall into 0 points are 15. Therefore, the sum of the scores of the nutrients after the statistical adjustment is used as the score of the food combination, that is, the food The score for the combination is 20 points.
- each nutrient in the first food combination and the adjusted food combination is calculated based on the amount of each specific food in the corresponding food combination and the density of each nutrient of each specific food.
- the quantity of nutrients in this application can be selected according to actual conditions, that is, the quantity of nutrients in this application includes but is not limited to those shown in Table 4 above.
- Step B random step: arrange the scores of all food combinations in the previous step A in order, and give corresponding indexes to each food combination in the order of arrangement, and perform the scores of all the food combinations in the previous step A The sum is calculated to obtain the total, and the obtained total is a random range, a random value is randomly generated within the random range, and the food combination corresponding to the index corresponding to the random value is used as the adjusted food combination.
- the sequential arrangement is preferably arranged in the order of replacement, or arranged according to the score value, or arranged randomly, etc.; all the food combinations in the previous step A refer to before the step B All the food combinations that occurred in the most recent step A, or all the food combinations that occurred in the most recent step A before the step B, except for the first food combination; preferably, the most recent food combination before the step B For all the food combinations that appeared in step A at one time, this preferred solution can further improve the efficiency of obtaining the target food combination.
- the step B is preferably: normalize the scores of all food combinations in the previous step A, and arrange the normalized results in order, and give each food combination in the order of arrangement.
- the corresponding index is calculated by summing all the normalized results in the current step B to obtain the total number.
- the total number obtained is the random range, and a random value is randomly selected within the random range.
- the random value is determined by the random value.
- the food combination corresponding to the corresponding index is used as the adjusted food group.
- normalization there are many ways of normalization, including but not limited to normalization according to the sum as a certain number, or normalization according to the maximum number as a certain number, and so on.
- step B the scores of each food combination in the random step are processed according to the following preferred methods, and then the corresponding steps are executed:
- the step B is specifically:
- the preset value is between 1.1-30, more preferably between 2-20.
- processing the scores of each food combination by the above-mentioned optimization method can increase the gap between the scores of each food combination and increase the scores of the food combinations obtained through random numerical correspondence to a higher score. The probability of the value interval, thereby further improving the efficiency of obtaining the target food combination.
- the normalization process can be: the sum of the calculation results obtained after all food replacements is normalized to 1, and each time the food is replaced according to its index value, and the order of the food is adjusted from Sort in order from 0 to 1; and then a random number R between 0-1, and the food combination corresponding to the index value of R is determined as the adjusted food combination.
- Step C the first cycle step: the adjusted food combination obtained in the previous step B is used as the first food combination in the next step A, and the food type of the first food to be replaced in the process of performing step A again is replaced In principle, repeat steps A to B until all the N foods in the first food combination have been adjusted from step A to step B;
- the adjusted food combination after adjusting a fixed specified type of food, use the adjusted food combination as the object of the next adjustment, and continue to adjust the other types of food in the first food combination until all N types are adjusted. Have been adjusted. For example, after all fruit foods are replaced, it is necessary to adjust other foods in the first food combination, such as seafood foods.
- the replacement method is the same as the fruit replacement method. A variety of (fish, shrimp, clams, scallops, etc.), the specific seafood foods are replaced in turn, and the amount of specific seafood foods after replacement is calculated according to the caloric density of the corresponding foods, and the adjusted food combination is obtained until All types of food in the first food combination have been replaced.
- Step D the second loop step: repeat the above steps A to C until a target food combination that meets the preset conditions is obtained;
- step D after all foods are replaced for the first time, the above replacement operation can be repeated again until a target food combination that meets the preset conditions appears.
- the preset conditions include at least one of the following:
- the preset number of times can be in the range of 10 to 30 times.
- this is only an example.
- the range of other preset times is possible, and the corresponding can be done according to the actual situation.
- the setting is not limited in this application.
- the priority is represented by numbers from 1 to 4.
- the first-order nutrients involved in this embodiment include: protein, carbohydrate, dietary fiber, Total fat.
- the above-mentioned nutrients in the first order are just examples, and adjustments can also be made according to the actual situation of each person. For example, if a person is relatively deficient in vitamins, set the vitamin-related nutrients as the first Nutrients in order. That is, the above method (2) is only for illustration. For the preset condition, only some of the high priority nutrients are required to meet the range indicated by the second recommended amount, and then the adjusted food combination can be used as the target food Combination, without all nutrients meeting the range indicated by the second recommended amount.
- the first preset range may be greater than or equal to 30 and less than or equal to 35, or greater than or equal to 28 and less than or equal to 33.
- the first preset range can also be valued according to actual conditions, which is not limited in this application.
- the method according to the above embodiment can be implemented by means of software plus the necessary general hardware platform, of course, it can also be implemented by hardware, but in many cases the former is Better implementation.
- the technical solution of this application essentially or the part that contributes to the existing technology can be embodied in the form of a software product, and the computer software product is stored in a storage medium (such as ROM/RAM, magnetic disk, The optical disc) includes several instructions to make a terminal device (which can be a mobile phone, a computer, a server, or a network device, etc.) execute the methods described in the various embodiments of the present application.
- a device for pushing food information is also provided, and the device is used to implement the above-mentioned embodiments and preferred implementations, and those that have been explained will not be repeated.
- the term "module” may implement a combination of software and/or hardware that performs predetermined functions.
- the devices described in the following embodiments are preferably implemented in software, implementation of hardware or a combination of software and hardware is also possible and conceived.
- FIG. 3 is a schematic structural diagram of a device for pushing food information according to an embodiment of the present application.
- the device includes: a first acquiring module 32 configured to acquire the first amount of calories required by the target object per unit time The recommended amount and the second recommended amount of nutrients required; the determining module 34, coupled to the first obtaining module 32, is configured to determine a target food combination matching the first recommended amount and the second recommended amount in the food information collection; The pushing module 36 is coupled to the determining module 34 and configured to push the target food combination to the target terminal.
- the food information pushing device can be applied to a server or a terminal device, and the terminal device can be a mobile phone, a tablet computer, a laptop computer, and so on.
- the third embodiment is an apparatus embodiment corresponding to the first embodiment. Therefore, the first acquiring module 32 involved in this embodiment can be configured to perform the above step S102, the determining module 34 can be configured to perform the above step S104, and the pushing module 36 can be configured to perform the step S106.
- the first recommended amount of heat required per unit time involved in this embodiment can be obtained according to an anthropometric method in an alternative implementation of this embodiment.
- an anthropometric method is based on the target object The personal information and estimated exercise intensity are obtained.
- the anthropometric method uses 1 day as an example. The specific method is as follows:
- the personal information of the target object but not limited to: age, gender, height, weight, estimated exercise intensity; the personal information of the target object may further include characteristic information including but not limited to the current season, hometown, permanent residence, Current location, taste, physical state, price requirements, etc.; the physical state includes, but is not limited to: whether you have chronic diseases such as gout, diabetes, and/or hypertension, that is, in this embodiment, the anthropometric method includes the formula 1 to 3 are not repeated here.
- the first relationship is used to indicate the relationship between different calorie requirements and the calories that different food types should provide.
- the first relationship may be a preset diet standard, and then the type of food corresponding to the first recommended amount and the required calories can be obtained, where the diet standard includes but is not limited to: Shu Diet, Healthy Vegetarian Diet, Chinese Resident Dietary Guidelines-Diet Pagoda (for example, 2016 edition), Mediterranean diet.
- the Mediterranean diet as an example, according to the 200kcal increment, it is divided into 11 calorie categories from 1000-3200kcal, and the formation of the caloric value required for 13 types of food is shown in Table 2 or Table 3.
- the device of this embodiment may further include: a second acquisition module configured to acquire food types; wherein the number of food types is N, and N is a positive integer.
- the obtained food type N may refer to all existing food types, or part of all food types, such as the 13 types of food in Table 2.
- the food category can be obtained according to the actual situation.
- the determining module 34 involved in this embodiment includes: a first determining unit configured to preliminarily determine a first food combination based on the type of food and the first recommended amount; and a second determining unit configured to change the first recommended amount.
- the food in the first food combination and the corresponding food amount are adjusted through heuristic search or random search to determine the target food combination that matches the second recommended amount; wherein, the required nutrients are: Multiple; the second recommended amount of required nutrients includes the third recommended amount corresponding to different required nutrients.
- each of the first food combinations determined preliminarily The calories that should be provided by foods are: fruits 267.0kcal; starchy vegetables 41.7kcal; other vegetables 41.2kcal; red orange and purple vegetables 10.0kcal; dark green vegetables 25.7kcal; beans and peas; 151.9kcal; whole grains 299.4kcal; refined Cereals 276.2kcal; meat and eggs 269.9kcal; seafood 116.8kcal; nut seed soybeans 67.6kcal; edible oil 264.8kcal; dairy products 167.8kcal.
- the first food combination can be randomly obtained, as shown in Table 5.
- the above is the first food combination randomly selected when the first recommended amount is 2000kcal/day, and when the first recommended amount is other values, other preliminary first food combinations can be determined according to Table 2 above in specific application scenarios. Food combination.
- the second recommended amount of required nutrients includes the third recommended amount respectively corresponding to different required nutrients. That is to say, the second recommended amount involved in this embodiment includes the third recommended amount corresponding to each specific nutrient.
- the first recommended amount is In the case of 2000kcal/day, the second recommended amount includes the third recommended amount of each specific nutrient, for example, protein is 89g; carbohydrate is 259g; fiber food is 31g and so on.
- the random search method is simple and easy to implement; the heuristic search method is relatively random search scheme, in the case of food types, nutrient quantities, and specific foods under each food type, it can greatly improve the determination of the target The efficiency of food combinations.
- the second determining unit involved in this embodiment includes:
- the first replacement subunit is configured to perform step A, the adjustment step: replace the first food in the first food combination with specific foods in the food information set that belong to the same food category as the first food in the first food combination, and Obtain the score of each adjusted food combination; wherein, the score of the adjusted food combination is obtained according to the comparison result of the nutrient content in each adjusted food combination with the second recommended amount.
- the first food combination of this embodiment there are 13 types of food in the first food combination of this embodiment.
- one of the food types is selected as the adjustment object, for example, select
- the food category of is 13 kinds of fruits, and the food in this fruit category includes one or more specific fruits (such as grapes, bananas, apples, pears, etc.), that is to say, only the first food combination Foods that belong to the fruit category are adjusted, and other types of foods except fruits are not replaced.
- the specific replacement method is: randomly or in a certain order from the food information set, replace the fruits in the first food combination with specific fruits, such as replacing the grapes in the first food combination with lychees, and combine them at the same time
- the calories required by the fruit in a food combination, the energy density of the watermelon, and the amount of watermelon in the first food combination after replacement are determined.
- the score of the adjusted food combination is obtained based on the comparison between the nutrient content after each adjustment and the second recommended amount. This means that the content of each nutrient after each adjustment is corresponding to the first recommended amount. Three recommended amounts are compared to obtain the score of each nutrient, and the score of each nutrient is synthesized to obtain the adjusted food combination score.
- the third recommended amount in this embodiment can be a range value or a fixed point value; however, in this embodiment, it is preferably a range value; each nutrient has a corresponding The third recommended amount; based on this, there are many ways to obtain the score of each nutrient by comparing the content of each nutrient after each replacement with the corresponding third recommended amount, such as method (1) Determine after each replacement Whether the content of each nutrient falls within the value range indicated by the corresponding third recommended amount, the nutrient falling within the value range gets the corresponding score, and the nutrient that does not fall within the value range is zero.
- Method (2) Determine whether the content of each nutrient of the food combination after each replacement falls within the value range indicated by the corresponding third recommended amount, and the nutrients falling into the value range get the corresponding score, and then calculate The ratio between the nutrient content that does not fall into the value range and the corresponding third recommended amount, and the corresponding score is obtained according to the ratio. It should be noted that the above method is only an example to illustrate the method of comparing the third recommended amount of each nutrient content after each adjustment to obtain the score of each nutrient. The same is true for other methods of obtaining scores based on comparison. Within the protection scope of this application.
- the adjusted nutrients fall within the value range indicated by the third recommended amount and count 1 point (of course, other scoring systems can also be used)
- the nutrients that do not fall into 0 points are 16. Therefore, the sum of the scores of the nutrients after the statistical adjustment is used as the score of the food combination, that is, the score of the food combination is 20 points.
- the content of each nutrient in the first food combination and the adjusted food combination is calculated based on the amount of each specific food in the corresponding food combination and the density of each nutrient of each specific food.
- the first processing subunit is set to perform step B.
- Random step arrange the scores of all food combinations in the previous step A in order, and give corresponding indexes to each food combination in the order of arrangement, and compare the previous step A
- the scores of all the food combinations in are added to calculate the total, and the total obtained is the random range, a random value is randomly selected within the random range, and the food combination corresponding to the index corresponding to the random value is used as the adjusted Food combination.
- the sequential arrangement is preferably arranged in the order of replacement, or arranged according to the score value, or arranged randomly, etc.; all the food combinations in the previous step A refer to before the step B All the food combinations that occurred in the most recent step A, or all the food combinations that occurred in the most recent step A before the step B, except for the first food combination; preferably, the most recent food combination before the step B For all the food combinations that appeared in step A at one time, this preferred solution can further improve the efficiency of obtaining the target food combination.
- the step B is preferably: normalize the scores of all food combinations in the previous step A, and arrange the normalized results in sequence, and give each food combination in the order of arrangement.
- the corresponding index is calculated by summing all the normalized results in the current step B to obtain the total number.
- the total number obtained is the random range, and a random value is randomly selected within the random range.
- the random value is determined by the random value.
- the food combination corresponding to the corresponding index is used as the adjusted food group. It should be noted that there are many ways of normalization, including but not limited to normalization according to the sum as a certain number, or normalization according to the maximum number as a certain number, and so on.
- step B the scores of each food combination in the random step are processed according to the following preferred methods, and then the corresponding steps are executed:
- the step B is specifically:
- the normalization process can be: the sum of the calculation results obtained after all food replacements is normalized to 1, and each time the food is replaced according to its index value, and the order of the food is adjusted from Sort in order from 0 to 1; and then a random number R between 0-1, and the food combination corresponding to the index value of R is determined as the adjusted food combination.
- the first execution subunit is set to execute step C.
- the first cycle step the adjusted food combination obtained in step B in the previous step is used as the first food combination in step A in the next step, and the replacement is performed in the process of executing step A again
- the food type to which the first food to be replaced belongs is a principle, and Step A to Step B are repeated until the N foods in the first food combination have all been adjusted from Step A to Step B.
- the adjusted food combination after adjusting a fixed specified type of food, use the adjusted food combination as the object of the next adjustment, and continue to adjust the other types of food in the first food combination until all N types are adjusted. Have been adjusted. For example, after all fruit foods are replaced, it is necessary to adjust other foods in the first food combination, such as seafood foods.
- the replacement method is the same as the fruit replacement method. For multiple types (fish, shrimp, clams, scallops, etc.), specific seafood foods are sequentially replaced to obtain an adjusted food combination until all types of foods in the first food combination have been replaced.
- the second execution subunit is configured to execute step D, and the second loop step: repeat the above steps A to C until a target food combination that meets the preset conditions is obtained.
- the preset condition includes at least one of the following: the number of repeated executions of step A to step C reaches the preset number of times; or, during the repeated execution of step A to step B, or the repeated execution of steps A to C, X
- the adjusted first food combination, and the amount of the first sequence nutrient contained in each of the X adjusted first food combinations falls within the range indicated by the second recommended amount; or, repeating step A to step B, or in the process of repeating steps A to C, Y adjusted first food combinations appear, and the scores of the Y adjusted first food combinations all fall within the first preset range.
- the above modules can be implemented by software or hardware, and the latter can be implemented by the following methods, but not limited to this: the above modules are all located in the same processor; or, the above modules can be combined in any combination The forms are located in different processors.
- a food information display device is also provided, and the device is used to implement the above-mentioned embodiments and preferred implementations. What has been described will not be repeated.
- the term "module” may implement a combination of software and/or hardware that performs predetermined functions. Although the devices described in the following embodiments are preferably implemented in software, implementation of hardware or a combination of software and hardware is also possible and conceived.
- FIG. 4 is a schematic structural diagram of a food information display device according to an embodiment of the present application.
- the device includes: a third acquiring module 42 configured to acquire the first amount of calories required by the target object per unit time Recommended amount and the second recommended amount of nutrients required; the fourth obtaining module 44, coupled to the third obtaining module 42, is configured to obtain the food information set that matches the first recommended amount and the second recommended amount The target food combination; the display module 46 is coupled to the fourth acquisition module and is configured to display the target food combination to the target terminal.
- the food information display device can be applied to a terminal device, which can be a mobile phone, a tablet computer, a laptop computer, and so on.
- the fourth embodiment is an apparatus embodiment corresponding to the second embodiment. Therefore, the third acquisition module 42 involved in this embodiment can be set to perform the above step S202, the fourth acquisition module 44 can be set to perform the above step S204, and the display module 46 can be set to perform step S206.
- the first recommended amount of heat required per unit time involved in this embodiment can be obtained according to an anthropometric method in an alternative implementation of this embodiment.
- an anthropometric method is based on the target object The personal information and estimated exercise intensity are obtained.
- the anthropometric method uses 1 day as an example. The specific method is as follows:
- the personal information of the target object but not limited to: age, gender, height, weight, estimated exercise intensity; the personal information of the target object may further include characteristic information including but not limited to the current season, hometown, permanent residence, Current location, taste, physical state, price requirements, etc.; the physical state includes, but is not limited to: whether you have chronic diseases such as gout, diabetes, and/or hypertension, that is, in this embodiment, the anthropometric method includes the formula 1 to 3 are not repeated here.
- the first relationship is used to indicate the relationship between different calorie requirements and the calories that different food types should provide.
- the first relationship may be a preset diet standard, and then the type of food corresponding to the first recommended amount and the required calories can be obtained, where the diet standard includes but is not limited to: Shu Diet, Healthy Vegetarian Diet, Chinese Resident Dietary Guidelines-Diet Pagoda (for example, 2016 edition), Mediterranean diet.
- the Mediterranean diet as an example, according to the 200kcal increment, it is divided into 11 calorie categories from 1000-3200kcal, and the formation of the caloric value required for 13 types of food is shown in Table 2 or Table 3.
- the device of this embodiment may further include: a fifth acquisition module configured to acquire food types; wherein the number of food types is N, and N is a positive integer.
- the food type N obtained by the first obtaining unit may refer to all existing food types, or may be a part of all food types, such as the 13 food types in Table 2. In other words, the food category can be obtained according to the actual situation.
- the third acquiring module 44 involved in this embodiment includes: a third determining unit configured to preliminarily determine the first food combination according to the food type and the first recommended amount; and the fourth determining unit configured to initially determine the first food combination.
- the food in the first food combination and the corresponding food amount are adjusted by heuristic search or random search to determine the target food combination that matches the second recommended amount; where , There are many kinds of nutrients required; the second recommended amount of required nutrients includes the third recommended amount corresponding to the different required nutrients.
- each of the first food combinations determined preliminarily The calories that should be provided by such foods are: fruits 267.0kcal; starchy vegetables 41.7kcal; other vegetables 41.2kcal; red orange and purple vegetables 10.0kcal; dark green vegetables 25.7kcal; beans and peas; 151.9kcal; whole grains 99.4kcal; refined Cereals 276.2kcal; meat and eggs 269.9kcal; seafood 116.8kcal; nut seed soybeans 67.6kcal; edible oil 264.8kcal; dairy products 167.8kcal.
- the first food combination can be randomly obtained, as shown in Table 5.
- the above is the first food combination randomly selected when the first recommended amount is 2000kcal/day, and when the first recommended amount is other values, other preliminary first food combinations can be determined according to Table 2 above in specific application scenarios. Food combination.
- the second recommended amount of required nutrients includes the third recommended amount corresponding to different required nutrients. That is to say, the second recommended amount involved in this embodiment includes the third recommended amount corresponding to each specific nutrient.
- the first recommended amount is In the case of 2000kcal/day, the second recommended amount includes the third recommended amount of each specific nutrient, for example, protein is 89g; carbohydrate is 259g; fiber food is 31g and so on.
- the random search method is simple and easy to implement; the heuristic search method is relatively random search scheme, in the case of food types, nutrient quantities, and specific foods under each food type, it can greatly improve the determination of the target The efficiency of food combinations.
- the fourth determining unit involved in this embodiment includes:
- the second replacement subunit is configured to perform step A.
- the adjustment step replace the first food in the first food combination with specific foods in the food information set that belong to the same food category as the first food in the first food combination, and Adjust the amount of food to be replaced each time, and get the score of each adjusted food combination; among them, the score of the adjusted food combination is based on the nutrient content of the adjusted food combination and the second recommended amount
- the comparison result is obtained.
- the first food combination of this embodiment there are 13 types of food in the first food combination of this embodiment.
- one of the food types is selected as the adjustment object, for example, select
- the food category of is 13 kinds of fruits, and the food in this fruit category includes one or more specific fruits (such as grapes, bananas, apples, pears, etc.), that is to say, only the first food combination Foods that belong to the fruit category are adjusted, and other types of foods except fruits are not replaced.
- the specific replacement method is as follows: randomly or in a certain order from the food information set, replace the fruits in the first food combination with specific fruits, such as replacing the grapes in the first food combination with lychees, and combine them simultaneously To determine the amount of lychees in the first food combination after the replacement, or to replace the bananas in the first food combination with watermelon, and combine the original food
- the calories required by the fruit in a food combination, the energy density of the watermelon, the amount of watermelon in the first food combination after replacement, and so on are determined.
- the score of the adjusted food combination is obtained based on the comparison between the nutrient content after each adjustment and the second recommended amount. This means that the content of each nutrient after each adjustment is corresponding to the first recommended amount. Three recommended amounts are compared to obtain the score of each nutrient, and the score of each nutrient is synthesized to obtain the adjusted food combination score.
- the third recommended amount in this embodiment can be a range value or a fixed point value; however, in this embodiment, it is preferably a range value; each nutrient has a corresponding The third recommended amount; based on this, there are many ways to obtain the score of each nutrient by comparing the content of each nutrient after each replacement with the corresponding third recommended amount, such as method (1) Determine after each replacement Whether the content of each nutrient falls within the value range indicated by the corresponding third recommended amount, the nutrient falling within the value range gets the corresponding score, and the nutrient that does not fall within the value range is zero.
- Method (2) Determine whether the content of each nutrient of the food combination after each replacement falls within the value range indicated by the corresponding third recommended amount, and the nutrients falling into the value range get the corresponding score, and then calculate The ratio between the nutrient content that does not fall into the value range and the corresponding third recommended amount, and the corresponding score is obtained according to the ratio. It should be noted that the above method is only an example to illustrate the method of comparing the third recommended amount of each nutrient content after each adjustment to obtain the score of each nutrient. The same is true for other methods of obtaining scores based on comparison. Within the protection scope of this application.
- the adjusted nutrients fall within the value range indicated by the third recommended amount and count 1 point (of course, other scoring systems can also be used)
- the nutrients that do not fall into 0 points are 16. Therefore, the sum of the scores of the nutrients after the statistical adjustment is used as the score of the food combination, that is, the score of the food combination is 20 points.
- the second processing sub-unit is set to perform step B.
- Random step arrange the scores of all food combinations in the previous step A in order, and give corresponding indexes to each food combination in the order of arrangement, and compare the previous step
- the scores of all food combinations in A are summed to calculate the total, and the total obtained is a random range, a random value is randomly selected within the random range, and the food combination corresponding to the index corresponding to the random value is used as an adjustment After the food mix.
- the sequential arrangement is preferably arranged in the order of replacement, or arranged according to the score value, or arranged randomly, etc.; all the food combinations in the previous step A refer to before the step B All the food combinations that occurred in the most recent step A, or all the food combinations that occurred in the most recent step A before the step B, except for the first food combination; preferably, the most recent food combination before the step B For all the food combinations that appeared in step A at one time, this preferred solution can further improve the efficiency of obtaining the target food combination.
- the step B is preferably: normalize the scores of all food combinations in the previous step A, and arrange the normalized results in sequence, and give each food combination in the order of arrangement.
- the corresponding index is calculated by summing all the normalized results in the current step B to obtain the total number.
- the total number obtained is the random range, and a random value is randomly selected within the random range.
- the random value is determined by the random value.
- the food combination corresponding to the corresponding index is used as the adjusted food group. It should be noted that there are many ways of normalization, including but not limited to normalization according to the sum as a certain number, or normalization according to the maximum number as a certain number, and so on.
- step B the scores of each food combination in the random step are processed according to the following preferred methods, and then the corresponding steps are executed:
- the step B is specifically:
- the normalization process can be: the sum of the calculation results obtained after all food replacements is normalized to 1, and each time the food is replaced according to its index value, and the order of the food is adjusted from Sort in order from 0 to 1; and then a random number R between 0-1, and the food combination corresponding to the index value of R is determined as the adjusted food combination.
- the third execution subunit is set to execute step C.
- the first cycle step the adjusted food combination obtained in step B in the previous step is used as the first food combination in step A in the next step, and the replacement is performed in the process of executing step A again
- the food type to which the first food to be replaced belongs is a principle, and Step A to Step B are repeated until the N foods in the first food combination have all been adjusted from Step A to Step B.
- the adjusted food combination after adjusting a fixed specified type of food, use the adjusted food combination as the object of the next adjustment, and continue to adjust the other types of food in the first food combination until all N types are adjusted. Have been adjusted. For example, after all fruit foods are replaced, it is necessary to adjust other foods in the first food combination, such as seafood foods.
- the replacement method is the same as the fruit replacement method. For multiple types (fish, shrimp, clams, scallops, etc.), specific seafood foods are sequentially replaced to obtain an adjusted food combination until all types of foods in the first food combination have been replaced.
- the fourth execution subunit is set to execute step D, and the second loop step: repeat the above steps A to C until a target food combination that meets the preset conditions is obtained.
- the preset condition includes at least one of the following: the number of repeated executions of step A to step C reaches a preset number of times; or, during the repeated execution of step A to step B, or the repeated execution of steps A to C, X
- the adjusted first food combination, and the amount of the first sequence nutrient contained in each of the X adjusted first food combinations falls within the range indicated by the second recommended amount; or, repeating step A to step B, or in the process of repeating steps A to C, Y adjusted first food combinations appear, and the scores of the Y adjusted first food combinations all fall within the first preset range.
- the above modules can be implemented by software or hardware, and the latter can be implemented by the following methods, but not limited to this: the above modules are all located in the same processor; or, the above modules can be combined in any combination The forms are located in different processors.
- the embodiment of the present application also provides a storage medium in which a computer program is stored, wherein the computer program is configured to execute the steps in any one of the foregoing food information pushing method embodiments when running.
- the above storage medium may be set to store a computer program for performing the following steps:
- S2 Determine a target food combination matching the first recommended amount and the second recommended amount according to a predetermined food information set
- the above storage medium may include, but is not limited to: a USB flash drive, a read-only memory (Read-Only Memory, ROM for short), a random access memory (Random Access Memory, RAM for short), Various media that can store computer programs, such as removable hard disks, magnetic disks, or optical disks.
- the embodiment of the present application also provides a storage medium in which a computer program is stored, wherein the computer program is configured to execute the steps in any one of the foregoing food information display method embodiments when running.
- the above storage medium may be set to store a computer program for performing the following steps:
- the above storage medium may include, but is not limited to: a USB flash drive, a read-only memory (Read-Only Memory, ROM for short), a random access memory (Random Access Memory, RAM for short), Various media that can store computer programs, such as removable hard disks, magnetic disks, or optical disks.
- modules or steps of this application can be implemented by a general-purpose computing device, and they can be concentrated on a single computing device or distributed in a network composed of multiple computing devices
- they can be implemented with program code executable by the computing device, so that they can be stored in the storage device to be executed by the computing device, and in some cases, can be in a different order than here
- the steps shown or described are performed, or they are made into individual integrated circuit modules respectively, or multiple modules or steps among them are made into a single integrated circuit module for implementation. In this way, the application is not limited to any specific combination of hardware and software.
- the first recommended amount of calories required by the target object per unit time and the second recommended amount of nutrients needed are obtained, and then the first recommended amount and the second recommended amount are determined according to the predetermined food information set Match the target food combination, and push the target food combination to the target terminal, that is, the pushed target food combination is obtained according to the first recommended amount of calories and the second recommended amount of nutrients, so that it can push more for the target object Reasonable food combination, rather than choosing the corresponding food according to personal preference, solves the problem that related technologies fail to take into account the intake of calories and nutrients at the same time to consider food matching, and achieves the effect of making the user's diet more reasonable.
Landscapes
- Health & Medical Sciences (AREA)
- Engineering & Computer Science (AREA)
- Nutrition Science (AREA)
- Epidemiology (AREA)
- General Health & Medical Sciences (AREA)
- Medical Informatics (AREA)
- Primary Health Care (AREA)
- Public Health (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Medical Treatment And Welfare Office Work (AREA)
Abstract
Description
本申请涉及饮食领域,具体而言,涉及一种食物信息的推送方法及装置、存储介质。This application relates to the field of diet, and specifically to a method and device for pushing food information, and a storage medium.
随着人们生活水平的提高,供人们选择的食物的种类也越来越多。但是,人们在日常生活中通常是根据个人喜好来选择相应的食物,例如,有人喜欢油腻的食物、有人喜欢麻和/或辣的食物、有人喜欢甜食等等。长此以往,往往会给身体带来负面的影响,如,肥胖、炎症、各种慢性疾病等等。现有技术中也存在着一些仅根据简单的热量计算来选择食物的技术方案。但是,这种方法仅考虑了通过食物满足人体热量维度的需求,长期食用通过该方法选择出来的食物,同样可能不利于身体健康。With the improvement of people's living standards, there are more and more types of food for people to choose. However, people usually choose corresponding foods according to their personal preferences in daily life, for example, some people like greasy food, some people like hemp and/or spicy food, some people like sweets, and so on. If things go on like this, it will often bring negative effects to the body, such as obesity, inflammation, various chronic diseases and so on. There are also some technical solutions in the prior art that only select food based on simple calorie calculations. However, this method only considers food to meet the needs of the human body's caloric dimension, and long-term consumption of food selected by this method may also be detrimental to health.
发明内容Summary of the invention
本申请实施例提供了一种食物信息的推送方法及装置、存储介质,以至少解决相关技术中未能同时兼顾热量和营养素的摄入考虑进行食物搭配的问题。The embodiments of the present application provide a method, a device, and a storage medium for pushing food information, so as to at least solve the problem in the related art that the intake of calories and nutrients cannot be taken into consideration at the same time for food matching.
根据本申请的一个实施例,提供了一种食物信息的推送方法,包括:获取目标对象在单位时间内所需的热量的第一推荐量以及所需的营养素的第二推荐量;在食物信息集合确定出与所述第一推荐量和所述第二推荐量匹配的目标食物组合;向目标终端推送所述目标食物组合。According to an embodiment of the present application, a method for pushing food information is provided, which includes: obtaining a first recommended amount of calories required by a target object per unit time and a second recommended amount of nutrients required by the target object; The set determines a target food combination that matches the first recommended amount and the second recommended amount; and pushes the target food combination to a target terminal.
根据本申请的一个实施例,提供了一种食物信息的推送装置,包括:第一获取模块,设置为获取目标对象在单位时间内所需的热量的第一推荐量以及所需的营养素的第二推荐量;确定模块,设置为在食物信息集合确定出与所述第一推荐量和所述第二推荐量匹配的目标食物组合;推送模块,设置为向目标终端推送所述目标食物组合。According to an embodiment of the present application, there is provided a food information pushing device, including: a first acquisition module configured to acquire the first recommended amount of calories required by a target object per unit time and the first recommended amount of nutrients required 2. Recommended amount; a determining module, configured to determine a target food combination matching the first recommended amount and the second recommended amount in the food information collection; a pushing module, configured to push the target food combination to a target terminal.
根据本申请的一个实施例,提供了一种存储介质,所述存储介质中存储有计算机程序,其中,所述计算机程序被设置为运行时执行所述食物信息的推送方法中所述的方法。According to an embodiment of the present application, there is provided a storage medium in which a computer program is stored, wherein the computer program is configured to execute the method described in the method for pushing food information when running.
通过本申请,获取目标对象在单位时间内所需的热量的第一推荐量以及所需的营养素的第二推荐量,进而根据预定的食物信息集合确定出与第一推荐量和第二推荐量匹配的目标食物组合,并向目标终端推送目标食物组合,也就是说,该推送的目标食物组合是根据热量的第一推荐量和营养素的第二推荐量得到的,从而能够为目标对象推送更加合理的食物组合,而不是根据个人喜好选择相应的食物,从而解决了相关技术中未能同时兼顾热量和营养素的摄入考虑进行食物搭配的问题,达到了使用户饮食更加合理的效果。Through this application, the first recommended amount of calories required by the target object per unit time and the second recommended amount of nutrients needed are obtained, and then the first recommended amount and the second recommended amount are determined according to the predetermined food information set Match the target food combination, and push the target food combination to the target terminal, that is, the pushed target food combination is obtained according to the first recommended amount of calories and the second recommended amount of nutrients, so that it can push more for the target object Reasonable food combination, rather than choosing the corresponding food according to personal preference, solves the problem that related technologies fail to take into account the intake of calories and nutrients at the same time to consider food matching, and achieves the effect of making the user's diet more reasonable.
此处所说明的附图用来提供对本申请的进一步理解,构成本申请的一部分,本申请的示意性实施例及其说明用于解释本申请,并不构成对本申请的不当限定。在附图中:The drawings described here are used to provide a further understanding of the application and constitute a part of the application. The exemplary embodiments and descriptions of the application are used to explain the application, and do not constitute an improper limitation of the application. In the drawings:
图1是根据本申请实施例的饮食信息的推送方法的流程图;Fig. 1 is a flowchart of a method for pushing diet information according to an embodiment of the present application;
图2是根据本申请实施例的饮食信息的显示方法的流程图;Fig. 2 is a flowchart of a method for displaying diet information according to an embodiment of the present application;
图3是根据本申请实施例的饮食信息的推送装置的结构示意图;Fig. 3 is a schematic structural diagram of a device for pushing diet information according to an embodiment of the present application;
图4是根据本申请实施例的饮食信息的显示装置的结果示意图。Fig. 4 is a schematic diagram of the results of the display device for diet information according to an embodiment of the present application.
下文中将参考附图并结合实施例来详细说明本申请。需要说明的是,在不冲突的情况下,本申请中的实施例及实施例中的特征可以相互组合。Hereinafter, the present application will be described in detail with reference to the drawings and in conjunction with the embodiments. It should be noted that the embodiments in the present application and the features in the embodiments can be combined with each other if there is no conflict.
需要说明的是,本申请的说明书和权利要求书及上述附图中的术语“第一”、“第二”等是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。It should be noted that the terms “first” and “second” in the description and claims of the present application and the above drawings are used to distinguish similar objects, and do not have to be used to describe a specific order or sequence.
本申请所述的食物信息集合是指包含有多种食物名称及各种食物所属类别的一个集合;进一步的,所述食物信息集合还可以包括各种食物的产地、价格、上市时节、功效(例如降血压、降血脂、降胆固醇等)、嘌呤含量、升糖指数等信息。The food information collection described in this application refers to a collection that contains a variety of food names and categories of various foods; further, the food information collection may also include the origin, price, time of sale, and efficacy of various foods ( Such as lowering blood pressure, lowering blood fat, lowering cholesterol, etc.), purine content, glycemic index and other information.
实施例1Example 1
在本实施例中提供了一种饮食信息的推送方法,图1是根据本申请实施例的饮食信息的推送方法的流程图,如图1所示,该流程包括如下步骤:In this embodiment, a method for pushing diet information is provided. FIG. 1 is a flowchart of a method for pushing diet information according to an embodiment of the present application. As shown in FIG. 1, the process includes the following steps:
步骤S102,获取目标对象在单位时间内所需的热量的第一推荐量以及所需的营养素的第二推荐量;Step S102, obtaining the first recommended amount of calories required by the target object per unit time and the second recommended amount of nutrients required by the target object;
步骤S104,根据预定的食物信息集合确定出与第一推荐量和第二推荐量匹配的目标食物组合;Step S104: Determine a target food combination matching the first recommended amount and the second recommended amount according to the predetermined food information set;
步骤S106,向目标终端推送目标食物组合。Step S106: Push the target food combination to the target terminal.
通过上述步骤S102至步骤S106,获取目标对象在单位时间内所需的热量的第一推荐量以及所需的营养素的第二推荐量,进而根据预定的食物信息集合确定出与第一推荐量和第二推荐量匹配的目标食物组合,并向目标终端推送目标食物组合,也就是说,该推送的目标食物组合是根据热量的第一推荐量和营养素的第二推荐量得到的,从而能够为目标对象推送更加合理的食物组合,而不是根据个人喜好选择相应的食物,从而解决了相关技术中未能同时兼顾热量和营养素的摄入考虑进行食物搭配的问题,达到了使用户饮食更加合理的效果。Through the above steps S102 to S106, the first recommended amount of calories required by the target object per unit time and the second recommended amount of nutrients needed are obtained, and then the sum of the first recommended amount and the first recommended amount are determined according to the predetermined food information set. The target food combination that matches the second recommended amount and push the target food combination to the target terminal, that is, the pushed target food combination is obtained according to the first recommended amount of calories and the second recommended amount of nutrients, so that it can be The target object pushes a more reasonable food combination, rather than choosing the corresponding food according to personal preferences, thus solving the problem of not taking into account the intake of calories and nutrients at the same time in the related technology to consider food matching, and achieving a more reasonable diet for users effect.
需要说明的是,本实施例中涉及到的方法步骤的执行主体可以是服务器或终端,其中,终端包括:手机、平板电脑等设备。It should be noted that the execution subject of the method steps involved in this embodiment may be a server or a terminal, where the terminal includes: a mobile phone, a tablet computer, and other devices.
此外,对于本实施例步骤S102中涉及到的对于单位时间内所需的热量的第一推荐量,在本实施例的可选实施方式中可以根据人体测量法得到,当然这仅仅是举例说明,其他可以得到该第一推荐量的方式也是在本申请的保护范围之内的,下面以人体测量法为例,对如何得到该第一推荐量的方式进行举例说明,该人体测量法是根据目标对象的个人信息以及预估的 运动强度得到的,此外该人体测量法是以1天为单位时间为例,具体方式如下:In addition, the first recommended amount of heat required per unit time involved in step S102 of this embodiment can be obtained according to an anthropometric method in an optional implementation of this embodiment. Of course, this is only an example. Other ways to obtain the first recommended amount are also within the scope of protection of this application. The following takes an anthropometric method as an example to illustrate how to obtain the first recommended amount. This anthropometric method is based on the target The subject’s personal information and estimated exercise intensity are obtained. In addition, the anthropometric method uses 1 day as an example. The specific method is as follows:
目标对象的个人信息包括但不限于:年龄、性别、身高、体重、预估的运动强度;目标对象的个人信息还可进一步包括特性信息,所述特性信息包括不限于当前时令、籍贯、常住地、当前所在位置、口味、身体状态、价格要求等;所述身体状态包括但不限于:是否患有痛风、糖尿病和/或高血压等慢性疾病。基于此,人体测量法的方式包括如下公式:The personal information of the target object includes but is not limited to: age, gender, height, weight, estimated exercise intensity; the personal information of the target object may further include characteristic information, including but not limited to current season, hometown, and usual residence , Current location, taste, physical condition, price requirements, etc.; the physical condition includes, but is not limited to: whether you have chronic diseases such as gout, diabetes, and/or hypertension. Based on this, the anthropometric method includes the following formula:
人体基础代谢率(BMR kcal,男)=10*体重(kg)+6.25*身高(cm)-5*年龄(年)+5 式1Human basal metabolic rate (BMR kcal, male) = 10 * weight (kg) + 6.25 * height (cm)-5 * age (years) + 5 formula 1
人体基础代谢率(BMR kcal,女)=10*体重(kg)+6.25*身高(cm)-5*年龄(年)-161 式2Human basal metabolic rate (BMR kcal, female) = 10 * weight (kg) + 6.25 * height (cm)-5 * age (years)-161 formula 2
第一推荐量(kcal)=BMR*预估的运动强度(或称运动系数) 式3The first recommended amount (kcal) = BMR* estimated exercise intensity (or exercise coefficient) Equation 3
其中,运动强度或运动系数可按如表1所示;Among them, exercise intensity or exercise coefficient can be as shown in Table 1;
表1Table 1
在本实施例的可选实施方式中,食物种类和热量之间存在预设的第一关系;其中,该第一关系用于指示不同热量需求与不同的食物种类分别应提供的热量之间的对应关系。也就是说,可以通过该第一关系,在通过上述人体测量法得到目标对象的第一推荐量后,能够确定不同的食物种类分别应提供的热量。在具体的应用场景中,该第一关系可以是预设的饮食标 准,进而可以得到该第一推荐量所对应的食物种类及其所需的热量,其中,该饮食标准包括但不限于:得舒饮食法、健康素食饮食法、中国居民膳食指南-膳食宝塔(例如2016版)、地中海饮食法。In an optional implementation of this embodiment, there is a preset first relationship between food types and calories; wherein, the first relationship is used to indicate the relationship between different calorie requirements and the calories that different food types should provide. Correspondence. That is to say, through the first relationship, after the first recommended amount of the target object is obtained through the above-mentioned anthropometric method, the calories that should be provided by different food types can be determined. In a specific application scenario, the first relationship may be a preset diet standard, and then the type of food corresponding to the first recommended amount and the required calories can be obtained, where the diet standard includes but is not limited to: Shu Diet, Healthy Vegetarian Diet, Chinese Resident Dietary Guidelines-Diet Pagoda (for example, 2016 edition), Mediterranean diet.
下面,以地中海饮食法为例,按200kcal的增量从1000-3200kcal分成11种卡路里类别,分别针对13类食物需要提供的热量值形成表2;Below, taking the Mediterranean diet as an example, according to the increment of 200kcal, it is divided into 11 calorie categories from 1000-3200kcal, and Table 2 is formed for the calorie value provided by 13 types of foods respectively;
表2Table 2
需要说明的是,上述表2仅仅是本申请中第一推荐量所对应的食物种类及其所需的热量的优选实施方式,在本申请中并不限于上述表2中所对应的第一关系,该第一关系所指示的对应关系还是可以是其他形式。例如表3,具体记载了各类食物的重量与不同能量摄入水平的对应关系,该关系可通过各类食物的平均能量密度换算成本申请所述的第一关系,即指示不同热量需求与不同的食物种类分别应提供的热量之间的对应关系。It should be noted that the above table 2 is only a preferred embodiment of the food types corresponding to the first recommended amount in this application and the required calories, and this application is not limited to the first relationship corresponding to the above table 2 , The corresponding relationship indicated by the first relationship may still be in other forms. For example, Table 3 specifically records the corresponding relationship between the weight of various foods and different energy intake levels. This relationship can be calculated by converting the average energy density of various foods into the first relationship described in the application, that is, indicating different calorie requirements and different The corresponding relationship between the calories that should be provided by the food types.
表3table 3
由上述表2可知,不同的热量对应的13种食物分别具有对应的热量;如果单位时间为1天,且根据人体测量得到目标对象的第一推荐量为2000kcal,则从可以从表2中确定出卡路里摄入量为2000kcal的情况,需要的13种食物所对应的卡路里含量,如表2的第6列所示:水果需要提供267.0千卡路里、淀粉类蔬菜需要提供41.7千卡路里等等。It can be seen from the above table 2 that the 13 foods corresponding to different calories have corresponding calories; if the unit time is 1 day, and the first recommended amount of the target object is 2000kcal according to anthropometric measurements, it can be determined from Table 2 If the calorie intake is 2000kcal, the calorie content corresponding to the 13 kinds of foods required is shown in the sixth column of Table 2: Fruits need to provide 267.0 kilocalories, starchy vegetables need to provide 41.7 kilocalories, and so on.
需要说明的是,本申请中的第一推荐量可以是一个范围值,也可以是一个固定的点值。所述在第一推荐量不变的情况下,是指各具体食物组合所提供的热量均在第一推荐量所属的范围值内,或各具体食物组合所提供的热量均为第一推荐量所对应的点值,或各具体食物组合所提供的热量均落在第一推荐量所对应的点值左右(例如:正负5%或正负10%)。It should be noted that the first recommended amount in this application may be a range value or a fixed point value. Under the condition that the first recommended amount remains unchanged, it means that the calories provided by each specific food combination are within the range of the first recommended amount, or the calories provided by each specific food combination are all the first recommended amount The corresponding point value, or the calories provided by each specific food combination, fall around the point value corresponding to the first recommended amount (for example: plus or minus 5% or plus or minus 10%).
此外,在本实施例的可选实施方式中,营养素和热量之间存在预设的第二关系;其中,该第二关系用于指示不同热量需求与各营养素的推荐摄入量之间的对应关系。在本实施例的可选实施方式中,对于不同的热量推荐量对应的营养素的含量可以如表4所示,当然表4也仅仅是举例说明,对于其他具体形式的第二关系也是在本申请的保护范围之内。In addition, in an optional implementation of this embodiment, there is a preset second relationship between nutrients and calories; wherein, the second relationship is used to indicate the correspondence between different caloric requirements and the recommended intake of each nutrient relationship. In an alternative implementation of this embodiment, the nutrient content corresponding to different recommended amounts of calories can be shown in Table 4. Of course, Table 4 is only an example. The second relationship for other specific forms is also in this application. Within the scope of protection.
表4Table 4
需要说明的是,在本申请中,所述第一关系和第二关系可同时或分别存储于终端侧或服务器侧。It should be noted that in this application, the first relationship and the second relationship may be stored on the terminal side or the server side at the same time or separately.
在本实施例的可选实施方式中,本实施例的方法步骤还可以包括:In an alternative implementation of this embodiment, the method steps of this embodiment may further include:
步骤S108,获取食物种类;其中,食物种类的数量为N,N为正整数;Step S108, obtaining food types; where the number of food types is N, and N is a positive integer;
需要说明的是,该步骤S108可以执行在上述步骤S102至步骤S106中的任一步骤之前或之后,此外,对于该步骤S108中涉及到的食物种类N可以是指现有的所有食物种类,也可以是所有食物种类中的一部分,例如表2中的13类食物。也就是说,可以根据实际情况来获取该食物种类。It should be noted that this step S108 can be performed before or after any of the above steps S102 to S106. In addition, the food type N involved in this step S108 can refer to all existing food types. It can be part of all food types, such as the 13 types of food in Table 2. In other words, the food category can be obtained according to the actual situation.
在本实施例的可选实施方式中,本实施例步骤S104中涉及到的在食物信息集合确定出与第一推荐量和第二推荐量匹配的目标食物组合方式,可以是:In an optional implementation manner of this embodiment, the target food combination mode that matches the first recommended amount and the second recommended amount in the food information set involved in step S104 in this embodiment may be:
步骤S104-11,根据食物种类和第一推荐量初步确定出第一食物组合;Step S104-11: Preliminarily determine the first food combination according to the food type and the first recommended amount;
对于该步骤S104-11,在确定食物种类和第一推荐量后就可以初步确定出第一食物组合,以上述表2为例,如果食物种类是13种,而确定的第一推荐量为2000kcal/day,则初步确定出的第一食物组合中各类食物应提供的热量为:水果267.0kcal;淀粉类蔬菜41.7kcal;其他蔬菜41.2kcal;红橙紫蔬菜10.0kcal;深绿蔬菜25.7kcal;豆类和豌豆;151.9kcal;全谷物299.4kcal;精致谷物276.2kcal;肉蛋269.9kcal;海鲜116.8kcal;坚果种子大豆67.6kcal;食用油264.8kcal;乳制品167.8kcal。进一步结合各具体食物的能量密度,在一具体实施例中,可随机得出第一食物组合,具体如表5所示。For this step S104-11, the first food combination can be preliminarily determined after the food type and the first recommended amount are determined. Taking Table 2 as an example, if there are 13 food types, and the determined first recommended amount is 2000kcal /day, the preliminarily determined calories provided by various foods in the first food combination are: fruits 267.0kcal; starchy vegetables 41.7kcal; other vegetables 41.2kcal; red orange and purple vegetables 10.0kcal; dark green vegetables 25.7kcal; Beans and peas; 151.9kcal; whole grains 299.4kcal; refined grains 276.2kcal; meat and eggs 269.9kcal; seafood 116.8kcal; nut seeds and soybeans 67.6kcal; edible oil 264.8kcal; dairy products 167.8kcal. Further combining the energy density of each specific food, in a specific embodiment, the first food combination can be randomly obtained, as shown in Table 5.
表5table 5
需要说明的是,上述是第一推荐量为2000kcal/day的情况下,随机出的第一食物组合,而在第一推荐量为其他取值时,在具体应用场景中可以根据上述表2和各具体食物的能量密度确定其他的第一食物组合。It should be noted that the above is the first food combination randomly selected when the first recommended amount is 2000kcal/day, and when the first recommended amount is other values, in specific application scenarios, the above table 2 and The energy density of each specific food determines other first food combinations.
步骤S104-12,在第一推荐量不变的情况下,通过启发式搜索的方式或随机搜索的方式对第一食物组合中食物及对应的食物量进行调整,以确定出与第二推荐量匹配的目标食物组合;Step S104-12: Under the condition that the first recommended amount remains unchanged, the food in the first food combination and the corresponding food amount are adjusted through heuristic search or random search to determine the second recommended amount Matching target food combination;
需要说明的是,本实施例中所需的营养素有多种;所需的营养素的第二推荐量包括与所需的不同营养素分别对应的第三推荐量。也就是说,本实施例中涉及到的第二推荐量是包括了各个具体营养素所对应的第三推荐量的,在具体应用场景中结合上述表2和表4可知,在第一推荐量为2000kcal/day的情况下,该第二推荐量包括了各个具体营养素的第三推荐量,例如,蛋白质为89g;碳水化合物为259g;纤维类食物为31g等等。It should be noted that there are many kinds of nutrients required in this embodiment; the second recommended amount of required nutrients includes the third recommended amount respectively corresponding to different required nutrients. That is to say, the second recommended amount involved in this embodiment includes the third recommended amount corresponding to each specific nutrient. In a specific application scenario, combining Table 2 and Table 4 above, it can be seen that the first recommended amount is In the case of 2000kcal/day, the second recommended amount includes the third recommended amount of each specific nutrient, for example, protein is 89g; carbohydrate is 259g; fiber food is 31g and so on.
所述随机搜索方法简单,易于执行;所述启发式搜索的方法相对随机搜索的方案,在食物种类、营养素数量、各食物种类下具体食物较多的情况下,可大大提高确定出所述目标食物组合的效率。The random search method is simple and easy to implement; the heuristic search method is relatively random search scheme, in the case of food types, nutrient quantities, and specific foods under each food type, it can greatly improve the determination of the target The efficiency of food combinations.
其中,对于该步骤S104-12在本实施例的可选实施方式中,可以是:Wherein, for this step S104-12 in an optional implementation of this embodiment, it may be:
步骤A,调整步骤:分别用食物信息集合中与第一食物组合中的第一食物属于同一食物种类的食物替换第一食物组合中的第一食物,并调整每次替换上去的食物的量,得到每一次调整后食物组合的分值;其中,调整后的食物组合的分值是根据每次调整后的食物组合中的营养素含量与第二推荐量的比较结果得到的。Step A, adjustment step: replace the first food in the first food combination with foods in the food information set that belong to the same food category as the first food in the first food combination, and adjust the amount of food replaced each time, Obtain the score of each adjusted food combination; wherein, the score of the adjusted food combination is obtained according to the comparison result of the nutrient content in each adjusted food combination with the second recommended amount.
其中,在具体应用场景中,以上述地中海饮食为例,则本实施例第一 食物组合中食物的种类有13种,在第一次调整过程中选择其中一种食物种类作为调整对象,例如选择的食物种类为13种中的水果,而该水果种类中的食物包括一种或多种具体的水果(如葡萄、香蕉、苹果、梨子等),也就是说,首先只对第一食物组合中属于水果类的食物进行调整,除水果类的其他种类的食物不对其进行替换。具体的替换方式为:从食物信息集合中以随机或按一定顺序的形式,以具体的水果去替换该第一食物组合中的水果,如用荔枝去替换第一食物组合中的葡萄,同时结合原第一食物组合中的水果所需提供的热量,以及荔枝的能量密度,确定替换后的第一食物组合中荔枝的量,或用西瓜去替换第一食物组合中的香蕉,同时结合原第一食物组合中的水果所需提供的热量,以及西瓜的能量密度,确定替换后的第一食物组合中西瓜的量等等。Among them, in a specific application scenario, taking the above-mentioned Mediterranean diet as an example, there are 13 types of food in the first food combination of this embodiment. In the first adjustment process, one of the food types is selected as the adjustment object, for example, select The food category of is 13 kinds of fruits, and the food in this fruit category includes one or more specific fruits (such as grapes, bananas, apples, pears, etc.), that is to say, only the first food combination Foods belonging to fruits are adjusted, and foods other than fruits are not replaced. The specific replacement method is as follows: randomly or in a certain order from the food information set, replace the fruits in the first food combination with specific fruits, such as replacing the grapes in the first food combination with lychees, and combine them simultaneously To determine the amount of lychees in the first food combination after the replacement, or to replace the bananas in the first food combination with watermelon, and combine the original food The calories required by the fruit in a food combination, the energy density of the watermelon, the amount of watermelon in the first food combination after replacement, and so on are determined.
此外,需要说明的是,调整后的食物组合的分值是根据每次调整后营养素含量与第二推荐量的比较结果得到的是指:将每一次调整后的各个营养素的含量分别对应的第三推荐量进行比较得到各个营养素的分值,综合各个营养素的分值得到调整后的食物组合的分值。In addition, it should be noted that the score of the adjusted food combination is obtained based on the comparison between the nutrient content after each adjustment and the second recommended amount. This means that the content of each nutrient after each adjustment is corresponding to the first recommended amount. Three recommended amounts are compared to obtain the score of each nutrient, and the score of each nutrient is synthesized to obtain the adjusted food combination score.
其中,需要说明的是,本实施例中的第三推荐量可以是一个范围值,也可以是一个固定的点值;但是,在本实施例中优选为范围值;每一个营养素都具有对应的第三推荐量;基于此,将每一次替换后的各个营养素的含量分别与对应的第三推荐量进行比较得到各个营养素的分值的方式有多种,如方式(1)确定每一次替换后的各个营养素的含量是否分别落入对应的第三推荐量所表示的取值范围内,落入取值范围的营养素得到相应的分值,没有落入该取值范围的即为零分。方式(2)确定每一次替换后的食物组合的各个营养素的含量是否分别落入对应的第三推荐量所表示的取值范围内,落入取值范围的营养素得到相应的分值,进而计算没有落入该取值范围的营养素含量与对应的第三推荐量之间的比值,根据比值得到相应的分值。需要说明的是,上述方式仅仅是举例说明将每一次调整后的各个营养素的含量分别对应的第三推荐量进行比较得到各个营养素的分值的方式,对于其他的根据比较得到分值的方式也是在本申请的保护范 围之内的。Among them, it should be noted that the third recommended amount in this embodiment can be a range value or a fixed point value; however, in this embodiment, it is preferably a range value; each nutrient has a corresponding The third recommended amount; based on this, there are many ways to obtain the score of each nutrient by comparing the content of each nutrient after each replacement with the corresponding third recommended amount, such as method (1) Determine after each replacement Whether the content of each nutrient falls within the value range indicated by the corresponding third recommended amount, the nutrient falling within the value range gets the corresponding score, and the nutrient that does not fall within the value range is zero. Method (2) Determine whether the content of each nutrient of the food combination after each replacement falls within the value range indicated by the corresponding third recommended amount, and the nutrients falling into the value range get the corresponding score, and then calculate The ratio between the nutrient content that does not fall into the value range and the corresponding third recommended amount, and the corresponding score is obtained according to the ratio. It should be noted that the above method is only an example to illustrate the method of comparing the third recommended amount of each nutrient content after each adjustment to obtain the score of each nutrient. The same is true for other methods of obtaining scores based on comparison. Within the protection scope of this application.
以方式(1)为例,如果本实施例中涉及到的营养素有36个,调整后的营养素落入第三推荐量所表示的取值范围计1分(当然也可以是其他计分制)的营养素有20个,没有落入的计0分的营养素有16,因此统计调整后得分的营养素的分值的和作为该食物组合的分值,即该食物组合的分值为20分。Taking method (1) as an example, if there are 36 nutrients involved in this example, the adjusted nutrients fall within the value range indicated by the third recommended amount and count 1 point (of course, other scoring systems can also be used) There are 20 nutrients for food, and the nutrients that do not fall into 0 points are 16. Therefore, the sum of the scores of the nutrients after the statistical adjustment is used as the score of the food combination, that is, the score of the food combination is 20 points.
需要说明的是:第一食物组合、调整后的食物组合中各个营养素的含量是根据相应食物组合中各具体食物的量以及各具体食物的各营养素密度计算而得的。It should be noted that the content of each nutrient in the first food combination and the adjusted food combination is calculated based on the amount of each specific food in the corresponding food combination and the density of each nutrient of each specific food.
需要说明的是,本申请中的营养素及数量可根据实际情况进行相应的取值,也就是说,本申请中的营养素的选择范围包括但不限于上述表4所示。It should be noted that the nutrients and quantities in this application can be selected according to actual conditions, that is, the selection range of nutrients in this application includes but is not limited to those shown in Table 4 above.
步骤B,随机步骤:将前一步骤A中的所有食物组合的分值依次排列,并按排列顺序对各食物组合分别给予对应的索引,对前一步骤A中的所有食物组合的分值进行求和计算得到总数,以得到的总数为随机范围,在该随机范围内随机出一个随机数值,以所述随机数值所对应的索引对应的食物组合作为调整后的食物组合。Step B, random step: arrange the scores of all food combinations in the previous step A in order, and give corresponding indexes to each food combination in the order of arrangement, and perform the scores of all the food combinations in the previous step A The sum is calculated to obtain the total, and the obtained total is a random range, a random value is randomly generated within the random range, and the food combination corresponding to the index corresponding to the random value is used as the adjusted food combination.
需要说明的是,所述依次排列优选为按替换顺序先后排列,或按分值高低排列,或随机排列等等;所述前一步骤A中的所有食物组合,是指在所述步骤B之前最近的一次的步骤A中出现的所有食物组合,或者在所述步骤B之前最近的一次的步骤A中出现的除第一食物组合之外的所有食物组合;优选为在所述步骤B之前最近的一次的步骤A中出现的所有食物组合,本优选方案可进一步提高获得目标食物组合的效率。It should be noted that the sequential arrangement is preferably arranged in the order of replacement, or arranged according to the score value, or arranged randomly, etc.; all the food combinations in the previous step A refer to before the step B All the food combinations that occurred in the most recent step A, or all the food combinations that occurred in the most recent step A before the step B, except for the first food combination; preferably, the most recent food combination before the step B For all the food combinations that appeared in step A at one time, this preferred solution can further improve the efficiency of obtaining the target food combination.
其中,所述步骤B优选为:将前一步骤A中的所有食物组合的分值进行归一化处理,并将归一化处理后的结果依次排列,并按排列顺序对各食物组合分别给予对应的索引,对当次步骤B中所有归一化处理后的结果进行求和计算得到总数,以得到的总数为随机范围,在该随机范围内随机 出一个随机数值,以所述随机数值所对应的索引对应的食物组合作为调整后的食物组。Wherein, the step B is preferably: normalize the scores of all food combinations in the previous step A, and arrange the normalized results in order, and give each food combination in the order of arrangement. The corresponding index is calculated by summing all the normalized results in the current step B to obtain the total number. The total number obtained is the random range, and a random value is randomly selected within the random range. The random value is determined by the random value. The food combination corresponding to the corresponding index is used as the adjusted food group.
需要说明的是,所述归一化的方式有多种,包括但不限于按总和为一确定数归一化,或按最大数为一确定数进行归一化等等。It should be noted that there are many ways of normalization, including but not limited to normalization according to the sum as a certain number, or normalization according to the maximum number as a certain number, and so on.
更进一步的,将步骤B,随机步骤中的各食物组合的分值分别按如下优选方法处理后再执行相应步骤:Furthermore, in step B, the scores of each food combination in the random step are processed according to the following preferred methods, and then the corresponding steps are executed:
以自然对数的底数e作为底数,以及各食物组合的分值与预设值的乘积结果为指数,得到各初步处理后的食物组合的分值;Using the base e of the natural logarithm as the base, and the product of the score of each food combination and the preset value as the index, the score of each food combination after preliminary processing is obtained;
所述步骤B具体为:The step B is specifically:
将前一步骤A中的所有初步处理后的食物组合的分值进行归一化处理,并将归一化处理后的结果依次排列,并按排列顺序对前一步骤A中的各食物组合分别给予对应的索引,对当次步骤B中的所有归一化处理后的结果进行求和计算得到总数,以得到的总数为随机范围,在该随机范围内随机出一个随机数值,以所述随机数值所对应的索引对应的食物组合作为调整后的食物组。Normalize the scores of all the food combinations after the preliminary treatment in the previous step A, and arrange the results after the normalization in order, and separate the food combinations in the previous step A in the order of arrangement Given the corresponding index, sum up all the normalized results in step B of the current time to calculate the total number, and use the total number as a random range, and randomly select a random value within the random range. The food combination corresponding to the index corresponding to the value is used as the adjusted food group.
优选的,该预设值在1.1-30之间,更优选在2-20之间。Preferably, the preset value is between 1.1-30, more preferably between 2-20.
需要说明的是,通过上述优选方法处理各食物组合的分值,可增大各食物组合的分值之间的差距,能提高后续通过随机数值对应得到食物组合的分值落入较高的分值区间的概率,从而进一步提高获得所述目标食物组合的效率。It should be noted that processing the scores of each food combination by the above-mentioned optimization method can increase the gap between the scores of each food combination and increase the scores of the food combinations obtained through random numerical correspondence to a higher score. The probability of the value interval, thereby further improving the efficiency of obtaining the target food combination.
在具体的应用场景中,对于归一化处理的方式可以是:所有食物替换后得到的计算结果之和归一化为1,每次食物替换后根据其索引值,并按照调整食物的顺序从0至1之间依次排序;进而在0-1之间随机一个数R,以R所在索引值对应的食物组合确定为调整后的食物组合。In a specific application scenario, the normalization process can be: the sum of the calculation results obtained after all food replacements is normalized to 1, and each time the food is replaced according to its index value, and the order of the food is adjusted from Sort in order from 0 to 1; and then a random number R between 0-1, and the food combination corresponding to the index value of R is determined as the adjusted food combination.
步骤C,第一循环步骤:以前一次步骤B所得的调整后的食物组合作为后一次步骤A的第一食物组合,以及更换在再次执行步骤A的过程中进行替换的第一食物所属的食物种类为原则,重复执行步骤A至步骤B, 直至第一食物组合中的N种食物均执行过步骤A至步骤B的调整。Step C, the first cycle step: the adjusted food combination obtained in the previous step B is used as the first food combination in the next step A, and the food type of the first food to be replaced in the process of performing step A again is replaced In principle, steps A to B are repeated until all N foods in the first food combination have been adjusted from step A to step B.
也就是说,在对固定的一指定种类食物调整完后,将该调整后的食物组合作为下一次调整的对象,继续对第一食物组合中的其他种类的食物分别进行调整,直到所有N种类均被调整。例如,在水果类的食物均被替换后,则需要对第一食物组合中的其他类食物进行调整,如海鲜类食物,该替换的方式和替换水果的方式是一致的,如果海鲜类食物有多种(鱼、虾、花蛤、扇贝等),则也是依次对具体海鲜类食物进行替换,并根据相应食物的热量密度计算替换后具体海鲜类食物的量,得到调整后的食物组合,直到该第一食物组合中的所有种类的食物均被替换过。In other words, after adjusting a fixed specified type of food, use the adjusted food combination as the object of the next adjustment, and continue to adjust the other types of food in the first food combination until all N types are adjusted. Have been adjusted. For example, after all fruit foods are replaced, it is necessary to adjust other foods in the first food combination, such as seafood foods. The replacement method is the same as the fruit replacement method. A variety of (fish, shrimp, clams, scallops, etc.), the specific seafood foods are replaced in turn, and the amount of specific seafood foods after replacement is calculated according to the caloric density of the corresponding foods, and the adjusted food combination is obtained until All types of food in the first food combination have been replaced.
步骤D,第二循环步骤:重复执行上述步骤A至步骤C,直到得到满足预设条件的目标食物组合。Step D, the second cycle step: repeat the above steps A to C until the target food combination that meets the preset conditions is obtained.
可见,对于该步骤D,则是在第一次对所有食物替换后,还可以再次循环执行上述替换操作,直到出现满足预设条件的目标食物组合。It can be seen that for this step D, after replacing all the foods for the first time, the above-mentioned replacement operation can be repeated again until the target food combination that meets the preset conditions appears.
优选的,预设条件包括以下至少之一:Preferably, the preset conditions include at least one of the following:
(1)重复执行步骤A至步骤C的次数达到预设次数;(1) The number of repeated steps A to C reaches the preset number;
对于该方式(1),在本实施例中该预设次数取值范围可以是10~30次,当然这仅仅是举例说明,其他的预设次数的范围可以的,可以根据实际情况进行相应的设置,在本申请中并不对此进行限定。For this method (1), in this embodiment, the preset number of times can be in the range of 10 to 30 times. Of course, this is only an example. The range of other preset times is possible, and the corresponding can be done according to the actual situation. The setting is not limited in this application.
(2)在重复执行步骤A至步骤B,或重复执行步骤A至C过程中,出现X个调整后的第一食物组合,且X个调整后的第一食物组合各自所含有的第一顺位营养素的量均落入第二推荐量所指示的范围;X为正整数。(2) In the process of repeating steps A to B, or repeating steps A to C, there are X adjusted first food combinations, and each of the X adjusted first food combinations contains the first order The amount of bit nutrients all fall within the range indicated by the second recommended amount; X is a positive integer.
对于该方式(2),由于营养素可以根据实际情况(日常所需量或者个人情况)对其进行优先级排序,也就是说,每个具体营养素都是具有相应的优先级顺序的,在具体应用场景中可以是如表6所示;For this method (2), since nutrients can be prioritized according to actual conditions (daily required amounts or personal conditions), that is to say, each specific nutrient has a corresponding priority order, and in specific applications The scene can be as shown in Table 6;
表6Table 6
由上述表6可知,优先级通过1至4的数字来表示,数字越大优先级越低,因此,对于本实施例中涉及到的第一顺位营养素包括:蛋白质、碳水化合物、膳食纤维、总脂肪。当然,上述第一顺位的营养素仅仅是举例说明,也可以根据每个人的实际情况进行相应的调整,例如,某一个人对于维生素是比较缺乏的,则将维生素相关的营养素的设置为第一顺位的营养素。也即,上述方式(2)只是说明,对于预设条件可以是只需要其中一部分的优先级高的营养素满足了第二推荐量所指示的范围,则可以将该调整后的食物组合作为目标食物组合,而不需要所有营养素均满足该第二推荐量所指示的范围。It can be seen from Table 6 above that the priority is represented by numbers from 1 to 4. The larger the number, the lower the priority. Therefore, the first order nutrients involved in this embodiment include: protein, carbohydrate, dietary fiber, Total fat. Of course, the above-mentioned nutrients in the first order are just examples, and adjustments can also be made according to the actual situation of each person. For example, if a person is relatively deficient in vitamins, set the vitamin-related nutrients as the first Nutrients in order. That is, the above method (2) is only for illustration. For the preset condition, only some of the high priority nutrients are required to meet the range indicated by the second recommended amount, and then the adjusted food combination can be used as the target food Combination, without all nutrients meeting the range indicated by the second recommended amount.
(3)在重复执行步骤A至步骤B,或重复执行步骤A至C过程中,出现Y个调整后的第一食物组合,且Y个调整后的第一食物组合的分值均落入第一预设范围。(3) In the process of repeating steps A to B, or repeating steps A to C, Y adjusted first food combinations appear, and the scores of the Y adjusted first food combinations fall into the first A preset range.
对于该方式(3)由于每一次调整后的食物组合均为得到相应的分值, 只要出现了Y个调整后的第一食物组合的分值落入第一预设范围,则可以将其作为目标食物组合。由于Y的取值是灵活的,即可以根据不同的情况对Y进行取值。如果以35个营养素为例,则最高分为35分,因此,该第一预设范围可以是大于等于30且小于等于35,还可以是大于等于28且小于等于33。该第一预设范围也可以根据实际情况进行相应的取值,在本申请中并不对其进行限定。For this method (3), since each adjusted food combination obtains a corresponding score, as long as there are Y adjusted first food combinations whose scores fall within the first preset range, they can be regarded as Target food combination. Since the value of Y is flexible, that is, the value of Y can be selected according to different situations. If 35 nutrients are taken as an example, the highest score is 35 points. Therefore, the first preset range may be greater than or equal to 30 and less than or equal to 35, or greater than or equal to 28 and less than or equal to 33. The first preset range can also be valued according to actual conditions, which is not limited in this application.
以上述表2和表4为例,对于上述步骤A至步骤B,在具体应用场景中可以是:食物种类为13种,营养素的种类为35种,得到第一食物组合后,假设第一类食物种仅有10种具体的食物,且第一次执行上述步骤A至步骤B时仅对第一食物组合中的第一类食物进行替换,这样包括第一食物组合,可得到十个食物组合的分值,这些分值根据替换的顺序依次11、15、18、20、14、23、28、29、30、25。将这些分值之和进行归一化为1的处理,归一化处理后的分值为:0.05、0.07、0.08、0.09、0.07、0.1、0.13、0.14、0.14、0.11。以1为随机范围,在该随机范围内随机出一个随机数值,以该随机数值所对应的索引对应的食物组合作为调整后的食物组合,继续执行后续步骤D和步骤D。Taking the above Table 2 and Table 4 as an example, for the above steps A to B, in a specific application scenario, there are 13 types of food and 35 types of nutrients. After the first food combination is obtained, assume the first type There are only 10 specific food types for food, and only the first type of food in the first food combination is replaced when the above steps A to B are performed for the first time, so including the first food combination, ten food combinations can be obtained The scores are 11, 15, 18, 20, 14, 23, 28, 29, 30, 25 according to the order of replacement. The sum of these scores is normalized to 1, and the normalized scores are: 0.05, 0.07, 0.08, 0.09, 0.07, 0.1, 0.13, 0.14, 0.14, 0.11. Using 1 as the random range, a random value is randomly generated within the random range, and the food combination corresponding to the index corresponding to the random value is used as the adjusted food combination, and the subsequent steps D and D are continued.
需要说明的是,上述仅仅是举例说明,并不构成对本申请的限定。It should be noted that the above is only an example and does not constitute a limitation to the application.
另外,在上述任一实施例的基础上,还可进一步包括:In addition, on the basis of any of the above embodiments, it may further include:
获取目标对象的个人信息,根据目标对象的个人信息中的特性信息,调整所述食物信息集合;然后再在调整后的食物信息集合确定出与所述第一推荐量和所述第二推荐量匹配的目标食物组合。即,针对所述食物信息集合增加一个以目标对象为基础的筛选步骤。本方案可降低后续步骤的预算量,提高效率,且提供更个性化的适合目标对象的目标食物组合。Acquire the personal information of the target object, adjust the food information set according to the characteristic information in the personal information of the target object; and then determine the difference between the first recommended amount and the second recommended amount in the adjusted food information set Matched target food combination. That is, a screening step based on the target object is added to the food information set. This solution can reduce the budget for subsequent steps, improve efficiency, and provide more personalized target food combinations suitable for target objects.
在本申请的一实施例中,目标对象患有糖尿病,则在食物信息集合中去除升糖指数高于第一预设数值(例如65)的食物,然后再在调整后的食物信息集合确定出与所述第一推荐量和所述第二推荐量匹配的目标食物组合。本实施例能够提供更个性化的适合目标对象的目标食物组合。In an embodiment of the present application, if the target object suffers from diabetes, the food with a glycemic index higher than a first preset value (for example, 65) is removed from the food information set, and then the adjusted food information set determines A target food combination that matches the first recommended amount and the second recommended amount. This embodiment can provide a more personalized target food combination suitable for the target object.
在本申请的一实施例中,目标对象患有痛风,则在食物信息集合中去除嘌呤含量高于第二预设数值(例如180mg/100g)的食物,然后再在调整后的食物信息集合确定出与所述第一推荐量和所述第二推荐量匹配的目标食物组合。本实施例能够提供更个性化的适合目标对象的目标食物组合。In an embodiment of the present application, if the target object suffers from gout, the food with purine content higher than the second preset value (for example, 180mg/100g) is removed from the food information set, and then the adjusted food information set is determined A target food combination that matches the first recommended amount and the second recommended amount is calculated. This embodiment can provide a more personalized target food combination suitable for the target object.
实施例2Example 2
本实施例提供了一种食物信息的显示方法,图2是根据本申请实施例的食物信息的显示方法的流程图,如图2所示,该方法的步骤包括:This embodiment provides a method for displaying food information. FIG. 2 is a flowchart of the method for displaying food information according to an embodiment of the present application. As shown in FIG. 2, the steps of the method include:
步骤S202,获取目标对象在单位时间内所需的热量的第一推荐量以及所需的营养素的第二推荐量;Step S202, obtaining the first recommended amount of calories required by the target object per unit time and the second recommended amount of nutrients required by the target object;
步骤S204,获取在食物信息集合确定出的与第一推荐量和第二推荐量匹配的目标食物组合;Step S204: Obtain the target food combination that matches the first recommended amount and the second recommended amount determined in the food information set;
步骤S206,在目标终端显示目标食物组合。Step S206: Display the target food combination on the target terminal.
通过上述步骤S202至步骤S206,获取目标对象在单位时间内所需的热量的第一推荐量以及所需的营养素的第二推荐量,进而根据预定的食物信息集合确定出与第一推荐量和第二推荐量匹配的目标食物组合,并在目标终端显示该目标食物组合,也就是说,该显示的目标食物组合是根据热量的第一推荐量和营养素的第二推荐量得到的,从而能够为目标对象显示更加合理的食物组合,而不是根据个人喜好选择相应的食物,从而解决了相关技术中未能同时兼顾热量和营养素的摄入考虑进行食物搭配的问题,达到了使用户饮食更加合理的效果。Through the above steps S202 to S206, the first recommended amount of calories needed by the target object per unit time and the second recommended amount of nutrients needed are obtained, and then the sum of the first recommended amount and the first recommended amount are determined according to the predetermined food information set. The target food combination that matches the second recommended amount, and the target food combination is displayed on the target terminal, that is, the displayed target food combination is obtained based on the first recommended amount of calories and the second recommended amount of nutrients, so that Show a more reasonable food combination for the target object, instead of choosing the corresponding food according to personal preference, so as to solve the problem of not taking into account the intake of calories and nutrients at the same time in the related technology to consider the food matching problem, and achieve a more reasonable diet for users Effect.
需要说明的是,本实施例中涉及到的方法步骤的执行主体可以是终端,其中,终端包括:手机、平板电脑等设备。It should be noted that the execution subject of the method steps involved in this embodiment may be a terminal, where the terminal includes: mobile phones, tablet computers and other devices.
此外,对于本实施例步骤S202中涉及到的对于单位时间内所需的热量的第一推荐量,在本实施例的可选实施方式中可以根据人体测量法得到,当然这仅仅是举例说明,其他可以得到该第一推荐量的方式也是在本申请的保护范围之内的,下面以人体测量法为例,对如何得到该第一推荐量的 方式进行举例说明,该人体测量法是根据目标对象的个人信息以及预估的运动强度得到的,此外该人体测量法是以1天为单位时间为例,具体方式如下:In addition, the first recommended amount of heat required per unit time involved in step S202 of this embodiment can be obtained according to an anthropometric method in an optional implementation of this embodiment, of course, this is only an example. Other ways to obtain the first recommended amount are also within the scope of protection of this application. The following takes an anthropometric method as an example to illustrate how to obtain the first recommended amount. This anthropometric method is based on the target The subject’s personal information and estimated exercise intensity are obtained. In addition, the anthropometric method uses 1 day as an example. The specific method is as follows:
目标对象的个人信息包括但不限于:年龄、性别、身高、体重、预估的运动强度;目标对象的个人信息还可进一步包括特性信息,所述特性信息包括不限于当前时令、籍贯、常住地、当前所在位置、口味、身体状态、价格要求等;所述身体状态包括但不限于是否包括痛风、糖尿病和/或高血压等慢性疾病。基于此,人体测量法的方式与实施例1中的热体测量法是一致的,也即在本实施例中该人体测量法包括式1至式3,在此不再赘述。The personal information of the target object includes but is not limited to: age, gender, height, weight, estimated exercise intensity; the personal information of the target object may further include characteristic information, including but not limited to current season, hometown, and usual residence , Current location, taste, physical condition, price requirements, etc.; the physical condition includes but is not limited to whether it includes chronic diseases such as gout, diabetes, and/or hypertension. Based on this, the anthropometric method is consistent with the thermal body measurement method in Example 1, that is, the anthropometric method in this embodiment includes Formula 1 to Formula 3, which will not be repeated here.
在本实施例的可选实施方式中,食物种类和热量之间存在预设的第一关系;其中,该第一关系用于指示不同热量需求与不同的食物种类分别应提供的热量之间的对应关系。也就是说,可以通过该第一关系,在通过上述人体测量法得到目标对象的第一推荐量后,能够确定不同的食物种类分别应提供的热量。在具体的应用场景中,该第一关系可以是预设的饮食标准,进而可以得到该第一推荐量所对应的食物种类及其所需的热量,其中,该饮食标准包括但不限于:得舒饮食法、健康素食饮食法、中国居民膳食指南版-膳食宝塔(例如2016版)、地中海饮食法。In an optional implementation of this embodiment, there is a preset first relationship between food types and calories; wherein, the first relationship is used to indicate the relationship between different calorie requirements and the calories that different food types should provide. Correspondence. That is to say, through the first relationship, after the first recommended amount of the target object is obtained through the above-mentioned anthropometric method, the calories that should be provided by different food types can be determined. In a specific application scenario, the first relationship may be a preset diet standard, and then the type of food corresponding to the first recommended amount and the required calories can be obtained, where the diet standard includes but is not limited to: Shu Diet Method, Healthy Vegetarian Diet Method, Chinese Resident Diet Guide Edition-Diet Pagoda (for example, 2016 version), Mediterranean diet method.
下面以地中海饮食法为例,按200kcal的增量从1000-3200kcal分成11种卡路里类别,分别针对13类食物需要提供的热量值形成如表2所示或表3所示。Taking the Mediterranean diet as an example, according to the 200kcal increment, it is divided into 11 calorie categories from 1000-3200kcal, and the formation of the caloric value required for 13 types of food is shown in Table 2 or Table 3.
由上述表2可知,不同的热量对应的13种食物分别具有对应的热量;如果单位时间为1天,且根据人体测量得到目标对象的第一推荐量为2000kcal,则从可以从表2中确定出卡路里摄入量为2000kcal的情况,需要的13种食物所对应的卡路里含量,如表2的第6列所示:水果需要提供267.0千卡路里、淀粉类蔬菜需要提供41.7千卡路里等等。It can be seen from the above table 2 that the 13 foods corresponding to different calories have corresponding calories; if the unit time is 1 day, and the first recommended amount of the target object is 2000kcal according to anthropometric measurements, it can be determined from Table 2 If the calorie intake is 2000kcal, the calorie content corresponding to the 13 kinds of foods required is shown in the sixth column of Table 2: Fruits need to provide 267.0 kilocalories, starchy vegetables need to provide 41.7 kilocalories, and so on.
此外,在本实施例的可选实施方式中,营养素和热量之间存在预设的第二关系;其中,该第二关系用于指示不同热量需求与各营养素的推荐摄 入量之间的对应关系。在本实施例的可选实施方式中,对于不同的热量推荐量对应的营养素的含量可以如表4所示,当然表4也仅仅是举例说明,对于其他具体形式的第二关系也是在本申请的保护范围之内。In addition, in an optional implementation of this embodiment, there is a preset second relationship between nutrients and calories; wherein, the second relationship is used to indicate the correspondence between different caloric requirements and the recommended intake of each nutrient relationship. In an alternative implementation of this embodiment, the nutrient content corresponding to different recommended amounts of calories can be shown in Table 4. Of course, Table 4 is only an example. The second relationship for other specific forms is also in this application. Within the scope of protection.
在本实施例的可选实施方式中,本实施例的方法步骤还可以包括:In an alternative implementation of this embodiment, the method steps of this embodiment may further include:
步骤S208,获取食物种类;其中,食物种类的数量为N,N为正整数;Step S208, obtaining food types; wherein the number of food types is N, and N is a positive integer;
需要说明的是,该步骤S208可以执行在上述步骤S202至步骤S206中的任一步骤之前或之后,此外,对于该步骤S208中涉及到的食物种类N可以是指现有的所有食物种类,也可以是所有食物种类中的一部分,例如表2中的13类食物。也就是说,可以根据实际情况来获取该食物种类。It should be noted that this step S208 can be performed before or after any of the above steps S202 to S206. In addition, the food type N involved in this step S208 can refer to all existing food types. It can be part of all food types, such as the 13 types of food in Table 2. In other words, the food category can be obtained according to the actual situation.
在本实施例的可选实施方式中,本实施例步骤S204中涉及到的获取在食物信息集合确定出的与第一推荐量和第二推荐量匹配的目标食物组合的方式,包括:In an optional implementation of this embodiment, the method of obtaining the target food combination determined in the food information set that matches the first recommended amount and the second recommended amount involved in step S204 of this embodiment includes:
步骤S204-11,根据食物种类和第一推荐量初步确定出第一食物组合;Step S204-11: Preliminarily determine the first food combination according to the food type and the first recommended amount;
对于该步骤S204-11,在确定食物种类和第一推荐量后就可以初步确定出第一食物组合,以上述表2为例,如果食物种类是13种,而确定的第一推荐量为2000kcal/day,则初步确定出的第一食物组合中各类食物应提供的热量为:水果267.0kcal;淀粉类蔬菜41.7kcal;其他蔬菜41.2kcal;红橙紫蔬菜10.0kcal;深绿蔬菜25.7kcal;豆类和豌豆;151.9kcal;全谷物299.4kcal;精致谷物276.2kcal;肉蛋269.9kcal;海鲜116.8kcal;坚果种子大豆67.6kcal;食用油264.8kcal;乳制品167.8kcal。进一步结合各具体食物的能量密度,在一具体实施例中,可随机得出第一食物组合,具体如表5所示。For this step S204-11, the first food combination can be preliminarily determined after the food type and the first recommended amount are determined. Taking Table 2 as an example, if there are 13 food types, and the determined first recommended amount is 2000kcal /day, the preliminarily determined calories provided by various foods in the first food combination are: fruits 267.0kcal; starchy vegetables 41.7kcal; other vegetables 41.2kcal; red orange and purple vegetables 10.0kcal; dark green vegetables 25.7kcal; Beans and peas; 151.9kcal; whole grains 299.4kcal; refined grains 276.2kcal; meat and eggs 269.9kcal; seafood 116.8kcal; nuts seed soybeans 67.6kcal; edible oils 264.8kcal; dairy products 167.8kcal. Further combining the energy density of each specific food, in a specific embodiment, the first food combination can be randomly obtained, as shown in Table 5.
步骤S204-12,在第一推荐量不变的情况下,通过启发式搜索的方式或随机搜索的方式对第一食物组合中食物及对应的食物量进行调整,以确定出与第二推荐量匹配的目标食物组合;其中,所需的营养素有多种;所需的营养素的第二推荐量包括与所需的不同营养素分别对应的第三推荐量。Step S204-12: Under the condition that the first recommended amount remains unchanged, the food in the first food combination and the corresponding food amount are adjusted through heuristic search or random search to determine the second recommended amount The matched target food combination; wherein, there are multiple required nutrients; the second recommended amount of required nutrients includes the third recommended amount respectively corresponding to different required nutrients.
需要说明的是,本实施例中所需的营养素有多种;所需的营养素的第二推荐量包括与所需的不同营养素分别对应的第三推荐量。也就是说,本实施例中涉及到的第二推荐量是包括了各个具体营养素所对应的第三推荐量的,在具体应用场景中结合上述表2和表4可知,在第一推荐量为2000kcal/day的情况下,该第二推荐量包括了各个具体营养素的第三推荐量,例如,蛋白质为89g;碳水化合物为259g;纤维类食物为31g等等。It should be noted that there are many kinds of nutrients required in this embodiment; the second recommended amount of required nutrients includes the third recommended amount respectively corresponding to different required nutrients. That is to say, the second recommended amount involved in this embodiment includes the third recommended amount corresponding to each specific nutrient. In a specific application scenario, combining Table 2 and Table 4 above, it can be seen that the first recommended amount is In the case of 2000kcal/day, the second recommended amount includes the third recommended amount of each specific nutrient, for example, protein is 89g; carbohydrate is 259g; fiber food is 31g and so on.
所述随机搜索方法简单,易于执行;所述启发式搜索的方法相对随机搜索的方案,在食物种类、营养素数量、各食物种类下具体食物较多的情况下,可大大提高确定出所述目标食物组合的效率。The random search method is simple and easy to implement; the heuristic search method is relatively random search scheme, in the case of food types, nutrient quantities, and specific foods under each food type, it can greatly improve the determination of the target The efficiency of food combinations.
其中,对于该步骤S204-13在本实施例的可选实施方式中,可以是:Wherein, for this step S204-13 in an optional implementation manner of this embodiment, it may be:
步骤A,调整步骤:分别用食物信息集合中与第一食物组合中的第一食物属于同一食物种类的食物替换第一食物组合中的第一食物,并调整每次替换上去的食物的量,得到每一次调整后食物组合的分值;其中,调整后的食物组合的分值是根据每次调整后的食物组合中的营养素含量与第二推荐量的比较结果得到的;Step A, adjustment step: replace the first food in the first food combination with foods in the food information set that belong to the same food category as the first food in the first food combination, and adjust the amount of food replaced each time, Obtain the score of each adjusted food combination; wherein, the score of the adjusted food combination is obtained based on the comparison result of the nutrient content in each adjusted food combination with the second recommended amount;
其中,在具体应用场景中,以上述地中海饮食为例,则本实施例第一食物组合中食物的种类有13种,在第一次调整过程中选择其中一种食物种类作为调整对象,例如选择的食物种类为13种中的水果,而该水果种类中的食物包括一种或多种具体的水果(如葡萄、香蕉、苹果、梨子等),也就是说,首先只对第一食物组合中属于水果类的食物进行调整,除水果类的其他种类的食物不对其进行替换。具体的替换方式为:从食物信息集合中以随机或按一定顺序的形式,以具体的水果去替换该第一食物组合中的水果,如用荔枝去替换第一食物组合中的葡萄,同时结合原第一食物组合中的水果所需提供的热量,以及荔枝的能量密度,确定替换后的第一食物组合中荔枝的量,或用西瓜去替换第一食物组合中的香蕉,同时结合原第一食物组合中的水果所需提供的热量,以及西瓜的能量密度,确定替换后的第一食物组合中西瓜的量等等。Among them, in a specific application scenario, taking the above-mentioned Mediterranean diet as an example, there are 13 types of food in the first food combination of this embodiment. In the first adjustment process, one of the food types is selected as the adjustment object, for example, select The food category of is 13 kinds of fruits, and the food in this fruit category includes one or more specific fruits (such as grapes, bananas, apples, pears, etc.), that is to say, only the first food combination Foods that belong to the fruit category are adjusted, and other types of foods except fruits are not replaced. The specific replacement method is as follows: randomly or in a certain order from the food information set, replace the fruits in the first food combination with specific fruits, such as replacing the grapes in the first food combination with lychees, and combine them simultaneously To determine the amount of lychees in the first food combination after the replacement, or to replace the bananas in the first food combination with watermelon, and combine the original food The calories required by the fruit in a food combination, the energy density of the watermelon, the amount of watermelon in the first food combination after replacement, and so on are determined.
此外,需要说明的是,调整后的食物组合的分值是根据每次调整后营养素含量与第二推荐量的比较结果得到的是指:将每一次调整后的各个营养素的含量分别对应的第三推荐量进行比较得到各个营养素的分值,综合各个营养素的分值得到调整后的食物组合的分值。In addition, it should be noted that the score of the adjusted food combination is obtained based on the comparison between the nutrient content after each adjustment and the second recommended amount. This means that the content of each nutrient after each adjustment is corresponding to the first recommended amount. Three recommended amounts are compared to obtain the score of each nutrient, and the score of each nutrient is synthesized to obtain the adjusted food combination score.
其中,需要说明的是,本实施例中的第三推荐量可以是一个范围值,也可以是一个固定的点值;但是,在本实施例中优选为范围值;每一个营养素都具有对应的第三推荐量;基于此,将每一次替换后的各个营养素的含量分别与对应的第三推荐量进行比较得到各个营养素的分值的方式有多种,如方式(1)确定每一次替换后的各个营养素的含量是否分别落入对应的第三推荐量所表示的取值范围内,落入取值范围的营养素得到相应的分值,没有落入该取值范围的即为零分。方式(2)确定每一次替换后的食物组合的各个营养素的含量是否分别落入对应的第三推荐量所表示的取值范围内,落入取值范围的营养素得到相应的分值,进而计算没有落入该取值范围的营养素含量与对应的第三推荐量之间的比值,根据比值得到相应的分值。需要说明的是,上述方式仅仅是举例说明将每一次调整后的各个营养素的含量分别对应的第三推荐量进行比较得到各个营养素的分值的方式,对于其他的根据比较得到分值的方式也是在本申请的保护范围之内的以方式(1)为例,如果本实施例中涉及到的营养素有35个,调整后的营养素落入第二推荐量所表示的取值范围计1分(当然也可以是其他计分制)的营养素有20个,没有落入的计0分的营养素有15,因此统计调整后得分的营养素的分值的和作为该食物组合的分值,即该食物组合的分值为20分。Among them, it should be noted that the third recommended amount in this embodiment can be a range value or a fixed point value; however, in this embodiment, it is preferably a range value; each nutrient has a corresponding The third recommended amount; based on this, there are many ways to obtain the score of each nutrient by comparing the content of each nutrient after each replacement with the corresponding third recommended amount, such as method (1) Determine after each replacement Whether the content of each nutrient falls within the value range indicated by the corresponding third recommended amount, the nutrient falling within the value range gets the corresponding score, and the nutrient that does not fall within the value range is zero. Method (2) Determine whether the content of each nutrient of the food combination after each replacement falls within the value range indicated by the corresponding third recommended amount, and the nutrients falling into the value range get the corresponding score, and then calculate The ratio between the nutrient content that does not fall into the value range and the corresponding third recommended amount, and the corresponding score is obtained according to the ratio. It should be noted that the above method is only an example to illustrate the method of comparing the third recommended amount of each nutrient content after each adjustment to obtain the score of each nutrient. The same is true for other methods of obtaining scores based on comparison. Within the protection scope of this application, take mode (1) as an example. If there are 35 nutrients involved in this example, the adjusted nutrients fall within the value range indicated by the second recommended amount and count as 1 point ( Of course, it can also be other scoring system) There are 20 nutrients, and the nutrients that do not fall into 0 points are 15. Therefore, the sum of the scores of the nutrients after the statistical adjustment is used as the score of the food combination, that is, the food The score for the combination is 20 points.
需要说明的是:第一食物组合、调整后的食物组合中各个营养素的含量是根据相应食物组合中各具体食物的量以及各具体食物的各营养素密度计算而得的。It should be noted that the content of each nutrient in the first food combination and the adjusted food combination is calculated based on the amount of each specific food in the corresponding food combination and the density of each nutrient of each specific food.
需要说明的是,本申请中的营养素数量可根据实际情况进行相应的取值,也就是说,本申请中的营养素的数量包括但不限于上述表4所示。It should be noted that the quantity of nutrients in this application can be selected according to actual conditions, that is, the quantity of nutrients in this application includes but is not limited to those shown in Table 4 above.
步骤B,随机步骤:将前一步骤A中的所有食物组合的分值依次排列,并按排列顺序对各食物组合分别给予对应的索引,对前一步骤A中的所有食物组合的分值进行求和计算得到总数,以得到的总数为随机范围,在该随机范围内随机出一个随机数值,以所述随机数值所对应的索引对应的食物组合作为调整后的食物组合。Step B, random step: arrange the scores of all food combinations in the previous step A in order, and give corresponding indexes to each food combination in the order of arrangement, and perform the scores of all the food combinations in the previous step A The sum is calculated to obtain the total, and the obtained total is a random range, a random value is randomly generated within the random range, and the food combination corresponding to the index corresponding to the random value is used as the adjusted food combination.
需要说明的是,所述依次排列优选为按替换顺序先后排列,或按分值高低排列,或随机排列等等;所述前一步骤A中的所有食物组合,是指在所述步骤B之前最近的一次的步骤A中出现的所有食物组合,或者在所述步骤B之前最近的一次的步骤A中出现的除第一食物组合之外的所有食物组合;优选为在所述步骤B之前最近的一次的步骤A中出现的所有食物组合,本优选方案可进一步提高获得目标食物组合的效率。It should be noted that the sequential arrangement is preferably arranged in the order of replacement, or arranged according to the score value, or arranged randomly, etc.; all the food combinations in the previous step A refer to before the step B All the food combinations that occurred in the most recent step A, or all the food combinations that occurred in the most recent step A before the step B, except for the first food combination; preferably, the most recent food combination before the step B For all the food combinations that appeared in step A at one time, this preferred solution can further improve the efficiency of obtaining the target food combination.
其中,所述步骤B优选为:将前一步骤A中的所有食物组合的分值进行归一化处理,并将归一化处理后的结果依次排列,并按排列顺序对各食物组合分别给予对应的索引,对当次步骤B中所有归一化处理后的结果进行求和计算得到总数,以得到的总数为随机范围,在该随机范围内随机出一个随机数值,以所述随机数值所对应的索引对应的食物组合作为调整后的食物组。Wherein, the step B is preferably: normalize the scores of all food combinations in the previous step A, and arrange the normalized results in order, and give each food combination in the order of arrangement. The corresponding index is calculated by summing all the normalized results in the current step B to obtain the total number. The total number obtained is the random range, and a random value is randomly selected within the random range. The random value is determined by the random value. The food combination corresponding to the corresponding index is used as the adjusted food group.
需要说明的是,所述归一化的方式有多种,包括但不限于按总和为一确定数归一化,或按最大数为一确定数进行归一化等等。It should be noted that there are many ways of normalization, including but not limited to normalization according to the sum as a certain number, or normalization according to the maximum number as a certain number, and so on.
更进一步的,将步骤B,随机步骤中的各食物组合的分值分别按如下优选方法处理后再执行相应步骤:Furthermore, in step B, the scores of each food combination in the random step are processed according to the following preferred methods, and then the corresponding steps are executed:
以自然对数的底数e作为底数,以及各食物组合的分值与预设值的乘积结果为指数,得到各初步处理后的食物组合的分值;Using the base e of the natural logarithm as the base, and the product of the score of each food combination and the preset value as the index, the score of each food combination after preliminary processing is obtained;
所述步骤B具体为:The step B is specifically:
将前一步骤A中的所有初步处理后的食物组合的分值进行归一化处理,并将归一化处理后的结果依次排列,并按排列顺序对前一步骤A中的各食物组合分别给予对应的索引,对当次步骤B中的所有归一化处理后的 结果进行求和计算得到总数,以得到的总数为随机范围,在该随机范围内随机出一个随机数值,以所述随机数值所对应的索引对应的食物组合作为调整后的食物组。Normalize the scores of all the food combinations after the preliminary treatment in the previous step A, and arrange the results after the normalization in order, and separate the food combinations in the previous step A in the order of arrangement Given the corresponding index, sum up all the normalized results in step B of the current time to calculate the total number, and take the total number as a random range, and randomly select a random value within the random range. The food combination corresponding to the index corresponding to the value is used as the adjusted food group.
优选的,该预设值在1.1-30之间,更优选在2-20之间。Preferably, the preset value is between 1.1-30, more preferably between 2-20.
需要说明的是,通过上述优选方法处理各食物组合的分值,可增大各食物组合的分值之间的差距,能提高后续通过随机数值对应得到食物组合的分值落入较高的分值区间的概率,从而进一步提高获得所述目标食物组合的效率。It should be noted that processing the scores of each food combination by the above-mentioned optimization method can increase the gap between the scores of each food combination and increase the scores of the food combinations obtained through random numerical correspondence to a higher score. The probability of the value interval, thereby further improving the efficiency of obtaining the target food combination.
在具体的应用场景中,对于归一化处理的方式可以是:所有食物替换后得到的计算结果之和归一化为1,每次食物替换后根据其索引值,并按照调整食物的顺序从0至1之间依次排序;进而在0-1之间随机一个数R,以R所在索引值对应的食物组合确定为调整后的食物组合。In a specific application scenario, the normalization process can be: the sum of the calculation results obtained after all food replacements is normalized to 1, and each time the food is replaced according to its index value, and the order of the food is adjusted from Sort in order from 0 to 1; and then a random number R between 0-1, and the food combination corresponding to the index value of R is determined as the adjusted food combination.
步骤C,第一循环步骤:以前一次步骤B所得的调整后的食物组合作为后一次步骤A的第一食物组合,以及更换在再次执行步骤A的过程中进行替换的第一食物所属的食物种类为原则,重复执行步骤A至步骤B,直至第一食物组合中的N种食物均执行过步骤A至步骤B的调整;Step C, the first cycle step: the adjusted food combination obtained in the previous step B is used as the first food combination in the next step A, and the food type of the first food to be replaced in the process of performing step A again is replaced In principle, repeat steps A to B until all the N foods in the first food combination have been adjusted from step A to step B;
也就是说,在对固定的一指定种类食物调整完后,将该调整后的食物组合作为下一次调整的对象,继续对第一食物组合中的其他种类的食物分别进行调整,直到所有N种类均被调整。例如,在水果类的食物均被替换后,则需要对第一食物组合中的其他类食物进行调整,如海鲜类食物,该替换的方式和替换水果的方式是一致的,如果海鲜类食物有多种(鱼、虾、花蛤、扇贝等),则也是依次对具体海鲜类食物进行替换,并根据相应食物的热量密度计算替换后具体海鲜类食物的量,得到调整后的食物组合,直到该第一食物组合中的所有种类的食物均被替换过。In other words, after adjusting a fixed specified type of food, use the adjusted food combination as the object of the next adjustment, and continue to adjust the other types of food in the first food combination until all N types are adjusted. Have been adjusted. For example, after all fruit foods are replaced, it is necessary to adjust other foods in the first food combination, such as seafood foods. The replacement method is the same as the fruit replacement method. A variety of (fish, shrimp, clams, scallops, etc.), the specific seafood foods are replaced in turn, and the amount of specific seafood foods after replacement is calculated according to the caloric density of the corresponding foods, and the adjusted food combination is obtained until All types of food in the first food combination have been replaced.
步骤D,第二循环步骤:重复执行上述步骤A至步骤C,直到得到满足预设条件的目标食物组合;Step D, the second loop step: repeat the above steps A to C until a target food combination that meets the preset conditions is obtained;
可见,对于该步骤D,则是在第一次对所有食物替换后,还可以再次 循环执行上述替换操作,直到出现满足预设条件的目标食物组合。It can be seen that for this step D, after all foods are replaced for the first time, the above replacement operation can be repeated again until a target food combination that meets the preset conditions appears.
优选的,预设条件包括以下至少之一:Preferably, the preset conditions include at least one of the following:
(1)重复执行步骤A至步骤C的次数达到预设次数;(1) The number of repeated steps A to C reaches the preset number;
对于该方式(1),在本实施例中该预设次数取值范围可以是10~30次,当然这仅仅是举例说明,其他的预设次数的范围可以的,可以根据实际情况进行相应的设置,在本申请中并不对此进行限定。For this method (1), in this embodiment, the preset number of times can be in the range of 10 to 30 times. Of course, this is only an example. The range of other preset times is possible, and the corresponding can be done according to the actual situation. The setting is not limited in this application.
(2)在重复执行步骤A至步骤B,或重复执行步骤A至C过程中,出现X个调整后的第一食物组合,且X个调整后的第一食物组合各自所含有的第一顺位营养素的量均落入第二推荐量所指示的范围;X为正整数。(2) In the process of repeating steps A to B, or repeating steps A to C, there are X adjusted first food combinations, and each of the X adjusted first food combinations contains the first order The amount of bit nutrients all fall within the range indicated by the second recommended amount; X is a positive integer.
对于该方式(2),由于营养素可以根据实际情况(日常所需量或者个人情况)对其进行优先级排序,也就是说,每个具体营养素都是具有相应的优先级顺序的,在具体应用场景中可以是如上述表5所示。For this method (2), since nutrients can be prioritized according to actual conditions (daily required amounts or personal conditions), that is to say, each specific nutrient has a corresponding priority order, and in specific applications The scenario can be as shown in Table 5 above.
由上述表5可知,优先级通过1至4的数字来表示,数字越大优先级越低,因此,对于本实施例中涉及到的第一顺位营养素包括:蛋白质、碳水化合物、膳食纤维、总脂肪。当然,上述第一顺位的营养素仅仅是举例说明,也可以根据每个人的实际情况进行相应的调整,例如,某一个人对于维生素是比较缺乏的,则将维生素相关的营养素的设置为第一顺位的营养素。也即,上述方式(2)只是说明,对于预设条件可以是只需要其中一部分的优先级高的营养素满足了第二推荐量所指示的范围,则可以将该调整后的食物组合作为目标食物组合,而不需要所有营养素均满足该第二推荐量所指示的范围。It can be seen from the above Table 5 that the priority is represented by numbers from 1 to 4. The larger the number, the lower the priority. Therefore, the first-order nutrients involved in this embodiment include: protein, carbohydrate, dietary fiber, Total fat. Of course, the above-mentioned nutrients in the first order are just examples, and adjustments can also be made according to the actual situation of each person. For example, if a person is relatively deficient in vitamins, set the vitamin-related nutrients as the first Nutrients in order. That is, the above method (2) is only for illustration. For the preset condition, only some of the high priority nutrients are required to meet the range indicated by the second recommended amount, and then the adjusted food combination can be used as the target food Combination, without all nutrients meeting the range indicated by the second recommended amount.
(3)在重复执行步骤A至步骤B,或重复执行步骤A至C过程中,出现Y个调整后的第一食物组合,且Y个调整后的第一食物组合的分值均落入第一预设范围。(3) In the process of repeating steps A to B, or repeating steps A to C, Y adjusted first food combinations appear, and the scores of the Y adjusted first food combinations fall into the first A preset range.
对于该方式(3)由于每一次调整后的食物组合均为得到相应的分值,只要出现了Y个调整后的第一食物组合的分值落入第一预设范围,则可以将其作为目标食物组合。由于Y的取值是灵活的,即可以根据不同的情况 对Y进行取值。如果以35个营养素为例,则最高分为35分,因此,该第一预设范围可以是大于等于30且小于等于35,还可以是大于等于28且小于等于33。该第一预设范围也可以根据实际情况进行相应的取值,在本申请中并不对其进行限定。For this method (3), since each adjusted food combination obtains a corresponding score, as long as there are Y adjusted first food combinations that fall within the first preset range, they can be used as Target food combination. Since the value of Y is flexible, that is, the value of Y can be selected according to different situations. If 35 nutrients are taken as an example, the highest score is 35 points. Therefore, the first preset range may be greater than or equal to 30 and less than or equal to 35, or greater than or equal to 28 and less than or equal to 33. The first preset range can also be valued according to actual conditions, which is not limited in this application.
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到根据上述实施例的方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端设备(可以是手机,计算机,服务器,或者网络设备等)执行本申请各个实施例所述的方法。Through the description of the above embodiments, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus the necessary general hardware platform, of course, it can also be implemented by hardware, but in many cases the former is Better implementation. Based on this understanding, the technical solution of this application essentially or the part that contributes to the existing technology can be embodied in the form of a software product, and the computer software product is stored in a storage medium (such as ROM/RAM, magnetic disk, The optical disc) includes several instructions to make a terminal device (which can be a mobile phone, a computer, a server, or a network device, etc.) execute the methods described in the various embodiments of the present application.
实施例3Example 3
在本实施例中还提供了一种食物信息的推送装置,该装置用于实现上述实施例及优选实施方式,已经进行过说明的不再赘述。如以下所使用的,术语“模块”可以实现预定功能的软件和/或硬件的组合。尽管以下实施例所描述的装置较佳地以软件来实现,但是硬件,或者软件和硬件的组合的实现也是可能并被构想的。In this embodiment, a device for pushing food information is also provided, and the device is used to implement the above-mentioned embodiments and preferred implementations, and those that have been explained will not be repeated. As used below, the term "module" may implement a combination of software and/or hardware that performs predetermined functions. Although the devices described in the following embodiments are preferably implemented in software, implementation of hardware or a combination of software and hardware is also possible and conceived.
图3是根据本申请实施例的食物信息的推送装置的结构示意图,如图3所示,该装置包括:第一获取模块32,设置为获取目标对象在单位时间内所需的热量的第一推荐量以及所需的营养素的第二推荐量;确定模块34,与第一获取模块32耦合连接,设置为在食物信息集合确定出与第一推荐量和第二推荐量匹配的目标食物组合;推送模块36,与确定模块34耦合连接,设置为向目标终端推送目标食物组合。FIG. 3 is a schematic structural diagram of a device for pushing food information according to an embodiment of the present application. As shown in FIG. 3, the device includes: a first acquiring
需要说明的是,该食物信息的推送装置可以应用在服务器或终端设备上,该终端设备可以是手机、平板电脑、手提电脑等等。It should be noted that the food information pushing device can be applied to a server or a terminal device, and the terminal device can be a mobile phone, a tablet computer, a laptop computer, and so on.
此外,由于本实施例3是与实施例1对应的装置实施例。因此,本实 施例中涉及到的第一获取模块32可以设置为执行上述步骤S102,确定模块34可以设置为执行上述步骤S104,推送模块36可以设置为执行步骤S106。In addition, since the third embodiment is an apparatus embodiment corresponding to the first embodiment. Therefore, the first acquiring
基于此,对于本实施例中涉及到的对于单位时间内所需的热量的第一推荐量,在本实施例的可选实施方式中可以根据人体测量法得到,当然这仅仅是举例说明,其他可以得到该第一推荐量的方式也是在本申请的保护范围之内的,下面以人体测量法为例,对如何得到该第一推荐量的方式进行举例说明,该人体测量法是根据目标对象的个人信息以及预估的运动强度得到的,此外该人体测量法是以1天为单位时间为例,具体方式如下:Based on this, the first recommended amount of heat required per unit time involved in this embodiment can be obtained according to an anthropometric method in an alternative implementation of this embodiment. Of course, this is only an example for illustration. The way in which the first recommended amount can be obtained is also within the scope of protection of this application. The following takes an anthropometric method as an example to illustrate how to obtain the first recommended amount. The anthropometric method is based on the target object The personal information and estimated exercise intensity are obtained. In addition, the anthropometric method uses 1 day as an example. The specific method is as follows:
目标对象的个人信息但不限于:年龄、性别、身高、体重、预估的运动强度;目标对象的个人信息还可进一步包括特性信息,所述特性信息包括不限于当前时令、籍贯、常住地、当前所在位置、口味、身体状态、价格要求等;所述身体状态包括但不限于:是否患有痛风、糖尿病和/或高血压等慢性疾病,也即在本实施例中该人体测量法包括式1至式3,在此不再赘述。The personal information of the target object but not limited to: age, gender, height, weight, estimated exercise intensity; the personal information of the target object may further include characteristic information including but not limited to the current season, hometown, permanent residence, Current location, taste, physical state, price requirements, etc.; the physical state includes, but is not limited to: whether you have chronic diseases such as gout, diabetes, and/or hypertension, that is, in this embodiment, the anthropometric method includes the formula 1 to 3 are not repeated here.
在本实施例的可选实施方式中,食物种类和热量之间存在预设的第一关系;其中,该第一关系用于指示不同热量需求与不同的食物种类分别应提供的热量之间的对应关系。也就是说,可以通过该第一关系,在通过上述人体测量法得到目标对象的第一推荐量后,能够确定不同的食物种类分别应提供的热量。在具体的应用场景中,该第一关系可以是预设的饮食标准,进而可以得到该第一推荐量所对应的食物种类及其所需的热量,其中,该饮食标准包括但不限于:得舒饮食法、健康素食饮食法、中国居民膳食指南-膳食宝塔(例如2016版)、地中海饮食法。In an optional implementation of this embodiment, there is a preset first relationship between food types and calories; wherein, the first relationship is used to indicate the relationship between different calorie requirements and the calories that different food types should provide. Correspondence. That is to say, through the first relationship, after the first recommended amount of the target object is obtained through the above-mentioned anthropometric method, the calories that should be provided by different food types can be determined. In a specific application scenario, the first relationship may be a preset diet standard, and then the type of food corresponding to the first recommended amount and the required calories can be obtained, where the diet standard includes but is not limited to: Shu Diet, Healthy Vegetarian Diet, Chinese Resident Dietary Guidelines-Diet Pagoda (for example, 2016 edition), Mediterranean diet.
下面以地中海饮食法为例,按200kcal的增量从1000-3200kcal分成11种卡路里类别,分别针对13类食物需要提供的热量值形成如表2所示或表3所示。Taking the Mediterranean diet as an example, according to the 200kcal increment, it is divided into 11 calorie categories from 1000-3200kcal, and the formation of the caloric value required for 13 types of food is shown in Table 2 or Table 3.
由上述表2可知,不同的热量对应的13种食物分别具有对应的热量; 如果单位时间为1天,且根据人体测量得到目标对象的第一推荐量为2000kcal,则从可以从表2中确定出卡路里摄入量为2000kcal的情况,需要的13种食物所对应的卡路里含量,如表2的第6列所示:水果需要267.0卡路里、淀粉类蔬菜需要41.7卡路里等等。It can be seen from Table 2 above that the 13 foods corresponding to different calories have corresponding calories; if the unit time is 1 day and the first recommended amount of the target object is 2000kcal according to anthropometric measurements, it can be determined from Table 2 If the calorie intake is 2000kcal, the calorie content corresponding to the 13 foods required is shown in the sixth column of Table 2: Fruits require 267.0 calories, starchy vegetables require 41.7 calories, and so on.
此外,在本实施例的可选实施方式中,营养素和热量之间存在预设的第二关系;其中,该第二关系用于指示不同热量需求与各营养素的推荐摄入量之间的对应关系。在本实施例的可选实施方式中,对于不同的热量推荐量对应的营养素的含量可以如表4所示,当然表4也仅仅是举例说明,对于其他具体形式的第二关系也是在本申请的保护范围之内。In addition, in an optional implementation of this embodiment, there is a preset second relationship between nutrients and calories; wherein, the second relationship is used to indicate the correspondence between different caloric requirements and the recommended intake of each nutrient relationship. In an alternative implementation of this embodiment, the nutrient content corresponding to different recommended amounts of calories can be shown in Table 4. Of course, Table 4 is only an example. The second relationship for other specific forms is also in this application. Within the scope of protection.
可选地,本实施例的装置还可以包括:第二获取模块,设置为获取食物种类;其中,食物种类的数量为N,N为正整数。Optionally, the device of this embodiment may further include: a second acquisition module configured to acquire food types; wherein the number of food types is N, and N is a positive integer.
需要说明的是,获取到的食物种类N可以是指现有的所有食物种类,也可以是所有食物种类中的一部分,例如表2中的13类食物。也就是说,可以根据实际情况来获取该食物种类。It should be noted that the obtained food type N may refer to all existing food types, or part of all food types, such as the 13 types of food in Table 2. In other words, the food category can be obtained according to the actual situation.
本实施例中涉及到的确定模块34包括:第一确定单元,设置为根据食物种类和第一推荐量初步确定出第一食物组合;第二确定单元,设置为在第一推荐量不变的情况下,通过启发式搜索的方式或随机搜索的方式对第一食物组合中食物及对应的食物量进行调整,以确定出与第二推荐量匹配的目标食物组合;其中,所需的营养素有多种;所需的营养素的第二推荐量包括与所需的不同营养素分别对应的第三推荐量。The determining
而对于第一确定单元确定的第一食物组合,以上述表2为例,如果食物种类是13种,而确定的第一推荐量为2000kcal/day,则初步确定出的第一食物组合中各类食物应提供的热量为:水果267.0kcal;淀粉类蔬菜41.7kcal;其他蔬菜41.2kcal;红橙紫蔬菜10.0kcal;深绿蔬菜25.7kcal;豆类和豌豆;151.9kcal;全谷物299.4kcal;精致谷物276.2kcal;肉蛋269.9kcal;海鲜116.8kcal;坚果种子大豆67.6kcal;食用油264.8kcal;乳制品167.8kcal。进一步结合各具体食物的能量密度,在一具体实施例中, 可随机得出第一食物组合,具体如表5所示。上述是第一推荐量为2000kcal/day的情况下,随机出的第一食物组合,而在第一推荐量为其他取值时,在具体应用场景中可以根据上述表2确定其他初步的第一食物组合。For the first food combination determined by the first determining unit, taking Table 2 above as an example, if there are 13 types of food and the determined first recommended amount is 2000kcal/day, each of the first food combinations determined preliminarily The calories that should be provided by foods are: fruits 267.0kcal; starchy vegetables 41.7kcal; other vegetables 41.2kcal; red orange and purple vegetables 10.0kcal; dark green vegetables 25.7kcal; beans and peas; 151.9kcal; whole grains 299.4kcal; refined Cereals 276.2kcal; meat and eggs 269.9kcal; seafood 116.8kcal; nut seed soybeans 67.6kcal; edible oil 264.8kcal; dairy products 167.8kcal. Further combining the energy density of each specific food, in a specific embodiment, the first food combination can be randomly obtained, as shown in Table 5. The above is the first food combination randomly selected when the first recommended amount is 2000kcal/day, and when the first recommended amount is other values, other preliminary first food combinations can be determined according to Table 2 above in specific application scenarios. Food combination.
需要说明的是,本实施例中所需的营养素有多种;所需的营养素的第二推荐量包括与所需的不同营养素分别对应的第三推荐量。也就是说,本实施例中涉及到的第二推荐量是包括了各个具体营养素所对应的第三推荐量的,在具体应用场景中结合上述表2和表4可知,在第一推荐量为2000kcal/day的情况下,该第二推荐量包括了各个具体营养素的第三推荐量,例如,蛋白质为89g;碳水化合物为259g;纤维类食物为31g等等。It should be noted that there are many kinds of nutrients required in this embodiment; the second recommended amount of required nutrients includes the third recommended amount respectively corresponding to different required nutrients. That is to say, the second recommended amount involved in this embodiment includes the third recommended amount corresponding to each specific nutrient. In a specific application scenario, combining Table 2 and Table 4 above, it can be seen that the first recommended amount is In the case of 2000kcal/day, the second recommended amount includes the third recommended amount of each specific nutrient, for example, protein is 89g; carbohydrate is 259g; fiber food is 31g and so on.
所述随机搜索方法简单,易于执行;所述启发式搜索的方法相对随机搜索的方案,在食物种类、营养素数量、各食物种类下具体食物较多的情况下,可大大提高确定出所述目标食物组合的效率。The random search method is simple and easy to implement; the heuristic search method is relatively random search scheme, in the case of food types, nutrient quantities, and specific foods under each food type, it can greatly improve the determination of the target The efficiency of food combinations.
在本实施例的可选实施方式,本实施例中涉及到的第二确定单元包括:In an optional implementation manner of this embodiment, the second determining unit involved in this embodiment includes:
第一替换子单元,设置为执行步骤A,调整步骤:分别用食物信息集合中与第一食物组合中的第一食物属于同一食物种类的具体食物替换第一食物组合中的第一食物,并得到每一次调整后食物组合的分值;其中,调整后的食物组合的分值是根据每次调整后的食物组合中的营养素含量与第二推荐量的比较结果得到的。The first replacement subunit is configured to perform step A, the adjustment step: replace the first food in the first food combination with specific foods in the food information set that belong to the same food category as the first food in the first food combination, and Obtain the score of each adjusted food combination; wherein, the score of the adjusted food combination is obtained according to the comparison result of the nutrient content in each adjusted food combination with the second recommended amount.
其中,在具体应用场景中,以上述地中海饮食为例,则本实施例第一食物组合中食物的种类有13种,在第一次调整过程中选择其中一种食物种类作为调整对象,例如选择的食物种类为13种中的水果,而该水果种类中的食物包括一种或多种具体的水果(如葡萄、香蕉、苹果、梨子等),也就是说,首先只对第一食物组合中属于水果类的食物进行调整,除水果类的其他种类的食物不对其进行替换。具体的替换方式为:从食物信息集合中以随机或按一定顺序的形式,以具体的水果去替换该第一食物组合中的水果,如用荔枝去替换第一食物组合中的葡萄,同时结合原第一食物组 合中的水果所需提供的热量,以及荔枝的能量密度,确定替换后的第一食物组合中荔枝的量,或用西瓜去替换第一食物组合中的香蕉,同时结合原第一食物组合中的水果所需提供的热量,以及西瓜的能量密度,确定替换后的第一食物组合中西瓜的量等。Among them, in a specific application scenario, taking the above-mentioned Mediterranean diet as an example, there are 13 types of food in the first food combination of this embodiment. In the first adjustment process, one of the food types is selected as the adjustment object, for example, select The food category of is 13 kinds of fruits, and the food in this fruit category includes one or more specific fruits (such as grapes, bananas, apples, pears, etc.), that is to say, only the first food combination Foods that belong to the fruit category are adjusted, and other types of foods except fruits are not replaced. The specific replacement method is: randomly or in a certain order from the food information set, replace the fruits in the first food combination with specific fruits, such as replacing the grapes in the first food combination with lychees, and combine them at the same time To determine the amount of lychees in the first food combination after the replacement, or to replace the bananas in the first food combination with watermelon, and combine the original food The calories required by the fruit in a food combination, the energy density of the watermelon, and the amount of watermelon in the first food combination after replacement are determined.
此外,需要说明的是,调整后的食物组合的分值是根据每次调整后营养素含量与第二推荐量的比较结果得到的是指:将每一次调整后的各个营养素的含量分别对应的第三推荐量进行比较得到各个营养素的分值,综合各个营养素的分值得到调整后的食物组合的分值。In addition, it should be noted that the score of the adjusted food combination is obtained based on the comparison between the nutrient content after each adjustment and the second recommended amount. This means that the content of each nutrient after each adjustment is corresponding to the first recommended amount. Three recommended amounts are compared to obtain the score of each nutrient, and the score of each nutrient is synthesized to obtain the adjusted food combination score.
其中,需要说明的是,本实施例中的第三推荐量可以是一个范围值,也可以是一个固定的点值;但是,在本实施例中优选为范围值;每一个营养素都具有对应的第三推荐量;基于此,将每一次替换后的各个营养素的含量分别与对应的第三推荐量进行比较得到各个营养素的分值的方式有多种,如方式(1)确定每一次替换后的各个营养素的含量是否分别落入对应的第三推荐量所表示的取值范围内,落入取值范围的营养素得到相应的分值,没有落入该取值范围的即为零分。方式(2)确定每一次替换后的食物组合的各个营养素的含量是否分别落入对应的第三推荐量所表示的取值范围内,落入取值范围的营养素得到相应的分值,进而计算没有落入该取值范围的营养素含量与对应的第三推荐量之间的比值,根据比值得到相应的分值。需要说明的是,上述方式仅仅是举例说明将每一次调整后的各个营养素的含量分别对应的第三推荐量进行比较得到各个营养素的分值的方式,对于其他的根据比较得到分值的方式也是在本申请的保护范围之内的。Among them, it should be noted that the third recommended amount in this embodiment can be a range value or a fixed point value; however, in this embodiment, it is preferably a range value; each nutrient has a corresponding The third recommended amount; based on this, there are many ways to obtain the score of each nutrient by comparing the content of each nutrient after each replacement with the corresponding third recommended amount, such as method (1) Determine after each replacement Whether the content of each nutrient falls within the value range indicated by the corresponding third recommended amount, the nutrient falling within the value range gets the corresponding score, and the nutrient that does not fall within the value range is zero. Method (2) Determine whether the content of each nutrient of the food combination after each replacement falls within the value range indicated by the corresponding third recommended amount, and the nutrients falling into the value range get the corresponding score, and then calculate The ratio between the nutrient content that does not fall into the value range and the corresponding third recommended amount, and the corresponding score is obtained according to the ratio. It should be noted that the above method is only an example to illustrate the method of comparing the third recommended amount of each nutrient content after each adjustment to obtain the score of each nutrient. The same is true for other methods of obtaining scores based on comparison. Within the protection scope of this application.
以方式(1)为例,如果本实施例中涉及到的营养素有36个,调整后的营养素落入第三推荐量所表示的取值范围计1分(当然也可以是其他计分制)的营养素有20个,没有落入的计0分的营养素有16,因此统计调整后得分的营养素的分值的和作为该食物组合的分值,即该食物组合的分值为20分。Taking method (1) as an example, if there are 36 nutrients involved in this example, the adjusted nutrients fall within the value range indicated by the third recommended amount and count 1 point (of course, other scoring systems can also be used) There are 20 nutrients for food, and the nutrients that do not fall into 0 points are 16. Therefore, the sum of the scores of the nutrients after the statistical adjustment is used as the score of the food combination, that is, the score of the food combination is 20 points.
需要说明的是:本申请中,第一食物组合、调整后的食物组合中各个营养素的含量是根据相应食物组合中各具体食物的量以及各具体食物的各营养素密度计算而得的。It should be noted that in this application, the content of each nutrient in the first food combination and the adjusted food combination is calculated based on the amount of each specific food in the corresponding food combination and the density of each nutrient of each specific food.
需要说明的是,本申请中的营养素及数量可根据实际情况进行相应的取值,也就是说,本申请中的营养素的选择范围包括但不限于上述表4所示。It should be noted that the nutrients and quantities in this application can be selected according to actual conditions, that is, the selection range of nutrients in this application includes but is not limited to those shown in Table 4 above.
第一处理子单元,设置为执行步骤B,随机步骤:将前一步骤A中的所有食物组合的分值依次排列,并按排列顺序对各食物组合分别给予对应的索引,对前一步骤A中的所有食物组合的分值进行求和计算得到总数,以得到的总数为随机范围,在该随机范围内随机出一个随机数值,以所述随机数值所对应的索引对应的食物组合作为调整后的食物组合。The first processing subunit is set to perform step B. Random step: arrange the scores of all food combinations in the previous step A in order, and give corresponding indexes to each food combination in the order of arrangement, and compare the previous step A The scores of all the food combinations in are added to calculate the total, and the total obtained is the random range, a random value is randomly selected within the random range, and the food combination corresponding to the index corresponding to the random value is used as the adjusted Food combination.
需要说明的是,所述依次排列优选为按替换顺序先后排列,或按分值高低排列,或随机排列等等;所述前一步骤A中的所有食物组合,是指在所述步骤B之前最近的一次的步骤A中出现的所有食物组合,或者在所述步骤B之前最近的一次的步骤A中出现的除第一食物组合之外的所有食物组合;优选为在所述步骤B之前最近的一次的步骤A中出现的所有食物组合,本优选方案可进一步提高获得目标食物组合的效率。It should be noted that the sequential arrangement is preferably arranged in the order of replacement, or arranged according to the score value, or arranged randomly, etc.; all the food combinations in the previous step A refer to before the step B All the food combinations that occurred in the most recent step A, or all the food combinations that occurred in the most recent step A before the step B, except for the first food combination; preferably, the most recent food combination before the step B For all the food combinations that appeared in step A at one time, this preferred solution can further improve the efficiency of obtaining the target food combination.
其中,所述步骤B优选为:将前一步骤A中的所有食物组合的分值进行归一化处理,并将归一化处理后的结果依次排列,并按排列顺序对各个食物组合分别给予对应的索引,对当次步骤B中所有归一化处理后的结果进行求和计算得到总数,以得到的总数为随机范围,在该随机范围内随机出一个随机数值,以所述随机数值所对应的索引对应的食物组合作为调整后的食物组。需要说明的是,所述归一化的方式有多种,包括但不限于按总和为一确定数归一化,或按最大数为一确定数进行归一化等等。Wherein, the step B is preferably: normalize the scores of all food combinations in the previous step A, and arrange the normalized results in sequence, and give each food combination in the order of arrangement. The corresponding index is calculated by summing all the normalized results in the current step B to obtain the total number. The total number obtained is the random range, and a random value is randomly selected within the random range. The random value is determined by the random value. The food combination corresponding to the corresponding index is used as the adjusted food group. It should be noted that there are many ways of normalization, including but not limited to normalization according to the sum as a certain number, or normalization according to the maximum number as a certain number, and so on.
更进一步的,将步骤B,随机步骤中的各食物组合的分值分别按如下优选方法处理后再执行相应步骤:Furthermore, in step B, the scores of each food combination in the random step are processed according to the following preferred methods, and then the corresponding steps are executed:
以自然对数的底数e作为底数,以及各食物组合的分值与预设值的乘 积结果为指数,得到各初步处理后的食物组合的分值;Using the base e of the natural logarithm as the base, and the product of the score of each food combination and the preset value as the index, the score of each food combination after preliminary processing is obtained;
所述步骤B具体为:The step B is specifically:
将前一步骤A中的所有食物组合的分值进行归一化处理,并将归一化处理后的结果依次排列,并按排列顺序对前一步骤A中的各食物组合分别给予对应的索引,对当次步骤B中的所有归一化处理后的结果进行求和计算得到总数,以得到的总数为随机范围,在该随机范围内随机出一个随机数值,以所述随机数值所对应的索引对应的食物组合作为调整后的食物组。Normalize the scores of all food combinations in the previous step A, and arrange the normalized results in order, and give the corresponding indexes to each food combination in the previous step A in the order of arrangement , The sum of all normalized results in step B of the current time is calculated to obtain the total, and the total obtained is the random range, and a random value is randomly selected within the random range, and the random value corresponding to the random value is The food combination corresponding to the index is used as the adjusted food group.
在具体的应用场景中,对于归一化处理的方式可以是:所有食物替换后得到的计算结果之和归一化为1,每次食物替换后根据其索引值,并按照调整食物的顺序从0至1之间依次排序;进而在0-1之间随机一个数R,以R所在索引值对应的食物组合确定为调整后的食物组合。In a specific application scenario, the normalization process can be: the sum of the calculation results obtained after all food replacements is normalized to 1, and each time the food is replaced according to its index value, and the order of the food is adjusted from Sort in order from 0 to 1; and then a random number R between 0-1, and the food combination corresponding to the index value of R is determined as the adjusted food combination.
第一执行子单元,设置为执行步骤C,第一循环步骤:以前一次步骤B所得的调整后的食物组合作为后一次步骤A的第一食物组合,以及更换在再次执行步骤A的过程中进行替换的第一食物所属的食物种类为原则,重复执行步骤A至步骤B,直至第一食物组合中的N种食物均执行过步骤A至步骤B的调整。The first execution subunit is set to execute step C. The first cycle step: the adjusted food combination obtained in step B in the previous step is used as the first food combination in step A in the next step, and the replacement is performed in the process of executing step A again The food type to which the first food to be replaced belongs is a principle, and Step A to Step B are repeated until the N foods in the first food combination have all been adjusted from Step A to Step B.
也就是说,在对固定的一指定种类食物调整完后,将该调整后的食物组合作为下一次调整的对象,继续对第一食物组合中的其他种类的食物分别进行调整,直到所有N种类均被调整。例如,在水果类的食物均被替换后,则需要对第一食物组合中的其他类食物进行调整,如海鲜类食物,该替换的方式和替换水果的方式是一致的,如果海鲜类食物有多种(鱼、虾、花蛤、扇贝等),则也是依次对具体海鲜类食物进行替换,得到调整后的食物组合,直到该第一食物组合中的所有种类的食物均被替换过。In other words, after adjusting a fixed specified type of food, use the adjusted food combination as the object of the next adjustment, and continue to adjust the other types of food in the first food combination until all N types are adjusted. Have been adjusted. For example, after all fruit foods are replaced, it is necessary to adjust other foods in the first food combination, such as seafood foods. The replacement method is the same as the fruit replacement method. For multiple types (fish, shrimp, clams, scallops, etc.), specific seafood foods are sequentially replaced to obtain an adjusted food combination until all types of foods in the first food combination have been replaced.
第二执行子单元,设置为执行步骤D,第二循环步骤:重复执行上述步骤A至步骤C,直到得到满足预设条件的目标食物组合。The second execution subunit is configured to execute step D, and the second loop step: repeat the above steps A to C until a target food combination that meets the preset conditions is obtained.
优选的,预设条件包括以下至少之一:重复执行步骤A至步骤C的次数达到预设次数;或,在重复执行步骤A至步骤B,或重复执行步骤A 至C过程中,出现X个调整后的第一食物组合,且X个调整后的第一食物组合各自所含有的第一顺位营养素的量均落入第二推荐量所指示的范围;或,在重复执行步骤A至步骤B,或重复执行步骤A至C过程中,出现Y个调整后的第一食物组合,且Y个调整后的第一食物组合的分值均落入第一预设范围。Preferably, the preset condition includes at least one of the following: the number of repeated executions of step A to step C reaches the preset number of times; or, during the repeated execution of step A to step B, or the repeated execution of steps A to C, X The adjusted first food combination, and the amount of the first sequence nutrient contained in each of the X adjusted first food combinations falls within the range indicated by the second recommended amount; or, repeating step A to step B, or in the process of repeating steps A to C, Y adjusted first food combinations appear, and the scores of the Y adjusted first food combinations all fall within the first preset range.
需要说明的是,上述各个模块是可以通过软件或硬件来实现的,对于后者,可以通过以下方式实现,但不限于此:上述模块均位于同一处理器中;或者,上述各个模块以任意组合的形式分别位于不同的处理器中。It should be noted that the above modules can be implemented by software or hardware, and the latter can be implemented by the following methods, but not limited to this: the above modules are all located in the same processor; or, the above modules can be combined in any combination The forms are located in different processors.
实施例4Example 4
在本实施例中还提供了一种食物信息的显示装置,该装置用于实现上述实施例及优选实施方式,已经进行过说明的不再赘述。如以下所使用的,术语“模块”可以实现预定功能的软件和/或硬件的组合。尽管以下实施例所描述的装置较佳地以软件来实现,但是硬件,或者软件和硬件的组合的实现也是可能并被构想的。In this embodiment, a food information display device is also provided, and the device is used to implement the above-mentioned embodiments and preferred implementations. What has been described will not be repeated. As used below, the term "module" may implement a combination of software and/or hardware that performs predetermined functions. Although the devices described in the following embodiments are preferably implemented in software, implementation of hardware or a combination of software and hardware is also possible and conceived.
图4是根据本申请实施例的食物信息的显示装置的结构示意图,如图4所示,该装置包括:第三获取模块42,设置为获取目标对象在单位时间内所需的热量的第一推荐量以及所需的营养素的第二推荐量;第四获取模块44,与第三获取模块42耦合连接,设置为获取在食物信息集合确定出的与第一推荐量和第二推荐量匹配的目标食物组合;显示模块46,与第四获取模块耦合连接,设置为向目标终端显示目标食物组合。FIG. 4 is a schematic structural diagram of a food information display device according to an embodiment of the present application. As shown in FIG. 4, the device includes: a third acquiring
需要说明的是,该食物信息的显示装置可以应用在终端设备上,该终端设备可以是手机、平板电脑、手提电脑等等。It should be noted that the food information display device can be applied to a terminal device, which can be a mobile phone, a tablet computer, a laptop computer, and so on.
此外,由于本实施例4是与实施例2对应的装置实施例。因此,本实施例中涉及到的第三获取模块42可以设置为执行上述步骤S202,第四获取模块44可以设置为执行上述步骤S204,显示模块46可以设置为执行步骤S206。In addition, since the fourth embodiment is an apparatus embodiment corresponding to the second embodiment. Therefore, the
基于此,对于本实施例中涉及到的对于单位时间内所需的热量的第一 推荐量,在本实施例的可选实施方式中可以根据人体测量法得到,当然这仅仅是举例说明,其他可以得到该第一推荐量的方式也是在本申请的保护范围之内的,下面以人体测量法为例,对如何得到该第一推荐量的方式进行举例说明,该人体测量法是根据目标对象的个人信息以及预估的运动强度得到的,此外该人体测量法是以1天为单位时间为例,具体方式如下:Based on this, the first recommended amount of heat required per unit time involved in this embodiment can be obtained according to an anthropometric method in an alternative implementation of this embodiment. Of course, this is only an example for illustration. The way in which the first recommended amount can be obtained is also within the scope of protection of this application. The following takes an anthropometric method as an example to illustrate how to obtain the first recommended amount. The anthropometric method is based on the target object The personal information and estimated exercise intensity are obtained. In addition, the anthropometric method uses 1 day as an example. The specific method is as follows:
目标对象的个人信息但不限于:年龄、性别、身高、体重、预估的运动强度;目标对象的个人信息还可进一步包括特性信息,所述特性信息包括不限于当前时令、籍贯、常住地、当前所在位置、口味、身体状态、价格要求等;所述身体状态包括但不限于:是否患有痛风、糖尿病和/或高血压等慢性疾病,也即在本实施例中该人体测量法包括式1至式3,在此不再赘述。The personal information of the target object but not limited to: age, gender, height, weight, estimated exercise intensity; the personal information of the target object may further include characteristic information including but not limited to the current season, hometown, permanent residence, Current location, taste, physical state, price requirements, etc.; the physical state includes, but is not limited to: whether you have chronic diseases such as gout, diabetes, and/or hypertension, that is, in this embodiment, the anthropometric method includes the formula 1 to 3 are not repeated here.
在本实施例的可选实施方式中,食物种类和热量之间存在预设的第一关系;其中,该第一关系用于指示不同热量需求与不同的食物种类分别应提供的热量之间的对应关系。也就是说,可以通过该第一关系,在通过上述人体测量法得到目标对象的第一推荐量后,能够确定不同的食物种类分别应提供的热量。在具体的应用场景中,该第一关系可以是预设的饮食标准,进而可以得到该第一推荐量所对应的食物种类及其所需的热量,其中,该饮食标准包括但不限于:得舒饮食法、健康素食饮食法、中国居民膳食指南-膳食宝塔(例如2016版)、地中海饮食法。In an optional implementation of this embodiment, there is a preset first relationship between food types and calories; wherein, the first relationship is used to indicate the relationship between different calorie requirements and the calories that different food types should provide. Correspondence. That is to say, through the first relationship, after the first recommended amount of the target object is obtained through the above-mentioned anthropometric method, the calories that should be provided by different food types can be determined. In a specific application scenario, the first relationship may be a preset diet standard, and then the type of food corresponding to the first recommended amount and the required calories can be obtained, where the diet standard includes but is not limited to: Shu Diet, Healthy Vegetarian Diet, Chinese Resident Dietary Guidelines-Diet Pagoda (for example, 2016 edition), Mediterranean diet.
下面以地中海饮食法为例,按200kcal的增量从1000-3200kcal分成11种卡路里类别,分别针对13类食物需要提供的热量值形成如表2所示或表3所示。Taking the Mediterranean diet as an example, according to the 200kcal increment, it is divided into 11 calorie categories from 1000-3200kcal, and the formation of the caloric value required for 13 types of food is shown in Table 2 or Table 3.
由上述表2可知,不同的热量对应的13种食物分别具有对应的热量;如果单位时间为1天,且根据人体测量得到目标对象的第一推荐量为2000kcal,则从可以从表2中确定出卡路里摄入量为2000kcal的情况,需要的13种食物所对应的卡路里含量,如表2的第6列所示:水果需要267.0卡路里、淀粉类蔬菜需要41.7卡路里等等。It can be seen from Table 2 above that the 13 foods corresponding to different calories have corresponding calories; if the unit time is 1 day and the first recommended amount of the target object is 2000kcal according to anthropometric measurements, it can be determined from Table 2. If the calorie intake is 2000kcal, the calorie content corresponding to the 13 foods required is shown in the sixth column of Table 2: Fruits require 267.0 calories, starchy vegetables require 41.7 calories, and so on.
此外,在本实施例的可选实施方式中,营养素和热量之间存在预设的第二关系;其中,该第二关系用于指示不同热量需求与各营养素的推荐摄入量之间的对应关系。在本实施例的可选实施方式中,对于不同的热量推荐量对应的营养素的含量可以如表4所示,当然表4也仅仅是举例说明,对于其他具体形式的第二关系也是在本申请的保护范围之内。In addition, in an optional implementation of this embodiment, there is a preset second relationship between nutrients and calories; wherein, the second relationship is used to indicate the correspondence between different caloric requirements and the recommended intake of each nutrient relationship. In an alternative implementation of this embodiment, the nutrient content corresponding to different recommended amounts of calories can be shown in Table 4. Of course, Table 4 is only an example. The second relationship for other specific forms is also in this application. Within the scope of protection.
可选地,本实施例的装置还可以包括:第五获取模块,设置为获取食物种类;其中,食物种类的数量为N,N为正整数。Optionally, the device of this embodiment may further include: a fifth acquisition module configured to acquire food types; wherein the number of food types is N, and N is a positive integer.
需要说明的是,对于第一获取单元获取到的食物种类N可以是指现有的所有食物种类,也可以是所有食物种类中的一部分,例如表2中的13类食物。也就是说,可以根据实际情况来获取该食物种类。It should be noted that the food type N obtained by the first obtaining unit may refer to all existing food types, or may be a part of all food types, such as the 13 food types in Table 2. In other words, the food category can be obtained according to the actual situation.
可选地,本实施例中涉及到的第三获取模块44包括:第三确定单元,设置为根据食物种类和第一推荐量初步确定出第一食物组合;第四确定单元,设置为在第一推荐量不变的情况下,通过启发式搜索的方式或随机搜索的方式对第一食物组合中食物及对应的食物量进行调整,以确定出与第二推荐量匹配的目标食物组合;其中,所需的营养素有多种;所需的营养素的第二推荐量包括与所需的不同营养素分别对应的第三推荐量。Optionally, the third acquiring
而对于第三确定单元确定的第一食物组合,以上述表2为例,如果食物种类是13种,而确定的第一推荐量为2000kcal/day,则初步确定出的第一食物组合中各类食物应提供的热量为:水果267.0kcal;淀粉类蔬菜41.7kcal;其他蔬菜41.2kcal;红橙紫蔬菜10.0kcal;深绿蔬菜25.7kcal;豆类和豌豆;151.9kcal;全谷物99.4kcal;精致谷物276.2kcal;肉蛋269.9kcal;海鲜116.8kcal;坚果种子大豆67.6kcal;食用油264.8kcal;乳制品167.8kcal。进一步结合各具体食物的能量密度,在一具体实施例中,可随机得出第一食物组合,具体如表5所示。上述是第一推荐量为2000kcal/day的情况下,随机出的第一食物组合,而在第一推荐量为其他取值时,在具体应用场景中可以根据上述表2确定其他初步的第一食物组合。For the first food combination determined by the third determining unit, taking Table 2 above as an example, if there are 13 types of food and the determined first recommended amount is 2000kcal/day, each of the first food combinations determined preliminarily The calories that should be provided by such foods are: fruits 267.0kcal; starchy vegetables 41.7kcal; other vegetables 41.2kcal; red orange and purple vegetables 10.0kcal; dark green vegetables 25.7kcal; beans and peas; 151.9kcal; whole grains 99.4kcal; refined Cereals 276.2kcal; meat and eggs 269.9kcal; seafood 116.8kcal; nut seed soybeans 67.6kcal; edible oil 264.8kcal; dairy products 167.8kcal. Further combining the energy density of each specific food, in a specific embodiment, the first food combination can be randomly obtained, as shown in Table 5. The above is the first food combination randomly selected when the first recommended amount is 2000kcal/day, and when the first recommended amount is other values, other preliminary first food combinations can be determined according to Table 2 above in specific application scenarios. Food combination.
需要说明的是,本实施例中所需的营养素有多种;所需的营养素的第 二推荐量包括与所需的不同营养素分别对应的第三推荐量。也就是说,本实施例中涉及到的第二推荐量是包括了各个具体营养素所对应的第三推荐量的,在具体应用场景中结合上述表2和表4可知,在第一推荐量为2000kcal/day的情况下,该第二推荐量包括了各个具体营养素的第三推荐量,例如,蛋白质为89g;碳水化合物为259g;纤维类食物为31g等等。It should be noted that there are many kinds of nutrients required in this embodiment; the second recommended amount of required nutrients includes the third recommended amount corresponding to different required nutrients. That is to say, the second recommended amount involved in this embodiment includes the third recommended amount corresponding to each specific nutrient. In a specific application scenario, combining Table 2 and Table 4 above, it can be seen that the first recommended amount is In the case of 2000kcal/day, the second recommended amount includes the third recommended amount of each specific nutrient, for example, protein is 89g; carbohydrate is 259g; fiber food is 31g and so on.
所述随机搜索方法简单,易于执行;所述启发式搜索的方法相对随机搜索的方案,在食物种类、营养素数量、各食物种类下具体食物较多的情况下,可大大提高确定出所述目标食物组合的效率。The random search method is simple and easy to implement; the heuristic search method is relatively random search scheme, in the case of food types, nutrient quantities, and specific foods under each food type, it can greatly improve the determination of the target The efficiency of food combinations.
在本实施例的可选实施方式,本实施例中涉及到的第四确定单元包括:In an optional implementation manner of this embodiment, the fourth determining unit involved in this embodiment includes:
第二替换子单元,设置为执行步骤A,调整步骤:分别用食物信息集合中与第一食物组合中的第一食物属于同一食物种类的具体食物替换第一食物组合中的第一食物,并调整每次替换上去的食物的量,并得到每一次调整后食物组合的分值;其中,调整后的食物组合的分值是根据每次调整后的食物组合中的营养素含量与第二推荐量的比较结果得到的。The second replacement subunit is configured to perform step A. The adjustment step: replace the first food in the first food combination with specific foods in the food information set that belong to the same food category as the first food in the first food combination, and Adjust the amount of food to be replaced each time, and get the score of each adjusted food combination; among them, the score of the adjusted food combination is based on the nutrient content of the adjusted food combination and the second recommended amount The comparison result is obtained.
其中,在具体应用场景中,以上述地中海饮食为例,则本实施例第一食物组合中食物的种类有13种,在第一次调整过程中选择其中一种食物种类作为调整对象,例如选择的食物种类为13种中的水果,而该水果种类中的食物包括一种或多种具体的水果(如葡萄、香蕉、苹果、梨子等),也就是说,首先只对第一食物组合中属于水果类的食物进行调整,除水果类的其他种类的食物不对其进行替换。具体的替换方式为:从食物信息集合中以随机或按一定顺序的形式,以具体的水果去替换该第一食物组合中的水果,如用荔枝去替换第一食物组合中的葡萄,同时结合原第一食物组合中的水果所需提供的热量,以及荔枝的能量密度,确定替换后的第一食物组合中荔枝的量,或用西瓜去替换第一食物组合中的香蕉,同时结合原第一食物组合中的水果所需提供的热量,以及西瓜的能量密度,确定替换后的第一食物组合中西瓜的量等等。Among them, in a specific application scenario, taking the above-mentioned Mediterranean diet as an example, there are 13 types of food in the first food combination of this embodiment. In the first adjustment process, one of the food types is selected as the adjustment object, for example, select The food category of is 13 kinds of fruits, and the food in this fruit category includes one or more specific fruits (such as grapes, bananas, apples, pears, etc.), that is to say, only the first food combination Foods that belong to the fruit category are adjusted, and other types of foods except fruits are not replaced. The specific replacement method is as follows: randomly or in a certain order from the food information set, replace the fruits in the first food combination with specific fruits, such as replacing the grapes in the first food combination with lychees, and combine them simultaneously To determine the amount of lychees in the first food combination after the replacement, or to replace the bananas in the first food combination with watermelon, and combine the original food The calories required by the fruit in a food combination, the energy density of the watermelon, the amount of watermelon in the first food combination after replacement, and so on are determined.
此外,需要说明的是,调整后的食物组合的分值是根据每次调整后营 养素含量与第二推荐量的比较结果得到的是指:将每一次调整后的各个营养素的含量分别对应的第三推荐量进行比较得到各个营养素的分值,综合各个营养素的分值得到调整后的食物组合的分值。In addition, it should be noted that the score of the adjusted food combination is obtained based on the comparison between the nutrient content after each adjustment and the second recommended amount. This means that the content of each nutrient after each adjustment is corresponding to the first recommended amount. Three recommended amounts are compared to obtain the score of each nutrient, and the score of each nutrient is synthesized to obtain the adjusted food combination score.
其中,需要说明的是,本实施例中的第三推荐量可以是一个范围值,也可以是一个固定的点值;但是,在本实施例中优选为范围值;每一个营养素都具有对应的第三推荐量;基于此,将每一次替换后的各个营养素的含量分别与对应的第三推荐量进行比较得到各个营养素的分值的方式有多种,如方式(1)确定每一次替换后的各个营养素的含量是否分别落入对应的第三推荐量所表示的取值范围内,落入取值范围的营养素得到相应的分值,没有落入该取值范围的即为零分。方式(2)确定每一次替换后的食物组合的各个营养素的含量是否分别落入对应的第三推荐量所表示的取值范围内,落入取值范围的营养素得到相应的分值,进而计算没有落入该取值范围的营养素含量与对应的第三推荐量之间的比值,根据比值得到相应的分值。需要说明的是,上述方式仅仅是举例说明将每一次调整后的各个营养素的含量分别对应的第三推荐量进行比较得到各个营养素的分值的方式,对于其他的根据比较得到分值的方式也是在本申请的保护范围之内的。Among them, it should be noted that the third recommended amount in this embodiment can be a range value or a fixed point value; however, in this embodiment, it is preferably a range value; each nutrient has a corresponding The third recommended amount; based on this, there are many ways to obtain the score of each nutrient by comparing the content of each nutrient after each replacement with the corresponding third recommended amount, such as method (1) Determine after each replacement Whether the content of each nutrient falls within the value range indicated by the corresponding third recommended amount, the nutrient falling within the value range gets the corresponding score, and the nutrient that does not fall within the value range is zero. Method (2) Determine whether the content of each nutrient of the food combination after each replacement falls within the value range indicated by the corresponding third recommended amount, and the nutrients falling into the value range get the corresponding score, and then calculate The ratio between the nutrient content that does not fall into the value range and the corresponding third recommended amount, and the corresponding score is obtained according to the ratio. It should be noted that the above method is only an example to illustrate the method of comparing the third recommended amount of each nutrient content after each adjustment to obtain the score of each nutrient. The same is true for other methods of obtaining scores based on comparison. Within the protection scope of this application.
以方式(1)为例,如果本实施例中涉及到的营养素有36个,调整后的营养素落入第三推荐量所表示的取值范围计1分(当然也可以是其他计分制)的营养素有20个,没有落入的计0分的营养素有16,因此统计调整后得分的营养素的分值的和作为该食物组合的分值,即该食物组合的分值为20分。Taking method (1) as an example, if there are 36 nutrients involved in this example, the adjusted nutrients fall within the value range indicated by the third recommended amount and count 1 point (of course, other scoring systems can also be used) There are 20 nutrients for food, and the nutrients that do not fall into 0 points are 16. Therefore, the sum of the scores of the nutrients after the statistical adjustment is used as the score of the food combination, that is, the score of the food combination is 20 points.
第二处理子单元,设置为执行步骤B,随机步骤::将前一步骤A中的所有食物组合的分值依次排列,并按排列顺序对各食物组合分别给予对应的索引,对前一步骤A中的所有食物组合的分值进行求和计算得到总数,以得到的总数为随机范围,在该随机范围内随机出一个随机数值,以所述随机数值所对应的索引对应的食物组合作为调整后的食物组合。The second processing sub-unit is set to perform step B. Random step: arrange the scores of all food combinations in the previous step A in order, and give corresponding indexes to each food combination in the order of arrangement, and compare the previous step The scores of all food combinations in A are summed to calculate the total, and the total obtained is a random range, a random value is randomly selected within the random range, and the food combination corresponding to the index corresponding to the random value is used as an adjustment After the food mix.
需要说明的是,所述依次排列优选为按替换顺序先后排列,或按分值高低排列,或随机排列等等;所述前一步骤A中的所有食物组合,是指在所述步骤B之前最近的一次的步骤A中出现的所有食物组合,或者在所述步骤B之前最近的一次的步骤A中出现的除第一食物组合之外的所有食物组合;优选为在所述步骤B之前最近的一次的步骤A中出现的所有食物组合,本优选方案可进一步提高获得目标食物组合的效率。It should be noted that the sequential arrangement is preferably arranged in the order of replacement, or arranged according to the score value, or arranged randomly, etc.; all the food combinations in the previous step A refer to before the step B All the food combinations that occurred in the most recent step A, or all the food combinations that occurred in the most recent step A before the step B, except for the first food combination; preferably, the most recent food combination before the step B For all the food combinations that appeared in step A at one time, this preferred solution can further improve the efficiency of obtaining the target food combination.
其中,所述步骤B优选为:将前一步骤A中的所有食物组合的分值进行归一化处理,并将归一化处理后的结果依次排列,并按排列顺序对各个食物组合分别给予对应的索引,对当次步骤B中所有归一化处理后的结果进行求和计算得到总数,以得到的总数为随机范围,在该随机范围内随机出一个随机数值,以所述随机数值所对应的索引对应的食物组合作为调整后的食物组。需要说明的是,所述归一化的方式有多种,包括但不限于按总和为一确定数归一化,或按最大数为一确定数进行归一化等等。Wherein, the step B is preferably: normalize the scores of all food combinations in the previous step A, and arrange the normalized results in sequence, and give each food combination in the order of arrangement. The corresponding index is calculated by summing all the normalized results in the current step B to obtain the total number. The total number obtained is the random range, and a random value is randomly selected within the random range. The random value is determined by the random value. The food combination corresponding to the corresponding index is used as the adjusted food group. It should be noted that there are many ways of normalization, including but not limited to normalization according to the sum as a certain number, or normalization according to the maximum number as a certain number, and so on.
更进一步的,将步骤B,随机步骤中的各食物组合的分值分别按如下优选方法处理后再执行相应步骤:Furthermore, in step B, the scores of each food combination in the random step are processed according to the following preferred methods, and then the corresponding steps are executed:
以自然对数的底数e作为底数,以及各食物组合的分值与预设值的乘积结果为指数,得到各初步处理后的食物组合的分值;Using the base e of the natural logarithm as the base, and the product of the score of each food combination and the preset value as the index, the score of each food combination after preliminary processing is obtained;
所述步骤B具体为:The step B is specifically:
将前一步骤A中的所有食物组合的分值进行归一化处理,并将归一化处理后的结果依次排列,并按排列顺序对前一步骤A中的各食物组合分别给予对应的索引,对当次步骤B中的所有归一化处理后的结果进行求和计算得到总数,以得到的总数为随机范围,在该随机范围内随机出一个随机数值,以所述随机数值所对应的索引对应的食物组合作为调整后的食物组。Normalize the scores of all food combinations in the previous step A, and arrange the normalized results in order, and give the corresponding indexes to each food combination in the previous step A in the order of arrangement , The sum of all normalized results in step B of the current time is calculated to obtain the total, and the total obtained is the random range, and a random value is randomly selected within the random range, and the random value corresponding to the random value is The food combination corresponding to the index is used as the adjusted food group.
在具体的应用场景中,对于归一化处理的方式可以是:所有食物替换后得到的计算结果之和归一化为1,每次食物替换后根据其索引值,并按照调整食物的顺序从0至1之间依次排序;进而在0-1之间随机一个数R,以R所在索引值对应的食物组合确定为调整后的食物组合。In a specific application scenario, the normalization process can be: the sum of the calculation results obtained after all food replacements is normalized to 1, and each time the food is replaced according to its index value, and the order of the food is adjusted from Sort in order from 0 to 1; and then a random number R between 0-1, and the food combination corresponding to the index value of R is determined as the adjusted food combination.
第三执行子单元,设置为执行步骤C,第一循环步骤:以前一次步骤B所得的调整后的食物组合作为后一次步骤A的第一食物组合,以及更换在再次执行步骤A的过程中进行替换的第一食物所属的食物种类为原则,重复执行步骤A至步骤B,直至第一食物组合中的N种食物均执行过步骤A至步骤B的调整。The third execution subunit is set to execute step C. The first cycle step: the adjusted food combination obtained in step B in the previous step is used as the first food combination in step A in the next step, and the replacement is performed in the process of executing step A again The food type to which the first food to be replaced belongs is a principle, and Step A to Step B are repeated until the N foods in the first food combination have all been adjusted from Step A to Step B.
也就是说,在对固定的一指定种类食物调整完后,将该调整后的食物组合作为下一次调整的对象,继续对第一食物组合中的其他种类的食物分别进行调整,直到所有N种类均被调整。例如,在水果类的食物均被替换后,则需要对第一食物组合中的其他类食物进行调整,如海鲜类食物,该替换的方式和替换水果的方式是一致的,如果海鲜类食物有多种(鱼、虾、花蛤、扇贝等),则也是依次对具体海鲜类食物进行替换,得到调整后的食物组合,直到该第一食物组合中的所有种类的食物均被替换过。In other words, after adjusting a fixed specified type of food, use the adjusted food combination as the object of the next adjustment, and continue to adjust the other types of food in the first food combination until all N types are adjusted. Have been adjusted. For example, after all fruit foods are replaced, it is necessary to adjust other foods in the first food combination, such as seafood foods. The replacement method is the same as the fruit replacement method. For multiple types (fish, shrimp, clams, scallops, etc.), specific seafood foods are sequentially replaced to obtain an adjusted food combination until all types of foods in the first food combination have been replaced.
第四执行子单元,设置为执行步骤D,第二循环步骤:重复执行上述步骤A至步骤C,直到得到满足预设条件的目标食物组合。The fourth execution subunit is set to execute step D, and the second loop step: repeat the above steps A to C until a target food combination that meets the preset conditions is obtained.
优选的,预设条件包括以下至少之一:重复执行步骤A至步骤C的次数达到预设次数;或,在重复执行步骤A至步骤B,或重复执行步骤A至C过程中,出现X个调整后的第一食物组合,且X个调整后的第一食物组合各自所含有的第一顺位营养素的量均落入第二推荐量所指示的范围;或,在重复执行步骤A至步骤B,或重复执行步骤A至C过程中,出现Y个调整后的第一食物组合,且Y个调整后的第一食物组合的分值均落入第一预设范围。Preferably, the preset condition includes at least one of the following: the number of repeated executions of step A to step C reaches a preset number of times; or, during the repeated execution of step A to step B, or the repeated execution of steps A to C, X The adjusted first food combination, and the amount of the first sequence nutrient contained in each of the X adjusted first food combinations falls within the range indicated by the second recommended amount; or, repeating step A to step B, or in the process of repeating steps A to C, Y adjusted first food combinations appear, and the scores of the Y adjusted first food combinations all fall within the first preset range.
需要说明的是,上述各个模块是可以通过软件或硬件来实现的,对于后者,可以通过以下方式实现,但不限于此:上述模块均位于同一处理器中;或者,上述各个模块以任意组合的形式分别位于不同的处理器中。It should be noted that the above modules can be implemented by software or hardware, and the latter can be implemented by the following methods, but not limited to this: the above modules are all located in the same processor; or, the above modules can be combined in any combination The forms are located in different processors.
实施例5Example 5
本申请的实施例还提供了一种存储介质,该存储介质中存储有计算机程序,其中,该计算机程序被设置为运行时执行上述任一项食物信息的推 送方法实施例中的步骤。The embodiment of the present application also provides a storage medium in which a computer program is stored, wherein the computer program is configured to execute the steps in any one of the foregoing food information pushing method embodiments when running.
可选地,在本实施例中,上述存储介质可以被设置为存储用于执行以下步骤的计算机程序:Optionally, in this embodiment, the above storage medium may be set to store a computer program for performing the following steps:
S1,获取目标对象在单位时间内所需的热量的第一推荐量以及所需的营养素的第二推荐量;S1, obtaining the first recommended amount of calories required by the target object per unit time and the second recommended amount of nutrients required by the target object;
S2,根据预定的食物信息集合确定出与第一推荐量和第二推荐量匹配的目标食物组合;S2: Determine a target food combination matching the first recommended amount and the second recommended amount according to a predetermined food information set;
S3,向目标终端推送目标食物组合。S3, push the target food combination to the target terminal.
可选地,在本实施例中,上述存储介质可以包括但不限于:U盘、只读存储器(Read-Only Memory,简称为ROM)、随机存取存储器(Random Access Memory,简称为RAM)、移动硬盘、磁碟或者光盘等各种可以存储计算机程序的介质。Optionally, in this embodiment, the above storage medium may include, but is not limited to: a USB flash drive, a read-only memory (Read-Only Memory, ROM for short), a random access memory (Random Access Memory, RAM for short), Various media that can store computer programs, such as removable hard disks, magnetic disks, or optical disks.
本申请的实施例还提供了一种存储介质,该存储介质中存储有计算机程序,其中,该计算机程序被设置为运行时执行上述任一项食物信息的显示方法实施例中的步骤。The embodiment of the present application also provides a storage medium in which a computer program is stored, wherein the computer program is configured to execute the steps in any one of the foregoing food information display method embodiments when running.
可选地,在本实施例中,上述存储介质可以被设置为存储用于执行以下步骤的计算机程序:Optionally, in this embodiment, the above storage medium may be set to store a computer program for performing the following steps:
S1,获取目标对象在单位时间内所需的热量的第一推荐量以及所需的营养素的第二推荐量;S1, obtaining the first recommended amount of calories required by the target object per unit time and the second recommended amount of nutrients required by the target object;
S2,获取在食物信息集合确定出的与第一推荐量和第二推荐量匹配的目标食物组合;S2: Obtain a target food combination that matches the first recommended amount and the second recommended amount determined in the food information collection;
S3,向目标终端显示目标食物组合。S3: Display the target food combination to the target terminal.
可选地,在本实施例中,上述存储介质可以包括但不限于:U盘、只读存储器(Read-Only Memory,简称为ROM)、随机存取存储器(Random Access Memory,简称为RAM)、移动硬盘、磁碟或者光盘等各种可以存储计算机程序的介质。Optionally, in this embodiment, the above storage medium may include, but is not limited to: a USB flash drive, a read-only memory (Read-Only Memory, ROM for short), a random access memory (Random Access Memory, RAM for short), Various media that can store computer programs, such as removable hard disks, magnetic disks, or optical disks.
可选地,本实施例中的具体示例可以参考上述实施例及可选实施方式中所描述的示例,本实施例在此不再赘述。Optionally, for specific examples in this embodiment, reference may be made to the examples described in the foregoing embodiments and optional implementation manners, and details are not repeated in this embodiment.
显然,本领域的技术人员应该明白,上述的本申请的各模块或各步骤可以用通用的计算装置来实现,它们可以集中在单个的计算装置上,或者分布在多个计算装置所组成的网络上,可选地,它们可以用计算装置可执行的程序代码来实现,从而,可以将它们存储在存储装置中由计算装置来执行,并且在某些情况下,可以以不同于此处的顺序执行所示出或描述的步骤,或者将它们分别制作成各个集成电路模块,或者将它们中的多个模块或步骤制作成单个集成电路模块来实现。这样,本申请不限制于任何特定的硬件和软件结合。Obviously, those skilled in the art should understand that the above-mentioned modules or steps of this application can be implemented by a general-purpose computing device, and they can be concentrated on a single computing device or distributed in a network composed of multiple computing devices Above, optionally, they can be implemented with program code executable by the computing device, so that they can be stored in the storage device to be executed by the computing device, and in some cases, can be in a different order than here The steps shown or described are performed, or they are made into individual integrated circuit modules respectively, or multiple modules or steps among them are made into a single integrated circuit module for implementation. In this way, the application is not limited to any specific combination of hardware and software.
以上所述仅为本申请的优选实施例而已,并不用于限制本申请,对于本领域的技术人员来说,本申请可以有各种更改和变化。凡在本申请的原则之内,所作的任何修改、等同替换、改进等,均应包含在本申请的保护范围之内。The above are only the preferred embodiments of the present application, and are not used to limit the present application. For those skilled in the art, the present application may have various modifications and changes. Any modifications, equivalent replacements, improvements, etc. made within the principles of this application shall be included in the scope of protection of this application.
通过本申请,获取目标对象在单位时间内所需的热量的第一推荐量以及所需的营养素的第二推荐量,进而根据预定的食物信息集合确定出与第一推荐量和第二推荐量匹配的目标食物组合,并向目标终端推送目标食物组合,也就是说,该推送的目标食物组合是根据热量的第一推荐量和营养素的第二推荐量得到的,从而能够为目标对象推送更加合理的食物组合,而不是根据个人喜好选择相应的食物,从而解决了相关技术中未能同时兼顾热量和营养素的摄入考虑进行食物搭配的问题,达到了使用户饮食更加合理的效果。Through this application, the first recommended amount of calories required by the target object per unit time and the second recommended amount of nutrients needed are obtained, and then the first recommended amount and the second recommended amount are determined according to the predetermined food information set Match the target food combination, and push the target food combination to the target terminal, that is, the pushed target food combination is obtained according to the first recommended amount of calories and the second recommended amount of nutrients, so that it can push more for the target object Reasonable food combination, rather than choosing the corresponding food according to personal preference, solves the problem that related technologies fail to take into account the intake of calories and nutrients at the same time to consider food matching, and achieves the effect of making the user's diet more reasonable.
Claims (15)
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201910036620.3 | 2019-01-15 | ||
| CN201910036620.3A CN111161837B (en) | 2019-01-15 | 2019-01-15 | Food information pushing method and device and storage medium |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2020147558A1 true WO2020147558A1 (en) | 2020-07-23 |
Family
ID=70555614
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2019/129427 Ceased WO2020147558A1 (en) | 2019-01-15 | 2019-12-27 | Method and device for pushing food information, and storage medium |
Country Status (2)
| Country | Link |
|---|---|
| CN (1) | CN111161837B (en) |
| WO (1) | WO2020147558A1 (en) |
Families Citing this family (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN111883230B (en) * | 2019-12-18 | 2024-05-07 | 深圳数字生命研究院 | Method and device for generating dietary data, storage medium and electronic device |
| CN114036335A (en) * | 2021-11-11 | 2022-02-11 | 深圳市乐福衡器有限公司 | Food quality grade judging method and system, intelligent terminal and storage medium |
Citations (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20120083669A1 (en) * | 2010-10-04 | 2012-04-05 | Abujbara Nabil M | Personal Nutrition and Wellness Advisor |
| US20150279235A1 (en) * | 2014-03-31 | 2015-10-01 | Seiko Epson Corporation | Nutrition management system and nutrition management program |
| CN105528509A (en) * | 2014-09-29 | 2016-04-27 | 西安乐食智能餐具有限公司 | Method, apparatus and system for managing health plans |
| CN105718712A (en) * | 2015-04-27 | 2016-06-29 | 美的集团股份有限公司 | Nutritious recipe generation method and device |
| CN106382788A (en) * | 2016-08-29 | 2017-02-08 | 合肥美菱股份有限公司 | Refrigerator healthy diet recommendation method |
| CN108091383A (en) * | 2018-02-05 | 2018-05-29 | 深圳市是源医学科技有限公司 | Maternal weight gain data managing method, system, computer equipment and storage medium |
Family Cites Families (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN1967550A (en) * | 2006-11-22 | 2007-05-23 | 中国疾病预防控制中心营养与食品安全所 | Portable apparatus for inquiring, calculating and estimating nutrition and method therefor |
| CN106203725A (en) * | 2016-07-20 | 2016-12-07 | 上海交通大学 | Door-to-door trip route scheme personalized recommendation method based on heuristic search |
| CN107833617A (en) * | 2017-11-28 | 2018-03-23 | 威海海洋职业学院 | A kind of university student nutritious recipe preparation method on the one |
| CN108877896B (en) * | 2018-06-01 | 2022-02-22 | 四川黑石曼吉健康科技有限公司 | Artificial intelligence generated weight management method |
-
2019
- 2019-01-15 CN CN201910036620.3A patent/CN111161837B/en active Active
- 2019-12-27 WO PCT/CN2019/129427 patent/WO2020147558A1/en not_active Ceased
Patent Citations (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20120083669A1 (en) * | 2010-10-04 | 2012-04-05 | Abujbara Nabil M | Personal Nutrition and Wellness Advisor |
| US20150279235A1 (en) * | 2014-03-31 | 2015-10-01 | Seiko Epson Corporation | Nutrition management system and nutrition management program |
| CN105528509A (en) * | 2014-09-29 | 2016-04-27 | 西安乐食智能餐具有限公司 | Method, apparatus and system for managing health plans |
| CN105718712A (en) * | 2015-04-27 | 2016-06-29 | 美的集团股份有限公司 | Nutritious recipe generation method and device |
| CN106382788A (en) * | 2016-08-29 | 2017-02-08 | 合肥美菱股份有限公司 | Refrigerator healthy diet recommendation method |
| CN108091383A (en) * | 2018-02-05 | 2018-05-29 | 深圳市是源医学科技有限公司 | Maternal weight gain data managing method, system, computer equipment and storage medium |
Also Published As
| Publication number | Publication date |
|---|---|
| CN111161837A (en) | 2020-05-15 |
| CN111161837B (en) | 2023-06-20 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| Broekema et al. | Future-proof and sustainable healthy diets based on current eating patterns in the Netherlands | |
| Dyett et al. | Vegan lifestyle behaviors. An exploration of congruence with health-related beliefs and assessed health indices | |
| Ba et al. | Higher mushroom consumption is associated with lower risk of cancer: a systematic review and meta-analysis of observational studies | |
| Bogard et al. | Inclusion of small indigenous fish improves nutritional quality during the first 1000 days | |
| Luo et al. | Nut consumption and risk of type 2 diabetes, cardiovascular disease, and all-cause mortality: a systematic review and meta-analysis | |
| Chiu et al. | Does eating particular diets alter the risk of age-related macular degeneration in users of the Age-Related Eye Disease Study supplements? | |
| Vieux et al. | High nutritional quality is not associated with low greenhouse gas emissions in self-selected diets of French adults | |
| Keast et al. | Dried fruit consumption is associated with improved diet quality and reduced obesity in US adults: National Health and Nutrition Examination Survey, 1999-2004 | |
| Zinn et al. | Assessing the nutrient intake of a low-carbohydrate, high-fat (LCHF) diet: a hypothetical case study design | |
| Sousa et al. | Nutritional supplements use in high-performance athletes is related with lower nutritional inadequacy from food | |
| CN112820378B (en) | Nutritional catering recommendation method and system based on diet behavior | |
| JP2015531116A (en) | System and method for proposing food products | |
| WO2020147558A1 (en) | Method and device for pushing food information, and storage medium | |
| Von Goh et al. | Understanding the patterns of fish and seafood consumption and its nutritional roles among a Malaysian population to inform sustainable development | |
| Craddock et al. | Examining dietary behaviours, diet quality, motives and supplementation use in physically active individuals following vegetarian‐based eating patterns | |
| Rossato et al. | Intakes of unprocessed and minimally processed and ultraprocessed food are associated with diet quality in female and male health professionals in the United States: a prospective analysis | |
| Keenan et al. | Dietary nutrient intake and cognitive function in the Age‐Related Eye Disease Studies 1 and 2 | |
| Mishra et al. | Estimates of functional food and nutraceutical availability in the world, with reference to food peroxidation and food safety | |
| Holt et al. | Mediterranean diet and emotion regulation | |
| Papanikolaou et al. | Adding more beans to the US typical dietary pattern can lead to greater intake of shortfall nutrients and a higher diet quality in younger and older adults | |
| O’Keefe et al. | Evidence, not evangelism, for dietary recommendations | |
| Karimdavijani et al. | Association between the Quality and Diversity of Diet and the Risk of Colorectal Cancer | |
| Beals et al. | Recent recommendations and current controversies in sport nutrition | |
| CN112071397B (en) | Diet quality assessment method, terminal device and computer readable storage medium | |
| Chew | Does diet play a role in glaucoma? |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| 121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 19910851 Country of ref document: EP Kind code of ref document: A1 |
|
| NENP | Non-entry into the national phase |
Ref country code: DE |
|
| 32PN | Ep: public notification in the ep bulletin as address of the adressee cannot be established |
Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 03/12/2021) |
|
| 122 | Ep: pct application non-entry in european phase |
Ref document number: 19910851 Country of ref document: EP Kind code of ref document: A1 |